diff --git a/.envrc b/.envrc new file mode 100644 index 000000000..a5dbbcba7 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake . diff --git a/.github/ISSUE_TEMPLATE/0-feature.md b/.github/ISSUE_TEMPLATE/0-feature.md index 46baf8b57..078d07500 100644 --- a/.github/ISSUE_TEMPLATE/0-feature.md +++ b/.github/ISSUE_TEMPLATE/0-feature.md @@ -3,7 +3,7 @@ name: "✨ New Feature" about: Suggest an idea title: "✨ " labels: enhancement -assignees: "karthik1729" +assignees: "nxtcoder17" projects: Kloudlite --- diff --git a/.github/ISSUE_TEMPLATE/1-bug.md b/.github/ISSUE_TEMPLATE/1-bug.md index 3c4153f1d..40c926c25 100644 --- a/.github/ISSUE_TEMPLATE/1-bug.md +++ b/.github/ISSUE_TEMPLATE/1-bug.md @@ -3,7 +3,7 @@ name: "🐛 Bug Report" about: Create a bug report to help us improve title: "🐛 " labels: bug -assignees: karthik1729 +assignees: nxtcoder17 projects: kloudlite --- @@ -11,8 +11,7 @@ projects: kloudlite ### Describe the Bug ... -### To Reproduce -Steps to reproduce the behavior: +### How To Reproduce 1. ... 2. ... diff --git a/.github/workflows/auth.yml b/.github/workflows/auth.yml deleted file mode 100644 index fbb485aab..000000000 --- a/.github/workflows/auth.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: auth - -on: - workflow_dispatch: - push: - branches: - - 'feature/**' - - 'issue/**' - - 'bug/**' - - develop - - paths: - - "apps/auth/**" - - "pkg/**" - - "grpc-interfaces/**" - - "common/**" - - ".github/workflows/auth.yml" - - "go.*" - -jobs: - docker: - runs-on: ubuntu-latest - name: Deploy to Docker Image - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Set Docker tag - id: tag - uses: cytopia/docker-tag-action@v0.4.7 - with: - latest_git_branch: master - latest_docker_tag_name: ${{ secrets.CURRENT_VERSION }} - non_latest_docker_tag_prefix: "${{ secrets.CURRENT_VERSION }}-" - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ${{ secrets.DOCKER_REGISTRY }} - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build and Push - env: - TAG: v2 - REGISTRY: ${{ secrets.DOCKER_REGISTRY }} - APP: auth - GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} - - run: docker buildx build -f ./apps/${APP}/Dockerfile -t ${REGISTRY}/kloudlite/${APP}:${{ steps.tag.outputs.docker-tag }} ./apps/${APP} --push --build-arg APP=${APP} --build-arg GH_ACCESS_TOKEN=${GH_ACCESS_TOKEN} --build-context project-root=. - diff --git a/.github/workflows/build-container.yml b/.github/workflows/build-container.yml new file mode 100644 index 000000000..f0bd62ce5 --- /dev/null +++ b/.github/workflows/build-container.yml @@ -0,0 +1,131 @@ +name: build-docker-images + +on: + workflow_dispatch: + + repository_dispatch: + types: + - webhook + + push: + paths: + - "apps/**/**" + - "pkg/**" + - "grpc-interfaces/**" + - "common/**" + - "go.*" + - ".github/workflows/**" + + +permissions: + contents: read + packages: write + +jobs: + docker-builds: + strategy: + matrix: + app: + - accounts + - auth + - comms + - console + - container-registry + - iam + - infra + - worker-audit-logging + - webhook + - websocket-server + - message-office + - tenant-agent + runs-on: ubuntu-latest + name: Deploy to Docker Image + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Setup Golang caches + uses: actions/cache@v3 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-golang- + + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: 1.21.5 + + - name: Install Task + uses: arduino/setup-task@v1 + with: + version: 3.x + repo-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Install UPX + run: | + curl -L0 https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-amd64_linux.tar.xz > upx.tar.xz + tar -xf upx.tar.xz + sudo mv upx-4.2.1-amd64_linux/upx /usr/local/bin + + - name: Build Binary + run: | + cd apps/${{matrix.app}} + task build Out=$PWD/../../.github/workflows/container-build/app + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create Image Tag from branch name + if: startsWith(github.ref, 'refs/heads/release') + run: | + set +e + IMAGE_TAG=$(echo ${GITHUB_REF#refs/heads/} | sed 's/release-//g') + echo "$IMAGE_TAG" | grep -i '\-nightly$' + if [ $? -ne 0 ]; then + IMAGE_TAG="$IMAGE_TAG-nightly" + fi + set -e + + echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV + echo "OVERRIDE_PUSHED_IMAGE=true" >> $GITHUB_ENV + + - name: Create Image Tag from tag + if: startsWith(github.ref, 'refs/tags/') + run: | + IMAGE_TAG=$(echo ${GITHUB_REF#refs/tags/}) + + echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV + echo "OVERRIDE_PUSHED_IMAGE=false" >> $GITHUB_ENV + + - name: Build & Push Image + if: startsWith(github.ref, 'refs/heads/release') || startsWith(github.ref, 'refs/tags/') + run: | + set +e + image_name="ghcr.io/${{ github.repository }}/${{matrix.app}}" + + docker manifest inspect $image_name:$IMAGE_TAG + exit_status=$? + if [ $exit_status -eq 0 ]; then + [ "$OVERRIDE_PUSHED_IMAGE" = "false" ] && echo "image ($image_name:$IMAGE_TAG) already exists, and override image is disable, exiting" && exit 0 + echo "image exists, but override pushed image is set to true. proceeding with building image" + fi + + set -e + + cd .github/workflows/container-build + task go-container-build Image="$image_name:$IMAGE_TAG" + # task go-container-build Image="$image_name:commit-${GITHUB_SHA}" diff --git a/.github/workflows/container-build/Containerfile.local b/.github/workflows/container-build/Containerfile.local new file mode 100644 index 000000000..6cc1cc9d1 --- /dev/null +++ b/.github/workflows/container-build/Containerfile.local @@ -0,0 +1,7 @@ +#syntax=docker/dockerfile:1 +FROM gcr.io/distroless/static-debian11:nonroot +LABEL org.opencontainers.image.source https://github.com/kloudlite/api +WORKDIR /app +COPY --chown=1001 ./app ./app +CMD ["./app"] +ENTRYPOINT ["./app"] \ No newline at end of file diff --git a/.github/workflows/container-build/Taskfile.yaml b/.github/workflows/container-build/Taskfile.yaml new file mode 100644 index 000000000..acd9988ae --- /dev/null +++ b/.github/workflows/container-build/Taskfile.yaml @@ -0,0 +1,11 @@ +version: 3 + +tasks: + go-container-build: + preconditions: + - sh: '[[ -n "{{.Image}}" ]]' + msg: 'var Image must have a value' + silent: true + cmds: + - | + docker buildx build -f ./Containerfile.local -t {{.Image}} . --push diff --git a/.github/workflows/finance.yml b/.github/workflows/finance.yml deleted file mode 100644 index 996631730..000000000 --- a/.github/workflows/finance.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: finance - -on: - workflow_dispatch: - push: - branches: - - 'feature/**' - - 'issue/**' - - 'bug/**' - - develop - - paths: - - "apps/finance/**" - - "pkg/**" - - "grpc-interfaces/**" - - "common/**" - - ".github/workflows/finance.yml" - - "go.*" - -jobs: - docker: - runs-on: ubuntu-latest - name: Deploy to Docker Image - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Set Docker tag - id: tag - uses: cytopia/docker-tag-action@v0.4.7 - with: - latest_git_branch: master - latest_docker_tag_name: ${{ secrets.CURRENT_VERSION }} - non_latest_docker_tag_prefix: "${{ secrets.CURRENT_VERSION }}-" - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ${{ secrets.DOCKER_REGISTRY }} - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build and Push - env: - TAG: v2 - REGISTRY: ${{ secrets.DOCKER_REGISTRY }} - APP: auth - GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} - - run: docker buildx build -f ./apps/${APP}/Dockerfile -t ${REGISTRY}/kloudlite/${APP}:${{ steps.tag.outputs.docker-tag }} ./apps/${APP} --push --build-arg APP=${APP} --build-arg GH_ACCESS_TOKEN=${GH_ACCESS_TOKEN} --build-context project-root=. - diff --git a/.github/workflows/gateway-container.yml b/.github/workflows/gateway-container.yml new file mode 100644 index 000000000..44eab07d0 --- /dev/null +++ b/.github/workflows/gateway-container.yml @@ -0,0 +1,75 @@ +name: build-gateway-image + +on: + repository_dispatch: + types: + - webhook + push: + paths: + - "apps/gateway/**" + - ".github/workflows/**" + +permissions: + contents: read + packages: write + +jobs: + container-build: + runs-on: ubuntu-latest + name: Deploy to Docker Image + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create Image Tag from branch name + if: startsWith(github.ref, 'refs/heads/release') + run: | + set +e + IMAGE_TAG=$(echo ${GITHUB_REF#refs/heads/} | sed 's/release-//g') + echo "$IMAGE_TAG" | grep -i '\-nightly$' + if [ $? -ne 0 ]; then + IMAGE_TAG="$IMAGE_TAG-nightly" + fi + set -e + + echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV + echo "OVERRIDE_PUSHED_IMAGE=true" >> $GITHUB_ENV + + - name: Create Image Tag from tag + if: startsWith(github.ref, 'refs/tags/') + run: | + IMAGE_TAG=$(echo ${GITHUB_REF#refs/tags/}) + + echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV + echo "OVERRIDE_PUSHED_IMAGE=false" >> $GITHUB_ENV + + - name: Build & Push Image + if: startsWith(github.ref, 'refs/heads/release') || startsWith(github.ref, 'refs/tags/') + run: | + set +e + + image_name=ghcr.io/${{ github.repository }}/gateway + + docker manifest inspect $image_name:$IMAGE_TAG + exit_status=$? + if [ $exit_status -eq 0 ]; then + [ "$OVERRIDE_PUSHED_IMAGE" = "false" ] && echo "image ($image_name:$IMAGE_TAG) already exists, and override image is disable, exiting" && exit 0 + echo "image exists, but override pushed image is set to true. proceeding with building image" + fi + set -e + + cd apps/gateway + docker buildx build -t "$image_name:$IMAGE_TAG" . --push diff --git a/.github/workflows/scrap/ci.2yml b/.github/workflows/scrap/ci.2yml deleted file mode 100644 index 25f57b495..000000000 --- a/.github/workflows/scrap/ci.2yml +++ /dev/null @@ -1,45 +0,0 @@ -name: ci - -on: - push: - branches: - - '!*' - - '!**' - paths: - - "./apps/ci/**" - - "./pkg/**" - - "./grpc-interfaces/**" - - "./common/**" - - "./.github/workflows/**" - - -jobs: - docker: - runs-on: ubuntu-latest - # if: github.event.head_commit.message == 'build:ci' - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: harbor.dev.madhouselabs.io - username: ${{ secrets.HARBOR_USERNAME }} - password: ${{ secrets.HARBOR_PASSWORD }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build and Push - env: - TAG: v2 - REGISTRY: harbor.dev.madhouselabs.io - APP: ci - - run: | - docker buildx build -f ./apps/${APP}/Dockerfile -t ${REGISTRY}/kloudlite/${APP}:${TAG} ./apps/${APP} --push --build-arg APP=${APP} --build-context project-root=. diff --git a/.github/workflows/scrap/comms.yml b/.github/workflows/scrap/comms.yml deleted file mode 100644 index 8a3628ed4..000000000 --- a/.github/workflows/scrap/comms.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: comms - -on: - push: - branches: - - '!*' - - '!**' - paths: - - "./apps/comms/**" - - "./pkg/**" - - "./grpc-interfaces/**" - - "./common/**" - - "./.github/workflows/**" - - -jobs: - docker: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: harbor.dev.madhouselabs.io - username: ${{ secrets.HARBOR_USERNAME }} - password: ${{ secrets.HARBOR_PASSWORD }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build and Push - env: - TAG: v2 - REGISTRY: harbor.dev.madhouselabs.io - APP: comms - - run: docker buildx build -f ./apps/${APP}/Dockerfile -t ${REGISTRY}/kloudlite/${APP}:${TAG} ./apps/${APP} --push --build-arg APP=${APP} --build-context project-root=. - diff --git a/.github/workflows/scrap/console.yml b/.github/workflows/scrap/console.yml deleted file mode 100644 index 1ff593872..000000000 --- a/.github/workflows/scrap/console.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: console - -on: - push: - branches: - - '!*' - - '!**' - paths: - - "apps/console/**" - - "pkg/**" - - "grpc-interfaces/**" - - "common/**" -jobs: - docker: - runs-on: ubuntu-latest - # if: github.event.head_commit.message == 'build:console' - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: harbor.dev.madhouselabs.io - username: ${{ secrets.HARBOR_USERNAME }} - password: ${{ secrets.HARBOR_PASSWORD }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build and Push - env: - TAG: v2 - REGISTRY: harbor.dev.madhouselabs.io - APP: console - run: docker buildx build -f ./apps/${APP}/Dockerfile -t ${REGISTRY}/kloudlite/${APP}:${TAG} ./apps/${APP} --push --build-arg APP=${APP} --build-context project-root=. && diff --git a/.github/workflows/scrap/dns.yml b/.github/workflows/scrap/dns.yml deleted file mode 100644 index 2e0129da9..000000000 --- a/.github/workflows/scrap/dns.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: dns - -on: - push: - branches: - - '*' # matches every branch that doesn't contain a '/' - - '*/*' # matches every branch containing a single '/' - - '**' # matches every branch - - '!master' # excludes master - paths: - - "./apps/dns/**" - - "./pkg/**" - - "./grpc-interfaces/**" - - "./common/**" - - "./.github/workflows/**" - - -jobs: - docker: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: harbor.dev.madhouselabs.io - username: ${{ secrets.HARBOR_USERNAME }} - password: ${{ secrets.HARBOR_PASSWORD }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build and Push - env: - TAG: v2 - REGISTRY: harbor.dev.madhouselabs.io - APP: dns - - run: docker buildx build -f ./apps/${APP}/Dockerfile -t ${REGISTRY}/kloudlite/${APP}:${TAG} ./apps/${APP} --push --build-arg APP=${APP} --build-context project-root=. - diff --git a/.github/workflows/scrap/finance.yml b/.github/workflows/scrap/finance.yml deleted file mode 100644 index 5c2b55311..000000000 --- a/.github/workflows/scrap/finance.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: finance - -on: - push: - branches: - - '*' # matches every branch that doesn't contain a '/' - - '*/*' # matches every branch containing a single '/' - - '**' # matches every branch - - '!master' # excludes master - paths: - - "./apps/finance/**" - - "./pkg/**" - - "./grpc-interfaces/**" - - "./common/**" - - "./.github/workflows/**" - - -jobs: - docker: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: harbor.dev.madhouselabs.io - username: ${{ secrets.HARBOR_USERNAME }} - password: ${{ secrets.HARBOR_PASSWORD }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build and Push - env: - TAG: v2 - REGISTRY: harbor.dev.madhouselabs.io - APP: finance - - run: docker buildx build -f ./apps/${APP}/Dockerfile -t ${REGISTRY}/kloudlite/${APP}:${TAG} ./apps/${APP} --push --build-arg APP=${APP} --build-context project-root=. - diff --git a/.github/workflows/scrap/proxy.yml b/.github/workflows/scrap/proxy.yml deleted file mode 100644 index 7b422cd24..000000000 --- a/.github/workflows/scrap/proxy.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: proxy - -on: - push: - branches: - - '*' # matches every branch that doesn't contain a '/' - - '*/*' # matches every branch containing a single '/' - - '**' # matches every branch - - '!master' # excludes master - - paths: - - "./apps/proxy/**" - - "./pkg/**" - - "./grpc-interfaces/**" - - "./common/**" - - "./.github/workflows/**" - -jobs: - docker: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: harbor.dev.madhouselabs.io - username: ${{ secrets.HARBOR_USERNAME }} - password: ${{ secrets.HARBOR_PASSWORD }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build and Push - env: - TAG: v2 - REGISTRY: harbor.dev.madhouselabs.io - APP: proxy - - run: docker buildx build -f ./apps/${APP}/Dockerfile -t ${REGISTRY}/public/kloudlite/${APP}:${TAG} ./apps/${APP} --push --build-arg APP=${APP} --build-context project-root=. diff --git a/.gitignore b/.gitignore index 7c01c0cd5..e7ae79199 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,10 @@ nohup.out .GO .kl/secret* -__debug_bin +__debug_bin* +gqlenv.yml +_graph2 + +go.work +go.work.sum +.direnv diff --git a/.kl.yml b/.kl.yml deleted file mode 100644 index 453846819..000000000 --- a/.kl.yml +++ /dev/null @@ -1,14 +0,0 @@ -version: v1 -name: Sample -mres: [] -configs: -- id: cfg-eya4-w4c6zyrspkj35xq5wzhw17t - name: sample - env: - - key: SAMPLE_CONFIG - refkey: SAMPLE_CONFIG -secrets: [] -env: -- key: SAMPLE_ENV - value: sample_value -ports: [] diff --git a/.tools/__http__/ci.http.yml b/.tools/__http__/ci.http.yml deleted file mode 100644 index 93857e911..000000000 --- a/.tools/__http__/ci.http.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- -global: - sample: true ---- -label: Search Harbor Images -query: | - query Ci_harborSearch($accountId: ID!, $q: String!, $pagination: PaginationIn) { - ci_harborSearch(accountId: $accountId, q: $q, pagination: $pagination) { - imageName - createdAt - updatedAt - # tags { - # name - # } - } - } -variables: - accountId: acc-xnnbf-kd254lyrcnu2jqvnoksvk - q: mon - pagination: - page: 1 - perPage: 100 - ---- - -label: List Image Tags -query: | - query Query($imageName: String!, $pagination: PaginationIn) { - ci_harborImageTags(imageName: $imageName, pagination: $pagination) { - name - } - } -variables: - imageName: "kloudlite/production/kloudlite-operator" - pagination: - page: 1 - perPage: 100 - diff --git a/.tools/__http__/console.graphql.yml b/.tools/__http__/console.graphql.yml deleted file mode 100644 index 734c07db4..000000000 --- a/.tools/__http__/console.graphql.yml +++ /dev/null @@ -1,109 +0,0 @@ ---- -global: - accountId: acc-k-hw-z1woxao88zzw8wjwl5mu2bih - projectId: proj-hhaqjt-f-hwjisccuugzkru25ami ---- -label: List Projects -query: | - query Core_projects($accountId: ID) { - core_projects(accountId: $accountId) { - id - name - region { - id - name - } - } - } -variables: - accountId: "{{.accountId}}" - ---- - -label: Create Project -query: | - mutation Core_createProject($accountId: ID!, $name: String!, $displayName: String!, $description: String, $regionId: ID) { - core_createProject(accountId: $accountId, name: $name, displayName: $displayName, description: $description, regionId: $regionId) { - id - name - } - } -variables: - accountId: "{{.accountId}}" - name: "anotherone-t" - displayName: "sample x" - regionId: "reg-vmtjj-k9w-v8i-c7jtkzp5rmlubz" - description: "this is just a dummy, project and will be deleted soon" - ---- -# clus-t2a-sfpxmcmw9qfydq0kzqswfhvb -label: Add New Cluster -query: | - mutation Core_addNewCluster($cluster: ClusterIn!) { - core_addNewCluster(cluster: $cluster) { - id - name - subDomain - } - } -variables: - cluster: - name: dev-01 - subDomain: dev-01.clusters.dev.kloudlite.io - kubeConfig: |+ - apiVersion: v1 - clusters: - - cluster: - certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJkekNDQVIyZ0F3SUJBZ0lCQURBS0JnZ3Foa2pPUFFRREFqQWpNU0V3SHdZRFZRUUREQmhyTTNNdGMyVnkKZG1WeUxXTmhRREUyTnpBME9UazNOak13SGhjTk1qSXhNakE0TVRFME1qUXpXaGNOTXpJeE1qQTFNVEUwTWpRegpXakFqTVNFd0h3WURWUVFEREJock0zTXRjMlZ5ZG1WeUxXTmhRREUyTnpBME9UazNOak13V1RBVEJnY3Foa2pPClBRSUJCZ2dxaGtqT1BRTUJCd05DQUFTQlZSV0dpbXRjRWxpUnVEQ1lFeDhXRlVBdHowQzU1TEg3R1ZVdEhienAKaSs4TXZ5MWY4bmJqQ2Ezb1VxWUx5NHA0NjZmbUNTLzBXTVFIOEdvenJiK0ZvMEl3UURBT0JnTlZIUThCQWY4RQpCQU1DQXFRd0R3WURWUjBUQVFIL0JBVXdBd0VCL3pBZEJnTlZIUTRFRmdRVUpkdmhtZDgwbjV2QnJaZTlsdm1ECkJuRGpRSEl3Q2dZSUtvWkl6ajBFQXdJRFNBQXdSUUlnRnRrdFdPelVWR096c0Z5SitwOEV4TEZYZm9aeEZUOWIKa3BIWUZnZ0x0Q0lDSVFEWFpCQUY1bzd0Kzg0ZlhHSzlnZzJKdVlBODNvSXhhZHpDcndYRGZLSWttUT09Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K - server: ***REMOVED*** - name: dev-azure - contexts: - - context: - cluster: dev-azure - user: dev-azure - name: dev-azure - current-context: dev-azure - kind: Config - preferences: {} - users: - - name: dev-azure - user: - client-certificate-data: ***REMOVED***= - client-key-data: ***REMOVED***= - ---- -label: Create App -query: |+ - mutation Core_createApp($projectId: ID!, $app: AppInput!) { - core_createApp(projectId: $projectId, app: $app) { - id - name - namespace - project { - id - name - } - } - } -variables: - projectId: "{{.projectId}}" - app: - isLambda: false - name: sample - projectId: "{{.projectId}}" - readableId: "sample-app-2312" - services: - - exposed: 80 - target: 80 - type: tcp - containers: - - computePlan: basic - quantity: 1 - name: sample-app - attachedResources: [] - envVars: - - key: NAME - value: - type: literal - value: "sample-app" ---- diff --git a/.tools/__http__/console/apps.graphql.yml b/.tools/__http__/console/apps.graphql.yml deleted file mode 100644 index 252b651a3..000000000 --- a/.tools/__http__/console/apps.graphql.yml +++ /dev/null @@ -1,114 +0,0 @@ ---- -global: - # namespace: sample - # namespace: "sample-nxtcoder17" - accountName: kloudlite-dev - # namespace: kl-init-operators - namespace: sample-default - name: s1 ---- - -label: List Apps -query: |+ - query Core_listApps($namespace: String!) { - core_listApps(namespace: $namespace) { - syncStatus { - state - generation - lastSyncedAt - syncScheduledAt - } - metadata { - name - generation - } - } - } -variables: - namespace: "{{.namespace}}" ---- - -label: Get App -query: |+ - query Core_getApp($namespace: String!, $name: String!) { - core_getApp(namespace: $namespace, name: $name) { - metadata { - name - deletionTimestamp - } - spec { - containers{ - name - image - } - } - } - } -variables: - namespace: "{{.namespace}}" - name: "{{.name}}" ---- - -label: Create App -query: |+ - mutation Core_createApps($app: AppIn!) { - core_createApp(app: $app) { - metadata { - name - } - } - } -variables: - app: - metadata: - name: "{{.name}}2" - namespace: "{{.namespace}}" - spec: - # region: r1 - # region: dev-sample1-mumbai-1 - # accountName: '{{.accountName}}' - containers: - - name: main - image: nginx ---- - -label: Update App -query: |+ - mutation Core_updateApp($app: AppIn!) { - core_updateApp(app: $app) { - metadata { - name - generation - } - syncStatus { - state - generation - } - } - } -variables: - app: - metadata: - name: '{{.name}}' - namespace: '{{.namespace}}' - spec: - # accountName: '{{.accountName}}' - # region: dev-sample1-mumbai-1 - services: - - type: tcp - port: 80 - targetPort: 80 - containers: - - name: main - image: kong/httpbin ---- - -label: Delete App -query: |+ - mutation Core_deleteApp($namespace: String!, $name: String!) { - core_deleteApp(namespace: $namespace, name: $name) - } -variables: - namespace: '{{.namespace}}' - name: "{{.name}}" ---- diff --git a/.tools/__http__/console/configs.graphql.yml b/.tools/__http__/console/configs.graphql.yml deleted file mode 100644 index 1f4253324..000000000 --- a/.tools/__http__/console/configs.graphql.yml +++ /dev/null @@ -1,110 +0,0 @@ ---- -global: - namespace: sample - name: s1 ---- - -label: List Configs -query: |+ - query Core_listConfigs($namespace: String!) { - core_listConfigs(namespace: $namespace) { - metadata { - name - namespace - generation - } - data - syncStatus { - state - generation - } - } - } -variables: - namespace: "{{.namespace}}" ---- - -label: Create Config -query: |+ - mutation Core_createConfig($config: ConfigIn!) { - core_createConfig(config: $config) { - metadata { - name - namespace - } - data - } - } - -variables: - config: - metadata: - name: '{{.name}}' - namespace: '{{.namespace}}' - data: - key1: value1 - key2: value2 ---- - -label: Get Config -query: |+ - query Core_getConfig($namespace: String!, $name: String!) { - core_getConfig(namespace: $namespace, name: $name) { - metadata { - name - deletionTimestamp - namespace - } - data - } - } -variables: - name: '{{.name}}' - namespace: '{{.namespace}}' - ---- - -label: Update Config -query: |+ - mutation Core_updateConfig($config: ConfigIn!) { - core_updateConfig(config: $config) { - metadata { - name - generation - } - syncStatus { - state - generation - } - } - } -variables: - config: - metadata: - name: '{{.name}}' - namespace: '{{.namespace}}' - data: - key1: valueN - key3: value2 ---- - -label: Delete Config -query: |+ - mutation Core_deleteConfig($namespace: String!, $name: String!) { - core_deleteConfig(namespace: $namespace, name: $name) - } -variables: - namespace: '{{.namespace}}' - name: "{{.name}}" ---- - -label: Resync Config -query: |+ - query Query($namespace: String!, $name: String!) { - core_resyncConfig(namespace: $namespace, name: $name) - } -variables: - namespace: '{{.namespace}}' - name: "{{.name}}" - ---- diff --git a/.tools/__http__/console/environments.graphql.yml b/.tools/__http__/console/environments.graphql.yml deleted file mode 100644 index fc35da35f..000000000 --- a/.tools/__http__/console/environments.graphql.yml +++ /dev/null @@ -1,147 +0,0 @@ ---- -global: - accountName: kloudlite-dev - projectName: sample - projectTargetNamespace: sample - clusterName: sample - namespace: sample - envTargetNamespace: "sample-nxtcoder17" ---- - -label: List Environments -query: |+ - query Core_listWorkspaces($namespace: String!) { - core_listWorkspaces(namespace: $namespace) { - kind - metadata { - name - labels - namespace - } - spec { - projectName - } - status { - isReady - checks - } - syncStatus { - state - error - action - } - } - } -variables: - namespace: "{{.namespace}}" - ---- - -label: Get Environment -query: |+ - query Core_getEnvironment($namespace: String!, $name: String!) { - core_getEnvironment(namespace: $namespace, name: $name) { - metadata { - namespace - name - labels - } - spec { - projectName - targetNamespace - } - } - } -variables: - name: "default" - namespace: "{{.projectName}}" - ---- - -label: Create Environment -query: |+ - mutation Core_createEnvironment($env: EnvironmentIn!) { - core_createEnvironment(env: $env) { - apiVersion - kind - spec { - projectName - targetNamespace - } - syncStatus { - state - lastSyncedAt - generation - action - syncScheduledAt - } - } - } -variables: - env: - metadata: - name: sample - namespace: "{{.projectTargetNamespace}}" - spec: - projectName: "{{.projectName}}" - targetNamespace: "{{.envTargetNamespace}}" ---- - -label: Update Environment -query: |+ - mutation Core_updateEnvironment($env: EnvironmentIn!) { - core_updateEnvironment(env: $env) { - syncStatus { - action - generation - lastSyncedAt - state - syncScheduledAt - } - status { - isReady - displayVars - checks - } - kind - apiVersion - spec { - projectName - } - metadata { - name - namespace - } - } - } -variables: - env: - metadata: - name: sample - namespace: "{{.projectTargetNamespace}}" - spec: - projectName: "{{.projectName}}" - targetNamespace: "{{.envTargetNamespace}}" ---- - -label: Delete Environment -query: |+ - mutation Core_deleteEnvironment($name: String!, $namespace: String!) { - core_deleteEnvironment(name: $name, namespace: $namespace) - } -variables: - name: "sample" - namespace: "{{.namespace}}" ---- - -label: Resync Environment -query: |+ - query Query($namespace: String!, $name: String!) { - core_resyncEnvironment(namespace: $namespace, name: $name) - } -variables: - namespace: '{{.projectTargetNamespace}}' - # name: "{{.name}}" - name: "default" - ---- diff --git a/.tools/__http__/console/mres.graphql.yml b/.tools/__http__/console/mres.graphql.yml deleted file mode 100644 index 40a18c564..000000000 --- a/.tools/__http__/console/mres.graphql.yml +++ /dev/null @@ -1,108 +0,0 @@ ---- -global: - namespace: kl-core - name: s1 ---- - -label: List Managed Resources -query: |+ - query Core_listManagedResources($namespace: String!) { - core_listManagedResources(namespace: $namespace) { - metadata { - name - } - kind - spec { - inputs - } - } - } -variables: - namespace: "{{.namespace}}" ---- - -label: Create Managed Resource -query: |+ - mutation Core_createManagedResource($mres: ManagedResourceIn!) { - core_createManagedResource(mres: $mres) { - spec { - inputs - msvcRef { - name - kind - } - mresKind { - kind - } - } - } - } -variables: - mres: - metadata: - name: '{{.name}}' - namespace: '{{.namespace}}' - spec: - inputs: - k1: v1 - msvcRef: - apiVersion: "asdfasdf" - kind: StandaloneDatabase - name: s1 - mresKind: - kind: Database ---- - -label: Get ManagedService -query: |+ - query Core_getManagedResource($namespace: String!, $name: String!) { - core_getManagedResource(namespace: $namespace, name: $name) { - metadata { - name - } - kind - spec { - inputs - } - } - } -variables: - name: '{{.name}}' - namespace: '{{.namespace}}' - ---- - -label: Update ManagedService -query: |+ - mutation Core_updateManagedResource($mres: ManagedResourceIn!) { - core_updateManagedResource(mres: $mres) { - spec { - inputs - } - } - } -variables: - mres: - metadata: - name: '{{.name}}' - namespace: '{{.namespace}}' - spec: - inputs: - k1: v1 - msvcRef: - apiVersion: "###" - kind: StandaloneDatabase - name: s1 - mresKind: - kind: Database ---- - -label: Delete ManagedService -query: |+ - mutation Core_deleteManagedResource($namespace: String!, $name: String!) { - core_deleteManagedResource(namespace: $namespace, name: $name) - } -variables: - namespace: '{{.namespace}}' - name: "{{.name}}" ---- diff --git a/.tools/__http__/console/names.graphql.yml b/.tools/__http__/console/names.graphql.yml deleted file mode 100644 index b46029ab0..000000000 --- a/.tools/__http__/console/names.graphql.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -global: - accountName: kloudlite-dev - name: sample - namespace: s1 ---- -label: Check Name Availability -query: |+ - query Core_checkNameAvailability($resType: ConsoleResType!, $name: String!) { - core_checkNameAvailability(resType: $resType, name: $name) { - result - suggestedNames - } - } -variables: - resType: project - name: sample123 ---- diff --git a/.tools/__http__/console/routers.graphql.yml b/.tools/__http__/console/routers.graphql.yml deleted file mode 100644 index 6863c5fc6..000000000 --- a/.tools/__http__/console/routers.graphql.yml +++ /dev/null @@ -1,111 +0,0 @@ ---- -global: - projectNamespace: sample - namespace: kl-core - name: s1 ---- - -label: List Routers -query: |+ - query Core_listRouters($namespace: String!) { - core_listRouters(namespace: $namespace) { - metadata { - name - namespace - } - spec { - domains - } - syncStatus { - state - # error - generation - } - } - } -variables: - namespace: "{{.projectNamespace}}" ---- - -label: Create Router -query: |+ - mutation Core_createRouter($router: RouterIn!) { - core_createRouter(router: $router) { - spec { - domains - } - } - } -variables: - router: - metadata: - name: '{{.name}}' - namespace: '{{.projectNamespace}}' - spec: - domains: - - sample.example.com ---- - -label: Get Router -query: |+ - query Core_getRouter($namespace: String!, $name: String!) { - core_getRouter(namespace: $namespace, name: $name) { - metadata { - name - deletionTimestamp - namespace - } - spec { - domains - } - } - } -variables: - name: '{{.name}}' - namespace: '{{.projectNamespace}}' - ---- - -label: Update Router -query: |+ - mutation Core_updateRouter($router: RouterIn!) { - core_updateRouter(router: $router) { - spec { - domains - } - } - } -variables: - router: - metadata: - name: '{{.name}}' - namespace: '{{.projectNamespace}}' - spec: - domains: - - sample.example.com - routes: - - app: s1 - path: / - port: 80 ---- - -label: Delete Router -query: |+ - mutation Core_deleteRouter($namespace: String!, $name: String!) { - core_deleteRouter(namespace: $namespace, name: $name) - } -variables: - namespace: '{{.projectNamespace}}' - name: "{{.name}}2" ---- - -label: Resync Routers -query: |+ - query Query($namespace: String!, $name: String!) { - core_resyncRouter(namespace: $namespace, name: $name) - } -variables: - namespace: '{{.namespace}}' - name: "{{.name}}" - ---- diff --git a/.tools/__http__/console/secrets.graphql.yml b/.tools/__http__/console/secrets.graphql.yml deleted file mode 100644 index 4ad7226a8..000000000 --- a/.tools/__http__/console/secrets.graphql.yml +++ /dev/null @@ -1,100 +0,0 @@ ---- -global: - namespace: sample - name: s1 ---- - -label: List Secrets -query: |+ - query Core_listSecrets($namespace: String!) { - core_listSecrets(namespace: $namespace) { - metadata { - name - namespace - } - data - stringData - syncStatus { - state - generation - } - } - } -variables: - namespace: "{{.namespace}}" ---- - -label: Create Secret -query: |+ - mutation Core_createSecret($secret: SecretIn!) { - core_createSecret(secret: $secret) { - metadata { - name - namespace - } - stringData - syncStatus { - state - generation - } - } - } - -variables: - secret: - metadata: - name: '{{.name}}' - namespace: '{{.namespace}}' - stringData: - key1: value1 - key2: value2 ---- - -label: Get Secret -query: |+ - query Core_getSecret($namespace: String!, $name: String!) { - core_getSecret(namespace: $namespace, name: $name) { - metadata { - name - deletionTimestamp - namespace - } - data - stringData - } - } -variables: - name: '{{.name}}' - namespace: '{{.namespace}}' - ---- - -label: Update Secret -query: |+ - mutation Core_updateSecret($secret: SecretIn!) { - core_updateSecret(secret: $secret) { - metadata { - name - } - stringData - } - } -variables: - secret: - metadata: - name: '{{.name}}' - namespace: '{{.namespace}}' - stringData: - key1: value1x - key3: value2 ---- - -label: Delete Secret -query: |+ - mutation Core_deleteSecret($namespace: String!, $name: String!) { - core_deleteSecret(namespace: $namespace, name: $name) - } -variables: - namespace: '{{.namespace}}' - name: "{{.name}}" ---- diff --git a/.tools/__http__/consolev2/apps.graphql.yml b/.tools/__http__/consolev2/apps.graphql.yml deleted file mode 100644 index 837b05218..000000000 --- a/.tools/__http__/consolev2/apps.graphql.yml +++ /dev/null @@ -1,100 +0,0 @@ ---- -global: - # accountId: acc-k-9egfp-0nvz1wmpc6ylj9pxibqzt - accountId: acc-k-hw-z1woxao88zzw8wjwl5mu2bih - ---- - -label: Create App -query: |+ - mutation Core_createApp($app: App!) { - core_createApp(app: $app) - } - -variables: - app: - apiVersion: crds.kloudlite.io/v1 - kind: App - metadata: - name: sample-app - namespace: sample - spec: - region: master - containers: - - name: main - image: nginx - ---- - -label: Update App -query: |+ - mutation Core_updateApp($app: App!) { - core_updateApp(app: $app) - } - -variables: - app: - apiVersion: crds.kloudlite.io/v1 - kind: App - metadata: - name: sample-app - namespace: sample - spec: - region: master - containers: - - name: main - image: kong/httpbin - ---- - -label: Updating App running in an environment -query: |+ - mutation Core_updateApp($app: App!) { - core_updateApp(app: $app) - } - -variables: - app: - apiVersion: crds.kloudlite.io/v1 - kind: App - metadata: - name: sample-app - namespace: sample-default - spec: - region: master - containers: - - name: main - image: kong/httpbin - ---- - -label: Delete App -query: |+ - mutation Core_deleteApp($namespace: String!, $name: String!) { - core_deleteApp(namespace: $namespace, name: $name) - } -variables: - namespace: sample - name: sample-app - ---- - -label: Get Apps -query: |+ - query Core_Apps($namespace: String!) { - core_apps(namespace: $namespace) - } -variables: - namespace: sample - ---- - -label: Get App -query: |+ - query Core_App($namespace: String!, $name: String!) { - core_app(namespace: $namespace, name: $name) - } -variables: - namespace: sample - name: sample-app ---- diff --git a/.tools/__http__/consolev2/configs.graphql.yml b/.tools/__http__/consolev2/configs.graphql.yml deleted file mode 100644 index 8b33257a4..000000000 --- a/.tools/__http__/consolev2/configs.graphql.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- -global: - # accountId: acc-k-9egfp-0nvz1wmpc6ylj9pxibqzt - accountId: acc-k-hw-z1woxao88zzw8wjwl5mu2bih - namespace: sample ---- - -label: Create Config -query: |+ - mutation Core_createConfig($config: Config!) { - core_createConfig(config: $config) - } -variables: - config: - apiVersion: crds.kloudlite.io/v1 - kind: Config - metadata: - name: sample-app - namespace: sample - data: - k1: v1 ---- diff --git a/.tools/__http__/consolev2/projects.graphql.yml b/.tools/__http__/consolev2/projects.graphql.yml deleted file mode 100644 index b0db158da..000000000 --- a/.tools/__http__/consolev2/projects.graphql.yml +++ /dev/null @@ -1,75 +0,0 @@ ---- -global: - # accountId: acc-k-9egfp-0nvz1wmpc6ylj9pxibqzt - accountId: acc-k-hw-z1woxao88zzw8wjwl5mu2bih - ---- - -label: List Projects -query: | - query Core_projects($accountId: ID!) { - core_projects(accountId: $accountId) - } -variables: - accountId: "{{.accountId}}" - ---- -label: Get Project -query: | - query Core_project($name: String!) { - core_project(name: $name) - } -variables: - name: "sample" - ---- - -label: Create Project -query: | - mutation Core_createProject($project: Project!) { - core_createProject(project: $project) - } -variables: - # accountId: "{{accountId}}" - # name: "sample" - # displayName: "sample" - # regionId: "centralindia" - # description: "this is just a dev only project" - project: - apiVersion: crds.kloudlite.io/v1 - kind: Project - metadata: - name: sample - spec: - accountId: "{{.accountId}}" - displayName: "Sample Project" ---- - -label: Delete Project -query: | - mutation Core_deleteProject($name: String!) { - core_deleteProject(name: $name) - } -variables: - name: "sample" - ---- - -### Environments -label: Get Environments -query: | - query Core_getEnvironments($projectName: String!) { - core_getEnvironments(projectName: $projectName) - } -variables: - projectName: sample ---- - -label: Get Environment -query: | - query Core_getEnvironment($namespace: String!) { - core_getEnvironment(namespace: $namespace) - } -variables: - namespace: sample ---- diff --git a/.tools/__http__/consolev2/secrets.graphql.yml b/.tools/__http__/consolev2/secrets.graphql.yml deleted file mode 100644 index e69de29bb..000000000 diff --git a/.tools/__http__/container-registry/container-registry.graphql.yml b/.tools/__http__/container-registry/container-registry.graphql.yml deleted file mode 100644 index e221bc5db..000000000 --- a/.tools/__http__/container-registry/container-registry.graphql.yml +++ /dev/null @@ -1,95 +0,0 @@ ---- -label: 'List Repos' -query: | - query Cr_listRepos { - cr_listRepos { - artifactCount - name - id - pullCount - } - } - ---- - -label: Listing Artifacts -query: |+ - query Cr_listArtifacts($repoName: String!) { - cr_listArtifacts(repoName: $repoName) { - size - tags { - name - signed - immutable - pushedAt - } - } - } -variables: - repoName: kloudlite-dev/development/webhooks-api - ---- - -label: List Robots -query: |+ - query Cr_listRobots { - cr_listRobots { - apiVersion - kind - spec { - enabled - harborProjectName - permissions - targetSecret - } - metadata { - name - } - status { - isReady - displayVars - checks - } - syncStatus { - action - generation - lastSyncedAt - state - syncScheduledAt - } - } - } - ---- - -label: Create Robot User -query: |+ - mutation Cr_createRobot($robotUser: HarborRobotUserIn!) { - cr_createRobot(robotUser: $robotUser) { - kind - metadata { - name - namespace - generation - annotations - creationTimestamp - } - syncStatus { - state - action - generation - lastSyncedAt - syncScheduledAt - } - } - } -variables: - robotUser: - metadata: - name: s1 - spec: - harborProjectName: kloudlite-dev - permissions: - - push-repository - - pull-repository ---- diff --git a/.tools/__http__/finance/accounts.graphql.yml b/.tools/__http__/finance/accounts.graphql.yml deleted file mode 100644 index 58a7e8699..000000000 --- a/.tools/__http__/finance/accounts.graphql.yml +++ /dev/null @@ -1,106 +0,0 @@ ---- -global: - accountName: kloudlite-dev - # accountName: kl-dev - ---- - -label: Create Account -query: | - mutation Finance_createAccount($name: String!, $displayName: String!) { - finance_createAccount(name: $name, displayName: $displayName) { - name - } - } -variables: - name: "{{.accountName}}" - displayName: kloudlite dev account - # billing: - # stripePaymentMethodId: "{{.accountName}}" - # cardholderName: "{{.accountName}}" - # address: - # line1: "{{.accountName}}" - ---- - -label: Resync To K8s -query: |+ - query Query($accountName: String!) { - finance_reSyncAccount(accountName: $accountName) - } -variables: - accountName: "{{.accountName}}" - ---- -label: list accounts -query: |+ - query Query { - finance_listAccounts { - name - isActive - } - } ---- - -label: get account -query: |+ - query Query($accountName: String!) { - finance_account(accountName: $accountName) { - name - isActive - } - } -variables: - accountName: "{{.accountName}}" - ---- - -label: deactivate account -query: |+ - mutation DeactivateAccount($accountName: String!) { - finance_deactivateAccount(accountName: $accountName) - } -variables: - accountName: "{{.accountName}}" - ---- - -label: activate account -query: |+ - mutation ActivateAccount($accountName: String!) { - finance_activateAccount(accountName: $accountName) - } -variables: - accountName: "{{.accountName}}" - ---- -label: Invite Account Member -query: |+ - mutation Finance_inviteAccountMember($accountName: String!, $email: String!, $role: String!, $name: String) { - finance_inviteAccountMember(accountName: $accountName, email: $email, role: $role, name: $name) - } - -variables: - accountName: "{{.accountName}}" - email: "nxtcoder17@gmail.com" - name: "nxtcoder17" - role: "account-admin" - ---- -label: List All Invitations -query: |+ - query Finance_listInvitations($accountName: String!) { - finance_listInvitations(accountName: $accountName) { - accepted - account { - name - } - user { - id - } - role - } - } -variables: - accountName: "{{.accountName}}" ---- diff --git a/.tools/__http__/finance/finance.graphql.yml b/.tools/__http__/finance/finance.graphql.yml deleted file mode 100644 index f98651383..000000000 --- a/.tools/__http__/finance/finance.graphql.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -label: Attach A Cluster -query: | - mutation Finance_attachToCluster($accountId: ID!, $clusterId: ID!) { - finance_attachToCluster(accountId: $accountId, clusterId: $clusterId) - } -variables: - accountId: acc-xnnbf-kd255lyrcnu2jqvnoksvk - clusterId: clus-2o2h7anoxoycmcgpryjw3lk1-srt diff --git a/.tools/__http__/github.ci.http.yml b/.tools/__http__/github.ci.http.yml deleted file mode 100644 index 78db39c58..000000000 --- a/.tools/__http__/github.ci.http.yml +++ /dev/null @@ -1,171 +0,0 @@ -global: - accountId: acc-5mr4frb21ssmhh2rriuxluzveodv - projectId: "proj-bopxvo-qpfpodbz9lciwu45s5uqd" - projectName: "sample" - -# accountId: acc-4xrbue-eevzhin57x8maf2ddq9md -# projectId: "proj-wnmjf1c5ndqzevswbeuej5dyiknp" -# projectName: "sample-14847" ---- -label: github installations -query: | - query Query($pagination: PaginationIn) { - ci_githubInstallations(pagination: $pagination) - } -variables: - pagination: - page: 1 - perPage: 20 - ---- - -label: Github -query: | - query Query($org: String!, $search: String) { - ci_searchGithubRepos(org: $org, search: $search) - } -variables: - search: "demo" - org: KloudLite ---- - -label: Github Repos -query: | - query Query($installationId: Int!, $pagination: PaginationIn) { - ci_githubRepos(installationId: $installationId, pagination: $pagination) - } -variables: - # installationId: 22717460 - installationId: 22487879 - pagination: - page: 1 - perPage: 2 - ---- - -label: Github Repo Branches -query: | - query Query($repoUrl: String!) { - ci_githubRepoBranches(repoUrl: $repoUrl) - } -variables: - # repoUrl: https://github.com/kloudlite/demo-env - repoUrl: https://github.com/ScaleGroup/crewscale.git ---- - -label: Github Installation Token by installation id -query: | - query Query($instId: Int) { - ci_githubInstallationToken(instId: $instId) - } -variables: - instId: 22636591 - ---- - -label: Searching github -query: | - query SearchQuery($search: String!, $org: String!) { - ci_searchGithubRepos(search: $search, org: $org) - } -variables: - search: we - org: kloudlite - # pagination: - # page: 1 - # perPage: 5 ---- - -label: Get Installation Token By RepoUrl -query: | - query Query($repoUrl: String!) { - ci_githubInstallationToken(repoUrl: $repoUrl) - } -variables: - repoUrl: https://github.com/kloudlite/demo-env - ---- - -label: Create Github Pipeline with Docker -query: | - mutation Ci_createDockerPipeline($in: GitDockerPipelineIn!) { - ci_createDockerPipeline(in: $in) - } -variables: - in: - name: sample-example-github-asdfdasfas - # accountId: "{{accountId}}" - accountId: "acc-p3as823bdcuymhtz3upzzxh2wobw" - projectId: "{{projectId}}" - appId: "not-app-id-github-2" - # projectName: "{{projectName}}" - projectName: "testproj-22875" - containerName: "main" - gitProvider: github - repoName: "website" - gitRepoUrl: "https://github.com/nxtcoder17/sample" - gitBranch: master - dockerFile: ./Dockerfile - contextDir: ./ - buildArgs: "" - artifactRef: - # dockerImageName: "{{accountId}}/website2" - dockerImageName: "website2" - dockerImageTag: "latest" - ---- - -label: Create Github Pipeline with Docker -query: | - mutation Ci_createDockerPipeline($in: GitDockerPipelineIn!) { - ci_createDockerPipeline(in: $in) - } -variables: - in: - name: sample-example-github-asdfdasfas - # accountId: "{{accountId}}" - accountId: "acc-xnnbf-kd254lyrcnu2jqvnoksvk" - projectId: "proj-xv9pfmcwaov1yxuftpcwkq1n0sxi" - appId: "app-mnkuxqyzjrsf0e1kb9i43wrkxpho" - # projectName: "{{projectName}}" - projectName: "devenv-14473" - containerName: "main" - gitProvider: github - repoName: "website" - gitRepoUrl: "https://github.com/ScaleGroup/crewscale.git" - gitBranch: feature/cs-01_demo_branch - dockerFile: ./Dockerfile - contextDir: ./ - buildArgs: "" - artifactRef: - # dockerImageName: "{{accountId}}/website2" - dockerImageName: "c97-4c06-ae29-d1757c984c25" - dockerImageTag: "latest" - ---- - -label: List Pipelines -query: | - query Ci_getPipelines($projectId: ID!) { - ci_getPipelines(projectId: $projectId) { - id - name - dockerBuild { - dockerFile - } - build { - cmd - } - } - } -variables: - projectId: "{{projectId}}" ---- -label: Pipeline -query: | - query Query($pipelineId: ID!) { - ci_triggerPipeline(pipelineId: $pipelineId) - } - -variables: - pipelineId: pip-3pdwimijh1rnsrub72x05wmt4vcv diff --git a/.tools/__http__/gitlab.ci.http.yml b/.tools/__http__/gitlab.ci.http.yml deleted file mode 100644 index 45eeb4561..000000000 --- a/.tools/__http__/gitlab.ci.http.yml +++ /dev/null @@ -1,81 +0,0 @@ ---- -global: - accountId: acc-5mr4frb21ssmhh2rriuxluzveodv - projectId: "proj-bopxvo-qpfpodbz9lciwu45s5uqd" - projectName: "sample" ---- -label: Gitlab Groups -query: | - query Query($query: String) { - ci_gitlabGroups(query: $query) - } -variables: - query: "" - ---- - -label: Gitlab Repos with Search -query: | - query Query($groupId: String!, $search: String) { - ci_gitlabRepos(groupId: $groupId, search: $search) - } - -variables: - # groupId: "8508925" - groupId: "1459765" - search: "sample" - ---- - -label: Gitlab Repo Branches -query: | - query Query($repoId: String!) { - ci_gitlabRepoBranches(repoId: $repoId) - } -variables: - repoId: "26232015" - ---- - -label: Create Gitlab Pipeline with Docker -query: | - mutation Ci_createDockerPipeline($in: GitDockerPipelineIn!) { - ci_createDockerPipeline(in: $in) - } -variables: - in: - name: sample-example-2 - accountId: "{{accountId}}" - projectId: "{{projectId}}" - appId: "not-app-id-gitlab" - projectName: "{{projectName}}" - containerName: "main" - gitProvider: gitlab - repoName: "website" - gitRepoUrl: "https://gitlab.com/madhouselabs/sample" - gitBranch: master - dockerFile: ./Dockerfile - contextDir: ./ - buildArgs: "" - artifactRef: - dockerImageName: "harbor.dev.madhouselabs.io/{{accountId}}/website" - dockerImageTag: "latest" - ---- - -label: List Pipelines -query: | - query Ci_getPipelines($projectId: ID!) { - ci_getPipelines(projectId: $projectId) { - id - name - dockerBuild { - dockerFile - } - build { - cmd - } - } - } -variables: - projectId: "{{projectId}}" diff --git a/.tools/__http__/infra/cloud-providers.graphql.yml b/.tools/__http__/infra/cloud-providers.graphql.yml deleted file mode 100644 index e12ee8a42..000000000 --- a/.tools/__http__/infra/cloud-providers.graphql.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -global: - accountName: kloudlite-dev - name: sample - namespace: s1 - providerSecretName: provider-sample ---- -label: Create Cloud Provider -query: |+ - mutation Infra_createCloudProvider($cloudProvider: CloudProviderIn!, $providerSecret: SecretIn!) { - infra_createCloudProvider(cloudProvider: $cloudProvider, providerSecret: $providerSecret) { - metadata { - name - labels - } - status { - isReady - } - } - } -variables: - providerSecret: - metadata: &psecret - name: "{{.providerSecretName}}" - namespace: "{{.namespace}}" - stringData: - accessKey: "key1" - accessSecret: secret1 - cloudProvider: - metadata: - name: '{{.name}}' - spec: - display_name: "{{.name}}" - provider: 'aws' - accountName: "{{.accountName}}" - providerSecret: *psecret ---- - -label: List Providers -query: |+ - query Query() { - infra_listCloudProviders { - metadata { - name - } - spec { - accountName - provider - } - } - } ---- - -label: Get Provider -query: |+ - query Query($name: String!) { - infra_getCloudProvider(name: $name) { - syncStatus { - state - syncScheduledAt - } - metadata{ - name - } - spec { - accountName - } - } - } -variables: - name: "{{.name}}" - ---- - -label: Delete Provider -query: |+ - mutation Query($name: String!) { - infra_deleteCloudProvider(name: $name) - } -variables: - name: "{{.name}}" ---- diff --git a/.tools/__http__/infra/clusters.graphql.yml b/.tools/__http__/infra/clusters.graphql.yml deleted file mode 100644 index 65a2d8666..000000000 --- a/.tools/__http__/infra/clusters.graphql.yml +++ /dev/null @@ -1,102 +0,0 @@ ---- -global: - accountName: kloudlite-dev - providerName: sample - providerNamespace: s1 - providerSecretName: provider-sample - - clusterName: sample ---- - -label: Create Cluster -query: |+ - mutation Infra_createCluster($cluster: ClusterIn!) { - infra_createCluster(cluster: $cluster) { - metadata { - name - } - spec { - accountName - providerName - } - } - } -variables: - cluster: - # apiVersion: cmgr.kloudlite.io/v1 - # kind: Cluster - metadata: - name: "{{.clusterName}}" - spec: - accountName: "{{.accountName}}" - providerName: "{{.providerName}}" - provider: aws - count: 1 - region: ap-south-1 - config: '{"instanceType":"c6a.large","vpc":""}' ---- - -label: List Clusters -query: |+ - query Query { - infra_listClusters { - # syncStatus { - # status - # } - clusterToken - metadata { - name - } - spec { - accountName - } - } - } - ---- - -label: Get Cluster -query: |+ - query Query($name: String!) { - infra_getCluster(name: $name) { - kind - metadata { - name - } - spec { - provider - } - } - } -variables: - name: "{{.clusterName}}" - ---- -label: Update Cluster -query: |+ - mutation Infra_updateCluster($cluster: Cluster!) { - infra_updateCluster(cluster: $cluster) - } -variables: - cluster: - metadata: - name: "{{.clusterName}}" - spec: - accountName: "{{.accountName}}" - providerName: "{{.providerName}}" - provider: aws - count: 2 - region: ap-south-1 - config: '{"instanceType":"c6a.large","vpc":""}' - ---- -label: Delete Cluster -query: |+ - mutation Infra_deleteCluster($name: String!) { - infra_deleteCluster(name: $name) - } -variables: - name: "{{.clusterName}}" ---- - - diff --git a/.tools/__http__/infra/names.graphql.yml b/.tools/__http__/infra/names.graphql.yml deleted file mode 100644 index 1be20db14..000000000 --- a/.tools/__http__/infra/names.graphql.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -global: - accountName: kloudlite-dev - name: sample - namespace: s1 - providerSecretName: provider-sample ---- -label: Check Name Availability -query: |+ - query Infra_checkNameAvailability($resType: ResType!, $name: String!) { - infra_checkNameAvailability(resType: $resType, name: $name) { - result - suggestedNames - } - } -variables: - resType: BYOC - name: sample2 ---- diff --git a/.tools/__http__/pipeline.gql.yml b/.tools/__http__/pipeline.gql.yml deleted file mode 100644 index 84b511d7e..000000000 --- a/.tools/__http__/pipeline.gql.yml +++ /dev/null @@ -1,17 +0,0 @@ -label: get pipeline runs -query: | - query Ci_getPipelineRuns($pipelineId: ID!) { - ci_getPipelineRuns(pipelineId: $pipelineId) { - id - pipelineId - startTime - endTime - success - message - state - } - } -variables: - pipelineId: 'pip-dxgx9zuzyj-skjv4nxxarjah2lf6' - ---- diff --git a/.tools/__http__/pipeline.http.yml b/.tools/__http__/pipeline.http.yml deleted file mode 100644 index e906aef69..000000000 --- a/.tools/__http__/pipeline.http.yml +++ /dev/null @@ -1,170 +0,0 @@ ---- -global: - accountId: "acc-imgtxz4logeg-isxm4uqlpzzwctr" - projectId: "proj-ci1xmobjyia7cc00optpbeavpnmn" - projectName: "example-plaxonic" ---- -label: create github pipeline -query: | - mutation Ci_createPipeline($in: GitPipelineIn!) { - ci_createPipeline(in: $in) - } -variables: - in: - name: sample-pipeline - accountId: acc-wo4rgoszo9dmsa1na-yhbsvh75gj - projectId: proj-s1ok37ubokp62aszwu0jdoq4uorr - appId: app-pg5r5t4bqez31rvwyjgys8z0k55y - gitProvider: github - gitRepoUrl: https://github.com/nxtcoder17/sample - repoName: sample - gitBranch: master - build: - baseImage: docker - cmd: |+ - docker build -t ${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG} . - run: - baseImage: docker - cmd: "" - artifactRef: - dockerImageName: sample - dockerImageTag: latest - ---- -label: Create Gitlab Pipeline -query: | - mutation Ci_createPipeline($in: GitPipelineIn!) { - ci_createPipeline(in: $in) - } -variables: - in: - name: sample-pipeline2 - projectName: "{{projectName}}" - accountId: "{{accountId}}" - projectId: "{{projectName}}" - # appId: app-pg5r5t4bqez31rvwyjgys8z0k55y - appId: "sample" - gitProvider: gitlab - gitRepoUrl: https://gitlab.com/madhouselabs/sample - repoName: sample - gitBranch: latest - dockerFile: ./Dockerfile - dockerContextDir: ./ - # build: - # baseImage: docker - # cmd: |+ - # docker build -t ${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG} . - # run: - # baseImage: docker - # cmd: "" - artifactRef: - dockerImageName: harbor.dev.madhouselabs.io/kloudlite/sample - dockerImageTag: latest ---- -label: Create Gitlab Pipeline with buildCmd -query: | - mutation Ci_createPipeline($in: GitPipelineIn!) { - ci_createPipeline(in: $in) - } -variables: - in: - name: sample-pipeliney - projectName: sample-x - containerName: main - accountId: acc-wo4rgoszo9dmsa1na-yhbsvh75gj - projectId: proj-ll5s-miviimb0icwvznki9jqzkyi - appId: app-pg5r5t4bqez31rvwyjgys8z0k55y - gitProvider: gitlab - gitRepoUrl: https://gitlab.com/nxtcoder17/sample - repoName: sample - gitBranch: master - build: - baseImage: node:alpine - cmd: npm i - outputDir: app,package.json - run: - baseImage: node:alpine - cmd: npm start - artifactRef: - dockerImageName: sample - dockerImageTag: latest ---- -label: Create Gitlab Pipeline with buildCmd (error) -query: | - mutation Ci_createDockerPipeLine($in: GitDockerPipelineIn!) { - ci_createDockerPipeLine(in: $in) - } -variables: - in: - repoName: backend_np-cart - projectId: proj-0f1hjg-c0q0ndi9-damtr5f78vrq - accountId: acc-gqjm9v7geosp9mnkdt-kdiewwjc4 - projectName: sample-proje-24785 - containerName: main - gitBranch: main - name: pipeline_sample-app-27390-main - gitRepoUrl: https://github.com/abdheshnayak/backend_np-cart.git - gitProvider: github - artifactRef: - dockerImageName: 9fb-4d0b-bb67-e9dc16834193 - dockerImageTag: latest - appId: sample-app-27390 - dockerFile: Dockerfile - contextDir: ./ - buildArgs: '' ---- -label: list pipelines -query: | - query Ci_getPipelines($projectId: ID!) { - ci_getPipelines(projectId: $projectId) { - id - name - gitProvider - gitRepoUrl - gitBranch - build { - baseImage - cmd - } - run { - baseImage - cmd - } - metadata - } - } -variables: - projectId: proj-ll5s-miviimb0icwvznki9jqzkyi ---- - -label: get pipeline -query: | - query Ci_getPipelines($pipelineId: ID!) { - ci_getPipeline(pipelineId: $pipelineId) { - id - repoName - name - gitProvider - gitRepoUrl - build { - baseImage - cmd - } - gitBranch - run { - baseImage - cmd - } - metadata - } - } -variables: - pipelineId: pip-xlf2psoeq4ft215kuyhija7vlezj ---- -label: Delete pipeline -query: | - mutation Ci_deletePipeline($pipelineId: ID!) { - ci_deletePipeline(pipelineId: $pipelineId) - } -variables: - pipelineId: pip-sdmpguqbhbcdsbbsbzklc9ogfsff diff --git a/.tools/__http__/sample.yml b/.tools/__http__/sample.yml deleted file mode 100644 index faca27f4e..000000000 --- a/.tools/__http__/sample.yml +++ /dev/null @@ -1,115 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: wireguard - labels: - name: wireguard - ---- - -# apiVersion: v1 -# kind: PersistentVolumeClaim -# metadata: -# name: pv-claim-wireguard -# namespace: wireguard -# spec: -# storageClassName: do-block-storage -# accessModes: -# - ReadWriteOnce -# resources: -# requests: -# storage: 1Gi - ---- - -apiVersion: v1 -kind: ConfigMap -metadata: - name: wireguard-configmap - namespace: wireguard -data: - PUID: "1000" - PGID: "1000" - TZ: "Asia/kolkata" - SERVERPORT: "31820" - PEERS: "0" - ---- - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: wireguard-deployment - namespace: wireguard -spec: - replicas: 1 - strategy: - type: Recreate - selector: - matchLabels: - app: wireguard - template: - metadata: - labels: - app: wireguard - spec: - containers: - - name: wireguard - image: ghcr.io/linuxserver/wireguard - # command: - # - bash - # - -c - # - tail -f /dev/null - envFrom: - - configMapRef: - name: wireguard-configmap - securityContext: - capabilities: - add: - - NET_ADMIN - - SYS_MODULE - privileged: true - volumeMounts: - - name: wg-config - mountPath: /config - - name: host-volumes - mountPath: /lib/modules - ports: - - containerPort: 51820 - protocol: UDP - resources: - requests: - memory: "64Mi" - cpu: "100m" - limits: - memory: "128Mi" - cpu: "200m" - volumes: - - name: wg-config - hostPath: - path: /tmp - type: Directory - - name: host-volumes - hostPath: - path: /lib/modules - type: Directory - ---- - -kind: Service -apiVersion: v1 -metadata: - labels: - k8s-app: wireguard - name: wireguard-service - namespace: wireguard -spec: - type: NodePort - ports: - - port: 51820 - nodePort: 31820 - protocol: UDP - targetPort: 51820 - selector: - app: wireguard - diff --git a/.tools/__http__/test-redis.yml b/.tools/__http__/test-redis.yml deleted file mode 100644 index 5a9fce0ce..000000000 --- a/.tools/__http__/test-redis.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -query: | - query Test { - sample - } diff --git a/.tools/__http__/wireguard-cluster.graphql.yml b/.tools/__http__/wireguard-cluster.graphql.yml deleted file mode 100644 index ec3046574..000000000 --- a/.tools/__http__/wireguard-cluster.graphql.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- -label: List Clusters -query: | - query ListClusters { - listClusters { - id - name - } - } - ---- -label: Create Cluster -query: | - mutation CreateCluster($name: String!, $provider: String!, $region: String!) { - createCluster(name: $name, provider: $provider, region: $region) { - id - name - provider - endpoint - region - } - } - -variables: - name: "clusterfather" - provider: do - region: blr1 ---- diff --git a/.tools/dev/ci-external-name.yml b/.tools/dev/ci-external-name.yml deleted file mode 100644 index fbf4557f9..000000000 --- a/.tools/dev/ci-external-name.yml +++ /dev/null @@ -1,8 +0,0 @@ -kind: Service -apiVersion: v1 -metadata: - name: ci-api-local - namespace: hotspot -spec: - type: ExternalName - externalName: tunneling.hotspot.svc.cluster.local diff --git a/.tools/dev/ci-local-ingress.yml b/.tools/dev/ci-local-ingress.yml deleted file mode 100644 index 8c3ed03fa..000000000 --- a/.tools/dev/ci-local-ingress.yml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: ci-api.hotspot.local - namespace: hotspot - annotations: - # cert-manager.io/cluster-issuer: kl-cert-issuer - kubernetes.io/ingress.class: nginx - nginx.ingress.kubernetes.io/ssl-redirect: "false" - nginx.ingress.kubernetes.io/upstream-vhost: ci-api.hotspot.local -spec: - rules: - - host: ci-api.hotspot.local - http: - paths: - - pathType: Prefix - path: / - backend: - service: - name: tunneling - port: - number: 80 diff --git a/.tools/gqlenv.yml b/.tools/gqlenv.yml deleted file mode 100644 index 9f07ee5db..000000000 --- a/.tools/gqlenv.yml +++ /dev/null @@ -1,17 +0,0 @@ -mode: dev -map: - dev: - # url: https://gateway.kloudlite.io - # url: https://gateway.dev.kloudlite.io - # url: ***REMOVED*** - # url: http://localhost:3000/query - # url: http://auth-api.kl-core.svc.cluster.local/query - # url: http://finance-api.kl-core.svc.cluster.local/query - # url: http://localhost:3000/query - # url: http://console-api.kl-core.svc.cluster.local/query - # url: http://auth-api.kl-core.svc.cluster.local/query - # url: http://infra-api.kl-core.svc.cluster.local/query - # url: http://infra-api.kl-core.svc.cluster.local/query - url: http://gateway-api.kl-core.svc.cluster.local/query - headers: - cookie: hotspot-session=ses-ykthtwm9so4cnklyocuckywjx6ro; domain=.kloudlite.io; path=/; HttpOnly; secure; SameSite=None;kloudlite-account=kloudlite-dev;kloudlite-cluster=sample2; diff --git a/.tools/hotspot.yml b/.tools/hotspot.yml deleted file mode 100644 index ee9589c76..000000000 --- a/.tools/hotspot.yml +++ /dev/null @@ -1,47 +0,0 @@ -namespace: hotspot - -tunnels: - - nxt-gateway:80 -> app:4000 - - tekton-interceptor:80 -> app:5001 - - message-consumer:80 -> app:5001 - -local: - services: - - name: app - image: nxtcoder17/home - environment: - ABC: 'hello' - # command: - # - pnpm all - working_dir: /home/node/app - volumes: - - .:/home/node/app - - - name: mongo - image: mongo:latest - command: mongod --port 27018 - - - name: messenger - image: nxtcoder17/home - working_dir: /home/node/app - volumes: - - ../api-go:/home/node/app - - ~/.kube/configs/dev-hotspot-01.yml:/tmp/kconfig - environment: - KUBECONFIG: /tmp/kconfig - # command: - # - pnpm all - - mounts: - dir: /var/mounts - configs: - - gateway-supergraph - secrets: - - auth-api-secret - - auth-api-github-app-pk - - mongo-creds-mongodb - - redis-creds-redis-db - - comms-sendgrid-api - - finance-api-secret - -kubeConfig: ~/.kube/configs/dev-hotspot-01.yml diff --git a/.tools/lua/dap.lua b/.tools/lua/dap.lua deleted file mode 100644 index 8355563cc..000000000 --- a/.tools/lua/dap.lua +++ /dev/null @@ -1,46 +0,0 @@ -local M = {} - -local dap = require("dap") - -M.setup = function() - dap.configurations.go = { - { - type = "delve", - request = "launch", - program = "${file}", - debugAdapter = "dlv", - showLog = true, - -- console = "externalTerminal", - console = "internalTerminal", - internalTerminal = true, - externalTerminal = true, - -- env = { - -- hello = "hi", - -- }, - envFile = { - "${workspaceFolder}/.secrets/env", - "${workspaceFolder}/.env", - }, - }, - } - - dap.adapters.go = { - type = "server", - port = "${port}", - executable = { - command = "dlv", - args = { "dap", "-l", "127.0.0.1:${port}" }, - }, - } - - dap.adapters.delve = { - type = "server", - port = "${port}", - executable = { - command = "dlv", - args = { "dap", "-l", "127.0.0.1:${port}" }, - }, - } -end - -return M diff --git a/.tools/nvim/__http__/accounts/accounts.graphql.yml b/.tools/nvim/__http__/accounts/accounts.graphql.yml new file mode 100644 index 000000000..b352865c4 --- /dev/null +++ b/.tools/nvim/__http__/accounts/accounts.graphql.yml @@ -0,0 +1,120 @@ +--- +global: + accountName: kloudlite-dev +--- + +label: List Accounts +query: |+ + query Accounts_listAccounts { + accounts_listAccounts { + isActive + id + displayName + creationTime + markedForDeletion + metadata{ + # labels + name + } + } + } + +--- + +label: Get Account +query: |+ + query Accounts_getAccount($accountName: String!) { + accounts_getAccount(accountName: $accountName) { + metadata { + name + } + } + } +variables: + # accountName: "{{.accountName}}" + accountName: "sample" + +--- + +label: Create Account +query: | + mutation Accounts_createAccount($account: AccountIn!) { + accounts_createAccount(account: $account) { + apiVersion + id + isActive + kind + } + } +variables: + account: + contactEmail: "{{.email}}" + displayName: "Sample Account" + metadata: + name: "{{.accountName}}" + spec: {} + +--- + +label: Update Account +query: | + mutation Accounts_updateAccount($account: AccountIn!) { + accounts_updateAccount(account: $account) { + apiVersion + id + isActive + kind + } + } +variables: + account: + contactEmail: "sample@gmail.com" + displayName: "sample" + metadata: + name: sample + namespace: sample + labels: + k1: v1 + spec: {} + +--- + +label: Deactivate Account +query: |+ + mutation Accounts_deactivateAccount($accountName: String!) { + accounts_deactivateAccount(accountName: $accountName) + } +variables: + accountName: "{{.accountName}}" + +--- + +label: Activate Account +query: |+ + mutation Accounts_activateAccount($accountName: String!) { + accounts_activateAccount(accountName: $accountName) + } +variables: + accountName: "{{.accountName}}" +--- + +lable: Check Name Availability +query: |+ + query Accounts_checkNameAvailability($name: String!) { + accounts_checkNameAvailability(name: $name) { + result + suggestedNames + } + } +variables: + name: sample +--- + +label: Delete Account +query: |+ + mutation Accounts_deleteAccount($accountName: String!) { + accounts_deleteAccount(accountName: $accountName) + } +variables: + accountName: "{{.accountName}}" +--- diff --git a/.tools/nvim/__http__/accounts/invitations.graphql.yml b/.tools/nvim/__http__/accounts/invitations.graphql.yml new file mode 100644 index 000000000..1d27ea7cc --- /dev/null +++ b/.tools/nvim/__http__/accounts/invitations.graphql.yml @@ -0,0 +1,100 @@ +--- +global: + # accountName: kloudlite-dev + accountName: not-sample + invitationId: "invite-************" + emailToInvite: "*************@kloudlite.io" +--- + +label: List Invitations +query: |+ + query Accounts_listInvitations($accountName: String!) { + accounts_listInvitations(accountName: $accountName) { + id + inviteToken + userEmail + userRole + accepted + rejected + } + } +variables: + accountName: "{{.accountName}}" +--- + +label: List Invitations For User +query: |+ + query Accounts_listInvitationsForUser($onlyPending: Boolean!) { + accounts_listInvitationsForUser(onlyPending: $onlyPending) { + id + inviteToken + userEmail + userRole + accepted + rejected + } + } +variables: + onlyPending: true + +--- + +label: Get Invitation +query: |+ + query Accounts_getInvitation($accountName: String!, $invitationId: String!) { + accounts_getInvitation(accountName: $accountName, invitationId: $invitationId) { + id + inviteToken + } + } +variables: + accountName: "{{.accountName}}" + invitationId: "{{.invitationId}}" +--- + +label: Invite Member +query: |+ + mutation Accounts_inviteMember($accountName: String!, $invitation: InvitationIn!) { + accounts_inviteMember(accountName: $accountName, invitation: $invitation) { + id + userRole + } + } +variables: + accountName: "{{.accountName}}" + invitation: + userEmail: "{{.emailToInvite}}" + userRole: "account_admin" + +--- + +label: Resend Invite Email +query: |+ + mutation Accounts_resendInviteMail($accountName: String!, $invitationId: String!) { + accounts_resendInviteMail(accountName: $accountName, invitationId: $invitationId) + } +variables: + accountName: "{{.accountName}}" + invitationId: "{{.invitationId}}" +--- + +label: Delete Invitation +query: |+ + mutation Accounts_deleteInvitation($accountName: String!, $invitationId: String!) { + accounts_deleteInvitation(accountName: $accountName, invitationId: $invitationId) + } +variables: + accountName: "{{.accountName}}" + invitationId: "{{.invitationId}}" +--- + +label: Accept Invitation +query: |+ + mutation Accounts_acceptInvitation($accountName: String!, $inviteToken: String!) { + accounts_acceptInvitation(accountName: $accountName, inviteToken: $inviteToken) + } + +variables: + accountName: "{{.accountName}}" + inviteToken: "{{.invitationId}}" +--- diff --git a/.tools/nvim/__http__/accounts/memberships.graphql.yml b/.tools/nvim/__http__/accounts/memberships.graphql.yml new file mode 100644 index 000000000..b131d5096 --- /dev/null +++ b/.tools/nvim/__http__/accounts/memberships.graphql.yml @@ -0,0 +1,64 @@ +--- +global: + # accountName: kloudlite-dev + accountName: sample +--- + +label: List Memberships For User +query: |+ + query Accounts_listMembershipsForUser { + accounts_listMembershipsForUser { + accountName + role + userId + } + } +--- + +label: List Memberships For Account +query: |+ + query Accounts_listMembershipsForAccount($accountName: String!) { + accounts_listMembershipsForAccount(accountName: $accountName) { + accountName + role + user { + id + name + email + accounts { + role + accountName + } + } + } + } +variables: + # accountName: kloudlite-dev + accountName: sample + +--- + + +label: Get Account Membership +query: |+ + query Accounts_getAccountMembership($accountName: String!) { + accounts_getAccountMembership(accountName: $accountName) { + accountName + role + userId + } + } +variables: + # accountName: "{{.accountName}}" + accountName: "sample-8afe" +--- + +label: Remove Membership +query: |+ + mutation Accounts_removeAccountMembership($accountName: String!, $memberId: ID!) { + accounts_removeAccountMembership(accountName: $accountName, memberId: $memberId) + } +variables: + accountName: "{{.accountName}}" + memberId: "usr-njg-jjakbodnyw5aeax4bx1x3e-z" +--- diff --git a/.tools/__http__/auth/auth.graphql.yml b/.tools/nvim/__http__/auth/auth.graphql.yml similarity index 82% rename from .tools/__http__/auth/auth.graphql.yml rename to .tools/nvim/__http__/auth/auth.graphql.yml index b2a9f67c0..824d6dc62 100644 --- a/.tools/__http__/auth/auth.graphql.yml +++ b/.tools/nvim/__http__/auth/auth.graphql.yml @@ -1,8 +1,4 @@ --- -global: - hello: world - password: sample ---- query: | mutation Auth_signup($name: String!, $email: String!, $password: String!) { auth_signup(name: $name, email: $email, password: $password) { @@ -14,7 +10,7 @@ query: | } } variables: - email: sample@gmail.com + email: "{{.email}}" password: "{{.password}}" name: Sample Kumar @@ -46,8 +42,8 @@ query: | } } variables: - email: sample@gmail.com - password: sample + email: "{{.email}}" + password: "{{.password}}" --- label: "OAuth Login Request" @@ -71,9 +67,9 @@ query: | } } variables: - code: a12dbd32b0960e9390c3 + code: "**************" provider: github - state: eyJjc3JmIjoib1ZqM3k4eGhwLUppemVxMy1NdjktelhzLVVLLTBRUVUiLCJzdGF0ZSI6IiJ9 + state: "************" --- label: Me @@ -83,8 +79,10 @@ query: | avatar id email - providerGitlab - providerGithub + name + # providerGitlab + # providerGithub + # verified } } @@ -95,7 +93,7 @@ query: | ci_githubInstallationToken(installationId: $installationId) } variables: - installationId: 123432 + installationId: "************" --- label: List Github Installations @@ -111,7 +109,7 @@ query: | ci_githubRepos(installationId: $installationId) } variables: - installationId: 22636591 + installationId: "********" # page: 1 # limit: 20 @@ -214,18 +212,44 @@ variables: repoId: "26232015" --- +label: Verify Email +query: |+ + mutation Auth_verifyEmail($token: String!) { + auth_verifyEmail(token: $token) { + id + loginMethod + } + } +variables: + token: "{{.verify_token}}" +--- + +label: Request Reset Password query: | - mutation Auth_resetPassword($email: String!) { + mutation Auth_requestResetPassword($email: String!) { auth_requestResetPassword(email: $email) } variables: - email: shashwatsingh005@gmail.com + email: "{{.email}}" + --- + +label: Reset Password query: | mutation Auth_resetPassword($token: String!, $password: String!) { auth_resetPassword(token: $token, password: $password) } variables: - token: + token: "{{.reset_token}}" + password: "{{.password}}" +--- +query: |+ + query ListOAuthProviders { + auth_listOAuthProviders { + provider + enabled + } + } +--- diff --git a/.tools/nvim/__http__/console/apps.graphql.yml b/.tools/nvim/__http__/console/apps.graphql.yml new file mode 100644 index 000000000..d00f1e2d3 --- /dev/null +++ b/.tools/nvim/__http__/console/apps.graphql.yml @@ -0,0 +1,168 @@ +--- +global: + name: sample-app +--- + +label: List Apps +query: |+ #graphql + query Core_listApps($projectName: String!, $envName: String!) { + core_listApps(projectName: $projectName, envName: $envName) { + edges { + node { + id + environmentName + lastUpdatedBy { + userEmail + userId + userName + } + metadata { + name + annotations + } + syncStatus { + state + action + error + syncScheduledAt + recordVersion + } + projectName + recordVersion + kind + displayName + accountName + } + } + } + } +variables: + projectName: "{{.projectName}}" + envName: "{{.envName}}" +--- + +label: Get App +query: |+ #graphql + query Core_getApp($project: ProjectId!, $scope: WorkspaceOrEnvId!, $name: String!) { + core_getApp(project: $project, scope: $scope, name: $name) { + metadata { + name + deletionTimestamp + } + spec { + containers{ + name + image + } + } + } + } +variables: + project: + type: name + value: sample + scope: + # type: workspaceName + # value: sample + type: workspaceTargetNamespace + value: "{{.namespace}}" + # namespace: "{{.namespace}}" + name: "{{.name}}" +--- + +label: Create App +query: |+ #graphql + mutation Core_createApp($projectName: String!, $envName: String!, $app: AppIn!) { + core_createApp(projectName: $projectName, envName: $envName, app: $app) { + metadata { + name + } + syncStatus { + state + recordVersion + error + action + lastSyncedAt + } + createdBy{ + userId + userName + userEmail + } + } + } +variables: + projectName: "{{.projectName}}" + envName: "{{.envName}}" + app: + displayName: "sample app" + metadata: + name: "{{.name}}" + # name: "SAMPLE2" + spec: + services: + - type: tcp + port: 80 + targetPort: 80 + containers: + - name: main + # image: kong/httpbin + image: nginx +--- + +label: Update App +query: |+ #graphql + mutation Core_updateApp($projectName: String!, $envName: String!, $app: AppIn!) { + core_updateApp(projectName: $projectName, envName: $envName, app: $app) { + metadata { + name + generation + } + syncStatus { + state + recordVersion + } + recordVersion + } + } +variables: + projectName: "{{.projectName}}" + envName: "{{.envName}}" + app: + displayName: "sample app" + metadata: + name: '{{.name}}' + spec: + services: + - type: tcp + port: 80 + targetPort: 80 + containers: + - name: main + image: kong/httpbin + # image: nginx + +--- + +label: Delete App +query: |+ #graphql + mutation Core_deleteApp($projectName: String!, $envName: String!, $appName: String!) { + core_deleteApp(projectName: $projectName, envName: $envName, appName: $appName) + } +variables: + projectName: "{{.projectName}}" + envName: "{{.envName}}" + appName: "{{.name}}" +--- + +--- +label: restart app +query: |+ + query Query($projectName: String!, $envName: String!, $appName: String!) { + core_restartApp(projectName: $projectName, envName: $envName, appName: $appName) + } +variables: + projectName: "{{.projectName}}" + envName: "{{.envName}}" + appName: "nginx" +--- diff --git a/.tools/nvim/__http__/console/configs.graphql.yml b/.tools/nvim/__http__/console/configs.graphql.yml new file mode 100644 index 000000000..fb1ba8d66 --- /dev/null +++ b/.tools/nvim/__http__/console/configs.graphql.yml @@ -0,0 +1,156 @@ +--- +global: + name: sample-config +--- + +label: List Configs +query: |+ #graphql + query Core_listConfigs($projectName: String!, $envName: String!) { + core_listConfigs(projectName: $projectName, envName: $envName) { + edges { + cursor + node { + creationTime + accountName + apiVersion + kind + metadata { + name + namespace + generation + } + syncStatus { + state + error + recordVersion + action + lastSyncedAt + } + recordVersion + } + } + pageInfo { + endCursor + hasNextPage + hasPreviousPage + startCursor + } + totalCount + } + } +variables: + projectName: "{{.projectName}}" + envName: "{{.envName}}" +--- + +label: Create Config +query: |+ #graphql + mutation Core_createConfig($projectName: String!, $envName: String!, $config: ConfigIn!) { + core_createConfig(projectName: $projectName, envName: $envName, config: $config) { + metadata { + name + namespace + } + syncStatus { + state + action + recordVersion + } + recordVersion + data + } + } + +variables: + projectName: "{{.projectName}}" + envName: "{{.envName}}" + config: + displayName: "Sample Config" + metadata: + name: '{{.name}}' + namespace: '{{.namespace}}' + data: + key1: value1 + key2: value2 +--- + +label: Get Config +query: |+ #graphql + query Core_getConfig($namespace: String!, $name: String!) { + core_getConfig(namespace: $namespace, name: $name) { + metadata { + name + namespace + generation + } + status { + isReady + checks + lastReconcileTime + } + syncStatus { + state + action + generation + } + data + } + } +variables: + name: '{{.name}}' + namespace: '{{.namespace}}' + +--- + +label: Update Config +query: |+ #graphql + mutation Core_updateConfig($projectName: String!, $envName: String!, $config: ConfigIn!) { + core_updateConfig(projectName: $projectName, envName: $envName, config: $config) { + metadata { + name + namespace + generation + } + syncStatus{ + state + action + lastSyncedAt + } + data + } + } +variables: + projectName: "{{.projectName}}" + envName: "{{.envName}}" + config: + displayName: "Sample Config Update" + metadata: + name: '{{.name}}' + namespace: '{{.namespace}}' + data: + key1: valueX + # key2: value-for-key-2 + key3: Fdsfafaskfjsdfjasfj +--- + +label: Delete Config +query: |+ #graphql + mutation Core_deleteConfig($projectName: String!, $envName: String!, $configName: String!) { + core_deleteConfig(projectName: $projectName, envName: $envName, configName: $configName) + } +variables: + projectName: '{{.projectName}}' + envName: "{{.envName}}" + configName: "{{.name}}" +--- + +label: Resync Config +query: |+ + query Query($namespace: String!, $name: String!) { + core_resyncConfig(namespace: $namespace, name: $name) + } +variables: + namespace: '{{.namespace}}' + name: "{{.name}}" + +--- diff --git a/.tools/nvim/__http__/console/environments.graphql.yml b/.tools/nvim/__http__/console/environments.graphql.yml new file mode 100644 index 000000000..5a39b7745 --- /dev/null +++ b/.tools/nvim/__http__/console/environments.graphql.yml @@ -0,0 +1,151 @@ +--- +global: + envTargetNamespace: "nxtcoder17" +--- + +label: List Environments +query: |+ #graphql + query Core_listEnvironments($projectName: String!) { + core_listEnvironments(projectName: $projectName) { + edges { + cursor + node { + id + creationTime + accountName + apiVersion + kind + markedForDeletion + metadata { + name + namespace + } + createdBy{ + userId + userName + } + lastUpdatedBy{ + userName + } + spec { + targetNamespace + routing { + mode + } + } + syncStatus { + state + error + recordVersion + action + } + recordVersion + } + } + pageInfo { + endCursor + hasNextPage + hasPreviousPage + startCursor + } + totalCount + } + } +variables: + projectName: "{{.projectName}}" + +--- + +label: Create Environment +query: |+ #graphql + mutation Core_createEnvironment($projectName: String!, $env: EnvironmentIn!) { + core_createEnvironment(projectName: $projectName, env: $env) { + apiVersion + kind + spec { + projectName + targetNamespace + } + syncStatus { + state + lastSyncedAt + recordVersion + action + syncScheduledAt + } + } + } +variables: + projectName: "{{.projectName}}" + env: + displayName: Display Name of a sample environment + metadata: + name: "{{.envName}}" + spec: + projectName: "{{.projectName}}" +--- + +label: resync environment +query: |+ + query Query($projectName: String!, $name: String!) { + core_resyncEnvironment(projectName: $projectName, name: $name) + } +variables: + projectName: "{{.projectName}}" + name: "{{.envName}}" +--- + +label: "Update Environment" +query: |+ #graphql + mutation Core_updateEnvironment($projectName: String!, $env: EnvironmentIn!) { + core_updateEnvironment(projectName: $projectName, env: $env) { + spec { + projectName + targetNamespace + routing { + mode + } + } + } + } +variables: + projectName: "{{.projectName}}" + env: + displayName: Display Name of a sample environment + metadata: + name: "{{.envName}}" + spec: + projectName: "{{.projectName}}" + routing: + mode: public + +--- + +label: "delete environment" +query: |+ + mutation Core_deleteEnvironment($projectName: String!, $envName: String!) { + core_deleteEnvironment(projectName: $projectName, envName: $envName) + } +variables: + projectName: "{{.projectName}}" + envName: "{{.clonedEnvName}}" +--- + +--- +label: Clone Environment +query: |+ #graphql + mutation Core_cloneEnvironment($projectName: String!, $sourceEnvName: String!, $destinationEnvName: String!, $displayName: String!, $environmentRoutingMode: Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingMode!) { + core_cloneEnvironment(projectName: $projectName, sourceEnvName: $sourceEnvName, destinationEnvName: $destinationEnvName, displayName: $displayName, environmentRoutingMode: $environmentRoutingMode) { + metadata { + name + } + } + } + +variables: + projectName: "{{.projectName}}" + sourceEnvName: "{{.envName}}" + destinationEnvName: "{{.clonedEnvName}}" + displayName: "clone of {{.envName}}" + environmentRoutingMode: "private" +--- diff --git a/.tools/nvim/__http__/console/image-pull-secrets.yml b/.tools/nvim/__http__/console/image-pull-secrets.yml new file mode 100644 index 000000000..b2b6731d1 --- /dev/null +++ b/.tools/nvim/__http__/console/image-pull-secrets.yml @@ -0,0 +1,66 @@ +--- +label: List Image Pull Secrets +query: |+ #graphql + query Core_listImagePullSecrets($projectName: String!, $envName: String!) { + core_listImagePullSecrets(projectName: $projectName, envName: $envName) { + edges { + node { + format + dockerConfigJson + environmentName + } + } + } + } +variables: + projectName: "{{.projectName}}" + envName: "{{.envName}}" + +--- + +query: |+ #graphql + mutation Core_createImagePullSecret($projectName: String!, $envName: String!, $imagePullSecretIn: ImagePullSecretIn!) { + core_createImagePullSecret(projectName: $projectName, envName: $envName, imagePullSecretIn: $imagePullSecretIn) { + format + dockerConfigJson + } + } +variables: + # projectName: "{{.projectName}}" + # envName: "{{.envName}}" + projectName: "demo-project" + envName: "public-environment" + imagePullSecretIn: + displayName: "Image Pull Secret" + metadata: + name: test-ips + format: dockerConfigJson + dockerConfigJson: |+ + { + "auths": { + "ghcr.io": { + "auth": "************" + } + } + } +--- + +query: |+ + query Query($projectName: String!, $envName: String!, $name: String!) { + core_resyncImagePullSecret(projectName: $projectName, envName: $envName, name: $name) + } +variables: + projectName: "demo-project" + envName: "public-environment" + name: "test-ips" +--- + +query: |+ + mutation Core_deleteImagePullSecret($projectName: String!, $envName: String!, $secretName: String!) { + core_deleteImagePullSecret(projectName: $projectName, envName: $envName, secretName: $secretName) + } +variables: + projectName: "demo-project" + envName: "public-environment" + secretName: "test-ips" +--- diff --git a/.tools/nvim/__http__/console/logs-and-metrics.rest.yml b/.tools/nvim/__http__/console/logs-and-metrics.rest.yml new file mode 100644 index 000000000..d5aad41ab --- /dev/null +++ b/.tools/nvim/__http__/console/logs-and-metrics.rest.yml @@ -0,0 +1,46 @@ +--- +global: + namespace: "sample-nxtcoder17" + accountName: kloudlite-dev + workspaceName: sample + + clusterName: "nova-303453" + clusterNamespace: "kl-account-nova" + + endTime: '1700803914' + startTime: '1700717575' +--- + +label: Get Logs for App +query: + method: GET + url: 'http://console-api.karthik-testing.svc.cluster.local:9100/observability/logs/app?resource_name={{.name}}&resource_namespace={{.namespace}}&start_time={{.startTime}}&end_time={{.endTime}}' + +--- +label: Get Logs for Job +query: + method: GET + url: 'https://observability.dev.kloudlite.io/observability/logs/app?job_name={{.job_name}}&job_namespace={{.job_namespace}}&start_time={{.startTime}}&end_time={{.endTime}}' + +--- + +label: Get Memory Metrics for App +query: + method: GET + # url: 'http://console-api.kl-core.svc.cluster.local:9100/observability/metrics/memory?workspace_name={{.workspaceName}}&start_time={{.startTime}}&end_time={{.endTime}}' + url: 'http://console-api.karthik-testing.svc.cluster.local:9100/observability/metrics/memory?cluster_name=sample-cluster&tracking_id=app-k-zmtg0km7epjj-fq89uvao14-3-l' + +--- + +label: Get Cpu Metrics for App +query: + method: GET + url: 'http://localhost:9999/observability/metrics/cpu?workspace_name={{.workspaceName}}&start_time={{.startTime}}&end_time={{.endTime}}' + +--- + +label: Get Logs for cluster jobs +query: + method: GET + url: 'http://console-api.kl-core.svc.cluster.local:9100/observability/logs/cluster-job?start_time={{.startTime}}&end_time={{.endTime}}' +--- diff --git a/.tools/nvim/__http__/console/mres.graphql.yml b/.tools/nvim/__http__/console/mres.graphql.yml new file mode 100644 index 000000000..1f0d67c64 --- /dev/null +++ b/.tools/nvim/__http__/console/mres.graphql.yml @@ -0,0 +1,172 @@ +--- +global: + namespace: kl-core + # name: s1 + name: test-db +--- + +label: List Managed Resources +query: |+ #graphql + query Core_listManagedResources($projectName: String!, $envName: String!) { + core_listManagedResources(projectName: $projectName, envName: $envName) { + edges { + node { + accountName + spec { + resourceName + resourceTemplate { + msvcRef { + apiVersion + kind + name + namespace + } + } + } + syncStatus { + state + recordVersion + } + } + } + } + } +variables: + projectName: "{{.projectName}}" + envName: "{{.envName}}" +--- + +label: Create Managed Resource +query: |+ #graphql + mutation Core_createManagedResource($projectName: String!, $envName: String!, $mres: ManagedResourceIn!) { + core_createManagedResource(projectName: $projectName, envName: $envName, mres: $mres) { + spec { + resourceName + resourceTemplate { + apiVersion + kind + msvcRef { + apiVersion + kind + name + namespace + } + spec + } + } + } + } +variables: + projectName: "{{.projectName}}" + envName: "{{.envName}}" + mres: + displayName: "Test Managed Resource" + metadata: + name: "{{.name}}" + spec: + resourceTemplate: + apiVersion: mongodb.msvc.kloudlite.io/v1 + kind: Database + msvcRef: + apiVersion: mongodb.msvc.kloudlite.io/v1 + kind: StandaloneService + name: mongodb + namespace: pmsvc-mongodb + spec: + resourceName: "sample" + +--- + +label: Get ManagedService +query: |+ + query Core_getManagedResource($namespace: String!, $name: String!) { + core_getManagedResource(namespace: $namespace, name: $name) { + metadata { + name + } + kind + spec { + inputs + } + } + } +variables: + name: '{{.name}}' + namespace: '{{.namespace}}' + +--- + +label: Update ManagedService +query: |+ + mutation Core_updateManagedResource($mres: ManagedResourceIn!) { + core_updateManagedResource(mres: $mres) { + spec { + inputs + } + } + } +variables: + mres: + metadata: + name: '{{.name}}' + namespace: '{{.namespace}}' + spec: + inputs: + k1: v1 + msvcRef: + apiVersion: "###" + kind: StandaloneDatabase + name: s1 + mresKind: + kind: Database +--- + +label: Delete ManagedService +query: |+ + mutation Core_deleteManagedResource($namespace: String!, $name: String!) { + core_deleteManagedResource(namespace: $namespace, name: $name) + } +variables: + namespace: '{{.namespace}}' + name: "{{.name}}" + +--- + +label: Get Managed Resource Output Keys +query: |+ #graphql + query Query($projectName: String!, $envName: String!, $name: String!) { + core_getManagedResouceOutputKeys(projectName: $projectName, envName: $envName, name: $name) + } +variables: + # projectName: "{{.projectName}}" + # envName: "{{.envName}}" + # envName: "public-environment" + projectName: "demo-project" + envName: "private-environment" + # name: "{{.name}}" + name: "test-sample-db" + +--- + +label: Get Managed Resource Output Key Values +query: |+ #graphql + query Core_getManagedResouceOutputKeyValues($projectName: String!, $envName: String!, $keyrefs: [ManagedResourceKeyRefIn]) { + core_getManagedResouceOutputKeyValues(projectName: $projectName, envName: $envName, keyrefs: $keyrefs) { + key + mresName + value + } + } +variables: + # projectName: "{{.projectName}}" + # envName: "{{.envName}}" + projectName: "demo-project" + # envName: "public-environment" + projectName: "demo-project" + envName: "private-environment" + keyrefs: + - key: URI + # mresName: "{{.name}}" + mresName: "test-sample-db" + +--- diff --git a/.tools/__http__/console/msvc.graphql.yml b/.tools/nvim/__http__/console/msvc.graphql.yml similarity index 65% rename from .tools/__http__/console/msvc.graphql.yml rename to .tools/nvim/__http__/console/msvc.graphql.yml index 115dbc58f..a88ca3b6e 100644 --- a/.tools/__http__/console/msvc.graphql.yml +++ b/.tools/nvim/__http__/console/msvc.graphql.yml @@ -4,6 +4,60 @@ global: name: s1 --- +label: List Managed Service Templates +query: |+ + query Core_listManagedServiceTemplates { + core_listManagedServiceTemplates { + category + displayName + items { + apiVersion + kind + description + active + displayName + fields { + defaultValue + inputType + label + max + min + name + required + unit + } + logoUrl + name + outputs { + name + label + description + } + resources { + description + displayName + fields { + defaultValue + inputType + label + max + min + name + required + unit + } + name + outputs { + description + label + name + } + } + } + } + } +--- + label: List Managed Services query: |+ query Core_listRouters($namespace: String!) { @@ -95,4 +149,5 @@ query: |+ variables: namespace: '{{.namespace}}' name: "{{.name}}" + --- diff --git a/.tools/nvim/__http__/console/names.graphql.yml b/.tools/nvim/__http__/console/names.graphql.yml new file mode 100644 index 000000000..63766f14d --- /dev/null +++ b/.tools/nvim/__http__/console/names.graphql.yml @@ -0,0 +1,35 @@ +--- +global: + accountName: kloudlite-dev + name: sample + namespace: s1 + +--- +label: Check Name Availability +query: |+ #graphql + query Core_checkNameAvailability($projectName: String!, $resType: ConsoleResType!, $name: String!) { + core_checkNameAvailability(projectName: $projectName, resType: $resType, name: $name) { + result + suggestedNames + } + } +variables: + # projectName: "{{.projectName}}" + projectName: "world-bikash" + resType: project_managed_service + name: "hello-world" +--- + +label: Check Name Availability With Namespace +query: |+ #graphql + query Core_checkNameAvailability($resType: ConsoleResType!, $name: String!, $namespace: String) { + core_checkNameAvailability(resType: $resType, name: $name, namespace: $namespace) { + result + suggestedNames + } + } +variables: + resType: app + name: s1x + namespace: "sample-nxtcoder17" +-- diff --git a/.tools/nvim/__http__/console/project-managed-services.yml b/.tools/nvim/__http__/console/project-managed-services.yml new file mode 100644 index 000000000..975cb322e --- /dev/null +++ b/.tools/nvim/__http__/console/project-managed-services.yml @@ -0,0 +1,29 @@ +--- +label: list project managed services +query: |+ + query Core_listProjectManagedServices($projectName: String!) { + core_listProjectManagedServices(projectName: $projectName) { + edges { + node { + metadata { + name + annotations + } + } + } + } + } +variables: + projectName: "{{.projectName}}" +--- + +label: restart project managed service +query: |+ #graphql + query Query($projectName: String!, $name: String!) { + core_restartProjectManagedService(projectName: $projectName, name: $name) + } +variables: + projectName: "{{.projectName}}" + name: "sampledbservice" + +--- diff --git a/.tools/__http__/console/projects.graphql.yml b/.tools/nvim/__http__/console/projects.graphql.yml similarity index 51% rename from .tools/__http__/console/projects.graphql.yml rename to .tools/nvim/__http__/console/projects.graphql.yml index 904d15781..93fcfb9dc 100644 --- a/.tools/__http__/console/projects.graphql.yml +++ b/.tools/nvim/__http__/console/projects.graphql.yml @@ -1,7 +1,5 @@ --- global: - accountName: kloudlite-dev - clusterName: sample2 targetNamespace: sample name: sample --- @@ -10,28 +8,53 @@ label: List Projects query: |+ query Core_listProjects { core_listProjects { - metadata { - name + edges { + cursor + node { + updateTime + creationTime + accountName + clusterName + apiVersion + kind + metadata { + name + generation + creationTimestamp + } + spec { + targetNamespace + } + syncStatus { + state + action + error + recordVersion + } + recordVersion + status { + isReady + } + } } - spec { - accountName - clusterName - targetNamespace - } - status { - isReady - checks - } - syncStatus{ - lastSyncedAt - action - generation - state - error + pageInfo { + endCursor + hasNextPage + hasPreviousPage + startCursor } + totalCount } } - +variables: + # pq: + # first: 10 + # # before: NjQ2ZjAzYzdhMWE2OTI2MDhhODdlN2U5 + # # before: NjQ2ZjAzYzdhMWE2OTI2MDhhODdlN2U5 + # # after: NjQ2ZGU4MWRkMTM2NGYwZjBlYmE4MmVh + # + # orderBy: metadata.name + # sortBy: ASC --- label: Get Project @@ -45,11 +68,17 @@ query: |+ accountName targetNamespace } + syncStatus { + state + action + error + recordVersion + lastSyncedAt + } } } variables: name: "{{.name}}" - # name: "sample123" --- label: Create Project @@ -63,12 +92,12 @@ query: |+ } variables: project: + clusterName: "sample-cluster2" + displayName: "Sample Project" metadata: - name: "{{.name}}" + name: "{{.projectName}}" spec: - clusterName: "{{.clusterName}}" - accountName: "{{.accountName}}" - targetNamespace: "{{.targetNamespace}}" + targetNamespace: "{{.projectTargetNamespace}}" --- label: Update Project @@ -78,19 +107,19 @@ query: |+ metadata { name } - spec { - displayName - } + clusterName } } variables: project: + displayName: "This is a sample project" metadata: - name: "{{.name}}" + name: "{{.projectName}}" + labels: + kloudlite.io/sample: "true" spec: - displayName: "Example Project" - accountName: kloudlite-dev - targetNamespace: "{{.namespace}}" + targetNamespace: "{{.targetNamespace}}" + clusterName: "{{.clusterName}}" --- label: Delete Project @@ -99,7 +128,7 @@ query: |+ core_deleteProject(name: $name) } variables: - name: "{{.name}}" + name: "{{.projectName}}" --- label: Resync Project diff --git a/.tools/nvim/__http__/console/routers.graphql.yml b/.tools/nvim/__http__/console/routers.graphql.yml new file mode 100644 index 000000000..a68a0c367 --- /dev/null +++ b/.tools/nvim/__http__/console/routers.graphql.yml @@ -0,0 +1,150 @@ +--- +global: + projectNamespace: sample + namespace: kl-core + name: s1 +--- + +label: List Routers +query: |+ + query Core_listRouters($projectName: String!, $envName: String!) { + core_listRouters(projectName: $projectName, envName: $envName) { + edges { + cursor + node { + creationTime + accountName + apiVersion + kind + metadata { + name + namespace + } + spec { + ingressClass + domains + } + status { + isReady + checks + } + syncStatus { + state + recordVersion + error + } + } + } + pageInfo { + endCursor + hasNextPage + hasPreviousPage + startCursor + } + totalCount + } + } +variables: + projectName: '{{.projectName}}' + envName: "{{.envName}}" +--- + +label: Create Router +query: |+ + mutation Core_createRouter($projectName: String!, $envName: String!, $router: RouterIn!) { + core_createRouter(projectName: $projectName, envName: $envName, router: $router) { + spec { + domains + } + } + } +variables: + projectName: "{{.projectName}}" + envName: "{{.envName}}" + router: + displayName: "this is a test router" + metadata: + name: '{{.name}}' + spec: + # ingressClass: "{{.ingressClass}}" + https: + enabled: true + # clusterIssuer: cluster-issuer + domains: + - "{{.name}}.{{.baseDomain}}" + routes: + - app: sample-app + path: / + port: 80 +--- + +label: Get Router +query: |+ + query Core_getRouter($namespace: String!, $name: String!) { + core_getRouter(namespace: $namespace, name: $name) { + metadata { + name + deletionTimestamp + namespace + } + spec { + domains + } + } + } +variables: + name: '{{.name}}' + namespace: '{{.projectNamespace}}' + +--- + +label: Update Router +query: |+ + mutation Core_updateRouter($projectName: String!, $envName: String!, $router: RouterIn!) { + core_updateRouter(projectName: $projectName, envName: $envName, router: $router) { + spec { + domains + } + } + } +variables: + projectName: "{{.projectName}}" + envName: "{{.envName}}" + router: + displayName: "this is a test router" + metadata: + name: '{{.name}}' + spec: + ingressClass: "{{.ingressClass2}}" + https: + enabled: true + # clusterIssuer: cluster-issuer + domains: + - "example.{{.baseDomain}}" + routes: + - app: sample-app + path: / + port: 80 +--- + +label: Delete Router +query: |+ + mutation Core_deleteRouter($projectName: String!, $envName: String!, $routerName: String!) { + core_deleteRouter(projectName: $projectName, envName: $envName, routerName: $routerName) + } +variables: + projectName: '{{.projectName}}' + envName: '{{.envName}}' + routerName: "{{.name}}" +--- + +label: Resync Routers +query: |+ + query Query($namespace: String!, $name: String!) { + core_resyncRouter(namespace: $namespace, name: $name) + } +variables: + namespace: '{{.namespace}}' + name: "{{.name}}" + +--- diff --git a/.tools/nvim/__http__/console/secrets.graphql.yml b/.tools/nvim/__http__/console/secrets.graphql.yml new file mode 100644 index 000000000..58fc2c3fd --- /dev/null +++ b/.tools/nvim/__http__/console/secrets.graphql.yml @@ -0,0 +1,131 @@ +--- +global: + # namespace: sample + name: s1 + namespace: sample-nxtcoder17 +--- + +label: List Secrets +query: |+ + query Core_listSecrets($projectName: String!, $envName: String!) { + core_listSecrets(projectName: $projectName, envName: $envName) { + edges { + cursor + node { + creationTime + accountName + apiVersion + kind + metadata { + name + namespace + generation + creationTimestamp + } + syncStatus { + state + recordVersion + error + } + data + stringData + } + } + pageInfo { + endCursor + hasNextPage + hasPreviousPage + startCursor + } + totalCount + } + } +variables: + projectName: "{{.projectName}}" + envName: "{{.envName}}" +--- + +label: Create Secret +query: |+ + mutation Core_createSecret($projectName: String!, $envName: String!, $secret: SecretIn!) { + core_createSecret(projectName: $projectName, envName: $envName, secret: $secret) { + metadata { + name + namespace + } + stringData + syncStatus { + state + action + recordVersion + } + } + } +variables: + projectName: "{{.projectName}}" + envName: "{{.envName}}" + secret: + displayName: "Secret Display Name" + metadata: + name: '{{.name}}' + namespace: '{{.namespace}}' + stringData: + key1: value1 + key2: value2 +--- + +label: Get Secret +query: |+ + query Core_getSecret($namespace: String!, $name: String!) { + core_getSecret(namespace: $namespace, name: $name) { + metadata { + name + deletionTimestamp + namespace + } + data + stringData + } + } +variables: + name: '{{.name}}' + namespace: '{{.namespace}}' + +--- + +label: Update Secret +query: |+ + mutation Core_updateSecret($projectName: String!, $envName: String!, $secret: SecretIn!) { + core_updateSecret(projectName: $projectName, envName: $envName, secret: $secret) { + metadata { + name + generation + } + stringData + recordVersion + } + } +variables: + projectName: "{{.projectName}}" + envName: "{{.envName}}" + secret: + displayName: "Hello Hi" + metadata: + name: '{{.name}}' + namespace: '{{.namespace}}' + stringData: + key1: v1 + key3: v2 +--- + +label: Delete Secret +query: |+ + mutation Core_deleteSecret($projectName: String!, $envName: String!, $secretName: String!) { + core_deleteSecret(projectName: $projectName, envName: $envName, secretName: $secretName) + } +variables: + projectName: "{{.projectName}}" + envName: "{{.envName}}" + secretName: "{{.name}}16" + +--- diff --git a/.tools/nvim/__http__/console/workspaces.graphql.yml b/.tools/nvim/__http__/console/workspaces.graphql.yml new file mode 100644 index 000000000..808f708ed --- /dev/null +++ b/.tools/nvim/__http__/console/workspaces.graphql.yml @@ -0,0 +1,176 @@ +--- +global: + accountName: kloudlite-dev + projectName: sample + worksapceName: sample + projectTargetNamespace: sample + clusterName: sample + namespace: sample + envTargetNamespace: "sample-nxtcoder17" +--- + +label: List Workspaces +query: |+ + query Core_listWorkspaces($project: ProjectId!, $pq: CursorPaginationIn) { + core_listWorkspaces(project: $project, pq: $pq) { + edges { + cursor + node { + creationTime + accountName + apiVersion + kind + markedForDeletion + metadata { + name + namespace + } + createdBy{ + userId + userName + } + lastUpdatedBy{ + userName + } + spec { + targetNamespace + } + syncStatus { + state + error + recordVersion + action + } + recordVersion + } + } + pageInfo { + endCursor + hasNextPage + hasPreviousPage + startCursor + } + totalCount + } + } +variables: + project: + type: name + value: "{{.projectName}}" + +--- + +label: Get Workspace +query: |+ + query Core_getWorkspace($namespace: String!, $name: String!) { + core_getWorkspace(namespace: $namespace, name: $name) { + metadata { + namespace + name + labels + } + spec { + projectName + targetNamespace + } + } + } +variables: + name: "default" + namespace: "{{.projectName}}" + +--- + +label: Create Workspace +query: |+ + mutation Core_createWorkspace($env: WorkspaceIn!) { + core_createWorkspace(env: $env) { + apiVersion + kind + spec { + projectName + targetNamespace + } + syncStatus { + state + lastSyncedAt + recordVersion + action + syncScheduledAt + } + } + } +variables: + env: + displayName: This is Sample Workspace + metadata: + name: sample + namespace: "{{.projectTargetNamespace}}" + spec: + projectName: "{{.projectName}}" + targetNamespace: "{{.envTargetNamespace}}" +--- + +label: Update Workspace +query: |+ + mutation Core_updateWorkspace($env: WorkspaceIn!) { + core_updateWorkspace(env: $env) { + syncStatus { + action + recordVersion + lastSyncedAt + state + syncScheduledAt + } + status { + isReady + resources { + kind + name + namespace + } + checks + } + kind + apiVersion + spec { + projectName + } + metadata { + name + namespace + } + } + } +variables: + env: + displayName: This is sample workspace + metadata: + name: sample + namespace: "{{.projectTargetNamespace}}" + spec: + projectName: "{{.projectName}}" + targetNamespace: "{{.envTargetNamespace}}" +--- + +label: Delete Workspace +query: |+ + mutation Core_deleteWorkspace($name: String!, $namespace: String!) { + core_deleteWorkspace(name: $name, namespace: $namespace) + } +variables: + name: "sample" + namespace: "{{.namespace}}" +--- + +label: Resync Workspaces +query: |+ + query Query($namespace: String!, $name: String!) { + core_resyncWorkspace(namespace: $namespace, name: $name) + } +variables: + namespace: '{{.projectTargetNamespace}}' + # name: "{{.name}}" + name: "sample" + +--- diff --git a/.tools/__http__/infra/byoc-clusters.graphql.yml b/.tools/nvim/__http__/infra/byoc-clusters.graphql.yml similarity index 68% rename from .tools/__http__/infra/byoc-clusters.graphql.yml rename to .tools/nvim/__http__/infra/byoc-clusters.graphql.yml index 7e7332f54..d3e565919 100644 --- a/.tools/__http__/infra/byoc-clusters.graphql.yml +++ b/.tools/nvim/__http__/infra/byoc-clusters.graphql.yml @@ -4,7 +4,42 @@ global: providerName: sample providerNamespace: s1 providerSecretName: provider-sample - clusterName: sample2 + clusterName: sample + +--- + +label: List BYOC Clusters +query: |+ + query Infra_listBYOCClusters { + infra_listBYOCClusters { + edges { + cursor + node { + creationTime + apiVersion + # clusterToken + kind + metadata { + name + namespace + generation + } + syncStatus { + state + action + recordVersion + } + } + } + pageInfo { + endCursor + hasNextPage + hasPreviousPage + startCursor + } + totalCount + } + } --- @@ -13,7 +48,7 @@ query: |+ mutation Infra_createBYOCCluster($cluster: BYOCClusterIn!) { infra_createBYOCCluster(cluster: $cluster) { apiVersion - clusterToken + # clusterToken kind metadata { name @@ -24,13 +59,12 @@ query: |+ region publicIps provider - defaultStorageClass - defaultIngressClass + storageClasses + ingressClasses accountName } status { isReady - displayVars checks } syncStatus { @@ -111,4 +145,11 @@ variables: name: "{{.clusterName}}" --- - +label: Resync BYOC +query: |+ + mutation Infra_resyncBYOCCluster($name: String!) { + infra_resyncBYOCCluster(name: $name) + } +variables: + name: "{{.clusterName}}" +--- diff --git a/.tools/nvim/__http__/infra/cloud-provider-secrets.graphql.yml b/.tools/nvim/__http__/infra/cloud-provider-secrets.graphql.yml new file mode 100644 index 000000000..e17e1bd0c --- /dev/null +++ b/.tools/nvim/__http__/infra/cloud-provider-secrets.graphql.yml @@ -0,0 +1,128 @@ +--- +global: + accountName: kloudlite-dev + clusterName: sample-cluster + + providerNamespace: kl-account-kloudlite-dev + providerName: aws-creds + +--- + +label: Create Cloud Provider Secret +query: |+ + mutation Infra_createProviderSecret($secret: CloudProviderSecretIn!) { + infra_createProviderSecret(secret: $secret) { + id + } + } +variables: + secret: + displayName: "this has aws credentials" + metadata: + name: "{{.providerName}}" + cloudProviderName: aws + aws: + awsAccountId: "{{.awsAccountId}}" +--- + +label: Update Cloud Provider Secret +query: |+ + mutation Infra_updateProviderSecret($secret: CloudProviderSecretIn!) { + infra_updateProviderSecret(secret: $secret) { + id + } + } +variables: + secret: + displayName: "this has aws credentials" + metadata: + name: "{{.providerName}}" + cloudProviderName: aws + aws: + awsAccountId: "{{.awsAccountId}}" + +--- + +label: List Provider Secrets +query: |+ + query Infra_listProviderSecrets($search: SearchProviderSecret) { + infra_listProviderSecrets(search: $search) { + edges { + node { + markedForDeletion + accountName + metadata { + name + namespace + } + aws { + awsAccountId + cfParamTrustedARN + cfParamStackName + cfParamRoleName + cfParamInstanceProfileName + cfParamExternalID + + secretKey + accessKey + } + } + } + } + } +variables: + search: + cloudProviderName: + matchType: 'regex' + regex: '^aws$' + +--- + +label: Get Provider Secret +query: |+ + query Infra_getProviderSecret($name: String!) { + infra_getProviderSecret(name: $name) { + accountName + metadata { + name + } + cloudProviderName + } + } +variables: + name: "{{.providerName}}" +--- + +label: Delete Provider Secret +query: |+ + mutation Infra_deleteProviderSecret($secretName: String!) { + infra_deleteProviderSecret(secretName: $secretName) + } +variables: + secretName: "{{.providerName}}" +--- + +label: Check AWS Access +query: |+ + query Infra_checkAWSAccess($cloudproviderName: String!) { + infra_checkAwsAccess(cloudproviderName: $cloudproviderName) { + result + installationUrl + } + } +variables: + cloudproviderName: "{{.providerName}}" +--- + +label: Check Name Availbility +query: |+ + query Infra_checkNameAvailability($resType: ResType!, $name: String!) { + infra_checkNameAvailability(resType: $resType, name: $name) { + result + suggestedNames + } + } +variables: + resType: providersecret + name: "{{.providerName}}" +--- diff --git a/.tools/nvim/__http__/infra/clusters.graphql.yml b/.tools/nvim/__http__/infra/clusters.graphql.yml new file mode 100644 index 000000000..889a4ebf0 --- /dev/null +++ b/.tools/nvim/__http__/infra/clusters.graphql.yml @@ -0,0 +1,153 @@ +--- +global: + clusterName: sample-cluster2 + + providerSecretName: "aws-283277" + providerSecretNamespace: "kl-account-new-prod-team" +--- + +label: Create Cluster +query: |+ + mutation Infra_createCluster($cluster: ClusterIn!) { + infra_createCluster(cluster: $cluster) { + metadata { + name + } + spec { + accountName + } + } + } +variables: + cluster: + displayName: "Sample Cluster" + metadata: + name: "{{.clusterName}}" + spec: + cloudflareEnabled: true + availabilityMode: dev + credentialsRef: + name: "{{.providerSecretName}}" + namespace: "{{.providerSecretNamespace}}" + cloudProvider: aws + aws: + region: ap-south-1 + k3sMasters: + instanceType: c6a.large + nvidiaGpuEnabled: false + +--- + +label: List Clusters +query: |+ + query Infra_listClusters($search: SearchCluster, $pagination: CursorPaginationIn) { + infra_listClusters(search: $search, pagination: $pagination) { + edges { + cursor + node { + id + kind + metadata { + name + namespace + } + status { + checks + } + spec { + messageQueueTopicName + } + # clusterToken + markedForDeletion + syncStatus { + action + error + lastSyncedAt + state + syncScheduledAt + recordVersion + } + adminKubeconfig { + value + encoding + } + } + } + } + } +variables: + search: + text: + matchType: regex + regex: "" + pagination: + first: 10 + +--- + +label: Get Cluster +query: |+ + query Query($name: String!) { + infra_getCluster(name: $name) { + kind + metadata { + name + } + recordVersion + markedForDeletion + spec { + cloudProvider + credentialsRef { + name + namespace + } + } + } + } +variables: + name: "{{.clusterName}}" + +--- + +label: Update Cluster +query: |+ + mutation Infra_updateCluster($cluster: ClusterIn!) { + infra_updateCluster(cluster: $cluster) { + metadata { + name + } + spec { + accountName + } + } + } +variables: + cluster: + displayName: "Sample Cluster" + metadata: + name: "{{.clusterName}}" + spec: + cloudflareEnabled: true + availabilityMode: dev + credentialsRef: + name: "{{.providerSecretName}}" + namespace: "{{.providerSecretNamespace}}" + cloudProvider: aws + aws: + region: ap-south-1 + k3sMasters: + instanceType: c6a.large + iamInstanceProfileRole: "EC2StorageAccess" + +--- + +label: Delete Cluster +query: |+ + mutation Infra_deleteCluster($name: String!) { + infra_deleteCluster(name: $name) + } +variables: + name: "{{.clusterName}}" + +--- + diff --git a/.tools/__http__/infra/edges.graphql.yml b/.tools/nvim/__http__/infra/edges.graphql.yml similarity index 100% rename from .tools/__http__/infra/edges.graphql.yml rename to .tools/nvim/__http__/infra/edges.graphql.yml diff --git a/.tools/nvim/__http__/infra/names.graphql.yml b/.tools/nvim/__http__/infra/names.graphql.yml new file mode 100644 index 000000000..8b9cd3205 --- /dev/null +++ b/.tools/nvim/__http__/infra/names.graphql.yml @@ -0,0 +1,34 @@ +--- +global: + accountName: kloudlite-dev + name: sample + namespace: s1 + providerSecretName: provider-sample +--- +label: Check Name Availability +query: |+ + query Infra_checkNameAvailability($resType: ResType!, $name: String!) { + infra_checkNameAvailability(resType: $resType, name: $name) { + result + suggestedNames + } + } +variables: + resType: vpn_device + # name: sample + name: sample +--- + +label: Check Name Availability, with ClusterName +query: |+ + query Infra_checkNameAvailability($resType: ResType!, $clusterName: String, $name: String!) { + infra_checkNameAvailability(resType: $resType, clusterName: $clusterName, name: $name) { + result + suggestedNames + } + } +variables: + clusterName: "sample-cluster2" + resType: vpn_device + name: sample-vpn-device9 +--- diff --git a/.tools/nvim/__http__/infra/nodepools.graphql.yml b/.tools/nvim/__http__/infra/nodepools.graphql.yml new file mode 100644 index 000000000..c3d985b24 --- /dev/null +++ b/.tools/nvim/__http__/infra/nodepools.graphql.yml @@ -0,0 +1,244 @@ +--- +global: + accountName: kloudlite-dev + providerName: sample + providerNamespace: s1 + providerSecretName: provider-sample + + clusterName: sample-cluster2 + # clusterName: teshdhr-797053 +--- + +label: Create Nodepool +query: |+ + mutation Infra_createNodePool($clusterName: String!, $pool: NodePoolIn!) { + infra_createNodePool(clusterName: $clusterName, pool: $pool) { + id + kind + metadata { + name + namespace + annotations + } + recordVersion + spec { + minCount + maxCount + } + } + } +variables: + clusterName: "{{.clusterName}}" + pool: + displayName: sample + metadata: + name: first + spec: + minCount: 1 + maxCount: 2 + targetCount: 1 + cloudProvider: "aws" + aws: + availabilityZone: ap-south-1a + poolType: "ec2" + ec2Pool: + instanceType: c6a.large + nvidiaGpuEnabled: false + +--- + +label: Create Spot EC2 Nodepool +query: |+ + mutation Infra_createNodePool($clusterName: String!, $pool: NodePoolIn!) { + infra_createNodePool(clusterName: $clusterName, pool: $pool) { + id + kind + metadata { + name + namespace + annotations + } + recordVersion + spec { + minCount + maxCount + } + } + } +variables: + clusterName: "{{.clusterName}}" + pool: + displayName: sample + metadata: + name: spot-cpu + spec: + minCount: 1 + maxCount: 2 + targetCount: 1 + cloudProvider: "aws" + aws: + availabilityZone: ap-south-1a + poolType: "spot" + spotPool: + cpuNode: + vcpu: + min: "2" + max: "4" + memoryPerVcpu: + min: "2" + max: "4" + nvidiaGpuEnabled: false + +--- + +label: Create Spot Nodepool +query: |+ + mutation Infra_createNodePool($clusterName: String!, $pool: NodePoolIn!) { + infra_createNodePool(clusterName: $clusterName, pool: $pool) { + id + kind + metadata { + name + namespace + annotations + } + recordVersion + spec { + minCount + maxCount + } + } + } +variables: + clusterName: "{{.clusterName}}" + pool: + displayName: sample + metadata: + name: gpu-np + spec: + minCount: 1 + maxCount: 2 + targetCount: 1 + cloudProvider: "aws" + aws: + availabilityZone: ap-south-1a + poolType: "spot" + spotPool: + gpuNode: + instanceTypes: ["g4dn.xlarge"] + nvidiaGpuEnabled: true + +--- + +label: Update Nodepool +query: |+ + mutation Infra_updateNodePool($clusterName: String!, $pool: NodePoolIn!) { + infra_updateNodePool(clusterName: $clusterName, pool: $pool) { + id + kind + metadata { + name + namespace + annotations + } + recordVersion + spec { + minCount + maxCount + } + } + } +variables: + clusterName: "{{.clusterName}}" + pool: + displayName: "sample nodepool" + metadata: + name: first + spec: + minCount: 1 + maxCount: 1 + cloudProvider: "aws" + +--- + +label: List Nodepools +query: |+ + query Infra_listNodePools($clusterName: String!) { + infra_listNodePools(clusterName: $clusterName) { + totalCount + pageInfo { + startCursor + endCursor + hasNextPage + hasPreviousPage + } + edges { + cursor + node { + id + kind + metadata { + name + generation + } + recordVersion + spec { + minCount + maxCount + # targetCount + } + syncStatus { + syncScheduledAt + state + recordVersion + lastSyncedAt + error + action + } + status { + isReady + } + } + } + } + } +variables: + clusterName: "{{.clusterName}}" + +--- +label: Get Nodepool +query: |+ + query Infra_getNodePool($clusterName: String!, $poolName: String!) { + infra_getNodePool(clusterName: $clusterName, poolName: $poolName) { + accountName + clusterName + id + metadata { + name + namespace + } + recordVersion + syncStatus { + syncScheduledAt + state + recordVersion + lastSyncedAt + error + action + } + } + } +variables: + clusterName: "{{.clusterName}}" + poolName: spot-cpu +--- + +label: Delete NodePool +query: |+ + mutation Infra_deleteNodePool($clusterName: String!, $poolName: String!) { + infra_deleteNodePool(clusterName: $clusterName, poolName: $poolName) + } +variables: + clusterName: "{{.clusterName}}" + poolName: spot-cpu +--- diff --git a/.tools/__http__/console.v2.graphql.yml b/.tools/nvim/__http__/infra/nodes.graphql.yml similarity index 100% rename from .tools/__http__/console.v2.graphql.yml rename to .tools/nvim/__http__/infra/nodes.graphql.yml diff --git a/.tools/nvim/__http__/infra/vpn-devices.graphql.yml b/.tools/nvim/__http__/infra/vpn-devices.graphql.yml new file mode 100644 index 000000000..2aa6701bc --- /dev/null +++ b/.tools/nvim/__http__/infra/vpn-devices.graphql.yml @@ -0,0 +1,91 @@ +--- +global: + namespace: sample + name: s1 + namespace: sample-nxtcoder17 + clusterName: sample-cluster2 +--- + +label: List VPN Devices +query: |+ + query Core_listVPNDevices($clusterName: String) { + core_listVPNDevices(clusterName: $clusterName) { + edges { + node { + accountName + clusterName + + apiVersion + createdBy { + userId + userName + } + spec { + offset + } + displayName + id + + recordVersion + syncStatus { + recordVersion + state + error + } + } + } + } + } + +variables: + clusterName: "{{.clusterName}}" + +--- + +query: |+ + query Core_listVPNDevicesForUser { + core_listVPNDevicesForUser { + metadata { + name + } + } + } + +--- + +label: Create VPN Device +query: |+ + mutation Core_createVPNDevice($clusterName: String!, $vpnDevice: VPNDeviceIn!) { + core_createVPNDevice(clusterName: $clusterName, vpnDevice: $vpnDevice) { + id + metadata { + name + } + spec { + offset + } + } + } + +variables: + clusterName: "{{.clusterName}}" + vpnDevice: + displayName: sample vpn device + metadata: + name: sample-vpn-device9 + namespace: wg-platform + spec: + serverName: platform + +--- + +label: Delete VPN Device +query: |+ + mutation Core_deleteVPNDevice($clusterName: String!, $deviceName: String!) { + core_deleteVPNDevice(clusterName: $clusterName, deviceName: $deviceName) + } + +variables: + clusterName: "{{.clusterName}}" + deviceName: sample-vpn-device9 +--- diff --git a/.tools/nvim/dap/go.lua b/.tools/nvim/dap/go.lua index b68fbe07c..ed6087381 100644 --- a/.tools/nvim/dap/go.lua +++ b/.tools/nvim/dap/go.lua @@ -1,28 +1,40 @@ local dap = require("dap") dap.configurations.go = { + { + type = "go", + name = "Debug auth-api", + request = "launch", + program = vim.g.nxt.project_root_dir .. "/apps/auth", + args = { "--dev" }, + console = "externalTerminal", + -- externalTerminal = true, + envFile = { + vim.g.nxt.project_root_dir .. "/apps/auth" .. "/.secrets/env", + }, + }, { type = "go", name = "Debug infra-api", request = "launch", - program = vim.g.root_dir .. "/apps/infra", + program = vim.g.nxt.project_root_dir .. "/apps/infra", args = { "--dev" }, console = "externalTerminal", -- externalTerminal = true, envFile = { - vim.g.root_dir .. "/apps/infra" .. "/.secrets/env", + vim.g.nxt.project_root_dir .. "/apps/infra" .. "/.secrets/env", }, }, { type = "go", name = "Debug console-api", request = "launch", - program = vim.g.root_dir .. "/apps/console", + program = vim.g.nxt.project_root_dir .. "/apps/console", args = { "--dev" }, console = "externalTerminal", -- externalTerminal = true, envFile = { - vim.g.root_dir .. "/apps/console" .. "/.secrets/env", + vim.g.nxt.project_root_dir .. "/apps/console" .. "/.secrets/env", }, -- dlvToolPath = -- "/usr/local/go/bin/dlv --headless=true --api-version=2 -r stdout:/tmp/debug.stdout -r stderr:/tmp/debug2.stderr", @@ -31,60 +43,132 @@ dap.configurations.go = { type = "go", name = "Debug finance-api", request = "launch", - program = vim.g.root_dir .. "/apps/finance", + program = vim.g.nxt.project_root_dir .. "/apps/finance", args = { "--dev" }, console = "externalTerminal", -- externalTerminal = true, envFile = { - vim.g.root_dir .. "/apps/finance" .. "/.secrets/env", + vim.g.nxt.project_root_dir .. "/apps/finance" .. "/.secrets/env", }, }, { type = "go", name = "Debug iam-api", request = "launch", - program = vim.g.root_dir .. "/apps/iam", + program = vim.g.nxt.project_root_dir .. "/apps/iam", args = { "--dev" }, console = "externalTerminal", -- externalTerminal = true, envFile = { - vim.g.root_dir .. "/apps/iam" .. "/.secrets/env", + vim.g.nxt.project_root_dir .. "/apps/iam" .. "/.secrets/env", }, }, { type = "go", name = "Debug message-office-api", request = "launch", - program = vim.g.root_dir .. "/apps/message-office", + program = vim.g.nxt.project_root_dir .. "/apps/message-office", args = { "--dev" }, console = "externalTerminal", -- externalTerminal = true, envFile = { - vim.g.root_dir .. "/apps/message-office" .. "/.secrets/env", + vim.g.nxt.project_root_dir .. "/apps/message-office" .. "/.secrets/env", }, }, { type = "go", name = "Debug container-registry-api", request = "launch", - program = vim.g.root_dir .. "/apps/container-registry", + program = vim.g.nxt.project_root_dir .. "/apps/container-registry", args = { "--dev" }, console = "externalTerminal", -- externalTerminal = true, envFile = { - vim.g.root_dir .. "/apps/container-registry" .. "/.secrets/env", + vim.g.nxt.project_root_dir .. "/apps/container-registry" .. "/.secrets/env", }, }, { type = "go", name = "Debug webhooks-api", request = "launch", - program = vim.g.root_dir .. "/apps/webhooks", + program = vim.g.nxt.project_root_dir .. "/apps/webhooks", + args = { "--dev" }, + console = "externalTerminal", + -- externalTerminal = true, + envFile = { + vim.g.nxt.project_root_dir .. "/apps/webhooks" .. "/.secrets/env", + }, + }, + { + type = "go", + name = "Debug accounts-api", + request = "launch", + program = vim.g.nxt.project_root_dir .. "/apps/accounts", + args = { "--dev" }, + console = "externalTerminal", + -- externalTerminal = true, + envFile = { + vim.g.nxt.project_root_dir .. "/apps/accounts" .. "/.secrets/env", + }, + }, + { + type = "go", + name = "Debug kubelet-metrics", + request = "launch", + program = vim.g.nxt.project_root_dir .. "/apps/kubelet-metrics", + args = { + "--dev", + "--node-name", + "ip-172-31-13-194", + "--enrich-from-labels", + "--filter-prefix", + "kloudlite.io/", + }, + console = "externalTerminal", + -- externalTerminal = true, + env = { + sample = "hello", + }, + -- envFile = { + -- vim.g.nxt.project_root_dir .. "/apps/kubelet-mmetrics" .. "/.secrets/env", + -- }, + }, + { + type = "go", + name = "Debug comms-api", + request = "launch", + program = vim.g.nxt.project_root_dir .. "/apps/comms", args = { "--dev" }, console = "externalTerminal", -- externalTerminal = true, envFile = { - vim.g.root_dir .. "/apps/webhooks" .. "/.secrets/env", + vim.g.nxt.project_root_dir .. "/apps/comms" .. "/.secrets/env", + }, + }, + + { + type = "go", + name = "Debug messages-distribution-worker", + request = "launch", + program = vim.g.nxt.project_root_dir .. "/apps/messages-distribution-worker", + args = { "--dev" }, + console = "externalTerminal", + -- externalTerminal = true, + envFile = { + vim.g.nxt.project_root_dir .. "/apps/messages-distribution-worker" .. "/.secrets/env", + }, + }, + + { + type = "go", + name = "Debug Tenant Agent", + request = "launch", + program = vim.g.nxt.project_root_dir .. "/apps/tenant-agent", + args = { "--dev"}, + console = "externalTerminal", + -- externalTerminal = true, + envFile = { + vim.g.nxt.project_root_dir .. "/apps/tenant-agent" .. "/.secrets/env", }, }, } diff --git a/.tools/snippets/go.lua b/.tools/nvim/snippets/go.lua similarity index 82% rename from .tools/snippets/go.lua rename to .tools/nvim/snippets/go.lua index ffacee9ff..7abd8a46e 100644 --- a/.tools/snippets/go.lua +++ b/.tools/nvim/snippets/go.lua @@ -26,7 +26,7 @@ local beacon_trig = s( ResourceId: {}, Tags: map[string]string{{"projectId": {}}}, }}) -]] , +]], { i(1, "/*accountId*/"), i(2, "/*Action*/"), @@ -74,7 +74,7 @@ func ( ) MarshalGQL(w io.Writer) { } w.Write(b) } -]] , +]], { p1 = i(1, "obj"), p2 = i(2, "//type"), @@ -88,4 +88,28 @@ func ( ) MarshalGQL(w io.Writer) { ) table.insert(snippets, gql_marshaler) +local fx_lifecycle_hook = s( + "fx_lifecycle_hook", + fmta( + [[ + fx.Invoke(func(lf fx.Lifecycle) { + lf.Append(fx.Hook{ + OnStart: func(ctx context.Context) error { + return + }, + OnStop: func(ctx context.Context) error { + return + }, + }) + }), + ]], + { + on_start = i(1, "nil"), + on_stop = i(2, "nil"), + } + ) +) + +table.insert(snippets, fx_lifecycle_hook) + return snippets, autosnippets diff --git a/.tools/pipeline/test.json b/.tools/pipeline/test.json deleted file mode 100644 index b2249a113..000000000 --- a/.tools/pipeline/test.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "zen": "Favor focus over features.", - "hook_id": 368082572, - "hook": { - "type": "Repository", - "id": 368082572, - "name": "web", - "active": true, - "events": [ - "push" - ], - "config": { - "content_type": "json", - "url": "https://tk.webhooks.dev.kloudlite.io/github?pipelineId=pip-9cnxjhxkqat9abb0wc2enxyf6bzj", - "insecure_ssl": "0" - }, - "updated_at": "2022-07-11T16:40:28Z", - "created_at": "2022-07-11T16:40:28Z", - "url": "https://api.github.com/repos/nxtcoder17/sample/hooks/368082572", - "test_url": "https://api.github.com/repos/nxtcoder17/sample/hooks/368082572/test", - "ping_url": "https://api.github.com/repos/nxtcoder17/sample/hooks/368082572/pings", - "deliveries_url": "https://api.github.com/repos/nxtcoder17/sample/hooks/368082572/deliveries", - "last_response": { - "code": null, - "status": "unused", - "message": null - } - }, - "repository": { - "id": 426581953, - "node_id": "R_kgDOGW0fwQ", - "name": "sample", - "full_name": "nxtcoder17/sample", - "private": false, - "owner": { - "login": "nxtcoder17", - "id": 22402557, - "node_id": "MDQ6VXNlcjIyNDAyNTU3", - "avatar_url": "https://avatars.githubusercontent.com/u/22402557?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/nxtcoder17", - "html_url": "https://github.com/nxtcoder17", - "followers_url": "https://api.github.com/users/nxtcoder17/followers", - "following_url": "https://api.github.com/users/nxtcoder17/following{/other_user}", - "gists_url": "https://api.github.com/users/nxtcoder17/gists{/gist_id}", - "starred_url": "https://api.github.com/users/nxtcoder17/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/nxtcoder17/subscriptions", - "organizations_url": "https://api.github.com/users/nxtcoder17/orgs", - "repos_url": "https://api.github.com/users/nxtcoder17/repos", - "events_url": "https://api.github.com/users/nxtcoder17/events{/privacy}", - "received_events_url": "https://api.github.com/users/nxtcoder17/received_events", - "type": "User", - "site_admin": false - }, - "html_url": "https://github.com/nxtcoder17/sample", - "description": null, - "fork": false, - "url": "https://api.github.com/repos/nxtcoder17/sample", - "forks_url": "https://api.github.com/repos/nxtcoder17/sample/forks", - "keys_url": "https://api.github.com/repos/nxtcoder17/sample/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/nxtcoder17/sample/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/nxtcoder17/sample/teams", - "hooks_url": "https://api.github.com/repos/nxtcoder17/sample/hooks", - "issue_events_url": "https://api.github.com/repos/nxtcoder17/sample/issues/events{/number}", - "events_url": "https://api.github.com/repos/nxtcoder17/sample/events", - "assignees_url": "https://api.github.com/repos/nxtcoder17/sample/assignees{/user}", - "branches_url": "https://api.github.com/repos/nxtcoder17/sample/branches{/branch}", - "tags_url": "https://api.github.com/repos/nxtcoder17/sample/tags", - "blobs_url": "https://api.github.com/repos/nxtcoder17/sample/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/nxtcoder17/sample/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/nxtcoder17/sample/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/nxtcoder17/sample/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/nxtcoder17/sample/statuses/{sha}", - "languages_url": "https://api.github.com/repos/nxtcoder17/sample/languages", - "stargazers_url": "https://api.github.com/repos/nxtcoder17/sample/stargazers", - "contributors_url": "https://api.github.com/repos/nxtcoder17/sample/contributors", - "subscribers_url": "https://api.github.com/repos/nxtcoder17/sample/subscribers", - "subscription_url": "https://api.github.com/repos/nxtcoder17/sample/subscription", - "commits_url": "https://api.github.com/repos/nxtcoder17/sample/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/nxtcoder17/sample/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/nxtcoder17/sample/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/nxtcoder17/sample/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/nxtcoder17/sample/contents/{+path}", - "compare_url": "https://api.github.com/repos/nxtcoder17/sample/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/nxtcoder17/sample/merges", - "archive_url": "https://api.github.com/repos/nxtcoder17/sample/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/nxtcoder17/sample/downloads", - "issues_url": "https://api.github.com/repos/nxtcoder17/sample/issues{/number}", - "pulls_url": "https://api.github.com/repos/nxtcoder17/sample/pulls{/number}", - "milestones_url": "https://api.github.com/repos/nxtcoder17/sample/milestones{/number}", - "notifications_url": "https://api.github.com/repos/nxtcoder17/sample/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/nxtcoder17/sample/labels{/name}", - "releases_url": "https://api.github.com/repos/nxtcoder17/sample/releases{/id}", - "deployments_url": "https://api.github.com/repos/nxtcoder17/sample/deployments", - "created_at": "2021-11-10T10:39:50Z", - "updated_at": "2022-07-04T08:37:56Z", - "pushed_at": "2022-04-26T07:30:43Z", - "git_url": "git://github.com/nxtcoder17/sample.git", - "ssh_url": "git@github.com:nxtcoder17/sample.git", - "clone_url": "https://github.com/nxtcoder17/sample.git", - "svn_url": "https://github.com/nxtcoder17/sample", - "homepage": "sample3-seven.vercel.app", - "size": 10, - "stargazers_count": 0, - "watchers_count": 0, - "language": "JavaScript", - "has_issues": true, - "has_projects": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": false, - "forks_count": 1, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 0, - "license": null, - "allow_forking": true, - "is_template": false, - "web_commit_signoff_required": false, - "topics": [ - - ], - "visibility": "public", - "forks": 1, - "open_issues": 0, - "watchers": 0, - "default_branch": "master" - }, - "sender": { - "login": "nxtcoder17", - "id": 22402557, - "node_id": "MDQ6VXNlcjIyNDAyNTU3", - "avatar_url": "https://avatars.githubusercontent.com/u/22402557?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/nxtcoder17", - "html_url": "https://github.com/nxtcoder17", - "followers_url": "https://api.github.com/users/nxtcoder17/followers", - "following_url": "https://api.github.com/users/nxtcoder17/following{/other_user}", - "gists_url": "https://api.github.com/users/nxtcoder17/gists{/gist_id}", - "starred_url": "https://api.github.com/users/nxtcoder17/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/nxtcoder17/subscriptions", - "organizations_url": "https://api.github.com/users/nxtcoder17/orgs", - "repos_url": "https://api.github.com/users/nxtcoder17/repos", - "events_url": "https://api.github.com/users/nxtcoder17/events{/privacy}", - "received_events_url": "https://api.github.com/users/nxtcoder17/received_events", - "type": "User", - "site_admin": false - } -} diff --git a/.tools/pipeline/test.sh b/.tools/pipeline/test.sh deleted file mode 100644 index c21f617a9..000000000 --- a/.tools/pipeline/test.sh +++ /dev/null @@ -1,2 +0,0 @@ -# curl -H 'Content-Type: application/json' -XPOST 'https://tk.webhooks.dev.kloudlite.io/github?pipelineId=pip-9cnxjhxkqat9abb0wc2enxyf6bzj' --data @test.json -curl -H 'Content-Type: application/json' -XPOST 'https://ci-17.app.khost.dev/github?pipelineId=pip-9cnxjhxkqat9abb0wc2enxyf6bzj' --data @test.json diff --git a/.tools/scripts/runner.sh b/.tools/scripts/runner.sh deleted file mode 100644 index b6d782632..000000000 --- a/.tools/scripts/runner.sh +++ /dev/null @@ -1,7 +0,0 @@ -#! /usr/bin/env bash - -APP=$1 - -if [ -d $APP ]; then - echo "app does not exist ..." -fi diff --git a/.tools/test.sh b/.tools/test.sh deleted file mode 100644 index 03b657fdd..000000000 --- a/.tools/test.sh +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/bash diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..75ecccc87 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [v1.0.0] - 2024-02-04 + +### Added + +- [apps/infra] tenant clusters installation of `charts/kloudlite-agent` is now installed and managed by infra API. It is done to ensure that kloudlite can upgrade those releases, as new releases arrive diff --git a/TASKS.md b/TASKS.md deleted file mode 100644 index 68caf673a..000000000 --- a/TASKS.md +++ /dev/null @@ -1,3 +0,0 @@ -- [x] Helm Updates from BYOC Deployments from remote BYOC cluster -- [] Creation of container registry protect and user (pull/push) on creation of account (finance -> apply to k8s new Account) -- [] Protected access needs to be changed to websockets (from remote cluster => kloudlite cluster) diff --git a/Taskfile.yml b/Taskfile.yml new file mode 100644 index 000000000..ba859a40f --- /dev/null +++ b/Taskfile.yml @@ -0,0 +1,64 @@ +version: 3 + +tasks: + mocks: + cmds: + - |+ + function gen_mock() { + package_path=$1 + interface_name=$2 + + banner="// Code generated by mocki. DO NOT EDIT." + + mock_module_path=$(echo $package_path | sed 's/kloudlite.io\///') + file_name=$(echo $interface_name | awk '{print tolower($0)}') + file_name+=".go" + + if [ ! -z $(echo $package_path | grep -i '/internal/') ]; then + printf "mocking $package_path.$interface_name " + + mkdir -p $mock_module_path/mocks + echo "$banner" > $mock_module_path/mocks/$file_name + mocki --package $package_path --interface $interface_name >> $mock_module_path/mocks/$file_name + echo "✅" + return + fi + + printf "mocking $package_path.$interface_name " + mkdir -p mocks/$mock_module_path + mocki --package $package_path --interface $interface_name > mocks/$mock_module_path/$file_name + echo "✅" + } + + gen_mock kloudlite.io/pkg/repos DbRepo + + gen_mock kloudlite.io/pkg/k8s Client + gen_mock kloudlite.io/apps/infra/internal/domain AccountsSvc + + gen_mock kloudlite.io/grpc-interfaces/kloudlite.io/rpc/iam IAMClient + gen_mock kloudlite.io/grpc-interfaces/kloudlite.io/rpc/accounts AccountsClient + gen_mock kloudlite.io/grpc-interfaces/kloudlite.io/rpc/message-office-internal MessageOfficeInternalClient + + gen_mock kloudlite.io/pkg/kafka Producer + gen_mock kloudlite.io/pkg/kafka Consumer + + # - mkdir -p pkg/repos/mocks + # - mocki --package kloudlite.io/pkg/repos --interface DbRepo > pkg/repos/mocks/db-repo.go + # + # - mkdir -p pkg/k8s/mocks + # - mocki --package kloudlite.io/pkg/k8s --interface ExtendedK8sClient > pkg/k8s/mocks/extended-k8s-client.go + # + # # grpc-interfaces mocks + # - mkdir -p mocks/grpc-interfaces/kloudlite.io/rpc/iam + # - mocki --package kloudlite.io/grpc-interfaces/kloudlite.io/rpc/iam --interface IAMClient > mocks/grpc-interfaces/kloudlite.io/rpc/iam/iam-client.go + # + # - mkdir -p mocks/grpc-interfaces/kloudlite.io/rpc/accounts + # - mocki --package kloudlite.io/grpc-interfaces/kloudlite.io/rpc/accounts --interface AccountsClient > mocks/grpc-interfaces/kloudlite.io/rpc/accounts/accounts-client.go + # + # - mkdir -p mocks/grpc-interfaces/kloudlite.io/rpc/message-office-internal + # + # # pkg/kafka mocks + # - mkdir -p mocks/pkg/kafka + # - mocki --package kloudlite.io/pkg/kafka --interface Producer > mocks/pkg/kafka/producer.go + # - mocki --package kloudlite.io/pkg/kafka --interface Consumer > mocks/pkg/kafka/consumer.go + # diff --git a/apps/accounts/Containerfile.local b/apps/accounts/Containerfile.local new file mode 100644 index 000000000..cfa21c354 --- /dev/null +++ b/apps/accounts/Containerfile.local @@ -0,0 +1,7 @@ +# syntax=docker/dockerfile:1.4 +FROM gcr.io/distroless/static:nonroot +WORKDIR /tmp +USER 1001:1001 +ARG APP +COPY --from=builder $APP ./accounts +CMD ["./accounts"] diff --git a/apps/accounts/Taskfile.yml b/apps/accounts/Taskfile.yml new file mode 100644 index 000000000..3da23b8a1 --- /dev/null +++ b/apps/accounts/Taskfile.yml @@ -0,0 +1,81 @@ +version: "3" + +dotenv: + - .secrets/env + +vars: + ImagePrefix: "ghcr.io/kloudlite/platform/apis" + +tasks: + gql: + dir: ./internal/app + cmds: + - go run github.com/99designs/gqlgen generate + - gofmt -w -d -r '"errors" -> "github.com/kloudlite/api/pkg/errors"' graph/*.resolvers.go + + build: + env: + CGO_ENABLED: 0 + GOOS: linux + GOARCH: amd64 + vars: + BuiltAt: + sh: date | sed 's/\s/_/g' + preconditions: + - sh: '[ -n "{{.Out}}" ]' + msg: var Out must have a value + cmds: + - go build -ldflags="-s -w -X github.com/kloudlite/api/common.BuiltAt=\"{{.BuiltAt}}\"" -o {{.Out}} + - upx {{.Out}} + + run: + dotenv: + - .secrets/env + cmds: + - go run main.go --dev + + k8s-schema: + cmds: + - mkdir -p "./internal/app/_struct-to-graphql" + - go run ../../cmd/struct-to-graphql + --struct github.com/kloudlite/api/apps/accounts/internal/entities.Account + --struct github.com/kloudlite/api/apps/accounts/internal/entities.Invitation + --struct github.com/kloudlite/api/apps/accounts/internal/entities.AccountMembership + > ./internal/app/_struct-to-graphql/main.go + - |+ + pushd ./internal/app/_struct-to-graphql + go run main.go --dev --out-dir ../graph/struct-to-graphql + popd + - rm -rf ./internal/app/_struct-to-graphql + + docker-build: + vars: + APP: finance + IMAGE: registry.kloudlite.io/kloudlite/{{.EnvName}}/{{.APP}}-api:{{.Tag}} + preconditions: + - sh: '[[ -n "{{.Tag}}" ]]' + msg: 'var Tag must have a value' + + - sh: '[[ "{{.EnvName}}" == "development" ]] || [[ "{{.EnvName}}" == "staging" ]] || [[ "{{.EnvName}}" == "production" ]]' + msg: 'var EnvName must have one of [development, staging, production] as its value' + cmds: + - docker buildx build -f ./Dockerfile -t {{.IMAGE}} . --build-arg APP={{.APP}} --platform linux/amd64 --build-context project-root=../.. + - docker push {{.IMAGE}} + + local-build: + preconditions: + - sh: '[ -n "{{.Tag}}" ]' + msg: 'var Tag must have a value' + vars: + Dockerfile: "./Containerfile.local" + APP: accounts + Image: "{{.ImagePrefix}}/{{.APP}}:{{.Tag}}" + cmds: + - |+ + dir=$(mktemp -d) + task build Out=$dir/{{.APP}} + + podman buildx build -t {{.Image}} -f {{.Dockerfile}} . --build-context builder=$dir --build-arg APP={{.APP}} + podman push {{.Image}} + rm -rf $dir + diff --git a/apps/accounts/internal/app/app.go b/apps/accounts/internal/app/app.go new file mode 100644 index 000000000..7f975bcf2 --- /dev/null +++ b/apps/accounts/internal/app/app.go @@ -0,0 +1,102 @@ +package app + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/gofiber/fiber/v2" + "github.com/kloudlite/api/apps/accounts/internal/app/graph" + "github.com/kloudlite/api/apps/accounts/internal/app/graph/generated" + "github.com/kloudlite/api/apps/accounts/internal/domain" + "github.com/kloudlite/api/apps/accounts/internal/entities" + "github.com/kloudlite/api/apps/accounts/internal/env" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/constants" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/accounts" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/auth" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/comms" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/console" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" + "github.com/kloudlite/api/pkg/grpc" + httpServer "github.com/kloudlite/api/pkg/http-server" + "github.com/kloudlite/api/pkg/kv" + "github.com/kloudlite/api/pkg/repos" + "go.uber.org/fx" +) + +type AuthCacheClient kv.Client + +type AuthClient grpc.Client + +type ConsoleClient grpc.Client + +type ( + ContainerRegistryClient grpc.Client + CommsClient grpc.Client + IAMClient grpc.Client +) + +var Module = fx.Module("app", + repos.NewFxMongoRepo[*entities.Account]("accounts", "acc", entities.AccountIndices), + repos.NewFxMongoRepo[*entities.Invitation]("invitations", "invite", entities.InvitationIndices), + + fx.Provide(func(client AuthCacheClient) kv.Repo[*entities.Invitation] { + return kv.NewRepo[*entities.Invitation](client) + }), + + // grpc clients + fx.Provide(func(conn ConsoleClient) console.ConsoleClient { + return console.NewConsoleClient(conn) + }), + + fx.Provide(func(conn IAMClient) iam.IAMClient { + return iam.NewIAMClient(conn) + }), + + fx.Provide(func(conn CommsClient) comms.CommsClient { + return comms.NewCommsClient(conn) + }), + + fx.Provide(func(conn AuthClient) auth.AuthClient { + return auth.NewAuthClient(conn) + }), + + fx.Provide(func(d domain.Domain) accounts.AccountsServer { + return &accountsGrpcServer{d: d} + }), + + fx.Invoke(func(d domain.Domain, gserver AccountsGrpcServer) { + registerAccountsGRPCServer(gserver, d) + }), + + domain.Module, + + fx.Invoke( + func(server httpServer.Server, d domain.Domain, env *env.Env, sessionRepo kv.Repo[*common.AuthSession]) { + gqlConfig := generated.Config{Resolvers: graph.NewResolver(d)} + + gqlConfig.Directives.IsLoggedInAndVerified = func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) { + sess := httpServer.GetSession[*common.AuthSession](ctx) + if sess == nil { + return nil, fiber.ErrUnauthorized + } + + if !sess.UserVerified { + return nil, fiber.ErrForbidden + } + + return next(context.WithValue(ctx, "kloudlite-user-session", *sess)) + } + + schema := generated.NewExecutableSchema(gqlConfig) + server.SetupGraphqlServer(schema, + httpServer.NewSessionMiddleware( + sessionRepo, + constants.CookieName, + env.CookieDomain, + constants.CacheSessionPrefix, + ), + ) + }, + ), +) diff --git a/apps/finance/internal/app/gqlgen.yml b/apps/accounts/internal/app/gqlgen.yml similarity index 60% rename from apps/finance/internal/app/gqlgen.yml rename to apps/accounts/internal/app/gqlgen.yml index 4c48c8869..2a020560c 100644 --- a/apps/finance/internal/app/gqlgen.yml +++ b/apps/accounts/internal/app/gqlgen.yml @@ -1,7 +1,8 @@ # Where are all the schema files located? globs are supported eg src/**/*.graphqls schema: - - crd-to-gql/*.graphqls - graph/*.graphqls + - graph/struct-to-graphql/*.graphqls + # Where should the generated server code go? exec: @@ -37,8 +38,7 @@ resolver: # 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: - - "kloudlite.io/pkg/errors" - # - "kloudlite.io/apps/wireguard/internal/domain/entities" + - "github.com/kloudlite/api/pkg/errors" # This section declares type mapping between the GraphQL and go type systems # @@ -46,35 +46,59 @@ autobind: # modelgen, the others will be allowed when binding to fields. Configure them to # your liking +skip_mod_tidy: true +skip_validation: true + models: + ID: + model: + - github.com/kloudlite/api/pkg/repos.ID + Int: + model: + - github.com/99designs/gqlgen/graphql.Int + - github.com/99designs/gqlgen/graphql.Int64 + - github.com/99designs/gqlgen/graphql.Int32 Json: model: - github.com/99designs/gqlgen/graphql.Map User: fields: - accountMembership: + accounts: resolver: true - accountMemberships: + accountInvitations: resolver: true - Account: - # model: kloudlite.io/apps/finance/internal/domain.Account + Account: &account-model + model: github.com/kloudlite/api/apps/accounts/internal/entities.Account fields: # accountMemberships: memberships: resolver: true # outstandingAmount: # resolver: true + AccountIn: *account-model AccountMembership: + model: github.com/kloudlite/api/apps/accounts/internal/entities.AccountMembership fields: user: resolver: true - account: - resolver: true - ID: - model: - - kloudlite.io/pkg/repos.ID - Int: - model: - - github.com/99designs/gqlgen/graphql.Int - - github.com/99designs/gqlgen/graphql.Int64 - - github.com/99designs/gqlgen/graphql.Int32 + + Invitation: &invitation-model + model: github.com/kloudlite/api/apps/accounts/internal/entities.Invitation + InvitationIn: *invitation-model + + Metadata: &metadata-model + model: k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta + MetadataIn: *metadata-model + + Github__com___kloudlite___operator___pkg___operator__Status: + model: github.com/kloudlite/operator/pkg/operator.Status + + AccountsCheckNameAvailabilityOutput: + model: github.com/kloudlite/api/apps/accounts/internal/domain.CheckNameAvailabilityOutput + + Github__com___kloudlite___api___apps___iam___types__Role: + model: github.com/kloudlite/api/apps/iam/types.Role + + Github__com___kloudlite___api___common__CreatedOrUpdatedBy: + model: github.com/kloudlite/api/common.CreatedOrUpdatedBy + diff --git a/apps/accounts/internal/app/graph/account.resolvers.go b/apps/accounts/internal/app/graph/account.resolvers.go new file mode 100644 index 000000000..353b54f07 --- /dev/null +++ b/apps/accounts/internal/app/graph/account.resolvers.go @@ -0,0 +1,57 @@ +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.28 + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + "time" + + "github.com/kloudlite/api/apps/accounts/internal/app/graph/generated" + "github.com/kloudlite/api/apps/accounts/internal/entities" + fn "github.com/kloudlite/api/pkg/functions" + "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// CreationTime is the resolver for the creationTime field. +func (r *accountResolver) CreationTime(ctx context.Context, obj *entities.Account) (string, error) { + if obj == nil { + return "", errors.Newf("account is nil") + } + return obj.BaseEntity.CreationTime.Format(time.RFC3339), nil +} + +// ID is the resolver for the id field. +func (r *accountResolver) ID(ctx context.Context, obj *entities.Account) (string, error) { + if obj == nil { + return "", errors.Newf("resource is nil") + } + return string(obj.Id), nil +} + +// UpdateTime is the resolver for the updateTime field. +func (r *accountResolver) UpdateTime(ctx context.Context, obj *entities.Account) (string, error) { + if obj == nil { + return "", errors.Newf("resource is nil") + } + return obj.UpdateTime.Format(time.RFC3339), nil +} + +// Metadata is the resolver for the metadata field. +func (r *accountInResolver) Metadata(ctx context.Context, obj *entities.Account, data *v1.ObjectMeta) error { + if obj == nil { + return errors.Newf("obj is nil") + } + return fn.JsonConversion(data, &obj.ObjectMeta) +} + +// Account returns generated.AccountResolver implementation. +func (r *Resolver) Account() generated.AccountResolver { return &accountResolver{r} } + +// AccountIn returns generated.AccountInResolver implementation. +func (r *Resolver) AccountIn() generated.AccountInResolver { return &accountInResolver{r} } + +type accountResolver struct{ *Resolver } +type accountInResolver struct{ *Resolver } diff --git a/apps/accounts/internal/app/graph/accountmembership.resolvers.go b/apps/accounts/internal/app/graph/accountmembership.resolvers.go new file mode 100644 index 000000000..30e84b8cb --- /dev/null +++ b/apps/accounts/internal/app/graph/accountmembership.resolvers.go @@ -0,0 +1,25 @@ +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.28 + +import ( + "context" + "fmt" + + "github.com/kloudlite/api/apps/accounts/internal/app/graph/generated" + "github.com/kloudlite/api/apps/accounts/internal/entities" +) + +// UserID is the resolver for the userId field. +func (r *accountMembershipResolver) UserID(ctx context.Context, obj *entities.AccountMembership) (string, error) { + panic(fmt.Errorf("not implemented: UserID - userId")) +} + +// AccountMembership returns generated.AccountMembershipResolver implementation. +func (r *Resolver) AccountMembership() generated.AccountMembershipResolver { + return &accountMembershipResolver{r} +} + +type accountMembershipResolver struct{ *Resolver } diff --git a/apps/accounts/internal/app/graph/common-types.resolvers.go b/apps/accounts/internal/app/graph/common-types.resolvers.go new file mode 100644 index 000000000..102a3f2da --- /dev/null +++ b/apps/accounts/internal/app/graph/common-types.resolvers.go @@ -0,0 +1,104 @@ +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.28 + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + "time" + + "github.com/kloudlite/api/apps/accounts/internal/app/graph/generated" + "github.com/kloudlite/api/common" + fn "github.com/kloudlite/api/pkg/functions" + "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// UserID is the resolver for the userId field. +func (r *github__com___kloudlite___api___common__CreatedOrUpdatedByResolver) UserID(ctx context.Context, obj *common.CreatedOrUpdatedBy) (string, error) { + if obj == nil { + return "", errors.Newf("createdOrUpdatedBy is nil") + } + return string(obj.UserId), nil +} + +// Annotations is the resolver for the annotations field. +func (r *metadataResolver) Annotations(ctx context.Context, obj *v1.ObjectMeta) (map[string]interface{}, error) { + if obj == nil { + return nil, errors.Newf("object metadata is nil") + } + + var m map[string]any + if err := fn.JsonConversion(obj.Annotations, &m); err != nil { + return nil, errors.NewE(err) + } + return m, nil +} + +// CreationTimestamp is the resolver for the creationTimestamp field. +func (r *metadataResolver) CreationTimestamp(ctx context.Context, obj *v1.ObjectMeta) (string, error) { + if obj == nil { + return "", errors.Newf("metadata is nil") + } + return obj.CreationTimestamp.Format(time.RFC3339), nil +} + +// DeletionTimestamp is the resolver for the deletionTimestamp field. +func (r *metadataResolver) DeletionTimestamp(ctx context.Context, obj *v1.ObjectMeta) (*string, error) { + if obj == nil { + return nil, errors.Newf("object metadata is nil") + } + if obj.DeletionTimestamp.IsZero() { + return nil, errors.Newf("object metadata is nil") + } + + return fn.New((*obj.DeletionTimestamp).Format(time.RFC3339)), nil +} + +// Labels is the resolver for the labels field. +func (r *metadataResolver) Labels(ctx context.Context, obj *v1.ObjectMeta) (map[string]interface{}, error) { + if obj == nil { + return nil, errors.Newf("object metadata is nil") + } + + m := make(map[string]interface{}, len(obj.Labels)) + if err := fn.JsonConversion(obj.Labels, &m); err != nil { + return nil, errors.NewE(err) + } + + return m, nil +} + +// Annotations is the resolver for the annotations field. +func (r *metadataInResolver) Annotations(ctx context.Context, obj *v1.ObjectMeta, data map[string]interface{}) error { + if obj == nil { + return errors.Newf("object annotations is nil") + } + + return fn.JsonConversion(data, &obj.Annotations) +} + +// Labels is the resolver for the labels field. +func (r *metadataInResolver) Labels(ctx context.Context, obj *v1.ObjectMeta, data map[string]interface{}) error { + if obj == nil { + return errors.Newf("object labels is nil") + } + + return fn.JsonConversion(data, &obj.Labels) +} + +// Github__com___kloudlite___api___common__CreatedOrUpdatedBy returns generated.Github__com___kloudlite___api___common__CreatedOrUpdatedByResolver implementation. +func (r *Resolver) Github__com___kloudlite___api___common__CreatedOrUpdatedBy() generated.Github__com___kloudlite___api___common__CreatedOrUpdatedByResolver { + return &github__com___kloudlite___api___common__CreatedOrUpdatedByResolver{r} +} + +// Metadata returns generated.MetadataResolver implementation. +func (r *Resolver) Metadata() generated.MetadataResolver { return &metadataResolver{r} } + +// MetadataIn returns generated.MetadataInResolver implementation. +func (r *Resolver) MetadataIn() generated.MetadataInResolver { return &metadataInResolver{r} } + +type github__com___kloudlite___api___common__CreatedOrUpdatedByResolver struct{ *Resolver } +type metadataResolver struct{ *Resolver } +type metadataInResolver struct{ *Resolver } diff --git a/apps/ci/internal/app/graph/entity.resolvers.go b/apps/accounts/internal/app/graph/entity.resolvers.go similarity index 50% rename from apps/ci/internal/app/graph/entity.resolvers.go rename to apps/accounts/internal/app/graph/entity.resolvers.go index 4a4f67c89..acaa25e36 100644 --- a/apps/ci/internal/app/graph/entity.resolvers.go +++ b/apps/accounts/internal/app/graph/entity.resolvers.go @@ -2,17 +2,19 @@ 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.28 import ( "context" - "kloudlite.io/apps/ci/internal/app/graph/generated" - "kloudlite.io/apps/ci/internal/app/graph/model" - "kloudlite.io/pkg/repos" + "github.com/kloudlite/api/apps/accounts/internal/app/graph/generated" + "github.com/kloudlite/api/apps/accounts/internal/app/graph/model" + "github.com/kloudlite/api/pkg/repos" ) -func (r *entityResolver) FindAppByID(ctx context.Context, id repos.ID) (*model.App, error) { - return &model.App{ +// FindUserByID is the resolver for the findUserByID field. +func (r *entityResolver) FindUserByID(ctx context.Context, id repos.ID) (*model.User, error) { + return &model.User{ ID: id, }, nil } diff --git a/apps/ci/internal/app/graph/generated/federation.go b/apps/accounts/internal/app/graph/generated/federation.go similarity index 86% rename from apps/ci/internal/app/graph/generated/federation.go rename to apps/accounts/internal/app/graph/generated/federation.go index d5c9528f5..214bc3d46 100644 --- a/apps/ci/internal/app/graph/generated/federation.go +++ b/apps/accounts/internal/app/graph/generated/federation.go @@ -80,21 +80,21 @@ func (ec *executionContext) __resolve_entities(ctx context.Context, representati }() switch typeName { - case "App": - resolverName, err := entityResolverNameForApp(ctx, rep) + case "User": + resolverName, err := entityResolverNameForUser(ctx, rep) if err != nil { - return fmt.Errorf(`finding resolver for Entity "App": %w`, err) + return fmt.Errorf(`finding resolver for Entity "User": %w`, err) } switch resolverName { - case "findAppByID": - id0, err := ec.unmarshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, rep["id"]) + case "findUserByID": + id0, err := ec.unmarshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx, rep["id"]) if err != nil { - return fmt.Errorf(`unmarshalling param 0 for findAppByID(): %w`, err) + return fmt.Errorf(`unmarshalling param 0 for findUserByID(): %w`, err) } - entity, err := ec.resolvers.Entity().FindAppByID(ctx, id0) + entity, err := ec.resolvers.Entity().FindUserByID(ctx, id0) if err != nil { - return fmt.Errorf(`resolving Entity "App": %w`, err) + return fmt.Errorf(`resolving Entity "User": %w`, err) } list[idx[i]] = entity @@ -169,7 +169,7 @@ func (ec *executionContext) __resolve_entities(ctx context.Context, representati } } -func entityResolverNameForApp(ctx context.Context, rep map[string]interface{}) (string, error) { +func entityResolverNameForUser(ctx context.Context, rep map[string]interface{}) (string, error) { for { var ( m map[string]interface{} @@ -181,7 +181,7 @@ func entityResolverNameForApp(ctx context.Context, rep map[string]interface{}) ( if _, ok = m["id"]; !ok { break } - return "findAppByID", nil + return "findUserByID", nil } - return "", fmt.Errorf("%w for App", ErrTypeNotFound) + return "", fmt.Errorf("%w for User", ErrTypeNotFound) } diff --git a/apps/finance/internal/app/graph/generated/generated.go b/apps/accounts/internal/app/graph/generated/generated.go similarity index 53% rename from apps/finance/internal/app/graph/generated/generated.go rename to apps/accounts/internal/app/graph/generated/generated.go index e09deeed1..465dcc6da 100644 --- a/apps/finance/internal/app/graph/generated/generated.go +++ b/apps/accounts/internal/app/graph/generated/generated.go @@ -14,10 +14,15 @@ import ( "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/introspection" "github.com/99designs/gqlgen/plugin/federation/fedruntime" + "github.com/kloudlite/api/apps/accounts/internal/app/graph/model" + "github.com/kloudlite/api/apps/accounts/internal/domain" + "github.com/kloudlite/api/apps/accounts/internal/entities" + "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/repos" gqlparser "github.com/vektah/gqlparser/v2" "github.com/vektah/gqlparser/v2/ast" - "kloudlite.io/apps/finance/internal/app/graph/model" - "kloudlite.io/pkg/repos" + "k8s.io/apimachinery/pkg/apis/meta/v1" ) // region ************************** generated!.gotpl ************************** @@ -41,69 +46,126 @@ type ResolverRoot interface { Account() AccountResolver AccountMembership() AccountMembershipResolver Entity() EntityResolver + Github__com___kloudlite___api___common__CreatedOrUpdatedBy() Github__com___kloudlite___api___common__CreatedOrUpdatedByResolver + Invitation() InvitationResolver + Metadata() MetadataResolver Mutation() MutationResolver Query() QueryResolver User() UserResolver + AccountIn() AccountInResolver + MetadataIn() MetadataInResolver } type DirectiveRoot struct { - IsLoggedIn func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) + HasAccount func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) + IsLoggedInAndVerified func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) } type ComplexityRoot struct { Account struct { - Billing func(childComplexity int) int ContactEmail func(childComplexity int) int - Created func(childComplexity int) int + CreatedBy func(childComplexity int) int + CreationTime func(childComplexity int) int DisplayName func(childComplexity int) int + ID func(childComplexity int) int IsActive func(childComplexity int) int - Memberships func(childComplexity int) int - Name func(childComplexity int) int - OutstandingAmount func(childComplexity int) int - ReadableID func(childComplexity int) int + LastUpdatedBy func(childComplexity int) int + Logo func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + ObjectMeta func(childComplexity int) int + RecordVersion func(childComplexity int) int + TargetNamespace func(childComplexity int) int + UpdateTime func(childComplexity int) int } AccountMembership struct { - Accepted func(childComplexity int) int - Account func(childComplexity int) int - Role func(childComplexity int) int - User func(childComplexity int) int + AccountName func(childComplexity int) int + Role func(childComplexity int) int + User func(childComplexity int) int + UserID func(childComplexity int) int } - Billing struct { - Address func(childComplexity int) int - CardholderName func(childComplexity int) int + AccountsCheckNameAvailabilityOutput struct { + Result func(childComplexity int) int + SuggestedNames func(childComplexity int) int } Entity struct { - FindAccountByName func(childComplexity int, name string) int - FindUserByID func(childComplexity int, id repos.ID) int + FindUserByID func(childComplexity int, id repos.ID) int + } + + Github__com___kloudlite___api___common__CreatedOrUpdatedBy struct { + UserEmail func(childComplexity int) int + UserID func(childComplexity int) int + UserName func(childComplexity int) int + } + + Invitation struct { + Accepted func(childComplexity int) int + AccountName func(childComplexity int) int + CreationTime func(childComplexity int) int + ID func(childComplexity int) int + InviteToken func(childComplexity int) int + InvitedBy func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + RecordVersion func(childComplexity int) int + Rejected func(childComplexity int) int + UpdateTime func(childComplexity int) int + UserEmail func(childComplexity int) int + UserName func(childComplexity int) int + UserRole func(childComplexity int) int + } + + Metadata struct { + Annotations func(childComplexity int) int + CreationTimestamp func(childComplexity int) int + DeletionTimestamp func(childComplexity int) int + Generation func(childComplexity int) int + Labels func(childComplexity int) int + Name func(childComplexity int) int + Namespace func(childComplexity int) int } Mutation struct { - FinanceActivateAccount func(childComplexity int, accountName string) int - FinanceCreateAccount func(childComplexity int, name string, displayName string) int - FinanceDeactivateAccount func(childComplexity int, accountName string) int - FinanceDeleteAccount func(childComplexity int, accountName string) int - FinanceDeleteInvitation func(childComplexity int, accountName string, email string) int - FinanceInviteUser func(childComplexity int, accountName string, name *string, email string, role string) int - FinanceRemoveAccountMember func(childComplexity int, accountName string, userID repos.ID) int - FinanceUpdateAccount func(childComplexity int, accountName string, name *string, contactEmail *string) int - FinanceUpdateAccountMember func(childComplexity int, accountName string, userID repos.ID, role string) int + AccountsAcceptInvitation func(childComplexity int, accountName string, inviteToken string) int + AccountsActivateAccount func(childComplexity int, accountName string) int + AccountsCreateAccount func(childComplexity int, account entities.Account) int + AccountsDeactivateAccount func(childComplexity int, accountName string) int + AccountsDeleteAccount func(childComplexity int, accountName string) int + AccountsDeleteInvitation func(childComplexity int, accountName string, invitationID string) int + AccountsInviteMembers func(childComplexity int, accountName string, invitations []*entities.Invitation) int + AccountsRejectInvitation func(childComplexity int, accountName string, inviteToken string) int + AccountsRemoveAccountMembership func(childComplexity int, accountName string, memberID repos.ID) int + AccountsResendInviteMail func(childComplexity int, accountName string, invitationID string) int + AccountsUpdateAccount func(childComplexity int, account entities.Account) int + AccountsUpdateAccountMembership func(childComplexity int, accountName string, memberID repos.ID, role types.Role) int + } + + PageInfo struct { + EndCursor func(childComplexity int) int + HasNextPage func(childComplexity int) int + HasPreviousPage func(childComplexity int) int + StartCursor func(childComplexity int) int } Query struct { - FinanceAccount func(childComplexity int, accountName string) int - FinanceListAccounts func(childComplexity int) int - FinanceListInvitations func(childComplexity int, accountName string) int - FinanceReSyncAccount func(childComplexity int, accountName string) int - __resolve__service func(childComplexity int) int - __resolve_entities func(childComplexity int, representations []map[string]interface{}) int + AccountsCheckNameAvailability func(childComplexity int, name string) int + AccountsGetAccount func(childComplexity int, accountName string) int + AccountsGetAccountMembership func(childComplexity int, accountName string) int + AccountsGetInvitation func(childComplexity int, accountName string, invitationID string) int + AccountsListAccounts func(childComplexity int) int + AccountsListInvitations func(childComplexity int, accountName string) int + AccountsListInvitationsForUser func(childComplexity int, onlyPending bool) int + AccountsListMembershipsForAccount func(childComplexity int, accountName string, role *types.Role) int + AccountsListMembershipsForUser func(childComplexity int) int + AccountsResyncAccount func(childComplexity int, accountName string) int + __resolve__service func(childComplexity int) int + __resolve_entities func(childComplexity int, representations []map[string]interface{}) int } User struct { - AccountMembership func(childComplexity int, accountName string) int - AccountMemberships func(childComplexity int) int + AccountInvitations func(childComplexity int, onlyPending bool) int + Accounts func(childComplexity int) int ID func(childComplexity int) int } @@ -113,37 +175,72 @@ type ComplexityRoot struct { } type AccountResolver interface { - Memberships(ctx context.Context, obj *model.Account) ([]*model.AccountMembership, error) + CreationTime(ctx context.Context, obj *entities.Account) (string, error) + + ID(ctx context.Context, obj *entities.Account) (string, error) + + UpdateTime(ctx context.Context, obj *entities.Account) (string, error) } type AccountMembershipResolver interface { - User(ctx context.Context, obj *model.AccountMembership) (*model.User, error) - - Account(ctx context.Context, obj *model.AccountMembership) (*model.Account, error) + UserID(ctx context.Context, obj *entities.AccountMembership) (string, error) + User(ctx context.Context, obj *entities.AccountMembership) (*model.User, error) } type EntityResolver interface { - FindAccountByName(ctx context.Context, name string) (*model.Account, error) FindUserByID(ctx context.Context, id repos.ID) (*model.User, error) } +type Github__com___kloudlite___api___common__CreatedOrUpdatedByResolver interface { + UserID(ctx context.Context, obj *common.CreatedOrUpdatedBy) (string, error) +} +type InvitationResolver interface { + CreationTime(ctx context.Context, obj *entities.Invitation) (string, error) + ID(ctx context.Context, obj *entities.Invitation) (string, error) + + UpdateTime(ctx context.Context, obj *entities.Invitation) (string, error) +} +type MetadataResolver interface { + Annotations(ctx context.Context, obj *v1.ObjectMeta) (map[string]interface{}, error) + CreationTimestamp(ctx context.Context, obj *v1.ObjectMeta) (string, error) + DeletionTimestamp(ctx context.Context, obj *v1.ObjectMeta) (*string, error) + + Labels(ctx context.Context, obj *v1.ObjectMeta) (map[string]interface{}, error) +} type MutationResolver interface { - FinanceCreateAccount(ctx context.Context, name string, displayName string) (*model.Account, error) - FinanceUpdateAccount(ctx context.Context, accountName string, name *string, contactEmail *string) (*model.Account, error) - FinanceRemoveAccountMember(ctx context.Context, accountName string, userID repos.ID) (bool, error) - FinanceUpdateAccountMember(ctx context.Context, accountName string, userID repos.ID, role string) (bool, error) - FinanceDeactivateAccount(ctx context.Context, accountName string) (bool, error) - FinanceActivateAccount(ctx context.Context, accountName string) (bool, error) - FinanceDeleteAccount(ctx context.Context, accountName string) (bool, error) - FinanceInviteUser(ctx context.Context, accountName string, name *string, email string, role string) (bool, error) - FinanceDeleteInvitation(ctx context.Context, accountName string, email string) (bool, error) + AccountsCreateAccount(ctx context.Context, account entities.Account) (*entities.Account, error) + AccountsUpdateAccount(ctx context.Context, account entities.Account) (*entities.Account, error) + AccountsDeactivateAccount(ctx context.Context, accountName string) (bool, error) + AccountsActivateAccount(ctx context.Context, accountName string) (bool, error) + AccountsDeleteAccount(ctx context.Context, accountName string) (bool, error) + AccountsInviteMembers(ctx context.Context, accountName string, invitations []*entities.Invitation) ([]*entities.Invitation, error) + AccountsResendInviteMail(ctx context.Context, accountName string, invitationID string) (bool, error) + AccountsDeleteInvitation(ctx context.Context, accountName string, invitationID string) (bool, error) + AccountsAcceptInvitation(ctx context.Context, accountName string, inviteToken string) (bool, error) + AccountsRejectInvitation(ctx context.Context, accountName string, inviteToken string) (bool, error) + AccountsRemoveAccountMembership(ctx context.Context, accountName string, memberID repos.ID) (bool, error) + AccountsUpdateAccountMembership(ctx context.Context, accountName string, memberID repos.ID, role types.Role) (bool, error) } type QueryResolver interface { - FinanceListAccounts(ctx context.Context) ([]*model.Account, error) - FinanceAccount(ctx context.Context, accountName string) (*model.Account, error) - FinanceListInvitations(ctx context.Context, accountName string) ([]*model.AccountMembership, error) - FinanceReSyncAccount(ctx context.Context, accountName string) (bool, error) + AccountsListAccounts(ctx context.Context) ([]*entities.Account, error) + AccountsGetAccount(ctx context.Context, accountName string) (*entities.Account, error) + AccountsResyncAccount(ctx context.Context, accountName string) (bool, error) + AccountsListInvitations(ctx context.Context, accountName string) ([]*entities.Invitation, error) + AccountsGetInvitation(ctx context.Context, accountName string, invitationID string) (*entities.Invitation, error) + AccountsListInvitationsForUser(ctx context.Context, onlyPending bool) ([]*entities.Invitation, error) + AccountsCheckNameAvailability(ctx context.Context, name string) (*domain.CheckNameAvailabilityOutput, error) + AccountsListMembershipsForUser(ctx context.Context) ([]*entities.AccountMembership, error) + AccountsListMembershipsForAccount(ctx context.Context, accountName string, role *types.Role) ([]*entities.AccountMembership, error) + AccountsGetAccountMembership(ctx context.Context, accountName string) (*entities.AccountMembership, error) } type UserResolver interface { - AccountMemberships(ctx context.Context, obj *model.User) ([]*model.AccountMembership, error) - AccountMembership(ctx context.Context, obj *model.User, accountName string) (*model.AccountMembership, error) + Accounts(ctx context.Context, obj *model.User) ([]*entities.AccountMembership, error) + AccountInvitations(ctx context.Context, obj *model.User, onlyPending bool) ([]*entities.Invitation, error) +} + +type AccountInResolver interface { + Metadata(ctx context.Context, obj *entities.Account, data *v1.ObjectMeta) error +} +type MetadataInResolver interface { + Annotations(ctx context.Context, obj *v1.ObjectMeta, data map[string]interface{}) error + Labels(ctx context.Context, obj *v1.ObjectMeta, data map[string]interface{}) error } type executableSchema struct { @@ -161,26 +258,26 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in _ = ec switch typeName + "." + field { - case "Account.billing": - if e.complexity.Account.Billing == nil { + case "Account.contactEmail": + if e.complexity.Account.ContactEmail == nil { break } - return e.complexity.Account.Billing(childComplexity), true + return e.complexity.Account.ContactEmail(childComplexity), true - case "Account.contactEmail": - if e.complexity.Account.ContactEmail == nil { + case "Account.createdBy": + if e.complexity.Account.CreatedBy == nil { break } - return e.complexity.Account.ContactEmail(childComplexity), true + return e.complexity.Account.CreatedBy(childComplexity), true - case "Account.created": - if e.complexity.Account.Created == nil { + case "Account.creationTime": + if e.complexity.Account.CreationTime == nil { break } - return e.complexity.Account.Created(childComplexity), true + return e.complexity.Account.CreationTime(childComplexity), true case "Account.displayName": if e.complexity.Account.DisplayName == nil { @@ -189,6 +286,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Account.DisplayName(childComplexity), true + case "Account.id": + if e.complexity.Account.ID == nil { + break + } + + return e.complexity.Account.ID(childComplexity), true + case "Account.isActive": if e.complexity.Account.IsActive == nil { break @@ -196,47 +300,61 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Account.IsActive(childComplexity), true - case "Account.memberships": - if e.complexity.Account.Memberships == nil { + case "Account.lastUpdatedBy": + if e.complexity.Account.LastUpdatedBy == nil { + break + } + + return e.complexity.Account.LastUpdatedBy(childComplexity), true + + case "Account.logo": + if e.complexity.Account.Logo == nil { + break + } + + return e.complexity.Account.Logo(childComplexity), true + + case "Account.markedForDeletion": + if e.complexity.Account.MarkedForDeletion == nil { break } - return e.complexity.Account.Memberships(childComplexity), true + return e.complexity.Account.MarkedForDeletion(childComplexity), true - case "Account.name": - if e.complexity.Account.Name == nil { + case "Account.metadata": + if e.complexity.Account.ObjectMeta == nil { break } - return e.complexity.Account.Name(childComplexity), true + return e.complexity.Account.ObjectMeta(childComplexity), true - case "Account.outstandingAmount": - if e.complexity.Account.OutstandingAmount == nil { + case "Account.recordVersion": + if e.complexity.Account.RecordVersion == nil { break } - return e.complexity.Account.OutstandingAmount(childComplexity), true + return e.complexity.Account.RecordVersion(childComplexity), true - case "Account.readableId": - if e.complexity.Account.ReadableID == nil { + case "Account.targetNamespace": + if e.complexity.Account.TargetNamespace == nil { break } - return e.complexity.Account.ReadableID(childComplexity), true + return e.complexity.Account.TargetNamespace(childComplexity), true - case "AccountMembership.accepted": - if e.complexity.AccountMembership.Accepted == nil { + case "Account.updateTime": + if e.complexity.Account.UpdateTime == nil { break } - return e.complexity.AccountMembership.Accepted(childComplexity), true + return e.complexity.Account.UpdateTime(childComplexity), true - case "AccountMembership.account": - if e.complexity.AccountMembership.Account == nil { + case "AccountMembership.accountName": + if e.complexity.AccountMembership.AccountName == nil { break } - return e.complexity.AccountMembership.Account(childComplexity), true + return e.complexity.AccountMembership.AccountName(childComplexity), true case "AccountMembership.role": if e.complexity.AccountMembership.Role == nil { @@ -252,31 +370,26 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.AccountMembership.User(childComplexity), true - case "Billing.address": - if e.complexity.Billing.Address == nil { + case "AccountMembership.userId": + if e.complexity.AccountMembership.UserID == nil { break } - return e.complexity.Billing.Address(childComplexity), true + return e.complexity.AccountMembership.UserID(childComplexity), true - case "Billing.cardholderName": - if e.complexity.Billing.CardholderName == nil { + case "AccountsCheckNameAvailabilityOutput.result": + if e.complexity.AccountsCheckNameAvailabilityOutput.Result == nil { break } - return e.complexity.Billing.CardholderName(childComplexity), true + return e.complexity.AccountsCheckNameAvailabilityOutput.Result(childComplexity), true - case "Entity.findAccountByName": - if e.complexity.Entity.FindAccountByName == nil { + case "AccountsCheckNameAvailabilityOutput.suggestedNames": + if e.complexity.AccountsCheckNameAvailabilityOutput.SuggestedNames == nil { break } - args, err := ec.field_Entity_findAccountByName_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Entity.FindAccountByName(childComplexity, args["name"].(string)), true + return e.complexity.AccountsCheckNameAvailabilityOutput.SuggestedNames(childComplexity), true case "Entity.findUserByID": if e.complexity.Entity.FindUserByID == nil { @@ -290,156 +403,448 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Entity.FindUserByID(childComplexity, args["id"].(repos.ID)), true - case "Mutation.finance_activateAccount": - if e.complexity.Mutation.FinanceActivateAccount == nil { + case "Github__com___kloudlite___api___common__CreatedOrUpdatedBy.userEmail": + if e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserEmail == nil { + break + } + + return e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserEmail(childComplexity), true + + case "Github__com___kloudlite___api___common__CreatedOrUpdatedBy.userId": + if e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserID == nil { + break + } + + return e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserID(childComplexity), true + + case "Github__com___kloudlite___api___common__CreatedOrUpdatedBy.userName": + if e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserName == nil { + break + } + + return e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserName(childComplexity), true + + case "Invitation.accepted": + if e.complexity.Invitation.Accepted == nil { + break + } + + return e.complexity.Invitation.Accepted(childComplexity), true + + case "Invitation.accountName": + if e.complexity.Invitation.AccountName == nil { + break + } + + return e.complexity.Invitation.AccountName(childComplexity), true + + case "Invitation.creationTime": + if e.complexity.Invitation.CreationTime == nil { + break + } + + return e.complexity.Invitation.CreationTime(childComplexity), true + + case "Invitation.id": + if e.complexity.Invitation.ID == nil { + break + } + + return e.complexity.Invitation.ID(childComplexity), true + + case "Invitation.inviteToken": + if e.complexity.Invitation.InviteToken == nil { + break + } + + return e.complexity.Invitation.InviteToken(childComplexity), true + + case "Invitation.invitedBy": + if e.complexity.Invitation.InvitedBy == nil { + break + } + + return e.complexity.Invitation.InvitedBy(childComplexity), true + + case "Invitation.markedForDeletion": + if e.complexity.Invitation.MarkedForDeletion == nil { + break + } + + return e.complexity.Invitation.MarkedForDeletion(childComplexity), true + + case "Invitation.recordVersion": + if e.complexity.Invitation.RecordVersion == nil { + break + } + + return e.complexity.Invitation.RecordVersion(childComplexity), true + + case "Invitation.rejected": + if e.complexity.Invitation.Rejected == nil { + break + } + + return e.complexity.Invitation.Rejected(childComplexity), true + + case "Invitation.updateTime": + if e.complexity.Invitation.UpdateTime == nil { + break + } + + return e.complexity.Invitation.UpdateTime(childComplexity), true + + case "Invitation.userEmail": + if e.complexity.Invitation.UserEmail == nil { + break + } + + return e.complexity.Invitation.UserEmail(childComplexity), true + + case "Invitation.userName": + if e.complexity.Invitation.UserName == nil { + break + } + + return e.complexity.Invitation.UserName(childComplexity), true + + case "Invitation.userRole": + if e.complexity.Invitation.UserRole == nil { + break + } + + return e.complexity.Invitation.UserRole(childComplexity), true + + case "Metadata.annotations": + if e.complexity.Metadata.Annotations == nil { + break + } + + return e.complexity.Metadata.Annotations(childComplexity), true + + case "Metadata.creationTimestamp": + if e.complexity.Metadata.CreationTimestamp == nil { + break + } + + return e.complexity.Metadata.CreationTimestamp(childComplexity), true + + case "Metadata.deletionTimestamp": + if e.complexity.Metadata.DeletionTimestamp == nil { + break + } + + return e.complexity.Metadata.DeletionTimestamp(childComplexity), true + + case "Metadata.generation": + if e.complexity.Metadata.Generation == nil { + break + } + + return e.complexity.Metadata.Generation(childComplexity), true + + case "Metadata.labels": + if e.complexity.Metadata.Labels == nil { + break + } + + return e.complexity.Metadata.Labels(childComplexity), true + + case "Metadata.name": + if e.complexity.Metadata.Name == nil { + break + } + + return e.complexity.Metadata.Name(childComplexity), true + + case "Metadata.namespace": + if e.complexity.Metadata.Namespace == nil { + break + } + + return e.complexity.Metadata.Namespace(childComplexity), true + + case "Mutation.accounts_acceptInvitation": + if e.complexity.Mutation.AccountsAcceptInvitation == nil { + break + } + + args, err := ec.field_Mutation_accounts_acceptInvitation_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.AccountsAcceptInvitation(childComplexity, args["accountName"].(string), args["inviteToken"].(string)), true + + case "Mutation.accounts_activateAccount": + if e.complexity.Mutation.AccountsActivateAccount == nil { + break + } + + args, err := ec.field_Mutation_accounts_activateAccount_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.AccountsActivateAccount(childComplexity, args["accountName"].(string)), true + + case "Mutation.accounts_createAccount": + if e.complexity.Mutation.AccountsCreateAccount == nil { + break + } + + args, err := ec.field_Mutation_accounts_createAccount_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.AccountsCreateAccount(childComplexity, args["account"].(entities.Account)), true + + case "Mutation.accounts_deactivateAccount": + if e.complexity.Mutation.AccountsDeactivateAccount == nil { + break + } + + args, err := ec.field_Mutation_accounts_deactivateAccount_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.AccountsDeactivateAccount(childComplexity, args["accountName"].(string)), true + + case "Mutation.accounts_deleteAccount": + if e.complexity.Mutation.AccountsDeleteAccount == nil { + break + } + + args, err := ec.field_Mutation_accounts_deleteAccount_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.AccountsDeleteAccount(childComplexity, args["accountName"].(string)), true + + case "Mutation.accounts_deleteInvitation": + if e.complexity.Mutation.AccountsDeleteInvitation == nil { + break + } + + args, err := ec.field_Mutation_accounts_deleteInvitation_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.AccountsDeleteInvitation(childComplexity, args["accountName"].(string), args["invitationId"].(string)), true + + case "Mutation.accounts_inviteMembers": + if e.complexity.Mutation.AccountsInviteMembers == nil { + break + } + + args, err := ec.field_Mutation_accounts_inviteMembers_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.AccountsInviteMembers(childComplexity, args["accountName"].(string), args["invitations"].([]*entities.Invitation)), true + + case "Mutation.accounts_rejectInvitation": + if e.complexity.Mutation.AccountsRejectInvitation == nil { break } - args, err := ec.field_Mutation_finance_activateAccount_args(context.TODO(), rawArgs) + args, err := ec.field_Mutation_accounts_rejectInvitation_args(context.TODO(), rawArgs) if err != nil { return 0, false } - return e.complexity.Mutation.FinanceActivateAccount(childComplexity, args["accountName"].(string)), true + return e.complexity.Mutation.AccountsRejectInvitation(childComplexity, args["accountName"].(string), args["inviteToken"].(string)), true - case "Mutation.finance_createAccount": - if e.complexity.Mutation.FinanceCreateAccount == nil { + case "Mutation.accounts_removeAccountMembership": + if e.complexity.Mutation.AccountsRemoveAccountMembership == nil { break } - args, err := ec.field_Mutation_finance_createAccount_args(context.TODO(), rawArgs) + args, err := ec.field_Mutation_accounts_removeAccountMembership_args(context.TODO(), rawArgs) if err != nil { return 0, false } - return e.complexity.Mutation.FinanceCreateAccount(childComplexity, args["name"].(string), args["displayName"].(string)), true + return e.complexity.Mutation.AccountsRemoveAccountMembership(childComplexity, args["accountName"].(string), args["memberId"].(repos.ID)), true - case "Mutation.finance_deactivateAccount": - if e.complexity.Mutation.FinanceDeactivateAccount == nil { + case "Mutation.accounts_resendInviteMail": + if e.complexity.Mutation.AccountsResendInviteMail == nil { break } - args, err := ec.field_Mutation_finance_deactivateAccount_args(context.TODO(), rawArgs) + args, err := ec.field_Mutation_accounts_resendInviteMail_args(context.TODO(), rawArgs) if err != nil { return 0, false } - return e.complexity.Mutation.FinanceDeactivateAccount(childComplexity, args["accountName"].(string)), true + return e.complexity.Mutation.AccountsResendInviteMail(childComplexity, args["accountName"].(string), args["invitationId"].(string)), true - case "Mutation.finance_deleteAccount": - if e.complexity.Mutation.FinanceDeleteAccount == nil { + case "Mutation.accounts_updateAccount": + if e.complexity.Mutation.AccountsUpdateAccount == nil { break } - args, err := ec.field_Mutation_finance_deleteAccount_args(context.TODO(), rawArgs) + args, err := ec.field_Mutation_accounts_updateAccount_args(context.TODO(), rawArgs) if err != nil { return 0, false } - return e.complexity.Mutation.FinanceDeleteAccount(childComplexity, args["accountName"].(string)), true + return e.complexity.Mutation.AccountsUpdateAccount(childComplexity, args["account"].(entities.Account)), true - case "Mutation.finance_deleteInvitation": - if e.complexity.Mutation.FinanceDeleteInvitation == nil { + case "Mutation.accounts_updateAccountMembership": + if e.complexity.Mutation.AccountsUpdateAccountMembership == nil { break } - args, err := ec.field_Mutation_finance_deleteInvitation_args(context.TODO(), rawArgs) + args, err := ec.field_Mutation_accounts_updateAccountMembership_args(context.TODO(), rawArgs) if err != nil { return 0, false } - return e.complexity.Mutation.FinanceDeleteInvitation(childComplexity, args["accountName"].(string), args["email"].(string)), true + return e.complexity.Mutation.AccountsUpdateAccountMembership(childComplexity, args["accountName"].(string), args["memberId"].(repos.ID), args["role"].(types.Role)), true + + case "PageInfo.endCursor": + if e.complexity.PageInfo.EndCursor == nil { + break + } + + return e.complexity.PageInfo.EndCursor(childComplexity), true + + case "PageInfo.hasNextPage": + if e.complexity.PageInfo.HasNextPage == nil { + break + } + + return e.complexity.PageInfo.HasNextPage(childComplexity), true + + case "PageInfo.hasPreviousPage": + if e.complexity.PageInfo.HasPreviousPage == nil { + break + } + + return e.complexity.PageInfo.HasPreviousPage(childComplexity), true + + case "PageInfo.startCursor": + if e.complexity.PageInfo.StartCursor == nil { + break + } + + return e.complexity.PageInfo.StartCursor(childComplexity), true - case "Mutation.finance_inviteUser": - if e.complexity.Mutation.FinanceInviteUser == nil { + case "Query.accounts_checkNameAvailability": + if e.complexity.Query.AccountsCheckNameAvailability == nil { break } - args, err := ec.field_Mutation_finance_inviteUser_args(context.TODO(), rawArgs) + args, err := ec.field_Query_accounts_checkNameAvailability_args(context.TODO(), rawArgs) if err != nil { return 0, false } - return e.complexity.Mutation.FinanceInviteUser(childComplexity, args["accountName"].(string), args["name"].(*string), args["email"].(string), args["role"].(string)), true + return e.complexity.Query.AccountsCheckNameAvailability(childComplexity, args["name"].(string)), true - case "Mutation.finance_removeAccountMember": - if e.complexity.Mutation.FinanceRemoveAccountMember == nil { + case "Query.accounts_getAccount": + if e.complexity.Query.AccountsGetAccount == nil { break } - args, err := ec.field_Mutation_finance_removeAccountMember_args(context.TODO(), rawArgs) + args, err := ec.field_Query_accounts_getAccount_args(context.TODO(), rawArgs) if err != nil { return 0, false } - return e.complexity.Mutation.FinanceRemoveAccountMember(childComplexity, args["accountName"].(string), args["userId"].(repos.ID)), true + return e.complexity.Query.AccountsGetAccount(childComplexity, args["accountName"].(string)), true - case "Mutation.finance_updateAccount": - if e.complexity.Mutation.FinanceUpdateAccount == nil { + case "Query.accounts_getAccountMembership": + if e.complexity.Query.AccountsGetAccountMembership == nil { break } - args, err := ec.field_Mutation_finance_updateAccount_args(context.TODO(), rawArgs) + args, err := ec.field_Query_accounts_getAccountMembership_args(context.TODO(), rawArgs) if err != nil { return 0, false } - return e.complexity.Mutation.FinanceUpdateAccount(childComplexity, args["accountName"].(string), args["name"].(*string), args["contactEmail"].(*string)), true + return e.complexity.Query.AccountsGetAccountMembership(childComplexity, args["accountName"].(string)), true - case "Mutation.finance_updateAccountMember": - if e.complexity.Mutation.FinanceUpdateAccountMember == nil { + case "Query.accounts_getInvitation": + if e.complexity.Query.AccountsGetInvitation == nil { break } - args, err := ec.field_Mutation_finance_updateAccountMember_args(context.TODO(), rawArgs) + args, err := ec.field_Query_accounts_getInvitation_args(context.TODO(), rawArgs) if err != nil { return 0, false } - return e.complexity.Mutation.FinanceUpdateAccountMember(childComplexity, args["accountName"].(string), args["userId"].(repos.ID), args["role"].(string)), true + return e.complexity.Query.AccountsGetInvitation(childComplexity, args["accountName"].(string), args["invitationId"].(string)), true + + case "Query.accounts_listAccounts": + if e.complexity.Query.AccountsListAccounts == nil { + break + } + + return e.complexity.Query.AccountsListAccounts(childComplexity), true - case "Query.finance_account": - if e.complexity.Query.FinanceAccount == nil { + case "Query.accounts_listInvitations": + if e.complexity.Query.AccountsListInvitations == nil { break } - args, err := ec.field_Query_finance_account_args(context.TODO(), rawArgs) + args, err := ec.field_Query_accounts_listInvitations_args(context.TODO(), rawArgs) if err != nil { return 0, false } - return e.complexity.Query.FinanceAccount(childComplexity, args["accountName"].(string)), true + return e.complexity.Query.AccountsListInvitations(childComplexity, args["accountName"].(string)), true - case "Query.finance_listAccounts": - if e.complexity.Query.FinanceListAccounts == nil { + case "Query.accounts_listInvitationsForUser": + if e.complexity.Query.AccountsListInvitationsForUser == nil { break } - return e.complexity.Query.FinanceListAccounts(childComplexity), true + args, err := ec.field_Query_accounts_listInvitationsForUser_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.AccountsListInvitationsForUser(childComplexity, args["onlyPending"].(bool)), true - case "Query.finance_listInvitations": - if e.complexity.Query.FinanceListInvitations == nil { + case "Query.accounts_listMembershipsForAccount": + if e.complexity.Query.AccountsListMembershipsForAccount == nil { break } - args, err := ec.field_Query_finance_listInvitations_args(context.TODO(), rawArgs) + args, err := ec.field_Query_accounts_listMembershipsForAccount_args(context.TODO(), rawArgs) if err != nil { return 0, false } - return e.complexity.Query.FinanceListInvitations(childComplexity, args["accountName"].(string)), true + return e.complexity.Query.AccountsListMembershipsForAccount(childComplexity, args["accountName"].(string), args["role"].(*types.Role)), true + + case "Query.accounts_listMembershipsForUser": + if e.complexity.Query.AccountsListMembershipsForUser == nil { + break + } + + return e.complexity.Query.AccountsListMembershipsForUser(childComplexity), true - case "Query.finance_reSyncAccount": - if e.complexity.Query.FinanceReSyncAccount == nil { + case "Query.accounts_resyncAccount": + if e.complexity.Query.AccountsResyncAccount == nil { break } - args, err := ec.field_Query_finance_reSyncAccount_args(context.TODO(), rawArgs) + args, err := ec.field_Query_accounts_resyncAccount_args(context.TODO(), rawArgs) if err != nil { return 0, false } - return e.complexity.Query.FinanceReSyncAccount(childComplexity, args["accountName"].(string)), true + return e.complexity.Query.AccountsResyncAccount(childComplexity, args["accountName"].(string)), true case "Query._service": if e.complexity.Query.__resolve__service == nil { @@ -460,24 +865,24 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.__resolve_entities(childComplexity, args["representations"].([]map[string]interface{})), true - case "User.accountMembership": - if e.complexity.User.AccountMembership == nil { + case "User.accountInvitations": + if e.complexity.User.AccountInvitations == nil { break } - args, err := ec.field_User_accountMembership_args(context.TODO(), rawArgs) + args, err := ec.field_User_accountInvitations_args(context.TODO(), rawArgs) if err != nil { return 0, false } - return e.complexity.User.AccountMembership(childComplexity, args["accountName"].(string)), true + return e.complexity.User.AccountInvitations(childComplexity, args["onlyPending"].(bool)), true - case "User.accountMemberships": - if e.complexity.User.AccountMemberships == nil { + case "User.accounts": + if e.complexity.User.Accounts == nil { break } - return e.complexity.User.AccountMemberships(childComplexity), true + return e.complexity.User.Accounts(childComplexity), true case "User.id": if e.complexity.User.ID == nil { @@ -501,7 +906,10 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { rc := graphql.GetOperationContext(ctx) ec := executionContext{rc, e} inputUnmarshalMap := graphql.BuildUnmarshalerMap( - ec.unmarshalInputBillingInput, + ec.unmarshalInputAccountIn, + ec.unmarshalInputAccountMembershipIn, + ec.unmarshalInputInvitationIn, + ec.unmarshalInputMetadataIn, ) first := true @@ -562,93 +970,174 @@ func (ec *executionContext) introspectType(name string) (*introspection.Type, er } var sources = []*ast.Source{ - {Name: "../schema.graphqls", Input: `directive @isLoggedIn on FIELD_DEFINITION + {Name: "../schema.graphqls", Input: `directive @isLoggedInAndVerified on FIELD_DEFINITION +directive @hasAccount on FIELD_DEFINITION + +type AccountsCheckNameAvailabilityOutput @shareable { + result: Boolean! + suggestedNames: [String!] +} + +extend type AccountMembership { + user: User! +} type Query { - finance_listAccounts: [Account] @isLoggedIn - finance_account(accountName: String!): Account @isLoggedIn - finance_listInvitations(accountName: String!): [AccountMembership] @isLoggedIn - # finance_stripeSetupIntent: String # user-access - # finance_testStripe(accountId: ID!): Boolean! #private + accounts_listAccounts: [Account] @isLoggedInAndVerified + accounts_getAccount(accountName: String!): Account @isLoggedInAndVerified + accounts_resyncAccount(accountName: String!): Boolean! @isLoggedInAndVerified + + accounts_listInvitations(accountName: String!): [Invitation!] @isLoggedInAndVerified + accounts_getInvitation(accountName: String!, invitationId: String!): Invitation @isLoggedInAndVerified + accounts_listInvitationsForUser(onlyPending: Boolean!): [Invitation!] @isLoggedInAndVerified - finance_reSyncAccount(accountName: String!): Boolean! @isLoggedIn + accounts_checkNameAvailability(name: String!): AccountsCheckNameAvailabilityOutput! @isLoggedInAndVerified + + accounts_listMembershipsForUser: [AccountMembership!] @isLoggedInAndVerified + accounts_listMembershipsForAccount(accountName: String!, role: Github__com___kloudlite___api___apps___iam___types__Role): [AccountMembership!] @isLoggedInAndVerified + accounts_getAccountMembership(accountName: String!): AccountMembership @isLoggedInAndVerified } type Mutation { - finance_createAccount(name: String!, displayName: String!): Account! @isLoggedIn - finance_updateAccount(accountName: String!, name: String, contactEmail: String): Account! @isLoggedIn - # finance_updateAccountBilling(accountId: ID!, billing: BillingInput!): Account! # account-admin-access, account-owner-access - finance_removeAccountMember(accountName: String!, userId: ID!): Boolean! @isLoggedIn - finance_updateAccountMember(accountName: String!, userId: ID!, role: String!): Boolean! @isLoggedIn - finance_deactivateAccount(accountName: String!): Boolean! @isLoggedIn - finance_activateAccount(accountName: String!): Boolean! @isLoggedIn - finance_deleteAccount(accountName: String!): Boolean! @isLoggedIn - # finance_attachToCluster(accountId: ID!, clusterId: ID!): Boolean! + accounts_createAccount(account: AccountIn!): Account! @isLoggedInAndVerified + accounts_updateAccount(account: AccountIn!): Account! @isLoggedInAndVerified - finance_inviteUser(accountName: String!, name: String, email: String!, role: String!): Boolean! @isLoggedIn - finance_deleteInvitation(accountName: String!, email: String!): Boolean! @isLoggedIn -} + accounts_deactivateAccount(accountName: String!): Boolean! @isLoggedInAndVerified + accounts_activateAccount(accountName: String!): Boolean! @isLoggedInAndVerified -scalar Json -scalar Date + accounts_deleteAccount(accountName: String!): Boolean! @isLoggedInAndVerified + # accounts_attachToCluster(accountId: ID!, clusterId: ID!): Boolean! -type Account @key(fields: "name") { - name: String! - displayName: String! - billing: Billing! - isActive: Boolean! - contactEmail: String! - readableId: ID! - memberships: [AccountMembership!]! # account-admin-access, account-owner-access - created: Date! - outstandingAmount: Float! -} - -# extend type Account @key(fields: "name") { -# name: String! -# memberships: [AccountMembership!]! # account-admin-access, account-owner-access -# } - -# extend type StoragePlan @key(fields: "name"){ -# name: String! @external -# pricePerGB: Float! -# } -# -# extend type ComputePlan @key(fields: "name"){ -# name: String! @external -# sharedPrice: Float! -# dedicatedPrice: Float! -# } -# -# extend type LambdaPlan @key(fields: "name"){ -# name: String! @external -# freeTier: Int! -# pricePerGBHr: Float! -# } + # invitations + accounts_inviteMembers(accountName: String!, invitations: [InvitationIn!]!): [Invitation!] @isLoggedInAndVerified + accounts_resendInviteMail(accountName: String!, invitationId: String!): Boolean! @isLoggedInAndVerified + accounts_deleteInvitation(accountName: String!, invitationId: String!): Boolean! @isLoggedInAndVerified + + accounts_acceptInvitation(accountName: String!, inviteToken: String!): Boolean! @isLoggedInAndVerified + accounts_rejectInvitation(accountName: String!, inviteToken: String!): Boolean! @isLoggedInAndVerified + + accounts_removeAccountMembership(accountName: String!, memberId: ID!): Boolean! @isLoggedInAndVerified + accounts_updateAccountMembership(accountName: String!, memberId: ID!, role: Github__com___kloudlite___api___apps___iam___types__Role!): Boolean! @isLoggedInAndVerified +} extend type User @key(fields: "id") { id: ID! @external - accountMemberships:[AccountMembership!]! @isLoggedIn # user-access - accountMembership(accountName: String!):AccountMembership! @isLoggedIn # user-access + accounts: [AccountMembership!] + accountInvitations(onlyPending: Boolean!): [Invitation!] +} +`, BuiltIn: false}, + {Name: "../struct-to-graphql/account.graphqls", Input: `type Account @shareable { + contactEmail: String + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + id: String! + isActive: Boolean + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + logo: String + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + recordVersion: Int! + targetNamespace: String + updateTime: Date! +} + +input AccountIn { + contactEmail: String + displayName: String! + isActive: Boolean + logo: String + metadata: MetadataIn +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/accountmembership.graphqls", Input: `type AccountMembership @shareable { + accountName: String! + role: Github__com___kloudlite___api___apps___iam___types__Role! + userId: String! +} + +input AccountMembershipIn { + accountName: String! + role: Github__com___kloudlite___api___apps___iam___types__Role! + userId: String! +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/common-types.graphqls", Input: `type Github__com___kloudlite___api___common__CreatedOrUpdatedBy @shareable { + userEmail: String! + userId: String! + userName: String! +} + +type Metadata @shareable { + annotations: Map + creationTimestamp: Date! + deletionTimestamp: Date + generation: Int! + labels: Map + name: String! + namespace: String +} + +type PageInfo @shareable { + endCursor: String + hasNextPage: Boolean + hasPreviousPage: Boolean + startCursor: String } -type AccountMembership { - user: User! - role: String! - account: Account! - accepted: Boolean! +input MetadataIn { + annotations: Map + labels: Map + name: String! + namespace: String } -type Billing { - cardholderName: String! - address: Json! +enum Github__com___kloudlite___api___apps___iam___types__Role { + account_admin + account_member + account_owner + project_admin + project_member + resource_owner } -input BillingInput { - stripePaymentMethodId: String! - cardholderName: String! - address: Json! +`, BuiltIn: false}, + {Name: "../struct-to-graphql/directives.graphqls", Input: `extend schema @link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@key", "@shareable", "@external"]) + +directive @goField( + forceResolver: Boolean + name: String +) on INPUT_FIELD_DEFINITION | FIELD_DEFINITION +`, BuiltIn: false}, + {Name: "../struct-to-graphql/invitation.graphqls", Input: `type Invitation @shareable { + accepted: Boolean + accountName: String! + creationTime: Date! + id: String! + invitedBy: String! + inviteToken: String! + markedForDeletion: Boolean + recordVersion: Int! + rejected: Boolean + updateTime: Date! + userEmail: String + userName: String + userRole: Github__com___kloudlite___api___apps___iam___types__Role! +} + +input InvitationIn { + userEmail: String + userName: String + userRole: Github__com___kloudlite___api___apps___iam___types__Role! } + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/scalars.graphqls", Input: `scalar Any +scalar Json +scalar Map +scalar Date `, BuiltIn: false}, {Name: "../../federation/directives.graphql", Input: ` scalar _Any @@ -667,12 +1156,11 @@ input BillingInput { `, BuiltIn: true}, {Name: "../../federation/entity.graphql", Input: ` # a union of all types that use the @key directive -union _Entity = Account | User +union _Entity = User # fake type to build resolver interfaces for users to implement type Entity { - findAccountByName(name: String!,): Account! - findUserByID(id: ID!,): User! + findUserByID(id: ID!,): User! } @@ -692,37 +1180,46 @@ var parsedSchema = gqlparser.MustLoadSchema(sources...) // region ***************************** args.gotpl ***************************** -func (ec *executionContext) field_Entity_findAccountByName_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Entity_findUserByID_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) + var arg0 repos.ID + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg0 + args["id"] = arg0 return args, nil } -func (ec *executionContext) field_Entity_findUserByID_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_accounts_acceptInvitation_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 repos.ID - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, tmp) + var arg0 string + if tmp, ok := rawArgs["accountName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("accountName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["id"] = arg0 + args["accountName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["inviteToken"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("inviteToken")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["inviteToken"] = arg1 return args, nil } -func (ec *executionContext) field_Mutation_finance_activateAccount_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_accounts_activateAccount_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string @@ -737,31 +1234,22 @@ func (ec *executionContext) field_Mutation_finance_activateAccount_args(ctx cont return args, nil } -func (ec *executionContext) field_Mutation_finance_createAccount_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_accounts_createAccount_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 - var arg1 string - if tmp, ok := rawArgs["displayName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + var arg0 entities.Account + if tmp, ok := rawArgs["account"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("account")) + arg0, err = ec.unmarshalNAccountIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐAccount(ctx, tmp) if err != nil { return nil, err } } - args["displayName"] = arg1 + args["account"] = arg0 return args, nil } -func (ec *executionContext) field_Mutation_finance_deactivateAccount_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_accounts_deactivateAccount_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string @@ -776,7 +1264,7 @@ func (ec *executionContext) field_Mutation_finance_deactivateAccount_args(ctx co return args, nil } -func (ec *executionContext) field_Mutation_finance_deleteAccount_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_accounts_deleteAccount_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string @@ -791,7 +1279,7 @@ func (ec *executionContext) field_Mutation_finance_deleteAccount_args(ctx contex return args, nil } -func (ec *executionContext) field_Mutation_finance_deleteInvitation_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_accounts_deleteInvitation_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string @@ -804,18 +1292,18 @@ func (ec *executionContext) field_Mutation_finance_deleteInvitation_args(ctx con } args["accountName"] = arg0 var arg1 string - if tmp, ok := rawArgs["email"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email")) + if tmp, ok := rawArgs["invitationId"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("invitationId")) arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["email"] = arg1 + args["invitationId"] = arg1 return args, nil } -func (ec *executionContext) field_Mutation_finance_inviteUser_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_accounts_inviteMembers_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string @@ -827,37 +1315,43 @@ func (ec *executionContext) field_Mutation_finance_inviteUser_args(ctx context.C } } args["accountName"] = arg0 - var arg1 *string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) + var arg1 []*entities.Invitation + if tmp, ok := rawArgs["invitations"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("invitations")) + arg1, err = ec.unmarshalNInvitationIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐInvitationᚄ(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg1 - var arg2 string - if tmp, ok := rawArgs["email"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + args["invitations"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_accounts_rejectInvitation_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["accountName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("accountName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["email"] = arg2 - var arg3 string - if tmp, ok := rawArgs["role"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("role")) - arg3, err = ec.unmarshalNString2string(ctx, tmp) + args["accountName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["inviteToken"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("inviteToken")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["role"] = arg3 + args["inviteToken"] = arg1 return args, nil } -func (ec *executionContext) field_Mutation_finance_removeAccountMember_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_accounts_removeAccountMembership_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string @@ -870,18 +1364,18 @@ func (ec *executionContext) field_Mutation_finance_removeAccountMember_args(ctx } args["accountName"] = arg0 var arg1 repos.ID - if tmp, ok := rawArgs["userId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userId")) - arg1, err = ec.unmarshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, tmp) + if tmp, ok := rawArgs["memberId"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("memberId")) + arg1, err = ec.unmarshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx, tmp) if err != nil { return nil, err } } - args["userId"] = arg1 + args["memberId"] = arg1 return args, nil } -func (ec *executionContext) field_Mutation_finance_updateAccountMember_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_accounts_resendInviteMail_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string @@ -893,28 +1387,19 @@ func (ec *executionContext) field_Mutation_finance_updateAccountMember_args(ctx } } args["accountName"] = arg0 - var arg1 repos.ID - if tmp, ok := rawArgs["userId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userId")) - arg1, err = ec.unmarshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, tmp) - if err != nil { - return nil, err - } - } - args["userId"] = arg1 - var arg2 string - if tmp, ok := rawArgs["role"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("role")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + var arg1 string + if tmp, ok := rawArgs["invitationId"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("invitationId")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["role"] = arg2 + args["invitationId"] = arg1 return args, nil } -func (ec *executionContext) field_Mutation_finance_updateAccount_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_accounts_updateAccountMembership_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string @@ -926,24 +1411,39 @@ func (ec *executionContext) field_Mutation_finance_updateAccount_args(ctx contex } } args["accountName"] = arg0 - var arg1 *string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) + var arg1 repos.ID + if tmp, ok := rawArgs["memberId"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("memberId")) + arg1, err = ec.unmarshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx, tmp) + if err != nil { + return nil, err + } + } + args["memberId"] = arg1 + var arg2 types.Role + if tmp, ok := rawArgs["role"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("role")) + arg2, err = ec.unmarshalNGithub__com___kloudlite___api___apps___iam___types__Role2githubᚗcomᚋkloudliteᚋapiᚋappsᚋiamᚋtypesᚐRole(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["contactEmail"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contactEmail")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) + args["role"] = arg2 + return args, nil +} + +func (ec *executionContext) field_Mutation_accounts_updateAccount_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 entities.Account + if tmp, ok := rawArgs["account"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("account")) + arg0, err = ec.unmarshalNAccountIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐAccount(ctx, tmp) if err != nil { return nil, err } } - args["contactEmail"] = arg2 + args["account"] = arg0 return args, nil } @@ -977,7 +1477,52 @@ func (ec *executionContext) field_Query__entities_args(ctx context.Context, rawA return args, nil } -func (ec *executionContext) field_Query_finance_account_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_accounts_checkNameAvailability_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_accounts_getAccountMembership_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["accountName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("accountName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["accountName"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_accounts_getAccount_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["accountName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("accountName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["accountName"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_accounts_getInvitation_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string @@ -989,10 +1534,34 @@ func (ec *executionContext) field_Query_finance_account_args(ctx context.Context } } args["accountName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["invitationId"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("invitationId")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["invitationId"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Query_accounts_listInvitationsForUser_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["onlyPending"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onlyPending")) + arg0, err = ec.unmarshalNBoolean2bool(ctx, tmp) + if err != nil { + return nil, err + } + } + args["onlyPending"] = arg0 return args, nil } -func (ec *executionContext) field_Query_finance_listInvitations_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_accounts_listInvitations_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string @@ -1007,7 +1576,7 @@ func (ec *executionContext) field_Query_finance_listInvitations_args(ctx context return args, nil } -func (ec *executionContext) field_Query_finance_reSyncAccount_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_accounts_listMembershipsForAccount_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string @@ -1019,10 +1588,19 @@ func (ec *executionContext) field_Query_finance_reSyncAccount_args(ctx context.C } } args["accountName"] = arg0 + var arg1 *types.Role + if tmp, ok := rawArgs["role"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("role")) + arg1, err = ec.unmarshalOGithub__com___kloudlite___api___apps___iam___types__Role2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiamᚋtypesᚐRole(ctx, tmp) + if err != nil { + return nil, err + } + } + args["role"] = arg1 return args, nil } -func (ec *executionContext) field_User_accountMembership_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_accounts_resyncAccount_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string @@ -1037,6 +1615,21 @@ func (ec *executionContext) field_User_accountMembership_args(ctx context.Contex return args, nil } +func (ec *executionContext) field_User_accountInvitations_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["onlyPending"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onlyPending")) + arg0, err = ec.unmarshalNBoolean2bool(ctx, tmp) + if err != nil { + return nil, err + } + } + args["onlyPending"] = 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{}{} @@ -1075,8 +1668,8 @@ func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArg // region **************************** field.gotpl ***************************** -func (ec *executionContext) _Account_name(ctx context.Context, field graphql.CollectedField, obj *model.Account) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Account_name(ctx, field) +func (ec *executionContext) _Account_contactEmail(ctx context.Context, field graphql.CollectedField, obj *entities.Account) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Account_contactEmail(ctx, field) if err != nil { return graphql.Null } @@ -1089,24 +1682,21 @@ func (ec *executionContext) _Account_name(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.ContactEmail, nil }) if err != nil { ec.Error(ctx, err) 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) + return ec.marshalOString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Account_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Account_contactEmail(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Account", Field: field, @@ -1119,8 +1709,8 @@ func (ec *executionContext) fieldContext_Account_name(ctx context.Context, field return fc, nil } -func (ec *executionContext) _Account_displayName(ctx context.Context, field graphql.CollectedField, obj *model.Account) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Account_displayName(ctx, field) +func (ec *executionContext) _Account_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.Account) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Account_createdBy(ctx, field) if err != nil { return graphql.Null } @@ -1133,7 +1723,7 @@ func (ec *executionContext) _Account_displayName(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.DisplayName, nil + return obj.CreatedBy, nil }) if err != nil { ec.Error(ctx, err) @@ -1145,26 +1735,34 @@ func (ec *executionContext) _Account_displayName(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(string) + res := resTmp.(common.CreatedOrUpdatedBy) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Account_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Account_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Account", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) }, } return fc, nil } -func (ec *executionContext) _Account_billing(ctx context.Context, field graphql.CollectedField, obj *model.Account) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Account_billing(ctx, field) +func (ec *executionContext) _Account_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.Account) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Account_creationTime(ctx, field) if err != nil { return graphql.Null } @@ -1177,7 +1775,7 @@ func (ec *executionContext) _Account_billing(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Billing, nil + return ec.resolvers.Account().CreationTime(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -1189,32 +1787,26 @@ func (ec *executionContext) _Account_billing(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.(*model.Billing) + res := resTmp.(string) fc.Result = res - return ec.marshalNBilling2ᚖkloudliteᚗioᚋappsᚋfinanceᚋinternalᚋappᚋgraphᚋmodelᚐBilling(ctx, field.Selections, res) + return ec.marshalNDate2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Account_billing(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Account_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Account", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "cardholderName": - return ec.fieldContext_Billing_cardholderName(ctx, field) - case "address": - return ec.fieldContext_Billing_address(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Billing", field.Name) + return nil, errors.New("field of type Date does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Account_isActive(ctx context.Context, field graphql.CollectedField, obj *model.Account) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Account_isActive(ctx, field) +func (ec *executionContext) _Account_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.Account) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Account_displayName(ctx, field) if err != nil { return graphql.Null } @@ -1227,7 +1819,7 @@ func (ec *executionContext) _Account_isActive(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.IsActive, nil + return obj.DisplayName, nil }) if err != nil { ec.Error(ctx, err) @@ -1239,26 +1831,26 @@ func (ec *executionContext) _Account_isActive(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Account_isActive(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Account_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Account", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Account_contactEmail(ctx context.Context, field graphql.CollectedField, obj *model.Account) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Account_contactEmail(ctx, field) +func (ec *executionContext) _Account_id(ctx context.Context, field graphql.CollectedField, obj *entities.Account) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Account_id(ctx, field) if err != nil { return graphql.Null } @@ -1271,7 +1863,7 @@ func (ec *executionContext) _Account_contactEmail(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ContactEmail, nil + return ec.resolvers.Account().ID(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -1288,12 +1880,12 @@ func (ec *executionContext) _Account_contactEmail(ctx context.Context, field gra return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Account_contactEmail(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Account_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Account", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") }, @@ -1301,8 +1893,8 @@ func (ec *executionContext) fieldContext_Account_contactEmail(ctx context.Contex return fc, nil } -func (ec *executionContext) _Account_readableId(ctx context.Context, field graphql.CollectedField, obj *model.Account) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Account_readableId(ctx, field) +func (ec *executionContext) _Account_isActive(ctx context.Context, field graphql.CollectedField, obj *entities.Account) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Account_isActive(ctx, field) if err != nil { return graphql.Null } @@ -1315,38 +1907,35 @@ func (ec *executionContext) _Account_readableId(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ReadableID, nil + return obj.IsActive, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(repos.ID) + res := resTmp.(*bool) fc.Result = res - return ec.marshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, field.Selections, res) + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Account_readableId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Account_isActive(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Account", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Account_memberships(ctx context.Context, field graphql.CollectedField, obj *model.Account) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Account_memberships(ctx, field) +func (ec *executionContext) _Account_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.Account) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Account_lastUpdatedBy(ctx, field) if err != nil { return graphql.Null } @@ -1359,7 +1948,7 @@ func (ec *executionContext) _Account_memberships(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Account().Memberships(rctx, obj) + return obj.LastUpdatedBy, nil }) if err != nil { ec.Error(ctx, err) @@ -1371,36 +1960,34 @@ func (ec *executionContext) _Account_memberships(ctx context.Context, field grap } return graphql.Null } - res := resTmp.([]*model.AccountMembership) + res := resTmp.(common.CreatedOrUpdatedBy) fc.Result = res - return ec.marshalNAccountMembership2ᚕᚖkloudliteᚗioᚋappsᚋfinanceᚋinternalᚋappᚋgraphᚋmodelᚐAccountMembershipᚄ(ctx, field.Selections, res) + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Account_memberships(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Account_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Account", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "user": - return ec.fieldContext_AccountMembership_user(ctx, field) - case "role": - return ec.fieldContext_AccountMembership_role(ctx, field) - case "account": - return ec.fieldContext_AccountMembership_account(ctx, field) - case "accepted": - return ec.fieldContext_AccountMembership_accepted(ctx, field) + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type AccountMembership", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) }, } return fc, nil } -func (ec *executionContext) _Account_created(ctx context.Context, field graphql.CollectedField, obj *model.Account) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Account_created(ctx, field) +func (ec *executionContext) _Account_logo(ctx context.Context, field graphql.CollectedField, obj *entities.Account) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Account_logo(ctx, field) if err != nil { return graphql.Null } @@ -1413,38 +2000,35 @@ func (ec *executionContext) _Account_created(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Created, nil + return obj.Logo, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*string) fc.Result = res - return ec.marshalNDate2string(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Account_created(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Account_logo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Account", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Date does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Account_outstandingAmount(ctx context.Context, field graphql.CollectedField, obj *model.Account) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Account_outstandingAmount(ctx, field) +func (ec *executionContext) _Account_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.Account) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Account_markedForDeletion(ctx, field) if err != nil { return graphql.Null } @@ -1457,38 +2041,35 @@ func (ec *executionContext) _Account_outstandingAmount(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.OutstandingAmount, nil + return obj.MarkedForDeletion, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(float64) + res := resTmp.(*bool) fc.Result = res - return ec.marshalNFloat2float64(ctx, field.Selections, res) + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Account_outstandingAmount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Account_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Account", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Float does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _AccountMembership_user(ctx context.Context, field graphql.CollectedField, obj *model.AccountMembership) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AccountMembership_user(ctx, field) +func (ec *executionContext) _Account_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.Account) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Account_metadata(ctx, field) if err != nil { return graphql.Null } @@ -1501,46 +2082,51 @@ func (ec *executionContext) _AccountMembership_user(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.AccountMembership().User(rctx, obj) + return obj.ObjectMeta, nil }) if err != nil { ec.Error(ctx, 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.User) + res := resTmp.(v1.ObjectMeta) fc.Result = res - return ec.marshalNUser2ᚖkloudliteᚗioᚋappsᚋfinanceᚋinternalᚋappᚋgraphᚋmodelᚐUser(ctx, field.Selections, res) + return ec.marshalOMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_AccountMembership_user(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Account_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "AccountMembership", + Object: "Account", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "id": - return ec.fieldContext_User_id(ctx, field) - case "accountMemberships": - return ec.fieldContext_User_accountMemberships(ctx, field) - case "accountMembership": - return ec.fieldContext_User_accountMembership(ctx, field) + case "annotations": + return ec.fieldContext_Metadata_annotations(ctx, field) + case "creationTimestamp": + return ec.fieldContext_Metadata_creationTimestamp(ctx, field) + case "deletionTimestamp": + return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) + case "generation": + return ec.fieldContext_Metadata_generation(ctx, field) + case "labels": + return ec.fieldContext_Metadata_labels(ctx, field) + case "name": + return ec.fieldContext_Metadata_name(ctx, field) + case "namespace": + return ec.fieldContext_Metadata_namespace(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) }, } return fc, nil } -func (ec *executionContext) _AccountMembership_role(ctx context.Context, field graphql.CollectedField, obj *model.AccountMembership) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AccountMembership_role(ctx, field) +func (ec *executionContext) _Account_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Account) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Account_recordVersion(ctx, field) if err != nil { return graphql.Null } @@ -1553,7 +2139,7 @@ func (ec *executionContext) _AccountMembership_role(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Role, nil + return obj.RecordVersion, nil }) if err != nil { ec.Error(ctx, err) @@ -1565,26 +2151,26 @@ func (ec *executionContext) _AccountMembership_role(ctx context.Context, field g } return graphql.Null } - res := resTmp.(string) + res := resTmp.(int) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_AccountMembership_role(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Account_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "AccountMembership", + Object: "Account", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _AccountMembership_account(ctx context.Context, field graphql.CollectedField, obj *model.AccountMembership) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AccountMembership_account(ctx, field) +func (ec *executionContext) _Account_targetNamespace(ctx context.Context, field graphql.CollectedField, obj *entities.Account) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Account_targetNamespace(ctx, field) if err != nil { return graphql.Null } @@ -1597,58 +2183,35 @@ func (ec *executionContext) _AccountMembership_account(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.AccountMembership().Account(rctx, obj) + return obj.TargetNamespace, nil }) if err != nil { ec.Error(ctx, 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.Account) + res := resTmp.(string) fc.Result = res - return ec.marshalNAccount2ᚖkloudliteᚗioᚋappsᚋfinanceᚋinternalᚋappᚋgraphᚋmodelᚐAccount(ctx, field.Selections, res) + return ec.marshalOString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_AccountMembership_account(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Account_targetNamespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "AccountMembership", + Object: "Account", 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_Account_name(ctx, field) - case "displayName": - return ec.fieldContext_Account_displayName(ctx, field) - case "billing": - return ec.fieldContext_Account_billing(ctx, field) - case "isActive": - return ec.fieldContext_Account_isActive(ctx, field) - case "contactEmail": - return ec.fieldContext_Account_contactEmail(ctx, field) - case "readableId": - return ec.fieldContext_Account_readableId(ctx, field) - case "memberships": - return ec.fieldContext_Account_memberships(ctx, field) - case "created": - return ec.fieldContext_Account_created(ctx, field) - case "outstandingAmount": - return ec.fieldContext_Account_outstandingAmount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Account", field.Name) + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _AccountMembership_accepted(ctx context.Context, field graphql.CollectedField, obj *model.AccountMembership) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AccountMembership_accepted(ctx, field) +func (ec *executionContext) _Account_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.Account) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Account_updateTime(ctx, field) if err != nil { return graphql.Null } @@ -1661,7 +2224,7 @@ func (ec *executionContext) _AccountMembership_accepted(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Accepted, nil + return ec.resolvers.Account().UpdateTime(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -1673,26 +2236,26 @@ func (ec *executionContext) _AccountMembership_accepted(ctx context.Context, fie } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNDate2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_AccountMembership_accepted(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Account_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "AccountMembership", + Object: "Account", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type Date does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Billing_cardholderName(ctx context.Context, field graphql.CollectedField, obj *model.Billing) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Billing_cardholderName(ctx, field) +func (ec *executionContext) _AccountMembership_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.AccountMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AccountMembership_accountName(ctx, field) if err != nil { return graphql.Null } @@ -1705,7 +2268,7 @@ func (ec *executionContext) _Billing_cardholderName(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.CardholderName, nil + return obj.AccountName, nil }) if err != nil { ec.Error(ctx, err) @@ -1722,9 +2285,9 @@ func (ec *executionContext) _Billing_cardholderName(ctx context.Context, field g return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Billing_cardholderName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_AccountMembership_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Billing", + Object: "AccountMembership", Field: field, IsMethod: false, IsResolver: false, @@ -1735,8 +2298,8 @@ func (ec *executionContext) fieldContext_Billing_cardholderName(ctx context.Cont return fc, nil } -func (ec *executionContext) _Billing_address(ctx context.Context, field graphql.CollectedField, obj *model.Billing) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Billing_address(ctx, field) +func (ec *executionContext) _AccountMembership_role(ctx context.Context, field graphql.CollectedField, obj *entities.AccountMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AccountMembership_role(ctx, field) if err != nil { return graphql.Null } @@ -1749,7 +2312,7 @@ func (ec *executionContext) _Billing_address(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Address, nil + return obj.Role, nil }) if err != nil { ec.Error(ctx, err) @@ -1761,26 +2324,26 @@ func (ec *executionContext) _Billing_address(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.(map[string]interface{}) + res := resTmp.(types.Role) fc.Result = res - return ec.marshalNJson2map(ctx, field.Selections, res) + return ec.marshalNGithub__com___kloudlite___api___apps___iam___types__Role2githubᚗcomᚋkloudliteᚋapiᚋappsᚋiamᚋtypesᚐRole(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Billing_address(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_AccountMembership_role(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Billing", + Object: "AccountMembership", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Json does not have child fields") + return nil, errors.New("field of type Github__com___kloudlite___api___apps___iam___types__Role does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Entity_findAccountByName(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Entity_findAccountByName(ctx, field) +func (ec *executionContext) _AccountMembership_userId(ctx context.Context, field graphql.CollectedField, obj *entities.AccountMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AccountMembership_userId(ctx, field) if err != nil { return graphql.Null } @@ -1793,7 +2356,7 @@ func (ec *executionContext) _Entity_findAccountByName(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Entity().FindAccountByName(rctx, fc.Args["name"].(string)) + return ec.resolvers.AccountMembership().UserID(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -1805,57 +2368,26 @@ func (ec *executionContext) _Entity_findAccountByName(ctx context.Context, field } return graphql.Null } - res := resTmp.(*model.Account) + res := resTmp.(string) fc.Result = res - return ec.marshalNAccount2ᚖkloudliteᚗioᚋappsᚋfinanceᚋinternalᚋappᚋgraphᚋmodelᚐAccount(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Entity_findAccountByName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_AccountMembership_userId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Entity", + Object: "AccountMembership", 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_Account_name(ctx, field) - case "displayName": - return ec.fieldContext_Account_displayName(ctx, field) - case "billing": - return ec.fieldContext_Account_billing(ctx, field) - case "isActive": - return ec.fieldContext_Account_isActive(ctx, field) - case "contactEmail": - return ec.fieldContext_Account_contactEmail(ctx, field) - case "readableId": - return ec.fieldContext_Account_readableId(ctx, field) - case "memberships": - return ec.fieldContext_Account_memberships(ctx, field) - case "created": - return ec.fieldContext_Account_created(ctx, field) - case "outstandingAmount": - return ec.fieldContext_Account_outstandingAmount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Account", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Entity_findAccountByName_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Entity_findUserByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Entity_findUserByID(ctx, field) +func (ec *executionContext) _AccountMembership_user(ctx context.Context, field graphql.CollectedField, obj *entities.AccountMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AccountMembership_user(ctx, field) if err != nil { return graphql.Null } @@ -1868,7 +2400,7 @@ func (ec *executionContext) _Entity_findUserByID(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Entity().FindUserByID(rctx, fc.Args["id"].(repos.ID)) + return ec.resolvers.AccountMembership().User(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -1882,12 +2414,12 @@ func (ec *executionContext) _Entity_findUserByID(ctx context.Context, field grap } res := resTmp.(*model.User) fc.Result = res - return ec.marshalNUser2ᚖkloudliteᚗioᚋappsᚋfinanceᚋinternalᚋappᚋgraphᚋmodelᚐUser(ctx, field.Selections, res) + return ec.marshalNUser2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋappᚋgraphᚋmodelᚐUser(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Entity_findUserByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_AccountMembership_user(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Entity", + Object: "AccountMembership", Field: field, IsMethod: true, IsResolver: true, @@ -1895,30 +2427,19 @@ func (ec *executionContext) fieldContext_Entity_findUserByID(ctx context.Context switch field.Name { case "id": return ec.fieldContext_User_id(ctx, field) - case "accountMemberships": - return ec.fieldContext_User_accountMemberships(ctx, field) - case "accountMembership": - return ec.fieldContext_User_accountMembership(ctx, field) + case "accounts": + return ec.fieldContext_User_accounts(ctx, field) + case "accountInvitations": + return ec.fieldContext_User_accountInvitations(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type User", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Entity_findUserByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_finance_createAccount(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_finance_createAccount(ctx, field) +func (ec *executionContext) _AccountsCheckNameAvailabilityOutput_result(ctx context.Context, field graphql.CollectedField, obj *domain.CheckNameAvailabilityOutput) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AccountsCheckNameAvailabilityOutput_result(ctx, field) if err != nil { return graphql.Null } @@ -1930,28 +2451,8 @@ func (ec *executionContext) _Mutation_finance_createAccount(ctx context.Context, } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().FinanceCreateAccount(rctx, fc.Args["name"].(string), fc.Args["displayName"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*model.Account); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/finance/internal/app/graph/model.Account`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.Result, nil }) if err != nil { ec.Error(ctx, err) @@ -1963,57 +2464,26 @@ func (ec *executionContext) _Mutation_finance_createAccount(ctx context.Context, } return graphql.Null } - res := resTmp.(*model.Account) + res := resTmp.(bool) fc.Result = res - return ec.marshalNAccount2ᚖkloudliteᚗioᚋappsᚋfinanceᚋinternalᚋappᚋgraphᚋmodelᚐAccount(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_finance_createAccount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_AccountsCheckNameAvailabilityOutput_result(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "AccountsCheckNameAvailabilityOutput", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext_Account_name(ctx, field) - case "displayName": - return ec.fieldContext_Account_displayName(ctx, field) - case "billing": - return ec.fieldContext_Account_billing(ctx, field) - case "isActive": - return ec.fieldContext_Account_isActive(ctx, field) - case "contactEmail": - return ec.fieldContext_Account_contactEmail(ctx, field) - case "readableId": - return ec.fieldContext_Account_readableId(ctx, field) - case "memberships": - return ec.fieldContext_Account_memberships(ctx, field) - case "created": - return ec.fieldContext_Account_created(ctx, field) - case "outstandingAmount": - return ec.fieldContext_Account_outstandingAmount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Account", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_finance_createAccount_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_finance_updateAccount(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_finance_updateAccount(ctx, field) +func (ec *executionContext) _AccountsCheckNameAvailabilityOutput_suggestedNames(ctx context.Context, field graphql.CollectedField, obj *domain.CheckNameAvailabilityOutput) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AccountsCheckNameAvailabilityOutput_suggestedNames(ctx, field) if err != nil { return graphql.Null } @@ -2025,90 +2495,36 @@ func (ec *executionContext) _Mutation_finance_updateAccount(ctx context.Context, } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().FinanceUpdateAccount(rctx, fc.Args["accountName"].(string), fc.Args["name"].(*string), fc.Args["contactEmail"].(*string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*model.Account); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/finance/internal/app/graph/model.Account`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.SuggestedNames, nil }) if err != nil { ec.Error(ctx, 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.Account) + res := resTmp.([]string) fc.Result = res - return ec.marshalNAccount2ᚖkloudliteᚗioᚋappsᚋfinanceᚋinternalᚋappᚋgraphᚋmodelᚐAccount(ctx, field.Selections, res) + return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_finance_updateAccount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_AccountsCheckNameAvailabilityOutput_suggestedNames(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "AccountsCheckNameAvailabilityOutput", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext_Account_name(ctx, field) - case "displayName": - return ec.fieldContext_Account_displayName(ctx, field) - case "billing": - return ec.fieldContext_Account_billing(ctx, field) - case "isActive": - return ec.fieldContext_Account_isActive(ctx, field) - case "contactEmail": - return ec.fieldContext_Account_contactEmail(ctx, field) - case "readableId": - return ec.fieldContext_Account_readableId(ctx, field) - case "memberships": - return ec.fieldContext_Account_memberships(ctx, field) - case "created": - return ec.fieldContext_Account_created(ctx, field) - case "outstandingAmount": - return ec.fieldContext_Account_outstandingAmount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Account", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_finance_updateAccount_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_finance_removeAccountMember(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_finance_removeAccountMember(ctx, field) +func (ec *executionContext) _Entity_findUserByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findUserByID(ctx, field) if err != nil { return graphql.Null } @@ -2120,28 +2536,8 @@ func (ec *executionContext) _Mutation_finance_removeAccountMember(ctx context.Co } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().FinanceRemoveAccountMember(rctx, fc.Args["accountName"].(string), fc.Args["userId"].(repos.ID)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindUserByID(rctx, fc.Args["id"].(repos.ID)) }) if err != nil { ec.Error(ctx, err) @@ -2153,19 +2549,27 @@ func (ec *executionContext) _Mutation_finance_removeAccountMember(ctx context.Co } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(*model.User) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNUser2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋappᚋgraphᚋmodelᚐUser(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_finance_removeAccountMember(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Entity_findUserByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Entity", 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") + switch field.Name { + case "id": + return ec.fieldContext_User_id(ctx, field) + case "accounts": + return ec.fieldContext_User_accounts(ctx, field) + case "accountInvitations": + return ec.fieldContext_User_accountInvitations(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) }, } defer func() { @@ -2175,15 +2579,15 @@ func (ec *executionContext) fieldContext_Mutation_finance_removeAccountMember(ct } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_finance_removeAccountMember_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Entity_findUserByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return } return fc, nil } -func (ec *executionContext) _Mutation_finance_updateAccountMember(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_finance_updateAccountMember(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx context.Context, field graphql.CollectedField, obj *common.CreatedOrUpdatedBy) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) if err != nil { return graphql.Null } @@ -2195,28 +2599,8 @@ func (ec *executionContext) _Mutation_finance_updateAccountMember(ctx context.Co } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().FinanceUpdateAccountMember(rctx, fc.Args["accountName"].(string), fc.Args["userId"].(repos.ID), fc.Args["role"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.UserEmail, nil }) if err != nil { ec.Error(ctx, err) @@ -2228,37 +2612,26 @@ func (ec *executionContext) _Mutation_finance_updateAccountMember(ctx context.Co } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_finance_updateAccountMember(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Github__com___kloudlite___api___common__CreatedOrUpdatedBy", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_finance_updateAccountMember_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_finance_deactivateAccount(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_finance_deactivateAccount(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx context.Context, field graphql.CollectedField, obj *common.CreatedOrUpdatedBy) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) if err != nil { return graphql.Null } @@ -2270,70 +2643,39 @@ func (ec *executionContext) _Mutation_finance_deactivateAccount(ctx context.Cont } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().FinanceDeactivateAccount(rctx, fc.Args["accountName"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Github__com___kloudlite___api___common__CreatedOrUpdatedBy().UserID(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.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_finance_deactivateAccount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Github__com___kloudlite___api___common__CreatedOrUpdatedBy", 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") + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_finance_deactivateAccount_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_finance_activateAccount(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_finance_activateAccount(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx context.Context, field graphql.CollectedField, obj *common.CreatedOrUpdatedBy) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) if err != nil { return graphql.Null } @@ -2345,28 +2687,8 @@ func (ec *executionContext) _Mutation_finance_activateAccount(ctx context.Contex } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().FinanceActivateAccount(rctx, fc.Args["accountName"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.UserName, nil }) if err != nil { ec.Error(ctx, err) @@ -2378,37 +2700,26 @@ func (ec *executionContext) _Mutation_finance_activateAccount(ctx context.Contex } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_finance_activateAccount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Github__com___kloudlite___api___common__CreatedOrUpdatedBy", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_finance_activateAccount_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_finance_deleteAccount(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_finance_deleteAccount(ctx, field) +func (ec *executionContext) _Invitation_accepted(ctx context.Context, field graphql.CollectedField, obj *entities.Invitation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invitation_accepted(ctx, field) if err != nil { return graphql.Null } @@ -2420,70 +2731,36 @@ func (ec *executionContext) _Mutation_finance_deleteAccount(ctx context.Context, } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().FinanceDeleteAccount(rctx, fc.Args["accountName"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.Accepted, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(*bool) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_finance_deleteAccount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Invitation_accepted(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Invitation", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("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_finance_deleteAccount_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_finance_inviteUser(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_finance_inviteUser(ctx, field) +func (ec *executionContext) _Invitation_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.Invitation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invitation_accountName(ctx, field) if err != nil { return graphql.Null } @@ -2495,28 +2772,8 @@ func (ec *executionContext) _Mutation_finance_inviteUser(ctx context.Context, fi } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().FinanceInviteUser(rctx, fc.Args["accountName"].(string), fc.Args["name"].(*string), fc.Args["email"].(string), fc.Args["role"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil }) if err != nil { ec.Error(ctx, err) @@ -2528,37 +2785,26 @@ func (ec *executionContext) _Mutation_finance_inviteUser(ctx context.Context, fi } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_finance_inviteUser(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Invitation_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Invitation", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_finance_inviteUser_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_finance_deleteInvitation(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_finance_deleteInvitation(ctx, field) +func (ec *executionContext) _Invitation_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.Invitation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invitation_creationTime(ctx, field) if err != nil { return graphql.Null } @@ -2570,28 +2816,8 @@ func (ec *executionContext) _Mutation_finance_deleteInvitation(ctx context.Conte } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().FinanceDeleteInvitation(rctx, fc.Args["accountName"].(string), fc.Args["email"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Invitation().CreationTime(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -2603,37 +2829,26 @@ func (ec *executionContext) _Mutation_finance_deleteInvitation(ctx context.Conte } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNDate2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_finance_deleteInvitation(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Invitation_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Invitation", 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") + return nil, errors.New("field of type Date 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_finance_deleteInvitation_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query_finance_listAccounts(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_finance_listAccounts(ctx, field) +func (ec *executionContext) _Invitation_id(ctx context.Context, field graphql.CollectedField, obj *entities.Invitation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invitation_id(ctx, field) if err != nil { return graphql.Null } @@ -2645,76 +2860,39 @@ func (ec *executionContext) _Query_finance_listAccounts(ctx context.Context, fie } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().FinanceListAccounts(rctx) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.([]*model.Account); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*kloudlite.io/apps/finance/internal/app/graph/model.Account`, tmp) + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Invitation().ID(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.Account) + res := resTmp.(string) fc.Result = res - return ec.marshalOAccount2ᚕᚖkloudliteᚗioᚋappsᚋfinanceᚋinternalᚋappᚋgraphᚋmodelᚐAccount(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_finance_listAccounts(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Invitation_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "Invitation", 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_Account_name(ctx, field) - case "displayName": - return ec.fieldContext_Account_displayName(ctx, field) - case "billing": - return ec.fieldContext_Account_billing(ctx, field) - case "isActive": - return ec.fieldContext_Account_isActive(ctx, field) - case "contactEmail": - return ec.fieldContext_Account_contactEmail(ctx, field) - case "readableId": - return ec.fieldContext_Account_readableId(ctx, field) - case "memberships": - return ec.fieldContext_Account_memberships(ctx, field) - case "created": - return ec.fieldContext_Account_created(ctx, field) - case "outstandingAmount": - return ec.fieldContext_Account_outstandingAmount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Account", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Query_finance_account(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_finance_account(ctx, field) +func (ec *executionContext) _Invitation_invitedBy(ctx context.Context, field graphql.CollectedField, obj *entities.Invitation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invitation_invitedBy(ctx, field) if err != nil { return graphql.Null } @@ -2726,87 +2904,39 @@ func (ec *executionContext) _Query_finance_account(ctx context.Context, field gr } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().FinanceAccount(rctx, fc.Args["accountName"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*model.Account); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/finance/internal/app/graph/model.Account`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.InvitedBy, nil }) if err != nil { ec.Error(ctx, 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.Account) + res := resTmp.(string) fc.Result = res - return ec.marshalOAccount2ᚖkloudliteᚗioᚋappsᚋfinanceᚋinternalᚋappᚋgraphᚋmodelᚐAccount(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_finance_account(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Invitation_invitedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "Invitation", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext_Account_name(ctx, field) - case "displayName": - return ec.fieldContext_Account_displayName(ctx, field) - case "billing": - return ec.fieldContext_Account_billing(ctx, field) - case "isActive": - return ec.fieldContext_Account_isActive(ctx, field) - case "contactEmail": - return ec.fieldContext_Account_contactEmail(ctx, field) - case "readableId": - return ec.fieldContext_Account_readableId(ctx, field) - case "memberships": - return ec.fieldContext_Account_memberships(ctx, field) - case "created": - return ec.fieldContext_Account_created(ctx, field) - case "outstandingAmount": - return ec.fieldContext_Account_outstandingAmount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Account", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_finance_account_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query_finance_listInvitations(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_finance_listInvitations(ctx, field) +func (ec *executionContext) _Invitation_inviteToken(ctx context.Context, field graphql.CollectedField, obj *entities.Invitation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invitation_inviteToken(ctx, field) if err != nil { return graphql.Null } @@ -2818,77 +2948,39 @@ func (ec *executionContext) _Query_finance_listInvitations(ctx context.Context, } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().FinanceListInvitations(rctx, fc.Args["accountName"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.([]*model.AccountMembership); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*kloudlite.io/apps/finance/internal/app/graph/model.AccountMembership`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.InviteToken, nil }) if err != nil { ec.Error(ctx, 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.AccountMembership) + res := resTmp.(string) fc.Result = res - return ec.marshalOAccountMembership2ᚕᚖkloudliteᚗioᚋappsᚋfinanceᚋinternalᚋappᚋgraphᚋmodelᚐAccountMembership(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_finance_listInvitations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Invitation_inviteToken(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "Invitation", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "user": - return ec.fieldContext_AccountMembership_user(ctx, field) - case "role": - return ec.fieldContext_AccountMembership_role(ctx, field) - case "account": - return ec.fieldContext_AccountMembership_account(ctx, field) - case "accepted": - return ec.fieldContext_AccountMembership_accepted(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type AccountMembership", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_finance_listInvitations_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query_finance_reSyncAccount(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_finance_reSyncAccount(ctx, field) +func (ec *executionContext) _Invitation_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.Invitation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invitation_markedForDeletion(ctx, field) if err != nil { return graphql.Null } @@ -2900,70 +2992,36 @@ func (ec *executionContext) _Query_finance_reSyncAccount(ctx context.Context, fi } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().FinanceReSyncAccount(rctx, fc.Args["accountName"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.MarkedForDeletion, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(*bool) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_finance_reSyncAccount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Invitation_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "Invitation", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type Boolean does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_finance_reSyncAccount_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query__entities(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query__entities(ctx, field) +func (ec *executionContext) _Invitation_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Invitation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invitation_recordVersion(ctx, field) if err != nil { return graphql.Null } @@ -2976,7 +3034,7 @@ func (ec *executionContext) _Query__entities(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.__resolve_entities(ctx, fc.Args["representations"].([]map[string]interface{})), nil + return obj.RecordVersion, nil }) if err != nil { ec.Error(ctx, err) @@ -2988,37 +3046,26 @@ func (ec *executionContext) _Query__entities(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.([]fedruntime.Entity) + res := resTmp.(int) fc.Result = res - return ec.marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query__entities(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Invitation_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "Invitation", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type _Entity does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query__entities_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query__service(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query__service(ctx, field) +func (ec *executionContext) _Invitation_rejected(ctx context.Context, field graphql.CollectedField, obj *entities.Invitation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invitation_rejected(ctx, field) if err != nil { return graphql.Null } @@ -3031,42 +3078,35 @@ func (ec *executionContext) _Query__service(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.__resolve__service(ctx) + return obj.Rejected, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(fedruntime.Service) + res := resTmp.(*bool) fc.Result = res - return ec.marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx, field.Selections, res) + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query__service(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Invitation_rejected(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "Invitation", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "sdl": - return ec.fieldContext__Service_sdl(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type _Service", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query___type(ctx, field) +func (ec *executionContext) _Invitation_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.Invitation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invitation_updateTime(ctx, field) if err != nil { return graphql.Null } @@ -3079,68 +3119,38 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.introspectType(fc.Args["name"].(string)) + return ec.resolvers.Invitation().UpdateTime(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.(*introspection.Type) + res := resTmp.(string) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNDate2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Invitation_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "Invitation", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + return nil, errors.New("field of type Date does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query___schema(ctx, field) +func (ec *executionContext) _Invitation_userEmail(ctx context.Context, field graphql.CollectedField, obj *entities.Invitation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invitation_userEmail(ctx, field) if err != nil { return graphql.Null } @@ -3153,7 +3163,7 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.introspectSchema() + return obj.UserEmail, nil }) if err != nil { ec.Error(ctx, err) @@ -3162,40 +3172,26 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C if resTmp == nil { return graphql.Null } - res := resTmp.(*introspection.Schema) + res := resTmp.(string) fc.Result = res - return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) + return ec.marshalOString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query___schema(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Invitation_userEmail(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "Invitation", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "description": - return ec.fieldContext___Schema_description(ctx, field) - case "types": - return ec.fieldContext___Schema_types(ctx, field) - case "queryType": - return ec.fieldContext___Schema_queryType(ctx, field) - case "mutationType": - return ec.fieldContext___Schema_mutationType(ctx, field) - case "subscriptionType": - return ec.fieldContext___Schema_subscriptionType(ctx, field) - case "directives": - return ec.fieldContext___Schema_directives(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_id(ctx, field) +func (ec *executionContext) _Invitation_userName(ctx context.Context, field graphql.CollectedField, obj *entities.Invitation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invitation_userName(ctx, field) if err != nil { return graphql.Null } @@ -3208,38 +3204,35 @@ func (ec *executionContext) _User_id(ctx context.Context, field graphql.Collecte }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return obj.UserName, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(repos.ID) + res := resTmp.(string) fc.Result = res - return ec.marshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, field.Selections, res) + return ec.marshalOString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Invitation_userName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "Invitation", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _User_accountMemberships(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_accountMemberships(ctx, field) +func (ec *executionContext) _Invitation_userRole(ctx context.Context, field graphql.CollectedField, obj *entities.Invitation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invitation_userRole(ctx, field) if err != nil { return graphql.Null } @@ -3251,28 +3244,8 @@ func (ec *executionContext) _User_accountMemberships(ctx context.Context, field } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.User().AccountMemberships(rctx, obj) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, obj, directive0) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.([]*model.AccountMembership); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*kloudlite.io/apps/finance/internal/app/graph/model.AccountMembership`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.UserRole, nil }) if err != nil { ec.Error(ctx, err) @@ -3284,36 +3257,26 @@ func (ec *executionContext) _User_accountMemberships(ctx context.Context, field } return graphql.Null } - res := resTmp.([]*model.AccountMembership) + res := resTmp.(types.Role) fc.Result = res - return ec.marshalNAccountMembership2ᚕᚖkloudliteᚗioᚋappsᚋfinanceᚋinternalᚋappᚋgraphᚋmodelᚐAccountMembershipᚄ(ctx, field.Selections, res) + return ec.marshalNGithub__com___kloudlite___api___apps___iam___types__Role2githubᚗcomᚋkloudliteᚋapiᚋappsᚋiamᚋtypesᚐRole(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_accountMemberships(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Invitation_userRole(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "Invitation", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "user": - return ec.fieldContext_AccountMembership_user(ctx, field) - case "role": - return ec.fieldContext_AccountMembership_role(ctx, field) - case "account": - return ec.fieldContext_AccountMembership_account(ctx, field) - case "accepted": - return ec.fieldContext_AccountMembership_accepted(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type AccountMembership", field.Name) + return nil, errors.New("field of type Github__com___kloudlite___api___apps___iam___types__Role does not have child fields") }, } return fc, nil } -func (ec *executionContext) _User_accountMembership(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_accountMembership(ctx, field) +func (ec *executionContext) _Metadata_annotations(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_annotations(ctx, field) if err != nil { return graphql.Null } @@ -3325,80 +3288,36 @@ func (ec *executionContext) _User_accountMembership(ctx context.Context, field g } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.User().AccountMembership(rctx, obj, fc.Args["accountName"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, obj, directive0) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*model.AccountMembership); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/finance/internal/app/graph/model.AccountMembership`, tmp) + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Metadata().Annotations(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.AccountMembership) + res := resTmp.(map[string]interface{}) fc.Result = res - return ec.marshalNAccountMembership2ᚖkloudliteᚗioᚋappsᚋfinanceᚋinternalᚋappᚋgraphᚋmodelᚐAccountMembership(ctx, field.Selections, res) + return ec.marshalOMap2map(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_accountMembership(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Metadata_annotations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "Metadata", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "user": - return ec.fieldContext_AccountMembership_user(ctx, field) - case "role": - return ec.fieldContext_AccountMembership_role(ctx, field) - case "account": - return ec.fieldContext_AccountMembership_account(ctx, field) - case "accepted": - return ec.fieldContext_AccountMembership_accepted(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type AccountMembership", field.Name) + return nil, errors.New("field of type Map 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_User_accountMembership_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) __Service_sdl(ctx context.Context, field graphql.CollectedField, obj *fedruntime.Service) (ret graphql.Marshaler) { - fc, err := ec.fieldContext__Service_sdl(ctx, field) +func (ec *executionContext) _Metadata_creationTimestamp(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_creationTimestamp(ctx, field) if err != nil { return graphql.Null } @@ -3411,35 +3330,38 @@ func (ec *executionContext) __Service_sdl(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.SDL, nil + return ec.resolvers.Metadata().CreationTimestamp(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.marshalOString2string(ctx, field.Selections, res) + return ec.marshalNDate2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext__Service_sdl(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Metadata_creationTimestamp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "_Service", + Object: "Metadata", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Date 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) +func (ec *executionContext) _Metadata_deletionTimestamp(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_deletionTimestamp(ctx, field) if err != nil { return graphql.Null } @@ -3452,38 +3374,35 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return ec.resolvers.Metadata().DeletionTimestamp(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) + res := resTmp.(*string) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalODate2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Metadata_deletionTimestamp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "Metadata", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Date does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_description(ctx, field) +func (ec *executionContext) _Metadata_generation(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_generation(ctx, field) if err != nil { return graphql.Null } @@ -3496,35 +3415,38 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.Generation, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(int64) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNInt2int64(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Metadata_generation(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "Metadata", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_locations(ctx, field) +func (ec *executionContext) _Metadata_labels(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_labels(ctx, field) if err != nil { return graphql.Null } @@ -3537,38 +3459,35 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Locations, nil + return ec.resolvers.Metadata().Labels(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) + res := resTmp.(map[string]interface{}) fc.Result = res - return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) + return ec.marshalOMap2map(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_locations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Metadata_labels(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "Metadata", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type __DirectiveLocation does not have child fields") + return nil, errors.New("field of type Map 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) +func (ec *executionContext) _Metadata_name(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_name(ctx, field) if err != nil { return graphql.Null } @@ -3581,7 +3500,7 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Args, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -3593,36 +3512,26 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.([]introspection.InputValue) + res := resTmp.(string) fc.Result = res - return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Metadata_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "Metadata", 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) +func (ec *executionContext) _Metadata_namespace(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_namespace(ctx, field) if err != nil { return graphql.Null } @@ -3635,38 +3544,35 @@ func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.IsRepeatable, nil + return obj.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.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalOString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Metadata_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "Metadata", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_name(ctx, field) +func (ec *executionContext) _Mutation_accounts_createAccount(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_accounts_createAccount(ctx, field) if err != nil { return graphql.Null } @@ -3678,8 +3584,28 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().AccountsCreateAccount(rctx, fc.Args["account"].(entities.Account)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Account); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/accounts/internal/entities.Account`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -3691,26 +3617,65 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*entities.Account) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNAccount2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐAccount(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_accounts_createAccount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "contactEmail": + return ec.fieldContext_Account_contactEmail(ctx, field) + case "createdBy": + return ec.fieldContext_Account_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Account_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_Account_displayName(ctx, field) + case "id": + return ec.fieldContext_Account_id(ctx, field) + case "isActive": + return ec.fieldContext_Account_isActive(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Account_lastUpdatedBy(ctx, field) + case "logo": + return ec.fieldContext_Account_logo(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Account_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Account_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_Account_recordVersion(ctx, field) + case "targetNamespace": + return ec.fieldContext_Account_targetNamespace(ctx, field) + case "updateTime": + return ec.fieldContext_Account_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Account", field.Name) }, } + defer func() { + if 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_accounts_createAccount_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } return fc, nil } -func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_description(ctx, field) +func (ec *executionContext) _Mutation_accounts_updateAccount(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_accounts_updateAccount(ctx, field) if err != nil { return graphql.Null } @@ -3722,36 +3687,98 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().AccountsUpdateAccount(rctx, fc.Args["account"].(entities.Account)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Account); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/accounts/internal/entities.Account`, tmp) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(*entities.Account) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNAccount2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐAccount(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_accounts_updateAccount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "Mutation", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "contactEmail": + return ec.fieldContext_Account_contactEmail(ctx, field) + case "createdBy": + return ec.fieldContext_Account_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Account_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_Account_displayName(ctx, field) + case "id": + return ec.fieldContext_Account_id(ctx, field) + case "isActive": + return ec.fieldContext_Account_isActive(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Account_lastUpdatedBy(ctx, field) + case "logo": + return ec.fieldContext_Account_logo(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Account_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Account_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_Account_recordVersion(ctx, field) + case "targetNamespace": + return ec.fieldContext_Account_targetNamespace(ctx, field) + case "updateTime": + return ec.fieldContext_Account_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Account", field.Name) }, } + defer func() { + if 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_accounts_updateAccount_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } return fc, nil } -func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) +func (ec *executionContext) _Mutation_accounts_deactivateAccount(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_accounts_deactivateAccount(ctx, field) if err != nil { return graphql.Null } @@ -3763,11 +3790,31 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.IsDeprecated(), nil - }) - if err != nil { - ec.Error(ctx, err) + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().AccountsDeactivateAccount(rctx, fc.Args["accountName"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, err) return graphql.Null } if resTmp == nil { @@ -3781,21 +3828,32 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_accounts_deactivateAccount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "Mutation", Field: field, IsMethod: true, - IsResolver: false, + 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_accounts_deactivateAccount_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } return fc, nil } -func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) +func (ec *executionContext) _Mutation_accounts_activateAccount(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_accounts_activateAccount(ctx, field) if err != nil { return graphql.Null } @@ -3807,36 +3865,70 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DeprecationReason(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().AccountsActivateAccount(rctx, fc.Args["accountName"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(bool) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_accounts_activateAccount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "Mutation", Field: field, IsMethod: true, - IsResolver: false, + 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 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_accounts_activateAccount_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } return fc, nil } -func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_name(ctx, field) +func (ec *executionContext) _Mutation_accounts_deleteAccount(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_accounts_deleteAccount(ctx, field) if err != nil { return graphql.Null } @@ -3848,8 +3940,28 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().AccountsDeleteAccount(rctx, fc.Args["accountName"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -3861,26 +3973,37 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(string) + res := resTmp.(bool) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_accounts_deleteAccount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + 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_accounts_deleteAccount_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } return fc, nil } -func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_description(ctx, field) +func (ec *executionContext) _Mutation_accounts_inviteMembers(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_accounts_inviteMembers(ctx, field) if err != nil { return graphql.Null } @@ -3892,8 +4015,28 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().AccountsInviteMembers(rctx, fc.Args["accountName"].(string), fc.Args["invitations"].([]*entities.Invitation)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.([]*entities.Invitation); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/kloudlite/api/apps/accounts/internal/entities.Invitation`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -3902,26 +4045,65 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.([]*entities.Invitation) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalOInvitation2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐInvitationᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_accounts_inviteMembers(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "Mutation", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "accepted": + return ec.fieldContext_Invitation_accepted(ctx, field) + case "accountName": + return ec.fieldContext_Invitation_accountName(ctx, field) + case "creationTime": + return ec.fieldContext_Invitation_creationTime(ctx, field) + case "id": + return ec.fieldContext_Invitation_id(ctx, field) + case "invitedBy": + return ec.fieldContext_Invitation_invitedBy(ctx, field) + case "inviteToken": + return ec.fieldContext_Invitation_inviteToken(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Invitation_markedForDeletion(ctx, field) + case "recordVersion": + return ec.fieldContext_Invitation_recordVersion(ctx, field) + case "rejected": + return ec.fieldContext_Invitation_rejected(ctx, field) + case "updateTime": + return ec.fieldContext_Invitation_updateTime(ctx, field) + case "userEmail": + return ec.fieldContext_Invitation_userEmail(ctx, field) + case "userName": + return ec.fieldContext_Invitation_userName(ctx, field) + case "userRole": + return ec.fieldContext_Invitation_userRole(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Invitation", field.Name) }, } + defer func() { + if 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_accounts_inviteMembers_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } return fc, nil } -func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_args(ctx, field) +func (ec *executionContext) _Mutation_accounts_resendInviteMail(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_accounts_resendInviteMail(ctx, field) if err != nil { return graphql.Null } @@ -3933,8 +4115,28 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Args, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().AccountsResendInviteMail(rctx, fc.Args["accountName"].(string), fc.Args["invitationId"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -3946,36 +4148,37 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.([]introspection.InputValue) + res := resTmp.(bool) fc.Result = res - return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_accounts_resendInviteMail(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___InputValue_name(ctx, field) - case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + return nil, errors.New("field of type 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_accounts_resendInviteMail_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } return fc, nil } -func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_type(ctx, field) +func (ec *executionContext) _Mutation_accounts_deleteInvitation(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_accounts_deleteInvitation(ctx, field) if err != nil { return graphql.Null } @@ -3987,8 +4190,28 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Type, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().AccountsDeleteInvitation(rctx, fc.Args["accountName"].(string), fc.Args["invitationId"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4000,48 +4223,37 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(bool) fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_accounts_deleteInvitation(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "Mutation", 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) + 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_accounts_deleteInvitation_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } return fc, nil } -func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) +func (ec *executionContext) _Mutation_accounts_acceptInvitation(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_accounts_acceptInvitation(ctx, field) if err != nil { return graphql.Null } @@ -4053,8 +4265,28 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.IsDeprecated(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().AccountsAcceptInvitation(rctx, fc.Args["accountName"].(string), fc.Args["inviteToken"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4071,21 +4303,32 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_accounts_acceptInvitation(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "Mutation", Field: field, IsMethod: true, - IsResolver: false, + 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_accounts_acceptInvitation_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } return fc, nil } -func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) +func (ec *executionContext) _Mutation_accounts_rejectInvitation(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_accounts_rejectInvitation(ctx, field) if err != nil { return graphql.Null } @@ -4097,36 +4340,70 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DeprecationReason(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().AccountsRejectInvitation(rctx, fc.Args["accountName"].(string), fc.Args["inviteToken"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(bool) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_accounts_rejectInvitation(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "Mutation", Field: field, IsMethod: true, - IsResolver: false, + 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 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_accounts_rejectInvitation_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } return fc, nil } -func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_name(ctx, field) +func (ec *executionContext) _Mutation_accounts_removeAccountMembership(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_accounts_removeAccountMembership(ctx, field) if err != nil { return graphql.Null } @@ -4138,8 +4415,28 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().AccountsRemoveAccountMembership(rctx, fc.Args["accountName"].(string), fc.Args["memberId"].(repos.ID)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4151,26 +4448,37 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.(string) + res := resTmp.(bool) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_accounts_removeAccountMembership(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + 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_accounts_removeAccountMembership_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } return fc, nil } -func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_description(ctx, field) +func (ec *executionContext) _Mutation_accounts_updateAccountMembership(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_accounts_updateAccountMembership(ctx, field) if err != nil { return graphql.Null } @@ -4182,36 +4490,70 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().AccountsUpdateAccountMembership(rctx, fc.Args["accountName"].(string), fc.Args["memberId"].(repos.ID), fc.Args["role"].(types.Role)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(bool) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_accounts_updateAccountMembership(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "Mutation", Field: field, IsMethod: true, - IsResolver: false, + 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 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_accounts_updateAccountMembership_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } return fc, nil } -func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_type(ctx, field) +func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_endCursor(ctx, field) if err != nil { return graphql.Null } @@ -4224,60 +4566,35 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Type, nil + return obj.EndCursor, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(*string) fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_endCursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "PageInfo", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) +func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_hasNextPage(ctx, field) if err != nil { return graphql.Null } @@ -4290,7 +4607,7 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.DefaultValue, nil + return obj.HasNextPage, nil }) if err != nil { ec.Error(ctx, err) @@ -4299,26 +4616,26 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.(*bool) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "PageInfo", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_description(ctx, field) +func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) if err != nil { return graphql.Null } @@ -4331,7 +4648,7 @@ func (ec *executionContext) ___Schema_description(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.HasPreviousPage, nil }) if err != nil { ec.Error(ctx, err) @@ -4340,26 +4657,26 @@ func (ec *executionContext) ___Schema_description(ctx context.Context, field gra if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.(*bool) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "PageInfo", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_types(ctx, field) +func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_startCursor(ctx, field) if err != nil { return graphql.Null } @@ -4372,60 +4689,35 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Types(), nil + return obj.StartCursor, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.([]introspection.Type) + res := resTmp.(*string) fc.Result = res - return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_types(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_startCursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "PageInfo", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_queryType(ctx, field) +func (ec *executionContext) _Query_accounts_listAccounts(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_accounts_listAccounts(ctx, field) if err != nil { return graphql.Null } @@ -4437,61 +4729,84 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.QueryType(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().AccountsListAccounts(rctx) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.([]*entities.Account); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/kloudlite/api/apps/accounts/internal/entities.Account`, tmp) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.([]*entities.Account) fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalOAccount2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐAccount(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_queryType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_accounts_listAccounts(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "Query", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "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) + case "contactEmail": + return ec.fieldContext_Account_contactEmail(ctx, field) + case "createdBy": + return ec.fieldContext_Account_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Account_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_Account_displayName(ctx, field) + case "id": + return ec.fieldContext_Account_id(ctx, field) + case "isActive": + return ec.fieldContext_Account_isActive(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Account_lastUpdatedBy(ctx, field) + case "logo": + return ec.fieldContext_Account_logo(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Account_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Account_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_Account_recordVersion(ctx, field) + case "targetNamespace": + return ec.fieldContext_Account_targetNamespace(ctx, field) + case "updateTime": + return ec.fieldContext_Account_updateTime(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Account", 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) +func (ec *executionContext) _Query_accounts_getAccount(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_accounts_getAccount(ctx, field) if err != nil { return graphql.Null } @@ -4503,8 +4818,28 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MutationType(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().AccountsGetAccount(rctx, fc.Args["accountName"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Account); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/accounts/internal/entities.Account`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4513,48 +4848,65 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr if resTmp == nil { return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(*entities.Account) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalOAccount2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐAccount(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_mutationType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_accounts_getAccount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "Query", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "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) + case "contactEmail": + return ec.fieldContext_Account_contactEmail(ctx, field) + case "createdBy": + return ec.fieldContext_Account_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Account_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_Account_displayName(ctx, field) + case "id": + return ec.fieldContext_Account_id(ctx, field) + case "isActive": + return ec.fieldContext_Account_isActive(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Account_lastUpdatedBy(ctx, field) + case "logo": + return ec.fieldContext_Account_logo(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Account_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Account_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_Account_recordVersion(ctx, field) + case "targetNamespace": + return ec.fieldContext_Account_targetNamespace(ctx, field) + case "updateTime": + return ec.fieldContext_Account_updateTime(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Account", field.Name) }, } + defer func() { + if 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_accounts_getAccount_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } return fc, nil } -func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) +func (ec *executionContext) _Query_accounts_resyncAccount(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_accounts_resyncAccount(ctx, field) if err != nil { return graphql.Null } @@ -4566,58 +4918,70 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SubscriptionType(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().AccountsResyncAccount(rctx, fc.Args["accountName"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(bool) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_accounts_resyncAccount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "Query", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } + defer func() { + if 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_accounts_resyncAccount_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } return fc, nil } -func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_directives(ctx, field) +func (ec *executionContext) _Query_accounts_listInvitations(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_accounts_listInvitations(ctx, field) if err != nil { return graphql.Null } @@ -4629,51 +4993,95 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Directives(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().AccountsListInvitations(rctx, fc.Args["accountName"].(string)) } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.([]*entities.Invitation); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/kloudlite/api/apps/accounts/internal/entities.Invitation`, tmp) + }) + if err != nil { + ec.Error(ctx, err) return graphql.Null } - res := resTmp.([]introspection.Directive) + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*entities.Invitation) fc.Result = res - return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) + return ec.marshalOInvitation2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐInvitationᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_directives(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_accounts_listInvitations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "Query", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "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) + case "accepted": + return ec.fieldContext_Invitation_accepted(ctx, field) + case "accountName": + return ec.fieldContext_Invitation_accountName(ctx, field) + case "creationTime": + return ec.fieldContext_Invitation_creationTime(ctx, field) + case "id": + return ec.fieldContext_Invitation_id(ctx, field) + case "invitedBy": + return ec.fieldContext_Invitation_invitedBy(ctx, field) + case "inviteToken": + return ec.fieldContext_Invitation_inviteToken(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Invitation_markedForDeletion(ctx, field) + case "recordVersion": + return ec.fieldContext_Invitation_recordVersion(ctx, field) + case "rejected": + return ec.fieldContext_Invitation_rejected(ctx, field) + case "updateTime": + return ec.fieldContext_Invitation_updateTime(ctx, field) + case "userEmail": + return ec.fieldContext_Invitation_userEmail(ctx, field) + case "userName": + return ec.fieldContext_Invitation_userName(ctx, field) + case "userRole": + return ec.fieldContext_Invitation_userRole(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Invitation", field.Name) }, } + defer func() { + if 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_accounts_listInvitations_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } return fc, nil } -func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_kind(ctx, field) +func (ec *executionContext) _Query_accounts_getInvitation(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_accounts_getInvitation(ctx, field) if err != nil { return graphql.Null } @@ -4685,39 +5093,95 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().AccountsGetInvitation(rctx, fc.Args["accountName"].(string), fc.Args["invitationId"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Invitation); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/accounts/internal/entities.Invitation`, tmp) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*entities.Invitation) fc.Result = res - return ec.marshalN__TypeKind2string(ctx, field.Selections, res) + return ec.marshalOInvitation2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐInvitation(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_accounts_getInvitation(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "Query", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type __TypeKind does not have child fields") + switch field.Name { + case "accepted": + return ec.fieldContext_Invitation_accepted(ctx, field) + case "accountName": + return ec.fieldContext_Invitation_accountName(ctx, field) + case "creationTime": + return ec.fieldContext_Invitation_creationTime(ctx, field) + case "id": + return ec.fieldContext_Invitation_id(ctx, field) + case "invitedBy": + return ec.fieldContext_Invitation_invitedBy(ctx, field) + case "inviteToken": + return ec.fieldContext_Invitation_inviteToken(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Invitation_markedForDeletion(ctx, field) + case "recordVersion": + return ec.fieldContext_Invitation_recordVersion(ctx, field) + case "rejected": + return ec.fieldContext_Invitation_rejected(ctx, field) + case "updateTime": + return ec.fieldContext_Invitation_updateTime(ctx, field) + case "userEmail": + return ec.fieldContext_Invitation_userEmail(ctx, field) + case "userName": + return ec.fieldContext_Invitation_userName(ctx, field) + case "userRole": + return ec.fieldContext_Invitation_userRole(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Invitation", field.Name) }, } + defer func() { + if 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_accounts_getInvitation_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } return fc, nil } -func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_name(ctx, field) +func (ec *executionContext) _Query_accounts_listInvitationsForUser(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_accounts_listInvitationsForUser(ctx, field) if err != nil { return graphql.Null } @@ -4729,8 +5193,28 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().AccountsListInvitationsForUser(rctx, fc.Args["onlyPending"].(bool)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.([]*entities.Invitation); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/kloudlite/api/apps/accounts/internal/entities.Invitation`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4739,26 +5223,65 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.([]*entities.Invitation) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalOInvitation2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐInvitationᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_accounts_listInvitationsForUser(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "Query", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "accepted": + return ec.fieldContext_Invitation_accepted(ctx, field) + case "accountName": + return ec.fieldContext_Invitation_accountName(ctx, field) + case "creationTime": + return ec.fieldContext_Invitation_creationTime(ctx, field) + case "id": + return ec.fieldContext_Invitation_id(ctx, field) + case "invitedBy": + return ec.fieldContext_Invitation_invitedBy(ctx, field) + case "inviteToken": + return ec.fieldContext_Invitation_inviteToken(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Invitation_markedForDeletion(ctx, field) + case "recordVersion": + return ec.fieldContext_Invitation_recordVersion(ctx, field) + case "rejected": + return ec.fieldContext_Invitation_rejected(ctx, field) + case "updateTime": + return ec.fieldContext_Invitation_updateTime(ctx, field) + case "userEmail": + return ec.fieldContext_Invitation_userEmail(ctx, field) + case "userName": + return ec.fieldContext_Invitation_userName(ctx, field) + case "userRole": + return ec.fieldContext_Invitation_userRole(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Invitation", field.Name) }, } + defer func() { + if 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_accounts_listInvitationsForUser_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } return fc, nil } -func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_description(ctx, field) +func (ec *executionContext) _Query_accounts_checkNameAvailability(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_accounts_checkNameAvailability(ctx, field) if err != nil { return graphql.Null } @@ -4770,36 +5293,76 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().AccountsCheckNameAvailability(rctx, fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*domain.CheckNameAvailabilityOutput); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/accounts/internal/domain.CheckNameAvailabilityOutput`, tmp) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(*domain.CheckNameAvailabilityOutput) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNAccountsCheckNameAvailabilityOutput2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋdomainᚐCheckNameAvailabilityOutput(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_accounts_checkNameAvailability(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "Query", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "result": + return ec.fieldContext_AccountsCheckNameAvailabilityOutput_result(ctx, field) + case "suggestedNames": + return ec.fieldContext_AccountsCheckNameAvailabilityOutput_suggestedNames(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type AccountsCheckNameAvailabilityOutput", field.Name) }, } + defer func() { + if 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_accounts_checkNameAvailability_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } return fc, nil } -func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_fields(ctx, field) +func (ec *executionContext) _Query_accounts_listMembershipsForUser(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_accounts_listMembershipsForUser(ctx, field) if err != nil { return graphql.Null } @@ -4811,8 +5374,28 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().AccountsListMembershipsForUser(rctx) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.([]*entities.AccountMembership); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/kloudlite/api/apps/accounts/internal/entities.AccountMembership`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4821,51 +5404,36 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co if resTmp == nil { return graphql.Null } - res := resTmp.([]introspection.Field) + res := resTmp.([]*entities.AccountMembership) fc.Result = res - return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) + return ec.marshalOAccountMembership2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐAccountMembershipᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_accounts_listMembershipsForUser(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "Query", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "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) + case "accountName": + return ec.fieldContext_AccountMembership_accountName(ctx, field) + case "role": + return ec.fieldContext_AccountMembership_role(ctx, field) + case "userId": + return ec.fieldContext_AccountMembership_userId(ctx, field) + case "user": + return ec.fieldContext_AccountMembership_user(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) + return nil, fmt.Errorf("no field named %q was found under type AccountMembership", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_interfaces(ctx, field) +func (ec *executionContext) _Query_accounts_listMembershipsForAccount(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_accounts_listMembershipsForAccount(ctx, field) if err != nil { return graphql.Null } @@ -4877,8 +5445,28 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Interfaces(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().AccountsListMembershipsForAccount(rctx, fc.Args["accountName"].(string), fc.Args["role"].(*types.Role)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.([]*entities.AccountMembership); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/kloudlite/api/apps/accounts/internal/entities.AccountMembership`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4887,48 +5475,47 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq if resTmp == nil { return graphql.Null } - res := resTmp.([]introspection.Type) + res := resTmp.([]*entities.AccountMembership) fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + return ec.marshalOAccountMembership2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐAccountMembershipᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_interfaces(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_accounts_listMembershipsForAccount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "Query", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "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) + case "accountName": + return ec.fieldContext_AccountMembership_accountName(ctx, field) + case "role": + return ec.fieldContext_AccountMembership_role(ctx, field) + case "userId": + return ec.fieldContext_AccountMembership_userId(ctx, field) + case "user": + return ec.fieldContext_AccountMembership_user(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + return nil, fmt.Errorf("no field named %q was found under type AccountMembership", field.Name) }, } + defer func() { + if 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_accounts_listMembershipsForAccount_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } return fc, nil } -func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) +func (ec *executionContext) _Query_accounts_getAccountMembership(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_accounts_getAccountMembership(ctx, field) if err != nil { return graphql.Null } @@ -4940,8 +5527,28 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.PossibleTypes(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().AccountsGetAccountMembership(rctx, fc.Args["accountName"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.AccountMembership); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/accounts/internal/entities.AccountMembership`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4950,48 +5557,47 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra if resTmp == nil { return graphql.Null } - res := resTmp.([]introspection.Type) + res := resTmp.(*entities.AccountMembership) fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + return ec.marshalOAccountMembership2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐAccountMembership(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_possibleTypes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_accounts_getAccountMembership(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "Query", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "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) + case "accountName": + return ec.fieldContext_AccountMembership_accountName(ctx, field) + case "role": + return ec.fieldContext_AccountMembership_role(ctx, field) + case "userId": + return ec.fieldContext_AccountMembership_userId(ctx, field) + case "user": + return ec.fieldContext_AccountMembership_user(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + return nil, fmt.Errorf("no field named %q was found under type AccountMembership", field.Name) }, } + defer func() { + if 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_accounts_getAccountMembership_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } return fc, nil } -func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_enumValues(ctx, field) +func (ec *executionContext) _Query__entities(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query__entities(ctx, field) if err != nil { return graphql.Null } @@ -5004,38 +5610,31 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil + return ec.__resolve_entities(ctx, fc.Args["representations"].([]map[string]interface{})), nil }) if err != nil { ec.Error(ctx, 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.EnumValue) + res := resTmp.([]fedruntime.Entity) fc.Result = res - return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) + return ec.marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query__entities(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "Query", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___EnumValue_name(ctx, field) - case "description": - return ec.fieldContext___EnumValue_description(ctx, field) - case "isDeprecated": - return ec.fieldContext___EnumValue_isDeprecated(ctx, field) - case "deprecationReason": - return ec.fieldContext___EnumValue_deprecationReason(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) + return nil, errors.New("field of type _Entity does not have child fields") }, } defer func() { @@ -5045,15 +5644,15 @@ func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query__entities_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return } return fc, nil } -func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_inputFields(ctx, field) +func (ec *executionContext) _Query__service(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query__service(ctx, field) if err != nil { return graphql.Null } @@ -5066,45 +5665,42 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.InputFields(), nil + return ec.__resolve__service(ctx) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]introspection.InputValue) + res := resTmp.(fedruntime.Service) fc.Result = res - return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + return ec.marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_inputFields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query__service(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "Query", 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) + case "sdl": + return ec.fieldContext__Service_sdl(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + return nil, fmt.Errorf("no field named %q was found under type _Service", 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) +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 } @@ -5117,7 +5713,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.OfType(), nil + return ec.introspectType(fc.Args["name"].(string)) }) if err != nil { ec.Error(ctx, err) @@ -5131,9 +5727,9 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_ofType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "Query", Field: field, IsMethod: true, IsResolver: false, @@ -5163,11 +5759,22 @@ func (ec *executionContext) fieldContext___Type_ofType(ctx context.Context, fiel return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } return fc, nil } -func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) +func (ec *executionContext) _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 } @@ -5180,7 +5787,7 @@ func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.SpecifiedByURL(), nil + return ec.introspectSchema() }) if err != nil { ec.Error(ctx, err) @@ -5189,156 +5796,2816 @@ func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field gr if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.(*introspection.Schema) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query___schema(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "Query", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "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 } -// endregion **************************** field.gotpl ***************************** - -// region **************************** input.gotpl ***************************** - -func (ec *executionContext) unmarshalInputBillingInput(ctx context.Context, obj interface{}) (model.BillingInput, error) { - var it model.BillingInput - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v +func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_id(ctx, field) + if err != nil { + return graphql.Null } - - fieldsInOrder := [...]string{"stripePaymentMethodId", "cardholderName", "address"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "stripePaymentMethodId": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripePaymentMethodId")) - it.StripePaymentMethodID, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "cardholderName": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cardholderName")) - it.CardholderName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "address": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("address")) - it.Address, err = ec.unmarshalNJson2map(ctx, v) - if err != nil { - return it, err - } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = 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.(repos.ID) + fc.Result = res + return ec.marshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _User_accounts(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_accounts(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.User().Accounts(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*entities.AccountMembership) + fc.Result = res + return ec.marshalOAccountMembership2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐAccountMembershipᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_accounts(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accountName": + return ec.fieldContext_AccountMembership_accountName(ctx, field) + case "role": + return ec.fieldContext_AccountMembership_role(ctx, field) + case "userId": + return ec.fieldContext_AccountMembership_userId(ctx, field) + case "user": + return ec.fieldContext_AccountMembership_user(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type AccountMembership", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _User_accountInvitations(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_accountInvitations(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.User().AccountInvitations(rctx, obj, fc.Args["onlyPending"].(bool)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*entities.Invitation) + fc.Result = res + return ec.marshalOInvitation2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐInvitationᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_accountInvitations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accepted": + return ec.fieldContext_Invitation_accepted(ctx, field) + case "accountName": + return ec.fieldContext_Invitation_accountName(ctx, field) + case "creationTime": + return ec.fieldContext_Invitation_creationTime(ctx, field) + case "id": + return ec.fieldContext_Invitation_id(ctx, field) + case "invitedBy": + return ec.fieldContext_Invitation_invitedBy(ctx, field) + case "inviteToken": + return ec.fieldContext_Invitation_inviteToken(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Invitation_markedForDeletion(ctx, field) + case "recordVersion": + return ec.fieldContext_Invitation_recordVersion(ctx, field) + case "rejected": + return ec.fieldContext_Invitation_rejected(ctx, field) + case "updateTime": + return ec.fieldContext_Invitation_updateTime(ctx, field) + case "userEmail": + return ec.fieldContext_Invitation_userEmail(ctx, field) + case "userName": + return ec.fieldContext_Invitation_userName(ctx, field) + case "userRole": + return ec.fieldContext_Invitation_userRole(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Invitation", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_User_accountInvitations_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) __Service_sdl(ctx context.Context, field graphql.CollectedField, obj *fedruntime.Service) (ret graphql.Marshaler) { + fc, err := ec.fieldContext__Service_sdl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SDL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext__Service_sdl(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "_Service", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field 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(ctx 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(ctx 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(ctx 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(ctx 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(ctx 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(ctx 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(ctx 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(ctx 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(ctx 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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + 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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, 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(ctx 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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + 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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, 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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_types(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Types(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_types(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_queryType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.QueryType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_queryType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_mutationType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MutationType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_mutationType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SubscriptionType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_directives(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Directives(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Directive) + fc.Result = res + return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_directives(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Directive_name(ctx, field) + case "description": + return ec.fieldContext___Directive_description(ctx, field) + case "locations": + return ec.fieldContext___Directive_locations(ctx, field) + case "args": + return ec.fieldContext___Directive_args(ctx, field) + case "isRepeatable": + return ec.fieldContext___Directive_isRepeatable(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalN__TypeKind2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __TypeKind does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_fields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Field) + fc.Result = res + return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Field_name(ctx, field) + case "description": + return ec.fieldContext___Field_description(ctx, field) + case "args": + return ec.fieldContext___Field_args(ctx, field) + case "type": + return ec.fieldContext___Field_type(ctx, field) + case "isDeprecated": + return ec.fieldContext___Field_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___Field_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_interfaces(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Interfaces(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_interfaces(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PossibleTypes(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_possibleTypes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_enumValues(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.EnumValue) + fc.Result = res + return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___EnumValue_name(ctx, field) + case "description": + return ec.fieldContext___EnumValue_description(ctx, field) + case "isDeprecated": + return ec.fieldContext___EnumValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___EnumValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_inputFields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.InputFields(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_inputFields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_ofType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OfType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_ofType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SpecifiedByURL(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +// endregion **************************** field.gotpl ***************************** + +// region **************************** input.gotpl ***************************** + +func (ec *executionContext) unmarshalInputAccountIn(ctx context.Context, obj interface{}) (entities.Account, error) { + var it entities.Account + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"contactEmail", "displayName", "isActive", "logo", "metadata"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "contactEmail": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contactEmail")) + it.ContactEmail, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "displayName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + it.DisplayName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "isActive": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isActive")) + it.IsActive, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + case "logo": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("logo")) + it.Logo, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "metadata": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalOMetadataIn2ᚖk8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.AccountIn().Metadata(ctx, &it, data); err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputAccountMembershipIn(ctx context.Context, obj interface{}) (model.AccountMembershipIn, error) { + var it model.AccountMembershipIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"accountName", "role", "userId"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "accountName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("accountName")) + it.AccountName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "role": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("role")) + it.Role, err = ec.unmarshalNGithub__com___kloudlite___api___apps___iam___types__Role2githubᚗcomᚋkloudliteᚋapiᚋappsᚋiamᚋtypesᚐRole(ctx, v) + if err != nil { + return it, err + } + case "userId": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userId")) + it.UserID, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputInvitationIn(ctx context.Context, obj interface{}) (entities.Invitation, error) { + var it entities.Invitation + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"userEmail", "userName", "userRole"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "userEmail": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userEmail")) + it.UserEmail, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "userName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userName")) + it.UserName, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "userRole": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userRole")) + it.UserRole, err = ec.unmarshalNGithub__com___kloudlite___api___apps___iam___types__Role2githubᚗcomᚋkloudliteᚋapiᚋappsᚋiamᚋtypesᚐRole(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMetadataIn(ctx context.Context, obj interface{}) (v1.ObjectMeta, error) { + var it v1.ObjectMeta + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"annotations", "labels", "name", "namespace"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "annotations": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotations")) + data, err := ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.MetadataIn().Annotations(ctx, &it, data); err != nil { + return it, err + } + case "labels": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("labels")) + data, err := ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.MetadataIn().Labels(ctx, &it, data); err != nil { + return it, err + } + case "name": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + it.Name, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "namespace": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) + it.Namespace, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + } + } + return it, nil } -// endregion **************************** input.gotpl ***************************** +// endregion **************************** input.gotpl ***************************** + +// region ************************** interface.gotpl *************************** + +func (ec *executionContext) __Entity(ctx context.Context, sel ast.SelectionSet, obj fedruntime.Entity) graphql.Marshaler { + switch obj := (obj).(type) { + case nil: + return graphql.Null + case model.User: + return ec._User(ctx, sel, &obj) + case *model.User: + if obj == nil { + return graphql.Null + } + return ec._User(ctx, sel, obj) + default: + panic(fmt.Errorf("unexpected type %T", obj)) + } +} + +// endregion ************************** interface.gotpl *************************** + +// region **************************** object.gotpl **************************** + +var accountImplementors = []string{"Account"} + +func (ec *executionContext) _Account(ctx context.Context, sel ast.SelectionSet, obj *entities.Account) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, accountImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Account") + case "contactEmail": + + out.Values[i] = ec._Account_contactEmail(ctx, field, obj) + + case "createdBy": + + out.Values[i] = ec._Account_createdBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "creationTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Account_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "displayName": + + out.Values[i] = ec._Account_displayName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "id": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Account_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "isActive": + + out.Values[i] = ec._Account_isActive(ctx, field, obj) + + case "lastUpdatedBy": + + out.Values[i] = ec._Account_lastUpdatedBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "logo": + + out.Values[i] = ec._Account_logo(ctx, field, obj) + + case "markedForDeletion": + + out.Values[i] = ec._Account_markedForDeletion(ctx, field, obj) + + case "metadata": + + out.Values[i] = ec._Account_metadata(ctx, field, obj) + + case "recordVersion": + + out.Values[i] = ec._Account_recordVersion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "targetNamespace": + + out.Values[i] = ec._Account_targetNamespace(ctx, field, obj) + + case "updateTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Account_updateTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var accountMembershipImplementors = []string{"AccountMembership"} + +func (ec *executionContext) _AccountMembership(ctx context.Context, sel ast.SelectionSet, obj *entities.AccountMembership) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, accountMembershipImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("AccountMembership") + case "accountName": + + out.Values[i] = ec._AccountMembership_accountName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "role": + + out.Values[i] = ec._AccountMembership_role(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "userId": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._AccountMembership_userId(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "user": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._AccountMembership_user(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var accountsCheckNameAvailabilityOutputImplementors = []string{"AccountsCheckNameAvailabilityOutput"} + +func (ec *executionContext) _AccountsCheckNameAvailabilityOutput(ctx context.Context, sel ast.SelectionSet, obj *domain.CheckNameAvailabilityOutput) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, accountsCheckNameAvailabilityOutputImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("AccountsCheckNameAvailabilityOutput") + case "result": + + out.Values[i] = ec._AccountsCheckNameAvailabilityOutput_result(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "suggestedNames": + + out.Values[i] = ec._AccountsCheckNameAvailabilityOutput_suggestedNames(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var entityImplementors = []string{"Entity"} -// region ************************** interface.gotpl *************************** +func (ec *executionContext) _Entity(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Entity", + }) -func (ec *executionContext) __Entity(ctx context.Context, sel ast.SelectionSet, obj fedruntime.Entity) graphql.Marshaler { - switch obj := (obj).(type) { - case nil: - return graphql.Null - case model.Account: - return ec._Account(ctx, sel, &obj) - case *model.Account: - if obj == nil { - return graphql.Null - } - return ec._Account(ctx, sel, obj) - case model.User: - return ec._User(ctx, sel, &obj) - case *model.User: - if obj == nil { - return graphql.Null + out := graphql.NewFieldSet(fields) + var invalids uint32 + 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("Entity") + case "findUserByID": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findUserByID(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) } - return ec._User(ctx, sel, obj) - default: - panic(fmt.Errorf("unexpected type %T", obj)) } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -// endregion ************************** interface.gotpl *************************** +var github__com___kloudlite___api___common__CreatedOrUpdatedByImplementors = []string{"Github__com___kloudlite___api___common__CreatedOrUpdatedBy"} -// region **************************** object.gotpl **************************** +func (ec *executionContext) _Github__com___kloudlite___api___common__CreatedOrUpdatedBy(ctx context.Context, sel ast.SelectionSet, obj *common.CreatedOrUpdatedBy) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___api___common__CreatedOrUpdatedByImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___api___common__CreatedOrUpdatedBy") + case "userEmail": -var accountImplementors = []string{"Account", "_Entity"} + out.Values[i] = ec._Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field, obj) -func (ec *executionContext) _Account(ctx context.Context, sel ast.SelectionSet, obj *model.Account) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, accountImplementors) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "userId": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "userName": + + out.Values[i] = ec._Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var invitationImplementors = []string{"Invitation"} + +func (ec *executionContext) _Invitation(ctx context.Context, sel ast.SelectionSet, obj *entities.Invitation) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, invitationImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Account") - case "name": + out.Values[i] = graphql.MarshalString("Invitation") + case "accepted": + + out.Values[i] = ec._Invitation_accepted(ctx, field, obj) + + case "accountName": - out.Values[i] = ec._Account_name(ctx, field, obj) + out.Values[i] = ec._Invitation_accountName(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - case "displayName": + case "creationTime": + field := field - out.Values[i] = ec._Account_displayName(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Invitation_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "id": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Invitation_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "invitedBy": + + out.Values[i] = ec._Invitation_invitedBy(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - case "billing": + case "inviteToken": - out.Values[i] = ec._Account_billing(ctx, field, obj) + out.Values[i] = ec._Invitation_inviteToken(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - case "isActive": + case "markedForDeletion": - out.Values[i] = ec._Account_isActive(ctx, field, obj) + out.Values[i] = ec._Invitation_markedForDeletion(ctx, field, obj) + + case "recordVersion": + + out.Values[i] = ec._Invitation_recordVersion(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - case "contactEmail": + case "rejected": - out.Values[i] = ec._Account_contactEmail(ctx, field, obj) + out.Values[i] = ec._Invitation_rejected(ctx, field, obj) + + case "updateTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Invitation_updateTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "userEmail": + + out.Values[i] = ec._Invitation_userEmail(ctx, field, obj) + + case "userName": + + out.Values[i] = ec._Invitation_userName(ctx, field, obj) + + case "userRole": + + out.Values[i] = ec._Invitation_userRole(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - case "readableId": + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var metadataImplementors = []string{"Metadata"} + +func (ec *executionContext) _Metadata(ctx context.Context, sel ast.SelectionSet, obj *v1.ObjectMeta) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, metadataImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Metadata") + case "annotations": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Metadata_annotations(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "creationTimestamp": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Metadata_creationTimestamp(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "deletionTimestamp": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Metadata_deletionTimestamp(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) - out.Values[i] = ec._Account_readableId(ctx, field, obj) + }) + case "generation": + + out.Values[i] = ec._Metadata_generation(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - case "memberships": + case "labels": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -5347,10 +8614,7 @@ func (ec *executionContext) _Account(ctx context.Context, sel ast.SelectionSet, ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Account_memberships(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } + res = ec._Metadata_labels(ctx, field, obj) return res } @@ -5358,20 +8622,17 @@ func (ec *executionContext) _Account(ctx context.Context, sel ast.SelectionSet, return innerFunc(ctx) }) - case "created": + case "name": - out.Values[i] = ec._Account_created(ctx, field, obj) + out.Values[i] = ec._Metadata_name(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - case "outstandingAmount": + case "namespace": - out.Values[i] = ec._Account_outstandingAmount(ctx, field, obj) + out.Values[i] = ec._Metadata_namespace(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -5383,69 +8644,129 @@ func (ec *executionContext) _Account(ctx context.Context, sel ast.SelectionSet, return out } -var accountMembershipImplementors = []string{"AccountMembership"} +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", + }) -func (ec *executionContext) _AccountMembership(ctx context.Context, sel ast.SelectionSet, obj *model.AccountMembership) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, accountMembershipImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 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("AccountMembership") - case "user": - field := field + out.Values[i] = graphql.MarshalString("Mutation") + case "accounts_createAccount": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._AccountMembership_user(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_accounts_createAccount(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ } + case "accounts_updateAccount": - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_accounts_updateAccount(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "accounts_deactivateAccount": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_accounts_deactivateAccount(ctx, field) }) - case "role": - out.Values[i] = ec._AccountMembership_role(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "accounts_activateAccount": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_accounts_activateAccount(ctx, field) + }) if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + invalids++ } - case "account": - field := field + case "accounts_deleteAccount": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._AccountMembership_account(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_accounts_deleteAccount(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ } + case "accounts_inviteMembers": - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_accounts_inviteMembers(ctx, field) + }) + case "accounts_resendInviteMail": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_accounts_resendInviteMail(ctx, field) }) - case "accepted": - out.Values[i] = ec._AccountMembership_accepted(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "accounts_deleteInvitation": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_accounts_deleteInvitation(ctx, field) + }) if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + invalids++ + } + case "accounts_acceptInvitation": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_accounts_acceptInvitation(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "accounts_rejectInvitation": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_accounts_rejectInvitation(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "accounts_removeAccountMembership": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_accounts_removeAccountMembership(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "accounts_updateAccountMembership": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_accounts_updateAccountMembership(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) @@ -5458,30 +8779,32 @@ func (ec *executionContext) _AccountMembership(ctx context.Context, sel ast.Sele return out } -var billingImplementors = []string{"Billing"} +var pageInfoImplementors = []string{"PageInfo"} -func (ec *executionContext) _Billing(ctx context.Context, sel ast.SelectionSet, obj *model.Billing) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, billingImplementors) +func (ec *executionContext) _PageInfo(ctx context.Context, sel ast.SelectionSet, obj *model.PageInfo) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, pageInfoImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Billing") - case "cardholderName": + out.Values[i] = graphql.MarshalString("PageInfo") + case "endCursor": - out.Values[i] = ec._Billing_cardholderName(ctx, field, obj) + out.Values[i] = ec._PageInfo_endCursor(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ - } - case "address": + case "hasNextPage": - out.Values[i] = ec._Billing_address(ctx, field, obj) + out.Values[i] = ec._PageInfo_hasNextPage(ctx, field, obj) + + case "hasPreviousPage": + + out.Values[i] = ec._PageInfo_hasPreviousPage(ctx, field, obj) + + case "startCursor": + + out.Values[i] = ec._PageInfo_startCursor(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ - } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -5493,12 +8816,12 @@ func (ec *executionContext) _Billing(ctx context.Context, sel ast.SelectionSet, return out } -var entityImplementors = []string{"Entity"} +var queryImplementors = []string{"Query"} -func (ec *executionContext) _Entity(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, entityImplementors) +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: "Entity", + Object: "Query", }) out := graphql.NewFieldSet(fields) @@ -5511,8 +8834,8 @@ func (ec *executionContext) _Entity(ctx context.Context, sel ast.SelectionSet) g switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Entity") - case "findAccountByName": + out.Values[i] = graphql.MarshalString("Query") + case "accounts_listAccounts": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -5521,10 +8844,7 @@ func (ec *executionContext) _Entity(ctx context.Context, sel ast.SelectionSet) g ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Entity_findAccountByName(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } + res = ec._Query_accounts_listAccounts(ctx, field) return res } @@ -5535,7 +8855,7 @@ func (ec *executionContext) _Entity(ctx context.Context, sel ast.SelectionSet) g out.Concurrently(i, func() graphql.Marshaler { return rrm(innerCtx) }) - case "findUserByID": + case "accounts_getAccount": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -5544,10 +8864,7 @@ func (ec *executionContext) _Entity(ctx context.Context, sel ast.SelectionSet) g ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Entity_findUserByID(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } + res = ec._Query_accounts_getAccount(ctx, field) return res } @@ -5558,148 +8875,90 @@ func (ec *executionContext) _Entity(ctx context.Context, sel ast.SelectionSet) g out.Concurrently(i, func() graphql.Marshaler { return rrm(innerCtx) }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var 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) - var invalids uint32 - 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 "finance_createAccount": - - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_finance_createAccount(ctx, field) - }) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "finance_updateAccount": - - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_finance_updateAccount(ctx, field) - }) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "finance_removeAccountMember": - - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_finance_removeAccountMember(ctx, field) - }) + case "accounts_resyncAccount": + field := field - if out.Values[i] == graphql.Null { - invalids++ + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_accounts_resyncAccount(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res } - case "finance_updateAccountMember": - - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_finance_updateAccountMember(ctx, field) - }) - if out.Values[i] == graphql.Null { - invalids++ + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) } - case "finance_deactivateAccount": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_finance_deactivateAccount(ctx, field) + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) + case "accounts_listInvitations": + field := field - if out.Values[i] == graphql.Null { - invalids++ + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_accounts_listInvitations(ctx, field) + return res } - case "finance_activateAccount": - - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_finance_activateAccount(ctx, field) - }) - if out.Values[i] == graphql.Null { - invalids++ + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) } - case "finance_deleteAccount": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_finance_deleteAccount(ctx, field) + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) + case "accounts_getInvitation": + field := field - if out.Values[i] == graphql.Null { - invalids++ - } - case "finance_inviteUser": - - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_finance_inviteUser(ctx, field) - }) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_accounts_getInvitation(ctx, field) + return res + } - if out.Values[i] == graphql.Null { - invalids++ + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) } - case "finance_deleteInvitation": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_finance_deleteInvitation(ctx, field) + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) + case "accounts_listInvitationsForUser": + field := field - if out.Values[i] == graphql.Null { - invalids++ + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_accounts_listInvitationsForUser(ctx, field) + return res } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - 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) - var invalids uint32 - for i, field := range fields { - innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ - Object: field.Name, - Field: field, - }) + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Query") - case "finance_listAccounts": + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "accounts_checkNameAvailability": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -5708,7 +8967,10 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_finance_listAccounts(ctx, field) + res = ec._Query_accounts_checkNameAvailability(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res } @@ -5719,7 +8981,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr out.Concurrently(i, func() graphql.Marshaler { return rrm(innerCtx) }) - case "finance_account": + case "accounts_listMembershipsForUser": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -5728,7 +8990,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_finance_account(ctx, field) + res = ec._Query_accounts_listMembershipsForUser(ctx, field) return res } @@ -5739,7 +9001,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr out.Concurrently(i, func() graphql.Marshaler { return rrm(innerCtx) }) - case "finance_listInvitations": + case "accounts_listMembershipsForAccount": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -5748,7 +9010,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_finance_listInvitations(ctx, field) + res = ec._Query_accounts_listMembershipsForAccount(ctx, field) return res } @@ -5759,7 +9021,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr out.Concurrently(i, func() graphql.Marshaler { return rrm(innerCtx) }) - case "finance_reSyncAccount": + case "accounts_getAccountMembership": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -5768,10 +9030,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_finance_reSyncAccount(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } + res = ec._Query_accounts_getAccountMembership(ctx, field) return res } @@ -5868,7 +9127,7 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - case "accountMemberships": + case "accounts": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -5877,10 +9136,7 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._User_accountMemberships(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } + res = ec._User_accounts(ctx, field, obj) return res } @@ -5888,7 +9144,7 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj return innerFunc(ctx) }) - case "accountMembership": + case "accountInvitations": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -5897,10 +9153,7 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._User_accountMembership(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } + res = ec._User_accountInvitations(ctx, field, obj) return res } @@ -6262,11 +9515,11 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o // region ***************************** type.gotpl ***************************** -func (ec *executionContext) marshalNAccount2kloudliteᚗioᚋappsᚋfinanceᚋinternalᚋappᚋgraphᚋmodelᚐAccount(ctx context.Context, sel ast.SelectionSet, v model.Account) graphql.Marshaler { +func (ec *executionContext) marshalNAccount2githubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐAccount(ctx context.Context, sel ast.SelectionSet, v entities.Account) graphql.Marshaler { return ec._Account(ctx, sel, &v) } -func (ec *executionContext) marshalNAccount2ᚖkloudliteᚗioᚋappsᚋfinanceᚋinternalᚋappᚋgraphᚋmodelᚐAccount(ctx context.Context, sel ast.SelectionSet, v *model.Account) graphql.Marshaler { +func (ec *executionContext) marshalNAccount2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐAccount(ctx context.Context, sel ast.SelectionSet, v *entities.Account) 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") @@ -6276,55 +9529,12 @@ func (ec *executionContext) marshalNAccount2ᚖkloudliteᚗioᚋappsᚋfinance return ec._Account(ctx, sel, v) } -func (ec *executionContext) marshalNAccountMembership2kloudliteᚗioᚋappsᚋfinanceᚋinternalᚋappᚋgraphᚋmodelᚐAccountMembership(ctx context.Context, sel ast.SelectionSet, v model.AccountMembership) graphql.Marshaler { - return ec._AccountMembership(ctx, sel, &v) -} - -func (ec *executionContext) marshalNAccountMembership2ᚕᚖkloudliteᚗioᚋappsᚋfinanceᚋinternalᚋappᚋgraphᚋmodelᚐAccountMembershipᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.AccountMembership) 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.marshalNAccountMembership2ᚖkloudliteᚗioᚋappsᚋfinanceᚋinternalᚋappᚋgraphᚋmodelᚐAccountMembership(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) unmarshalNAccountIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐAccount(ctx context.Context, v interface{}) (entities.Account, error) { + res, err := ec.unmarshalInputAccountIn(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNAccountMembership2ᚖkloudliteᚗioᚋappsᚋfinanceᚋinternalᚋappᚋgraphᚋmodelᚐAccountMembership(ctx context.Context, sel ast.SelectionSet, v *model.AccountMembership) graphql.Marshaler { +func (ec *executionContext) marshalNAccountMembership2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐAccountMembership(ctx context.Context, sel ast.SelectionSet, v *entities.AccountMembership) 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") @@ -6334,14 +9544,18 @@ func (ec *executionContext) marshalNAccountMembership2ᚖkloudliteᚗioᚋapps return ec._AccountMembership(ctx, sel, v) } -func (ec *executionContext) marshalNBilling2ᚖkloudliteᚗioᚋappsᚋfinanceᚋinternalᚋappᚋgraphᚋmodelᚐBilling(ctx context.Context, sel ast.SelectionSet, v *model.Billing) graphql.Marshaler { +func (ec *executionContext) marshalNAccountsCheckNameAvailabilityOutput2githubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋdomainᚐCheckNameAvailabilityOutput(ctx context.Context, sel ast.SelectionSet, v domain.CheckNameAvailabilityOutput) graphql.Marshaler { + return ec._AccountsCheckNameAvailabilityOutput(ctx, sel, &v) +} + +func (ec *executionContext) marshalNAccountsCheckNameAvailabilityOutput2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋdomainᚐCheckNameAvailabilityOutput(ctx context.Context, sel ast.SelectionSet, v *domain.CheckNameAvailabilityOutput) 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._Billing(ctx, sel, v) + return ec._AccountsCheckNameAvailabilityOutput(ctx, sel, v) } func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { @@ -6374,28 +9588,33 @@ func (ec *executionContext) marshalNDate2string(ctx context.Context, sel ast.Sel return res } -func (ec *executionContext) unmarshalNFloat2float64(ctx context.Context, v interface{}) (float64, error) { - res, err := graphql.UnmarshalFloatContext(ctx, v) +func (ec *executionContext) unmarshalNGithub__com___kloudlite___api___apps___iam___types__Role2githubᚗcomᚋkloudliteᚋapiᚋappsᚋiamᚋtypesᚐRole(ctx context.Context, v interface{}) (types.Role, error) { + tmp, err := graphql.UnmarshalString(v) + res := types.Role(tmp) return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNFloat2float64(ctx context.Context, sel ast.SelectionSet, v float64) graphql.Marshaler { - res := graphql.MarshalFloatContext(v) +func (ec *executionContext) marshalNGithub__com___kloudlite___api___apps___iam___types__Role2githubᚗcomᚋkloudliteᚋapiᚋappsᚋiamᚋtypesᚐRole(ctx context.Context, sel ast.SelectionSet, v types.Role) graphql.Marshaler { + res := graphql.MarshalString(string(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 graphql.WrapContextMarshaler(ctx, res) + return res +} + +func (ec *executionContext) marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx context.Context, sel ast.SelectionSet, v common.CreatedOrUpdatedBy) graphql.Marshaler { + return ec._Github__com___kloudlite___api___common__CreatedOrUpdatedBy(ctx, sel, &v) } -func (ec *executionContext) unmarshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx context.Context, v interface{}) (repos.ID, error) { +func (ec *executionContext) unmarshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx context.Context, v interface{}) (repos.ID, error) { tmp, err := graphql.UnmarshalString(v) res := repos.ID(tmp) return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx context.Context, sel ast.SelectionSet, v repos.ID) graphql.Marshaler { +func (ec *executionContext) marshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx context.Context, sel ast.SelectionSet, v repos.ID) graphql.Marshaler { res := graphql.MarshalString(string(v)) if res == graphql.Null { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { @@ -6405,19 +9624,28 @@ func (ec *executionContext) marshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx con return res } -func (ec *executionContext) unmarshalNJson2map(ctx context.Context, v interface{}) (map[string]interface{}, error) { - res, err := graphql.UnmarshalMap(v) +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) marshalNJson2map(ctx context.Context, sel ast.SelectionSet, v map[string]interface{}) graphql.Marshaler { - if v == nil { +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 graphql.Null } - res := graphql.MarshalMap(v) + return res +} + +func (ec *executionContext) unmarshalNInt2int64(ctx context.Context, v interface{}) (int64, error) { + res, err := graphql.UnmarshalInt64(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNInt2int64(ctx context.Context, sel ast.SelectionSet, v int64) graphql.Marshaler { + res := graphql.MarshalInt64(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") @@ -6426,6 +9654,38 @@ func (ec *executionContext) marshalNJson2map(ctx context.Context, sel ast.Select return res } +func (ec *executionContext) marshalNInvitation2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐInvitation(ctx context.Context, sel ast.SelectionSet, v *entities.Invitation) 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._Invitation(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNInvitationIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐInvitationᚄ(ctx context.Context, v interface{}) ([]*entities.Invitation, error) { + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*entities.Invitation, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNInvitationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐInvitation(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalNInvitationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐInvitation(ctx context.Context, v interface{}) (*entities.Invitation, error) { + res, err := ec.unmarshalInputInvitationIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) return res, graphql.ErrorOnPath(ctx, err) @@ -6441,11 +9701,11 @@ func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.S return res } -func (ec *executionContext) marshalNUser2kloudliteᚗioᚋappsᚋfinanceᚋinternalᚋappᚋgraphᚋmodelᚐUser(ctx context.Context, sel ast.SelectionSet, v model.User) graphql.Marshaler { +func (ec *executionContext) marshalNUser2githubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋappᚋgraphᚋmodelᚐUser(ctx context.Context, sel ast.SelectionSet, v model.User) graphql.Marshaler { return ec._User(ctx, sel, &v) } -func (ec *executionContext) marshalNUser2ᚖkloudliteᚗioᚋappsᚋfinanceᚋinternalᚋappᚋgraphᚋmodelᚐUser(ctx context.Context, sel ast.SelectionSet, v *model.User) graphql.Marshaler { +func (ec *executionContext) marshalNUser2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋappᚋgraphᚋmodelᚐUser(ctx context.Context, sel ast.SelectionSet, v *model.User) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") @@ -6818,7 +10078,7 @@ func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel a return res } -func (ec *executionContext) marshalOAccount2ᚕᚖkloudliteᚗioᚋappsᚋfinanceᚋinternalᚋappᚋgraphᚋmodelᚐAccount(ctx context.Context, sel ast.SelectionSet, v []*model.Account) graphql.Marshaler { +func (ec *executionContext) marshalOAccount2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐAccount(ctx context.Context, sel ast.SelectionSet, v []*entities.Account) graphql.Marshaler { if v == nil { return graphql.Null } @@ -6845,7 +10105,7 @@ func (ec *executionContext) marshalOAccount2ᚕᚖkloudliteᚗioᚋappsᚋfinanc if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalOAccount2ᚖkloudliteᚗioᚋappsᚋfinanceᚋinternalᚋappᚋgraphᚋmodelᚐAccount(ctx, sel, v[i]) + ret[i] = ec.marshalOAccount2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐAccount(ctx, sel, v[i]) } if isLen1 { f(i) @@ -6859,14 +10119,14 @@ func (ec *executionContext) marshalOAccount2ᚕᚖkloudliteᚗioᚋappsᚋfinanc return ret } -func (ec *executionContext) marshalOAccount2ᚖkloudliteᚗioᚋappsᚋfinanceᚋinternalᚋappᚋgraphᚋmodelᚐAccount(ctx context.Context, sel ast.SelectionSet, v *model.Account) graphql.Marshaler { +func (ec *executionContext) marshalOAccount2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐAccount(ctx context.Context, sel ast.SelectionSet, v *entities.Account) graphql.Marshaler { if v == nil { return graphql.Null } return ec._Account(ctx, sel, v) } -func (ec *executionContext) marshalOAccountMembership2ᚕᚖkloudliteᚗioᚋappsᚋfinanceᚋinternalᚋappᚋgraphᚋmodelᚐAccountMembership(ctx context.Context, sel ast.SelectionSet, v []*model.AccountMembership) graphql.Marshaler { +func (ec *executionContext) marshalOAccountMembership2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐAccountMembershipᚄ(ctx context.Context, sel ast.SelectionSet, v []*entities.AccountMembership) graphql.Marshaler { if v == nil { return graphql.Null } @@ -6893,7 +10153,7 @@ func (ec *executionContext) marshalOAccountMembership2ᚕᚖkloudliteᚗioᚋapp if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalOAccountMembership2ᚖkloudliteᚗioᚋappsᚋfinanceᚋinternalᚋappᚋgraphᚋmodelᚐAccountMembership(ctx, sel, v[i]) + ret[i] = ec.marshalNAccountMembership2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐAccountMembership(ctx, sel, v[i]) } if isLen1 { f(i) @@ -6904,10 +10164,16 @@ func (ec *executionContext) marshalOAccountMembership2ᚕᚖkloudliteᚗioᚋapp } wg.Wait() + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + return ret } -func (ec *executionContext) marshalOAccountMembership2ᚖkloudliteᚗioᚋappsᚋfinanceᚋinternalᚋappᚋgraphᚋmodelᚐAccountMembership(ctx context.Context, sel ast.SelectionSet, v *model.AccountMembership) graphql.Marshaler { +func (ec *executionContext) marshalOAccountMembership2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐAccountMembership(ctx context.Context, sel ast.SelectionSet, v *entities.AccountMembership) graphql.Marshaler { if v == nil { return graphql.Null } @@ -6940,6 +10206,121 @@ func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast return res } +func (ec *executionContext) unmarshalODate2ᚖ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) marshalODate2ᚖ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) unmarshalOGithub__com___kloudlite___api___apps___iam___types__Role2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiamᚋtypesᚐRole(ctx context.Context, v interface{}) (*types.Role, error) { + if v == nil { + return nil, nil + } + tmp, err := graphql.UnmarshalString(v) + res := types.Role(tmp) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOGithub__com___kloudlite___api___apps___iam___types__Role2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiamᚋtypesᚐRole(ctx context.Context, sel ast.SelectionSet, v *types.Role) graphql.Marshaler { + if v == nil { + return graphql.Null + } + res := graphql.MarshalString(string(*v)) + return res +} + +func (ec *executionContext) marshalOInvitation2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐInvitationᚄ(ctx context.Context, sel ast.SelectionSet, v []*entities.Invitation) 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.marshalNInvitation2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐInvitation(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) marshalOInvitation2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋaccountsᚋinternalᚋentitiesᚐInvitation(ctx context.Context, sel ast.SelectionSet, v *entities.Invitation) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Invitation(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOMap2map(ctx context.Context, v interface{}) (map[string]interface{}, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalMap(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOMap2map(ctx context.Context, sel ast.SelectionSet, v map[string]interface{}) graphql.Marshaler { + if v == nil { + return graphql.Null + } + res := graphql.MarshalMap(v) + return res +} + +func (ec *executionContext) marshalOMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx context.Context, sel ast.SelectionSet, v v1.ObjectMeta) graphql.Marshaler { + return ec._Metadata(ctx, sel, &v) +} + +func (ec *executionContext) unmarshalOMetadataIn2ᚖk8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx context.Context, v interface{}) (*v1.ObjectMeta, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputMetadataIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) return res, graphql.ErrorOnPath(ctx, err) diff --git a/apps/accounts/internal/app/graph/invitation.resolvers.go b/apps/accounts/internal/app/graph/invitation.resolvers.go new file mode 100644 index 000000000..2e2c2924c --- /dev/null +++ b/apps/accounts/internal/app/graph/invitation.resolvers.go @@ -0,0 +1,43 @@ +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.28 + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + "time" + + "github.com/kloudlite/api/apps/accounts/internal/app/graph/generated" + "github.com/kloudlite/api/apps/accounts/internal/entities" +) + +// CreationTime is the resolver for the creationTime field. +func (r *invitationResolver) CreationTime(ctx context.Context, obj *entities.Invitation) (string, error) { + if obj == nil { + return "", errors.Newf("invitation obj is nil") + } + return obj.CreationTime.Format(time.RFC3339), nil +} + +// ID is the resolver for the id field. +func (r *invitationResolver) ID(ctx context.Context, obj *entities.Invitation) (string, error) { + if obj == nil { + return "", errors.Newf("invitation obj is nil") + } + return string(obj.Id), nil +} + +// UpdateTime is the resolver for the updateTime field. +func (r *invitationResolver) UpdateTime(ctx context.Context, obj *entities.Invitation) (string, error) { + if obj == nil { + return "", errors.Newf("invitation obj is nil") + } + return obj.UpdateTime.Format(time.RFC3339), nil +} + +// Invitation returns generated.InvitationResolver implementation. +func (r *Resolver) Invitation() generated.InvitationResolver { return &invitationResolver{r} } + +type invitationResolver struct{ *Resolver } diff --git a/apps/accounts/internal/app/graph/model/models_gen.go b/apps/accounts/internal/app/graph/model/models_gen.go new file mode 100644 index 000000000..4e232711d --- /dev/null +++ b/apps/accounts/internal/app/graph/model/models_gen.go @@ -0,0 +1,30 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package model + +import ( + "github.com/kloudlite/api/apps/accounts/internal/entities" + "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/pkg/repos" +) + +type AccountMembershipIn struct { + AccountName string `json:"accountName"` + Role types.Role `json:"role"` + UserID string `json:"userId"` +} + +type PageInfo struct { + EndCursor *string `json:"endCursor,omitempty"` + HasNextPage *bool `json:"hasNextPage,omitempty"` + HasPreviousPage *bool `json:"hasPreviousPage,omitempty"` + StartCursor *string `json:"startCursor,omitempty"` +} + +type User struct { + ID repos.ID `json:"id"` + Accounts []*entities.AccountMembership `json:"accounts,omitempty"` + AccountInvitations []*entities.Invitation `json:"accountInvitations,omitempty"` +} + +func (User) IsEntity() {} diff --git a/apps/accounts/internal/app/graph/resolver.go b/apps/accounts/internal/app/graph/resolver.go new file mode 100644 index 000000000..2b5ff0886 --- /dev/null +++ b/apps/accounts/internal/app/graph/resolver.go @@ -0,0 +1,36 @@ +package graph + +import ( + "context" + "github.com/kloudlite/api/apps/accounts/internal/domain" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/errors" +) + +// This file will not be regenerated automatically. +// +// It serves as dependency injection for your app, add any dependencies you require here. + +type Resolver struct { + domain domain.Domain +} + +func NewResolver(domain domain.Domain) *Resolver { + return &Resolver{ + domain: domain, + } +} + +func toUserContext(ctx context.Context) (domain.UserContext, error) { + sess, ok := ctx.Value("kloudlite-user-session").(common.AuthSession) + if !ok { + return domain.UserContext{}, errors.Newf("`kloudlite-user-session` not set in request context") + } + + return domain.UserContext{ + Context: ctx, + UserId: sess.UserId, + UserName: sess.UserName, + UserEmail: sess.UserEmail, + }, nil +} diff --git a/apps/accounts/internal/app/graph/schema.graphqls b/apps/accounts/internal/app/graph/schema.graphqls new file mode 100644 index 000000000..d3358a10b --- /dev/null +++ b/apps/accounts/internal/app/graph/schema.graphqls @@ -0,0 +1,55 @@ +directive @isLoggedInAndVerified on FIELD_DEFINITION +directive @hasAccount on FIELD_DEFINITION + +type AccountsCheckNameAvailabilityOutput @shareable { + result: Boolean! + suggestedNames: [String!] +} + +extend type AccountMembership { + user: User! +} + +type Query { + accounts_listAccounts: [Account] @isLoggedInAndVerified + accounts_getAccount(accountName: String!): Account @isLoggedInAndVerified + accounts_resyncAccount(accountName: String!): Boolean! @isLoggedInAndVerified + + accounts_listInvitations(accountName: String!): [Invitation!] @isLoggedInAndVerified + accounts_getInvitation(accountName: String!, invitationId: String!): Invitation @isLoggedInAndVerified + accounts_listInvitationsForUser(onlyPending: Boolean!): [Invitation!] @isLoggedInAndVerified + + accounts_checkNameAvailability(name: String!): AccountsCheckNameAvailabilityOutput! @isLoggedInAndVerified + + accounts_listMembershipsForUser: [AccountMembership!] @isLoggedInAndVerified + accounts_listMembershipsForAccount(accountName: String!, role: Github__com___kloudlite___api___apps___iam___types__Role): [AccountMembership!] @isLoggedInAndVerified + accounts_getAccountMembership(accountName: String!): AccountMembership @isLoggedInAndVerified +} + +type Mutation { + accounts_createAccount(account: AccountIn!): Account! @isLoggedInAndVerified + accounts_updateAccount(account: AccountIn!): Account! @isLoggedInAndVerified + + accounts_deactivateAccount(accountName: String!): Boolean! @isLoggedInAndVerified + accounts_activateAccount(accountName: String!): Boolean! @isLoggedInAndVerified + + accounts_deleteAccount(accountName: String!): Boolean! @isLoggedInAndVerified + # accounts_attachToCluster(accountId: ID!, clusterId: ID!): Boolean! + + # invitations + accounts_inviteMembers(accountName: String!, invitations: [InvitationIn!]!): [Invitation!] @isLoggedInAndVerified + accounts_resendInviteMail(accountName: String!, invitationId: String!): Boolean! @isLoggedInAndVerified + accounts_deleteInvitation(accountName: String!, invitationId: String!): Boolean! @isLoggedInAndVerified + + accounts_acceptInvitation(accountName: String!, inviteToken: String!): Boolean! @isLoggedInAndVerified + accounts_rejectInvitation(accountName: String!, inviteToken: String!): Boolean! @isLoggedInAndVerified + + accounts_removeAccountMembership(accountName: String!, memberId: ID!): Boolean! @isLoggedInAndVerified + accounts_updateAccountMembership(accountName: String!, memberId: ID!, role: Github__com___kloudlite___api___apps___iam___types__Role!): Boolean! @isLoggedInAndVerified +} + +extend type User @key(fields: "id") { + id: ID! @external + accounts: [AccountMembership!] + accountInvitations(onlyPending: Boolean!): [Invitation!] +} diff --git a/apps/accounts/internal/app/graph/schema.resolvers.go b/apps/accounts/internal/app/graph/schema.resolvers.go new file mode 100644 index 000000000..f07cf97d3 --- /dev/null +++ b/apps/accounts/internal/app/graph/schema.resolvers.go @@ -0,0 +1,284 @@ +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.28 + +import ( + "context" + "github.com/kloudlite/api/apps/accounts/internal/app/graph/generated" + "github.com/kloudlite/api/apps/accounts/internal/app/graph/model" + "github.com/kloudlite/api/apps/accounts/internal/domain" + "github.com/kloudlite/api/apps/accounts/internal/entities" + iamT "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" +) + +// User is the resolver for the User field. +func (r *accountMembershipResolver) User(ctx context.Context, obj *entities.AccountMembership) (*model.User, error) { + return &model.User{ + ID: obj.UserId, + }, nil +} + +// AccountsCreateAccount is the resolver for the accounts_createAccount field. +func (r *mutationResolver) AccountsCreateAccount(ctx context.Context, account entities.Account) (*entities.Account, error) { + uc, err := toUserContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.domain.CreateAccount(uc, account) +} + +// AccountsUpdateAccount is the resolver for the accounts_updateAccount field. +func (r *mutationResolver) AccountsUpdateAccount(ctx context.Context, account entities.Account) (*entities.Account, error) { + uc, err := toUserContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.domain.UpdateAccount(uc, account) +} + +// AccountsDeactivateAccount is the resolver for the accounts_deactivateAccount field. +func (r *mutationResolver) AccountsDeactivateAccount(ctx context.Context, accountName string) (bool, error) { + uc, err := toUserContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + return r.domain.DeactivateAccount(uc, accountName) +} + +// AccountsActivateAccount is the resolver for the accounts_activateAccount field. +func (r *mutationResolver) AccountsActivateAccount(ctx context.Context, accountName string) (bool, error) { + uc, err := toUserContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + return r.domain.ActivateAccount(uc, accountName) +} + +// AccountsDeleteAccount is the resolver for the accounts_deleteAccount field. +func (r *mutationResolver) AccountsDeleteAccount(ctx context.Context, accountName string) (bool, error) { + uc, err := toUserContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + return r.domain.DeleteAccount(uc, accountName) +} + +// AccountsInviteMember is the resolver for the accounts_inviteMember field. +func (r *mutationResolver) AccountsInviteMembers(ctx context.Context, accountName string, invitations []*entities.Invitation) ([]*entities.Invitation, error) { + uc, err := toUserContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.domain.InviteMembers(uc, accountName, invitations) +} + +// AccountsResendInviteMail is the resolver for the accounts_resendInviteMail field. +func (r *mutationResolver) AccountsResendInviteMail(ctx context.Context, accountName string, invitationID string) (bool, error) { + uc, err := toUserContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + return r.domain.ResendInviteEmail(uc, accountName, repos.ID(invitationID)) +} + +// AccountsDeleteInvitation is the resolver for the accounts_deleteInvitation field. +func (r *mutationResolver) AccountsDeleteInvitation(ctx context.Context, accountName string, invitationID string) (bool, error) { + uc, err := toUserContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + return r.domain.DeleteInvitation(uc, accountName, repos.ID(invitationID)) +} + +// AccountsAcceptInvitation is the resolver for the accounts_acceptInvitation field. +func (r *mutationResolver) AccountsAcceptInvitation(ctx context.Context, accountName string, inviteToken string) (bool, error) { + uc, err := toUserContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + return r.domain.AcceptInvitation(uc, accountName, inviteToken) +} + +// AccountsRejectInvitation is the resolver for the accounts_rejectInvitation field. +func (r *mutationResolver) AccountsRejectInvitation(ctx context.Context, accountName string, inviteToken string) (bool, error) { + uc, err := toUserContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + + return r.domain.RejectInvitation(uc, accountName, inviteToken) +} + +// AccountsRemoveAccountMembership is the resolver for the accounts_removeAccountMembership field. +func (r *mutationResolver) AccountsRemoveAccountMembership(ctx context.Context, accountName string, memberID repos.ID) (bool, error) { + uc, err := toUserContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + return r.domain.RemoveAccountMembership(uc, accountName, memberID) +} + +// AccountsUpdateAccountMembership is the resolver for the accounts_updateAccountMembership field. +func (r *mutationResolver) AccountsUpdateAccountMembership(ctx context.Context, accountName string, memberID repos.ID, role iamT.Role) (bool, error) { + uc, err := toUserContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + return r.domain.UpdateAccountMembership(uc, accountName, memberID, iamT.Role(role)) +} + +// AccountsListAccounts is the resolver for the accounts_listAccounts field. +func (r *queryResolver) AccountsListAccounts(ctx context.Context) ([]*entities.Account, error) { + uc, err := toUserContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + a, err := r.domain.ListAccounts(uc) + if err != nil { + return nil, errors.NewE(err) + } + if a == nil { + return []*entities.Account{}, nil + } + return a, nil +} + +// AccountsGetAccount is the resolver for the accounts_getAccount field. +func (r *queryResolver) AccountsGetAccount(ctx context.Context, accountName string) (*entities.Account, error) { + uc, err := toUserContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.domain.GetAccount(uc, accountName) +} + +// AccountsResyncAccount is the resolver for the accounts_resyncAccount field. +func (r *queryResolver) AccountsResyncAccount(ctx context.Context, accountName string) (bool, error) { + uc, err := toUserContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + + if err := r.domain.ResyncAccount(uc, accountName); err != nil { + return false, errors.NewE(err) + } + return true, nil +} + +// AccountsListInvitations is the resolver for the accounts_listInvitations field. +func (r *queryResolver) AccountsListInvitations(ctx context.Context, accountName string) ([]*entities.Invitation, error) { + uc, err := toUserContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + invs, err := r.domain.ListInvitations(uc, accountName) + if err != nil { + return nil, errors.NewE(err) + } + + if invs == nil { + return []*entities.Invitation{}, nil + } + return invs, nil +} + +// AccountsGetInvitation is the resolver for the accounts_getInvitation field. +func (r *queryResolver) AccountsGetInvitation(ctx context.Context, accountName string, invitationID string) (*entities.Invitation, error) { + uc, err := toUserContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.domain.GetInvitation(uc, accountName, repos.ID(invitationID)) +} + +// AccountsListInvitationsForUser is the resolver for the accounts_listInvitationsForUser field. +func (r *queryResolver) AccountsListInvitationsForUser(ctx context.Context, onlyPending bool) ([]*entities.Invitation, error) { + uc, err := toUserContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + invitations, err := r.domain.ListInvitationsForUser(uc, onlyPending) + if err != nil { + return nil, errors.NewE(err) + } + if invitations == nil { + return make([]*entities.Invitation, 0), nil + } + + return invitations, nil +} + +// AccountsCheckNameAvailability is the resolver for the accounts_checkNameAvailability field. +func (r *queryResolver) AccountsCheckNameAvailability(ctx context.Context, name string) (*domain.CheckNameAvailabilityOutput, error) { + return r.domain.CheckNameAvailability(ctx, name) +} + +// AccountsListMembershipsForUser is the resolver for the accounts_listMembershipsForUser field. +func (r *queryResolver) AccountsListMembershipsForUser(ctx context.Context) ([]*entities.AccountMembership, error) { + uc, err := toUserContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.domain.ListMembershipsForUser(uc) +} + +// AccountsListMembershipsForAccount is the resolver for the accounts_listMembershipsForAccount field. +func (r *queryResolver) AccountsListMembershipsForAccount(ctx context.Context, accountName string, role *iamT.Role) ([]*entities.AccountMembership, error) { + uc, err := toUserContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.domain.ListMembershipsForAccount(uc, accountName, nil) +} + +// AccountsGetAccountMembership is the resolver for the accounts_getAccountMembership field. +func (r *queryResolver) AccountsGetAccountMembership(ctx context.Context, accountName string) (*entities.AccountMembership, error) { + uc, err := toUserContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.domain.GetAccountMembership(uc, accountName) +} + +// Accounts is the resolver for the accounts field. +func (r *userResolver) Accounts(ctx context.Context, obj *model.User) ([]*entities.AccountMembership, error) { + uc, err := toUserContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.domain.ListMembershipsForUser(uc) +} + +// AccountInvitations is the resolver for the accountInvitations field. +func (r *userResolver) AccountInvitations(ctx context.Context, obj *model.User, onlyPending bool) ([]*entities.Invitation, error) { + uc, err := toUserContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.domain.ListInvitationsForUser(uc, onlyPending) +} + +// Mutation returns generated.MutationResolver implementation. +func (r *Resolver) Mutation() generated.MutationResolver { return &mutationResolver{r} } + +// Query returns generated.QueryResolver implementation. +func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} } + +// User returns generated.UserResolver implementation. +func (r *Resolver) User() generated.UserResolver { return &userResolver{r} } + +type mutationResolver struct{ *Resolver } +type queryResolver struct{ *Resolver } +type userResolver struct{ *Resolver } diff --git a/apps/accounts/internal/app/graph/struct-to-graphql/account.graphqls b/apps/accounts/internal/app/graph/struct-to-graphql/account.graphqls new file mode 100644 index 000000000..5214c4a61 --- /dev/null +++ b/apps/accounts/internal/app/graph/struct-to-graphql/account.graphqls @@ -0,0 +1,24 @@ +type Account @shareable { + contactEmail: String + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + id: String! + isActive: Boolean + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + logo: String + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + recordVersion: Int! + targetNamespace: String + updateTime: Date! +} + +input AccountIn { + contactEmail: String + displayName: String! + isActive: Boolean + logo: String + metadata: MetadataIn +} + diff --git a/apps/accounts/internal/app/graph/struct-to-graphql/accountmembership.graphqls b/apps/accounts/internal/app/graph/struct-to-graphql/accountmembership.graphqls new file mode 100644 index 000000000..0b6765545 --- /dev/null +++ b/apps/accounts/internal/app/graph/struct-to-graphql/accountmembership.graphqls @@ -0,0 +1,12 @@ +type AccountMembership @shareable { + accountName: String! + role: Github__com___kloudlite___api___apps___iam___types__Role! + userId: String! +} + +input AccountMembershipIn { + accountName: String! + role: Github__com___kloudlite___api___apps___iam___types__Role! + userId: String! +} + diff --git a/apps/accounts/internal/app/graph/struct-to-graphql/common-types.graphqls b/apps/accounts/internal/app/graph/struct-to-graphql/common-types.graphqls new file mode 100644 index 000000000..ae044ee10 --- /dev/null +++ b/apps/accounts/internal/app/graph/struct-to-graphql/common-types.graphqls @@ -0,0 +1,39 @@ +type Github__com___kloudlite___api___common__CreatedOrUpdatedBy @shareable { + userEmail: String! + userId: String! + userName: String! +} + +type Metadata @shareable { + annotations: Map + creationTimestamp: Date! + deletionTimestamp: Date + generation: Int! + labels: Map + name: String! + namespace: String +} + +type PageInfo @shareable { + endCursor: String + hasNextPage: Boolean + hasPreviousPage: Boolean + startCursor: String +} + +input MetadataIn { + annotations: Map + labels: Map + name: String! + namespace: String +} + +enum Github__com___kloudlite___api___apps___iam___types__Role { + account_admin + account_member + account_owner + project_admin + project_member + resource_owner +} + diff --git a/apps/console/internal/app/graph/crd-to-gql/directives.graphqls b/apps/accounts/internal/app/graph/struct-to-graphql/directives.graphqls similarity index 77% rename from apps/console/internal/app/graph/crd-to-gql/directives.graphqls rename to apps/accounts/internal/app/graph/struct-to-graphql/directives.graphqls index 7f717fc28..59d6b45c6 100644 --- a/apps/console/internal/app/graph/crd-to-gql/directives.graphqls +++ b/apps/accounts/internal/app/graph/struct-to-graphql/directives.graphqls @@ -1,5 +1,4 @@ - -extend schema @link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@key", "@shareable"]) +extend schema @link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@key", "@shareable", "@external"]) directive @goField( forceResolver: Boolean diff --git a/apps/accounts/internal/app/graph/struct-to-graphql/invitation.graphqls b/apps/accounts/internal/app/graph/struct-to-graphql/invitation.graphqls new file mode 100644 index 000000000..60360e2b4 --- /dev/null +++ b/apps/accounts/internal/app/graph/struct-to-graphql/invitation.graphqls @@ -0,0 +1,22 @@ +type Invitation @shareable { + accepted: Boolean + accountName: String! + creationTime: Date! + id: String! + invitedBy: String! + inviteToken: String! + markedForDeletion: Boolean + recordVersion: Int! + rejected: Boolean + updateTime: Date! + userEmail: String + userName: String + userRole: Github__com___kloudlite___api___apps___iam___types__Role! +} + +input InvitationIn { + userEmail: String + userName: String + userRole: Github__com___kloudlite___api___apps___iam___types__Role! +} + diff --git a/apps/accounts/internal/app/graph/struct-to-graphql/scalars.graphqls b/apps/accounts/internal/app/graph/struct-to-graphql/scalars.graphqls new file mode 100644 index 000000000..1f83443a9 --- /dev/null +++ b/apps/accounts/internal/app/graph/struct-to-graphql/scalars.graphqls @@ -0,0 +1,4 @@ +scalar Any +scalar Json +scalar Map +scalar Date diff --git a/apps/accounts/internal/app/grpc-server.go b/apps/accounts/internal/app/grpc-server.go new file mode 100644 index 000000000..3aec3b311 --- /dev/null +++ b/apps/accounts/internal/app/grpc-server.go @@ -0,0 +1,46 @@ +package app + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + + "github.com/kloudlite/api/apps/accounts/internal/domain" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/accounts" + "github.com/kloudlite/api/pkg/grpc" + "github.com/kloudlite/api/pkg/repos" +) + +type AccountsGrpcServer grpc.Server + +type accountsGrpcServer struct { + accounts.UnimplementedAccountsServer + d domain.Domain +} + +// GetAccount implements accounts.AccountsServer. +func (s *accountsGrpcServer) GetAccount(ctx context.Context, in *accounts.GetAccountIn) (*accounts.GetAccountOut, error) { + acc, err := s.d.GetAccount(domain.UserContext{ + Context: ctx, + UserId: repos.ID(in.UserId), + }, in.AccountName) + if err != nil { + return nil, errors.NewE(err) + } + + isActive := false + if acc.IsActive != nil { + isActive = *acc.IsActive + } + + return &accounts.GetAccountOut{ + IsActive: isActive, + TargetNamespace: acc.TargetNamespace, + AccountId: string(acc.Id), + }, nil +} + +func registerAccountsGRPCServer(server AccountsGrpcServer, d domain.Domain) accounts.AccountsServer { + accountsSvc := &accountsGrpcServer{d: d} + accounts.RegisterAccountsServer(server, accountsSvc) + return accountsSvc +} diff --git a/apps/accounts/internal/domain/accounts.go b/apps/accounts/internal/domain/accounts.go new file mode 100644 index 000000000..cdd2f5db0 --- /dev/null +++ b/apps/accounts/internal/domain/accounts.go @@ -0,0 +1,247 @@ +package domain + +import ( + "context" + "fmt" + fc "github.com/kloudlite/api/apps/accounts/internal/entities/field-constants" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/errors" + "strings" + + "github.com/kloudlite/api/apps/accounts/internal/entities" + iamT "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/constants" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/repos" + corev1 "k8s.io/api/core/v1" + apiErrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +func (d *domain) findAccount(ctx context.Context, name string) (*entities.Account, error) { + result, err := d.accountRepo.FindOne(ctx, repos.Filter{ + fields.MetadataName: name, + fields.MarkedForDeletion: repos.Filter{"$ne": true}, + }) + if err != nil { + return nil, errors.NewE(err) + } + + if result == nil { + return nil, errors.Newf("account with name %q not found", name) + } + + return result, nil +} + +func (d *domain) ListAccounts(ctx UserContext) ([]*entities.Account, error) { + out, err := d.iamClient.ListMembershipsForUser(ctx, &iam.MembershipsForUserIn{ + UserId: string(ctx.UserId), + ResourceType: string(iamT.ResourceAccount), + }) + if err != nil { + return nil, errors.NewE(err) + } + + accountNames := make([]string, len(out.RoleBindings)) + for i := range out.RoleBindings { + accountNames[i] = strings.Split(out.RoleBindings[i].ResourceRef, "/")[0] + } + + return d.accountRepo.Find(ctx, repos.Query{Filter: repos.Filter{ + fields.MetadataName: repos.Filter{"$in": accountNames}, + fields.MarkedForDeletion: repos.Filter{"$ne": true}, + }}) +} + +func (d *domain) GetAccount(ctx UserContext, name string) (*entities.Account, error) { + if err := d.checkAccountAccess(ctx, name, ctx.UserId, iamT.GetAccount); err != nil { + return nil, errors.NewE(err) + } + return d.findAccount(ctx, name) +} + +func (d *domain) ensureNamespaceForAccount(ctx context.Context, accountName string, targetNamespace string) error { + if err := d.k8sClient.Get(ctx, fn.NN("", targetNamespace), &corev1.Namespace{}); err != nil { + if !apiErrors.IsNotFound(err) { + return errors.NewE(err) + } + } + + if err := d.k8sClient.Create(ctx, &corev1.Namespace{ + TypeMeta: metav1.TypeMeta{ + APIVersion: "v1", + Kind: "Namespace", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: targetNamespace, + Labels: map[string]string{ + constants.AccountNameKey: accountName, + }, + }, + }); err != nil { + return errors.NewE(err) + } + + return nil +} + +func (d *domain) deleteNamespaceForAccount(ctx context.Context, targetNamespace string) error { + panic("not implemented. Yet to decide if we want to delete namespace when account is deleted") +} + +func (d *domain) CreateAccount(ctx UserContext, account entities.Account) (*entities.Account, error) { + account.TargetNamespace = fmt.Sprintf("kl-account-%s", account.Name) + account.IsActive = fn.New(true) + account.CreatedBy = common.CreatedOrUpdatedBy{ + UserId: ctx.UserId, + UserName: ctx.UserName, + UserEmail: ctx.UserEmail, + } + account.LastUpdatedBy = account.CreatedBy + + acc, err := d.accountRepo.Create(ctx, &account) + if err != nil { + return nil, errors.NewE(err) + } + + if err := d.addMembership(ctx, acc.Name, ctx.UserId, iamT.RoleAccountOwner); err != nil { + return nil, errors.NewE(err) + } + + if err := d.ensureNamespaceForAccount(ctx, account.Name, account.TargetNamespace); err != nil { + return nil, errors.NewE(err) + } + + return acc, nil +} + +func (d *domain) UpdateAccount(ctx UserContext, accountIn entities.Account) (*entities.Account, error) { + if err := d.checkAccountAccess(ctx, accountIn.Name, ctx.UserId, iamT.UpdateAccount); err != nil { + return nil, errors.NewE(err) + } + + account, err := d.findAccount(ctx, accountIn.Name) + if err != nil { + return nil, errors.NewE(err) + } + + if account.IsActive != nil && !*account.IsActive { + return nil, errors.Newf("accountIn %q is not active, could not update", accountIn.Name) + } + + if account.IsMarkedForDeletion() { + return nil, errors.Newf("accountIn %q is marked for deletion, could not update", accountIn.Name) + } + + uAcc, err := d.accountRepo.PatchById(ctx, account.Id, repos.Document{ + fields.MetadataLabels: accountIn.Labels, + fields.DisplayName: accountIn.DisplayName, + fc.AccountLogo: accountIn.Logo, + fc.AccountContactEmail: accountIn.ContactEmail, + fields.LastUpdatedBy: common.CreatedOrUpdatedBy{ + UserId: ctx.UserId, + UserName: ctx.UserName, + UserEmail: ctx.UserEmail, + }, + }) + + if err != nil { + return nil, errors.NewE(err) + } + return uAcc, nil +} + +func (d *domain) DeleteAccount(ctx UserContext, name string) (bool, error) { + if err := d.checkAccountAccess(ctx, name, ctx.UserId, iamT.DeleteAccount); err != nil { + return false, errors.NewE(err) + } + + if _, err := d.accountRepo.Patch( + ctx, + repos.Filter{ + fields.MetadataName: name, + fields.MarkedForDeletion: repos.Filter{"$ne": true}, + }, + repos.Document{ + fields.MarkedForDeletion: fn.New(true), + fields.LastUpdatedBy: common.CreatedOrUpdatedBy{ + UserId: ctx.UserId, + UserName: ctx.UserName, + UserEmail: ctx.UserEmail, + }, + }); err != nil { + return false, errors.NewE(err) + } + + return true, nil +} + +func (d *domain) ResyncAccount(ctx UserContext, name string) error { + acc, err := d.findAccount(ctx, name) + if err != nil { + return errors.NewE(err) + } + if err := d.ensureNamespaceForAccount(ctx, acc.Name, acc.TargetNamespace); err != nil { + return errors.NewE(err) + } + return nil +} + +func (d *domain) ActivateAccount(ctx UserContext, name string) (bool, error) { + if err := d.checkAccountAccess(ctx, name, ctx.UserId, iamT.ActivateAccount); err != nil { + return false, errors.NewE(err) + } + + account, err := d.findAccount(ctx, name) + if err != nil { + return false, errors.NewE(err) + } + + if account.IsActive != nil && *account.IsActive { + return false, errors.Newf("account %q is already active", name) + } + + if _, err := d.accountRepo.PatchById(ctx, account.Id, repos.Document{ + fc.AccountIsActive: fn.New(true), + fields.LastUpdatedBy: common.CreatedOrUpdatedBy{ + UserId: ctx.UserId, + UserName: ctx.UserName, + UserEmail: ctx.UserEmail, + }, + }); err != nil { + return false, errors.NewE(err) + } + + return true, nil +} + +func (d *domain) DeactivateAccount(ctx UserContext, name string) (bool, error) { + if err := d.checkAccountAccess(ctx, name, ctx.UserId, iamT.DeactivateAccount); err != nil { + return false, errors.NewE(err) + } + + account, err := d.findAccount(ctx, name) + if err != nil { + return false, errors.NewE(err) + } + + if account.IsActive != nil && !*account.IsActive { + return false, errors.Newf("account %q is already deactive", name) + } + + if _, err := d.accountRepo.PatchById(ctx, account.Id, repos.Document{ + fc.AccountIsActive: fn.New(false), + fields.LastUpdatedBy: common.CreatedOrUpdatedBy{ + UserId: ctx.UserId, + UserName: ctx.UserName, + UserEmail: ctx.UserEmail, + }, + }); err != nil { + return false, errors.NewE(err) + } + + return true, nil +} diff --git a/apps/accounts/internal/domain/accounts_test b/apps/accounts/internal/domain/accounts_test new file mode 100644 index 000000000..774ff347e --- /dev/null +++ b/apps/accounts/internal/domain/accounts_test @@ -0,0 +1,279 @@ +package domain_test + +import ( + "context" + "github.com/kloudlite/api/common" + + "github.com/kloudlite/api/apps/accounts/internal/domain" + "github.com/kloudlite/api/apps/accounts/internal/entities" + authMock "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/auth/mocks" + commsMock "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/comms/mocks" + consoleMock "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/console/mocks" + _ "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/container_registry" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" + iamMock "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam/mocks" + k8sMock "github.com/kloudlite/api/mocks/pkg/k8s" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/api/pkg/repos" + "github.com/kloudlite/operator/pkg/kubectl" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + "google.golang.org/grpc" + "sigs.k8s.io/controller-runtime/pkg/client" + + // "kloudlite.io/pkg/repos" + reposMock "github.com/kloudlite/api/mocks/pkg/repos" +) + +var _ = Describe("domain.ActivateAccount says", func() { + // Given("an account", func() {}) + var authClient *authMock.AuthClient + var iamClient *iamMock.IAMClient + var consoleClient *consoleMock.ConsoleClient + // var containerRegistryClient container_registry.ContainerRegistryClient + var commsClient *commsMock.CommsClient + var accountRepo *reposMock.DbRepo[*entities.Account] + var invitationRepo *reposMock.DbRepo[*entities.Invitation] + var k8sYamlClient kubectl.YAMLClient + var k8sExtendedClient *k8sMock.ExtendedK8sClient + + logger, err := logging.New(&logging.Options{Name: "test"}) + if err != nil { + panic(err) + } + + BeforeEach(func() { + authClient = authMock.NewAuthClient() + iamClient = iamMock.NewIAMClient() + consoleClient = consoleMock.NewConsoleClient() + // containerRegistryClient = container_registry.NewContainerRegistryClient() + commsClient = commsMock.NewCommsClient() + accountRepo = reposMock.NewDbRepo[*entities.Account]() + invitationRepo = reposMock.NewDbRepo[*entities.Invitation]() + // k8sYamlClient = kubectl.NewYAMLClient() + k8sExtendedClient = k8sMock.NewExtendedK8sClient() + }) + + getDomain := func() domain.Domain { + return domain.NewDomain( + iamClient, + consoleClient, + // f.containerRegistryClient, + authClient, + commsClient, + k8sYamlClient, + k8sExtendedClient, + + accountRepo, + invitationRepo, + + logger, + ) + } + + When("user has no IAM permission to activate account", func() { + It("account activation should fail", func() { + d := getDomain() + + iamClient.MockCan = func(ctx context.Context, in *iam.CanIn, opts ...grpc.CallOption) (*iam.CanOut, error) { + return &iam.CanOut{Status: false}, nil + } + + accountRepo.MockFindOne = func(ctx context.Context, filter repos.Filter) (*entities.Account, error) { + return nil, errors.Newf("not found") + } + + _, err := d.ActivateAccount(domain.UserContext{}, "sample") + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring("unauthorized")) + }) + }) + + When("user has IAM permission to activate account", func() { + Context("but account does not exist", func() { + It("it should fail", func() { + d := getDomain() + + iamClient.MockCan = func(ctx context.Context, in *iam.CanIn, opts ...grpc.CallOption) (*iam.CanOut, error) { + return &iam.CanOut{Status: true}, nil + } + + accountRepo.MockFindOne = func(ctx context.Context, filter repos.Filter) (*entities.Account, error) { + return nil, errors.Newf("mock: account not found") + } + + _, err := d.ActivateAccount(domain.UserContext{}, "sample") + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring("mock: account not found")) + }) + }) + + Context("but account is already active", func() { + It("it should fail", func() { + d := getDomain() + + iamClient.MockCan = func(ctx context.Context, in *iam.CanIn, opts ...grpc.CallOption) (*iam.CanOut, error) { + return &iam.CanOut{Status: true}, nil + } + + accountRepo.MockFindOne = func(ctx context.Context, filter repos.Filter) (*entities.Account, error) { + return &entities.Account{IsActive: fn.New(true)}, nil + } + + _, err := d.ActivateAccount(domain.UserContext{}, "sample") + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring("already active")) + }) + }) + + Context("and account exists and it is currently disabled", func() { + It("then, account should get activated", func() { + d := getDomain() + + iamClient.MockCan = func(ctx context.Context, in *iam.CanIn, opts ...grpc.CallOption) (*iam.CanOut, error) { + return &iam.CanOut{Status: true}, nil + } + + accountRepo.MockFindOne = func(ctx context.Context, filter repos.Filter) (*entities.Account, error) { + return &entities.Account{IsActive: fn.New(false)}, nil + } + + accountRepo.MockUpdateById = func(ctx context.Context, id repos.ID, updatedData *entities.Account, opts ...repos.UpdateOpts) (*entities.Account, error) { + return &entities.Account{IsActive: fn.New(true)}, nil + } + _, err := d.ActivateAccount(domain.UserContext{}, "sample") + Expect(err).ToNot(HaveOccurred()) + }) + }) + }) +}) + +var _ = Describe("domain.CreateAccount() says", func() { + // Given("an account", func() {}) + var authClient *authMock.AuthClient + var iamClient *iamMock.IAMClient + var consoleClient *consoleMock.ConsoleClient + // var containerRegistryClient container_registry.ContainerRegistryClient + var commsClient *commsMock.CommsClient + var accountRepo *reposMock.DbRepo[*entities.Account] + var invitationRepo *reposMock.DbRepo[*entities.Invitation] + var k8sYamlClient kubectl.YAMLClient + var k8sExtendedClient *k8sMock.ExtendedK8sClient + + logger, err := logging.New(&logging.Options{Name: "test"}) + if err != nil { + panic(err) + } + + BeforeEach(func() { + authClient = authMock.NewAuthClient() + iamClient = iamMock.NewIAMClient() + consoleClient = consoleMock.NewConsoleClient() + // containerRegistryClient = container_registry.NewContainerRegistryClient() + commsClient = commsMock.NewCommsClient() + accountRepo = reposMock.NewDbRepo[*entities.Account]() + invitationRepo = reposMock.NewDbRepo[*entities.Invitation]() + // k8sYamlClient = kubectl.NewYAMLClient() + k8sExtendedClient = k8sMock.NewExtendedK8sClient() + }) + + getDomain := func() domain.Domain { + return domain.NewDomain( + iamClient, + consoleClient, + // f.containerRegistryClient, + authClient, + commsClient, + k8sYamlClient, + k8sExtendedClient, + + accountRepo, + invitationRepo, + + logger, + ) + } + + When("account already exists", func() { + It("fails", func() { + d := getDomain() + + // iamClient.MockCan = func(ctx context.Context, in *iam.CanIn, opts ...grpc.CallOption) (*iam.CanOut, error) { } + + accountRepo.MockCreate = func(ctx context.Context, data *entities.Account) (*entities.Account, error) { + return nil, errors.Newf("account already exists") + } + + k8sExtendedClient.MockValidateStruct = func(ctx context.Context, obj client.Object) error { + return nil + } + + _, err := d.CreateAccount(domain.UserContext{}, entities.Account{}) + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring("account already exists")) + }) + }) + + When("account does not exist", func() { + Context("but account is not valid", func() { + BeforeEach(func() { + k8sExtendedClient.MockValidateStruct = func(ctx context.Context, obj client.Object) error { + return errors.Newf("invalid account data") + } + }) + + It("fails", func() { + d := getDomain() + + accountRepo.MockCreate = func(ctx context.Context, data *entities.Account) (*entities.Account, error) { + return nil, errors.Newf("account already exists") + } + + _, err := d.CreateAccount(domain.UserContext{}, entities.Account{}) + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring("invalid account data")) + }) + }) + + Context("account is valid", func() { + BeforeEach(func() { + k8sExtendedClient.MockValidateStruct = func(ctx context.Context, obj client.Object) error { + return nil + } + }) + + It("succeeds", func() { + d := getDomain() + + accountRepo.MockCreate = func(ctx context.Context, data *entities.Account) (*entities.Account, error) { + return data, nil + } + + iamClient.MockAddMembership = func(ctx context.Context, in *iam.AddMembershipIn, opts ...grpc.CallOption) (*iam.AddMembershipOut, error) { + return &iam.AddMembershipOut{Result: true}, nil + } + + acc, err := d.CreateAccount(domain.UserContext{ + Context: context.TODO(), + UserId: "sample-userid", + UserName: "sample-username", + UserEmail: "sample-useremail", + }, entities.Account{}) + + Expect(err).To(BeNil()) + + Expect(acc.CreatedBy).To(BeEquivalentTo(common.CreatedOrUpdatedBy{ + UserId: "sample-userid", + UserName: "sample-username", + UserEmail: "sample-useremail", + })) + Expect(acc.LastUpdatedBy).To(BeEquivalentTo(common.CreatedOrUpdatedBy{ + UserId: "sample-userid", + UserName: "sample-username", + UserEmail: "sample-useremail", + })) + }) + }) + }) +}) diff --git a/apps/accounts/internal/domain/commons.go b/apps/accounts/internal/domain/commons.go new file mode 100644 index 000000000..6671c5fed --- /dev/null +++ b/apps/accounts/internal/domain/commons.go @@ -0,0 +1,39 @@ +package domain + +import ( + "context" + iamT "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" +) + +type UserContext struct { + context.Context + UserId repos.ID + UserName string + UserEmail string +} + +func (d *domain) checkAccountAccess(ctx context.Context, accountName string, userId repos.ID, action iamT.Action) error { + co, err := d.iamClient.Can(ctx, &iam.CanIn{ + UserId: string(userId), + ResourceRefs: []string{iamT.NewResourceRef(accountName, iamT.ResourceAccount, accountName)}, + Action: string(action), + }) + + // if err != nil { + // return err + // } + + if err != nil { + d.logger.Errorf(err, "iam.can check for action: ", action) + return errors.Newf("unauthorized to perform action: %s", action) + } + + if !co.Status { + return errors.Newf("unauthorized to perform action: %s", action) + } + + return nil +} diff --git a/apps/accounts/internal/domain/domain.go b/apps/accounts/internal/domain/domain.go new file mode 100644 index 000000000..928512927 --- /dev/null +++ b/apps/accounts/internal/domain/domain.go @@ -0,0 +1,117 @@ +package domain + +import ( + "github.com/kloudlite/api/apps/accounts/internal/entities" + iamT "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/auth" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/comms" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/console" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/container_registry" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" + "github.com/kloudlite/api/pkg/k8s" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/api/pkg/repos" + "go.uber.org/fx" + "golang.org/x/net/context" +) + +type CheckNameAvailabilityOutput struct { + Result bool `json:"result"` + SuggestedNames []string `json:"suggestedNames,omitempty"` +} + +type AccountService interface { + CheckNameAvailability(ctx context.Context, name string) (*CheckNameAvailabilityOutput, error) + + ListAccounts(ctx UserContext) ([]*entities.Account, error) + GetAccount(ctx UserContext, name string) (*entities.Account, error) + + CreateAccount(ctx UserContext, account entities.Account) (*entities.Account, error) + UpdateAccount(ctx UserContext, account entities.Account) (*entities.Account, error) + DeleteAccount(ctx UserContext, name string) (bool, error) + + ResyncAccount(ctx UserContext, name string) error + + ActivateAccount(ctx UserContext, name string) (bool, error) + DeactivateAccount(ctx UserContext, name string) (bool, error) +} + +type InvitationService interface { + InviteMembers(ctx UserContext, accountName string, invitations []*entities.Invitation) ([]*entities.Invitation, error) + ResendInviteEmail(ctx UserContext, accountName string, invitationId repos.ID) (bool, error) + + ListInvitations(ctx UserContext, accountName string) ([]*entities.Invitation, error) + GetInvitation(ctx UserContext, accountName string, invitationId repos.ID) (*entities.Invitation, error) + + ListInvitationsForUser(ctx UserContext, onlyPending bool) ([]*entities.Invitation, error) + + DeleteInvitation(ctx UserContext, accountName string, invitationId repos.ID) (bool, error) + + AcceptInvitation(ctx UserContext, accountName string, inviteToken string) (bool, error) + RejectInvitation(ctx UserContext, accountName string, inviteToken string) (bool, error) +} + +type MembershipService interface { + ListMembershipsForUser(ctx UserContext) ([]*entities.AccountMembership, error) + ListMembershipsForAccount(ctx UserContext, accountName string, role *iamT.Role) ([]*entities.AccountMembership, error) + + GetAccountMembership(ctx UserContext, accountName string) (*entities.AccountMembership, error) + + RemoveAccountMembership(ctx UserContext, accountName string, memberId repos.ID) (bool, error) + UpdateAccountMembership(ctx UserContext, accountName string, memberId repos.ID, role iamT.Role) (bool, error) +} + +type Domain interface { + AccountService + InvitationService + MembershipService +} + +type domain struct { + authClient auth.AuthClient + iamClient iam.IAMClient + consoleClient console.ConsoleClient + containerRegistryClient container_registry.ContainerRegistryClient + commsClient comms.CommsClient + + accountRepo repos.DbRepo[*entities.Account] + invitationRepo repos.DbRepo[*entities.Invitation] + // accountInviteTokenRepo cache.Repo[*entities.Invitation] + + k8sClient k8s.Client + + logger logging.Logger +} + +func NewDomain( + iamCli iam.IAMClient, + consoleClient console.ConsoleClient, + // containerRegistryClient container_registry.ContainerRegistryClient, + authClient auth.AuthClient, + commsClient comms.CommsClient, + + k8sClient k8s.Client, + + accountRepo repos.DbRepo[*entities.Account], + invitationRepo repos.DbRepo[*entities.Invitation], + // accountInviteTokenRepo cache.Repo[*entities.Invitation], + + logger logging.Logger, +) Domain { + return &domain{ + authClient: authClient, + iamClient: iamCli, + consoleClient: consoleClient, + commsClient: commsClient, + + k8sClient: k8sClient, + + accountRepo: accountRepo, + invitationRepo: invitationRepo, + // accountInviteTokenRepo: accountInviteTokenRepo, + + logger: logger, + } +} + +var Module = fx.Module("domain", fx.Provide(NewDomain)) diff --git a/apps/accounts/internal/domain/invitations.go b/apps/accounts/internal/domain/invitations.go new file mode 100644 index 000000000..0fc01fa5f --- /dev/null +++ b/apps/accounts/internal/domain/invitations.go @@ -0,0 +1,211 @@ +package domain + +import ( + "context" + "github.com/kloudlite/api/apps/accounts/internal/entities" + fc "github.com/kloudlite/api/apps/accounts/internal/entities/field-constants" + iamT "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/auth" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/comms" + "github.com/kloudlite/api/pkg/errors" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/repos" + nanoid "github.com/matoous/go-nanoid/v2" +) + +func (d *domain) findInvitation(ctx context.Context, accountName string, invitationId repos.ID) (*entities.Invitation, error) { + inv, err := d.invitationRepo.FindOne(ctx, repos.Filter{ + fields.AccountName: accountName, + fields.Id: invitationId, + }) + if err != nil { + return nil, errors.NewE(err) + } + + if inv == nil { + return nil, errors.Newf("no invitation found with id=%s", invitationId) + } + + return inv, nil +} + +func (d *domain) findInvitationByInviteToken(ctx context.Context, accountName string, userEmail string, inviteToken string) (*entities.Invitation, error) { + inv, err := d.invitationRepo.FindOne(ctx, repos.Filter{ + fc.InvitationUserEmail: userEmail, + fields.AccountName: accountName, + fc.InvitationInviteToken: inviteToken, + }) + if err != nil { + return nil, errors.NewE(err) + } + + if inv == nil { + return nil, errors.Newf("no invitation found, with given invite token") + } + + return inv, nil +} + +func (d *domain) InviteMembers(ctx UserContext, accountName string, invitations []*entities.Invitation) ([]*entities.Invitation, error) { + if err := d.checkAccountAccess(ctx, accountName, ctx.UserId, iamT.InviteAccountMember); err != nil { + return nil, errors.NewE(err) + } + + _, err := d.findAccount(ctx, accountName) + if err != nil { + return nil, errors.NewE(err) + } + + results := make([]*entities.Invitation, len(invitations)) + + for i := range invitations { + invitations[i].InviteToken, err = nanoid.New(64) + if err != nil { + return nil, errors.NewEf(err, "failed to generate invite token") + } + + user, err := d.authClient.GetUser(ctx, &auth.GetUserIn{ + UserId: string(ctx.UserId), + }) + if err != nil { + return nil, errors.NewE(err) + } + + invitations[i].InvitedBy = user.Name + invitations[i].AccountName = accountName + + inv, err := d.invitationRepo.Create(ctx, invitations[i]) + if err != nil { + return nil, errors.NewEf(err, "failed to create invitation") + } + + if _, err := d.commsClient.SendAccountMemberInviteEmail(ctx, &comms.AccountMemberInviteEmailInput{ + AccountName: inv.AccountName, + InvitationToken: inv.InviteToken, + InvitedBy: inv.InvitedBy, + Email: inv.UserEmail, + // TODO: verify user name, if it is not empty, then use it, otherwise use email + Name: inv.UserName, + }); err != nil { + return nil, errors.NewE(err) + } + + results[i] = inv + } + + return results, nil +} + +func (d *domain) ResendInviteEmail(ctx UserContext, accountName string, invitationId repos.ID) (bool, error) { + inv, err := d.findInvitation(ctx, accountName, invitationId) + if err != nil { + return false, errors.NewE(err) + } + + action := iamT.InviteAccountMember + if inv.UserRole == iamT.RoleAccountAdmin { + action = iamT.InviteAccountAdmin + } + + if err := d.checkAccountAccess(ctx, accountName, ctx.UserId, action); err != nil { + return false, errors.NewE(err) + } + + if _, err := d.commsClient.SendAccountMemberInviteEmail(ctx, &comms.AccountMemberInviteEmailInput{ + AccountName: accountName, + InvitationToken: inv.InviteToken, + InvitedBy: inv.InvitedBy, + Email: inv.UserEmail, + Name: accountName, + }); err != nil { + return false, errors.NewE(err) + } + + return true, nil +} + +func (d *domain) ListInvitations(ctx UserContext, accountName string) ([]*entities.Invitation, error) { + if err := d.checkAccountAccess(ctx, accountName, ctx.UserId, iamT.ListAccountInvitations); err != nil { + return nil, errors.NewE(err) + } + + return d.invitationRepo.Find(ctx, repos.Query{Filter: repos.Filter{"accountName": accountName}}) +} + +func (d *domain) ListInvitationsForUser(ctx UserContext, onlyPending bool) ([]*entities.Invitation, error) { + var filters repos.Filter = map[string]any{ + fc.InvitationUserEmail: ctx.UserEmail, + } + + if onlyPending { + filters["accepted"] = nil + filters["rejected"] = nil + } + + return d.invitationRepo.Find(ctx, repos.Query{Filter: filters}) +} + +func (d *domain) GetInvitation(ctx UserContext, accountName string, invitationId repos.ID) (*entities.Invitation, error) { + if err := d.checkAccountAccess(ctx, accountName, ctx.UserId, iamT.ListAccountInvitations); err != nil { + return nil, errors.NewE(err) + } + + return d.invitationRepo.FindById(ctx, invitationId) +} + +func (d *domain) DeleteInvitation(ctx UserContext, accountName string, invitationId repos.ID) (bool, error) { + if err := d.checkAccountAccess(ctx, accountName, ctx.UserId, iamT.DeleteAccountInvitation); err != nil { + return false, errors.NewE(err) + } + + inv, err := d.findInvitation(ctx, accountName, invitationId) + if err != nil { + return false, errors.NewE(err) + } + + if err := d.invitationRepo.DeleteById(ctx, inv.Id); err != nil { + return false, errors.NewE(err) + } + return true, nil +} + +func (d *domain) AcceptInvitation(ctx UserContext, accountName string, inviteToken string) (bool, error) { + inv, err := d.findInvitationByInviteToken(ctx, accountName, ctx.UserEmail, inviteToken) + if err != nil { + return false, errors.NewE(err) + } + + if inv.Accepted != nil || inv.Rejected != nil { + return false, errors.Newf("invitation already accepted or rejected, won't process further") + } + + inv.Accepted = fn.New(true) + if _, err := d.invitationRepo.UpdateById(ctx, inv.Id, inv); err != nil { + return false, errors.NewE(err) + } + + if err := d.addMembership(ctx, accountName, ctx.UserId, inv.UserRole); err != nil { + return false, errors.NewE(err) + } + + return true, nil +} + +func (d *domain) RejectInvitation(ctx UserContext, accountName string, inviteToken string) (bool, error) { + inv, err := d.findInvitationByInviteToken(ctx, accountName, ctx.UserEmail, inviteToken) + if err != nil { + return false, errors.NewE(err) + } + + if inv.Accepted != nil || inv.Rejected != nil { + return false, errors.Newf("invitation already accepted or rejected, won't process further") + } + + inv.Rejected = fn.New(true) + if _, err := d.invitationRepo.UpdateById(ctx, inv.Id, inv); err != nil { + return false, errors.NewE(err) + } + + return true, nil +} diff --git a/apps/accounts/internal/domain/memberships.go b/apps/accounts/internal/domain/memberships.go new file mode 100644 index 000000000..cbc0b0ba2 --- /dev/null +++ b/apps/accounts/internal/domain/memberships.go @@ -0,0 +1,142 @@ +package domain + +import ( + "context" + "github.com/kloudlite/api/apps/accounts/internal/entities" + "strings" + + iamT "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" +) + +func (d *domain) addMembership(ctx context.Context, accountName string, userId repos.ID, role iamT.Role) error { + if _, err := d.iamClient.AddMembership(ctx, &iam.AddMembershipIn{ + UserId: string(userId), + ResourceType: string(iamT.ResourceAccount), + ResourceRef: iamT.NewResourceRef(accountName, iamT.ResourceAccount, accountName), + Role: string(role), + }); err != nil { + return errors.NewE(err) + } + + return nil +} + +func (d *domain) RemoveAccountMembership(ctx UserContext, accountName string, memberId repos.ID) (bool, error) { + if err := d.checkAccountAccess(ctx, accountName, ctx.UserId, iamT.RemoveAccountMembership); err != nil { + return false, errors.NewE(err) + } + + account, err := d.findAccount(ctx, accountName) + if err != nil { + return false, errors.NewE(err) + } + + if (account.IsActive != nil && !*account.IsActive) || account.IsMarkedForDeletion() { + return false, errors.Newf("account %q is not active, or marked for deletion, aborting request", accountName) + } + + out, err := d.iamClient.RemoveMembership(ctx, &iam.RemoveMembershipIn{ + UserId: string(memberId), + ResourceRef: iamT.NewResourceRef(accountName, iamT.ResourceAccount, accountName), + }) + if err != nil { + return false, errors.NewE(err) + } + + return out.Result, nil +} + +func (d *domain) UpdateAccountMembership(ctx UserContext, accountName string, memberId repos.ID, role iamT.Role) (bool, error) { + if err := d.checkAccountAccess(ctx, accountName, ctx.UserId, iamT.UpdateAccountMembership); err != nil { + return false, errors.NewE(err) + } + + account, err := d.findAccount(ctx, accountName) + if err != nil { + return false, errors.NewE(err) + } + + if (account.IsActive != nil && !*account.IsActive) || account.IsMarkedForDeletion() { + return false, errors.Newf("account %q is not active, or marked for deletion, aborting request", accountName) + } + + out, err := d.iamClient.UpdateMembership(ctx, &iam.UpdateMembershipIn{ + UserId: string(memberId), + ResourceType: string(iamT.ResourceAccount), + ResourceRef: iamT.NewResourceRef(accountName, iamT.ResourceAccount, accountName), + Role: string(role), + }) + + if err != nil { + return false, errors.NewE(err) + } + + return out.Result, nil +} + +func (d *domain) ListMembershipsForAccount(ctx UserContext, accountName string, role *iamT.Role) ([]*entities.AccountMembership, error) { + if err := d.checkAccountAccess(ctx, accountName, ctx.UserId, iamT.ListMembershipsForAccount); err != nil { + return nil, errors.NewE(err) + } + + out, err := d.iamClient.ListMembershipsForResource(ctx, &iam.MembershipsForResourceIn{ + ResourceType: string(iamT.ResourceAccount), + ResourceRef: iamT.NewResourceRef(accountName, iamT.ResourceAccount, accountName), + }) + if err != nil { + return nil, errors.NewE(err) + } + + memberships := make([]*entities.AccountMembership, len(out.RoleBindings)) + for i := range out.RoleBindings { + memberships[i] = &entities.AccountMembership{ + AccountName: accountName, + UserId: repos.ID(out.RoleBindings[i].UserId), + Role: iamT.Role(out.RoleBindings[i].Role), + } + } + + return memberships, nil +} + +func (d *domain) ListMembershipsForUser(ctx UserContext) ([]*entities.AccountMembership, error) { + out, err := d.iamClient.ListMembershipsForUser(ctx, &iam.MembershipsForUserIn{ + UserId: string(ctx.UserId), + ResourceType: string(iamT.ResourceAccount), + }) + if err != nil { + return nil, errors.NewE(err) + } + + memberships := make([]*entities.AccountMembership, len(out.RoleBindings)) + for i := range out.RoleBindings { + memberships[i] = &entities.AccountMembership{ + AccountName: strings.Split(out.RoleBindings[i].ResourceRef, "/")[0], + UserId: repos.ID(out.RoleBindings[i].UserId), + Role: iamT.Role(out.RoleBindings[i].Role), + } + } + + return memberships, nil +} + +func (d *domain) GetAccountMembership(ctx UserContext, accountName string) (*entities.AccountMembership, error) { + membership, err := d.iamClient.GetMembership( + ctx, &iam.GetMembershipIn{ + UserId: string(ctx.UserId), + ResourceType: string(iamT.ResourceAccount), + ResourceRef: iamT.NewResourceRef(accountName, iamT.ResourceAccount, accountName), + }, + ) + if err != nil { + return nil, errors.NewE(err) + } + return &entities.AccountMembership{ + AccountName: accountName, + UserId: repos.ID(membership.UserId), + Role: iamT.Role(membership.Role), + }, nil +} diff --git a/apps/accounts/internal/domain/names.go b/apps/accounts/internal/domain/names.go new file mode 100644 index 000000000..b250c497c --- /dev/null +++ b/apps/accounts/internal/domain/names.go @@ -0,0 +1,28 @@ +package domain + +import ( + "context" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/errors" + + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/repos" +) + +func (d *domain) CheckNameAvailability(ctx context.Context, name string) (*CheckNameAvailabilityOutput, error) { + if fn.IsValidK8sResourceName(name) { + p, err := d.accountRepo.FindOne(ctx, repos.Filter{ + fields.MetadataName: name, + }) + if err != nil { + return &CheckNameAvailabilityOutput{Result: false}, errors.NewE(err) + } + if p == nil { + return &CheckNameAvailabilityOutput{Result: true}, nil + } + } + return &CheckNameAvailabilityOutput{ + Result: false, + SuggestedNames: fn.GenValidK8sResourceNames(name, 3), + }, nil +} diff --git a/apps/accounts/internal/domain/suite_test.go b/apps/accounts/internal/domain/suite_test.go new file mode 100644 index 000000000..4bacf1ddb --- /dev/null +++ b/apps/accounts/internal/domain/suite_test.go @@ -0,0 +1,12 @@ +package domain_test + +import ( + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + "testing" +) + +func TestDomain(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "Accounts Domain Suite") +} diff --git a/apps/accounts/internal/entities/account.go b/apps/accounts/internal/entities/account.go new file mode 100644 index 000000000..f9c6dda06 --- /dev/null +++ b/apps/accounts/internal/entities/account.go @@ -0,0 +1,40 @@ +package entities + +import ( + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/repos" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type Account struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + metav1.ObjectMeta `json:"metadata,omitempty"` + TargetNamespace string `json:"targetNamespace,omitempty" graphql:"noinput"` + + common.ResourceMetadata `json:",inline"` + + Logo *string `json:"logo"` + IsActive *bool `json:"isActive,omitempty"` + ContactEmail string `json:"contactEmail,omitempty"` +} + +var AccountIndices = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: "id", Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: "metadata.name", Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: "targetNamespace", Value: repos.IndexAsc}, + }, + Unique: true, + }, +} diff --git a/apps/accounts/internal/entities/field-constants/gen.go b/apps/accounts/internal/entities/field-constants/gen.go new file mode 100644 index 000000000..3bfda9046 --- /dev/null +++ b/apps/accounts/internal/entities/field-constants/gen.go @@ -0,0 +1,3 @@ +package field_constants + +//go:generate go run github.com/kloudlite/api/cmd/struct-json-path --pkg github.com/kloudlite/api/apps/accounts/internal/entities --common-path "metadata" --common-path "apiVersion" --common-path "kind" --common-path "status" --common-path "syncStatus" --common-path "lastUpdatedBy" --common-path "createdBy" --common-path "displayName" --common-path "creationTime" --common-path "updateTime" --common-path "id" --common-path "recordVersion" --common-path "accountName" --common-path "clusterName" --common-path "markedForDeletion" --out-file ./generated_constants.go --banner "package field_constants" --ignore-nesting "time.Time" --ignore-nesting "k8s.io/apimachinery/pkg/apis/meta/v1.Time" diff --git a/apps/accounts/internal/entities/field-constants/generated_constants.go b/apps/accounts/internal/entities/field-constants/generated_constants.go new file mode 100644 index 000000000..7a2db14be --- /dev/null +++ b/apps/accounts/internal/entities/field-constants/generated_constants.go @@ -0,0 +1,28 @@ +// DO NOT EDIT. generated by "github.com/kloudlite/api/cmd/struct-json-path" + +package field_constants + +// constant vars generated for struct Account +const ( + AccountContactEmail = "contactEmail" + AccountIsActive = "isActive" + AccountLogo = "logo" + AccountTargetNamespace = "targetNamespace" +) + +// constant vars generated for struct AccountMembership +const ( + AccountMembershipRole = "role" + AccountMembershipUserId = "userId" +) + +// constant vars generated for struct Invitation +const ( + InvitationAccepted = "accepted" + InvitationInviteToken = "inviteToken" + InvitationInvitedBy = "invitedBy" + InvitationRejected = "rejected" + InvitationUserEmail = "userEmail" + InvitationUserName = "userName" + InvitationUserRole = "userRole" +) diff --git a/apps/accounts/internal/entities/invitations.go b/apps/accounts/internal/entities/invitations.go new file mode 100644 index 000000000..e53d8c7b1 --- /dev/null +++ b/apps/accounts/internal/entities/invitations.go @@ -0,0 +1,41 @@ +package entities + +import ( + iamT "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/pkg/repos" +) + +type Invitation struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + InvitedBy string `json:"invitedBy" graphql:"noinput"` + InviteToken string `json:"inviteToken" graphql:"noinput"` + UserEmail string `json:"userEmail,omitempty"` + UserName string `json:"userName,omitempty"` + UserRole iamT.Role `json:"userRole"` + AccountName string `json:"accountName" graphql:"noinput"` + Accepted *bool `json:"accepted,omitempty" graphql:"noinput"` + Rejected *bool `json:"rejected,omitempty" graphql:"noinput"` +} + +var InvitationIndices = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: "id", Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: "inviteToken", Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: "accountName", Value: repos.IndexAsc}, + {Key: "userEmail", Value: repos.IndexAsc}, + {Key: "userRole", Value: repos.IndexAsc}, + }, + Unique: true, + }, +} diff --git a/apps/accounts/internal/entities/membership.go b/apps/accounts/internal/entities/membership.go new file mode 100644 index 000000000..c67d8bd93 --- /dev/null +++ b/apps/accounts/internal/entities/membership.go @@ -0,0 +1,14 @@ +package entities + +import ( + iamT "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/pkg/repos" +) + +// Used for the following GraphQL schema: + +type AccountMembership struct { + AccountName string `json:"accountName"` + UserId repos.ID `json:"userId"` + Role iamT.Role `json:"role"` +} diff --git a/apps/accounts/internal/env/env.go b/apps/accounts/internal/env/env.go new file mode 100644 index 000000000..71f1bcfe1 --- /dev/null +++ b/apps/accounts/internal/env/env.go @@ -0,0 +1,35 @@ +package env + +import ( + "github.com/codingconcepts/env" + "github.com/kloudlite/api/pkg/errors" +) + +type Env struct { + HttpPort uint16 `env:"HTTP_PORT" required:"true"` + HttpCors string `env:"CORS_ORIGINS" required:"false"` + GrpcPort uint16 `env:"GRPC_PORT" required:"true"` + + DBName string `env:"MONGO_DB_NAME" required:"true"` + DBUrl string `env:"MONGO_URI" required:"true"` + + CookieDomain string `env:"COOKIE_DOMAIN" required:"true"` + + IamGrpcAddr string `env:"IAM_GRPC_ADDR" required:"true"` + CommsGrpcAddr string `env:"COMMS_GRPC_ADDR" required:"true"` + ContainerRegistryGrpcAddr string `env:"CONTAINER_REGISTRY_GRPC_ADDR" required:"true"` + ConsoleGrpcAddr string `env:"CONSOLE_GRPC_ADDR" required:"true"` + AuthGrpcAddr string `env:"AUTH_GRPC_ADDR" required:"true"` + SessionKVBucket string `env:"SESSION_KV_BUCKET" required:"true"` + NatsURL string `env:"NATS_URL" required:"true"` + IsDev bool + KubernetesApiProxy string `env:"KUBERNETES_API_PROXY"` +} + +func LoadEnv() (*Env, error) { + var ev Env + if err := env.Set(&ev); err != nil { + return nil, errors.NewE(err) + } + return &ev, nil +} diff --git a/apps/accounts/internal/framework/framework.go b/apps/accounts/internal/framework/framework.go new file mode 100644 index 000000000..a3181ca81 --- /dev/null +++ b/apps/accounts/internal/framework/framework.go @@ -0,0 +1,154 @@ +package framework + +import ( + "context" + "fmt" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/nats" + "time" + + "github.com/kloudlite/api/pkg/kv" + "github.com/kloudlite/api/pkg/repos" + + "github.com/kloudlite/api/pkg/logging" + + "github.com/kloudlite/api/apps/accounts/internal/app" + "github.com/kloudlite/api/apps/accounts/internal/env" + "github.com/kloudlite/api/pkg/grpc" + httpServer "github.com/kloudlite/api/pkg/http-server" + "go.uber.org/fx" +) + +type fm struct { + env *env.Env +} + +func (f *fm) GetMongoConfig() (url string, dbName string) { + return f.env.DBUrl, f.env.DBName +} + +var Module = fx.Module("framework", + fx.Provide(func(ev *env.Env) *fm { + return &fm{env: ev} + }), + + fx.Provide(func(ev *env.Env, logger logging.Logger) (*nats.JetstreamClient, error) { + name := "accounts:jetstream-client" + nc, err := nats.NewClient(ev.NatsURL, nats.ClientOpts{ + Name: name, + Logger: logger, + }) + if err != nil { + return nil, errors.NewE(err) + } + + return nats.NewJetstreamClient(nc) + }), + + fx.Provide( + func(ev *env.Env, jc *nats.JetstreamClient) (kv.Repo[*common.AuthSession], error) { + cxt := context.TODO() + return kv.NewNatsKVRepo[*common.AuthSession](cxt, ev.SessionKVBucket, jc) + }, + ), + repos.NewMongoClientFx[*fm](), + + fx.Provide(func(ev *env.Env) (app.AuthClient, error) { + return grpc.NewGrpcClient(ev.AuthGrpcAddr) + }), + + fx.Provide(func(ev *env.Env) (app.IAMClient, error) { + return grpc.NewGrpcClient(ev.IamGrpcAddr) + }), + + fx.Provide(func(ev *env.Env) (app.CommsClient, error) { + return grpc.NewGrpcClient(ev.CommsGrpcAddr) + }), + + fx.Provide(func(ev *env.Env) (app.ContainerRegistryClient, error) { + return grpc.NewGrpcClient(ev.ContainerRegistryGrpcAddr) + }), + + fx.Provide(func(ev *env.Env) (app.ConsoleClient, error) { + return grpc.NewGrpcClient(ev.ConsoleGrpcAddr) + }), + + app.Module, + + fx.Invoke(func(c1 app.AuthClient, c2 app.IAMClient, c3 app.CommsClient, c4 app.ContainerRegistryClient, c5 app.ConsoleClient, lf fx.Lifecycle) { + lf.Append(fx.Hook{ + OnStop: func(context.Context) error { + if err := c1.Close(); err != nil { + return errors.NewE(err) + } + if err := c2.Close(); err != nil { + return errors.NewE(err) + } + if err := c3.Close(); err != nil { + return errors.NewE(err) + } + if err := c4.Close(); err != nil { + return errors.NewE(err) + } + if err := c5.Close(); err != nil { + return errors.NewE(err) + } + return nil + }, + }) + }), + + fx.Provide(func(logger logging.Logger) (app.AccountsGrpcServer, error) { + return grpc.NewGrpcServer(grpc.ServerOpts{ + Logger: logger.WithKV("component", "grpc-server"), + }) + }), + + fx.Invoke(func(lf fx.Lifecycle, server app.AccountsGrpcServer, ev *env.Env, logger logging.Logger) { + lf.Append(fx.Hook{ + OnStart: func(ctx context.Context) error { + errCh := make(chan error, 1) + + tctx, cf := context.WithTimeout(ctx, 2*time.Second) + defer cf() + + go func() { + err := server.Listen(fmt.Sprintf(":%d", ev.GrpcPort)) + if err != nil { + errCh <- err + logger.Errorf(err, "failed to start grpc server") + } + }() + + select { + case <-tctx.Done(): + case err := <-errCh: + return err + } + + return nil + }, + OnStop: func(context.Context) error { + server.Stop() + return nil + }, + }) + }), + + fx.Provide(func(logger logging.Logger, e *env.Env) httpServer.Server { + corsOrigins := "https://studio.apollographql.com" + return httpServer.NewServer(httpServer.ServerArgs{Logger: logger, CorsAllowOrigins: &corsOrigins, IsDev: e.IsDev}) + }), + + fx.Invoke(func(lf fx.Lifecycle, server httpServer.Server, ev *env.Env) { + lf.Append(fx.Hook{ + OnStart: func(context.Context) error { + return server.Listen(fmt.Sprintf(":%d", ev.HttpPort)) + }, + OnStop: func(context.Context) error { + return server.Close() + }, + }) + }), +) diff --git a/apps/accounts/main.go b/apps/accounts/main.go new file mode 100644 index 000000000..e41888f96 --- /dev/null +++ b/apps/accounts/main.go @@ -0,0 +1,79 @@ +package main + +import ( + "context" + "flag" + "github.com/kloudlite/api/pkg/errors" + "os" + "time" + + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/k8s" + "github.com/kloudlite/api/pkg/logging" + "go.uber.org/fx" + "k8s.io/client-go/rest" + + "github.com/kloudlite/api/apps/accounts/internal/env" + "github.com/kloudlite/api/apps/accounts/internal/framework" +) + +func main() { + var isDev bool + flag.BoolVar(&isDev, "dev", false, "--dev") + flag.Parse() + + logger, err := logging.New(&logging.Options{Name: "accounts", Dev: isDev}) + if err != nil { + panic(err) + } + + app := fx.New( + fx.NopLogger, + + fx.Provide(func() logging.Logger { + return logger + }), + + fx.Provide(func() (*env.Env, error) { + if e, err := env.LoadEnv(); err != nil { + return nil, errors.NewE(err) + } else { + e.IsDev = isDev + return e, nil + } + }), + + fx.Provide(func(e *env.Env) (*rest.Config, error) { + if e.KubernetesApiProxy != "" { + return &rest.Config{ + Host: e.KubernetesApiProxy, + }, nil + } + + return k8s.RestInclusterConfig() + }), + + fx.Provide(func(cfg *rest.Config) (k8s.Client, error) { + return k8s.NewClient(cfg, nil) + }), + + framework.Module, + ) + + ctx, cancelFunc := func() (context.Context, context.CancelFunc) { + if isDev { + return context.WithTimeout(context.TODO(), 20*time.Second) + } + return context.WithTimeout(context.TODO(), 5*time.Second) + }() + defer cancelFunc() + + if err := app.Start(ctx); err != nil { + logger.Errorf(err, "error starting accounts app") + logger.Infof("EXITING as errors encountered during startup") + os.Exit(1) + } + + common.PrintReadyBanner() + <-app.Done() +} diff --git a/apps/ad-webhook/Dockerfile b/apps/ad-webhook/Dockerfile deleted file mode 100644 index 6937e2ece..000000000 --- a/apps/ad-webhook/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -FROM golang:1.18.3-alpine3.16 AS base -USER 1001 -ENV GOPATH=/tmp/go -ENV GOCACHE=/tmp/go-cache -WORKDIR /tmp/app -COPY . . -RUN go mod download -x -ARG APP -RUN mkdir -p ./apps/$APP -WORKDIR /tmp/app/apps/$APP -COPY --chown=1001 ./ ./ -RUN CGO_ENABLED=0 go build -tags musl -o /tmp/bin/$APP ./main.go -RUN chmod +x /tmp/bin/$APP - -#FROM gcr.io/distroless/static-debian11 -FROM alpine -ARG APP -RUN adduser -D -h /home/nonroot nonroot -USER nonroot -WORKDIR /tmp/app -COPY --chown=nonroot --from=base /tmp/bin/$APP ./$APP -CMD ["./admission-webhook"] diff --git a/apps/ad-webhook/Taskfile.yml b/apps/ad-webhook/Taskfile.yml deleted file mode 100644 index 23d82310e..000000000 --- a/apps/ad-webhook/Taskfile.yml +++ /dev/null @@ -1,23 +0,0 @@ -version: '3' - -dotenv: [] - -tasks: - run: - cmds: - - nodemon -e go --signal SIGKILL --exec 'go run -tags dynamic main.go --dev || exit 1' - - docker-build: - vars: -# IMAGE: registry.kloudlite.io/kloudlite/admission-webhook:v2 - APP: admission-webhook - IMAGE: registry.kloudlite.io/kloudlite/{{.EnvName}}/{{.APP}}:{{.Tag}} - preconditions: - - sh: '[[ -n "{{.Tag}}" ]]' - msg: 'var Tag must have a value' - - - sh: '[[ "{{.EnvName}}" == "development" ]] || [[ "{{.EnvName}}" == "staging" ]] || [[ "{{.EnvName}}" == "production" ]]' - msg: 'var EnvName must have one of [development, staging, production] as its value' - cmds: - - docker buildx build -f ./Dockerfile -t {{.IMAGE}} . --build-arg APP={{.APP}} --platform linux/amd64 --build-context project-root=../.. - - docker push {{.IMAGE}} diff --git a/apps/ad-webhook/cr/admission-webhook.yml b/apps/ad-webhook/cr/admission-webhook.yml deleted file mode 100644 index 75715b1d0..000000000 --- a/apps/ad-webhook/cr/admission-webhook.yml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: admissionregistration.k8s.io/v1beta1 -kind: MutatingWebhookConfiguration -metadata: - name: add-node-selector -webhooks: -- name: add-node-selector.kl - rules: - - apiGroups: [""] - apiVersions: ["v1"] - resources: ["pods"] - operations: ["CREATE"] - failurePolicy: Fail - clientConfig: - service: - name: add-node-selector - namespace: kube-system - path: "/add-node-selector" - # caBundle: diff --git a/apps/ad-webhook/cr/deploy.yml b/apps/ad-webhook/cr/deploy.yml deleted file mode 100644 index 9d66e124d..000000000 --- a/apps/ad-webhook/cr/deploy.yml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: admission-webhook - namespace: kube-system -spec: - selector: - matchLabels: - app: add-node-selector - template: - metadata: - creationTimestamp: null - labels: - app: add-node-selector - spec: - containers: - - image: registry.kloudlite.io/kloudlite/development/admission-webhook:v1.0.5 - imagePullPolicy: Always - name: main - resources: - limits: - cpu: 50m - memory: 50Mi - requests: - cpu: 10m - memory: 10Mi diff --git a/apps/ad-webhook/cr/service.yml b/apps/ad-webhook/cr/service.yml deleted file mode 100644 index 40cf7490c..000000000 --- a/apps/ad-webhook/cr/service.yml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: add-node-selector - namespace: kube-system -spec: - selector: - app: add-node-selector - ports: - - name: webhook - port: 443 - targetPort: 8443 diff --git a/apps/ad-webhook/go.mod b/apps/ad-webhook/go.mod deleted file mode 100644 index 41096ce5c..000000000 --- a/apps/ad-webhook/go.mod +++ /dev/null @@ -1,27 +0,0 @@ -module github.com/kloudlite/admission-webhook - -go 1.20 - -require ( - k8s.io/api v0.26.1 - k8s.io/apimachinery v0.26.1 - k8s.io/klog v1.0.0 -) - -require ( - github.com/go-logr/logr v1.2.3 // indirect - github.com/gogo/protobuf v1.3.2 // indirect - github.com/google/gofuzz v1.1.0 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect - golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 // indirect - golang.org/x/text v0.5.0 // indirect - gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect - k8s.io/klog/v2 v2.80.1 // indirect - k8s.io/utils v0.0.0-20221107191617-1a15be271d1d // indirect - sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect -) diff --git a/apps/ad-webhook/go.sum b/apps/ad-webhook/go.sum deleted file mode 100644 index d8ae0561d..000000000 --- a/apps/ad-webhook/go.sum +++ /dev/null @@ -1,85 +0,0 @@ -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= -github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 h1:Frnccbp+ok2GkUS2tC84yAq/U9Vg+0sIO7aRL3T4Xnc= -golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= -golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -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/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= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= -gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= -gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -k8s.io/api v0.26.1 h1:f+SWYiPd/GsiWwVRz+NbFyCgvv75Pk9NK6dlkZgpCRQ= -k8s.io/api v0.26.1/go.mod h1:xd/GBNgR0f707+ATNyPmQ1oyKSgndzXij81FzWGsejg= -k8s.io/apimachinery v0.26.1 h1:8EZ/eGJL+hY/MYCNwhmDzVqq2lPl3N3Bo8rvweJwXUQ= -k8s.io/apimachinery v0.26.1/go.mod h1:tnPmbONNJ7ByJNz9+n9kMjNP8ON+1qoAIIC70lztu74= -k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= -k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= -k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= -k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/utils v0.0.0-20221107191617-1a15be271d1d h1:0Smp/HP1OH4Rvhe+4B8nWGERtlqAGSftbSbbmm45oFs= -k8s.io/utils v0.0.0-20221107191617-1a15be271d1d/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k= -sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/apps/ad-webhook/main.go b/apps/ad-webhook/main.go deleted file mode 100644 index 367aa6d8f..000000000 --- a/apps/ad-webhook/main.go +++ /dev/null @@ -1,115 +0,0 @@ -package main - -import ( - "encoding/json" - "net/http" - "strings" - - admissionv1 "k8s.io/api/admission/v1" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/serializer" - "k8s.io/klog" -) - -var ( - scheme = runtime.NewScheme() - codecs = serializer.NewCodecFactory(scheme) -) - -func init() { - _ = corev1.AddToScheme(scheme) - _ = admissionv1.AddToScheme(scheme) -} - -func main() { - http.HandleFunc("/add-node-selector", func(w http.ResponseWriter, r *http.Request) { - contentType := r.Header.Get("Content-Type") - if !strings.Contains(contentType, "application/json") { - klog.Errorf("unexpected content type: %s", contentType) - http.Error(w, "unexpected content type", http.StatusBadRequest) - return - } - - req := admissionv1.AdmissionReview{} - if err := json.NewDecoder(r.Body).Decode(&req); err != nil { - klog.Errorf("failed to decode request body: %v", err) - http.Error(w, "failed to decode request body", http.StatusBadRequest) - return - } - - resp := admit(&req) - if resp != nil { - klog.Infof("sending response: %s", resp) - if err := json.NewEncoder(w).Encode(resp); err != nil { - klog.Errorf("failed to encode response: %v", err) - http.Error(w, "failed to encode response", http.StatusInternalServerError) - } - return - } - - http.Error(w, "no response", http.StatusNotFound) - }) - - server := &http.Server{ - Addr: ":8443", - } - - klog.Infof("listening on %s", server.Addr) - - if err := server.ListenAndServe(); err != nil { - klog.Fatalf("failed to serve: %v", err) - } -} - -func admit(req *admissionv1.AdmissionReview) *admissionv1.AdmissionResponse { - pod := &corev1.Pod{} - if err := json.Unmarshal(req.Request.Object.Raw, pod); err != nil { - klog.Errorf("failed to unmarshal Pod: %v", err) - return toAdmissionResponse(err) - } - - pvcFound := false - for _, volume := range pod.Spec.Volumes { - if volume.VolumeSource.PersistentVolumeClaim != nil { - pvcFound = true - break - } - } - - if !pvcFound { - return nil - } - - if pod.Spec.NodeSelector == nil { - pod.Spec.NodeSelector = map[string]string{} - } - - pod.Spec.NodeSelector["kloudlite.io/stateful"] = "true" - pod.Spec.PriorityClassName = "stateful" - - marshaledPod, err := json.Marshal(pod) - if err != nil { - klog.Errorf("failed to marshal Pod: %v", err) - return toAdmissionResponse(err) - } - - return &admissionv1.AdmissionResponse{ - UID: req.Request.UID, - Allowed: true, - Patch: marshaledPod, - PatchType: func() *admissionv1.PatchType { - pt := admissionv1.PatchTypeJSONPatch - return &pt - }(), - } -} - -func toAdmissionResponse(err error) *admissionv1.AdmissionResponse { - return &admissionv1.AdmissionResponse{ - Result: &metav1.Status{ - Message: err.Error(), - }, - } -} diff --git a/apps/auth/Containerfile.local b/apps/auth/Containerfile.local new file mode 100644 index 000000000..4a238382c --- /dev/null +++ b/apps/auth/Containerfile.local @@ -0,0 +1,6 @@ +#syntax=docker/dockerfile:1 +FROM gcr.io/distroless/static-debian11:nonroot +WORKDIR /app +ARG APP +COPY --from=builder --chown=1001 $APP ./auth +ENTRYPOINT ["./auth"] diff --git a/apps/auth/Dockerfile b/apps/auth/Dockerfile index 6c95152f4..4da1f5202 100644 --- a/apps/auth/Dockerfile +++ b/apps/auth/Dockerfile @@ -23,8 +23,7 @@ ENV CGO_ENABLED=0 RUN GOOS=linux GOARCH=amd64 go build -tags musl -o /tmp/bin/$APP ./main.go RUN chmod +x /tmp/bin/$APP -#FROM gcr.io/distroless/static:nonroot -FROM golang:1.18.3-alpine3.16 +FROM gcr.io/distroless/static:nonroot USER 1001:1001 ARG APP COPY --from=base /tmp/bin/$APP /auth diff --git a/apps/auth/Taskfile.yml b/apps/auth/Taskfile.yml index 522d80241..92185c879 100644 --- a/apps/auth/Taskfile.yml +++ b/apps/auth/Taskfile.yml @@ -2,10 +2,14 @@ version: '3' dotenv: [".secrets/oauth.env", ".secrets/env"] +vars: + ImagePrefix: "ghcr.io/kloudlite/api" + tasks: run: cmds: - - nodemon -e go --signal SIGKILL --exec 'go run -tags dynamic main.go --dev || exit 1' + - go run main.go --dev + gql: sources: - graph/schema.graphqls @@ -13,55 +17,36 @@ tasks: dir: internal/app cmds: - go run github.com/99designs/gqlgen generate + - gofmt -w -d -r '"errors" -> "github.com/kloudlite/api/pkg/errors"' graph/*.resolvers.go - docker-build: + + build: + env: + CGO_ENABLED: 0 + GOOS: linux + GOARCH: amd64 vars: -# IMAGE: registry.kloudlite.io/kloudlite/auth:v2 - APP: auth - IMAGE: registry.kloudlite.io/kloudlite/{{.EnvName}}/{{.APP}}-api:{{.Tag}} + BuiltAt: + sh: date | sed 's/\s/_/g' preconditions: - - sh: '[[ -n "{{.Tag}}" ]]' - msg: 'var Tag must have a value' - - - sh: '[[ "{{.EnvName}}" == "development" ]] || [[ "{{.EnvName}}" == "staging" ]] || [[ "{{.EnvName}}" == "production" ]]' - msg: 'var EnvName must have one of [development, staging, production] as its value' + - sh: '[ -n "{{.Out}}" ]' + msg: var Out must have a value cmds: - - docker buildx build -f ./Dockerfile -t {{.IMAGE}} . --build-arg APP={{.APP}} --platform linux/amd64 --build-context project-root=../.. - - docker push {{.IMAGE}} + - go build -v -ldflags="-s -w -X github.com/kloudlite/api/common.BuiltAt=\"{{.BuiltAt}}\"" -o {{.Out}} + - upx {{.Out}} local-build: - preconditions: - - sh: '[ -n "{{.EnvName}}" ]' - msg: 'var EnvName must have a value' - - sh: '[ -n "{{.Tag}}" ]' - msg: 'var Tag must have a value' vars: APP: auth - IMAGE: registry.kloudlite.io/kloudlite/{{.EnvName}}/{{.APP}}-api:{{.Tag}} - env: - CGO_ENABLED: 0 - GOOS: linux - GOARCH: amd64 + IMAGE: "{{.ImagePrefix}}/{{.APP}}:{{.Tag}}" + preconditions: + - sh: '[[ -n "{{.Tag}}" ]]' + msg: 'var Tag must have a value' silent: true cmds: - - |+ - lineNumbers=$(cat Dockerfile | grep -i '^FROM' -n | tail +2 | awk -F: '{print $1}') - - startLineNo=$(echo "$lineNumbers" | head -n+1) - finalLineNo=$(echo "$lineNumbers" | tail -1) - - tDir=$(mktemp -d) - - nDockerfile=$(cat Dockerfile | tail --lines=+$startLineNo | grep -i --invert-match 'from=base') - echo "$nDockerfile" | sed "1 i # syntax=docker/dockerfile:1.4" > $tDir/Dockerfile.base - - - cat $tDir/Dockerfile.base | sed "4 i COPY --from=local-builder ./{{.APP}} /{{.APP}}" > $tDir/Dockerfile - cat $tDir/Dockerfile - - CGO_ENABLED=0 go build -o $tDir/{{.APP}} . - - docker buildx build -f $tDir/Dockerfile -t {{.IMAGE}} . --build-context local-builder=${tDir} - docker push {{.IMAGE}} - rm -rf $tDir - + - | + tdir=$(mktemp -d) + task build Out=$tdir/{{.APP}} + podman buildx build -f ./Containerfile.local -t {{.IMAGE}} . --build-context builder=${tdir} --build-arg APP="{{.APP}}" + podman push {{.IMAGE}} + rm -rf $tdir diff --git a/apps/auth/internal/app/app.go b/apps/auth/internal/app/app.go new file mode 100644 index 000000000..3dfacc7c8 --- /dev/null +++ b/apps/auth/internal/app/app.go @@ -0,0 +1,83 @@ +package app + +import ( + "context" + "github.com/kloudlite/api/pkg/nats" + "go.uber.org/fx" + "google.golang.org/grpc" + + "github.com/kloudlite/api/apps/auth/internal/app/graph" + "github.com/kloudlite/api/apps/auth/internal/app/graph/generated" + "github.com/kloudlite/api/apps/auth/internal/domain" + "github.com/kloudlite/api/apps/auth/internal/env" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/constants" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/auth" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/comms" + httpServer "github.com/kloudlite/api/pkg/http-server" + "github.com/kloudlite/api/pkg/kv" + "github.com/kloudlite/api/pkg/repos" +) + +type CommsClientConnection *grpc.ClientConn + +var Module = fx.Module( + "app", + repos.NewFxMongoRepo[*domain.User]("users", "usr", domain.UserIndexes), + repos.NewFxMongoRepo[*domain.AccessToken]("access_tokens", "tkn", domain.AccessTokenIndexes), + repos.NewFxMongoRepo[*domain.RemoteLogin]("remote_logins", "rlgn", domain.RemoteTokenIndexes), + fx.Provide( + func(ev *env.Env, jc *nats.JetstreamClient) (kv.Repo[*domain.VerifyToken], error) { + cxt := context.TODO() + return kv.NewNatsKVRepo[*domain.VerifyToken](cxt, ev.VerifyTokenKVBucket, jc) + }, + ), + fx.Provide( + func(ev *env.Env, jc *nats.JetstreamClient) (kv.Repo[*domain.ResetPasswordToken], error) { + cxt := context.TODO() + return kv.NewNatsKVRepo[*domain.ResetPasswordToken](cxt, ev.ResetPasswordTokenKVBucket, jc) + }, + ), + + fx.Provide( + func(conn CommsClientConnection) comms.CommsClient { + return comms.NewCommsClient((*grpc.ClientConn)(conn)) + }, + ), + + fx.Provide(fxGithub), + fx.Provide(fxGitlab), + fx.Provide(fxGoogle), + + fx.Provide(fxRPCServer), + fx.Invoke( + func(server *grpc.Server, authServer auth.AuthServer) { + auth.RegisterAuthServer(server, authServer) + }, + ), + + fx.Invoke( + func( + server httpServer.Server, + d domain.Domain, + ev *env.Env, + repo kv.Repo[*common.AuthSession], + ) { + schema := generated.NewExecutableSchema( + generated.Config{Resolvers: graph.NewResolver(d, ev)}, + ) + + server.SetupGraphqlServer( + schema, + httpServer.NewSessionMiddleware( + repo, + constants.CookieName, + ev.CookieDomain, + constants.CacheSessionPrefix, + ), + ) + }, + ), + + domain.Module, +) diff --git a/apps/auth/internal/app/github.go b/apps/auth/internal/app/github.go index a2001dc86..021ebcad9 100644 --- a/apps/auth/internal/app/github.go +++ b/apps/auth/internal/app/github.go @@ -2,22 +2,25 @@ package app import ( "context" - "io/ioutil" + "fmt" "net/http" + "os" "strconv" "strings" "time" "github.com/bradleyfalzon/ghinstallation/v2" "github.com/google/go-github/v43/github" + "github.com/kloudlite/api/apps/auth/internal/domain" + "github.com/kloudlite/api/apps/auth/internal/env" + "github.com/kloudlite/api/pkg/errors" + fn "github.com/kloudlite/api/pkg/functions" "golang.org/x/oauth2" oauthGithub "golang.org/x/oauth2/github" - "kloudlite.io/apps/auth/internal/domain" - "kloudlite.io/pkg/errors" - fn "kloudlite.io/pkg/functions" ) type githubI struct { + enabled bool cfg *oauth2.Config ghCli *github.Client ghCliForUser func(ctx context.Context, token *oauth2.Token) *github.Client @@ -25,12 +28,19 @@ type githubI struct { } func (gh *githubI) GetOAuthToken(ctx context.Context, token *oauth2.Token) (*oauth2.Token, error) { + if !gh.enabled { + return nil, errors.Newf("github oauth is disabled") + } return gh.cfg.TokenSource(ctx, token).Token() } func (gh *githubI) Authorize(_ context.Context, state string) (string, error) { + if !gh.enabled { + fmt.Println("github oauth is disabled") + return "", nil + } csrfToken := fn.Must(fn.CleanerNanoid(32)) - b64state, err := fn.Json.ToB64Url(map[string]string{"csrf": csrfToken, "state": state}) + b64state, err := fn.ToBase64UrlFromJson(map[string]string{"csrf": csrfToken, "state": state}) if err != nil { return "", errors.NewEf(err, "could not JSON marshal oauth State into []byte") } @@ -41,6 +51,10 @@ func (gh *githubI) Authorize(_ context.Context, state string) (string, error) { } func (gh *githubI) Callback(ctx context.Context, code, state string) (*github.User, *oauth2.Token, error) { + if !gh.enabled { + return nil, nil, errors.Newf("github oauth is disabled") + } + token, err := gh.cfg.Exchange(ctx, code) if err != nil { return nil, nil, errors.NewEf(err, "could not exchange the token") @@ -55,6 +69,10 @@ func (gh *githubI) Callback(ctx context.Context, code, state string) (*github.Us } func (gh *githubI) GetPrimaryEmail(ctx context.Context, token *oauth2.Token) (string, error) { + if !gh.enabled { + return "", errors.Newf("github oauth is disabled") + } + emails, _, err := gh.ghCliForUser(ctx, token).Users.ListEmails( ctx, &github.ListOptions{ Page: 1, @@ -62,7 +80,7 @@ func (gh *githubI) GetPrimaryEmail(ctx context.Context, token *oauth2.Token) (st }, ) if err != nil { - return "", err + return "", errors.NewE(err) } for i := range emails { @@ -74,25 +92,24 @@ func (gh *githubI) GetPrimaryEmail(ctx context.Context, token *oauth2.Token) (st return "", errors.Newf("no primary email could be found for this user, among first 100 emails provided by github") } -type GithubOAuth interface { - GithubConfig() (clientId, clientSecret, callbackUrl, githubAppId, githubAppPKFile string) -} +func fxGithub(ev *env.Env) domain.Github { + if !ev.OAuth2Enabled || !ev.OAuth2GithubEnabled { + return &githubI{enabled: false} + } -func fxGithub(env *Env) domain.Github { - clientId, clientSecret, callbackUrl, ghAppId, ghAppPKFile := env.GithubConfig() cfg := oauth2.Config{ - ClientID: clientId, - ClientSecret: clientSecret, + ClientID: ev.GithubClientId, + ClientSecret: ev.GithubClientSecret, Endpoint: oauthGithub.Endpoint, - RedirectURL: callbackUrl, - Scopes: strings.Split(env.GithubScopes, ","), + RedirectURL: ev.GithubCallbackUrl, + Scopes: strings.Split(ev.GithubScopes, ","), } - privatePem, err := ioutil.ReadFile(ghAppPKFile) + privatePem, err := os.ReadFile(ev.GithubAppPKFile) if err != nil { panic(errors.NewEf(err, "reading github app PK file")) } - appId, _ := strconv.ParseInt(ghAppId, 10, 64) + appId, _ := strconv.ParseInt(ev.GithubAppId, 10, 64) itr, err := ghinstallation.NewAppsTransport(http.DefaultTransport, appId, privatePem) if err != nil { panic(errors.NewEf(err, "creating app transport")) @@ -106,9 +123,10 @@ func fxGithub(env *Env) domain.Github { ghCli := github.NewClient(&http.Client{Transport: itr, Timeout: time.Second * 30}) return &githubI{ + enabled: true, cfg: &cfg, ghCli: ghCli, ghCliForUser: ghCliForUser, - webhookUrl: env.GithubWebhookUrl, + webhookUrl: ev.GithubWebhookUrl, } } diff --git a/apps/auth/internal/app/gitlab.go b/apps/auth/internal/app/gitlab.go index 8dc8f908b..60f2669b7 100644 --- a/apps/auth/internal/app/gitlab.go +++ b/apps/auth/internal/app/gitlab.go @@ -2,28 +2,41 @@ package app import ( "context" + "fmt" "strings" + "github.com/kloudlite/api/apps/auth/internal/domain" + "github.com/kloudlite/api/apps/auth/internal/env" + "github.com/kloudlite/api/pkg/errors" "github.com/xanzy/go-gitlab" "golang.org/x/oauth2" oauthGitlab "golang.org/x/oauth2/gitlab" - "kloudlite.io/apps/auth/internal/domain" - "kloudlite.io/pkg/errors" ) type gitlabI struct { - cfg *oauth2.Config + enabled bool + cfg *oauth2.Config } func (gl *gitlabI) GetOAuthToken(ctx context.Context, token *oauth2.Token) (*oauth2.Token, error) { + if !gl.enabled { + return nil, errors.Newf("gitlab oauth is disabled") + } return gl.cfg.TokenSource(ctx, token).Token() } func (gl *gitlabI) Authorize(_ context.Context, state string) (string, error) { + if !gl.enabled { + fmt.Println("gitlab oauth is disabled") + return "", nil + } return gl.cfg.AuthCodeURL(state), nil } func (gl *gitlabI) Callback(ctx context.Context, code string, state string) (*gitlab.User, *oauth2.Token, error) { + if !gl.enabled { + return nil, nil, errors.Newf("gitlab oauth is disabled") + } token, err := gl.cfg.Exchange(ctx, code) if err != nil { return nil, nil, errors.NewEf(err, "could not exchange the token") @@ -44,15 +57,18 @@ type GitlabOAuth interface { GitlabConfig() (clientId, clientSecret, callbackUrl string) } -func fxGitlab(env *Env) domain.Gitlab { - clientId, clientSecret, callbackUrl := env.GitlabConfig() +func fxGitlab(ev *env.Env) domain.Gitlab { + if !ev.OAuth2Enabled || !ev.OAuth2GitlabEnabled { + return &gitlabI{enabled: false, cfg: nil} + } + cfg := oauth2.Config{ - ClientID: clientId, - ClientSecret: clientSecret, + ClientID: ev.GitlabClientId, + ClientSecret: ev.GitlabClientSecret, Endpoint: oauthGitlab.Endpoint, - RedirectURL: callbackUrl, - Scopes: strings.Split(env.GitlabScopes, ","), + RedirectURL: ev.GitlabCallbackUrl, + Scopes: strings.Split(ev.GitlabScopes, ","), } - return &gitlabI{cfg: &cfg} + return &gitlabI{enabled: true, cfg: &cfg} } diff --git a/apps/auth/internal/app/google.go b/apps/auth/internal/app/google.go index 9fc884221..58e73b722 100644 --- a/apps/auth/internal/app/google.go +++ b/apps/auth/internal/app/google.go @@ -9,21 +9,32 @@ import ( "net/url" "strings" + "github.com/kloudlite/api/apps/auth/internal/domain" + "github.com/kloudlite/api/apps/auth/internal/env" + "github.com/kloudlite/api/pkg/errors" "golang.org/x/oauth2" "golang.org/x/oauth2/google" - "kloudlite.io/apps/auth/internal/domain" - "kloudlite.io/pkg/errors" ) type googleI struct { - cfg *oauth2.Config + enabled bool + cfg *oauth2.Config } func (g *googleI) Authorize(ctx context.Context, state string) (string, error) { + if !g.enabled { + fmt.Println("google oAuth is disabled") + return "", nil + } + return g.cfg.AuthCodeURL(state), nil } func (g *googleI) Callback(ctx context.Context, code string, state string) (*domain.GoogleUser, *oauth2.Token, error) { + if !g.enabled { + return nil, nil, errors.Newf("google oauth is disabled") + } + nCode, err := url.PathUnescape(code) if err != nil { return nil, nil, errors.NewEf(err, "could not UnEscape string code %q", code) @@ -58,14 +69,17 @@ type GoogleOAuth interface { GoogleConfig() (clientId, clientSecret, callbackUrl string) } -func fxGoogle(env *Env) domain.Google { - clientId, clientSecret, callbackUrl := env.GoogleConfig() +func fxGoogle(ev *env.Env) domain.Google { + if !ev.OAuth2Enabled || !ev.OAuth2GoogleEnabled { + return &googleI{enabled: false} + } + cfg := &oauth2.Config{ - ClientID: clientId, - ClientSecret: clientSecret, + ClientID: ev.GoogleClientId, + ClientSecret: ev.GoogleClientSecret, Endpoint: google.Endpoint, - RedirectURL: callbackUrl, - Scopes: strings.Split(env.GoogleScopes, ","), + RedirectURL: ev.GoogleCallbackUrl, + Scopes: strings.Split(ev.GoogleScopes, ","), } - return &googleI{cfg} + return &googleI{enabled: true, cfg: cfg} } diff --git a/apps/auth/internal/app/gqlgen.yml b/apps/auth/internal/app/gqlgen.yml index e859c7a1c..5c4e6b82e 100644 --- a/apps/auth/internal/app/gqlgen.yml +++ b/apps/auth/internal/app/gqlgen.yml @@ -35,8 +35,8 @@ resolver: # 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: - - "kloudlite.io/pkg/errors" - # - "kloudlite.io/apps/wireguard/internal/domain/entities" + - "github.com/kloudlite/api/pkg/errors" + # - "github.com/kloudlite/api/apps/wireguard/internal/domain/entities" # This section declares type mapping between the GraphQL and go type systems # @@ -44,6 +44,8 @@ autobind: # modelgen, the others will be allowed when binding to fields. Configure them to # your liking +skip_validation: true + models: Json: model: @@ -53,7 +55,7 @@ models: - github.com/99designs/gqlgen/graphql.Map ID: model: - - kloudlite.io/pkg/repos.ID + - github.com/kloudlite/api/pkg/repos.ID Int: model: - github.com/99designs/gqlgen/graphql.Int diff --git a/apps/auth/internal/app/graph/entity.resolvers.go b/apps/auth/internal/app/graph/entity.resolvers.go index f66a47a2b..dc112b483 100644 --- a/apps/auth/internal/app/graph/entity.resolvers.go +++ b/apps/auth/internal/app/graph/entity.resolvers.go @@ -2,18 +2,20 @@ 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.28 import ( "context" - - "kloudlite.io/apps/auth/internal/app/graph/generated" - "kloudlite.io/apps/auth/internal/app/graph/model" - "kloudlite.io/pkg/repos" + "github.com/kloudlite/api/apps/auth/internal/app/graph/generated" + "github.com/kloudlite/api/apps/auth/internal/app/graph/model" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" ) +// FindUserByID is the resolver for the findUserByID field. func (r *entityResolver) FindUserByID(ctx context.Context, id repos.ID) (*model.User, error) { userEntity, err := r.d.GetUserById(ctx, id) - return userModelFromEntity(userEntity), err + return userModelFromEntity(userEntity), errors.NewE(err) } // Entity returns generated.EntityResolver implementation. diff --git a/apps/auth/internal/app/graph/functions.go b/apps/auth/internal/app/graph/functions.go index b22085d44..21b5c5a69 100644 --- a/apps/auth/internal/app/graph/functions.go +++ b/apps/auth/internal/app/graph/functions.go @@ -1,9 +1,9 @@ package graph import ( - "kloudlite.io/apps/auth/internal/app/graph/model" - "kloudlite.io/apps/auth/internal/domain" - "kloudlite.io/common" + "github.com/kloudlite/api/apps/auth/internal/app/graph/model" + "github.com/kloudlite/api/apps/auth/internal/domain" + "github.com/kloudlite/api/common" ) func mapFromProviderDetail(detail *domain.ProviderDetail) map[string]any { diff --git a/apps/auth/internal/app/graph/generated/federation.go b/apps/auth/internal/app/graph/generated/federation.go index 2b8e0bfb6..214bc3d46 100644 --- a/apps/auth/internal/app/graph/generated/federation.go +++ b/apps/auth/internal/app/graph/generated/federation.go @@ -88,7 +88,7 @@ func (ec *executionContext) __resolve_entities(ctx context.Context, representati switch resolverName { case "findUserByID": - id0, err := ec.unmarshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, rep["id"]) + id0, err := ec.unmarshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx, rep["id"]) if err != nil { return fmt.Errorf(`unmarshalling param 0 for findUserByID(): %w`, err) } diff --git a/apps/auth/internal/app/graph/generated/generated.go b/apps/auth/internal/app/graph/generated/generated.go index 6f0a6b2eb..4c7878b36 100644 --- a/apps/auth/internal/app/graph/generated/generated.go +++ b/apps/auth/internal/app/graph/generated/generated.go @@ -14,10 +14,10 @@ import ( "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/introspection" "github.com/99designs/gqlgen/plugin/federation/fedruntime" + "github.com/kloudlite/api/apps/auth/internal/app/graph/model" + "github.com/kloudlite/api/pkg/repos" gqlparser "github.com/vektah/gqlparser/v2" "github.com/vektah/gqlparser/v2/ast" - "kloudlite.io/apps/auth/internal/app/graph/model" - "kloudlite.io/pkg/repos" ) // region ************************** generated!.gotpl ************************** @@ -56,9 +56,7 @@ type ComplexityRoot struct { AuthChangePassword func(childComplexity int, currentPassword string, newPassword string) int AuthClearMetadata func(childComplexity int) int AuthCreateRemoteLogin func(childComplexity int, secret *string) int - AuthInviteSignup func(childComplexity int, email string, name string) int AuthLogin func(childComplexity int, email string, password string) int - AuthLoginWithInviteToken func(childComplexity int, inviteToken string) int AuthLogout func(childComplexity int) int AuthRequestResetPassword func(childComplexity int, email string) int AuthResendVerificationEmail func(childComplexity int) int @@ -71,13 +69,19 @@ type ComplexityRoot struct { OAuthLogin func(childComplexity int, provider string, code string, state *string) int } + OAuthProviderStatus struct { + Enabled func(childComplexity int) int + Provider func(childComplexity int) int + } + Query struct { - AuthFindByEmail func(childComplexity int, email string) int - AuthGetRemoteLogin func(childComplexity int, loginID string, secret string) int - AuthMe func(childComplexity int) int - OAuthRequestLogin func(childComplexity int, provider string, state *string) int - __resolve__service func(childComplexity int) int - __resolve_entities func(childComplexity int, representations []map[string]interface{}) int + AuthFindByEmail func(childComplexity int, email string) int + AuthGetRemoteLogin func(childComplexity int, loginID string, secret string) int + AuthListOAuthProviders func(childComplexity int) int + AuthMe func(childComplexity int) int + OAuthRequestLogin func(childComplexity int, provider string, state *string) int + __resolve__service func(childComplexity int) int + __resolve_entities func(childComplexity int, representations []map[string]interface{}) int } RemoteLogin struct { @@ -126,8 +130,6 @@ type MutationResolver interface { AuthVerifyEmail(ctx context.Context, token string) (*model.Session, error) AuthResetPassword(ctx context.Context, token string, password string) (bool, error) AuthRequestResetPassword(ctx context.Context, email string) (bool, error) - AuthLoginWithInviteToken(ctx context.Context, inviteToken string) (*model.Session, error) - AuthInviteSignup(ctx context.Context, email string, name string) (repos.ID, error) AuthChangeEmail(ctx context.Context, email string) (bool, error) AuthResendVerificationEmail(ctx context.Context) (bool, error) AuthChangePassword(ctx context.Context, currentPassword string, newPassword string) (bool, error) @@ -139,6 +141,7 @@ type QueryResolver interface { AuthFindByEmail(ctx context.Context, email string) (*model.User, error) OAuthRequestLogin(ctx context.Context, provider string, state *string) (string, error) AuthGetRemoteLogin(ctx context.Context, loginID string, secret string) (*model.RemoteLogin, error) + AuthListOAuthProviders(ctx context.Context) ([]*model.OAuthProviderStatus, error) } type executableSchema struct { @@ -211,18 +214,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.AuthCreateRemoteLogin(childComplexity, args["secret"].(*string)), true - case "Mutation.auth_inviteSignup": - if e.complexity.Mutation.AuthInviteSignup == nil { - break - } - - args, err := ec.field_Mutation_auth_inviteSignup_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Mutation.AuthInviteSignup(childComplexity, args["email"].(string), args["name"].(string)), true - case "Mutation.auth_login": if e.complexity.Mutation.AuthLogin == nil { break @@ -235,18 +226,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.AuthLogin(childComplexity, args["email"].(string), args["password"].(string)), true - case "Mutation.auth_loginWithInviteToken": - if e.complexity.Mutation.AuthLoginWithInviteToken == nil { - break - } - - args, err := ec.field_Mutation_auth_loginWithInviteToken_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Mutation.AuthLoginWithInviteToken(childComplexity, args["inviteToken"].(string)), true - case "Mutation.auth_logout": if e.complexity.Mutation.AuthLogout == nil { break @@ -357,6 +336,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.OAuthLogin(childComplexity, args["provider"].(string), args["code"].(string), args["state"].(*string)), true + case "OAuthProviderStatus.enabled": + if e.complexity.OAuthProviderStatus.Enabled == nil { + break + } + + return e.complexity.OAuthProviderStatus.Enabled(childComplexity), true + + case "OAuthProviderStatus.provider": + if e.complexity.OAuthProviderStatus.Provider == nil { + break + } + + return e.complexity.OAuthProviderStatus.Provider(childComplexity), true + case "Query.auth_findByEmail": if e.complexity.Query.AuthFindByEmail == nil { break @@ -381,6 +374,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.AuthGetRemoteLogin(childComplexity, args["loginId"].(string), args["secret"].(string)), true + case "Query.auth_listOAuthProviders": + if e.complexity.Query.AuthListOAuthProviders == nil { + break + } + + return e.complexity.Query.AuthListOAuthProviders(childComplexity), true + case "Query.auth_me": if e.complexity.Query.AuthMe == nil { break @@ -559,6 +559,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { rc := graphql.GetOperationContext(ctx) ec := executionContext{rc, e} + inputUnmarshalMap := graphql.BuildUnmarshalerMap() first := true switch rc.Operation.Operation { @@ -568,6 +569,7 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { return nil } first = false + ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) data := ec._Query(ctx, rc.Operation.SelectionSet) var buf bytes.Buffer data.MarshalGQL(&buf) @@ -582,6 +584,7 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { return nil } first = false + ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) data := ec._Mutation(ctx, rc.Operation.SelectionSet) var buf bytes.Buffer data.MarshalGQL(&buf) @@ -616,45 +619,47 @@ func (ec *executionContext) introspectType(name string) (*introspection.Type, er } var sources = []*ast.Source{ - {Name: "graph/schema.graphqls", Input: `scalar Date + {Name: "../schema.graphqls", Input: `scalar Date scalar Json scalar ProviderDetail scalar URL scalar Any -type Query { - auth_me: User # Done - auth_findByEmail(email: String!): User # Done - oAuth_requestLogin(provider: String!, state: String): URL! - auth_getRemoteLogin(loginId: String!, secret: String!): RemoteLogin -} - type RemoteLogin { status: String! authHeader: String } +type OAuthProviderStatus { + provider: String! + enabled: Boolean! +} + +type Query { + auth_me: User # public-access + auth_findByEmail(email: String!): User # public-access # Deprecate + oAuth_requestLogin(provider: String!, state: String): URL! # public-access + auth_getRemoteLogin(loginId: String!, secret: String!): RemoteLogin # public-access + auth_listOAuthProviders: [OAuthProviderStatus!] +} + type Mutation { - auth_setRemoteAuthHeader(loginId: String!, authHeader:String):Boolean! - auth_createRemoteLogin(secret: String):String! - - auth_login(email: String!, password: String!): Session # Done - auth_signup(name: String!, email: String!, password: String!): Session # Done - auth_logout: Boolean! # Done - auth_setMetadata(values: Json!): User! # Done - auth_clearMetadata: User! #Done - auth_verifyEmail(token: String!): Session! #Done - auth_resetPassword(token: String!, password: String!): Boolean! #Done - auth_requestResetPassword(email: String!): Boolean! #Done - auth_loginWithInviteToken(inviteToken: String!): Session - auth_inviteSignup(email: String!, name: String!): ID! - auth_changeEmail(email: String!): Boolean! #Done - auth_resendVerificationEmail: Boolean! #Done - auth_changePassword(currentPassword: String!, newPassword: String!): Boolean! #Done - oAuth_login(provider: String!, code: String!, state: String): Session! - oAuth_addLogin(provider: String!, state: String!, code: String!): Boolean! - -# oAuth_githubAddWebhook(repoUrl: String!): Boolean! + auth_setRemoteAuthHeader(loginId: String!, authHeader:String):Boolean! # user-access + auth_createRemoteLogin(secret: String):String! # public-access + + auth_login(email: String!, password: String!): Session # public-access + auth_signup(name: String!, email: String!, password: String!): Session # public-access + auth_logout: Boolean! # user-access + auth_setMetadata(values: Json!): User! # user-access # Deprecate + auth_clearMetadata: User! # user-access # Deprecate + auth_verifyEmail(token: String!): Session! # public-access # TBD + auth_resetPassword(token: String!, password: String!): Boolean! # user-access + auth_requestResetPassword(email: String!): Boolean! # user-access + auth_changeEmail(email: String!): Boolean! # user-access #Done + auth_resendVerificationEmail: Boolean! # user-access #Done + auth_changePassword(currentPassword: String!, newPassword: String!): Boolean! # user-access #Done + oAuth_login(provider: String!, code: String!, state: String): Session! # public-access + oAuth_addLogin(provider: String!, state: String!, code: String!): Boolean! # public-access } type Session { @@ -679,17 +684,17 @@ type User @key(fields: "id") { providerGoogle: ProviderDetail } `, BuiltIn: false}, - {Name: "federation/directives.graphql", Input: ` -scalar _Any -scalar _FieldSet - -directive @external on FIELD_DEFINITION -directive @requires(fields: _FieldSet!) on FIELD_DEFINITION -directive @provides(fields: _FieldSet!) on FIELD_DEFINITION -directive @key(fields: _FieldSet!) repeatable on OBJECT | INTERFACE -directive @extends on OBJECT | INTERFACE + {Name: "../../federation/directives.graphql", Input: ` + scalar _Any + scalar _FieldSet + directive @requires(fields: _FieldSet!) on FIELD_DEFINITION + directive @provides(fields: _FieldSet!) on FIELD_DEFINITION + directive @extends on OBJECT | INTERFACE + + directive @key(fields: _FieldSet!) repeatable on OBJECT | INTERFACE + directive @external on FIELD_DEFINITION `, BuiltIn: true}, - {Name: "federation/entity.graphql", Input: ` + {Name: "../../federation/entity.graphql", Input: ` # a union of all types that use the @key directive union _Entity = User @@ -721,7 +726,7 @@ func (ec *executionContext) field_Entity_findUserByID_args(ctx context.Context, var arg0 repos.ID if tmp, ok := rawArgs["id"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, tmp) + arg0, err = ec.unmarshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx, tmp) if err != nil { return nil, err } @@ -784,45 +789,6 @@ func (ec *executionContext) field_Mutation_auth_createRemoteLogin_args(ctx conte return args, nil } -func (ec *executionContext) field_Mutation_auth_inviteSignup_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["email"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["email"] = arg0 - var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["name"] = arg1 - return args, nil -} - -func (ec *executionContext) field_Mutation_auth_loginWithInviteToken_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["inviteToken"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("inviteToken")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["inviteToken"] = arg0 - return args, nil -} - func (ec *executionContext) field_Mutation_auth_login_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -1171,31 +1137,20 @@ func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArg // region **************************** field.gotpl ***************************** func (ec *executionContext) _Entity_findUserByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findUserByID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "Entity", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Entity_findUserByID_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Entity().FindUserByID(rctx, args["id"].(repos.ID)) + return ec.resolvers.Entity().FindUserByID(rctx, fc.Args["id"].(repos.ID)) }) if err != nil { ec.Error(ctx, err) @@ -1209,35 +1164,72 @@ func (ec *executionContext) _Entity_findUserByID(ctx context.Context, field grap } res := resTmp.(*model.User) fc.Result = res - return ec.marshalNUser2ᚖkloudliteᚗioᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐUser(ctx, field.Selections, res) + return ec.marshalNUser2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐUser(ctx, field.Selections, res) } -func (ec *executionContext) _Mutation_auth_setRemoteAuthHeader(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { +func (ec *executionContext) fieldContext_Entity_findUserByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_User_id(ctx, field) + case "name": + return ec.fieldContext_User_name(ctx, field) + case "email": + return ec.fieldContext_User_email(ctx, field) + case "avatar": + return ec.fieldContext_User_avatar(ctx, field) + case "invite": + return ec.fieldContext_User_invite(ctx, field) + case "verified": + return ec.fieldContext_User_verified(ctx, field) + case "metadata": + return ec.fieldContext_User_metadata(ctx, field) + case "joined": + return ec.fieldContext_User_joined(ctx, field) + case "providerGitlab": + return ec.fieldContext_User_providerGitlab(ctx, field) + case "providerGithub": + return ec.fieldContext_User_providerGithub(ctx, field) + case "providerGoogle": + return ec.fieldContext_User_providerGoogle(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + }, + } defer func() { if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + err = ec.Recover(ctx, r) + ec.Error(ctx, err) } }() - fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findUserByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return } + return fc, nil +} - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_auth_setRemoteAuthHeader_args(ctx, rawArgs) +func (ec *executionContext) _Mutation_auth_setRemoteAuthHeader(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_auth_setRemoteAuthHeader(ctx, field) if err != nil { - ec.Error(ctx, err) return graphql.Null } - fc.Args = args + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.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().AuthSetRemoteAuthHeader(rctx, args["loginId"].(string), args["authHeader"].(*string)) + return ec.resolvers.Mutation().AuthSetRemoteAuthHeader(rctx, fc.Args["loginId"].(string), fc.Args["authHeader"].(*string)) }) if err != nil { ec.Error(ctx, err) @@ -1254,32 +1246,45 @@ func (ec *executionContext) _Mutation_auth_setRemoteAuthHeader(ctx context.Conte return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) _Mutation_auth_createRemoteLogin(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_Mutation_auth_setRemoteAuthHeader(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "Mutation", Field: field, - Args: nil, 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) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_auth_createRemoteLogin_args(ctx, rawArgs) - if err != nil { + if fc.Args, err = ec.field_Mutation_auth_setRemoteAuthHeader_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_auth_createRemoteLogin(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_auth_createRemoteLogin(ctx, field) + if err != nil { return graphql.Null } - fc.Args = args + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.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().AuthCreateRemoteLogin(rctx, args["secret"].(*string)) + return ec.resolvers.Mutation().AuthCreateRemoteLogin(rctx, fc.Args["secret"].(*string)) }) if err != nil { ec.Error(ctx, err) @@ -1296,32 +1301,45 @@ func (ec *executionContext) _Mutation_auth_createRemoteLogin(ctx context.Context return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _Mutation_auth_login(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_Mutation_auth_createRemoteLogin(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "Mutation", Field: field, - Args: nil, 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") + }, } - + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_auth_login_args(ctx, rawArgs) - if err != nil { + if fc.Args, err = ec.field_Mutation_auth_createRemoteLogin_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_auth_login(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_auth_login(ctx, field) + if err != nil { return graphql.Null } - fc.Args = args + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.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().AuthLogin(rctx, args["email"].(string), args["password"].(string)) + return ec.resolvers.Mutation().AuthLogin(rctx, fc.Args["email"].(string), fc.Args["password"].(string)) }) if err != nil { ec.Error(ctx, err) @@ -1332,35 +1350,60 @@ func (ec *executionContext) _Mutation_auth_login(ctx context.Context, field grap } res := resTmp.(*model.Session) fc.Result = res - return ec.marshalOSession2ᚖkloudliteᚗioᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐSession(ctx, field.Selections, res) + return ec.marshalOSession2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐSession(ctx, field.Selections, res) } -func (ec *executionContext) _Mutation_auth_signup(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_Mutation_auth_login(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "Mutation", Field: field, - Args: nil, IsMethod: true, IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Session_id(ctx, field) + case "userId": + return ec.fieldContext_Session_userId(ctx, field) + case "userEmail": + return ec.fieldContext_Session_userEmail(ctx, field) + case "loginMethod": + return ec.fieldContext_Session_loginMethod(ctx, field) + case "userVerified": + return ec.fieldContext_Session_userVerified(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Session", field.Name) + }, } - + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_auth_signup_args(ctx, rawArgs) - if err != nil { + if fc.Args, err = ec.field_Mutation_auth_login_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_auth_signup(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_auth_signup(ctx, field) + if err != nil { return graphql.Null } - fc.Args = args + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.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().AuthSignup(rctx, args["name"].(string), args["email"].(string), args["password"].(string)) + return ec.resolvers.Mutation().AuthSignup(rctx, fc.Args["name"].(string), fc.Args["email"].(string), fc.Args["password"].(string)) }) if err != nil { ec.Error(ctx, err) @@ -1371,25 +1414,57 @@ func (ec *executionContext) _Mutation_auth_signup(ctx context.Context, field gra } res := resTmp.(*model.Session) fc.Result = res - return ec.marshalOSession2ᚖkloudliteᚗioᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐSession(ctx, field.Selections, res) + return ec.marshalOSession2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐSession(ctx, field.Selections, res) } -func (ec *executionContext) _Mutation_auth_logout(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_Mutation_auth_signup(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "Mutation", Field: field, - Args: nil, IsMethod: true, IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Session_id(ctx, field) + case "userId": + return ec.fieldContext_Session_userId(ctx, field) + case "userEmail": + return ec.fieldContext_Session_userEmail(ctx, field) + case "loginMethod": + return ec.fieldContext_Session_loginMethod(ctx, field) + case "userVerified": + return ec.fieldContext_Session_userVerified(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Session", field.Name) + }, + } + defer func() { + if 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_auth_signup_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return } + return fc, nil +} +func (ec *executionContext) _Mutation_auth_logout(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_auth_logout(ctx, field) + if err != nil { + return graphql.Null + } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.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().AuthLogout(rctx) @@ -1409,32 +1484,34 @@ func (ec *executionContext) _Mutation_auth_logout(ctx context.Context, field gra return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) _Mutation_auth_setMetadata(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_Mutation_auth_logout(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "Mutation", Field: field, - Args: nil, 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") + }, } + return fc, nil +} - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_auth_setMetadata_args(ctx, rawArgs) +func (ec *executionContext) _Mutation_auth_setMetadata(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_auth_setMetadata(ctx, field) if err != nil { - ec.Error(ctx, err) return graphql.Null } - fc.Args = args + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.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().AuthSetMetadata(rctx, args["values"].(map[string]interface{})) + return ec.resolvers.Mutation().AuthSetMetadata(rctx, fc.Args["values"].(map[string]interface{})) }) if err != nil { ec.Error(ctx, err) @@ -1448,25 +1525,69 @@ func (ec *executionContext) _Mutation_auth_setMetadata(ctx context.Context, fiel } res := resTmp.(*model.User) fc.Result = res - return ec.marshalNUser2ᚖkloudliteᚗioᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐUser(ctx, field.Selections, res) + return ec.marshalNUser2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐUser(ctx, field.Selections, res) } -func (ec *executionContext) _Mutation_auth_clearMetadata(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_Mutation_auth_setMetadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "Mutation", Field: field, - Args: nil, IsMethod: true, IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_User_id(ctx, field) + case "name": + return ec.fieldContext_User_name(ctx, field) + case "email": + return ec.fieldContext_User_email(ctx, field) + case "avatar": + return ec.fieldContext_User_avatar(ctx, field) + case "invite": + return ec.fieldContext_User_invite(ctx, field) + case "verified": + return ec.fieldContext_User_verified(ctx, field) + case "metadata": + return ec.fieldContext_User_metadata(ctx, field) + case "joined": + return ec.fieldContext_User_joined(ctx, field) + case "providerGitlab": + return ec.fieldContext_User_providerGitlab(ctx, field) + case "providerGithub": + return ec.fieldContext_User_providerGithub(ctx, field) + case "providerGoogle": + return ec.fieldContext_User_providerGoogle(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_auth_setMetadata_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return } + return fc, nil +} +func (ec *executionContext) _Mutation_auth_clearMetadata(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_auth_clearMetadata(ctx, field) + if err != nil { + return graphql.Null + } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.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().AuthClearMetadata(rctx) @@ -1483,35 +1604,61 @@ func (ec *executionContext) _Mutation_auth_clearMetadata(ctx context.Context, fi } res := resTmp.(*model.User) fc.Result = res - return ec.marshalNUser2ᚖkloudliteᚗioᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐUser(ctx, field.Selections, res) + return ec.marshalNUser2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐUser(ctx, field.Selections, res) } -func (ec *executionContext) _Mutation_auth_verifyEmail(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_Mutation_auth_clearMetadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "Mutation", Field: field, - Args: nil, IsMethod: true, IsResolver: true, - } + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_User_id(ctx, field) + case "name": + return ec.fieldContext_User_name(ctx, field) + case "email": + return ec.fieldContext_User_email(ctx, field) + case "avatar": + return ec.fieldContext_User_avatar(ctx, field) + case "invite": + return ec.fieldContext_User_invite(ctx, field) + case "verified": + return ec.fieldContext_User_verified(ctx, field) + case "metadata": + return ec.fieldContext_User_metadata(ctx, field) + case "joined": + return ec.fieldContext_User_joined(ctx, field) + case "providerGitlab": + return ec.fieldContext_User_providerGitlab(ctx, field) + case "providerGithub": + return ec.fieldContext_User_providerGithub(ctx, field) + case "providerGoogle": + return ec.fieldContext_User_providerGoogle(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + }, + } + return fc, nil +} - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_auth_verifyEmail_args(ctx, rawArgs) +func (ec *executionContext) _Mutation_auth_verifyEmail(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_auth_verifyEmail(ctx, field) if err != nil { - ec.Error(ctx, err) return graphql.Null } - fc.Args = args + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.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().AuthVerifyEmail(rctx, args["token"].(string)) + return ec.resolvers.Mutation().AuthVerifyEmail(rctx, fc.Args["token"].(string)) }) if err != nil { ec.Error(ctx, err) @@ -1525,35 +1672,60 @@ func (ec *executionContext) _Mutation_auth_verifyEmail(ctx context.Context, fiel } res := resTmp.(*model.Session) fc.Result = res - return ec.marshalNSession2ᚖkloudliteᚗioᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐSession(ctx, field.Selections, res) + return ec.marshalNSession2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐSession(ctx, field.Selections, res) } -func (ec *executionContext) _Mutation_auth_resetPassword(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_Mutation_auth_verifyEmail(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "Mutation", Field: field, - Args: nil, IsMethod: true, IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Session_id(ctx, field) + case "userId": + return ec.fieldContext_Session_userId(ctx, field) + case "userEmail": + return ec.fieldContext_Session_userEmail(ctx, field) + case "loginMethod": + return ec.fieldContext_Session_loginMethod(ctx, field) + case "userVerified": + return ec.fieldContext_Session_userVerified(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Session", field.Name) + }, } - + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_auth_resetPassword_args(ctx, rawArgs) - if err != nil { + if fc.Args, err = ec.field_Mutation_auth_verifyEmail_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_auth_resetPassword(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_auth_resetPassword(ctx, field) + if err != nil { return graphql.Null } - fc.Args = args + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.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().AuthResetPassword(rctx, args["token"].(string), args["password"].(string)) + return ec.resolvers.Mutation().AuthResetPassword(rctx, fc.Args["token"].(string), fc.Args["password"].(string)) }) if err != nil { ec.Error(ctx, err) @@ -1570,32 +1742,45 @@ func (ec *executionContext) _Mutation_auth_resetPassword(ctx context.Context, fi return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) _Mutation_auth_requestResetPassword(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_Mutation_auth_resetPassword(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "Mutation", Field: field, - Args: nil, 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) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_auth_requestResetPassword_args(ctx, rawArgs) - if err != nil { + if fc.Args, err = ec.field_Mutation_auth_resetPassword_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_auth_requestResetPassword(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_auth_requestResetPassword(ctx, field) + if err != nil { return graphql.Null } - fc.Args = args + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.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().AuthRequestResetPassword(rctx, args["email"].(string)) + return ec.resolvers.Mutation().AuthRequestResetPassword(rctx, fc.Args["email"].(string)) }) if err != nil { ec.Error(ctx, err) @@ -1612,71 +1797,100 @@ func (ec *executionContext) _Mutation_auth_requestResetPassword(ctx context.Cont return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) _Mutation_auth_loginWithInviteToken(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_Mutation_auth_requestResetPassword(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "Mutation", Field: field, - Args: nil, 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) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_auth_loginWithInviteToken_args(ctx, rawArgs) - if err != nil { + if fc.Args, err = ec.field_Mutation_auth_requestResetPassword_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_auth_changeEmail(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_auth_changeEmail(ctx, field) + if err != nil { return graphql.Null } - fc.Args = args + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.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().AuthLoginWithInviteToken(rctx, args["inviteToken"].(string)) + return ec.resolvers.Mutation().AuthChangeEmail(rctx, fc.Args["email"].(string)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*model.Session) + res := resTmp.(bool) fc.Result = res - return ec.marshalOSession2ᚖkloudliteᚗioᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐSession(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) _Mutation_auth_inviteSignup(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_Mutation_auth_changeEmail(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "Mutation", Field: field, - Args: nil, 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) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_auth_inviteSignup_args(ctx, rawArgs) - if err != nil { + if fc.Args, err = ec.field_Mutation_auth_changeEmail_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_auth_resendVerificationEmail(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_auth_resendVerificationEmail(ctx, field) + if err != nil { return graphql.Null } - fc.Args = args + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.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().AuthInviteSignup(rctx, args["email"].(string), args["name"].(string)) + return ec.resolvers.Mutation().AuthResendVerificationEmail(rctx) }) if err != nil { ec.Error(ctx, err) @@ -1688,37 +1902,39 @@ func (ec *executionContext) _Mutation_auth_inviteSignup(ctx context.Context, fie } return graphql.Null } - res := resTmp.(repos.ID) + res := resTmp.(bool) fc.Result = res - return ec.marshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) _Mutation_auth_changeEmail(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_Mutation_auth_resendVerificationEmail(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "Mutation", Field: field, - Args: nil, 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") + }, } + return fc, nil +} - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_auth_changeEmail_args(ctx, rawArgs) +func (ec *executionContext) _Mutation_auth_changePassword(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_auth_changePassword(ctx, field) if err != nil { - ec.Error(ctx, err) return graphql.Null } - fc.Args = args + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.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().AuthChangeEmail(rctx, args["email"].(string)) + return ec.resolvers.Mutation().AuthChangePassword(rctx, fc.Args["currentPassword"].(string), fc.Args["newPassword"].(string)) }) if err != nil { ec.Error(ctx, err) @@ -1735,25 +1951,45 @@ func (ec *executionContext) _Mutation_auth_changeEmail(ctx context.Context, fiel return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) _Mutation_auth_resendVerificationEmail(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_Mutation_auth_changePassword(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "Mutation", Field: field, - Args: nil, 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_auth_changePassword_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} +func (ec *executionContext) _Mutation_oAuth_login(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_oAuth_login(ctx, field) + if err != nil { + return graphql.Null + } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.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().AuthResendVerificationEmail(rctx) + return ec.resolvers.Mutation().OAuthLogin(rctx, fc.Args["provider"].(string), fc.Args["code"].(string), fc.Args["state"].(*string)) }) if err != nil { ec.Error(ctx, err) @@ -1765,37 +2001,62 @@ func (ec *executionContext) _Mutation_auth_resendVerificationEmail(ctx context.C } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(*model.Session) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNSession2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐSession(ctx, field.Selections, res) } -func (ec *executionContext) _Mutation_auth_changePassword(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_Mutation_oAuth_login(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "Mutation", Field: field, - Args: nil, IsMethod: true, IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Session_id(ctx, field) + case "userId": + return ec.fieldContext_Session_userId(ctx, field) + case "userEmail": + return ec.fieldContext_Session_userEmail(ctx, field) + case "loginMethod": + return ec.fieldContext_Session_loginMethod(ctx, field) + case "userVerified": + return ec.fieldContext_Session_userVerified(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Session", field.Name) + }, } - + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_auth_changePassword_args(ctx, rawArgs) - if err != nil { + if fc.Args, err = ec.field_Mutation_oAuth_login_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_oAuth_addLogin(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_oAuth_addLogin(ctx, field) + if err != nil { return graphql.Null } - fc.Args = args + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.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().AuthChangePassword(rctx, args["currentPassword"].(string), args["newPassword"].(string)) + return ec.resolvers.Mutation().OAuthAddLogin(rctx, fc.Args["provider"].(string), fc.Args["state"].(string), fc.Args["code"].(string)) }) if err != nil { ec.Error(ctx, err) @@ -1812,32 +2073,45 @@ func (ec *executionContext) _Mutation_auth_changePassword(ctx context.Context, f return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) _Mutation_oAuth_login(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_Mutation_oAuth_addLogin(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "Mutation", Field: field, - Args: nil, 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) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_oAuth_login_args(ctx, rawArgs) - if err != nil { + if fc.Args, err = ec.field_Mutation_oAuth_addLogin_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _OAuthProviderStatus_provider(ctx context.Context, field graphql.CollectedField, obj *model.OAuthProviderStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OAuthProviderStatus_provider(ctx, field) + if err != nil { return graphql.Null } - fc.Args = args + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.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().OAuthLogin(rctx, args["provider"].(string), args["code"].(string), args["state"].(*string)) + return obj.Provider, nil }) if err != nil { ec.Error(ctx, err) @@ -1849,37 +2123,39 @@ func (ec *executionContext) _Mutation_oAuth_login(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(*model.Session) + res := resTmp.(string) fc.Result = res - return ec.marshalNSession2ᚖkloudliteᚗioᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐSession(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _Mutation_oAuth_addLogin(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Mutation", +func (ec *executionContext) fieldContext_OAuthProviderStatus_provider(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OAuthProviderStatus", Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, } + return fc, nil +} - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_oAuth_addLogin_args(ctx, rawArgs) +func (ec *executionContext) _OAuthProviderStatus_enabled(ctx context.Context, field graphql.CollectedField, obj *model.OAuthProviderStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OAuthProviderStatus_enabled(ctx, field) if err != nil { - ec.Error(ctx, err) return graphql.Null } - fc.Args = args + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.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().OAuthAddLogin(rctx, args["provider"].(string), args["state"].(string), args["code"].(string)) + return obj.Enabled, nil }) if err != nil { ec.Error(ctx, err) @@ -1896,22 +2172,31 @@ func (ec *executionContext) _Mutation_oAuth_addLogin(ctx context.Context, field return ec.marshalNBoolean2bool(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext_OAuthProviderStatus_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OAuthProviderStatus", + 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) _Query_auth_me(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_auth_me(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().AuthMe(rctx) @@ -1925,35 +2210,61 @@ func (ec *executionContext) _Query_auth_me(ctx context.Context, field graphql.Co } res := resTmp.(*model.User) fc.Result = res - return ec.marshalOUser2ᚖkloudliteᚗioᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐUser(ctx, field.Selections, res) + return ec.marshalOUser2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐUser(ctx, field.Selections, res) } -func (ec *executionContext) _Query_auth_findByEmail(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_Query_auth_me(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "Query", Field: field, - Args: nil, IsMethod: true, IsResolver: true, - } + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_User_id(ctx, field) + case "name": + return ec.fieldContext_User_name(ctx, field) + case "email": + return ec.fieldContext_User_email(ctx, field) + case "avatar": + return ec.fieldContext_User_avatar(ctx, field) + case "invite": + return ec.fieldContext_User_invite(ctx, field) + case "verified": + return ec.fieldContext_User_verified(ctx, field) + case "metadata": + return ec.fieldContext_User_metadata(ctx, field) + case "joined": + return ec.fieldContext_User_joined(ctx, field) + case "providerGitlab": + return ec.fieldContext_User_providerGitlab(ctx, field) + case "providerGithub": + return ec.fieldContext_User_providerGithub(ctx, field) + case "providerGoogle": + return ec.fieldContext_User_providerGoogle(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + }, + } + return fc, nil +} - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_auth_findByEmail_args(ctx, rawArgs) +func (ec *executionContext) _Query_auth_findByEmail(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_auth_findByEmail(ctx, field) if err != nil { - ec.Error(ctx, err) return graphql.Null } - fc.Args = args + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.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().AuthFindByEmail(rctx, args["email"].(string)) + return ec.resolvers.Query().AuthFindByEmail(rctx, fc.Args["email"].(string)) }) if err != nil { ec.Error(ctx, err) @@ -1964,35 +2275,72 @@ func (ec *executionContext) _Query_auth_findByEmail(ctx context.Context, field g } res := resTmp.(*model.User) fc.Result = res - return ec.marshalOUser2ᚖkloudliteᚗioᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐUser(ctx, field.Selections, res) + return ec.marshalOUser2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐUser(ctx, field.Selections, res) } -func (ec *executionContext) _Query_oAuth_requestLogin(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_Query_auth_findByEmail(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "Query", Field: field, - Args: nil, IsMethod: true, IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_User_id(ctx, field) + case "name": + return ec.fieldContext_User_name(ctx, field) + case "email": + return ec.fieldContext_User_email(ctx, field) + case "avatar": + return ec.fieldContext_User_avatar(ctx, field) + case "invite": + return ec.fieldContext_User_invite(ctx, field) + case "verified": + return ec.fieldContext_User_verified(ctx, field) + case "metadata": + return ec.fieldContext_User_metadata(ctx, field) + case "joined": + return ec.fieldContext_User_joined(ctx, field) + case "providerGitlab": + return ec.fieldContext_User_providerGitlab(ctx, field) + case "providerGithub": + return ec.fieldContext_User_providerGithub(ctx, field) + case "providerGoogle": + return ec.fieldContext_User_providerGoogle(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + }, } - + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_oAuth_requestLogin_args(ctx, rawArgs) - if err != nil { + if fc.Args, err = ec.field_Query_auth_findByEmail_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_oAuth_requestLogin(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_oAuth_requestLogin(ctx, field) + if err != nil { return graphql.Null } - fc.Args = args + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.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().OAuthRequestLogin(rctx, args["provider"].(string), args["state"].(*string)) + return ec.resolvers.Query().OAuthRequestLogin(rctx, fc.Args["provider"].(string), fc.Args["state"].(*string)) }) if err != nil { ec.Error(ctx, err) @@ -2009,32 +2357,45 @@ func (ec *executionContext) _Query_oAuth_requestLogin(ctx context.Context, field return ec.marshalNURL2string(ctx, field.Selections, res) } -func (ec *executionContext) _Query_auth_getRemoteLogin(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_Query_oAuth_requestLogin(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "Query", Field: field, - Args: nil, IsMethod: true, IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type URL 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) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_auth_getRemoteLogin_args(ctx, rawArgs) - if err != nil { + if fc.Args, err = ec.field_Query_oAuth_requestLogin_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_auth_getRemoteLogin(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_auth_getRemoteLogin(ctx, field) + if err != nil { return graphql.Null } - fc.Args = args + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.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().AuthGetRemoteLogin(rctx, args["loginId"].(string), args["secret"].(string)) + return ec.resolvers.Query().AuthGetRemoteLogin(rctx, fc.Args["loginId"].(string), fc.Args["secret"].(string)) }) if err != nil { ec.Error(ctx, err) @@ -2045,35 +2406,101 @@ func (ec *executionContext) _Query_auth_getRemoteLogin(ctx context.Context, fiel } res := resTmp.(*model.RemoteLogin) fc.Result = res - return ec.marshalORemoteLogin2ᚖkloudliteᚗioᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐRemoteLogin(ctx, field.Selections, res) + return ec.marshalORemoteLogin2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐRemoteLogin(ctx, field.Selections, res) } -func (ec *executionContext) _Query__entities(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { +func (ec *executionContext) fieldContext_Query_auth_getRemoteLogin(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 "status": + return ec.fieldContext_RemoteLogin_status(ctx, field) + case "authHeader": + return ec.fieldContext_RemoteLogin_authHeader(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type RemoteLogin", field.Name) + }, + } + defer func() { + if 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_auth_getRemoteLogin_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_auth_listOAuthProviders(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_auth_listOAuthProviders(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().AuthListOAuthProviders(rctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.OAuthProviderStatus) + fc.Result = res + return ec.marshalOOAuthProviderStatus2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐOAuthProviderStatusᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_auth_listOAuthProviders(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "Query", Field: field, - Args: nil, IsMethod: true, - IsResolver: false, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "provider": + return ec.fieldContext_OAuthProviderStatus_provider(ctx, field) + case "enabled": + return ec.fieldContext_OAuthProviderStatus_enabled(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OAuthProviderStatus", field.Name) + }, } + return fc, nil +} - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query__entities_args(ctx, rawArgs) +func (ec *executionContext) _Query__entities(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query__entities(ctx, field) if err != nil { - ec.Error(ctx, err) return graphql.Null } - fc.Args = args + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.__resolve_entities(ctx, args["representations"].([]map[string]interface{})), nil + return ec.__resolve_entities(ctx, fc.Args["representations"].([]map[string]interface{})), nil }) if err != nil { ec.Error(ctx, err) @@ -2090,22 +2517,42 @@ func (ec *executionContext) _Query__entities(ctx context.Context, field graphql. return ec.marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx, field.Selections, res) } -func (ec *executionContext) _Query__service(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_Query__entities(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "Query", Field: field, - Args: nil, IsMethod: true, IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type _Entity does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query__entities_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return } + return fc, nil +} +func (ec *executionContext) _Query__service(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query__service(ctx, field) + if err != nil { + return graphql.Null + } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.__resolve__service(ctx) @@ -2125,32 +2572,38 @@ func (ec *executionContext) _Query__service(ctx context.Context, field graphql.C return ec.marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx, field.Selections, res) } -func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_Query__service(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "Query", Field: field, - Args: nil, IsMethod: true, IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "sdl": + return ec.fieldContext__Service_sdl(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type _Service", field.Name) + }, } + return fc, nil +} - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query___type_args(ctx, rawArgs) +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 { - ec.Error(ctx, err) return graphql.Null } - fc.Args = args + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = 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(args["name"].(string)) + return ec.introspectType(fc.Args["name"].(string)) }) if err != nil { ec.Error(ctx, err) @@ -2164,22 +2617,64 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "Query", Field: field, - Args: nil, 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 } + 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() @@ -2196,22 +2691,45 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext_Query___schema(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 "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) _RemoteLogin_status(ctx context.Context, field graphql.CollectedField, obj *model.RemoteLogin) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RemoteLogin_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 } }() - fc := &graphql.FieldContext{ - Object: "RemoteLogin", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Status, nil @@ -2231,22 +2749,31 @@ func (ec *executionContext) _RemoteLogin_status(ctx context.Context, field graph return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _RemoteLogin_authHeader(ctx context.Context, field graphql.CollectedField, obj *model.RemoteLogin) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_RemoteLogin_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "RemoteLogin", Field: field, - Args: nil, IsMethod: false, IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, } + return fc, nil +} +func (ec *executionContext) _RemoteLogin_authHeader(ctx context.Context, field graphql.CollectedField, obj *model.RemoteLogin) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RemoteLogin_authHeader(ctx, field) + if err != nil { + return graphql.Null + } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.AuthHeader, nil @@ -2263,22 +2790,31 @@ func (ec *executionContext) _RemoteLogin_authHeader(ctx context.Context, field g return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext_RemoteLogin_authHeader(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "RemoteLogin", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _Session_id(ctx context.Context, field graphql.CollectedField, obj *model.Session) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Session_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 } }() - fc := &graphql.FieldContext{ - Object: "Session", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -2295,25 +2831,34 @@ func (ec *executionContext) _Session_id(ctx context.Context, field graphql.Colle } res := resTmp.(repos.ID) fc.Result = res - return ec.marshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx, field.Selections, res) } -func (ec *executionContext) _Session_userId(ctx context.Context, field graphql.CollectedField, obj *model.Session) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_Session_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "Session", Field: field, - Args: nil, 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) _Session_userId(ctx context.Context, field graphql.CollectedField, obj *model.Session) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Session_userId(ctx, field) + if err != nil { + return graphql.Null + } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.UserID, nil @@ -2330,25 +2875,34 @@ func (ec *executionContext) _Session_userId(ctx context.Context, field graphql.C } res := resTmp.(repos.ID) fc.Result = res - return ec.marshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx, field.Selections, res) } -func (ec *executionContext) _Session_userEmail(ctx context.Context, field graphql.CollectedField, obj *model.Session) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_Session_userId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "Session", Field: field, - Args: nil, 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) _Session_userEmail(ctx context.Context, field graphql.CollectedField, obj *model.Session) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Session_userEmail(ctx, field) + if err != nil { + return graphql.Null + } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.UserEmail, nil @@ -2368,22 +2922,31 @@ func (ec *executionContext) _Session_userEmail(ctx context.Context, field graphq return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _Session_loginMethod(ctx context.Context, field graphql.CollectedField, obj *model.Session) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_Session_userEmail(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "Session", Field: field, - Args: nil, IsMethod: false, IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, } + return fc, nil +} +func (ec *executionContext) _Session_loginMethod(ctx context.Context, field graphql.CollectedField, obj *model.Session) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Session_loginMethod(ctx, field) + if err != nil { + return graphql.Null + } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.LoginMethod, nil @@ -2403,22 +2966,31 @@ func (ec *executionContext) _Session_loginMethod(ctx context.Context, field grap return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _Session_userVerified(ctx context.Context, field graphql.CollectedField, obj *model.Session) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_Session_loginMethod(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "Session", Field: field, - Args: nil, IsMethod: false, IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, } + return fc, nil +} +func (ec *executionContext) _Session_userVerified(ctx context.Context, field graphql.CollectedField, obj *model.Session) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Session_userVerified(ctx, field) + if err != nil { + return graphql.Null + } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.UserVerified, nil @@ -2438,22 +3010,31 @@ func (ec *executionContext) _Session_userVerified(ctx context.Context, field gra return ec.marshalNBoolean2bool(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext_Session_userVerified(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Session", + 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) _User_id(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "User", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -2470,25 +3051,34 @@ func (ec *executionContext) _User_id(ctx context.Context, field graphql.Collecte } res := resTmp.(repos.ID) fc.Result = res - return ec.marshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx, field.Selections, res) } -func (ec *executionContext) _User_name(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_User_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "User", Field: field, - Args: nil, IsMethod: false, IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, } + return fc, nil +} +func (ec *executionContext) _User_name(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_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 @@ -2508,22 +3098,31 @@ func (ec *executionContext) _User_name(ctx context.Context, field graphql.Collec return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _User_email(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_User_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "User", Field: field, - Args: nil, IsMethod: false, IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, } + return fc, nil +} +func (ec *executionContext) _User_email(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_email(ctx, field) + if err != nil { + return graphql.Null + } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Email, nil @@ -2543,22 +3142,31 @@ func (ec *executionContext) _User_email(ctx context.Context, field graphql.Colle return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _User_avatar(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_User_email(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "User", Field: field, - Args: nil, IsMethod: false, IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, } + return fc, nil +} +func (ec *executionContext) _User_avatar(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_avatar(ctx, field) + if err != nil { + return graphql.Null + } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Avatar, nil @@ -2575,22 +3183,31 @@ func (ec *executionContext) _User_avatar(ctx context.Context, field graphql.Coll return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) _User_invite(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_User_avatar(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "User", Field: field, - Args: nil, IsMethod: false, IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, } + return fc, nil +} +func (ec *executionContext) _User_invite(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_invite(ctx, field) + if err != nil { + return graphql.Null + } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Invite, nil @@ -2610,22 +3227,31 @@ func (ec *executionContext) _User_invite(ctx context.Context, field graphql.Coll return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _User_verified(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_User_invite(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "User", Field: field, - Args: nil, IsMethod: false, IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, } + return fc, nil +} +func (ec *executionContext) _User_verified(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_verified(ctx, field) + if err != nil { + return graphql.Null + } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Verified, nil @@ -2645,22 +3271,31 @@ func (ec *executionContext) _User_verified(ctx context.Context, field graphql.Co return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) _User_metadata(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_User_verified(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "User", Field: field, - Args: nil, 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) _User_metadata(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_metadata(ctx, field) + if err != nil { + return graphql.Null + } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Metadata, nil @@ -2677,22 +3312,31 @@ func (ec *executionContext) _User_metadata(ctx context.Context, field graphql.Co return ec.marshalOJson2map(ctx, field.Selections, res) } -func (ec *executionContext) _User_joined(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_User_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "User", Field: field, - Args: nil, IsMethod: false, IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Json does not have child fields") + }, } + return fc, nil +} +func (ec *executionContext) _User_joined(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_joined(ctx, field) + if err != nil { + return graphql.Null + } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Joined, nil @@ -2712,22 +3356,31 @@ func (ec *executionContext) _User_joined(ctx context.Context, field graphql.Coll return ec.marshalNDate2string(ctx, field.Selections, res) } -func (ec *executionContext) _User_providerGitlab(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_User_joined(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "User", Field: field, - Args: nil, IsMethod: false, IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, } + return fc, nil +} +func (ec *executionContext) _User_providerGitlab(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_providerGitlab(ctx, field) + if err != nil { + return graphql.Null + } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.ProviderGitlab, nil @@ -2744,22 +3397,31 @@ func (ec *executionContext) _User_providerGitlab(ctx context.Context, field grap return ec.marshalOProviderDetail2map(ctx, field.Selections, res) } -func (ec *executionContext) _User_providerGithub(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_User_providerGitlab(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "User", Field: field, - Args: nil, IsMethod: false, IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ProviderDetail does not have child fields") + }, } + return fc, nil +} +func (ec *executionContext) _User_providerGithub(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_providerGithub(ctx, field) + if err != nil { + return graphql.Null + } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.ProviderGithub, nil @@ -2776,22 +3438,31 @@ func (ec *executionContext) _User_providerGithub(ctx context.Context, field grap return ec.marshalOProviderDetail2map(ctx, field.Selections, res) } -func (ec *executionContext) _User_providerGoogle(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_User_providerGithub(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "User", Field: field, - Args: nil, IsMethod: false, IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ProviderDetail does not have child fields") + }, } + return fc, nil +} +func (ec *executionContext) _User_providerGoogle(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_providerGoogle(ctx, field) + if err != nil { + return graphql.Null + } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.ProviderGoogle, nil @@ -2808,22 +3479,31 @@ func (ec *executionContext) _User_providerGoogle(ctx context.Context, field grap return ec.marshalOProviderDetail2map(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext_User_providerGoogle(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ProviderDetail does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) __Service_sdl(ctx context.Context, field graphql.CollectedField, obj *fedruntime.Service) (ret graphql.Marshaler) { + fc, err := ec.fieldContext__Service_sdl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "_Service", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.SDL, nil @@ -2840,22 +3520,31 @@ func (ec *executionContext) __Service_sdl(ctx context.Context, field graphql.Col return ec.marshalOString2string(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext__Service_sdl(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "_Service", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field 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 } }() - fc := &graphql.FieldContext{ - Object: "__Directive", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -2875,22 +3564,31 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Directive_name(ctx 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 } }() - fc := &graphql.FieldContext{ - Object: "__Directive", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description(), nil @@ -2907,22 +3605,31 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Directive_description(ctx 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 } }() - fc := &graphql.FieldContext{ - Object: "__Directive", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Locations, nil @@ -2942,22 +3649,31 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext___Directive_locations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "__Directive", Field: field, - Args: nil, 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 @@ -2977,22 +3693,41 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) } -func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext___Directive_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "__Directive", Field: field, - Args: nil, 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 @@ -3012,22 +3747,31 @@ func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field return ec.marshalNBoolean2bool(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Directive_isRepeatable(ctx 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 } }() - fc := &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -3047,22 +3791,31 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___EnumValue_name(ctx 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 } }() - fc := &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description(), nil @@ -3079,22 +3832,31 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext___EnumValue_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "__EnumValue", Field: field, - Args: nil, 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 @@ -3114,22 +3876,31 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "__EnumValue", Field: field, - Args: nil, 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 @@ -3146,22 +3917,31 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___EnumValue_deprecationReason(ctx 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 } }() - fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -3181,22 +3961,31 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext___Field_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "__Field", Field: field, - Args: nil, - IsMethod: true, + IsMethod: false, IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, } + return 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 @@ -3213,22 +4002,31 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Field_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) ___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 } }() - fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Args, nil @@ -3248,22 +4046,41 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) } -func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext___Field_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "__Field", Field: field, - Args: nil, 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 @@ -3283,22 +4100,53 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Field_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.IsDeprecated(), nil @@ -3318,22 +4166,31 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext___Field_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "__Field", Field: field, - Args: nil, 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 @@ -3350,22 +4207,31 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Field_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -3385,22 +4251,31 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return ec.marshalNString2string(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___InputValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, 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 } }() - fc := &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description(), nil @@ -3417,22 +4292,31 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___InputValue_description(ctx 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 } }() - fc := &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Type, nil @@ -3452,22 +4336,53 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___InputValue_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + 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 } }() - fc := &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DefaultValue, nil @@ -3484,22 +4399,31 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + 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 } }() - fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description(), nil @@ -3516,22 +4440,31 @@ func (ec *executionContext) ___Schema_description(ctx context.Context, field gra return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext___Schema_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "__Schema", Field: field, - Args: nil, 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 @@ -3551,22 +4484,53 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Schema_types(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_queryType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.QueryType(), nil @@ -3586,22 +4550,53 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Schema_queryType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_mutationType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.MutationType(), nil @@ -3618,22 +4613,53 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Schema_mutationType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.SubscriptionType(), nil @@ -3650,22 +4676,53 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_directives(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Directives(), nil @@ -3685,22 +4742,43 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Schema_directives(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Directive_name(ctx, field) + case "description": + return ec.fieldContext___Directive_description(ctx, field) + case "locations": + return ec.fieldContext___Directive_locations(ctx, field) + case "args": + return ec.fieldContext___Directive_args(ctx, field) + case "isRepeatable": + return ec.fieldContext___Directive_isRepeatable(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Kind(), nil @@ -3720,22 +4798,31 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return ec.marshalN__TypeKind2string(ctx, field.Selections, res) } -func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext___Type_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "__Type", Field: field, - Args: nil, 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 @@ -3752,22 +4839,31 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext___Type_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "__Type", Field: field, - Args: nil, 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 @@ -3784,32 +4880,34 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext___Type_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "__Type", Field: field, - Args: nil, 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 +} - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field___Type_fields_args(ctx, rawArgs) +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 { - ec.Error(ctx, err) return graphql.Null } - fc.Args = args + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = 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(args["includeDeprecated"].(bool)), nil + return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil }) if err != nil { ec.Error(ctx, err) @@ -3823,22 +4921,56 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) } -func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "__Type", Field: field, - Args: nil, IsMethod: true, IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Field_name(ctx, field) + case "description": + return ec.fieldContext___Field_description(ctx, field) + case "args": + return ec.fieldContext___Field_args(ctx, field) + case "type": + return ec.fieldContext___Field_type(ctx, field) + case "isDeprecated": + return ec.fieldContext___Field_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___Field_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) + }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} +func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_interfaces(ctx, field) + if err != nil { + return graphql.Null + } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Interfaces(), nil @@ -3855,22 +4987,53 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Type_interfaces(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.PossibleTypes(), nil @@ -3887,32 +5050,56 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext___Type_possibleTypes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "__Type", Field: field, - Args: nil, 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 +} - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field___Type_enumValues_args(ctx, rawArgs) +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 { - ec.Error(ctx, err) return graphql.Null } - fc.Args = args + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = 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(args["includeDeprecated"].(bool)), nil + return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil }) if err != nil { ec.Error(ctx, err) @@ -3926,22 +5113,52 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) } -func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "__Type", Field: field, - Args: nil, IsMethod: true, IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___EnumValue_name(ctx, field) + case "description": + return ec.fieldContext___EnumValue_description(ctx, field) + case "isDeprecated": + return ec.fieldContext___EnumValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___EnumValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return } + return fc, nil +} +func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_inputFields(ctx, field) + if err != nil { + return graphql.Null + } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.InputFields(), nil @@ -3958,22 +5175,41 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) } -func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext___Type_inputFields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "__Type", Field: field, - Args: nil, 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 @@ -3990,22 +5226,53 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Type_ofType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.SpecifiedByURL(), nil @@ -4022,6 +5289,19 @@ func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field gr return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + // endregion **************************** field.gotpl ***************************** // region **************************** input.gotpl ***************************** @@ -4123,162 +5403,165 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) case "__typename": out.Values[i] = graphql.MarshalString("Mutation") case "auth_setRemoteAuthHeader": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_auth_setRemoteAuthHeader(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_auth_setRemoteAuthHeader(ctx, field) + }) if out.Values[i] == graphql.Null { invalids++ } case "auth_createRemoteLogin": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_auth_createRemoteLogin(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_auth_createRemoteLogin(ctx, field) + }) if out.Values[i] == graphql.Null { invalids++ } case "auth_login": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_auth_login(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_auth_login(ctx, field) + }) case "auth_signup": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_auth_signup(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_auth_signup(ctx, field) + }) case "auth_logout": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_auth_logout(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_auth_logout(ctx, field) + }) if out.Values[i] == graphql.Null { invalids++ } case "auth_setMetadata": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_auth_setMetadata(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_auth_setMetadata(ctx, field) + }) if out.Values[i] == graphql.Null { invalids++ } case "auth_clearMetadata": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_auth_clearMetadata(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_auth_clearMetadata(ctx, field) + }) if out.Values[i] == graphql.Null { invalids++ } case "auth_verifyEmail": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_auth_verifyEmail(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_auth_verifyEmail(ctx, field) + }) if out.Values[i] == graphql.Null { invalids++ } case "auth_resetPassword": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_auth_resetPassword(ctx, field) - } - - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "auth_requestResetPassword": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_auth_requestResetPassword(ctx, field) - } - - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "auth_loginWithInviteToken": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_auth_loginWithInviteToken(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_auth_resetPassword(ctx, field) + }) - case "auth_inviteSignup": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_auth_inviteSignup(ctx, field) + if out.Values[i] == graphql.Null { + invalids++ } + case "auth_requestResetPassword": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_auth_requestResetPassword(ctx, field) + }) if out.Values[i] == graphql.Null { invalids++ } case "auth_changeEmail": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_auth_changeEmail(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_auth_changeEmail(ctx, field) + }) if out.Values[i] == graphql.Null { invalids++ } case "auth_resendVerificationEmail": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_auth_resendVerificationEmail(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_auth_resendVerificationEmail(ctx, field) + }) if out.Values[i] == graphql.Null { invalids++ } case "auth_changePassword": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_auth_changePassword(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_auth_changePassword(ctx, field) + }) if out.Values[i] == graphql.Null { invalids++ } case "oAuth_login": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_oAuth_login(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_oAuth_login(ctx, field) + }) if out.Values[i] == graphql.Null { invalids++ } case "oAuth_addLogin": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_oAuth_addLogin(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var oAuthProviderStatusImplementors = []string{"OAuthProviderStatus"} + +func (ec *executionContext) _OAuthProviderStatus(ctx context.Context, sel ast.SelectionSet, obj *model.OAuthProviderStatus) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, oAuthProviderStatusImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("OAuthProviderStatus") + case "provider": + + out.Values[i] = ec._OAuthProviderStatus_provider(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } + case "enabled": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec._OAuthProviderStatus_enabled(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -4393,6 +5676,26 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) } + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "auth_listOAuthProviders": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_auth_listOAuthProviders(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + out.Concurrently(i, func() graphql.Marshaler { return rrm(innerCtx) }) @@ -4443,18 +5746,16 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return rrm(innerCtx) }) case "__type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___type(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + }) case "__schema": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___schema(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + 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)) @@ -4478,21 +5779,15 @@ func (ec *executionContext) _RemoteLogin(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("RemoteLogin") case "status": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._RemoteLogin_status(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._RemoteLogin_status(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "authHeader": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._RemoteLogin_authHeader(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._RemoteLogin_authHeader(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -4516,51 +5811,36 @@ func (ec *executionContext) _Session(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("Session") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Session_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Session_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "userId": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Session_userId(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Session_userId(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "userEmail": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Session_userEmail(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Session_userEmail(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "loginMethod": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Session_loginMethod(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Session_loginMethod(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "userVerified": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Session_userVerified(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Session_userVerified(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -4587,99 +5867,66 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("User") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "email": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_email(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_email(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "avatar": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_avatar(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_avatar(ctx, field, obj) case "invite": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_invite(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_invite(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "verified": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_verified(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_verified(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "metadata": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_metadata(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_metadata(ctx, field, obj) case "joined": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_joined(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_joined(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "providerGitlab": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_providerGitlab(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_providerGitlab(ctx, field, obj) case "providerGithub": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_providerGithub(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_providerGithub(ctx, field, obj) case "providerGoogle": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_providerGoogle(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_providerGoogle(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -4703,11 +5950,8 @@ func (ec *executionContext) __Service(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("_Service") case "sdl": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.__Service_sdl(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.__Service_sdl(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -4731,48 +5975,33 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__Directive") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_description(ctx, field, obj) case "locations": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_locations(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_locations(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isRepeatable": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_isRepeatable(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -4799,38 +6028,26 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__EnumValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -4854,58 +6071,40 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Field") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_description(ctx, field, obj) case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -4929,38 +6128,26 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("__InputValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_description(ctx, field, obj) case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "defaultValue": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_defaultValue(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -4984,52 +6171,34 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Schema") case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_description(ctx, field, obj) case "types": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_types(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_types(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "queryType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_queryType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "mutationType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_mutationType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) case "subscriptionType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_subscriptionType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) case "directives": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_directives(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_directives(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -5056,77 +6225,47 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("__Type") case "kind": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_kind(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_kind(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_name(ctx, field, obj) case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_description(ctx, field, obj) case "fields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_fields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_fields(ctx, field, obj) case "interfaces": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_interfaces(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) case "possibleTypes": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_possibleTypes(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) case "enumValues": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_enumValues(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) case "inputFields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_inputFields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) case "ofType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_ofType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_ofType(ctx, field, obj) case "specifiedByURL": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_specifiedByURL(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -5152,7 +6291,7 @@ func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.Se res := graphql.MarshalBoolean(v) if res == graphql.Null { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } } return res @@ -5167,23 +6306,23 @@ func (ec *executionContext) marshalNDate2string(ctx context.Context, sel ast.Sel res := graphql.MarshalString(v) if res == graphql.Null { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } } return res } -func (ec *executionContext) unmarshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx context.Context, v interface{}) (repos.ID, error) { +func (ec *executionContext) unmarshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx context.Context, v interface{}) (repos.ID, error) { tmp, err := graphql.UnmarshalString(v) res := repos.ID(tmp) return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx context.Context, sel ast.SelectionSet, v repos.ID) graphql.Marshaler { +func (ec *executionContext) marshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx context.Context, sel ast.SelectionSet, v repos.ID) graphql.Marshaler { res := graphql.MarshalString(string(v)) if res == graphql.Null { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } } return res @@ -5197,27 +6336,37 @@ func (ec *executionContext) unmarshalNJson2map(ctx context.Context, v interface{ func (ec *executionContext) marshalNJson2map(ctx context.Context, sel ast.SelectionSet, v map[string]interface{}) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } res := graphql.MarshalMap(v) if res == graphql.Null { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } } return res } -func (ec *executionContext) marshalNSession2kloudliteᚗioᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐSession(ctx context.Context, sel ast.SelectionSet, v model.Session) graphql.Marshaler { +func (ec *executionContext) marshalNOAuthProviderStatus2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐOAuthProviderStatus(ctx context.Context, sel ast.SelectionSet, v *model.OAuthProviderStatus) 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._OAuthProviderStatus(ctx, sel, v) +} + +func (ec *executionContext) marshalNSession2githubᚗcomᚋkloudliteᚋapiᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐSession(ctx context.Context, sel ast.SelectionSet, v model.Session) graphql.Marshaler { return ec._Session(ctx, sel, &v) } -func (ec *executionContext) marshalNSession2ᚖkloudliteᚗioᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐSession(ctx context.Context, sel ast.SelectionSet, v *model.Session) graphql.Marshaler { +func (ec *executionContext) marshalNSession2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐSession(ctx context.Context, sel ast.SelectionSet, v *model.Session) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } @@ -5233,7 +6382,7 @@ func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.S res := graphql.MarshalString(v) if res == graphql.Null { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } } return res @@ -5248,20 +6397,20 @@ func (ec *executionContext) marshalNURL2string(ctx context.Context, sel ast.Sele res := graphql.MarshalString(v) if res == graphql.Null { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } } return res } -func (ec *executionContext) marshalNUser2kloudliteᚗioᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐUser(ctx context.Context, sel ast.SelectionSet, v model.User) graphql.Marshaler { +func (ec *executionContext) marshalNUser2githubᚗcomᚋkloudliteᚋapiᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐUser(ctx context.Context, sel ast.SelectionSet, v model.User) graphql.Marshaler { return ec._User(ctx, sel, &v) } -func (ec *executionContext) marshalNUser2ᚖkloudliteᚗioᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐUser(ctx context.Context, sel ast.SelectionSet, v *model.User) graphql.Marshaler { +func (ec *executionContext) marshalNUser2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐUser(ctx context.Context, sel ast.SelectionSet, v *model.User) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } @@ -5276,14 +6425,14 @@ func (ec *executionContext) unmarshalN_Any2map(ctx context.Context, v interface{ func (ec *executionContext) marshalN_Any2map(ctx context.Context, sel ast.SelectionSet, v map[string]interface{}) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } res := graphql.MarshalMap(v) if res == graphql.Null { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } } return res @@ -5368,7 +6517,7 @@ func (ec *executionContext) marshalN_FieldSet2string(ctx context.Context, sel as res := graphql.MarshalString(v) if res == graphql.Null { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } } return res @@ -5435,7 +6584,7 @@ func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Conte res := graphql.MarshalString(v) if res == graphql.Null { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } } return res @@ -5609,7 +6758,7 @@ func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgen 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, "must not be null") + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } @@ -5625,7 +6774,7 @@ func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel a res := graphql.MarshalString(v) if res == graphql.Null { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } } return res @@ -5673,6 +6822,53 @@ func (ec *executionContext) marshalOJson2map(ctx context.Context, sel ast.Select return res } +func (ec *executionContext) marshalOOAuthProviderStatus2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐOAuthProviderStatusᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.OAuthProviderStatus) 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.marshalNOAuthProviderStatus2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐOAuthProviderStatus(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) unmarshalOProviderDetail2map(ctx context.Context, v interface{}) (map[string]interface{}, error) { if v == nil { return nil, nil @@ -5689,14 +6885,14 @@ func (ec *executionContext) marshalOProviderDetail2map(ctx context.Context, sel return res } -func (ec *executionContext) marshalORemoteLogin2ᚖkloudliteᚗioᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐRemoteLogin(ctx context.Context, sel ast.SelectionSet, v *model.RemoteLogin) graphql.Marshaler { +func (ec *executionContext) marshalORemoteLogin2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐRemoteLogin(ctx context.Context, sel ast.SelectionSet, v *model.RemoteLogin) graphql.Marshaler { if v == nil { return graphql.Null } return ec._RemoteLogin(ctx, sel, v) } -func (ec *executionContext) marshalOSession2ᚖkloudliteᚗioᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐSession(ctx context.Context, sel ast.SelectionSet, v *model.Session) graphql.Marshaler { +func (ec *executionContext) marshalOSession2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐSession(ctx context.Context, sel ast.SelectionSet, v *model.Session) graphql.Marshaler { if v == nil { return graphql.Null } @@ -5729,7 +6925,7 @@ func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel as return res } -func (ec *executionContext) marshalOUser2ᚖkloudliteᚗioᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐUser(ctx context.Context, sel ast.SelectionSet, v *model.User) graphql.Marshaler { +func (ec *executionContext) marshalOUser2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋauthᚋinternalᚋappᚋgraphᚋmodelᚐUser(ctx context.Context, sel ast.SelectionSet, v *model.User) graphql.Marshaler { if v == nil { return graphql.Null } diff --git a/apps/auth/internal/app/graph/model/models_gen.go b/apps/auth/internal/app/graph/model/models_gen.go index 6365f17fc..c7ac1de43 100644 --- a/apps/auth/internal/app/graph/model/models_gen.go +++ b/apps/auth/internal/app/graph/model/models_gen.go @@ -3,12 +3,17 @@ package model import ( - "kloudlite.io/pkg/repos" + "github.com/kloudlite/api/pkg/repos" ) +type OAuthProviderStatus struct { + Provider string `json:"provider"` + Enabled bool `json:"enabled"` +} + type RemoteLogin struct { Status string `json:"status"` - AuthHeader *string `json:"authHeader"` + AuthHeader *string `json:"authHeader,omitempty"` } type Session struct { @@ -23,14 +28,14 @@ type User struct { ID repos.ID `json:"id"` Name string `json:"name"` Email string `json:"email"` - Avatar *string `json:"avatar"` + Avatar *string `json:"avatar,omitempty"` Invite string `json:"invite"` Verified bool `json:"verified"` - Metadata map[string]interface{} `json:"metadata"` + Metadata map[string]interface{} `json:"metadata,omitempty"` Joined string `json:"joined"` - ProviderGitlab map[string]interface{} `json:"providerGitlab"` - ProviderGithub map[string]interface{} `json:"providerGithub"` - ProviderGoogle map[string]interface{} `json:"providerGoogle"` + ProviderGitlab map[string]interface{} `json:"providerGitlab,omitempty"` + ProviderGithub map[string]interface{} `json:"providerGithub,omitempty"` + ProviderGoogle map[string]interface{} `json:"providerGoogle,omitempty"` } func (User) IsEntity() {} diff --git a/apps/auth/internal/app/graph/resolver.go b/apps/auth/internal/app/graph/resolver.go index fa4b5915d..cf16385c4 100644 --- a/apps/auth/internal/app/graph/resolver.go +++ b/apps/auth/internal/app/graph/resolver.go @@ -1,17 +1,22 @@ package graph -import "kloudlite.io/apps/auth/internal/domain" +import ( + "github.com/kloudlite/api/apps/auth/internal/domain" + "github.com/kloudlite/api/apps/auth/internal/env" +) // This file will not be regenerated automatically. // // It serves as dependency injection for your app, add any dependencies you require here. type Resolver struct { - d domain.Domain + d domain.Domain + ev *env.Env } -func NewResolver(d domain.Domain) *Resolver { +func NewResolver(d domain.Domain, ev *env.Env) *Resolver { return &Resolver{ d: d, + ev: ev, } } diff --git a/apps/auth/internal/app/graph/schema.graphqls b/apps/auth/internal/app/graph/schema.graphqls index c27caca97..1989ded4a 100644 --- a/apps/auth/internal/app/graph/schema.graphqls +++ b/apps/auth/internal/app/graph/schema.graphqls @@ -4,16 +4,22 @@ scalar ProviderDetail scalar URL scalar Any +type RemoteLogin { + status: String! + authHeader: String +} + +type OAuthProviderStatus { + provider: String! + enabled: Boolean! +} + type Query { auth_me: User # public-access auth_findByEmail(email: String!): User # public-access # Deprecate oAuth_requestLogin(provider: String!, state: String): URL! # public-access auth_getRemoteLogin(loginId: String!, secret: String!): RemoteLogin # public-access -} - -type RemoteLogin { - status: String! - authHeader: String + auth_listOAuthProviders: [OAuthProviderStatus!] } type Mutation { @@ -28,7 +34,6 @@ type Mutation { auth_verifyEmail(token: String!): Session! # public-access # TBD auth_resetPassword(token: String!, password: String!): Boolean! # user-access auth_requestResetPassword(email: String!): Boolean! # user-access - auth_loginWithInviteToken(inviteToken: String!): Session # public-access # Deprecate auth_changeEmail(email: String!): Boolean! # user-access #Done auth_resendVerificationEmail: Boolean! # user-access #Done auth_changePassword(currentPassword: String!, newPassword: String!): Boolean! # user-access #Done diff --git a/apps/auth/internal/app/graph/schema.resolvers.go b/apps/auth/internal/app/graph/schema.resolvers.go index 4eac324fb..36eca004a 100644 --- a/apps/auth/internal/app/graph/schema.resolvers.go +++ b/apps/auth/internal/app/graph/schema.resolvers.go @@ -2,51 +2,62 @@ 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.28 import ( "context" - "errors" - - "kloudlite.io/apps/auth/internal/app/graph/generated" - "kloudlite.io/apps/auth/internal/app/graph/model" - "kloudlite.io/common" - klErrors "kloudlite.io/pkg/errors" - httpServer "kloudlite.io/pkg/http-server" - "kloudlite.io/pkg/repos" + + "github.com/kloudlite/api/apps/auth/internal/app/graph/generated" + "github.com/kloudlite/api/apps/auth/internal/app/graph/model" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/errors" + klErrors "github.com/kloudlite/api/pkg/errors" + httpServer "github.com/kloudlite/api/pkg/http-server" + "github.com/kloudlite/api/pkg/repos" ) +// AuthSetRemoteAuthHeader is the resolver for the auth_setRemoteAuthHeader field. func (r *mutationResolver) AuthSetRemoteAuthHeader(ctx context.Context, loginID string, authHeader *string) (bool, error) { err := r.d.SetRemoteLoginAuthHeader(ctx, repos.ID(loginID), *authHeader) - return err == nil, err + return err == nil, klErrors.NewE(err) } +// AuthCreateRemoteLogin is the resolver for the auth_createRemoteLogin field. func (r *mutationResolver) AuthCreateRemoteLogin(ctx context.Context, secret *string) (string, error) { login, err := r.d.CreateRemoteLogin(ctx, *secret) if err != nil { - return "", err + return "", klErrors.NewE(err) } return string(login), nil } +// AuthLogin is the resolver for the auth_login field. func (r *mutationResolver) AuthLogin(ctx context.Context, email string, password string) (*model.Session, error) { sessionEntity, err := r.d.Login(ctx, email, password) if err != nil { - return nil, err + return nil, klErrors.NewE(err) + } + + if !sessionEntity.UserVerified { + return nil, errors.New("user email not verified") } + httpServer.SetSession(ctx, sessionEntity) return sessionModelFromAuthSession(sessionEntity), err } +// AuthSignup is the resolver for the auth_signup field. func (r *mutationResolver) AuthSignup(ctx context.Context, name string, email string, password string) (*model.Session, error) { sessionEntity, err := r.d.SignUp(ctx, name, email, password) if err != nil { - return nil, err + return nil, klErrors.NewE(err) } httpServer.SetSession(ctx, sessionEntity) session := sessionModelFromAuthSession(sessionEntity) return session, err } +// AuthLogout is the resolver for the auth_logout field. func (r *mutationResolver) AuthLogout(ctx context.Context) (bool, error) { session := httpServer.GetSession[*common.AuthSession](ctx) if session == nil { @@ -56,49 +67,44 @@ func (r *mutationResolver) AuthLogout(ctx context.Context) (bool, error) { return true, nil } +// AuthSetMetadata is the resolver for the auth_setMetadata field. func (r *mutationResolver) AuthSetMetadata(ctx context.Context, values map[string]interface{}) (*model.User, error) { session := httpServer.GetSession[*common.AuthSession](ctx) if session == nil { return nil, errors.New("user not logged in") } userEntity, err := r.d.SetUserMetadata(ctx, session.UserId, values) - return userModelFromEntity(userEntity), err + return userModelFromEntity(userEntity), klErrors.NewE(err) } +// AuthClearMetadata is the resolver for the auth_clearMetadata field. func (r *mutationResolver) AuthClearMetadata(ctx context.Context) (*model.User, error) { session := httpServer.GetSession[*common.AuthSession](ctx) if session == nil { return nil, errors.New("user not logged in") } userEntity, err := r.d.ClearUserMetadata(ctx, session.UserId) - return userModelFromEntity(userEntity), err + return userModelFromEntity(userEntity), klErrors.NewE(err) } +// AuthVerifyEmail is the resolver for the auth_verifyEmail field. func (r *mutationResolver) AuthVerifyEmail(ctx context.Context, token string) (*model.Session, error) { sessionEntity, err := r.d.VerifyEmail(ctx, token) httpServer.SetSession(ctx, sessionEntity) - return sessionModelFromAuthSession(sessionEntity), err + return sessionModelFromAuthSession(sessionEntity), klErrors.NewE(err) } +// AuthResetPassword is the resolver for the auth_resetPassword field. func (r *mutationResolver) AuthResetPassword(ctx context.Context, token string, password string) (bool, error) { return r.d.ResetPassword(ctx, token, password) } +// AuthRequestResetPassword is the resolver for the auth_requestResetPassword field. func (r *mutationResolver) AuthRequestResetPassword(ctx context.Context, email string) (bool, error) { return r.d.RequestResetPassword(ctx, email) } -func (r *mutationResolver) AuthLoginWithInviteToken(ctx context.Context, inviteToken string) (*model.Session, error) { - // TODO - sessionE, err := r.d.LoginWithInviteToken(ctx, inviteToken) - return sessionModelFromAuthSession(sessionE), err -} - -func (r *mutationResolver) AuthInviteSignup(ctx context.Context, email string, name string) (repos.ID, error) { - // TODO - return r.d.InviteUser(ctx, email, name) -} - +// AuthChangeEmail is the resolver for the auth_changeEmail field. func (r *mutationResolver) AuthChangeEmail(ctx context.Context, email string) (bool, error) { session := httpServer.GetSession[*common.AuthSession](ctx) if session == nil { @@ -107,6 +113,7 @@ func (r *mutationResolver) AuthChangeEmail(ctx context.Context, email string) (b return r.d.ChangeEmail(ctx, session.UserId, email) } +// AuthResendVerificationEmail is the resolver for the auth_resendVerificationEmail field. func (r *mutationResolver) AuthResendVerificationEmail(ctx context.Context) (bool, error) { session := httpServer.GetSession[*common.AuthSession](ctx) if session == nil { @@ -115,6 +122,7 @@ func (r *mutationResolver) AuthResendVerificationEmail(ctx context.Context) (boo return r.d.ResendVerificationEmail(ctx, session.UserId) } +// AuthChangePassword is the resolver for the auth_changePassword field. func (r *mutationResolver) AuthChangePassword(ctx context.Context, currentPassword string, newPassword string) (bool, error) { session := httpServer.GetSession[*common.AuthSession](ctx) if session == nil { @@ -123,6 +131,7 @@ func (r *mutationResolver) AuthChangePassword(ctx context.Context, currentPasswo return r.d.ChangePassword(ctx, session.UserId, currentPassword, newPassword) } +// OAuthLogin is the resolver for the oAuth_login field. func (r *mutationResolver) OAuthLogin(ctx context.Context, provider string, code string, state *string) (*model.Session, error) { st := "" if state != nil { @@ -133,9 +142,10 @@ func (r *mutationResolver) OAuthLogin(ctx context.Context, provider string, code return nil, klErrors.NewEf(err, "could not create session") } httpServer.SetSession(ctx, sessionEntity) - return sessionModelFromAuthSession(sessionEntity), err + return sessionModelFromAuthSession(sessionEntity), klErrors.NewE(err) } +// OAuthAddLogin is the resolver for the oAuth_addLogin field. func (r *mutationResolver) OAuthAddLogin(ctx context.Context, provider string, state string, code string) (bool, error) { session := httpServer.GetSession[*common.AuthSession](ctx) if session == nil { @@ -144,6 +154,7 @@ func (r *mutationResolver) OAuthAddLogin(ctx context.Context, provider string, s return r.d.OauthAddLogin(ctx, session.UserId, provider, state, code) } +// AuthMe is the resolver for the auth_me field. func (r *queryResolver) AuthMe(ctx context.Context) (*model.User, error) { session := httpServer.GetSession[*common.AuthSession](ctx) if session == nil { @@ -151,19 +162,21 @@ func (r *queryResolver) AuthMe(ctx context.Context) (*model.User, error) { } u, err := r.d.GetUserById(ctx, session.UserId) if err != nil { - return nil, err + return nil, klErrors.NewE(err) } if u == nil { return nil, klErrors.Newf("user(email=%s) does not exist in system", session.UserEmail) } - return userModelFromEntity(u), err + return userModelFromEntity(u), klErrors.NewE(err) } +// AuthFindByEmail is the resolver for the auth_findByEmail field. func (r *queryResolver) AuthFindByEmail(ctx context.Context, email string) (*model.User, error) { userEntity, err := r.d.GetUserByEmail(ctx, email) - return userModelFromEntity(userEntity), err + return userModelFromEntity(userEntity), klErrors.NewE(err) } +// OAuthRequestLogin is the resolver for the oAuth_requestLogin field. func (r *queryResolver) OAuthRequestLogin(ctx context.Context, provider string, state *string) (string, error) { _state := "" if state != nil { @@ -176,6 +189,7 @@ func (r *queryResolver) OAuthRequestLogin(ctx context.Context, provider string, return url, nil } +// AuthGetRemoteLogin is the resolver for the auth_getRemoteLogin field. func (r *queryResolver) AuthGetRemoteLogin(ctx context.Context, loginID string, secret string) (*model.RemoteLogin, error) { login, err := r.d.GetRemoteLogin(ctx, repos.ID(loginID), secret) if err != nil { @@ -187,11 +201,34 @@ func (r *queryResolver) AuthGetRemoteLogin(ctx context.Context, loginID string, }, nil } +// AuthListOAuthProviders is the resolver for the auth_listOAuthProviders field. +func (r *queryResolver) AuthListOAuthProviders(ctx context.Context) ([]*model.OAuthProviderStatus, error) { + if !r.ev.OAuth2Enabled { + return []*model.OAuthProviderStatus{}, nil + } + return []*model.OAuthProviderStatus{ + { + Provider: "github", + Enabled: r.ev.OAuth2GithubEnabled, + }, + { + Provider: "gitlab", + Enabled: r.ev.OAuth2GitlabEnabled, + }, + { + Provider: "google", + Enabled: r.ev.OAuth2GoogleEnabled, + }, + }, nil +} + // Mutation returns generated.MutationResolver implementation. func (r *Resolver) Mutation() generated.MutationResolver { return &mutationResolver{r} } // Query returns generated.QueryResolver implementation. func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} } -type mutationResolver struct{ *Resolver } -type queryResolver struct{ *Resolver } +type ( + mutationResolver struct{ *Resolver } + queryResolver struct{ *Resolver } +) diff --git a/apps/auth/internal/app/grpc-server.go b/apps/auth/internal/app/grpc-server.go index 25f468327..4fced8aeb 100644 --- a/apps/auth/internal/app/grpc-server.go +++ b/apps/auth/internal/app/grpc-server.go @@ -2,10 +2,11 @@ package app import ( "context" + "github.com/kloudlite/api/pkg/repos" - "kloudlite.io/apps/auth/internal/domain" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/auth" - "kloudlite.io/pkg/errors" + "github.com/kloudlite/api/apps/auth/internal/domain" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/auth" + "github.com/kloudlite/api/pkg/errors" ) type authGrpcServer struct { @@ -13,6 +14,21 @@ type authGrpcServer struct { d domain.Domain } +func (a *authGrpcServer) GetUser(ctx context.Context, in *auth.GetUserIn) (*auth.GetUserOut, error) { + user, err := a.d.GetUserById(ctx, repos.ID(in.UserId)) + if err != nil { + return nil, errors.NewE(err) + } + if user == nil { + return nil, errors.Newf("could not find user with (id=%q)", in.UserId) + } + return &auth.GetUserOut{ + Id: string(user.Id), + Email: user.Email, + Name: user.Name, + }, nil +} + func (a *authGrpcServer) FromAccToken(token domain.AccessToken) *auth.AccessTokenOut { return &auth.AccessTokenOut{ Id: string(token.Id), @@ -31,12 +47,12 @@ func (a *authGrpcServer) FromAccToken(token domain.AccessToken) *auth.AccessToke func (a *authGrpcServer) EnsureUserByEmail(ctx context.Context, request *auth.GetUserByEmailRequest) (*auth.GetUserByEmailOut, error) { user, err := a.d.GetUserByEmail(ctx, request.Email) if err != nil { - return nil, err + return nil, errors.NewE(err) } if user == nil { user, err = a.d.EnsureUserByEmail(ctx, request.Email) if err != nil { - return nil, err + return nil, errors.NewE(err) } } return &auth.GetUserByEmailOut{ @@ -47,7 +63,7 @@ func (a *authGrpcServer) EnsureUserByEmail(ctx context.Context, request *auth.Ge func (a *authGrpcServer) GetAccessToken(ctx context.Context, in *auth.GetAccessTokenRequest) (*auth.AccessTokenOut, error) { token, err := a.d.GetAccessToken(ctx, in.Provider, in.UserId, in.TokenId) if err != nil { - return nil, err + return nil, errors.NewE(err) } if token == nil { return nil, errors.Newf("token is nil") diff --git a/apps/auth/internal/app/main.go b/apps/auth/internal/app/main.go deleted file mode 100644 index 95dcd4ef4..000000000 --- a/apps/auth/internal/app/main.go +++ /dev/null @@ -1,120 +0,0 @@ -package app - -import ( - "net/http" - - "github.com/gofiber/fiber/v2" - "go.uber.org/fx" - "google.golang.org/grpc" - "kloudlite.io/apps/auth/internal/app/graph" - "kloudlite.io/apps/auth/internal/app/graph/generated" - "kloudlite.io/apps/auth/internal/domain" - "kloudlite.io/common" - "kloudlite.io/constants" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/auth" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/comms" - "kloudlite.io/pkg/cache" - "kloudlite.io/pkg/config" - httpServer "kloudlite.io/pkg/http-server" - "kloudlite.io/pkg/repos" -) - -type Env struct { - CookieDomain string `env:"COOKIE_DOMAIN" required:"true"` - GithubWebhookUrl string `env:"GITHUB_WEBHOOK_URL" required:"true"` - GitlabWebhookUrl string `env:"GITLAB_WEBHOOK_URL" required:"true"` - - GithubClientId string `env:"GITHUB_CLIENT_ID" required:"true"` - GithubClientSecret string `env:"GITHUB_CLIENT_SECRET" required:"true"` - GithubCallbackUrl string `env:"GITHUB_CALLBACK_URL" required:"true"` - GithubAppId string `env:"GITHUB_APP_ID" required:"true"` - GithubAppPKFile string `env:"GITHUB_APP_PK_FILE" required:"true"` - GithubScopes string `env:"GITHUB_SCOPES" required:"true"` - - GitlabClientId string `env:"GITLAB_CLIENT_ID" required:"true"` - GitlabClientSecret string `env:"GITLAB_CLIENT_SECRET" required:"true"` - GitlabCallbackUrl string `env:"GITLAB_CALLBACK_URL" required:"true"` - GitlabScopes string `env:"GITLAB_SCOPES" required:"true"` - - GoogleClientId string `env:"GOOGLE_CLIENT_ID" required:"true"` - GoogleClientSecret string `env:"GOOGLE_CLIENT_SECRET" required:"true"` - GoogleCallbackUrl string `env:"GOOGLE_CALLBACK_URL" required:"true"` - GoogleScopes string `env:"GOOGLE_SCOPES" required:"true"` -} - -func (env *Env) GoogleConfig() (clientId string, clientSecret string, callbackUrl string) { - return env.GoogleClientId, env.GoogleClientSecret, env.GoogleCallbackUrl -} - -func (env *Env) GitlabConfig() (clientId string, clientSecret string, callbackUrl string) { - return env.GitlabClientId, env.GitlabClientSecret, env.GitlabCallbackUrl -} - -func (env *Env) GithubConfig() (clientId, clientSecret, callbackUrl, githubAppId, githubAppPKFile string) { - return env.GithubClientId, env.GithubClientSecret, env.GithubCallbackUrl, env.GithubAppId, env.GithubAppPKFile -} - -type CommsClientConnection *grpc.ClientConn - -var Module = fx.Module( - "app", - config.EnvFx[Env](), - repos.NewFxMongoRepo[*domain.User]("users", "usr", domain.UserIndexes), - repos.NewFxMongoRepo[*domain.AccessToken]("access_tokens", "tkn", domain.AccessTokenIndexes), - repos.NewFxMongoRepo[*domain.RemoteLogin]("remote_logins", "rlgn", domain.RemoteTokenIndexes), - cache.NewFxRepo[*domain.VerifyToken](), - cache.NewFxRepo[*domain.ResetPasswordToken](), - - fx.Provide( - func(conn CommsClientConnection) comms.CommsClient { - return comms.NewCommsClient((*grpc.ClientConn)(conn)) - }, - ), - - fx.Provide(fxGithub), - fx.Provide(fxGitlab), - fx.Provide(fxGoogle), - - fx.Provide(fxRPCServer), - fx.Invoke( - func(server *grpc.Server, authServer auth.AuthServer) { - auth.RegisterAuthServer(server, authServer) - }, - ), - - fx.Invoke(func(server *fiber.App, cacheClient cache.Client, env *Env) { - sessionMiddleware := httpServer.NewSessionMiddleware[*common.AuthSession](cacheClient, constants.CookieName, env.CookieDomain, constants.CacheSessionPrefix) - // INFO: (route: `/.check/logged-in`) is supposed to be used by nginx, as authentication url for other kloudlite services, - // where this api acts as authentication provider - server.Get("/.check/logged-in", sessionMiddleware, func(c *fiber.Ctx) error { - session := httpServer.GetSession[*common.AuthSession](c.Context()) - if session == nil { - return c.SendStatus(http.StatusUnauthorized) - } - return c.SendStatus(http.StatusOK) - }) - }), - - fx.Invoke( - func( - server *fiber.App, - d domain.Domain, - env *Env, - cacheClient cache.Client, - ) { - schema := generated.NewExecutableSchema( - generated.Config{Resolvers: graph.NewResolver(d)}, - ) - httpServer.SetupGQLServer( - server, schema, - httpServer.NewSessionMiddleware[*common.AuthSession]( - cacheClient, - constants.CookieName, - env.CookieDomain, - constants.CacheSessionPrefix, - ), - ) - }, - ), - domain.Module, -) diff --git a/apps/auth/internal/domain/domain.go b/apps/auth/internal/domain/domain.go index 4323b9734..22d5963b9 100644 --- a/apps/auth/internal/domain/domain.go +++ b/apps/auth/internal/domain/domain.go @@ -2,9 +2,8 @@ package domain import ( "context" - "kloudlite.io/common" - "kloudlite.io/pkg/messaging" - "kloudlite.io/pkg/repos" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/repos" ) type Domain interface { @@ -28,12 +27,11 @@ type Domain interface { GetAccessToken(ctx context.Context, provider string, userId string, tokenId string) (*AccessToken, error) GetLoginDetails(ctx context.Context, provider string, state *string) (string, error) InviteUser(ctx context.Context, email string, name string) (repos.ID, error) - LoginWithInviteToken(ctx context.Context, token string) (*common.AuthSession, error) OauthRequestLogin(ctx context.Context, provider string, state string) (string, error) OauthLogin(ctx context.Context, provider string, state string, code string) (*common.AuthSession, error) OauthAddLogin(ctx context.Context, userId repos.ID, provider string, state string, code string) (bool, error) } type Messenger interface { - SendEmail(ctx context.Context, template string, payload messaging.Json) error + SendEmail(ctx context.Context, template string, payload map[string]any) error } diff --git a/apps/auth/internal/domain/entities.go b/apps/auth/internal/domain/entities.go index 2579bde0b..017a6f278 100644 --- a/apps/auth/internal/domain/entities.go +++ b/apps/auth/internal/domain/entities.go @@ -3,8 +3,8 @@ package domain import ( "time" + "github.com/kloudlite/api/pkg/repos" "golang.org/x/oauth2" - "kloudlite.io/pkg/repos" ) type InvitationStatus string @@ -88,11 +88,6 @@ var AccessTokenIndexes = []repos.IndexField{ }, } -type InviteToken struct { - Token string `json:"token"` - UserId repos.ID `json:"user_id"` -} - type VerifyToken struct { Token string `json:"token"` UserId repos.ID `json:"user_id"` diff --git a/apps/auth/internal/domain/impl.go b/apps/auth/internal/domain/impl.go index 902a23fe5..4f79c7af8 100644 --- a/apps/auth/internal/domain/impl.go +++ b/apps/auth/internal/domain/impl.go @@ -7,35 +7,46 @@ import ( "encoding/hex" "encoding/json" "fmt" - "kloudlite.io/constants" "strings" "time" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/comms" + "github.com/kloudlite/api/constants" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/comms" + + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/kv" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/api/pkg/repos" "golang.org/x/oauth2" - "kloudlite.io/common" - "kloudlite.io/pkg/cache" - "kloudlite.io/pkg/errors" - "kloudlite.io/pkg/functions" - "kloudlite.io/pkg/logging" - "kloudlite.io/pkg/repos" ) func generateId(prefix string) string { - id, e := functions.CleanerNanoid(28) - if e != nil { - panic(fmt.Errorf("could not get cleanerNanoid()")) - } + id := functions.CleanerNanoidOrDie(28) return fmt.Sprintf("%s-%s", prefix, strings.ToLower(id)) } +func newAuthSession(userId repos.ID, userEmail string, userName string, userVerified bool, loginMethod string) *common.AuthSession { + sessionId := generateId("sess") + s := &common.AuthSession{ + UserId: userId, + UserEmail: userEmail, + UserVerified: userVerified, + UserName: userName, + LoginMethod: loginMethod, + } + s.SetId(repos.ID(sessionId)) + return s +} + type domainI struct { userRepo repos.DbRepo[*User] accessTokenRepo repos.DbRepo[*AccessToken] commsClient comms.CommsClient - verifyTokenRepo cache.Repo[*VerifyToken] - resetTokenRepo cache.Repo[*ResetPasswordToken] + verifyTokenRepo kv.Repo[*VerifyToken] + resetTokenRepo kv.Repo[*ResetPasswordToken] logger logging.Logger github Github gitlab Gitlab @@ -65,7 +76,7 @@ func (d *domainI) GetRemoteLogin(ctx context.Context, loginId repos.ID, secret s if id.Secret != secret { return nil, errors.New("invalid secret") } - return id, err + return id, errors.NewE(err) } func (d *domainI) CreateRemoteLogin(ctx context.Context, secret string) (repos.ID, error) { @@ -76,7 +87,7 @@ func (d *domainI) CreateRemoteLogin(ctx context.Context, secret string) (repos.I }, ) if err != nil { - return "", err + return "", errors.NewE(err) } return create.Id, nil } @@ -88,9 +99,9 @@ func (d *domainI) EnsureUserByEmail(ctx context.Context, email string) (*User, e }, ) if err != nil { - return nil, err + return nil, errors.NewE(err) } - return u, err + return u, errors.NewE(err) } func (d *domainI) OauthAddLogin(ctx context.Context, userId repos.ID, provider string, state string, code string) (bool, error) { @@ -107,9 +118,9 @@ func (d *domainI) OauthAddLogin(ctx context.Context, userId repos.ID, provider s } _, err = d.addOAuthLogin(ctx, provider, t, user, u.AvatarURL) if err != nil { - return false, err + return false, errors.NewE(err) } - return true, err + return true, errors.NewE(err) } case constants.ProviderGitlab: @@ -120,9 +131,9 @@ func (d *domainI) OauthAddLogin(ctx context.Context, userId repos.ID, provider s } _, err = d.afterOAuthLogin(ctx, provider, t, user, &u.AvatarURL) if err != nil { - return false, err + return false, errors.NewE(err) } - return true, err + return true, errors.NewE(err) } default: @@ -142,26 +153,22 @@ func (d *domainI) GetUserByEmail(ctx context.Context, email string) (*User, erro } func (d *domainI) Login(ctx context.Context, email string, password string) (*common.AuthSession, error) { - matched, err := d.userRepo.FindOne(ctx, repos.Filter{"email": email}) + user, err := d.userRepo.FindOne(ctx, repos.Filter{"email": email}) if err != nil { - return nil, err + return nil, errors.NewE(err) } - if matched == nil { + if user == nil { d.logger.Warnf("user not found for email=%s", email) return nil, errors.Newf("not valid credentials") } - bytes := md5.Sum([]byte(password + matched.PasswordSalt)) - if matched.Password != hex.EncodeToString(bytes[:]) { + bytes := md5.Sum([]byte(password + user.PasswordSalt)) + // TODO (nxtcoder17): use crypto/subtle to compare hashes, to avoid timing attacks, also does not work now + if user.Password != hex.EncodeToString(bytes[:]) { return nil, errors.New("not valid credentials") } - session := common.NewSession( - matched.Id, - matched.Email, - matched.Verified, - "email/password", - ) + session := newAuthSession(user.Id, user.Email, user.Name, user.Verified, "email/password") return session, nil } @@ -170,7 +177,7 @@ func (d *domainI) SignUp(ctx context.Context, name string, email string, passwor if err != nil { if matched != nil { - return nil, err + return nil, errors.NewE(err) } } @@ -182,7 +189,7 @@ func (d *domainI) SignUp(ctx context.Context, name string, email string, passwor salt := generateId("salt") sum := md5.Sum([]byte(password + salt)) - create, err := d.userRepo.Create( + user, err := d.userRepo.Create( ctx, &User{ Name: name, Email: email, @@ -195,20 +202,15 @@ func (d *domainI) SignUp(ctx context.Context, name string, email string, passwor ) if err != nil { - return nil, err + return nil, errors.NewE(err) } - err = d.generateAndSendVerificationToken(ctx, create) + err = d.generateAndSendVerificationToken(ctx, user) if err != nil { - return nil, err + return nil, errors.NewE(err) } - return common.NewSession( - create.Id, - create.Email, - create.Verified, - "email/password", - ), nil + return newAuthSession(user.Id, user.Email, user.Name, user.Verified, "email/password"), nil } func (d *domainI) GetLoginDetails(ctx context.Context, provider string, state *string) (string, error) { @@ -224,12 +226,12 @@ func (d *domainI) InviteUser(ctx context.Context, email string, name string) (re func (d *domainI) SetUserMetadata(ctx context.Context, userId repos.ID, metadata UserMetadata) (*User, error) { user, err := d.userRepo.FindById(ctx, userId) if err != nil { - return nil, err + return nil, errors.NewE(err) } user.Metadata = metadata updated, err := d.userRepo.UpdateById(ctx, userId, user) if err != nil { - return nil, err + return nil, errors.NewE(err) } return updated, nil } @@ -237,12 +239,12 @@ func (d *domainI) SetUserMetadata(ctx context.Context, userId repos.ID, metadata func (d *domainI) ClearUserMetadata(ctx context.Context, userId repos.ID) (*User, error) { user, err := d.userRepo.FindById(ctx, userId) if err != nil { - return nil, err + return nil, errors.NewE(err) } user.Metadata = nil updated, err := d.userRepo.UpdateById(ctx, userId, user) if err != nil { - return nil, err + return nil, errors.NewE(err) } return updated, nil } @@ -250,29 +252,27 @@ func (d *domainI) ClearUserMetadata(ctx context.Context, userId repos.ID) (*User func (d *domainI) VerifyEmail(ctx context.Context, token string) (*common.AuthSession, error) { v, err := d.verifyTokenRepo.Get(ctx, token) if err != nil { - return nil, err + return nil, errors.NewE(err) } user, err := d.userRepo.FindById(ctx, v.UserId) if err != nil { - return nil, err + return nil, errors.NewE(err) } user.Verified = true u, err := d.userRepo.UpdateById(ctx, v.UserId, user) if err != nil { - return nil, err + return nil, errors.NewE(err) } - d.commsClient.SendWelcomeEmail( + if _, err := d.commsClient.SendWelcomeEmail( ctx, &comms.WelcomeEmailInput{ Email: user.Email, Name: user.Name, }, - ) - return common.NewSession( - u.Id, - u.Email, - u.Verified, - "email/verify", - ), nil + ); err != nil { + d.logger.Errorf(err) + } + + return newAuthSession(u.Id, u.Email, u.Name, u.Verified, "email/verify"), nil } func (d *domainI) ResetPassword(ctx context.Context, token string, password string) (bool, error) { @@ -291,7 +291,7 @@ func (d *domainI) ResetPassword(ctx context.Context, token string, password stri user.PasswordSalt = salt _, err = d.userRepo.UpdateById(ctx, repos.ID(get.UserId), user) if err != nil { - return false, err + return false, errors.NewE(err) } err = d.resetTokenRepo.Drop(ctx, token) @@ -307,7 +307,7 @@ func (d *domainI) RequestResetPassword(ctx context.Context, email string) (bool, resetToken := generateId("reset") one, err := d.userRepo.FindOne(ctx, repos.Filter{"email": email}) if err != nil { - return false, err + return false, errors.NewE(err) } if one == nil { return false, errors.New("no account present with provided email, register your account first.") @@ -319,33 +319,28 @@ func (d *domainI) RequestResetPassword(ctx context.Context, email string) (bool, time.Second*24*60*60, ) if err != nil { - return false, err + return false, errors.NewE(err) } err = d.sendResetPasswordEmail(ctx, resetToken, one) if err != nil { - return false, err + return false, errors.NewE(err) } return true, nil } -func (d *domainI) LoginWithInviteToken(ctx context.Context, token string) (*common.AuthSession, error) { - // TODO implement me - panic("implement me") -} - func (d *domainI) ChangeEmail(ctx context.Context, id repos.ID, email string) (bool, error) { user, err := d.userRepo.FindById(ctx, id) if err != nil { - return false, err + return false, errors.NewE(err) } user.Email = email updated, err := d.userRepo.UpdateById(ctx, id, user) if err != nil { - return false, err + return false, errors.NewE(err) } err = d.generateAndSendVerificationToken(ctx, updated) if err != nil { - return false, err + return false, errors.NewE(err) } return true, nil } @@ -353,19 +348,19 @@ func (d *domainI) ChangeEmail(ctx context.Context, id repos.ID, email string) (b func (d *domainI) ResendVerificationEmail(ctx context.Context, userId repos.ID) (bool, error) { user, err := d.userRepo.FindById(ctx, userId) if err != nil { - return false, err + return false, errors.NewE(err) } err = d.generateAndSendVerificationToken(ctx, user) if err != nil { - return false, err + return false, errors.NewE(err) } - return true, err + return true, errors.NewE(err) } func (d *domainI) ChangePassword(ctx context.Context, id repos.ID, currentPassword string, newPassword string) (bool, error) { user, err := d.userRepo.FindById(ctx, id) if err != nil { - return false, err + return false, errors.NewE(err) } sum := md5.Sum([]byte(currentPassword + user.PasswordSalt)) if user.Password == hex.EncodeToString(sum[:]) { @@ -375,7 +370,7 @@ func (d *domainI) ChangePassword(ctx context.Context, id repos.ID, currentPasswo user.Password = hex.EncodeToString(newSum[:]) _, err := d.userRepo.UpdateById(ctx, id, user) if err != nil { - return false, err + return false, errors.NewE(err) } // TODO send comm return true, nil @@ -408,12 +403,14 @@ func (d *domainI) addOAuthLogin(ctx context.Context, provider string, token *oau user = u user.Joined = time.Now() user, err = d.userRepo.Create(ctx, user) - d.commsClient.SendWelcomeEmail( + if _, err := d.commsClient.SendWelcomeEmail( ctx, &comms.WelcomeEmailInput{ Email: user.Email, Name: user.Name, }, - ) + ); err != nil { + d.logger.Errorf(err) + } if err != nil { return nil, errors.NewEf(err, "could not create user (email=%s)", user.Email) } @@ -456,9 +453,9 @@ func (d *domainI) addOAuthLogin(ctx context.Context, provider string, token *oau func (d *domainI) afterOAuthLogin(ctx context.Context, provider string, token *oauth2.Token, newUser *User, avatarUrl *string) (*common.AuthSession, error) { user, err := d.addOAuthLogin(ctx, provider, token, newUser, avatarUrl) if err != nil { - return nil, err + return nil, errors.NewE(err) } - session := common.NewSession(user.Id, user.Email, user.Verified, fmt.Sprintf("oauth2/%s", provider)) + session := newAuthSession(user.Id, user.Email, user.Name, user.Verified, fmt.Sprintf("oauth2/%s", provider)) return session, nil } @@ -478,12 +475,12 @@ func (d *domainI) OauthLogin(ctx context.Context, provider string, state string, d.logger.Infof("user has no public email, trying to get his protected email") pEmail, err := d.github.GetPrimaryEmail(ctx, t) if err != nil { - return "", err + return "", errors.NewE(err) } return pEmail, nil }() if err != nil { - return nil, err + return nil, errors.NewE(err) } name := func() string { @@ -542,7 +539,7 @@ func (d *domainI) OauthLogin(ctx context.Context, provider string, state string, func (gl *domainI) Hash(t *oauth2.Token) (string, error) { b, err := json.Marshal(t) if err != nil { - return "", err + return "", errors.NewE(err) } return b64.StdEncoding.EncodeToString(b), nil } @@ -565,7 +562,7 @@ func (d *domainI) GetAccessToken(ctx context.Context, provider string, userId st hash, err := d.Hash(accToken.Token) if err != nil { - return nil, err + return nil, errors.NewE(err) } if provider == "github" { @@ -575,7 +572,7 @@ func (d *domainI) GetAccessToken(ctx context.Context, provider string, userId st } hash2, err := d.Hash(token) if err != nil { - return nil, err + return nil, errors.NewE(err) } if hash != hash2 { accToken.Token = token @@ -589,7 +586,7 @@ func (d *domainI) GetAccessToken(ctx context.Context, provider string, userId st } hash2, err := d.Hash(token) if err != nil { - return nil, err + return nil, errors.NewE(err) } if hash != hash2 { accToken.Token = token @@ -641,11 +638,11 @@ func (d *domainI) generateAndSendVerificationToken(ctx context.Context, user *Us }, time.Second*24*60*60, ) if err != nil { - return err + return errors.NewE(err) } err = d.sendVerificationEmail(ctx, verificationToken, user) if err != nil { - return err + return errors.NewE(err) } return nil } @@ -654,8 +651,8 @@ func fxDomain( userRepo repos.DbRepo[*User], accessTokenRepo repos.DbRepo[*AccessToken], remoteLoginRepo repos.DbRepo[*RemoteLogin], - verifyTokenRepo cache.Repo[*VerifyToken], - resetTokenRepo cache.Repo[*ResetPasswordToken], + verifyTokenRepo kv.Repo[*VerifyToken], + resetTokenRepo kv.Repo[*ResetPasswordToken], github Github, gitlab Gitlab, google Google, diff --git a/apps/auth/internal/env/env.go b/apps/auth/internal/env/env.go new file mode 100644 index 000000000..a009e28f4 --- /dev/null +++ b/apps/auth/internal/env/env.go @@ -0,0 +1,98 @@ +package env + +import ( + "github.com/codingconcepts/env" + "github.com/kloudlite/api/pkg/errors" +) + +type Env struct { + MongoUri string `env:"MONGO_URI" required:"true"` + MongoDbName string `env:"MONGO_DB_NAME" required:"true"` + Port uint16 `env:"PORT" required:"true"` + GrpcPort uint16 `env:"GRPC_PORT" required:"true"` + CorsOrigins string `env:"ORIGINS"` + + CookieDomain string `env:"COOKIE_DOMAIN" required:"true"` + + OAuth2Enabled bool `env:"OAUTH2_ENABLED" required:"true"` + + OAuth2GithubEnabled bool `env:"OAUTH2_GITHUB_ENABLED" required:"false"` + GithubClientId string `env:"GITHUB_CLIENT_ID" required:"false"` + GithubClientSecret string `env:"GITHUB_CLIENT_SECRET" required:"false"` + GithubCallbackUrl string `env:"GITHUB_CALLBACK_URL" required:"false"` + GithubAppId string `env:"GITHUB_APP_ID" required:"false"` + GithubAppPKFile string `env:"GITHUB_APP_PK_FILE" required:"false"` + GithubScopes string `env:"GITHUB_SCOPES" required:"false"` + GithubWebhookUrl string `env:"GITHUB_WEBHOOK_URL" required:"false"` + + OAuth2GitlabEnabled bool `env:"OAUTH2_GITLAB_ENABLED" required:"false"` + GitlabClientId string `env:"GITLAB_CLIENT_ID" required:"false"` + GitlabClientSecret string `env:"GITLAB_CLIENT_SECRET" required:"false"` + GitlabCallbackUrl string `env:"GITLAB_CALLBACK_URL" required:"false"` + GitlabScopes string `env:"GITLAB_SCOPES" required:"false"` + GitlabWebhookUrl string `env:"GITLAB_WEBHOOK_URL" required:"false"` + + OAuth2GoogleEnabled bool `env:"OAUTH2_GOOGLE_ENABLED" required:"false"` + GoogleClientId string `env:"GOOGLE_CLIENT_ID" required:"false"` + GoogleClientSecret string `env:"GOOGLE_CLIENT_SECRET" required:"false"` + GoogleCallbackUrl string `env:"GOOGLE_CALLBACK_URL" required:"false"` + GoogleScopes string `env:"GOOGLE_SCOPES" required:"false"` + + CommsService string `env:"COMMS_SERVICE" required:"true"` + NatsURL string `env:"NATS_URL" required:"true"` + SessionKVBucket string `env:"SESSION_KV_BUCKET" required:"true"` + VerifyTokenKVBucket string `env:"VERIFY_TOKEN_KV_BUCKET" required:"true"` + ResetPasswordTokenKVBucket string `env:"RESET_PASSWORD_TOKEN_KV_BUCKET" required:"true"` + IsDev bool +} + +func (ev *Env) validateEnv() error { + if ev.OAuth2Enabled { + if ev.OAuth2GithubEnabled { + err := errors.Newf("when github oauth2 is enabled, secrets `GITHUB_CLIENT_ID`, `GITHUB_CLIENT_SECRET`, `GITHUB_CALLBACK_URL`, `GITHUB_APP_ID`, `GITHUB_APP_PK_FILE`, `GITHUB_SCOPES` are required") + + if ev.GithubClientId == "" || + ev.GithubClientSecret == "" || + ev.GithubCallbackUrl == "" || + ev.GithubAppId == "" || + ev.GithubAppPKFile == "" || + ev.GithubScopes == "" { + return err + } + } + + if ev.OAuth2GitlabEnabled { + err := errors.Newf("when gitlab oauth2 is enabled, secrets `GITLAB_CLIENT_ID`, `GITLAB_CLIENT_SECRET`, `GITLAB_CALLBACK_URL`, `GITLAB_SCOPES` are required") + + if ev.GitlabClientId == "" || + ev.GitlabClientSecret == "" || + ev.GitlabCallbackUrl == "" || + ev.GitlabScopes == "" { + return errors.NewE(err) + } + } + + if ev.OAuth2GoogleEnabled { + err := errors.Newf("when google oauth2 is enabled, secrets `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET`, `GOOGLE_CALLBACK_URL`, `GOOGLE_SCOPES` are required") + + if ev.GoogleClientId == "" || + ev.GoogleClientSecret == "" || + ev.GoogleCallbackUrl == "" || + ev.GoogleScopes == "" { + return errors.NewE(err) + } + } + } + return nil +} + +func LoadEnv() (*Env, error) { + var ev Env + if err := env.Set(&ev); err != nil { + return nil, errors.NewE(err) + } + if err := ev.validateEnv(); err != nil { + return nil, errors.NewE(err) + } + return &ev, nil +} diff --git a/apps/auth/internal/framework/main.go b/apps/auth/internal/framework/main.go index 5024b06db..9dc3aef1f 100644 --- a/apps/auth/internal/framework/main.go +++ b/apps/auth/internal/framework/main.go @@ -1,63 +1,99 @@ package framework import ( + "context" + "fmt" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/kv" + "github.com/kloudlite/api/pkg/nats" + "go.uber.org/fx" - "kloudlite.io/apps/auth/internal/app" - "kloudlite.io/pkg/cache" - "kloudlite.io/pkg/config" - rpc "kloudlite.io/pkg/grpc" - httpServer "kloudlite.io/pkg/http-server" - "kloudlite.io/pkg/repos" + + "github.com/kloudlite/api/apps/auth/internal/app" + "github.com/kloudlite/api/apps/auth/internal/env" + rpc "github.com/kloudlite/api/pkg/grpc" + httpServer "github.com/kloudlite/api/pkg/http-server" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/api/pkg/repos" ) type CommsGrpcEnv struct { - CommsService string `env:"COMMS_SERVICE" required:"true"` + *env.Env } func (c CommsGrpcEnv) GetGRPCServerURL() string { return c.CommsService } -type Env struct { - MongoUri string `env:"MONGO_URI" required:"true"` - RedisHosts string `env:"REDIS_HOSTS" required:"true"` - RedisUserName string `env:"REDIS_USERNAME" required:"true"` - RedisPassword string `env:"REDIS_PASSWORD" required:"true"` - RedisPrefix string `env:"REDIS_PREFIX" required:"true"` - MongoDbName string `env:"MONGO_DB_NAME" required:"true"` - Port uint16 `env:"PORT" required:"true"` - GrpcPort uint16 `env:"GRPC_PORT" required:"true"` - CorsOrigins string `env:"ORIGINS"` +type fm struct { + *env.Env } -func (e *Env) GetHttpPort() uint16 { +func (e *fm) GetHttpPort() uint16 { return e.Port } -func (e *Env) GetHttpCors() string { +func (e *fm) GetHttpCors() string { return e.CorsOrigins } -func (e *Env) RedisOptions() (hosts, username, password, basePrefix string) { - return e.RedisHosts, e.RedisUserName, e.RedisPassword, e.RedisPrefix -} - -func (e *Env) GetMongoConfig() (url string, dbName string) { +func (e *fm) GetMongoConfig() (url string, dbName string) { return e.MongoUri, e.MongoDbName } -func (e *Env) GetGRPCPort() uint16 { +func (e *fm) GetGRPCPort() uint16 { return e.GrpcPort } var Module fx.Option = fx.Module( "framework", - config.EnvFx[Env](), - config.EnvFx[CommsGrpcEnv](), - repos.NewMongoClientFx[*Env](), - cache.NewRedisFx[*Env](), - httpServer.NewHttpServerFx[*Env](), - rpc.NewGrpcServerFx[*Env](), + fx.Provide(func(ev *env.Env) *fm { + return &fm{ev} + }), + fx.Provide(func(ev *env.Env) *CommsGrpcEnv { + return &CommsGrpcEnv{ev} + }), + + repos.NewMongoClientFx[*fm](), + + fx.Provide(func(ev *env.Env, logger logging.Logger) (*nats.JetstreamClient, error) { + name := "auth:jetstream-client" + nc, err := nats.NewClient(ev.NatsURL, nats.ClientOpts{ + Name: name, + Logger: logger, + }) + if err != nil { + return nil, errors.NewE(err) + } + + return nats.NewJetstreamClient(nc) + }), + + fx.Provide( + func(ev *env.Env, jc *nats.JetstreamClient) (kv.Repo[*common.AuthSession], error) { + cxt := context.TODO() + return kv.NewNatsKVRepo[*common.AuthSession](cxt, ev.SessionKVBucket, jc) + }, + ), + + fx.Provide(func(e *env.Env, logger logging.Logger) httpServer.Server { + corsOrigins := "https://studio.apollographql.com" + return httpServer.NewServer(httpServer.ServerArgs{Logger: logger, CorsAllowOrigins: &corsOrigins, IsDev: e.IsDev}) + }), + + fx.Invoke(func(lf fx.Lifecycle, server httpServer.Server, ev *env.Env) { + lf.Append(fx.Hook{ + OnStart: func(context.Context) error { + return server.Listen(fmt.Sprintf(":%d", ev.Port)) + }, + OnStop: func(context.Context) error { + return server.Close() + }, + }) + }), + + rpc.NewGrpcServerFx[*fm](), rpc.NewGrpcClientFx[*CommsGrpcEnv, app.CommsClientConnection](), app.Module, ) diff --git a/apps/auth/main.go b/apps/auth/main.go index f4a8bdd2e..a79293e97 100644 --- a/apps/auth/main.go +++ b/apps/auth/main.go @@ -1,21 +1,55 @@ package main import ( + "context" "flag" + "github.com/kloudlite/api/pkg/errors" + "time" + "go.uber.org/fx" - "kloudlite.io/apps/auth/internal/framework" - "kloudlite.io/pkg/logging" + + "github.com/kloudlite/api/apps/auth/internal/env" + "github.com/kloudlite/api/apps/auth/internal/framework" + "github.com/kloudlite/api/common" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/logging" ) func main() { - isDev := flag.Bool("dev", false, "--dev") + var isDev bool + flag.BoolVar(&isDev, "dev", false, "--dev") flag.Parse() - fx.New( - framework.Module, + app := fx.New( + fx.NopLogger, + fn.FxErrorHandler(), + fx.Provide(func() (*env.Env, error) { + if e, err := env.LoadEnv(); err != nil { + return nil, errors.NewE(err) + } else { + e.IsDev = isDev + return e, nil + } + }), fx.Provide( func() (logging.Logger, error) { - return logging.New(&logging.Options{Name: "auth", Dev: *isDev}) + return logging.New(&logging.Options{Name: "auth", Dev: isDev}) }, ), - ).Run() + framework.Module, + ) + + ctx, cancelFunc := func() (context.Context, context.CancelFunc) { + if isDev { + return context.WithTimeout(context.TODO(), 20*time.Second) + } + return context.WithTimeout(context.TODO(), 5*time.Second) + }() + defer cancelFunc() + + if err := app.Start(ctx); err != nil { + panic(err) + } + + common.PrintReadyBanner() + <-app.Done() } diff --git a/apps/ci/Dockerfile b/apps/ci/Dockerfile deleted file mode 100644 index 5c55c0d62..000000000 --- a/apps/ci/Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -# syntax=docker/dockerfile:1.4 -FROM golang:1.18.3-alpine3.16 AS base -USER 1001 -ENV GOPATH=/tmp/go -ENV GOCACHE=/tmp/go-cache -WORKDIR /tmp/app -COPY --link --chown=1001 --from=project-root ./go.mod ./go.sum ./tools.go ./ -RUN go mod download -x -COPY --link --chown=1001 --from=project-root common ./common -COPY --link --chown=1001 --from=project-root grpc-interfaces ./grpc-interfaces -COPY --link --chown=1001 --from=project-root pkg ./pkg -ARG APP -RUN mkdir -p ./apps/$APP -WORKDIR /tmp/app/apps/$APP -COPY --link --chown=1001 ./ ./ -ENV CGO_ENABLED=0 -RUN go build -tags musl -o /tmp/bin/ci ./main.go -# ENV GOBIN=/tmp/bin -# RUN go install . -# RUN ls -al /tmp/bin -RUN chmod +x /tmp/bin/ci - -#FROM golang:1.18-alpine -# FROM gcr.io/distroless/static-debian11 -FROM alpine -USER 1001 -#WORKDIR /tmp/app -COPY --link --from=base --chown=1001 /tmp/bin/ci ./ci -CMD ["./ci"] diff --git a/apps/ci/Taskfile.yml b/apps/ci/Taskfile.yml deleted file mode 100644 index 26770e5ee..000000000 --- a/apps/ci/Taskfile.yml +++ /dev/null @@ -1,67 +0,0 @@ -version: "3" - -dotenv: [".secrets/env", ".secrets/oauth.env"] - -tasks: - gql: - dir: ./internal/app - cmds: - - go run -tags dynamic github.com/99designs/gqlgen generate - run: - interactive: true - cmds: - # - nodemon -e go --signal SIGKILL --exec 'go run -tags dynamic main.go --dev || exit 1' - - go build -o /tmp/ci - # - /tmp/ci --dev - # - dlv exec --delv - - dlv exec -l 127.0.0.1:31117 --headless /tmp/ci -- --dev - - - docker-build: - vars: - APP: ci - IMAGE: registry.kloudlite.io/kloudlite/{{.EnvName}}/{{.APP}}-api:{{.Tag}} - preconditions: - - sh: '[[ -n "{{.Tag}}" ]]' - msg: 'var Tag must have a value' - - sh: '[[ "{{.EnvName}}" == "development" ]] || [[ "{{.EnvName}}" == "staging" ]] || [[ "{{.EnvName}}" == "production" ]]' - msg: 'var EnvName must have one of [development, staging, production] as its value' - cmds: - - docker buildx build -f ./Dockerfile -t {{.IMAGE}} . --build-arg APP={{.APP}} --platform linux/amd64 --build-context project-root=../.. --cache-to type=inline - - docker push {{.IMAGE}} - - local-build: - preconditions: - - sh: '[ -n "{{.EnvName}}" ]' - msg: 'var EnvName must have a value' - - sh: '[ -n "{{.Tag}}" ]' - msg: 'var Tag must have a value' - vars: - APP: ci - IMAGE: registry.kloudlite.io/kloudlite/{{.EnvName}}/{{.APP}}-api:{{.Tag}} - env: - CGO_ENABLED: 0 - GOOS: linux - GOARCH: amd64 - silent: true - cmds: - - |+ - lineNumbers=$(cat Dockerfile | grep -i '^FROM' -n | tail +2 | awk -F: '{print $1}') - - startLineNo=$(echo "$lineNumbers" | head -n+1) - finalLineNo=$(echo "$lineNumbers" | tail -1) - - tDir=$(mktemp -d) - - nDockerfile=$(cat Dockerfile | tail --lines=+$startLineNo | grep -i --invert-match 'from=base') - echo "$nDockerfile" | sed "1 i # syntax=docker/dockerfile:1.4" > $tDir/Dockerfile.base - - #lineNo=$(cat Dockerfile | grep -i '^FROM' -n | tail -1 | awk -F: '{print $1}') - CGO_ENABLED=0 go build -o $tDir/{{.APP}} . - - cat $tDir/Dockerfile.base | sed "5 i COPY --from=local-builder ./{{.APP}} ./{{.APP}}" > $tDir/Dockerfile - cat $tDir/Dockerfile - - docker buildx build -f $tDir/Dockerfile -t {{.IMAGE}} . --build-context local-builder=${tDir} - docker push {{.IMAGE}} - rm -rf $tDir diff --git a/apps/ci/internal/app/git-webhook-consumer.go b/apps/ci/internal/app/git-webhook-consumer.go deleted file mode 100644 index e3b339664..000000000 --- a/apps/ci/internal/app/git-webhook-consumer.go +++ /dev/null @@ -1,176 +0,0 @@ -package app - -import ( - "bytes" - "context" - "embed" - "encoding/json" - "kloudlite.io/constants" - "text/template" - "time" - - "go.uber.org/fx" - "kloudlite.io/apps/ci/internal/domain" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/finance" - "kloudlite.io/pkg/errors" - "kloudlite.io/pkg/logging" - "kloudlite.io/pkg/redpanda" - text_templates "kloudlite.io/pkg/text-templates" - "kloudlite.io/pkg/types" -) - -var ( - //go:embed templates - dirTemplates embed.FS -) - -type pt struct { - tt *template.Template - logger logging.Logger -} - -func (pt *pt) RenderPipelineRun(pipelineRunParams []*domain.TektonVars) (*bytes.Buffer, error) { - b := new(bytes.Buffer) - if err := pt.tt.ExecuteTemplate( - b, "pipeline-run.yml.tpl", map[string]any{ - "pipeline-runs": pipelineRunParams, - }, - ); err != nil { - pt.logger.Errorf(err, "error parsing template (pipeline-run.yml.tpl)") - return nil, err - } - return b, nil -} - -const ( - GithubEventHeader string = "X-Github-Event" - GitlabEventHeader string = "X-Gitlab-Event" -) - -func fxInvokeProcessGitWebhooks() fx.Option { - return fx.Options( - - fx.Provide( - func(logger logging.Logger) (domain.PipelineTemplate, error) { - t := template.New("taskrun") - t = text_templates.WithFunctions(t) - if _, err := t.ParseFS(dirTemplates, "templates/pipeline-run.yml.tpl"); err != nil { - return nil, err - } - return &pt{tt: t, logger: logger}, nil - }, - ), - - fx.Invoke( - func(d domain.Domain, financeClient finance.FinanceClient, consumer redpanda.Consumer, producer redpanda.Producer, - logr logging.Logger, t domain.PipelineTemplate) { - consumer.StartConsuming( - func(msg []byte, _ time.Time, offset int64) error { - logger := logr.WithName("ci-webhook").WithKV("offset", offset) - logger.Infof("started processing") - defer func() { - logger.Infof("finished processing") - }() - - var gitHook types.GitHttpHook - if err := json.Unmarshal(msg, &gitHook); err != nil { - logger.Errorf(err, "could not unmarshal into *GitWebhookPayload") - return err - } - - hook, err := func() (*domain.GitWebhookPayload, error) { - if gitHook.GitProvider == constants.ProviderGithub { - return d.ParseGithubHook(gitHook.Headers[GithubEventHeader], gitHook.Body) - } - if gitHook.GitProvider == constants.ProviderGitlab { - return d.ParseGitlabHook(gitHook.Headers[GitlabEventHeader], gitHook.Body) - } - return nil, errors.New("unknown git provider") - }() - if err != nil { - if _, ok := err.(*domain.ErrEventNotSupported); ok { - logger.Infof(err.Error()) - return nil - } - logger.Errorf(err, "could not extract gitHook") - return err - } - - logger = logger.WithKV("repo", hook.RepoUrl, "provider", hook.GitProvider, "branch", hook.GitBranch) - - tctx, cancelFn := context.WithTimeout(context.TODO(), 3*time.Second) - defer cancelFn() - - pipelines, err := d.ListPipelinesByGitInfo(tctx, hook.RepoUrl, hook.GitProvider, hook.GitBranch) - if err != nil { - return errors.NewEf(err, "listing pipelines by git info") - } - - if len(pipelines) == 0 { - logger.Infof("no pipeline is configured for given hook body") - return nil - } - - // tkRuns, err := d.GetTektonRunParams(context.TODO(), hook.GitProvider, hook.RepoUrl, hook.GitBranch) - // if err != nil { - // logger.Errorf(err, "could not get tekton run params") - // return err - // } - - // if len(tkRuns) == 0 { - // logger.Infof("no pipeline is configured for given hook body") - // return nil - // } - - accountRuns := map[string][]*domain.TektonVars{} - - for i := range pipelines { - pRun, err := d.CreateNewPipelineRun(context.TODO(), pipelines[i].Id) - if err != nil { - logger.Errorf(err, "creating new pipeline run") - // return err - } - params, err := d.GetPipelineRunParams(context.TODO(), pipelines[i], pRun) - if err != nil { - logger.Errorf(err, "getting pipeline run params") - // return err - } - accountRuns[pipelines[i].AccountId] = append(accountRuns[pipelines[i].AccountId], params) - } - - // for i := range tkRuns { - // tkRuns[i].GitCommitHash = hook.CommitHash - // accountRuns[tkRuns[i].AccountId] = append(accountRuns[tkRuns[i].AccountId], tkRuns[i]) - // } - - for k := range accountRuns { - cluster, err := financeClient.GetAttachedCluster(context.TODO(), &finance.GetAttachedClusterIn{AccountId: k}) - if err != nil { - continue - } - - b, err := t.RenderPipelineRun(accountRuns[k]) - agentMsgBytes, err := json.Marshal(map[string]any{"action": "create", "yamls": b.Bytes()}) - if err != nil { - return err - } - - ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second) - topicName := cluster.ClusterId + "-incoming" - - pMsg, err := producer.Produce(ctx, topicName, hook.RepoUrl, agentMsgBytes) - if err != nil { - cancelFn() - logger.Errorf(err, "error processing message, could not pipeline output into topic=%s", topicName) - return err - } - logger.Infof("processed git webhook, pipelined output into to topic=%s, offset=%d", pMsg.Topic, pMsg.Offset) - cancelFn() - } - return nil - }, - ) - }, - ), - ) -} diff --git a/apps/ci/internal/app/github.go b/apps/ci/internal/app/github.go deleted file mode 100644 index 313038644..000000000 --- a/apps/ci/internal/app/github.go +++ /dev/null @@ -1,252 +0,0 @@ -package app - -import ( - "context" - "fmt" - "io/ioutil" - "net/http" - "os" - "regexp" - "strconv" - "strings" - "time" - - "kloudlite.io/apps/ci/internal/domain" - "kloudlite.io/pkg/types" - - "github.com/bradleyfalzon/ghinstallation/v2" - // "github.com/google/go-github/v43/github" - "github.com/google/go-github/v45/github" - "golang.org/x/oauth2" - oauthGithub "golang.org/x/oauth2/github" - "kloudlite.io/pkg/errors" - fn "kloudlite.io/pkg/functions" -) - -type githubI struct { - cfg *oauth2.Config - ghCli *github.Client - ghCliForUser func(ctx context.Context, token *oauth2.Token) *github.Client - env *Env -} - -func (gh *githubI) CheckWebhookExists(ctx context.Context, token *domain.AccessToken, repoUrl string, webhookId *domain.GithubWebhookId) (bool, error) { - if webhookId == nil { - return false, nil - } - - owner, repo := gh.getOwnerAndRepo(repoUrl) - hook, _, err := gh.ghCliForUser(ctx, token.Token).Repositories.GetHook(ctx, owner, repo, int64(*webhookId)) - if err != nil { - return false, err - } - - return hook != nil, nil -} - -func (gh *githubI) AddRepoWebhook(ctx context.Context, accToken *domain.AccessToken, repoUrl, webhookUrl string) (*domain.GithubWebhookId, error) { - owner, repo := gh.getOwnerAndRepo(repoUrl) - hookName := "kloudlite-pipeline" - - hook, res, err := gh.ghCliForUser(ctx, accToken.Token).Repositories.CreateHook( - ctx, owner, repo, &github.Hook{ - Config: map[string]any{ - "url": webhookUrl, - "content_type": "json", - "secret": gh.env.GithubWebhookAuthzSecret, - }, - Events: []string{"push"}, - Active: fn.NewBool(true), - Name: &hookName, - }, - ) - if err != nil { - // ASSERT: GitHub returns 422 only if hook already exists on the repository - if res.StatusCode == 422 { - return nil, nil - } - return nil, errors.NewEf(err, "could not create github webhook") - } - - return fn.New(domain.GithubWebhookId(*hook.ID)), nil -} - -func (gh *githubI) AddWebhook(ctx context.Context, accToken *domain.AccessToken, repoUrl, webhookUrl string) (*domain.GithubWebhookId, error) { - // TODO:: we migrated to GitHub app webhook, which allows us to skip creating github repository webhooks, now - return nil, nil -} - -func (gh *githubI) DeleteWebhook(ctx context.Context, accToken *domain.AccessToken, repoUrl string, hookId domain.GithubWebhookId) error { - owner, repo := gh.getOwnerAndRepo(repoUrl) - resp, err := gh.ghCliForUser(ctx, accToken.Token).Repositories.DeleteHook(ctx, owner, repo, int64(hookId)) - if err != nil && resp.StatusCode == http.StatusNotFound { - return nil - } - return err -} - -func (gh *githubI) getOwnerAndRepo(repoUrl string) (owner, repo string) { - re := regexp.MustCompile("https://(.+)/(.+)/(.+)") - matches := re.FindStringSubmatch(repoUrl) - return matches[2], strings.Split(matches[3], ".git")[0] -} - -func (gh *githubI) buildListOptions(p *types.Pagination) github.ListOptions { - if p == nil { - return github.ListOptions{ - PerPage: 200, - } - } - return github.ListOptions{ - Page: p.Page, - PerPage: p.PerPage, - } -} - -func (gh *githubI) ListBranches(ctx context.Context, accToken *domain.AccessToken, repoUrl string, pagination *types.Pagination) ([]*github.Branch, error) { - owner, repo := gh.getOwnerAndRepo(repoUrl) - - var branches []*github.Branch - hasFetchedAll := false - pageNo := 1 - for !hasFetchedAll { - if pageNo > 5 { - break - } - brcs, _, err := gh.ghCliForUser(ctx, accToken.Token).Repositories.ListBranches( - ctx, owner, repo, &github.BranchListOptions{ - ListOptions: func() github.ListOptions { - return github.ListOptions{Page: pageNo, PerPage: 100} - }(), - }, - ) - if err != nil { - return nil, errors.NewEf(err, "could not list branches") - } - branches = append(branches, brcs...) - if len(brcs) != 100 { - hasFetchedAll = true - } - pageNo++ - } - return branches, nil -} - -func (gh *githubI) SearchRepos(ctx context.Context, accToken *domain.AccessToken, q, org string, pagination *types.Pagination) (*github.RepositoriesSearchResult, error) { - // TODO: search repos not working at all from the API - searchQ := fmt.Sprintf("%s org:%s", q, org) - rsr, resp, err := gh.ghCliForUser(ctx, accToken.Token).Search.Repositories( - context.TODO(), searchQ, &github.SearchOptions{ - ListOptions: gh.buildListOptions(pagination), - }, - ) - fmt.Println(resp) - if err != nil { - return nil, errors.NewEf(err, "could not search repositories") - } - return rsr, nil -} - -func (gh *githubI) ListInstallations(ctx context.Context, accToken *domain.AccessToken, pagination *types.Pagination) ([]*github.Installation, error) { - opts := gh.buildListOptions(pagination) - i, _, err := gh.ghCliForUser(ctx, accToken.Token).Apps.ListUserInstallations(ctx, &opts) - if err != nil { - return nil, errors.NewEf(err, "could not list user installations") - } - return i, nil -} - -func (gh *githubI) ListRepos(ctx context.Context, accToken *domain.AccessToken, instId int64, pagination *types.Pagination) (*github.ListRepositories, error) { - opts := gh.buildListOptions(pagination) - repos, _, err := gh.ghCliForUser(ctx, accToken.Token).Apps.ListUserRepos(ctx, instId, &opts) - if err != nil { - return nil, errors.NewEf(err, "could not list user repositories") - } - return repos, nil -} - -func (gh *githubI) GetLatestCommit(ctx context.Context, accToken *domain.AccessToken, repoUrl string, branchName string) (string, error) { - owner, repo := gh.getOwnerAndRepo(repoUrl) - branch, _, err := gh.ghCliForUser(ctx, accToken.Token).Repositories.GetBranch(ctx, owner, repo, branchName, true) - if err != nil { - return "", err - } - return *branch.GetCommit().SHA, nil -} - -func (gh *githubI) Callback(ctx context.Context, code, state string) (*github.User, *oauth2.Token, error) { - token, err := gh.cfg.Exchange(ctx, code) - if err != nil { - return nil, nil, errors.NewEf(err, "could not exchange the token") - } - c := gh.cfg.Client(ctx, token) - c2 := github.NewClient(c) - u, _, err := c2.Users.Get(ctx, "") - if err != nil { - return nil, nil, errors.NewEf(err, "could nog get authenticated user from github") - } - return u, token, nil -} - -func (gh *githubI) GetToken(ctx context.Context, token *oauth2.Token) (*oauth2.Token, error) { - return gh.cfg.TokenSource(ctx, token).Token() -} - -func (gh *githubI) GetInstallationToken(ctx context.Context, repoUrl string) (string, error) { - owner, repo := gh.getOwnerAndRepo(repoUrl) - inst, _, err := gh.ghCli.Apps.FindRepositoryInstallation(ctx, owner, repo) - if err != nil { - return "", errors.NewEf(err, "could not fetch repository installation") - } - installationId := *inst.ID - it, _, err := gh.ghCli.Apps.CreateInstallationToken(ctx, installationId, &github.InstallationTokenOptions{}) - if err != nil { - return "", errors.NewEf(err, "failed to get installation token") - } - return it.GetToken(), err -} - -type GithubOAuth interface { - GithubConfig() (clientId, clientSecret, callbackUrl, githubAppId, githubAppPKFile string) -} - -func fxGithub(env *Env) (domain.Github, error) { - clientId, clientSecret, callbackUrl, ghAppId, ghAppPKFile := env.GithubConfig() - cfg := oauth2.Config{ - ClientID: clientId, - ClientSecret: clientSecret, - Endpoint: oauthGithub.Endpoint, - RedirectURL: callbackUrl, - Scopes: strings.Split(env.GithubScopes, ","), - // Scopes: []string{"user:email", "admin:org"}, - } - - if _, err := os.Stat(ghAppPKFile); err != nil { - return nil, fmt.Errorf("github privaate key file (path='%s') does not exist", ghAppPKFile) - } - - privatePem, err := ioutil.ReadFile(ghAppPKFile) - if err != nil { - return nil, errors.NewEf(err, "reading github app PK file") - } - - appId, _ := strconv.ParseInt(ghAppId, 10, 64) - itr, err := ghinstallation.NewAppsTransport(http.DefaultTransport, appId, privatePem) - if err != nil { - panic(errors.NewEf(err, "creating app transport")) - } - - ghCliForUser := func(ctx context.Context, token *oauth2.Token) *github.Client { - ts := oauth2.StaticTokenSource(token) - return github.NewClient(oauth2.NewClient(ctx, ts)) - } - - ghCli := github.NewClient(&http.Client{Transport: itr, Timeout: 30 * time.Second}) - - return &githubI{ - cfg: &cfg, - ghCli: ghCli, - ghCliForUser: ghCliForUser, - env: env, - }, nil -} diff --git a/apps/ci/internal/app/gitlab.go b/apps/ci/internal/app/gitlab.go deleted file mode 100644 index 9164b0346..000000000 --- a/apps/ci/internal/app/gitlab.go +++ /dev/null @@ -1,254 +0,0 @@ -package app - -import ( - "context" - "fmt" - "regexp" - "strings" - - "kloudlite.io/apps/ci/internal/domain" - fn "kloudlite.io/pkg/functions" - "kloudlite.io/pkg/types" - - "github.com/xanzy/go-gitlab" - "golang.org/x/oauth2" - oauthGitlab "golang.org/x/oauth2/gitlab" - "kloudlite.io/pkg/errors" -) - -type gitlabI struct { - cfg *oauth2.Config - webhookUrl string - env *Env -} - -func (gl *gitlabI) GetTriggerWebhookUrl() string { - return gl.webhookUrl -} - -func (gl *gitlabI) getToken(_ context.Context, token *domain.AccessToken) (*oauth2.Token, error) { - if token == nil { - return nil, errors.New("token is nil") - } - return token.Token, nil -} - -func (gl *gitlabI) getClient(ctx context.Context, token *domain.AccessToken) (*gitlab.Client, error) { - t, err := gl.getToken(ctx, token) - if err != nil { - return nil, err - } - client, err := gitlab.NewOAuthClient(t.AccessToken) - if err != nil { - return nil, errors.NewEf(err, "could not build gitlab oauth client") - } - return client, nil -} - -func (gl *gitlabI) ListGroups(ctx context.Context, token *domain.AccessToken, query *string, pagination *types.Pagination) ([]domain.GitlabGroup, error) { - client, err := gl.getClient(ctx, token) - if err != nil { - return nil, err - } - groups, _, err := client.Groups.ListGroups( - &gitlab.ListGroupsOptions{ - ListOptions: buildListOptions(pagination), - Search: query, - TopLevelOnly: fn.NewBool(true), - WithCustomAttributes: nil, - }, - ) - if err != nil { - return nil, err - } - - grs := make([]domain.GitlabGroup, 0, len(groups)+1) - - user, _, err := client.Users.CurrentUser() - if err != nil { - return nil, err - } - - grs = append(grs, domain.GitlabGroup{Id: fmt.Sprintf("%d", user.ID), FullName: user.Name, AvatarUrl: user.AvatarURL}) - for i := range groups { - grs = append( - grs, domain.GitlabGroup{ - Id: fmt.Sprintf("%d", groups[i].ID), - FullName: groups[i].FullName, - AvatarUrl: groups[i].AvatarURL, - }, - ) - } - - return grs, nil -} - -func buildListOptions(p *types.Pagination) gitlab.ListOptions { - if p == nil { - return gitlab.ListOptions{} - } - return gitlab.ListOptions{ - Page: p.Page, - PerPage: p.PerPage, - } -} - -func (gl *gitlabI) ListRepos(ctx context.Context, token *domain.AccessToken, gid string, query *string, pagination *types.Pagination) ([]*gitlab.Project, error) { - client, err := gl.getClient(ctx, token) - if err != nil { - return nil, err - } - - user, _, err := client.Users.CurrentUser() - if err != nil { - return nil, errors.NewEf(err, "could not get current gitlab user") - } - - if fmt.Sprintf("%d", user.ID) == gid { - projects, _, err := client.Projects.ListUserProjects( - user.ID, &gitlab.ListProjectsOptions{ - ListOptions: buildListOptions(pagination), - Search: query, - Simple: fn.New(true), - }, - ) - return projects, err - } - - projects, _, err := client.Groups.ListGroupProjects( - gid, &gitlab.ListGroupProjectsOptions{ - IncludeSubGroups: fn.NewBool(true), - ListOptions: buildListOptions(pagination), - Search: query, - Simple: fn.NewBool(true), - }, - ) - return projects, err -} - -func (gl *gitlabI) ListBranches(ctx context.Context, token *domain.AccessToken, repoId string, query *string, pagination *types.Pagination) ([]*gitlab.Branch, error) { - client, err := gl.getClient(ctx, token) - if err != nil { - return nil, err - } - branches, _, err := client.Branches.ListBranches( - repoId, &gitlab.ListBranchesOptions{ - ListOptions: buildListOptions(pagination), - Search: query, - }, - ) - - if err != nil { - return nil, errors.NewEf(err, "could not list branches") - } - - return branches, nil -} - -func (gl *gitlabI) getRepoId(repoUrl string) string { - re := regexp.MustCompile("https://(.*?)/(.*)") - // re := regexp.MustCompile("https://(.*?)/(.*)(.git)?") - matches := re.FindStringSubmatch(repoUrl) - return strings.Split(matches[2], ".git")[0] -} - -func (gl *gitlabI) GetRepoId(repoUrl string) string { - return gl.getRepoId(repoUrl) -} - -func (gl *gitlabI) CheckWebhookExists(ctx context.Context, token *domain.AccessToken, repoId string, webhookId *domain.GitlabWebhookId) (bool, error) { - if webhookId == nil { - return false, nil - } - client, err := gl.getClient(ctx, token) - if err != nil { - return false, err - } - - hook, _, err := client.Projects.GetProjectHook(repoId, int(*webhookId)) - if err != nil { - return false, nil - } - return hook != nil, nil -} - -func (gl *gitlabI) AddWebhook(ctx context.Context, token *domain.AccessToken, repoId string, pipelineId string) (*domain.GitlabWebhookId, error) { - client, err := gl.getClient(ctx, token) - if err != nil { - return nil, err - } - // webhookUrl := fmt.Sprintf("%s?pipelineId=%s", gl.webhookUrl, pipelineId) - - hook, _, err := client.Projects.AddProjectHook( - repoId, &gitlab.AddProjectHookOptions{ - PushEvents: fn.NewBool(true), - TagPushEvents: fn.NewBool(true), - Token: &gl.env.GitlabWebhookAuthzSecret, - URL: &gl.webhookUrl, - }, - ) - if err != nil { - return nil, errors.NewEf(err, "could not add gitlab webhook") - } - return fn.New(domain.GitlabWebhookId(hook.ID)), nil -} - -func (gl *gitlabI) DeleteWebhook(ctx context.Context, token *domain.AccessToken, repoUrl string, hookId domain.GitlabWebhookId) error { - client, err := gl.getClient(ctx, token) - if err != nil { - return err - } - _, err = client.Projects.DeleteProjectHook(gl.getRepoId(repoUrl), int(hookId)) - return err -} - -func (gl *gitlabI) GetLatestCommit(ctx context.Context, token *domain.AccessToken, repoUrl string, branchName string) (string, error) { - client, err := gl.getClient(ctx, token) - if err != nil { - return "", err - } - repoId := gl.getRepoId(repoUrl) - branch, _, err := client.Branches.GetBranch(repoId, branchName) - if err != nil { - return "", err - } - return branch.Commit.ShortID, nil -} - -func (gl *gitlabI) RepoToken(ctx context.Context, token *domain.AccessToken) (*oauth2.Token, error) { - return gl.getToken(ctx, token) -} - -func (gl *gitlabI) Callback(ctx context.Context, code string, state string) (*gitlab.User, *oauth2.Token, error) { - token, err := gl.cfg.Exchange(ctx, code) - if err != nil { - return nil, nil, errors.NewEf(err, "could not exchange the token") - } - - c2, err := gitlab.NewOAuthClient(token.AccessToken) - if err != nil { - return nil, nil, errors.NewEf(err, "could not create gitlab oauth client") - } - u, _, err := c2.Users.CurrentUser() - if err != nil { - return nil, nil, errors.NewEf(err, "could not get gitlab user") - } - return u, token, nil -} - -type GitlabOAuth interface { - GitlabConfig() (clientId, clientSecret, callbackUrl string) -} - -func fxGitlab(env *Env) domain.Gitlab { - clientId, clientSecret, callbackUrl := env.GitlabConfig() - cfg := oauth2.Config{ - ClientID: clientId, - ClientSecret: clientSecret, - Endpoint: oauthGitlab.Endpoint, - RedirectURL: callbackUrl, - Scopes: strings.Split(env.GitlabScopes, ","), - } - - return &gitlabI{cfg: &cfg, webhookUrl: env.GitlabWebhookUrl, env: env} -} diff --git a/apps/ci/internal/app/gqlgen.yml b/apps/ci/internal/app/gqlgen.yml deleted file mode 100644 index 5822a1359..000000000 --- a/apps/ci/internal/app/gqlgen.yml +++ /dev/null @@ -1,74 +0,0 @@ -# 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/generated.go - package: generated - -# Uncomment to enable federation -federation: - filename: graph/generated/federation.go - package: generated - -# 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 - -# Optional: turn on use ` + "`" + `gqlgen:"fieldName"` + "`" + ` tags in your models -# struct_tag: json - -# Optional: turn on to use []Thing instead of []*Thing -# omit_slice_element_pointers: false - -# Optional: set to speed up generation time by not performing a final validation pass. -# skip_validation: true - -# gqlgen will search for any type names in the schema in these go packages -# if they match it will use them, otherwise it will generate them. -autobind: - - "kloudlite.io/pkg/errors" - # - "kloudlite.io/apps/wireguard/internal/domain/entities" - -# This section declares type mapping between the GraphQL and go type systems -# -# The first line in each type will be used as defaults for resolver arguments and -# modelgen, the others will be allowed when binding to fields. Configure them to -# your liking -skip_validation: true -models: - App: - fields: - pipelines: - resolver: true - ci_createDockerPipeLine: - resolver: true - ci_createPipeLine: - resolver: true - - HarborSearchResult: - fields: - tags: - resolver: true - ID: - model: - - kloudlite.io/pkg/repos.ID - Int: - model: - - github.com/99designs/gqlgen/graphql.Int - - github.com/99designs/gqlgen/graphql.Int64 - - github.com/99designs/gqlgen/graphql.Int32 - PaginationIn: - model: - - kloudlite.io/pkg/types.Pagination - Json: - model: - - github.com/99designs/gqlgen/graphql.Map diff --git a/apps/ci/internal/app/graph/generated/generated.go b/apps/ci/internal/app/graph/generated/generated.go deleted file mode 100644 index 30ce72edc..000000000 --- a/apps/ci/internal/app/graph/generated/generated.go +++ /dev/null @@ -1,8459 +0,0 @@ -// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. - -package generated - -import ( - "bytes" - "context" - "errors" - "fmt" - "strconv" - "sync" - "sync/atomic" - "time" - - "github.com/99designs/gqlgen/graphql" - "github.com/99designs/gqlgen/graphql/introspection" - "github.com/99designs/gqlgen/plugin/federation/fedruntime" - gqlparser "github.com/vektah/gqlparser/v2" - "github.com/vektah/gqlparser/v2/ast" - "kloudlite.io/apps/ci/internal/app/graph/model" - "kloudlite.io/pkg/repos" - "kloudlite.io/pkg/types" -) - -// region ************************** generated!.gotpl ************************** - -// NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface. -func NewExecutableSchema(cfg Config) graphql.ExecutableSchema { - return &executableSchema{ - resolvers: cfg.Resolvers, - directives: cfg.Directives, - complexity: cfg.Complexity, - } -} - -type Config struct { - Resolvers ResolverRoot - Directives DirectiveRoot - Complexity ComplexityRoot -} - -type ResolverRoot interface { - App() AppResolver - Entity() EntityResolver - HarborSearchResult() HarborSearchResultResolver - Mutation() MutationResolver - Query() QueryResolver -} - -type DirectiveRoot struct { -} - -type ComplexityRoot struct { - App struct { - CiCreateDockerPipeLine func(childComplexity int, containerName string, in model.GitDockerPipelineIn) int - CiCreatePipeLine func(childComplexity int, containerName string, in model.GitPipelineIn) int - ID func(childComplexity int) int - Pipelines func(childComplexity int) int - } - - DockerBuild struct { - BuildArgs func(childComplexity int) int - ContextDir func(childComplexity int) int - DockerFile func(childComplexity int) int - } - - Entity struct { - FindAppByID func(childComplexity int, id repos.ID) int - } - - GitPipeline struct { - Build func(childComplexity int) int - DockerBuild func(childComplexity int) int - GitBranch func(childComplexity int) int - GitProvider func(childComplexity int) int - GitRepoURL func(childComplexity int) int - ID func(childComplexity int) int - Metadata func(childComplexity int) int - Name func(childComplexity int) int - Run func(childComplexity int) int - } - - GitPipelineArtifact struct { - DockerImageName func(childComplexity int) int - DockerImageTag func(childComplexity int) int - } - - GitPipelineBuild struct { - BaseImage func(childComplexity int) int - Cmd func(childComplexity int) int - OutputDir func(childComplexity int) int - } - - GitPipelineRun struct { - BaseImage func(childComplexity int) int - Cmd func(childComplexity int) int - } - - HarborImageTagsResult struct { - Immutable func(childComplexity int) int - Name func(childComplexity int) int - Signed func(childComplexity int) int - } - - HarborSearchResult struct { - CreatedAt func(childComplexity int) int - ImageName func(childComplexity int) int - Tags func(childComplexity int) int - UpdatedAt func(childComplexity int) int - } - - Mutation struct { - CiCreateDockerPipeline func(childComplexity int, in model.GitDockerPipelineIn) int - CiCreatePipeline func(childComplexity int, in model.GitPipelineIn) int - CiDeletePipeline func(childComplexity int, pipelineID repos.ID) int - } - - PipelineRun struct { - ArtifactRef func(childComplexity int) int - Build func(childComplexity int) int - CreationTime func(childComplexity int) int - DockerBuildInput func(childComplexity int) int - EndTime func(childComplexity int) int - GitBranch func(childComplexity int) int - GitProvider func(childComplexity int) int - GitRepo func(childComplexity int) int - ID func(childComplexity int) int - Message func(childComplexity int) int - PipelineID func(childComplexity int) int - Run func(childComplexity int) int - StartTime func(childComplexity int) int - State func(childComplexity int) int - Success func(childComplexity int) int - } - - Query struct { - CiGetPipeline func(childComplexity int, pipelineID repos.ID) int - CiGetPipelineRun func(childComplexity int, pipelineRunID repos.ID) int - CiGetPipelineRuns func(childComplexity int, pipelineID repos.ID) int - CiGetPipelines func(childComplexity int, projectID repos.ID) int - CiGithubInstallationToken func(childComplexity int, repoURL string) int - CiGithubInstallations func(childComplexity int, pagination *types.Pagination) int - CiGithubRepoBranches func(childComplexity int, repoURL string, pagination *types.Pagination) int - CiGithubRepos func(childComplexity int, installationID int, pagination *types.Pagination) int - CiGitlabGroups func(childComplexity int, query *string, pagination *types.Pagination) int - CiGitlabRepoBranches func(childComplexity int, repoID string, search *string, pagination *types.Pagination) int - CiGitlabRepos func(childComplexity int, groupID string, search *string, pagination *types.Pagination) int - CiHarborImageTags func(childComplexity int, imageName string, pagination *types.Pagination) int - CiHarborSearch func(childComplexity int, accountID repos.ID, q string, pagination *types.Pagination) int - CiSearchGithubRepos func(childComplexity int, search *string, org string, pagination *types.Pagination) int - CiTriggerPipeline func(childComplexity int, pipelineID repos.ID) int - __resolve__service func(childComplexity int) int - __resolve_entities func(childComplexity int, representations []map[string]interface{}) int - } - - _Service struct { - SDL func(childComplexity int) int - } -} - -type AppResolver interface { - Pipelines(ctx context.Context, obj *model.App) ([]*model.GitPipeline, error) - CiCreateDockerPipeLine(ctx context.Context, obj *model.App, containerName string, in model.GitDockerPipelineIn) (map[string]interface{}, error) - CiCreatePipeLine(ctx context.Context, obj *model.App, containerName string, in model.GitPipelineIn) (map[string]interface{}, error) -} -type EntityResolver interface { - FindAppByID(ctx context.Context, id repos.ID) (*model.App, error) -} -type HarborSearchResultResolver interface { - Tags(ctx context.Context, obj *model.HarborSearchResult) ([]*model.HarborImageTagsResult, error) -} -type MutationResolver interface { - CiDeletePipeline(ctx context.Context, pipelineID repos.ID) (bool, error) - CiCreatePipeline(ctx context.Context, in model.GitPipelineIn) (map[string]interface{}, error) - CiCreateDockerPipeline(ctx context.Context, in model.GitDockerPipelineIn) (map[string]interface{}, error) -} -type QueryResolver interface { - CiGithubInstallations(ctx context.Context, pagination *types.Pagination) (interface{}, error) - CiGithubInstallationToken(ctx context.Context, repoURL string) (interface{}, error) - CiGithubRepos(ctx context.Context, installationID int, pagination *types.Pagination) (interface{}, error) - CiGithubRepoBranches(ctx context.Context, repoURL string, pagination *types.Pagination) (interface{}, error) - CiSearchGithubRepos(ctx context.Context, search *string, org string, pagination *types.Pagination) (interface{}, error) - CiGitlabGroups(ctx context.Context, query *string, pagination *types.Pagination) (interface{}, error) - CiGitlabRepos(ctx context.Context, groupID string, search *string, pagination *types.Pagination) (interface{}, error) - CiGitlabRepoBranches(ctx context.Context, repoID string, search *string, pagination *types.Pagination) (interface{}, error) - CiGetPipelines(ctx context.Context, projectID repos.ID) ([]*model.GitPipeline, error) - CiGetPipeline(ctx context.Context, pipelineID repos.ID) (*model.GitPipeline, error) - CiTriggerPipeline(ctx context.Context, pipelineID repos.ID) (*bool, error) - CiGetPipelineRuns(ctx context.Context, pipelineID repos.ID) ([]*model.PipelineRun, error) - CiGetPipelineRun(ctx context.Context, pipelineRunID repos.ID) (*model.PipelineRun, error) - CiHarborSearch(ctx context.Context, accountID repos.ID, q string, pagination *types.Pagination) ([]*model.HarborSearchResult, error) - CiHarborImageTags(ctx context.Context, imageName string, pagination *types.Pagination) ([]*model.HarborImageTagsResult, error) -} - -type executableSchema struct { - resolvers ResolverRoot - directives DirectiveRoot - complexity ComplexityRoot -} - -func (e *executableSchema) Schema() *ast.Schema { - return parsedSchema -} - -func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) { - ec := executionContext{nil, e} - _ = ec - switch typeName + "." + field { - - case "App.ci_createDockerPipeLine": - if e.complexity.App.CiCreateDockerPipeLine == nil { - break - } - - args, err := ec.field_App_ci_createDockerPipeLine_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.App.CiCreateDockerPipeLine(childComplexity, args["containerName"].(string), args["in"].(model.GitDockerPipelineIn)), true - - case "App.ci_createPipeLine": - if e.complexity.App.CiCreatePipeLine == nil { - break - } - - args, err := ec.field_App_ci_createPipeLine_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.App.CiCreatePipeLine(childComplexity, args["containerName"].(string), args["in"].(model.GitPipelineIn)), true - - case "App.id": - if e.complexity.App.ID == nil { - break - } - - return e.complexity.App.ID(childComplexity), true - - case "App.pipelines": - if e.complexity.App.Pipelines == nil { - break - } - - return e.complexity.App.Pipelines(childComplexity), true - - case "DockerBuild.buildArgs": - if e.complexity.DockerBuild.BuildArgs == nil { - break - } - - return e.complexity.DockerBuild.BuildArgs(childComplexity), true - - case "DockerBuild.contextDir": - if e.complexity.DockerBuild.ContextDir == nil { - break - } - - return e.complexity.DockerBuild.ContextDir(childComplexity), true - - case "DockerBuild.dockerFile": - if e.complexity.DockerBuild.DockerFile == nil { - break - } - - return e.complexity.DockerBuild.DockerFile(childComplexity), true - - case "Entity.findAppByID": - if e.complexity.Entity.FindAppByID == nil { - break - } - - args, err := ec.field_Entity_findAppByID_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Entity.FindAppByID(childComplexity, args["id"].(repos.ID)), true - - case "GitPipeline.build": - if e.complexity.GitPipeline.Build == nil { - break - } - - return e.complexity.GitPipeline.Build(childComplexity), true - - case "GitPipeline.dockerBuild": - if e.complexity.GitPipeline.DockerBuild == nil { - break - } - - return e.complexity.GitPipeline.DockerBuild(childComplexity), true - - case "GitPipeline.gitBranch": - if e.complexity.GitPipeline.GitBranch == nil { - break - } - - return e.complexity.GitPipeline.GitBranch(childComplexity), true - - case "GitPipeline.gitProvider": - if e.complexity.GitPipeline.GitProvider == nil { - break - } - - return e.complexity.GitPipeline.GitProvider(childComplexity), true - - case "GitPipeline.gitRepoUrl": - if e.complexity.GitPipeline.GitRepoURL == nil { - break - } - - return e.complexity.GitPipeline.GitRepoURL(childComplexity), true - - case "GitPipeline.id": - if e.complexity.GitPipeline.ID == nil { - break - } - - return e.complexity.GitPipeline.ID(childComplexity), true - - case "GitPipeline.metadata": - if e.complexity.GitPipeline.Metadata == nil { - break - } - - return e.complexity.GitPipeline.Metadata(childComplexity), true - - case "GitPipeline.name": - if e.complexity.GitPipeline.Name == nil { - break - } - - return e.complexity.GitPipeline.Name(childComplexity), true - - case "GitPipeline.run": - if e.complexity.GitPipeline.Run == nil { - break - } - - return e.complexity.GitPipeline.Run(childComplexity), true - - case "GitPipelineArtifact.dockerImageName": - if e.complexity.GitPipelineArtifact.DockerImageName == nil { - break - } - - return e.complexity.GitPipelineArtifact.DockerImageName(childComplexity), true - - case "GitPipelineArtifact.dockerImageTag": - if e.complexity.GitPipelineArtifact.DockerImageTag == nil { - break - } - - return e.complexity.GitPipelineArtifact.DockerImageTag(childComplexity), true - - case "GitPipelineBuild.baseImage": - if e.complexity.GitPipelineBuild.BaseImage == nil { - break - } - - return e.complexity.GitPipelineBuild.BaseImage(childComplexity), true - - case "GitPipelineBuild.cmd": - if e.complexity.GitPipelineBuild.Cmd == nil { - break - } - - return e.complexity.GitPipelineBuild.Cmd(childComplexity), true - - case "GitPipelineBuild.outputDir": - if e.complexity.GitPipelineBuild.OutputDir == nil { - break - } - - return e.complexity.GitPipelineBuild.OutputDir(childComplexity), true - - case "GitPipelineRun.baseImage": - if e.complexity.GitPipelineRun.BaseImage == nil { - break - } - - return e.complexity.GitPipelineRun.BaseImage(childComplexity), true - - case "GitPipelineRun.cmd": - if e.complexity.GitPipelineRun.Cmd == nil { - break - } - - return e.complexity.GitPipelineRun.Cmd(childComplexity), true - - case "HarborImageTagsResult.immutable": - if e.complexity.HarborImageTagsResult.Immutable == nil { - break - } - - return e.complexity.HarborImageTagsResult.Immutable(childComplexity), true - - case "HarborImageTagsResult.name": - if e.complexity.HarborImageTagsResult.Name == nil { - break - } - - return e.complexity.HarborImageTagsResult.Name(childComplexity), true - - case "HarborImageTagsResult.signed": - if e.complexity.HarborImageTagsResult.Signed == nil { - break - } - - return e.complexity.HarborImageTagsResult.Signed(childComplexity), true - - case "HarborSearchResult.createdAt": - if e.complexity.HarborSearchResult.CreatedAt == nil { - break - } - - return e.complexity.HarborSearchResult.CreatedAt(childComplexity), true - - case "HarborSearchResult.imageName": - if e.complexity.HarborSearchResult.ImageName == nil { - break - } - - return e.complexity.HarborSearchResult.ImageName(childComplexity), true - - case "HarborSearchResult.tags": - if e.complexity.HarborSearchResult.Tags == nil { - break - } - - return e.complexity.HarborSearchResult.Tags(childComplexity), true - - case "HarborSearchResult.updatedAt": - if e.complexity.HarborSearchResult.UpdatedAt == nil { - break - } - - return e.complexity.HarborSearchResult.UpdatedAt(childComplexity), true - - case "Mutation.ci_createDockerPipeline": - if e.complexity.Mutation.CiCreateDockerPipeline == nil { - break - } - - args, err := ec.field_Mutation_ci_createDockerPipeline_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Mutation.CiCreateDockerPipeline(childComplexity, args["in"].(model.GitDockerPipelineIn)), true - - case "Mutation.ci_createPipeline": - if e.complexity.Mutation.CiCreatePipeline == nil { - break - } - - args, err := ec.field_Mutation_ci_createPipeline_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Mutation.CiCreatePipeline(childComplexity, args["in"].(model.GitPipelineIn)), true - - case "Mutation.ci_deletePipeline": - if e.complexity.Mutation.CiDeletePipeline == nil { - break - } - - args, err := ec.field_Mutation_ci_deletePipeline_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Mutation.CiDeletePipeline(childComplexity, args["pipelineId"].(repos.ID)), true - - case "PipelineRun.artifactRef": - if e.complexity.PipelineRun.ArtifactRef == nil { - break - } - - return e.complexity.PipelineRun.ArtifactRef(childComplexity), true - - case "PipelineRun.build": - if e.complexity.PipelineRun.Build == nil { - break - } - - return e.complexity.PipelineRun.Build(childComplexity), true - - case "PipelineRun.creationTime": - if e.complexity.PipelineRun.CreationTime == nil { - break - } - - return e.complexity.PipelineRun.CreationTime(childComplexity), true - - case "PipelineRun.dockerBuildInput": - if e.complexity.PipelineRun.DockerBuildInput == nil { - break - } - - return e.complexity.PipelineRun.DockerBuildInput(childComplexity), true - - case "PipelineRun.endTime": - if e.complexity.PipelineRun.EndTime == nil { - break - } - - return e.complexity.PipelineRun.EndTime(childComplexity), true - - case "PipelineRun.gitBranch": - if e.complexity.PipelineRun.GitBranch == nil { - break - } - - return e.complexity.PipelineRun.GitBranch(childComplexity), true - - case "PipelineRun.gitProvider": - if e.complexity.PipelineRun.GitProvider == nil { - break - } - - return e.complexity.PipelineRun.GitProvider(childComplexity), true - - case "PipelineRun.gitRepo": - if e.complexity.PipelineRun.GitRepo == nil { - break - } - - return e.complexity.PipelineRun.GitRepo(childComplexity), true - - case "PipelineRun.id": - if e.complexity.PipelineRun.ID == nil { - break - } - - return e.complexity.PipelineRun.ID(childComplexity), true - - case "PipelineRun.message": - if e.complexity.PipelineRun.Message == nil { - break - } - - return e.complexity.PipelineRun.Message(childComplexity), true - - case "PipelineRun.pipelineId": - if e.complexity.PipelineRun.PipelineID == nil { - break - } - - return e.complexity.PipelineRun.PipelineID(childComplexity), true - - case "PipelineRun.run": - if e.complexity.PipelineRun.Run == nil { - break - } - - return e.complexity.PipelineRun.Run(childComplexity), true - - case "PipelineRun.startTime": - if e.complexity.PipelineRun.StartTime == nil { - break - } - - return e.complexity.PipelineRun.StartTime(childComplexity), true - - case "PipelineRun.state": - if e.complexity.PipelineRun.State == nil { - break - } - - return e.complexity.PipelineRun.State(childComplexity), true - - case "PipelineRun.success": - if e.complexity.PipelineRun.Success == nil { - break - } - - return e.complexity.PipelineRun.Success(childComplexity), true - - case "Query.ci_getPipeline": - if e.complexity.Query.CiGetPipeline == nil { - break - } - - args, err := ec.field_Query_ci_getPipeline_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.CiGetPipeline(childComplexity, args["pipelineId"].(repos.ID)), true - - case "Query.ci_getPipelineRun": - if e.complexity.Query.CiGetPipelineRun == nil { - break - } - - args, err := ec.field_Query_ci_getPipelineRun_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.CiGetPipelineRun(childComplexity, args["pipelineRunId"].(repos.ID)), true - - case "Query.ci_getPipelineRuns": - if e.complexity.Query.CiGetPipelineRuns == nil { - break - } - - args, err := ec.field_Query_ci_getPipelineRuns_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.CiGetPipelineRuns(childComplexity, args["pipelineId"].(repos.ID)), true - - case "Query.ci_getPipelines": - if e.complexity.Query.CiGetPipelines == nil { - break - } - - args, err := ec.field_Query_ci_getPipelines_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.CiGetPipelines(childComplexity, args["projectId"].(repos.ID)), true - - case "Query.ci_githubInstallationToken": - if e.complexity.Query.CiGithubInstallationToken == nil { - break - } - - args, err := ec.field_Query_ci_githubInstallationToken_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.CiGithubInstallationToken(childComplexity, args["repoUrl"].(string)), true - - case "Query.ci_githubInstallations": - if e.complexity.Query.CiGithubInstallations == nil { - break - } - - args, err := ec.field_Query_ci_githubInstallations_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.CiGithubInstallations(childComplexity, args["pagination"].(*types.Pagination)), true - - case "Query.ci_githubRepoBranches": - if e.complexity.Query.CiGithubRepoBranches == nil { - break - } - - args, err := ec.field_Query_ci_githubRepoBranches_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.CiGithubRepoBranches(childComplexity, args["repoUrl"].(string), args["pagination"].(*types.Pagination)), true - - case "Query.ci_githubRepos": - if e.complexity.Query.CiGithubRepos == nil { - break - } - - args, err := ec.field_Query_ci_githubRepos_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.CiGithubRepos(childComplexity, args["installationId"].(int), args["pagination"].(*types.Pagination)), true - - case "Query.ci_gitlabGroups": - if e.complexity.Query.CiGitlabGroups == nil { - break - } - - args, err := ec.field_Query_ci_gitlabGroups_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.CiGitlabGroups(childComplexity, args["query"].(*string), args["pagination"].(*types.Pagination)), true - - case "Query.ci_gitlabRepoBranches": - if e.complexity.Query.CiGitlabRepoBranches == nil { - break - } - - args, err := ec.field_Query_ci_gitlabRepoBranches_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.CiGitlabRepoBranches(childComplexity, args["repoId"].(string), args["search"].(*string), args["pagination"].(*types.Pagination)), true - - case "Query.ci_gitlabRepos": - if e.complexity.Query.CiGitlabRepos == nil { - break - } - - args, err := ec.field_Query_ci_gitlabRepos_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.CiGitlabRepos(childComplexity, args["groupId"].(string), args["search"].(*string), args["pagination"].(*types.Pagination)), true - - case "Query.ci_harborImageTags": - if e.complexity.Query.CiHarborImageTags == nil { - break - } - - args, err := ec.field_Query_ci_harborImageTags_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.CiHarborImageTags(childComplexity, args["imageName"].(string), args["pagination"].(*types.Pagination)), true - - case "Query.ci_harborSearch": - if e.complexity.Query.CiHarborSearch == nil { - break - } - - args, err := ec.field_Query_ci_harborSearch_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.CiHarborSearch(childComplexity, args["accountId"].(repos.ID), args["q"].(string), args["pagination"].(*types.Pagination)), true - - case "Query.ci_searchGithubRepos": - if e.complexity.Query.CiSearchGithubRepos == nil { - break - } - - args, err := ec.field_Query_ci_searchGithubRepos_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.CiSearchGithubRepos(childComplexity, args["search"].(*string), args["org"].(string), args["pagination"].(*types.Pagination)), true - - case "Query.ci_triggerPipeline": - if e.complexity.Query.CiTriggerPipeline == nil { - break - } - - args, err := ec.field_Query_ci_triggerPipeline_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.CiTriggerPipeline(childComplexity, args["pipelineId"].(repos.ID)), true - - case "Query._service": - if e.complexity.Query.__resolve__service == nil { - break - } - - return e.complexity.Query.__resolve__service(childComplexity), true - - case "Query._entities": - if e.complexity.Query.__resolve_entities == nil { - break - } - - args, err := ec.field_Query__entities_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.__resolve_entities(childComplexity, args["representations"].([]map[string]interface{})), true - - case "_Service.sdl": - if e.complexity._Service.SDL == nil { - break - } - - return e.complexity._Service.SDL(childComplexity), true - - } - return 0, false -} - -func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { - rc := graphql.GetOperationContext(ctx) - ec := executionContext{rc, e} - first := true - - switch rc.Operation.Operation { - case ast.Query: - return func(ctx context.Context) *graphql.Response { - if !first { - return nil - } - first = false - data := ec._Query(ctx, rc.Operation.SelectionSet) - var buf bytes.Buffer - data.MarshalGQL(&buf) - - return &graphql.Response{ - Data: buf.Bytes(), - } - } - case ast.Mutation: - return func(ctx context.Context) *graphql.Response { - if !first { - return nil - } - first = false - 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 -} - -func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { - if ec.DisableIntrospection { - return nil, errors.New("introspection disabled") - } - return introspection.WrapSchema(parsedSchema), nil -} - -func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { - if ec.DisableIntrospection { - return nil, errors.New("introspection disabled") - } - return introspection.WrapTypeFromDef(parsedSchema, parsedSchema.Types[name]), nil -} - -var sources = []*ast.Source{ - {Name: "graph/schema.graphqls", Input: `scalar Json -scalar Any -scalar Date -scalar Time - -type Query { - ci_githubInstallations(pagination: PaginationIn): Any! # user-access - ci_githubInstallationToken(repoUrl: String!): Any! # user-access - ci_githubRepos(installationId: Int!, pagination: PaginationIn): Any! # user-access - ci_githubRepoBranches(repoUrl: String!, pagination: PaginationIn): Any! # user-access - ci_searchGithubRepos(search: String, org: String!, pagination: PaginationIn): Any! # user-access - - ci_gitlabGroups(query: String, pagination: PaginationIn): Any! # user-access - ci_gitlabRepos(groupId: String!, search: String, pagination: PaginationIn): Any! # user-access - ci_gitlabRepoBranches(repoId: String!, search: String, pagination: PaginationIn): Any! # user-access - - ci_getPipelines(projectId: ID!): [GitPipeline!] # user-access # deprecate - ci_getPipeline(pipelineId: ID!): GitPipeline # user-access # deprecate - ci_triggerPipeline(pipelineId: ID!): Boolean # user-access # deprecate - - ci_getPipelineRuns(pipelineId: ID!): [PipelineRun!] - ci_getPipelineRun(pipelineRunId: ID!): PipelineRun - - ci_harborSearch(accountId: ID!, q: String!, pagination: PaginationIn): [HarborSearchResult!] # account-member-access - ci_harborImageTags(imageName: String!, pagination: PaginationIn): [HarborImageTagsResult!] -} - -type HarborSearchResult { - imageName: String! - updatedAt: Time - createdAt: Time - tags: [HarborImageTagsResult!]! -} - -type PipelineRun { - id: ID! - pipelineId: ID! - creationTime: Time! - startTime: Time - endTime: Time - success: Boolean! - message: String - state: String - gitProvider: String! - gitRepo: String! - gitBranch: String! - - build: GitPipelineBuild - run: GitPipelineRun - dockerBuildInput: DockerBuild - artifactRef: GitPipelineArtifact! -} - -type HarborImageTagsResult { - name: String! - signed: Boolean! - immutable: Boolean! -} - -input PaginationIn { - page: Int! - perPage: Int! -} - -input GitPipelineIn { - name: String! - - accountId: String! - projectId: String! - appId: String! - - projectName: String! - containerName: String! - - gitProvider: String! - gitRepoUrl: String! - repoName: String! - gitBranch: String! - - build: GitPipelineBuildIn - run: GitPipelineRunIn - - artifactRef: GitPipelineArtifactIn - metadata: Json -} - -input GitPipelineBuildIn { - baseImage: String! - cmd: String! - outputDir: String -} - -type GitPipelineBuild { - baseImage: String - cmd: String! - outputDir: String -} - -input GitPipelineRunIn { - baseImage: String - cmd: String! -} - -type GitPipelineRun { - baseImage: String - cmd: String! -} - -input GitPipelineArtifactIn { - dockerImageName: String - dockerImageTag: String -} - -type GitPipelineArtifact { - dockerImageName: String - dockerImageTag: String -} - -type GitPipeline { - id: ID! - name: String! - - gitProvider: String! - gitRepoUrl: String! - gitBranch: String! - - build: GitPipelineBuild - run: GitPipelineRun - - dockerBuild: DockerBuild - - metadata: Json -} - -type DockerBuild { - dockerFile: String! - contextDir: String! - buildArgs: String - -} - -input GitDockerPipelineIn { - name: String! - - accountId: String! - projectId: String! - appId: String! - - projectName: String! - containerName: String! - - gitProvider: String! - gitRepoUrl: String! - repoName: String! - gitBranch: String! - - dockerFile: String! - contextDir: String! - buildArgs: String! - - artifactRef:GitPipelineArtifactIn - metadata: Json -} - -extend type App @key(fields: "id") { - id: ID! @external - pipelines: [GitPipeline!]! # project-developer-access project-admin-access - ci_createDockerPipeLine(containerName: String!, in: GitDockerPipelineIn!): Json! # project-developer-access project-admin-access - ci_createPipeLine(containerName: String!, in: GitPipelineIn!): Json! # project-developer-access project-admin-access -} - -type Mutation { - ci_deletePipeline(pipelineId: ID!): Boolean! # project-developer-access project-admin-access - ci_createPipeline(in: GitPipelineIn!): Json! # project-developer-access project-admin-access - ci_createDockerPipeline(in: GitDockerPipelineIn!): Json! -} -`, BuiltIn: false}, - {Name: "federation/directives.graphql", Input: ` -scalar _Any -scalar _FieldSet - -directive @external on FIELD_DEFINITION -directive @requires(fields: _FieldSet!) on FIELD_DEFINITION -directive @provides(fields: _FieldSet!) on FIELD_DEFINITION -directive @key(fields: _FieldSet!) repeatable on OBJECT | INTERFACE -directive @extends on OBJECT | INTERFACE -`, BuiltIn: true}, - {Name: "federation/entity.graphql", Input: ` -# a union of all types that use the @key directive -union _Entity = App - -# fake type to build resolver interfaces for users to implement -type Entity { - findAppByID(id: ID!,): App! - -} - -type _Service { - sdl: String -} - -extend type Query { - _entities(representations: [_Any!]!): [_Entity]! - _service: _Service! -} -`, BuiltIn: true}, -} -var parsedSchema = gqlparser.MustLoadSchema(sources...) - -// endregion ************************** generated!.gotpl ************************** - -// region ***************************** args.gotpl ***************************** - -func (ec *executionContext) field_App_ci_createDockerPipeLine_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["containerName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("containerName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["containerName"] = arg0 - var arg1 model.GitDockerPipelineIn - if tmp, ok := rawArgs["in"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) - arg1, err = ec.unmarshalNGitDockerPipelineIn2kloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitDockerPipelineIn(ctx, tmp) - if err != nil { - return nil, err - } - } - args["in"] = arg1 - return args, nil -} - -func (ec *executionContext) field_App_ci_createPipeLine_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["containerName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("containerName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["containerName"] = arg0 - var arg1 model.GitPipelineIn - if tmp, ok := rawArgs["in"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) - arg1, err = ec.unmarshalNGitPipelineIn2kloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitPipelineIn(ctx, tmp) - if err != nil { - return nil, err - } - } - args["in"] = arg1 - return args, nil -} - -func (ec *executionContext) field_Entity_findAppByID_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 repos.ID - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, tmp) - if err != nil { - return nil, err - } - } - args["id"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Mutation_ci_createDockerPipeline_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 model.GitDockerPipelineIn - if tmp, ok := rawArgs["in"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) - arg0, err = ec.unmarshalNGitDockerPipelineIn2kloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitDockerPipelineIn(ctx, tmp) - if err != nil { - return nil, err - } - } - args["in"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Mutation_ci_createPipeline_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 model.GitPipelineIn - if tmp, ok := rawArgs["in"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) - arg0, err = ec.unmarshalNGitPipelineIn2kloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitPipelineIn(ctx, tmp) - if err != nil { - return nil, err - } - } - args["in"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Mutation_ci_deletePipeline_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 repos.ID - if tmp, ok := rawArgs["pipelineId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pipelineId")) - arg0, err = ec.unmarshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, tmp) - if err != nil { - return nil, err - } - } - args["pipelineId"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["name"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Query__entities_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 []map[string]interface{} - if tmp, ok := rawArgs["representations"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("representations")) - arg0, err = ec.unmarshalN_Any2ᚕmapᚄ(ctx, tmp) - if err != nil { - return nil, err - } - } - args["representations"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Query_ci_getPipelineRun_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 repos.ID - if tmp, ok := rawArgs["pipelineRunId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pipelineRunId")) - arg0, err = ec.unmarshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, tmp) - if err != nil { - return nil, err - } - } - args["pipelineRunId"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Query_ci_getPipelineRuns_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 repos.ID - if tmp, ok := rawArgs["pipelineId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pipelineId")) - arg0, err = ec.unmarshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, tmp) - if err != nil { - return nil, err - } - } - args["pipelineId"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Query_ci_getPipeline_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 repos.ID - if tmp, ok := rawArgs["pipelineId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pipelineId")) - arg0, err = ec.unmarshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, tmp) - if err != nil { - return nil, err - } - } - args["pipelineId"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Query_ci_getPipelines_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 repos.ID - if tmp, ok := rawArgs["projectId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectId")) - arg0, err = ec.unmarshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectId"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Query_ci_githubInstallationToken_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["repoUrl"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("repoUrl")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["repoUrl"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Query_ci_githubInstallations_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *types.Pagination - if tmp, ok := rawArgs["pagination"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pagination")) - arg0, err = ec.unmarshalOPaginationIn2ᚖkloudliteᚗioᚋpkgᚋtypesᚐPagination(ctx, tmp) - if err != nil { - return nil, err - } - } - args["pagination"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Query_ci_githubRepoBranches_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["repoUrl"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("repoUrl")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["repoUrl"] = arg0 - var arg1 *types.Pagination - if tmp, ok := rawArgs["pagination"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pagination")) - arg1, err = ec.unmarshalOPaginationIn2ᚖkloudliteᚗioᚋpkgᚋtypesᚐPagination(ctx, tmp) - if err != nil { - return nil, err - } - } - args["pagination"] = arg1 - return args, nil -} - -func (ec *executionContext) field_Query_ci_githubRepos_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 int - if tmp, ok := rawArgs["installationId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("installationId")) - arg0, err = ec.unmarshalNInt2int(ctx, tmp) - if err != nil { - return nil, err - } - } - args["installationId"] = arg0 - var arg1 *types.Pagination - if tmp, ok := rawArgs["pagination"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pagination")) - arg1, err = ec.unmarshalOPaginationIn2ᚖkloudliteᚗioᚋpkgᚋtypesᚐPagination(ctx, tmp) - if err != nil { - return nil, err - } - } - args["pagination"] = arg1 - return args, nil -} - -func (ec *executionContext) field_Query_ci_gitlabGroups_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *string - if tmp, ok := rawArgs["query"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("query")) - arg0, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["query"] = arg0 - var arg1 *types.Pagination - if tmp, ok := rawArgs["pagination"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pagination")) - arg1, err = ec.unmarshalOPaginationIn2ᚖkloudliteᚗioᚋpkgᚋtypesᚐPagination(ctx, tmp) - if err != nil { - return nil, err - } - } - args["pagination"] = arg1 - return args, nil -} - -func (ec *executionContext) field_Query_ci_gitlabRepoBranches_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["repoId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("repoId")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["repoId"] = arg0 - var arg1 *string - if tmp, ok := rawArgs["search"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) - arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["search"] = arg1 - var arg2 *types.Pagination - if tmp, ok := rawArgs["pagination"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pagination")) - arg2, err = ec.unmarshalOPaginationIn2ᚖkloudliteᚗioᚋpkgᚋtypesᚐPagination(ctx, tmp) - if err != nil { - return nil, err - } - } - args["pagination"] = arg2 - return args, nil -} - -func (ec *executionContext) field_Query_ci_gitlabRepos_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["groupId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupId")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["groupId"] = arg0 - var arg1 *string - if tmp, ok := rawArgs["search"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) - arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["search"] = arg1 - var arg2 *types.Pagination - if tmp, ok := rawArgs["pagination"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pagination")) - arg2, err = ec.unmarshalOPaginationIn2ᚖkloudliteᚗioᚋpkgᚋtypesᚐPagination(ctx, tmp) - if err != nil { - return nil, err - } - } - args["pagination"] = arg2 - return args, nil -} - -func (ec *executionContext) field_Query_ci_harborImageTags_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["imageName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("imageName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["imageName"] = arg0 - var arg1 *types.Pagination - if tmp, ok := rawArgs["pagination"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pagination")) - arg1, err = ec.unmarshalOPaginationIn2ᚖkloudliteᚗioᚋpkgᚋtypesᚐPagination(ctx, tmp) - if err != nil { - return nil, err - } - } - args["pagination"] = arg1 - return args, nil -} - -func (ec *executionContext) field_Query_ci_harborSearch_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 repos.ID - if tmp, ok := rawArgs["accountId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("accountId")) - arg0, err = ec.unmarshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, tmp) - if err != nil { - return nil, err - } - } - args["accountId"] = arg0 - var arg1 string - if tmp, ok := rawArgs["q"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("q")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["q"] = arg1 - var arg2 *types.Pagination - if tmp, ok := rawArgs["pagination"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pagination")) - arg2, err = ec.unmarshalOPaginationIn2ᚖkloudliteᚗioᚋpkgᚋtypesᚐPagination(ctx, tmp) - if err != nil { - return nil, err - } - } - args["pagination"] = arg2 - return args, nil -} - -func (ec *executionContext) field_Query_ci_searchGithubRepos_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["search"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) - arg0, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["search"] = arg0 - var arg1 string - if tmp, ok := rawArgs["org"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("org")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["org"] = arg1 - var arg2 *types.Pagination - if tmp, ok := rawArgs["pagination"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pagination")) - arg2, err = ec.unmarshalOPaginationIn2ᚖkloudliteᚗioᚋpkgᚋtypesᚐPagination(ctx, tmp) - if err != nil { - return nil, err - } - } - args["pagination"] = arg2 - return args, nil -} - -func (ec *executionContext) field_Query_ci_triggerPipeline_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 repos.ID - if tmp, ok := rawArgs["pipelineId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pipelineId")) - arg0, err = ec.unmarshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, tmp) - if err != nil { - return nil, err - } - } - args["pipelineId"] = 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) _App_id(ctx context.Context, field graphql.CollectedField, obj *model.App) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "App", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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.(repos.ID) - fc.Result = res - return ec.marshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, field.Selections, res) -} - -func (ec *executionContext) _App_pipelines(ctx context.Context, field graphql.CollectedField, obj *model.App) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "App", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.App().Pipelines(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.GitPipeline) - fc.Result = res - return ec.marshalNGitPipeline2ᚕᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitPipelineᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) _App_ci_createDockerPipeLine(ctx context.Context, field graphql.CollectedField, obj *model.App) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "App", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_App_ci_createDockerPipeLine_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.App().CiCreateDockerPipeLine(rctx, obj, args["containerName"].(string), args["in"].(model.GitDockerPipelineIn)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalNJson2map(ctx, field.Selections, res) -} - -func (ec *executionContext) _App_ci_createPipeLine(ctx context.Context, field graphql.CollectedField, obj *model.App) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "App", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_App_ci_createPipeLine_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.App().CiCreatePipeLine(rctx, obj, args["containerName"].(string), args["in"].(model.GitPipelineIn)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalNJson2map(ctx, field.Selections, res) -} - -func (ec *executionContext) _DockerBuild_dockerFile(ctx context.Context, field graphql.CollectedField, obj *model.DockerBuild) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "DockerBuild", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DockerFile, nil - }) - if err != nil { - ec.Error(ctx, err) - 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) _DockerBuild_contextDir(ctx context.Context, field graphql.CollectedField, obj *model.DockerBuild) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "DockerBuild", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ContextDir, nil - }) - if err != nil { - ec.Error(ctx, err) - 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) _DockerBuild_buildArgs(ctx context.Context, field graphql.CollectedField, obj *model.DockerBuild) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "DockerBuild", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.BuildArgs, nil - }) - 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) _Entity_findAppByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Entity", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Entity_findAppByID_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Entity().FindAppByID(rctx, args["id"].(repos.ID)) - }) - if err != nil { - ec.Error(ctx, 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.App) - fc.Result = res - return ec.marshalNApp2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐApp(ctx, field.Selections, res) -} - -func (ec *executionContext) _GitPipeline_id(ctx context.Context, field graphql.CollectedField, obj *model.GitPipeline) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "GitPipeline", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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.(repos.ID) - fc.Result = res - return ec.marshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, field.Selections, res) -} - -func (ec *executionContext) _GitPipeline_name(ctx context.Context, field graphql.CollectedField, obj *model.GitPipeline) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "GitPipeline", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) _GitPipeline_gitProvider(ctx context.Context, field graphql.CollectedField, obj *model.GitPipeline) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "GitPipeline", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.GitProvider, nil - }) - if err != nil { - ec.Error(ctx, err) - 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) _GitPipeline_gitRepoUrl(ctx context.Context, field graphql.CollectedField, obj *model.GitPipeline) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "GitPipeline", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.GitRepoURL, nil - }) - if err != nil { - ec.Error(ctx, err) - 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) _GitPipeline_gitBranch(ctx context.Context, field graphql.CollectedField, obj *model.GitPipeline) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "GitPipeline", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.GitBranch, nil - }) - if err != nil { - ec.Error(ctx, err) - 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) _GitPipeline_build(ctx context.Context, field graphql.CollectedField, obj *model.GitPipeline) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "GitPipeline", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Build, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.GitPipelineBuild) - fc.Result = res - return ec.marshalOGitPipelineBuild2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitPipelineBuild(ctx, field.Selections, res) -} - -func (ec *executionContext) _GitPipeline_run(ctx context.Context, field graphql.CollectedField, obj *model.GitPipeline) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "GitPipeline", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Run, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.GitPipelineRun) - fc.Result = res - return ec.marshalOGitPipelineRun2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitPipelineRun(ctx, field.Selections, res) -} - -func (ec *executionContext) _GitPipeline_dockerBuild(ctx context.Context, field graphql.CollectedField, obj *model.GitPipeline) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "GitPipeline", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DockerBuild, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.DockerBuild) - fc.Result = res - return ec.marshalODockerBuild2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐDockerBuild(ctx, field.Selections, res) -} - -func (ec *executionContext) _GitPipeline_metadata(ctx context.Context, field graphql.CollectedField, obj *model.GitPipeline) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "GitPipeline", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Metadata, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOJson2map(ctx, field.Selections, res) -} - -func (ec *executionContext) _GitPipelineArtifact_dockerImageName(ctx context.Context, field graphql.CollectedField, obj *model.GitPipelineArtifact) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "GitPipelineArtifact", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DockerImageName, nil - }) - 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) _GitPipelineArtifact_dockerImageTag(ctx context.Context, field graphql.CollectedField, obj *model.GitPipelineArtifact) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "GitPipelineArtifact", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DockerImageTag, nil - }) - 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) _GitPipelineBuild_baseImage(ctx context.Context, field graphql.CollectedField, obj *model.GitPipelineBuild) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "GitPipelineBuild", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.BaseImage, nil - }) - 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) _GitPipelineBuild_cmd(ctx context.Context, field graphql.CollectedField, obj *model.GitPipelineBuild) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "GitPipelineBuild", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Cmd, nil - }) - if err != nil { - ec.Error(ctx, err) - 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) _GitPipelineBuild_outputDir(ctx context.Context, field graphql.CollectedField, obj *model.GitPipelineBuild) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "GitPipelineBuild", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.OutputDir, nil - }) - 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) _GitPipelineRun_baseImage(ctx context.Context, field graphql.CollectedField, obj *model.GitPipelineRun) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "GitPipelineRun", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.BaseImage, nil - }) - 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) _GitPipelineRun_cmd(ctx context.Context, field graphql.CollectedField, obj *model.GitPipelineRun) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "GitPipelineRun", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Cmd, nil - }) - if err != nil { - ec.Error(ctx, err) - 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) _HarborImageTagsResult_name(ctx context.Context, field graphql.CollectedField, obj *model.HarborImageTagsResult) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "HarborImageTagsResult", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) _HarborImageTagsResult_signed(ctx context.Context, field graphql.CollectedField, obj *model.HarborImageTagsResult) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "HarborImageTagsResult", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Signed, nil - }) - if err != nil { - ec.Error(ctx, 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) _HarborImageTagsResult_immutable(ctx context.Context, field graphql.CollectedField, obj *model.HarborImageTagsResult) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "HarborImageTagsResult", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Immutable, nil - }) - if err != nil { - ec.Error(ctx, 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) _HarborSearchResult_imageName(ctx context.Context, field graphql.CollectedField, obj *model.HarborSearchResult) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "HarborSearchResult", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ImageName, nil - }) - if err != nil { - ec.Error(ctx, err) - 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) _HarborSearchResult_updatedAt(ctx context.Context, field graphql.CollectedField, obj *model.HarborSearchResult) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "HarborSearchResult", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.UpdatedAt, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*time.Time) - fc.Result = res - return ec.marshalOTime2ᚖtimeᚐTime(ctx, field.Selections, res) -} - -func (ec *executionContext) _HarborSearchResult_createdAt(ctx context.Context, field graphql.CollectedField, obj *model.HarborSearchResult) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "HarborSearchResult", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.CreatedAt, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*time.Time) - fc.Result = res - return ec.marshalOTime2ᚖtimeᚐTime(ctx, field.Selections, res) -} - -func (ec *executionContext) _HarborSearchResult_tags(ctx context.Context, field graphql.CollectedField, obj *model.HarborSearchResult) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "HarborSearchResult", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.HarborSearchResult().Tags(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.HarborImageTagsResult) - fc.Result = res - return ec.marshalNHarborImageTagsResult2ᚕᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐHarborImageTagsResultᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) _Mutation_ci_deletePipeline(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_ci_deletePipeline_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CiDeletePipeline(rctx, args["pipelineId"].(repos.ID)) - }) - if err != nil { - ec.Error(ctx, 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) _Mutation_ci_createPipeline(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_ci_createPipeline_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CiCreatePipeline(rctx, args["in"].(model.GitPipelineIn)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalNJson2map(ctx, field.Selections, res) -} - -func (ec *executionContext) _Mutation_ci_createDockerPipeline(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_ci_createDockerPipeline_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CiCreateDockerPipeline(rctx, args["in"].(model.GitDockerPipelineIn)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalNJson2map(ctx, field.Selections, res) -} - -func (ec *executionContext) _PipelineRun_id(ctx context.Context, field graphql.CollectedField, obj *model.PipelineRun) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "PipelineRun", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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.(repos.ID) - fc.Result = res - return ec.marshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, field.Selections, res) -} - -func (ec *executionContext) _PipelineRun_pipelineId(ctx context.Context, field graphql.CollectedField, obj *model.PipelineRun) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "PipelineRun", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.PipelineID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(repos.ID) - fc.Result = res - return ec.marshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, field.Selections, res) -} - -func (ec *executionContext) _PipelineRun_creationTime(ctx context.Context, field graphql.CollectedField, obj *model.PipelineRun) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "PipelineRun", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.CreationTime, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(time.Time) - fc.Result = res - return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) -} - -func (ec *executionContext) _PipelineRun_startTime(ctx context.Context, field graphql.CollectedField, obj *model.PipelineRun) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "PipelineRun", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.StartTime, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*time.Time) - fc.Result = res - return ec.marshalOTime2ᚖtimeᚐTime(ctx, field.Selections, res) -} - -func (ec *executionContext) _PipelineRun_endTime(ctx context.Context, field graphql.CollectedField, obj *model.PipelineRun) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "PipelineRun", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.EndTime, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*time.Time) - fc.Result = res - return ec.marshalOTime2ᚖtimeᚐTime(ctx, field.Selections, res) -} - -func (ec *executionContext) _PipelineRun_success(ctx context.Context, field graphql.CollectedField, obj *model.PipelineRun) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "PipelineRun", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Success, nil - }) - if err != nil { - ec.Error(ctx, 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) _PipelineRun_message(ctx context.Context, field graphql.CollectedField, obj *model.PipelineRun) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "PipelineRun", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) _PipelineRun_state(ctx context.Context, field graphql.CollectedField, obj *model.PipelineRun) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "PipelineRun", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.State, nil - }) - 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) _PipelineRun_gitProvider(ctx context.Context, field graphql.CollectedField, obj *model.PipelineRun) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "PipelineRun", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.GitProvider, nil - }) - if err != nil { - ec.Error(ctx, err) - 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) _PipelineRun_gitRepo(ctx context.Context, field graphql.CollectedField, obj *model.PipelineRun) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "PipelineRun", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.GitRepo, nil - }) - if err != nil { - ec.Error(ctx, err) - 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) _PipelineRun_gitBranch(ctx context.Context, field graphql.CollectedField, obj *model.PipelineRun) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "PipelineRun", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.GitBranch, nil - }) - if err != nil { - ec.Error(ctx, err) - 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) _PipelineRun_build(ctx context.Context, field graphql.CollectedField, obj *model.PipelineRun) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "PipelineRun", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Build, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.GitPipelineBuild) - fc.Result = res - return ec.marshalOGitPipelineBuild2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitPipelineBuild(ctx, field.Selections, res) -} - -func (ec *executionContext) _PipelineRun_run(ctx context.Context, field graphql.CollectedField, obj *model.PipelineRun) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "PipelineRun", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Run, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.GitPipelineRun) - fc.Result = res - return ec.marshalOGitPipelineRun2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitPipelineRun(ctx, field.Selections, res) -} - -func (ec *executionContext) _PipelineRun_dockerBuildInput(ctx context.Context, field graphql.CollectedField, obj *model.PipelineRun) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "PipelineRun", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DockerBuildInput, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.DockerBuild) - fc.Result = res - return ec.marshalODockerBuild2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐDockerBuild(ctx, field.Selections, res) -} - -func (ec *executionContext) _PipelineRun_artifactRef(ctx context.Context, field graphql.CollectedField, obj *model.PipelineRun) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "PipelineRun", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ArtifactRef, nil - }) - if err != nil { - ec.Error(ctx, 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.GitPipelineArtifact) - fc.Result = res - return ec.marshalNGitPipelineArtifact2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitPipelineArtifact(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query_ci_githubInstallations(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_ci_githubInstallations_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CiGithubInstallations(rctx, args["pagination"].(*types.Pagination)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(interface{}) - fc.Result = res - return ec.marshalNAny2interface(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query_ci_githubInstallationToken(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_ci_githubInstallationToken_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CiGithubInstallationToken(rctx, args["repoUrl"].(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.(interface{}) - fc.Result = res - return ec.marshalNAny2interface(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query_ci_githubRepos(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_ci_githubRepos_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CiGithubRepos(rctx, args["installationId"].(int), args["pagination"].(*types.Pagination)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(interface{}) - fc.Result = res - return ec.marshalNAny2interface(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query_ci_githubRepoBranches(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_ci_githubRepoBranches_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CiGithubRepoBranches(rctx, args["repoUrl"].(string), args["pagination"].(*types.Pagination)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(interface{}) - fc.Result = res - return ec.marshalNAny2interface(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query_ci_searchGithubRepos(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_ci_searchGithubRepos_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CiSearchGithubRepos(rctx, args["search"].(*string), args["org"].(string), args["pagination"].(*types.Pagination)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(interface{}) - fc.Result = res - return ec.marshalNAny2interface(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query_ci_gitlabGroups(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_ci_gitlabGroups_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CiGitlabGroups(rctx, args["query"].(*string), args["pagination"].(*types.Pagination)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(interface{}) - fc.Result = res - return ec.marshalNAny2interface(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query_ci_gitlabRepos(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_ci_gitlabRepos_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CiGitlabRepos(rctx, args["groupId"].(string), args["search"].(*string), args["pagination"].(*types.Pagination)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(interface{}) - fc.Result = res - return ec.marshalNAny2interface(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query_ci_gitlabRepoBranches(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_ci_gitlabRepoBranches_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CiGitlabRepoBranches(rctx, args["repoId"].(string), args["search"].(*string), args["pagination"].(*types.Pagination)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(interface{}) - fc.Result = res - return ec.marshalNAny2interface(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query_ci_getPipelines(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_ci_getPipelines_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CiGetPipelines(rctx, args["projectId"].(repos.ID)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*model.GitPipeline) - fc.Result = res - return ec.marshalOGitPipeline2ᚕᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitPipelineᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query_ci_getPipeline(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_ci_getPipeline_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CiGetPipeline(rctx, args["pipelineId"].(repos.ID)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.GitPipeline) - fc.Result = res - return ec.marshalOGitPipeline2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitPipeline(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query_ci_triggerPipeline(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_ci_triggerPipeline_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CiTriggerPipeline(rctx, args["pipelineId"].(repos.ID)) - }) - 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) _Query_ci_getPipelineRuns(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_ci_getPipelineRuns_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CiGetPipelineRuns(rctx, args["pipelineId"].(repos.ID)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*model.PipelineRun) - fc.Result = res - return ec.marshalOPipelineRun2ᚕᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐPipelineRunᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query_ci_getPipelineRun(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_ci_getPipelineRun_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CiGetPipelineRun(rctx, args["pipelineRunId"].(repos.ID)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.PipelineRun) - fc.Result = res - return ec.marshalOPipelineRun2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐPipelineRun(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query_ci_harborSearch(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_ci_harborSearch_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CiHarborSearch(rctx, args["accountId"].(repos.ID), args["q"].(string), args["pagination"].(*types.Pagination)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*model.HarborSearchResult) - fc.Result = res - return ec.marshalOHarborSearchResult2ᚕᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐHarborSearchResultᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query_ci_harborImageTags(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_ci_harborImageTags_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CiHarborImageTags(rctx, args["imageName"].(string), args["pagination"].(*types.Pagination)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*model.HarborImageTagsResult) - fc.Result = res - return ec.marshalOHarborImageTagsResult2ᚕᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐHarborImageTagsResultᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query__entities(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query__entities_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.__resolve_entities(ctx, args["representations"].([]map[string]interface{})), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]fedruntime.Entity) - fc.Result = res - return ec.marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query__service(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.__resolve__service(ctx) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(fedruntime.Service) - fc.Result = res - return ec.marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query___type_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.introspectType(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) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) __Service_sdl(ctx context.Context, field graphql.CollectedField, obj *fedruntime.Service) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "_Service", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SDL, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Directive", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Directive", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Directive", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Directive", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Directive", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field___Type_fields_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Fields(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) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field___Type_enumValues_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.EnumValues(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) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) -} - -// endregion **************************** field.gotpl ***************************** - -// region **************************** input.gotpl ***************************** - -func (ec *executionContext) unmarshalInputGitDockerPipelineIn(ctx context.Context, obj interface{}) (model.GitDockerPipelineIn, error) { - var it model.GitDockerPipelineIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - for k, v := range asMap { - switch k { - case "name": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - it.Name, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "accountId": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("accountId")) - it.AccountID, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "projectId": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectId")) - it.ProjectID, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "appId": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appId")) - it.AppID, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "projectName": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - it.ProjectName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "containerName": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("containerName")) - it.ContainerName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "gitProvider": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitProvider")) - it.GitProvider, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "gitRepoUrl": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitRepoUrl")) - it.GitRepoURL, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "repoName": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("repoName")) - it.RepoName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "gitBranch": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitBranch")) - it.GitBranch, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "dockerFile": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("dockerFile")) - it.DockerFile, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "contextDir": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contextDir")) - it.ContextDir, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "buildArgs": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("buildArgs")) - it.BuildArgs, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "artifactRef": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("artifactRef")) - it.ArtifactRef, err = ec.unmarshalOGitPipelineArtifactIn2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitPipelineArtifactIn(ctx, v) - if err != nil { - return it, err - } - case "metadata": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) - it.Metadata, err = ec.unmarshalOJson2map(ctx, v) - if err != nil { - return it, err - } - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputGitPipelineArtifactIn(ctx context.Context, obj interface{}) (model.GitPipelineArtifactIn, error) { - var it model.GitPipelineArtifactIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - for k, v := range asMap { - switch k { - case "dockerImageName": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("dockerImageName")) - it.DockerImageName, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - case "dockerImageTag": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("dockerImageTag")) - it.DockerImageTag, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputGitPipelineBuildIn(ctx context.Context, obj interface{}) (model.GitPipelineBuildIn, error) { - var it model.GitPipelineBuildIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - for k, v := range asMap { - switch k { - case "baseImage": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("baseImage")) - it.BaseImage, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "cmd": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cmd")) - it.Cmd, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "outputDir": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("outputDir")) - it.OutputDir, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputGitPipelineIn(ctx context.Context, obj interface{}) (model.GitPipelineIn, error) { - var it model.GitPipelineIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - for k, v := range asMap { - switch k { - case "name": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - it.Name, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "accountId": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("accountId")) - it.AccountID, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "projectId": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectId")) - it.ProjectID, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "appId": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appId")) - it.AppID, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "projectName": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - it.ProjectName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "containerName": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("containerName")) - it.ContainerName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "gitProvider": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitProvider")) - it.GitProvider, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "gitRepoUrl": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitRepoUrl")) - it.GitRepoURL, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "repoName": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("repoName")) - it.RepoName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "gitBranch": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gitBranch")) - it.GitBranch, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "build": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("build")) - it.Build, err = ec.unmarshalOGitPipelineBuildIn2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitPipelineBuildIn(ctx, v) - if err != nil { - return it, err - } - case "run": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("run")) - it.Run, err = ec.unmarshalOGitPipelineRunIn2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitPipelineRunIn(ctx, v) - if err != nil { - return it, err - } - case "artifactRef": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("artifactRef")) - it.ArtifactRef, err = ec.unmarshalOGitPipelineArtifactIn2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitPipelineArtifactIn(ctx, v) - if err != nil { - return it, err - } - case "metadata": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) - it.Metadata, err = ec.unmarshalOJson2map(ctx, v) - if err != nil { - return it, err - } - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputGitPipelineRunIn(ctx context.Context, obj interface{}) (model.GitPipelineRunIn, error) { - var it model.GitPipelineRunIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - for k, v := range asMap { - switch k { - case "baseImage": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("baseImage")) - it.BaseImage, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - case "cmd": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cmd")) - it.Cmd, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputPaginationIn(ctx context.Context, obj interface{}) (types.Pagination, error) { - var it types.Pagination - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - for k, v := range asMap { - switch k { - case "page": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("page")) - it.Page, err = ec.unmarshalNInt2int(ctx, v) - if err != nil { - return it, err - } - case "perPage": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("perPage")) - it.PerPage, err = ec.unmarshalNInt2int(ctx, v) - if err != nil { - return it, err - } - } - } - - return it, nil -} - -// endregion **************************** input.gotpl ***************************** - -// region ************************** interface.gotpl *************************** - -func (ec *executionContext) __Entity(ctx context.Context, sel ast.SelectionSet, obj fedruntime.Entity) graphql.Marshaler { - switch obj := (obj).(type) { - case nil: - return graphql.Null - case model.App: - return ec._App(ctx, sel, &obj) - case *model.App: - if obj == nil { - return graphql.Null - } - return ec._App(ctx, sel, obj) - default: - panic(fmt.Errorf("unexpected type %T", obj)) - } -} - -// endregion ************************** interface.gotpl *************************** - -// region **************************** object.gotpl **************************** - -var appImplementors = []string{"App", "_Entity"} - -func (ec *executionContext) _App(ctx context.Context, sel ast.SelectionSet, obj *model.App) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, appImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("App") - case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._App_id(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "pipelines": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._App_pipelines(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "ci_createDockerPipeLine": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._App_ci_createDockerPipeLine(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "ci_createPipeLine": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._App_ci_createPipeLine(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var dockerBuildImplementors = []string{"DockerBuild"} - -func (ec *executionContext) _DockerBuild(ctx context.Context, sel ast.SelectionSet, obj *model.DockerBuild) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, dockerBuildImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("DockerBuild") - case "dockerFile": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._DockerBuild_dockerFile(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "contextDir": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._DockerBuild_contextDir(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "buildArgs": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._DockerBuild_buildArgs(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var entityImplementors = []string{"Entity"} - -func (ec *executionContext) _Entity(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, entityImplementors) - ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ - Object: "Entity", - }) - - out := graphql.NewFieldSet(fields) - var invalids uint32 - 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("Entity") - case "findAppByID": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Entity_findAppByID(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var gitPipelineImplementors = []string{"GitPipeline"} - -func (ec *executionContext) _GitPipeline(ctx context.Context, sel ast.SelectionSet, obj *model.GitPipeline) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, gitPipelineImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("GitPipeline") - case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._GitPipeline_id(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._GitPipeline_name(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "gitProvider": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._GitPipeline_gitProvider(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "gitRepoUrl": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._GitPipeline_gitRepoUrl(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "gitBranch": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._GitPipeline_gitBranch(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "build": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._GitPipeline_build(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "run": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._GitPipeline_run(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "dockerBuild": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._GitPipeline_dockerBuild(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "metadata": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._GitPipeline_metadata(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var gitPipelineArtifactImplementors = []string{"GitPipelineArtifact"} - -func (ec *executionContext) _GitPipelineArtifact(ctx context.Context, sel ast.SelectionSet, obj *model.GitPipelineArtifact) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, gitPipelineArtifactImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("GitPipelineArtifact") - case "dockerImageName": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._GitPipelineArtifact_dockerImageName(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "dockerImageTag": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._GitPipelineArtifact_dockerImageTag(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var gitPipelineBuildImplementors = []string{"GitPipelineBuild"} - -func (ec *executionContext) _GitPipelineBuild(ctx context.Context, sel ast.SelectionSet, obj *model.GitPipelineBuild) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, gitPipelineBuildImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("GitPipelineBuild") - case "baseImage": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._GitPipelineBuild_baseImage(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "cmd": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._GitPipelineBuild_cmd(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "outputDir": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._GitPipelineBuild_outputDir(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var gitPipelineRunImplementors = []string{"GitPipelineRun"} - -func (ec *executionContext) _GitPipelineRun(ctx context.Context, sel ast.SelectionSet, obj *model.GitPipelineRun) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, gitPipelineRunImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("GitPipelineRun") - case "baseImage": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._GitPipelineRun_baseImage(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "cmd": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._GitPipelineRun_cmd(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var harborImageTagsResultImplementors = []string{"HarborImageTagsResult"} - -func (ec *executionContext) _HarborImageTagsResult(ctx context.Context, sel ast.SelectionSet, obj *model.HarborImageTagsResult) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, harborImageTagsResultImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("HarborImageTagsResult") - case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._HarborImageTagsResult_name(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "signed": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._HarborImageTagsResult_signed(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "immutable": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._HarborImageTagsResult_immutable(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var harborSearchResultImplementors = []string{"HarborSearchResult"} - -func (ec *executionContext) _HarborSearchResult(ctx context.Context, sel ast.SelectionSet, obj *model.HarborSearchResult) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, harborSearchResultImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("HarborSearchResult") - case "imageName": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._HarborSearchResult_imageName(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "updatedAt": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._HarborSearchResult_updatedAt(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "createdAt": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._HarborSearchResult_createdAt(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "tags": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._HarborSearchResult_tags(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var 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) - var invalids uint32 - 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 "ci_deletePipeline": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_ci_deletePipeline(ctx, field) - } - - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "ci_createPipeline": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_ci_createPipeline(ctx, field) - } - - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "ci_createDockerPipeline": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_ci_createDockerPipeline(ctx, field) - } - - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var pipelineRunImplementors = []string{"PipelineRun"} - -func (ec *executionContext) _PipelineRun(ctx context.Context, sel ast.SelectionSet, obj *model.PipelineRun) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, pipelineRunImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("PipelineRun") - case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PipelineRun_id(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "pipelineId": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PipelineRun_pipelineId(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "creationTime": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PipelineRun_creationTime(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "startTime": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PipelineRun_startTime(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "endTime": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PipelineRun_endTime(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "success": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PipelineRun_success(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "message": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PipelineRun_message(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "state": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PipelineRun_state(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "gitProvider": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PipelineRun_gitProvider(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "gitRepo": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PipelineRun_gitRepo(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "gitBranch": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PipelineRun_gitBranch(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "build": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PipelineRun_build(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "run": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PipelineRun_run(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "dockerBuildInput": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PipelineRun_dockerBuildInput(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "artifactRef": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PipelineRun_artifactRef(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var 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) - var invalids uint32 - 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 "ci_githubInstallations": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_ci_githubInstallations(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "ci_githubInstallationToken": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_ci_githubInstallationToken(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "ci_githubRepos": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_ci_githubRepos(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "ci_githubRepoBranches": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_ci_githubRepoBranches(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "ci_searchGithubRepos": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_ci_searchGithubRepos(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "ci_gitlabGroups": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_ci_gitlabGroups(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "ci_gitlabRepos": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_ci_gitlabRepos(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "ci_gitlabRepoBranches": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_ci_gitlabRepoBranches(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "ci_getPipelines": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_ci_getPipelines(ctx, field) - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "ci_getPipeline": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_ci_getPipeline(ctx, field) - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "ci_triggerPipeline": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_ci_triggerPipeline(ctx, field) - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "ci_getPipelineRuns": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_ci_getPipelineRuns(ctx, field) - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "ci_getPipelineRun": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_ci_getPipelineRun(ctx, field) - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "ci_harborSearch": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_ci_harborSearch(ctx, field) - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "ci_harborImageTags": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_ci_harborImageTags(ctx, field) - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "_entities": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query__entities(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "_service": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query__service(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "__type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___type(ctx, field) - } - - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) - - case "__schema": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___schema(ctx, field) - } - - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var _ServiceImplementors = []string{"_Service"} - -func (ec *executionContext) __Service(ctx context.Context, sel ast.SelectionSet, obj *fedruntime.Service) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, _ServiceImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("_Service") - case "sdl": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.__Service_sdl(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - 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) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Directive") - case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_name(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_description(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "locations": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_locations(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_args(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "isRepeatable": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_isRepeatable(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var __EnumValueImplementors = []string{"__EnumValue"} - -func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__EnumValue") - case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_name(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_description(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_isDeprecated(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_deprecationReason(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - 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) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Field") - case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_name(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_description(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_args(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_type(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_isDeprecated(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_deprecationReason(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - 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) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__InputValue") - case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_name(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_description(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_type(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "defaultValue": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_defaultValue(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - 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) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Schema") - case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_description(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "types": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_types(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "queryType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_queryType(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "mutationType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_mutationType(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "subscriptionType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_subscriptionType(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "directives": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_directives(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var __TypeImplementors = []string{"__Type"} - -func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Type") - case "kind": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_kind(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_name(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_description(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "fields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_fields(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "interfaces": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_interfaces(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "possibleTypes": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_possibleTypes(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "enumValues": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_enumValues(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "inputFields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_inputFields(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "ofType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_ofType(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "specifiedByURL": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_specifiedByURL(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -// endregion **************************** object.gotpl **************************** - -// region ***************************** type.gotpl ***************************** - -func (ec *executionContext) unmarshalNAny2interface(ctx context.Context, v interface{}) (interface{}, error) { - res, err := graphql.UnmarshalAny(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNAny2interface(ctx context.Context, sel ast.SelectionSet, v interface{}) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := graphql.MarshalAny(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - } - return res -} - -func (ec *executionContext) marshalNApp2kloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐApp(ctx context.Context, sel ast.SelectionSet, v model.App) graphql.Marshaler { - return ec._App(ctx, sel, &v) -} - -func (ec *executionContext) marshalNApp2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐApp(ctx context.Context, sel ast.SelectionSet, v *model.App) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - return ec._App(ctx, sel, v) -} - -func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { - res, err := graphql.UnmarshalBoolean(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { - res := graphql.MarshalBoolean(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - } - return res -} - -func (ec *executionContext) unmarshalNGitDockerPipelineIn2kloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitDockerPipelineIn(ctx context.Context, v interface{}) (model.GitDockerPipelineIn, error) { - res, err := ec.unmarshalInputGitDockerPipelineIn(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNGitPipeline2ᚕᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitPipelineᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GitPipeline) 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.marshalNGitPipeline2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitPipeline(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) marshalNGitPipeline2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitPipeline(ctx context.Context, sel ast.SelectionSet, v *model.GitPipeline) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - return ec._GitPipeline(ctx, sel, v) -} - -func (ec *executionContext) marshalNGitPipelineArtifact2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitPipelineArtifact(ctx context.Context, sel ast.SelectionSet, v *model.GitPipelineArtifact) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - return ec._GitPipelineArtifact(ctx, sel, v) -} - -func (ec *executionContext) unmarshalNGitPipelineIn2kloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitPipelineIn(ctx context.Context, v interface{}) (model.GitPipelineIn, error) { - res, err := ec.unmarshalInputGitPipelineIn(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNHarborImageTagsResult2ᚕᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐHarborImageTagsResultᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.HarborImageTagsResult) 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.marshalNHarborImageTagsResult2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐHarborImageTagsResult(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) marshalNHarborImageTagsResult2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐHarborImageTagsResult(ctx context.Context, sel ast.SelectionSet, v *model.HarborImageTagsResult) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - return ec._HarborImageTagsResult(ctx, sel, v) -} - -func (ec *executionContext) marshalNHarborSearchResult2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐHarborSearchResult(ctx context.Context, sel ast.SelectionSet, v *model.HarborSearchResult) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - return ec._HarborSearchResult(ctx, sel, v) -} - -func (ec *executionContext) unmarshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx context.Context, v interface{}) (repos.ID, error) { - tmp, err := graphql.UnmarshalString(v) - res := repos.ID(tmp) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx context.Context, sel ast.SelectionSet, v repos.ID) graphql.Marshaler { - res := graphql.MarshalString(string(v)) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - } - return res -} - -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, "must not be null") - } - } - return res -} - -func (ec *executionContext) unmarshalNJson2map(ctx context.Context, v interface{}) (map[string]interface{}, error) { - res, err := graphql.UnmarshalMap(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNJson2map(ctx context.Context, sel ast.SelectionSet, v map[string]interface{}) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := graphql.MarshalMap(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - } - return res -} - -func (ec *executionContext) marshalNPipelineRun2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐPipelineRun(ctx context.Context, sel ast.SelectionSet, v *model.PipelineRun) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - return ec._PipelineRun(ctx, sel, 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, "must not be null") - } - } - return res -} - -func (ec *executionContext) unmarshalNTime2timeᚐTime(ctx context.Context, v interface{}) (time.Time, error) { - res, err := graphql.UnmarshalTime(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNTime2timeᚐTime(ctx context.Context, sel ast.SelectionSet, v time.Time) graphql.Marshaler { - res := graphql.MarshalTime(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - } - return res -} - -func (ec *executionContext) unmarshalN_Any2map(ctx context.Context, v interface{}) (map[string]interface{}, error) { - res, err := graphql.UnmarshalMap(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalN_Any2map(ctx context.Context, sel ast.SelectionSet, v map[string]interface{}) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := graphql.MarshalMap(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - } - return res -} - -func (ec *executionContext) unmarshalN_Any2ᚕmapᚄ(ctx context.Context, v interface{}) ([]map[string]interface{}, error) { - var vSlice []interface{} - if v != nil { - vSlice = graphql.CoerceList(v) - } - var err error - res := make([]map[string]interface{}, len(vSlice)) - for i := range vSlice { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalN_Any2map(ctx, vSlice[i]) - if err != nil { - return nil, err - } - } - return res, nil -} - -func (ec *executionContext) marshalN_Any2ᚕmapᚄ(ctx context.Context, sel ast.SelectionSet, v []map[string]interface{}) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - for i := range v { - ret[i] = ec.marshalN_Any2map(ctx, sel, v[i]) - } - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx context.Context, sel ast.SelectionSet, v []fedruntime.Entity) 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.marshalO_Entity2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - return ret -} - -func (ec *executionContext) unmarshalN_FieldSet2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalN_FieldSet2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - res := graphql.MarshalString(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - } - return res -} - -func (ec *executionContext) marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx context.Context, sel ast.SelectionSet, v fedruntime.Service) graphql.Marshaler { - return ec.__Service(ctx, sel, &v) -} - -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, "must not be null") - } - } - 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, "must not be null") - } - 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, "must not be null") - } - } - 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) marshalODockerBuild2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐDockerBuild(ctx context.Context, sel ast.SelectionSet, v *model.DockerBuild) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._DockerBuild(ctx, sel, v) -} - -func (ec *executionContext) marshalOGitPipeline2ᚕᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitPipelineᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GitPipeline) 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.marshalNGitPipeline2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitPipeline(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) marshalOGitPipeline2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitPipeline(ctx context.Context, sel ast.SelectionSet, v *model.GitPipeline) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._GitPipeline(ctx, sel, v) -} - -func (ec *executionContext) unmarshalOGitPipelineArtifactIn2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitPipelineArtifactIn(ctx context.Context, v interface{}) (*model.GitPipelineArtifactIn, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputGitPipelineArtifactIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOGitPipelineBuild2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitPipelineBuild(ctx context.Context, sel ast.SelectionSet, v *model.GitPipelineBuild) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._GitPipelineBuild(ctx, sel, v) -} - -func (ec *executionContext) unmarshalOGitPipelineBuildIn2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitPipelineBuildIn(ctx context.Context, v interface{}) (*model.GitPipelineBuildIn, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputGitPipelineBuildIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOGitPipelineRun2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitPipelineRun(ctx context.Context, sel ast.SelectionSet, v *model.GitPipelineRun) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._GitPipelineRun(ctx, sel, v) -} - -func (ec *executionContext) unmarshalOGitPipelineRunIn2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐGitPipelineRunIn(ctx context.Context, v interface{}) (*model.GitPipelineRunIn, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputGitPipelineRunIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOHarborImageTagsResult2ᚕᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐHarborImageTagsResultᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.HarborImageTagsResult) 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.marshalNHarborImageTagsResult2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐHarborImageTagsResult(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) marshalOHarborSearchResult2ᚕᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐHarborSearchResultᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.HarborSearchResult) 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.marshalNHarborSearchResult2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐHarborSearchResult(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) unmarshalOJson2map(ctx context.Context, v interface{}) (map[string]interface{}, error) { - if v == nil { - return nil, nil - } - res, err := graphql.UnmarshalMap(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOJson2map(ctx context.Context, sel ast.SelectionSet, v map[string]interface{}) graphql.Marshaler { - if v == nil { - return graphql.Null - } - res := graphql.MarshalMap(v) - return res -} - -func (ec *executionContext) unmarshalOPaginationIn2ᚖkloudliteᚗioᚋpkgᚋtypesᚐPagination(ctx context.Context, v interface{}) (*types.Pagination, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputPaginationIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOPipelineRun2ᚕᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐPipelineRunᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.PipelineRun) 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.marshalNPipelineRun2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐPipelineRun(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) marshalOPipelineRun2ᚖkloudliteᚗioᚋappsᚋciᚋinternalᚋappᚋgraphᚋmodelᚐPipelineRun(ctx context.Context, sel ast.SelectionSet, v *model.PipelineRun) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._PipelineRun(ctx, sel, v) -} - -func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - res := graphql.MarshalString(v) - return res -} - -func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v interface{}) (*string, error) { - if v == nil { - return nil, nil - } - 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) unmarshalOTime2ᚖtimeᚐTime(ctx context.Context, v interface{}) (*time.Time, error) { - if v == nil { - return nil, nil - } - res, err := graphql.UnmarshalTime(v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOTime2ᚖtimeᚐTime(ctx context.Context, sel ast.SelectionSet, v *time.Time) graphql.Marshaler { - if v == nil { - return graphql.Null - } - res := graphql.MarshalTime(*v) - return res -} - -func (ec *executionContext) marshalO_Entity2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx context.Context, sel ast.SelectionSet, v fedruntime.Entity) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec.__Entity(ctx, sel, v) -} - -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/apps/ci/internal/app/graph/model/models_gen.go b/apps/ci/internal/app/graph/model/models_gen.go deleted file mode 100644 index 4c173e3b0..000000000 --- a/apps/ci/internal/app/graph/model/models_gen.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. - -package model - -import ( - "time" - - "kloudlite.io/pkg/repos" -) - -type App struct { - ID repos.ID `json:"id"` - Pipelines []*GitPipeline `json:"pipelines"` - CiCreateDockerPipeLine map[string]interface{} `json:"ci_createDockerPipeLine"` - CiCreatePipeLine map[string]interface{} `json:"ci_createPipeLine"` -} - -func (App) IsEntity() {} - -type DockerBuild struct { - DockerFile string `json:"dockerFile"` - ContextDir string `json:"contextDir"` - BuildArgs *string `json:"buildArgs"` -} - -type GitDockerPipelineIn struct { - Name string `json:"name"` - AccountID string `json:"accountId"` - ProjectID string `json:"projectId"` - AppID string `json:"appId"` - ProjectName string `json:"projectName"` - ContainerName string `json:"containerName"` - GitProvider string `json:"gitProvider"` - GitRepoURL string `json:"gitRepoUrl"` - RepoName string `json:"repoName"` - GitBranch string `json:"gitBranch"` - DockerFile string `json:"dockerFile"` - ContextDir string `json:"contextDir"` - BuildArgs string `json:"buildArgs"` - ArtifactRef *GitPipelineArtifactIn `json:"artifactRef"` - Metadata map[string]interface{} `json:"metadata"` -} - -type GitPipeline struct { - ID repos.ID `json:"id"` - Name string `json:"name"` - GitProvider string `json:"gitProvider"` - GitRepoURL string `json:"gitRepoUrl"` - GitBranch string `json:"gitBranch"` - Build *GitPipelineBuild `json:"build"` - Run *GitPipelineRun `json:"run"` - DockerBuild *DockerBuild `json:"dockerBuild"` - Metadata map[string]interface{} `json:"metadata"` -} - -type GitPipelineArtifact struct { - DockerImageName *string `json:"dockerImageName"` - DockerImageTag *string `json:"dockerImageTag"` -} - -type GitPipelineArtifactIn struct { - DockerImageName *string `json:"dockerImageName"` - DockerImageTag *string `json:"dockerImageTag"` -} - -type GitPipelineBuild struct { - BaseImage *string `json:"baseImage"` - Cmd string `json:"cmd"` - OutputDir *string `json:"outputDir"` -} - -type GitPipelineBuildIn struct { - BaseImage string `json:"baseImage"` - Cmd string `json:"cmd"` - OutputDir *string `json:"outputDir"` -} - -type GitPipelineIn struct { - Name string `json:"name"` - AccountID string `json:"accountId"` - ProjectID string `json:"projectId"` - AppID string `json:"appId"` - ProjectName string `json:"projectName"` - ContainerName string `json:"containerName"` - GitProvider string `json:"gitProvider"` - GitRepoURL string `json:"gitRepoUrl"` - RepoName string `json:"repoName"` - GitBranch string `json:"gitBranch"` - Build *GitPipelineBuildIn `json:"build"` - Run *GitPipelineRunIn `json:"run"` - ArtifactRef *GitPipelineArtifactIn `json:"artifactRef"` - Metadata map[string]interface{} `json:"metadata"` -} - -type GitPipelineRun struct { - BaseImage *string `json:"baseImage"` - Cmd string `json:"cmd"` -} - -type GitPipelineRunIn struct { - BaseImage *string `json:"baseImage"` - Cmd string `json:"cmd"` -} - -type HarborImageTagsResult struct { - Name string `json:"name"` - Signed bool `json:"signed"` - Immutable bool `json:"immutable"` -} - -type HarborSearchResult struct { - ImageName string `json:"imageName"` - UpdatedAt *time.Time `json:"updatedAt"` - CreatedAt *time.Time `json:"createdAt"` - Tags []*HarborImageTagsResult `json:"tags"` -} - -type PipelineRun struct { - ID repos.ID `json:"id"` - PipelineID repos.ID `json:"pipelineId"` - CreationTime time.Time `json:"creationTime"` - StartTime *time.Time `json:"startTime"` - EndTime *time.Time `json:"endTime"` - Success bool `json:"success"` - Message *string `json:"message"` - State *string `json:"state"` - GitProvider string `json:"gitProvider"` - GitRepo string `json:"gitRepo"` - GitBranch string `json:"gitBranch"` - Build *GitPipelineBuild `json:"build"` - Run *GitPipelineRun `json:"run"` - DockerBuildInput *DockerBuild `json:"dockerBuildInput"` - ArtifactRef *GitPipelineArtifact `json:"artifactRef"` -} diff --git a/apps/ci/internal/app/graph/resolver.go b/apps/ci/internal/app/graph/resolver.go deleted file mode 100644 index 7c337ee4d..000000000 --- a/apps/ci/internal/app/graph/resolver.go +++ /dev/null @@ -1,11 +0,0 @@ -package graph - -import "kloudlite.io/apps/ci/internal/domain" - -// This file will not be regenerated automatically. -// -// It serves as dependency injection for your app, add any dependencies you require here. - -type Resolver struct { - Domain domain.Domain -} diff --git a/apps/ci/internal/app/graph/schema.graphqls b/apps/ci/internal/app/graph/schema.graphqls deleted file mode 100644 index 1a1e75695..000000000 --- a/apps/ci/internal/app/graph/schema.graphqls +++ /dev/null @@ -1,180 +0,0 @@ -scalar Json -scalar Any -scalar Date -scalar Time - -type Query { - ci_githubInstallations(pagination: PaginationIn): Any! # user-access - ci_githubInstallationToken(repoUrl: String!): Any! # user-access - ci_githubRepos(installationId: Int!, pagination: PaginationIn): Any! # user-access - ci_githubRepoBranches(repoUrl: String!, pagination: PaginationIn): Any! # user-access - ci_searchGithubRepos(search: String, org: String!, pagination: PaginationIn): Any! # user-access - - ci_gitlabGroups(query: String, pagination: PaginationIn): Any! # user-access - ci_gitlabRepos(groupId: String!, search: String, pagination: PaginationIn): Any! # user-access - ci_gitlabRepoBranches(repoId: String!, search: String, pagination: PaginationIn): Any! # user-access - - ci_getPipelines(projectId: ID!): [GitPipeline!] # user-access # deprecate - ci_getPipeline(pipelineId: ID!): GitPipeline # user-access # deprecate - ci_triggerPipeline(pipelineId: ID!): Boolean # user-access # deprecate - - ci_getPipelineRuns(pipelineId: ID!): [PipelineRun!] - ci_getPipelineRun(pipelineRunId: ID!): PipelineRun - - ci_harborSearch(accountId: ID!, q: String!, pagination: PaginationIn): [HarborSearchResult!] # account-member-access - ci_harborImageTags(imageName: String!, pagination: PaginationIn): [HarborImageTagsResult!] - - ci_listHarborCredentials(accountId: ID!): [HarborCredentials!] - ci_createHarborCredentials(accountId: ID!, permission: String!): [HarborCredentials!] - ci_revokeHarborCredentials(accountId: ID!, permission: String!): Boolean! -} - -type HarborSearchResult { - imageName: String! - updatedAt: Time - createdAt: Time - tags: [HarborImageTagsResult!]! -} - -type PipelineRun { - id: ID! - pipelineId: ID! - creationTime: Time! - startTime: Time - endTime: Time - success: Boolean! - message: String - state: String - gitProvider: String! - gitRepo: String! - gitBranch: String! - - build: GitPipelineBuild - run: GitPipelineRun - dockerBuildInput: DockerBuild - artifactRef: GitPipelineArtifact! -} - -type HarborImageTagsResult { - name: String! - signed: Boolean! - immutable: Boolean! -} - -input PaginationIn { - page: Int! - perPage: Int! -} - -input GitPipelineIn { - name: String! - - accountId: String! - projectId: String! - appId: String! - - projectName: String! - containerName: String! - - gitProvider: String! - gitRepoUrl: String! - repoName: String! - gitBranch: String! - - build: GitPipelineBuildIn - run: GitPipelineRunIn - - artifactRef: GitPipelineArtifactIn - metadata: Json -} - -input GitPipelineBuildIn { - baseImage: String! - cmd: String! - outputDir: String -} - -type GitPipelineBuild { - baseImage: String - cmd: String! - outputDir: String -} - -input GitPipelineRunIn { - baseImage: String - cmd: String! -} - -type GitPipelineRun { - baseImage: String - cmd: String! -} - -input GitPipelineArtifactIn { - dockerImageName: String - dockerImageTag: String -} - -type GitPipelineArtifact { - dockerImageName: String - dockerImageTag: String -} - -type GitPipeline { - id: ID! - name: String! - - gitProvider: String! - gitRepoUrl: String! - gitBranch: String! - - build: GitPipelineBuild - run: GitPipelineRun - - dockerBuild: DockerBuild - - metadata: Json -} - -type DockerBuild { - dockerFile: String! - contextDir: String! - buildArgs: String - -} - -input GitDockerPipelineIn { - name: String! - - accountId: String! - projectId: String! - appId: String! - - projectName: String! - containerName: String! - - gitProvider: String! - gitRepoUrl: String! - repoName: String! - gitBranch: String! - - dockerFile: String! - contextDir: String! - buildArgs: String! - - artifactRef:GitPipelineArtifactIn - metadata: Json -} - -extend type App @key(fields: "id") { - id: ID! @external - pipelines: [GitPipeline!]! # project-developer-access project-admin-access - ci_createDockerPipeLine(containerName: String!, in: GitDockerPipelineIn!): Json! # project-developer-access project-admin-access - ci_createPipeLine(containerName: String!, in: GitPipelineIn!): Json! # project-developer-access project-admin-access -} - -type Mutation { - ci_deletePipeline(pipelineId: ID!): Boolean! # project-developer-access project-admin-access - ci_createPipeline(in: GitPipelineIn!): Json! # project-developer-access project-admin-access - ci_createDockerPipeline(in: GitDockerPipelineIn!): Json! -} diff --git a/apps/ci/internal/app/graph/schema.resolvers.go b/apps/ci/internal/app/graph/schema.resolvers.go deleted file mode 100644 index d5336e443..000000000 --- a/apps/ci/internal/app/graph/schema.resolvers.go +++ /dev/null @@ -1,601 +0,0 @@ -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. - -import ( - "context" - "encoding/json" - "errors" - - "kloudlite.io/apps/ci/internal/app/graph/generated" - "kloudlite.io/apps/ci/internal/app/graph/model" - "kloudlite.io/apps/ci/internal/domain" - "kloudlite.io/common" - wErrors "kloudlite.io/pkg/errors" - fn "kloudlite.io/pkg/functions" - httpServer "kloudlite.io/pkg/http-server" - "kloudlite.io/pkg/repos" - "kloudlite.io/pkg/types" -) - -func (r *appResolver) Pipelines(ctx context.Context, obj *model.App) ([]*model.GitPipeline, error) { - pipelines, err := r.Domain.GetAppPipelines(ctx, obj.ID) - if err != nil { - return nil, err - } - var res []*model.GitPipeline - for _, pipeline := range pipelines { - res = append( - res, &model.GitPipeline{ - ID: pipeline.Id, - Name: pipeline.Name, - GitProvider: pipeline.GitProvider, - GitRepoURL: pipeline.GitRepoUrl, - GitBranch: pipeline.GitBranch, - Build: func() *model.GitPipelineBuild { - if pipeline.Build == nil { - return nil - } - return &model.GitPipelineBuild{ - BaseImage: &pipeline.Build.BaseImage, - Cmd: pipeline.Build.Cmd, - OutputDir: &pipeline.Build.OutputDir, - } - }(), - Run: func() *model.GitPipelineRun { - if pipeline.Run == nil { - return nil - } - return &model.GitPipelineRun{ - BaseImage: &pipeline.Run.BaseImage, - Cmd: pipeline.Run.Cmd, - } - }(), - Metadata: pipeline.Metadata, - }, - ) - } - return res, nil -} - -func (r *appResolver) CiCreateDockerPipeLine(ctx context.Context, obj *model.App, containerName string, in model.GitDockerPipelineIn) (map[string]interface{}, error) { - session := httpServer.GetSession[*common.AuthSession](ctx) - if session == nil { - return nil, errors.New("not authorized") - } - var pipeline, err = r.Domain.CreatePipeline( - ctx, session.UserId, domain.Pipeline{ - Name: in.Name, - ProjectName: in.ProjectName, - ProjectId: in.ProjectID, - AccountId: in.AccountID, - AppId: string(obj.ID), - ContainerName: containerName, - GitProvider: in.GitProvider, - GitRepoUrl: in.GitRepoURL, - GitBranch: in.GitBranch, - DockerBuildInput: domain.DockerBuildInput{ - DockerFile: in.DockerFile, - ContextDir: in.ContextDir, - BuildArgs: in.BuildArgs, - }, - ArtifactRef: domain.ArtifactRef{ - DockerImageName: fn.DefaultIfNil(in.ArtifactRef.DockerImageName), - DockerImageTag: fn.DefaultIfNil(in.ArtifactRef.DockerImageTag), - }, - Metadata: in.Metadata, - }, - ) - if err != nil { - return nil, err - } - marshal, err := json.Marshal(pipeline) - if err != nil { - return nil, err - } - x := make(map[string]any) - err = json.Unmarshal(marshal, &x) - if err != nil { - return nil, err - } - return x, err -} - -func (r *appResolver) CiCreatePipeLine(ctx context.Context, obj *model.App, containerName string, in model.GitPipelineIn) (map[string]interface{}, error) { - session := httpServer.GetSession[*common.AuthSession](ctx) - if session == nil { - return nil, errors.New("not authorized") - } - var pipeline, err = r.Domain.CreatePipeline( - ctx, session.UserId, domain.Pipeline{ - AccountId: in.AccountID, - ProjectName: in.ProjectName, - Name: in.Name, - ProjectId: in.ProjectID, - AppId: string(obj.ID), - ContainerName: containerName, - GitProvider: in.GitProvider, - GitRepoUrl: in.GitRepoURL, - GitBranch: in.GitBranch, - Build: &domain.ContainerImageBuild{ - BaseImage: in.Build.BaseImage, - Cmd: in.Build.Cmd, - OutputDir: func() string { - if in.Build.OutputDir != nil { - return *in.Build.OutputDir - } - return "" - }(), - }, - Run: &domain.ContainerImageRun{ - BaseImage: fn.DefaultIfNil(in.Run.BaseImage), - Cmd: in.Run.Cmd, - }, - ArtifactRef: domain.ArtifactRef{ - DockerImageName: fn.DefaultIfNil(in.ArtifactRef.DockerImageName), - DockerImageTag: fn.DefaultIfNil(in.ArtifactRef.DockerImageTag), - }, - Metadata: in.Metadata, - }, - ) - if err != nil { - return nil, err - } - marshal, err := json.Marshal(pipeline) - if err != nil { - return nil, err - } - x := make(map[string]any) - err = json.Unmarshal(marshal, &x) - if err != nil { - return nil, err - } - return x, err -} - -func (r *harborSearchResultResolver) Tags(ctx context.Context, obj *model.HarborSearchResult) ([]*model.HarborImageTagsResult, error) { - tags, err := r.Domain.HarborImageTags(ctx, obj.ImageName, &types.Pagination{Page: 1, PerPage: 20}) - if err != nil { - return nil, err - } - items := make([]*model.HarborImageTagsResult, len(tags)) - for i := range tags { - items[i] = &model.HarborImageTagsResult{ - Name: tags[i].Name, - Signed: tags[i].Signed, - Immutable: tags[i].Immutable, - } - } - return items, nil -} - -func (r *mutationResolver) CiDeletePipeline(ctx context.Context, pipelineID repos.ID) (bool, error) { - // session := httpServer.GetSession[*common.AuthSession](ctx) - if err := r.Domain.DeletePipeline(ctx, pipelineID); err != nil { - return false, err - } - return true, nil -} - -func (r *mutationResolver) CiCreatePipeline(ctx context.Context, in model.GitPipelineIn) (map[string]interface{}, error) { - session := httpServer.GetSession[*common.AuthSession](ctx) - if session == nil { - return nil, errors.New("not authorized") - } - var pipeline, err = r.Domain.CreatePipeline( - ctx, session.UserId, domain.Pipeline{ - Name: in.Name, - ProjectName: in.ProjectName, - AccountId: in.AccountID, - ProjectId: in.ProjectID, - AppId: in.AppID, - GitProvider: in.GitProvider, - GitRepoUrl: in.GitRepoURL, - GitBranch: in.GitBranch, - Build: &domain.ContainerImageBuild{ - BaseImage: in.Build.BaseImage, - Cmd: in.Build.Cmd, - OutputDir: fn.DefaultIfNil(in.Build.OutputDir), - }, - Run: &domain.ContainerImageRun{ - BaseImage: fn.DefaultIfNil(in.Run.BaseImage), - Cmd: in.Run.Cmd, - }, - ArtifactRef: domain.ArtifactRef{ - DockerImageName: fn.DefaultIfNil(in.ArtifactRef.DockerImageName), - DockerImageTag: fn.DefaultIfNil(in.ArtifactRef.DockerImageTag), - }, - }, - ) - if err != nil { - return nil, err - } - marshal, err := json.Marshal(pipeline) - if err != nil { - return nil, err - } - x := make(map[string]any) - err = json.Unmarshal(marshal, &x) - if err != nil { - return nil, err - } - return x, err -} - -func (r *mutationResolver) CiCreateDockerPipeline(ctx context.Context, in model.GitDockerPipelineIn) (map[string]interface{}, error) { - session := httpServer.GetSession[*common.AuthSession](ctx) - if session == nil { - return nil, wErrors.NotLoggedIn - } - - var pipeline, err = r.Domain.CreatePipeline( - ctx, session.UserId, domain.Pipeline{ - Name: in.Name, - ProjectName: in.ProjectName, - ProjectId: in.ProjectID, - AccountId: in.AccountID, - AppId: in.AppID, - ContainerName: in.ContainerName, - GitProvider: in.GitProvider, - GitRepoUrl: in.GitRepoURL, - GitBranch: in.GitBranch, - DockerBuildInput: domain.DockerBuildInput{ - DockerFile: in.DockerFile, - ContextDir: in.ContextDir, - BuildArgs: in.BuildArgs, - }, - ArtifactRef: domain.ArtifactRef{ - DockerImageName: fn.DefaultIfNil(in.ArtifactRef.DockerImageName), - DockerImageTag: fn.DefaultIfNil(in.ArtifactRef.DockerImageTag), - }, - Metadata: in.Metadata, - }, - ) - - if err != nil { - return nil, err - } - marshal, err := json.Marshal(pipeline) - if err != nil { - return nil, err - } - x := make(map[string]any) - err = json.Unmarshal(marshal, &x) - if err != nil { - return nil, err - } - return x, err -} - -func (r *queryResolver) CiGithubInstallations(ctx context.Context, pagination *types.Pagination) (interface{}, error) { - session := httpServer.GetSession[*common.AuthSession](ctx) - if session == nil { - return nil, errors.New("not authenticated") - } - return r.Domain.GithubListInstallations(ctx, session.UserId, pagination) -} - -func (r *queryResolver) CiGithubInstallationToken(ctx context.Context, repoURL string) (interface{}, error) { - return r.Domain.GithubInstallationToken(ctx, repoURL) -} - -func (r *queryResolver) CiGithubRepos(ctx context.Context, installationID int, pagination *types.Pagination) (interface{}, error) { - session := httpServer.GetSession[*common.AuthSession](ctx) - if session == nil { - return nil, errors.New("not authenticated") - } - return r.Domain.GithubListRepos(ctx, session.UserId, int64(installationID), pagination) -} - -func (r *queryResolver) CiGithubRepoBranches(ctx context.Context, repoURL string, pagination *types.Pagination) (interface{}, error) { - session := httpServer.GetSession[*common.AuthSession](ctx) - if session == nil { - return nil, errors.New("not authenticated") - } - branches, err := r.Domain.GithubListBranches(ctx, session.UserId, repoURL, pagination) - return branches, err -} - -func (r *queryResolver) CiSearchGithubRepos(ctx context.Context, search *string, org string, pagination *types.Pagination) (interface{}, error) { - session := httpServer.GetSession[*common.AuthSession](ctx) - if session == nil { - return nil, errors.New("not authenticated") - } - return r.Domain.GithubSearchRepos(ctx, session.UserId, *search, org, pagination) -} - -func (r *queryResolver) CiGitlabGroups(ctx context.Context, query *string, pagination *types.Pagination) (interface{}, error) { - session := httpServer.GetSession[*common.AuthSession](ctx) - return r.Domain.GitlabListGroups(ctx, session.UserId, query, pagination) -} - -func (r *queryResolver) CiGitlabRepos(ctx context.Context, groupID string, search *string, pagination *types.Pagination) (interface{}, error) { - session := httpServer.GetSession[*common.AuthSession](ctx) - return r.Domain.GitlabListRepos(ctx, session.UserId, groupID, search, pagination) -} - -func (r *queryResolver) CiGitlabRepoBranches(ctx context.Context, repoID string, search *string, pagination *types.Pagination) (interface{}, error) { - session := httpServer.GetSession[*common.AuthSession](ctx) - return r.Domain.GitlabListBranches(ctx, session.UserId, repoID, search, pagination) -} - -func (r *queryResolver) CiGetPipelines(ctx context.Context, projectID repos.ID) ([]*model.GitPipeline, error) { - pipelineEntities, err := r.Domain.ListPipelines(ctx, projectID) - if err != nil { - return nil, err - } - pipelines := make([]*model.GitPipeline, len(pipelineEntities)) - for i, pItem := range pipelineEntities { - pipelines[i] = &model.GitPipeline{ - ID: pItem.Id, - Name: pItem.Name, - GitProvider: pItem.GitProvider, - GitRepoURL: pItem.GitRepoUrl, - GitBranch: pItem.GitBranch, - Metadata: pItem.Metadata, - DockerBuild: func() *model.DockerBuild { - if pItem.DockerBuildInput.DockerFile == "" { - return nil - } - return &model.DockerBuild{ - DockerFile: pItem.DockerBuildInput.DockerFile, - ContextDir: pItem.DockerBuildInput.ContextDir, - BuildArgs: &pItem.DockerBuildInput.BuildArgs, - } - }(), - } - - if pItem.Build != nil { - pipelines[i].Build = &model.GitPipelineBuild{ - BaseImage: &pItem.Build.BaseImage, - Cmd: pItem.Build.Cmd, - OutputDir: &pItem.Build.OutputDir, - } - } - - if pItem.Run != nil { - pipelines[i].Run = &model.GitPipelineRun{ - BaseImage: &pItem.Run.BaseImage, - Cmd: pItem.Run.Cmd, - } - } - - } - return pipelines, nil -} - -func (r *queryResolver) CiGetPipeline(ctx context.Context, pipelineID repos.ID) (*model.GitPipeline, error) { - pipeline, err := r.Domain.GetPipeline(ctx, pipelineID) - if err != nil { - return nil, err - } - - pRecord := model.GitPipeline{ - ID: pipeline.Id, - Name: pipeline.Name, - GitProvider: pipeline.GitProvider, - GitRepoURL: pipeline.GitRepoUrl, - GitBranch: pipeline.GitBranch, - Build: &model.GitPipelineBuild{ - BaseImage: &pipeline.Build.BaseImage, - Cmd: pipeline.Build.Cmd, - OutputDir: &pipeline.Build.OutputDir, - }, - Run: &model.GitPipelineRun{ - BaseImage: &pipeline.Run.BaseImage, - Cmd: pipeline.Run.Cmd, - }, - DockerBuild: func() *model.DockerBuild { - if pipeline.DockerBuildInput.DockerFile == "" { - return nil - } - return &model.DockerBuild{ - DockerFile: pipeline.DockerBuildInput.DockerFile, - ContextDir: pipeline.DockerBuildInput.ContextDir, - BuildArgs: &pipeline.DockerBuildInput.BuildArgs, - } - }(), - Metadata: pipeline.Metadata, - } - - if pipeline.Build != nil { - pRecord.Build = &model.GitPipelineBuild{ - BaseImage: &pipeline.Build.BaseImage, - Cmd: pRecord.Build.Cmd, - OutputDir: &pipeline.Build.OutputDir, - } - } - - if pipeline.Run != nil { - pRecord.Run = &model.GitPipelineRun{ - BaseImage: &pipeline.Run.BaseImage, - Cmd: pipeline.Run.Cmd, - } - } - - return &pRecord, nil -} - -func (r *queryResolver) CiTriggerPipeline(ctx context.Context, pipelineID repos.ID) (*bool, error) { - session := httpServer.GetSession[*common.AuthSession](ctx) - if err := r.Domain.TriggerPipeline(ctx, session.UserId, pipelineID); err != nil { - return fn.New(false), err - } - return fn.New(true), nil -} - -func (r *queryResolver) CiGetPipelineRuns(ctx context.Context, pipelineID repos.ID) ([]*model.PipelineRun, error) { - pRuns, err := r.Domain.ListPipelineRuns(ctx, pipelineID) - if err != nil { - return nil, err - } - - runs := make([]*model.PipelineRun, len(pRuns)) - - for i := range pRuns { - pRun := pRuns[i] - runs[i] = &model.PipelineRun{ - ID: pRun.Id, - PipelineID: pRun.PipelineID, - CreationTime: pRun.CreationTime, - StartTime: pRun.StartTime, - EndTime: pRun.EndTime, - Success: pRun.Success, - Message: &pRun.Message, - State: (*string)(&pRun.State), - GitProvider: pRun.GitProvider, - GitRepo: pRun.GitRepo, - GitBranch: pRun.GitBranch, - Build: func() *model.GitPipelineBuild { - if pRun.Build == nil { - return nil - } - return &model.GitPipelineBuild{ - BaseImage: &pRun.Build.BaseImage, - Cmd: pRun.Build.Cmd, - OutputDir: &pRun.Build.OutputDir, - } - }(), - Run: func() *model.GitPipelineRun { - if pRun.Run == nil { - return nil - } - return &model.GitPipelineRun{ - BaseImage: &pRun.Run.BaseImage, - Cmd: pRun.Run.Cmd, - } - }(), - DockerBuildInput: func() *model.DockerBuild { - if pRun.DockerBuildInput == nil { - return nil - } - return &model.DockerBuild{ - DockerFile: pRun.DockerBuildInput.DockerFile, - ContextDir: pRun.DockerBuildInput.ContextDir, - BuildArgs: &pRun.DockerBuildInput.BuildArgs, - } - }(), - // DockerBuildInput: &model.DockerBuild{}, - ArtifactRef: &model.GitPipelineArtifact{ - DockerImageName: &pRun.ArtifactRef.DockerImageName, - DockerImageTag: &pRun.ArtifactRef.DockerImageTag, - }, - } - } - - return runs, nil -} - -func (r *queryResolver) CiGetPipelineRun(ctx context.Context, pipelineRunID repos.ID) (*model.PipelineRun, error) { - pr, err := r.Domain.GetPipelineRun(ctx, pipelineRunID) - if err != nil { - return nil, err - } - - return &model.PipelineRun{ - ID: pr.Id, - PipelineID: pr.PipelineID, - CreationTime: pr.CreationTime, - StartTime: pr.StartTime, - EndTime: pr.EndTime, - Success: pr.Success, - Message: &pr.Message, - State: (*string)(&pr.State), - GitProvider: pr.GitProvider, - GitRepo: pr.GitRepo, - GitBranch: pr.GitBranch, - Build: func() *model.GitPipelineBuild { - if pr.Build == nil { - return nil - } - return &model.GitPipelineBuild{ - BaseImage: &pr.Build.BaseImage, - Cmd: pr.Build.Cmd, - OutputDir: &pr.Build.OutputDir, - } - }(), - Run: func() *model.GitPipelineRun { - if pr.Run == nil { - return nil - } - return &model.GitPipelineRun{ - BaseImage: &pr.Run.BaseImage, - Cmd: pr.Run.Cmd, - } - }(), - DockerBuildInput: func() *model.DockerBuild { - if pr.DockerBuildInput == nil { - return nil - } - return &model.DockerBuild{ - DockerFile: pr.DockerBuildInput.DockerFile, - ContextDir: pr.DockerBuildInput.ContextDir, - BuildArgs: &pr.DockerBuildInput.BuildArgs, - } - }(), - ArtifactRef: &model.GitPipelineArtifact{ - DockerImageName: &pr.ArtifactRef.DockerImageName, - DockerImageTag: &pr.ArtifactRef.DockerImageTag, - }, - }, nil -} - -func (r *queryResolver) CiHarborSearch(ctx context.Context, accountID repos.ID, q string, pagination *types.Pagination) ([]*model.HarborSearchResult, error) { - session := httpServer.GetSession[*common.AuthSession](ctx) - if session == nil { - return nil, errors.New("not Authorized") - } - results, err := r.Domain.HarborImageSearch(ctx, accountID, q, pagination) - if err != nil { - return nil, err - } - items := make([]*model.HarborSearchResult, len(results)) - for i := range results { - items[i] = &model.HarborSearchResult{ - ImageName: results[i].Name, - UpdatedAt: &results[i].UpdateTime, - CreatedAt: &results[i].CreationTime, - } - } - return items, nil -} - -func (r *queryResolver) CiHarborImageTags(ctx context.Context, imageName string, pagination *types.Pagination) ([]*model.HarborImageTagsResult, error) { - session := httpServer.GetSession[*common.AuthSession](ctx) - if session == nil { - return nil, errors.New("not Authorized") - } - tags, err := r.Domain.HarborImageTags(ctx, imageName, pagination) - if err != nil { - return nil, err - } - items := make([]*model.HarborImageTagsResult, len(tags)) - for i := range tags { - items[i] = &model.HarborImageTagsResult{ - Name: tags[i].Name, - Signed: tags[i].Signed, - Immutable: tags[i].Immutable, - } - } - return items, nil -} - -// App returns generated.AppResolver implementation. -func (r *Resolver) App() generated.AppResolver { return &appResolver{r} } - -// HarborSearchResult returns generated.HarborSearchResultResolver implementation. -func (r *Resolver) HarborSearchResult() generated.HarborSearchResultResolver { - return &harborSearchResultResolver{r} -} - -// Mutation returns generated.MutationResolver implementation. -func (r *Resolver) Mutation() generated.MutationResolver { return &mutationResolver{r} } - -// Query returns generated.QueryResolver implementation. -func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} } - -type appResolver struct{ *Resolver } -type harborSearchResultResolver struct{ *Resolver } -type mutationResolver struct{ *Resolver } -type queryResolver struct{ *Resolver } diff --git a/apps/ci/internal/app/main.go b/apps/ci/internal/app/main.go deleted file mode 100644 index fdb0ba710..000000000 --- a/apps/ci/internal/app/main.go +++ /dev/null @@ -1,258 +0,0 @@ -package app - -import ( - "github.com/gofiber/fiber/v2" - "go.uber.org/fx" - "google.golang.org/grpc" - "kloudlite.io/apps/ci/internal/app/graph" - "kloudlite.io/apps/ci/internal/app/graph/generated" - "kloudlite.io/apps/ci/internal/domain" - "kloudlite.io/common" - "kloudlite.io/constants" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/auth" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/console" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/finance" - "kloudlite.io/pkg/cache" - "kloudlite.io/pkg/config" - "kloudlite.io/pkg/errors" - "kloudlite.io/pkg/harbor" - httpServer "kloudlite.io/pkg/http-server" - "kloudlite.io/pkg/logging" - "kloudlite.io/pkg/redpanda" - "kloudlite.io/pkg/repos" -) - -type Env struct { - CookieDomain string `env:"COOKIE_DOMAIN" required:"true"` - GithubWebhookUrl string `env:"GITHUB_WEBHOOK_URL" required:"true"` - GitlabWebhookUrl string `env:"GITLAB_WEBHOOK_URL" required:"true"` - - GithubClientId string `env:"GITHUB_CLIENT_ID" required:"true"` - GithubClientSecret string `env:"GITHUB_CLIENT_SECRET" required:"true"` - GithubCallbackUrl string `env:"GITHUB_CALLBACK_URL" required:"true"` - GithubAppId string `env:"GITHUB_APP_ID" required:"true"` - GithubAppPKFile string `env:"GITHUB_APP_PK_FILE" required:"true"` - GithubScopes string `env:"GITHUB_SCOPES" required:"true"` - - GitlabClientId string `env:"GITLAB_CLIENT_ID" required:"true"` - GitlabClientSecret string `env:"GITLAB_CLIENT_SECRET" required:"true"` - GitlabCallbackUrl string `env:"GITLAB_CALLBACK_URL" required:"true"` - GitlabScopes string `env:"GITLAB_SCOPES" required:"true"` - - GoogleClientId string `env:"GOOGLE_CLIENT_ID" required:"true"` - GoogleClientSecret string `env:"GOOGLE_CLIENT_SECRET" required:"true"` - GoogleCallbackUrl string `env:"GOOGLE_CALLBACK_URL" required:"true"` - GoogleScopes string `env:"GOOGLE_SCOPES" required:"true"` - - KafkaTopicGitWebhooks string `env:"KAFKA_TOPIC_GIT_WEBHOOKS" required:"true"` - KafkaTopicPipelineRunUpdates string `env:"KAFKA_TOPIC_PIPELINE_RUN_UPDATES" required:"true"` - - KafkaGitWebhooksConsumerId string `env:"KAFKA_GIT_WEBHOOKS_CONSUMER_ID" required:"true"` - KafkaBrokers string `env:"KAFKA_BROKERS" required:"true"` - KafkaUsername string `env:"KAFKA_USERNAME" required:"true"` - KafkaPassword string `env:"KAFKA_PASSWORD" required:"true"` - - // KAFKA_GIT_WEBHOOKS_TOPIC="kl-git-webhooks" - // KAFKA_BROKERS="redpanda.kl-init-redpanda.svc.cluster.local" - - HarborAdminUsername string `env:"HARBOR_ADMIN_USERNAME" required:"true"` - HarborAdminPassword string `env:"HARBOR_ADMIN_PASSWORD" required:"true"` - HarborRegistryHost string `env:"HARBOR_REGISTRY_HOST" required:"true"` - - GithubWebhookAuthzSecret string `env:"GITHUB_WEBHOOK_AUTHZ_SECRET" required:"true"` - GitlabWebhookAuthzSecret string `env:"GITLAB_WEBHOOK_AUTHZ_SECRET" required:"true"` - KlHookTriggerAuthzSecret string `env:"KL_HOOK_TRIGGER_AUTHZ_SECRET" required:"true"` -} - -func (env *Env) GetKafkaSASLAuth() *redpanda.KafkaSASLAuth { - return &redpanda.KafkaSASLAuth{ - SASLMechanism: redpanda.ScramSHA256, - User: env.KafkaUsername, - Password: env.KafkaPassword, - } -} - -func (env *Env) GetBrokerHosts() string { - return env.KafkaBrokers -} - -func (env *Env) GoogleConfig() (clientId string, clientSecret string, callbackUrl string) { - return env.GoogleClientId, env.GoogleClientSecret, env.GoogleCallbackUrl -} - -func (env *Env) GitlabConfig() (clientId string, clientSecret string, callbackUrl string) { - return env.GitlabClientId, env.GitlabClientSecret, env.GitlabCallbackUrl -} - -func (env *Env) GithubConfig() (clientId, clientSecret, callbackUrl, githubAppId, githubAppPKFile string) { - return env.GithubClientId, env.GithubClientSecret, env.GithubCallbackUrl, env.GithubAppId, env.GithubAppPKFile -} - -func (env *Env) GetSubscriptionTopics() []string { - return []string{env.KafkaTopicGitWebhooks} -} - -func (env *Env) GetConsumerGroupId() string { - return env.KafkaGitWebhooksConsumerId -} - -type AuthCacheClient cache.Client -type CacheClient cache.Client - -type AuthGRPCClient *grpc.ClientConn -type ConsoleGRPCClient *grpc.ClientConn -type FinanceGRPCClient *grpc.ClientConn - -var Module = fx.Module( - "app", - - fx.Provide(config.LoadEnv[Env]()), - - // Mongo Repos - repos.NewFxMongoRepo[*domain.Pipeline]("pipelines", "pip", domain.PipelineIndexes), - repos.NewFxMongoRepo[*domain.GitRepositoryHook]("git_repo_hooks", "grh", domain.GitRepositoryHookIndices), - repos.NewFxMongoRepo[*domain.PipelineRun]("pipeline_runs", "pr", domain.PipelineRunIndexes), - - redpanda.NewConsumerFx[*Env](), - redpanda.NewProducerFx[*Env](), - - fx.Provide( - func(conn AuthGRPCClient) auth.AuthClient { - return auth.NewAuthClient((*grpc.ClientConn)(conn)) - }, - ), - - fx.Provide( - func(conn ConsoleGRPCClient) console.ConsoleClient { - return console.NewConsoleClient((*grpc.ClientConn)(conn)) - }, - ), - - fx.Provide( - func(conn FinanceGRPCClient) finance.FinanceClient { - return finance.NewFinanceClient((*grpc.ClientConn)(conn)) - }, - ), - - // FiberApp - fx.Invoke( - func(app *fiber.App, d domain.Domain, gitlab domain.Gitlab) { - app.Get( - "/healthy", func(ctx *fiber.Ctx) error { - return ctx.JSON("hello world") - }, - ) - app.Get( - "/pipelines/:pipeline", func(ctx *fiber.Ctx) error { - pipeline, err := d.GetPipeline(ctx.Context(), repos.ID(ctx.Params("pipeline"))) - if err != nil { - return err - } - return ctx.JSON(pipeline) - }, - ) - - app.Get( - "/access-token/:provider/:pipelineId", func(ctx *fiber.Ctx) error { - provider := ctx.Params("provider") - pipelineId := ctx.Params("pipelineId") - pipeline, err := d.GetPipeline(ctx.Context(), repos.ID(pipelineId)) - if err != nil { - return err - } - if provider == constants.ProviderGitlab { - token, err := d.GitlabPullToken(ctx.Context(), pipeline.AccessTokenId) - if err != nil { - return errors.NewEf(err, "while getting gitlab pull token") - } - return ctx.JSON(token) - } - - if provider == constants.ProviderGithub { - token, err := d.GithubInstallationToken(ctx.Context(), pipeline.GitRepoUrl) - if err != nil { - return errors.NewEf(err, "while getting gitlab pull token") - } - return ctx.JSON(token) - } - return errors.Newf("unknown (provider=%s) not one of [github,gitlab]", provider) - }, - ) - - }, - ), - - // Webhook - fx.Invoke( - func(app *fiber.App, d domain.Domain) error { - app.Post( - "/hooks/:gitProvider", func(ctx *fiber.Ctx) error { - return nil - }, - ) - return nil - }, - ), - - // GraphQL App - fx.Invoke( - func( - server *fiber.App, - d domain.Domain, - env *Env, - cacheClient AuthCacheClient, - ) { - schema := generated.NewExecutableSchema( - generated.Config{Resolvers: &graph.Resolver{Domain: d}}, - ) - httpServer.SetupGQLServer( - server, - schema, - httpServer.NewSessionMiddleware[*common.AuthSession]( - cacheClient, - constants.CookieName, - env.CookieDomain, - constants.CacheSessionPrefix, - ), - ) - }, - ), - - fx.Provide(fxGitlab), - fx.Provide(fxGithub), - - fx.Provide( - func(env *Env) domain.HarborHost { - return domain.HarborHost(env.HarborRegistryHost) - }, - ), - - fx.Provide( - func(env *Env) (*harbor.Client, error) { - return harbor.NewClient( - harbor.Args{ - HarborAdminUsername: env.HarborAdminUsername, - HarborAdminPassword: env.HarborAdminPassword, - HarborRegistryHost: env.HarborRegistryHost, - }, - ) - }, - ), - - fxInvokeProcessGitWebhooks(), - - fx.Provide( - func(ev *Env, logger logging.Logger) (PipelineStatusConsumer, error) { - return redpanda.NewConsumer( - ev.KafkaBrokers, ev.KafkaGitWebhooksConsumerId, redpanda.ConsumerOpts{ - SASLAuth: ev.GetKafkaSASLAuth(), - Logger: logger, - }, []string{ev.KafkaTopicPipelineRunUpdates}, - ) - }, - ), - - fx.Invoke(fxInvokeProcessPipelineRunEvents), - - domain.Module, -) diff --git a/apps/ci/internal/app/pipeline-status-consumer.go b/apps/ci/internal/app/pipeline-status-consumer.go deleted file mode 100644 index bdf84ef47..000000000 --- a/apps/ci/internal/app/pipeline-status-consumer.go +++ /dev/null @@ -1,43 +0,0 @@ -package app - -import ( - "context" - "encoding/json" - "log" - "time" - - "kloudlite.io/apps/ci/internal/domain" - "kloudlite.io/pkg/logging" - "kloudlite.io/pkg/redpanda" -) - -type PipelineStatusConsumer redpanda.Consumer - -func fxInvokeProcessPipelineRunEvents(d domain.Domain, consumer PipelineStatusConsumer, logr logging.Logger) { - ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second) - defer cancelFn() - - if err := consumer.Ping(ctx); err != nil { - log.Fatal("failed to ping kafka brokers, for pipeline status consumer") - } - logr.Infof("successful ping to kafka brokers") - consumer.StartConsuming( - func(msg []byte, _ time.Time, offset int64) error { - logger := logr.WithName("ci-pipeline-watcher").WithKV("offset", offset) - logger.Infof("started processing") - defer func() { - logger.Infof("processed message") - }() - - var kMsg domain.PipelineRunStatus - if err := json.Unmarshal(msg, &kMsg); err != nil { - return err - } - - ctx, cancelFn := context.WithTimeout(context.Background(), 3*time.Second) - defer cancelFn() - - return d.UpdatePipelineRunStatus(ctx, kMsg) - }, - ) -} diff --git a/apps/ci/internal/app/templates/pipeline-run.yml.dind.tpl b/apps/ci/internal/app/templates/pipeline-run.yml.dind.tpl deleted file mode 100644 index 44602f98b..000000000 --- a/apps/ci/internal/app/templates/pipeline-run.yml.dind.tpl +++ /dev/null @@ -1,272 +0,0 @@ -{{- $svcAccountName := "kloudlite-svc-account" }} -{{/*{{- $dockerConfigName := "kloudlite-docker-registry" }}*/}} -{{- $dockerConfigName := "kloudlite-harbor-creds" }} - -{{- $tolerationKey := "only-ci" }} -{{- $tolerationEffect := "NoSchedule" }} - -{{- $varPipelineId := "pipeline-id" }} -{{- $varTaskNamespace := "task-namespace" }} -{{- $varGitRepo := "git-repo" }} -{{- $varGitUser := "git-user" }} -{{- $varGitPassword := "git-password" }} -{{- $varGitBranch := "git-branch" }} -{{- $varGitCommitHash := "git-commit-hash" }} - -{{- $varIsDockerBuild := "is-docker-build" }} -{{- $varDockerContextDir := "docker-context-dir"}} -{{- $varDockerFile := "docker-file"}} -{{- $varDockerBuildArgs := "docker-build-args"}} - -{{- $varBuildBaseImage := "build-base-image" }} -{{- $varBuildCmd := "build-cmd" }} -{{- $varBuildOutputDir := "build-output-dir" }} - -{{- $varRunBaseImage := "run-base-image"}} -{{- $varRunCmd := "run-cmd"}} - -{{- $varArtifactRefDockerImageName := "artifact_ref-docker_image_name"}} -{{- $varArtifactRefDockerImageTag := "artifact_ref-docker_image_tag"}} -{{/*{{- $varAppName := get . "app-name" -}}*/}} - -{{/*input Variables*/}} -{{- $pipelineRuns := get . "pipeline-runs" }} - -{{- range $pRun := $pipelineRuns}} -{{- with $pRun }} -{{- /*gotype: kloudlite.io/apps/ci/internal/domain.TektonVars*/ -}} -{{""}} - ---- -apiVersion: tekton.dev/v1beta1 -kind: PipelineRun -metadata: - generateName: {{.PipelineRunId}}- - namespace: {{.TaskNamespace}} - labels: - app: {{.PipelineId}} - component: {{.PipelineRunId}} -spec: - workspaces: - - name: p-output - emptyDir: {} - - - name: p-docker-config - secret: - secretName: {{$dockerConfigName}} - serviceAccountName: {{$svcAccountName}} - podTemplate: - nodeSelector: - kloudlite.io/auto-scaler: "true" - tolerations: - - key: kloudlite.io/auto-scaler - operator: Exists - effect: NoExecute - pipelineSpec: - workspaces: - - name: p-output - - name: p-docker-config - tasks: - - name: build-and-push - workspaces: - - name: output - workspace: p-output - - name: docker-config - workspace: p-docker-config - params: - - name: {{$varGitRepo}} - value: {{.GitRepo}} - - - name: {{$varGitBranch}} - value: {{.GitBranch}} - - - name: {{$varGitUser}} - value: {{.GitUser}} - - - name: {{$varGitPassword}} - value: {{.GitPassword}} - - - name: {{$varGitCommitHash}} - value: {{.GitCommitHash}} - - {{/* Docker configurations*/}} - - name: {{$varIsDockerBuild}} - value: {{.IsDockerBuild}} - - - name: {{$varDockerFile}} - value: {{.DockerFile}} - - - name: {{$varDockerContextDir}} - value: {{.DockerContextDir}} - - - name: {{$varDockerBuildArgs}} - value: {{.DockerBuildArgs}} - - {{/* Build Configurations*/}} - - name: {{$varBuildBaseImage}} - value: {{.BuildBaseImage}} - - - name: {{$varBuildCmd}} - value: {{.BuildCmd}} - - - name: {{$varBuildOutputDir}} - value: {{.BuildOutputDir}} - - {{/* Run Configurations*/}} - - name: {{$varRunBaseImage}} - value: {{.RunBaseImage}} - - - name: {{$varRunCmd}} - value: {{.RunCmd}} - - {{/* Artifacts*/}} - - name: {{$varArtifactRefDockerImageName}} - value: {{.ArtifactDockerImageName}} - - - name: {{$varArtifactRefDockerImageTag}} - value: {{.ArtifactDockerImageTag}} - taskSpec: -{{/* computeResources:*/}} -{{/* requests:*/}} -{{/* cpu: 100m*/}} -{{/* memory: 400Mi*/}} -{{/* limits:*/}} -{{/* cpu: 200m*/}} -{{/* memory: 400Mi*/}} - sidecars: - - name: dind - image: docker:19.03.5-dind - args: - - dockerd - - --host - - tcp://127.0.0.1:2375 - - --max-concurrent-downloads - - "1" - securityContext: - privileged: true - volumeMounts: - - name: $(workspaces.output.volume) - mountPath: /var/lib/docker - subPath: docker - - workspaces: - - name: output - - name: docker-config - steps: - - name: clone-git - image: registry.kloudlite.io/public/git:latest - script: |+ - cat > clone-git.sh <<'EOF' - - workdir="$(workspaces.output.path)" - gitUser="$(params.{{$varGitUser}})" - gitPassword="$(params.{{$varGitPassword}})" - gitRepo=$(echo $(params.{{$varGitRepo}}) | sed -E "s/https:[/]{2}(.*?\/)/https\:\/\/${gitUser}\:${gitPassword}@\1/g") - gitBranch="$(params.{{$varGitBranch}})" - - echo "cloning git repo: $gitRepo" - - # if not using git submodules - - cd $workdir - {{/* git clone --depth=1 --config remote.origin.pull="${gitBranch}" "$gitRepo" "./repo"*/}} - echo git clone --depth=1 --branch ${gitBranch} --single-branch "$gitRepo" "./repo" - git clone --depth=1 --branch ${gitBranch} --single-branch "$gitRepo" "./repo" - ls -l repo - echo "successfully cloned git repo: $gitRepo" - - echo "STEP (clone-git) FINISHED" - EOF - - sh clone-git.sh - # sh clone-git.sh | sed 's|.*|[kl-build:clone-git] &|' - - - name: build-image - image: registry.kloudlite.io/public/kloudlite/tekton-builder:latest - imagePullPolicy: Always - env: - - name: DOCKER_HOST - value: 127.0.0.1:2375 - securityContext: - runAsUser: 0 - script: |+ - cat > build-image.sh <<'EOF' - - set -o errexit - set -o pipefail - set -o nounset - - # ls -l $(workspaces.docker-config.path) - mkdir -p ~/.docker - cp $(workspaces.docker-config.path)/.dockerconfigjson ~/.docker/config.json - cd "$(workspaces.output.path)/repo" - - buildBaseImage='$(params.{{$varBuildBaseImage}})' - buildCmd='$(params.{{$varBuildCmd}})' - buildOutputDir='$(params.{{$varBuildOutputDir}})' - - runBaseImage='$(params.{{$varRunBaseImage}})' - runCmd='$(params.{{$varRunCmd}})' - - isDockerBuild='$(params.{{$varIsDockerBuild}})' - dockerfile='$(params.{{$varDockerFile}})' - dockerContextDir='$(params.{{$varDockerContextDir}})' - dockerBuildArgs='$(params.{{$varDockerBuildArgs}})' - - dockerImageName='$(params.{{$varArtifactRefDockerImageName}})' - dockerImageTag='$(params.{{$varArtifactRefDockerImageTag}})' - - gitCommitHash='$(params.{{$varGitCommitHash}})' - - if [ "$isDockerBuild" == "true" ]; then - # eval "$buildCmd" | envsubst - pushd $dockerContextDir - echo "listing files in context dir" - ls -al - echo docker build -f $dockerfile $dockerBuildArgs -t $dockerImageName:$dockerImageTag . - {{/* docker buildx build -f $dockerfile $dockerBuildArgs -t $dockerImageName:$dockerImageTag .*/}} - docker build -f $dockerfile $dockerBuildArgs -t $dockerImageName:$dockerImageTag . || exit 1 - popd - else - IFS=','; read -ra arr <<< $buildOutputDir - copyCmds="" - for item in ${arr[@]} - do - item=$(echo $item | xargs echo -n) - copyCmds+="COPY --from=build /app/$item ./$item\n" - done - - cat > /tmp/Dockerfile < clone-git.sh <<'EOF' - - workdir="$(workspaces.output.path)" - gitUser="$(params.{{$varGitUser}})" - gitPassword="$(params.{{$varGitPassword}})" - gitRepo=$(echo $(params.{{$varGitRepo}}) | sed -E "s/https:[/]{2}(.*?\/)/https\:\/\/${gitUser}\:${gitPassword}@\1/g") - gitBranch="$(params.{{$varGitBranch}})" - - echo "cloning git repo: $gitRepo" - - # if not using git submodules - - cd $workdir - {{/* git clone --depth=1 --config remote.origin.pull="${gitBranch}" "$gitRepo" "./repo"*/}} - echo git clone --depth=1 --branch ${gitBranch} --single-branch "$gitRepo" "./repo" - git clone --depth=1 --branch ${gitBranch} --single-branch "$gitRepo" "./repo" - ls -l repo - echo "successfully cloned git repo: $gitRepo" - - echo "STEP (clone-git) FINISHED" - EOF - - sh clone-git.sh - # sh clone-git.sh | sed 's|.*|[kl-build:clone-git] &|' - - - name: build-image - image: registry.kloudlite.io/public/kloudlite/tekton-builder:latest - imagePullPolicy: Always - env: - - name: DOCKER_HOST - value: 127.0.0.1:2375 - securityContext: - runAsUser: 0 - script: |+ - cat > build-image.sh <<'EOF' - - set -o errexit - set -o pipefail - set -o nounset - - # ls -l $(workspaces.docker-config.path) - mkdir -p ~/.docker - cp $(workspaces.docker-config.path)/.dockerconfigjson ~/.docker/config.json - cd "$(workspaces.output.path)/repo" - - buildBaseImage='$(params.{{$varBuildBaseImage}})' - buildCmd='$(params.{{$varBuildCmd}})' - buildOutputDir='$(params.{{$varBuildOutputDir}})' - - runBaseImage='$(params.{{$varRunBaseImage}})' - runCmd='$(params.{{$varRunCmd}})' - - isDockerBuild='$(params.{{$varIsDockerBuild}})' - dockerfile='$(params.{{$varDockerFile}})' - dockerContextDir='$(params.{{$varDockerContextDir}})' - dockerBuildArgs='$(params.{{$varDockerBuildArgs}})' - - dockerImageName='$(params.{{$varArtifactRefDockerImageName}})' - dockerImageTag='$(params.{{$varArtifactRefDockerImageTag}})' - - gitCommitHash='$(params.{{$varGitCommitHash}})' - - if [ "$isDockerBuild" == "true" ]; then - # eval "$buildCmd" | envsubst - pushd $dockerContextDir - echo "listing files in context dir" - ls -al -{{/* echo docker build -f $dockerfile $dockerBuildArgs -t $dockerImageName:$dockerImageTag .*/}} -{{/* */}}{{/* docker buildx build -f $dockerfile $dockerBuildArgs -t $dockerImageName:$dockerImageTag .*/}} -{{/* docker build -f $dockerfile $dockerBuildArgs -t $dockerImageName:$dockerImageTag . || exit 1*/}} - popd - else - IFS=','; read -ra arr <<< $buildOutputDir - copyCmds="" - for item in ${arr[@]} - do - item=$(echo $item | xargs echo -n) - copyCmds+="COPY --from=build /app/$item ./$item\n" - done - - cat > ./Dockerfile < clone-git.sh <<'EOF' - workdir="$(workspaces.output.path)" - mkdir -p $workdir - gitUser="$(params.{{$varGitUser}})" - gitPassword="$(params.{{$varGitPassword}})" - gitRepo="$(params.{{$varGitRepo}})" - gitRepoUrl=$(echo $(params.{{$varGitRepo}}) | sed -E "s/https:[/]{2}(.*?\/)/https\:\/\/${gitUser}\:${gitPassword}@\1/g") - gitBranch="$(params.{{$varGitBranch}})" - - echo "cloning git repo: $gitRepo" - - # if not using git submodules - cd $workdir -{{/* echo git clone --depth=1 --branch ${gitBranch} --single-branch "$gitRepo" "./repo"*/}} - git clone --depth=1 --branch ${gitBranch} --single-branch "$gitRepoUrl" "./repo" - ls -l repo - echo "successfully cloned git repo: $gitRepo" - echo "STEP (clone-git) FINISHED" - EOF - - sh clone-git.sh -{{/* ssh root@localhost bash -c "$(cat clone-git.sh)"*/}} - # sh clone-git.sh | sed 's|.*|[kl-build:clone-git] &|' - - - name: build-image - image: docker.io/nxtcoder17/alpine.ssh:root - imagePullPolicy: Always - env: - - name: DOCKER_HOST - value: 127.0.0.1:2375 - securityContext: - runAsUser: 0 - volumeMounts: - - name: host-ssh-root - mountPath: /root/.ssh - - name: host-dir - mountPath: /app - script: |+ -{{/* ls -al $(workspaces.docker-config.path)*/}} -{{/* ls -al $(workspaces.output.path)*/}} - -{{/* [ -f /root/.ssh/id_rsa.pub ] || ssh-keygen -t rsa -N "" -f /root/.ssh/id_rsa*/}} -{{/* echo "here"*/}} -{{/* touch /root/.ssh/authorized_keys*/}} -{{/* cat /root/.ssh/authorized_keys | grep -i "$(cat /root/.ssh/id_rsa.pub)"*/}} -{{/* [ $? -ne 0 ] && {*/}} -{{/* cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys*/}} -{{/* }*/}} -{{/* bash -x sx.sh*/}} - - cp $(workspaces.docker-config.path)/.dockerconfigjson /app/docker-config.json - cp -r $(workspaces.output.path)/repo /app/repo - - cat > /app/build-image.sh <<'EOF' - - set -o errexit - set -o pipefail - set -o nounset - - DOCKER="podman" - - mkdir -p /etc/containers - cat > /etc/containers/registries.conf <<'END1' - [registries.search] - registries = ['docker.io'] - END1 - - # ls -l $(workspaces.docker-config.path) - mkdir -p ~/.docker - cp /tmp/{{.PipelineRunId}}/docker-config.json ~/.docker/config.json -{{/* cp $(workspaces.docker-config.path)/.dockerconfigjson ~/.docker/config.json*/}} - - cd /tmp/{{.PipelineRunId}}/repo -{{/* cd "$(workspaces.output.path)/repo"*/}} - - buildBaseImage='$(params.{{$varBuildBaseImage}})' - buildCmd='$(params.{{$varBuildCmd}})' - buildOutputDir='$(params.{{$varBuildOutputDir}})' - - runBaseImage='$(params.{{$varRunBaseImage}})' - runCmd='$(params.{{$varRunCmd}})' - - isDockerBuild='$(params.{{$varIsDockerBuild}})' - dockerfile='$(params.{{$varDockerFile}})' - dockerContextDir='$(params.{{$varDockerContextDir}})' - dockerBuildArgs='$(params.{{$varDockerBuildArgs}})' - - dockerImageName='$(params.{{$varArtifactRefDockerImageName}})' - dockerImageTag='$(params.{{$varArtifactRefDockerImageTag}})' - - gitCommitHash='$(params.{{$varGitCommitHash}})' - - if [ "$isDockerBuild" == "true" ]; then - # eval "$buildCmd" | envsubst - pushd $dockerContextDir -{{/* echo "listing files in context dir"*/}} -{{/* ls -al*/}} - echo $DOCKER build -f $dockerfile $dockerBuildArgs -t $dockerImageName:$dockerImageTag . - $DOCKER build -f $dockerfile $dockerBuildArgs -t $dockerImageName:$dockerImageTag . || exit 1 - popd - else - IFS=','; read -ra arr <<< $buildOutputDir - copyCmds="" - for item in ${arr[@]} - do - item=$(echo $item | xargs echo -n) - copyCmds+="COPY --from=build /app/$item ./$item\n" - done - - cat > /tmp/Dockerfile < 0 { - if pStatus.Success { - return PipelineStatueSuccess - } - return PipelineStateError - } - return PipelineStateIdle - }() - - if _, err = d.pipelineRunRepo.UpdateById(ctx, repos.ID(pStatus.PipelineRunId), prun); err != nil { - return err - } - return nil -} - -func (d *domainI) ListPipelineRuns(ctx context.Context, pipelineId repos.ID) ([]*PipelineRun, error) { - pr, err := d.pipelineRunRepo.Find(ctx, repos.Query{Filter: repos.Filter{"pipeline_id": pipelineId}}) - if err != nil { - return nil, err - } - return pr, nil -} - -func (d *domainI) GetPipelineRun(ctx context.Context, pipelineRunId repos.ID) (*PipelineRun, error) { - return d.pipelineRunRepo.FindById(ctx, pipelineRunId) -} - -type Env struct { - GithubWebhookUrl string `env:"GITHUB_WEBHOOK_URL" required:"true"` - GitlabWebhookUrl string `env:"GITLAB_WEBHOOK_URL" required:"true"` - - GithubWebhookAuthzSecret string `env:"GITHUB_WEBHOOK_AUTHZ_SECRET" required:"true"` - GitlabWebhookAuthzSecret string `env:"GITLAB_WEBHOOK_AUTHZ_SECRET" required:"true"` - KlHookTriggerAuthzSecret string `env:"KL_HOOK_TRIGGER_AUTHZ_SECRET" required:"true"` -} - -const ( - GitlabProvider string = "gitlab" - GithubProvider string = "github" -) - -func (d *domainI) HarborImageSearch(ctx context.Context, accountId repos.ID, q string, pagination *t.Pagination) ([]harbor.Repository, error) { - return d.harborCli.SearchRepositories( - ctx, accountId, q, harbor.ListOptions{ - Page: func() int64 { - if pagination == nil { - return 1 - } - return int64(pagination.Page) - }(), - PageSize: func() int64 { - if pagination == nil { - return 20 - } - return int64(pagination.PerPage) - }(), - }, - ) -} - -func (d *domainI) HarborImageTags(ctx context.Context, imageName string, pagination *t.Pagination) ([]harbor.ImageTag, error) { - n := strings.SplitN(imageName, "/", 2) - projectName := n[0] - resourceName := n[1] - - return d.harborCli.ListTags( - ctx, projectName, resourceName, harbor.ListTagsOpts{ - ListOptions: harbor.ListOptions{ - Page: func() int64 { - if pagination == nil { - return 1 - } - return int64(pagination.Page) - }(), - PageSize: func() int64 { - if pagination == nil { - return 10 - } - return int64(pagination.PerPage) - }(), - }, - }, - ) -} - -func (d *domainI) GetAppPipelines(ctx context.Context, appId repos.ID) ([]*Pipeline, error) { - find, err := d.pipelineRepo.Find( - ctx, repos.Query{ - Filter: repos.Filter{ - "app_id": appId, - }, - }, - ) - if err != nil { - return nil, err - } - return find, nil -} - -type GitWebhookPayload struct { - GitProvider string `json:"git_provider,omitempty"` - RepoUrl string `json:"repo_url,omitempty"` - GitBranch string `json:"git_branch,omitempty"` - CommitHash string `json:"commit_hash,omitempty"` -} - -func getBranchFromRef(gitRef string) string { - sp := strings.SplitN(gitRef, "/", 3) - if len(sp) == 3 { - return sp[2] - } - return "" -} - -type ErrEventNotSupported struct { - err error -} - -func (e *ErrEventNotSupported) Error() string { - return e.err.Error() -} - -func (d *domainI) ParseGithubHook(eventType string, hookBody []byte) (*GitWebhookPayload, error) { - hook, err := github.ParseWebHook(eventType, hookBody) - if err != nil { - d.logger.Infof("bad webhook body, dropping message ...") - return nil, err - } - - switch h := hook.(type) { - case *github.PushEvent: - { - payload := GitWebhookPayload{ - GitProvider: constants.ProviderGithub, - RepoUrl: *h.Repo.HTMLURL, - GitBranch: getBranchFromRef(h.GetRef()), - CommitHash: h.GetAfter()[:int(math.Min(10, float64(len(h.GetAfter()))))], - } - return &payload, nil - } - default: - return nil, &ErrEventNotSupported{err: fmt.Errorf("event type (%s), currently not supported", eventType)} - } -} - -func (d *domainI) ParseGitlabHook(eventType string, hookBody []byte) (*GitWebhookPayload, error) { - hook, err := gitlab.ParseWebhook(gitlab.EventType(eventType), hookBody) - if err != nil { - return nil, errors.NewEf(err, "could not parse webhook body for eventType=%s", eventType) - } - switch h := hook.(type) { - case *gitlab.PushEvent: - { - payload := &GitWebhookPayload{ - GitProvider: constants.ProviderGitlab, - RepoUrl: h.Repository.GitHTTPURL, - GitBranch: getBranchFromRef(h.Ref), - CommitHash: h.CheckoutSHA[:int(math.Min(10, float64(len(h.CheckoutSHA))))], - } - return payload, nil - } - default: - return nil, &ErrEventNotSupported{err: fmt.Errorf("event type (%s) currently not supported", eventType)} - } -} - -func (d *domainI) gitlabPullToken(ctx context.Context, accTokenReq *auth.GetAccessTokenRequest) (string, error) { - accessToken, err := d.authClient.GetAccessToken(ctx, accTokenReq) - if err != nil || accessToken == nil { - return "", errors.NewEf(err, "could not get gitlab access token") - } - - accToken := AccessToken{ - UserId: repos.ID(accessToken.UserId), - Email: accessToken.Email, - Provider: accessToken.Provider, - Token: &oauth2.Token{ - AccessToken: accessToken.OauthToken.AccessToken, - TokenType: accessToken.OauthToken.TokenType, - RefreshToken: accessToken.OauthToken.RefreshToken, - Expiry: time.UnixMilli(accessToken.OauthToken.Expiry), - }, - Data: nil, - } - repoToken, err := d.gitlab.RepoToken(ctx, &accToken) - if err != nil || repoToken == nil { - return "", errors.NewEf(err, "could not get repoToken") - } - return repoToken.AccessToken, nil -} - -func (d *domainI) GitlabPullToken(ctx context.Context, tokenId repos.ID) (string, error) { - return d.gitlabPullToken(ctx, &auth.GetAccessTokenRequest{TokenId: string(tokenId)}) -} - -func (d *domainI) ListPipelines(ctx context.Context, projectId repos.ID) ([]*Pipeline, error) { - find, err := d.pipelineRepo.Find( - ctx, repos.Query{ - Filter: repos.Filter{ - "project_id": projectId, - }, - }, - ) - if err != nil { - return nil, err - } - return find, nil -} - -func (d *domainI) GetPipelineRunParams(ctx context.Context, p *Pipeline, pRun *PipelineRun) (*TektonVars, error) { - if p == nil || pRun == nil { - return nil, errors.Newf("pipeline and pipeline-run must be non-nil") - } - - pullToken, err := func() (string, error) { - if p.GitProvider == GithubProvider { - return d.github.GetInstallationToken(ctx, p.GitRepoUrl) - } - if p.GitProvider == GitlabProvider { - if p.AccessTokenId == "" { - return "", errors.Newf("pipeline has no associated gitlab access-token information") - } - return d.gitlabPullToken(ctx, &auth.GetAccessTokenRequest{TokenId: string(p.AccessTokenId)}) - } - return "", errors.Newf("unknown git provider") - }() - if err != nil { - return nil, err - } - - return &TektonVars{ - PipelineId: p.Id, - PipelineRunId: pRun.Id, - AccountId: p.AccountId, - GitRepo: p.GitRepoUrl, - GitUser: func() string { - if p.GitProvider == "github" { - return "x-access-token" - } - if p.GitProvider == "gitlab" { - return "oauth2" - } - return "" - }(), - GitPassword: pullToken, - GitBranch: p.GitBranch, - GitCommitHash: "", - IsDockerBuild: p.DockerBuildInput.DockerFile != "", - DockerFile: &p.DockerBuildInput.DockerFile, - DockerContextDir: &p.DockerBuildInput.ContextDir, - DockerBuildArgs: &p.DockerBuildInput.BuildArgs, - BuildBaseImage: fn.DefaultIfNil(p.Build).BaseImage, - BuildCmd: fn.DefaultIfNil(p.Build).Cmd, - BuildOutputDir: fn.DefaultIfNil(p.Build).OutputDir, - RunBaseImage: fn.DefaultIfNil(p.Run).BaseImage, - RunCmd: fn.DefaultIfNil(p.Run).Cmd, - TaskNamespace: p.ProjectName, - ArtifactDockerImageName: fmt.Sprintf("%s/%s/%s", d.harborHost, p.AccountId, p.ArtifactRef.DockerImageName), - ArtifactDockerImageTag: p.ArtifactRef.DockerImageTag, - }, nil -} - -func (d *domainI) GitlabListGroups(ctx context.Context, userId repos.ID, query *string, pagination *t.Pagination) (any, error) { - token, err := d.getAccessTokenByUserId(ctx, "gitlab", userId) - if err != nil { - return nil, err - } - return d.gitlab.ListGroups(ctx, token, query, pagination) -} - -func (d *domainI) GitlabListRepos(ctx context.Context, userId repos.ID, gid string, query *string, pagination *t.Pagination) (any, error) { - token, err := d.getAccessTokenByUserId(ctx, "gitlab", userId) - if err != nil { - return nil, err - } - return d.gitlab.ListRepos(ctx, token, gid, query, pagination) -} - -func (d *domainI) GitlabListBranches(ctx context.Context, userId repos.ID, repoId string, query *string, pagination *t.Pagination) (any, error) { - token, err := d.getAccessTokenByUserId(ctx, "gitlab", userId) - if err != nil { - return nil, err - } - return d.gitlab.ListBranches(ctx, token, repoId, query, pagination) -} - -func (d *domainI) GitlabAddWebhook(ctx context.Context, userId repos.ID, repoId string, pipelineId repos.ID) (repos.ID, error) { - grHook, err := d.gitRepoHookRepo.FindOne(ctx, repos.Filter{"httpUrl": d.gitlabWebhookUrl}) - if err != nil { - return "", err - } - - token, err := d.getAccessTokenByUserId(ctx, "gitlab", userId) - if err != nil { - return "", err - } - - if grHook != nil { - exists, _ := d.gitlab.CheckWebhookExists(ctx, token, repoId, grHook.GitlabWebhookId) - if exists { - return grHook.Id, nil - } - if err := d.gitRepoHookRepo.DeleteById(ctx, grHook.Id); err != nil { - return "", err - } - } - - webhookId, err := d.gitlab.AddWebhook(ctx, token, repoId, string(pipelineId)) - if err != nil { - return "", err - } - - grHook, err = d.gitRepoHookRepo.Create( - ctx, &GitRepositoryHook{ - HttpUrl: d.gitlabWebhookUrl, - GitProvider: GitlabProvider, - GitlabWebhookId: webhookId, - }, - ) - - if err != nil { - return "", err - } - return grHook.Id, nil -} - -func (d *domainI) SaveUserAcc(ctx context.Context, acc *HarborAccount) error { - _, err := d.harborAccRepo.Create(ctx, acc) - if err != nil { - return errors.NewEf(err, "[dbRepo] failed to create harbor account") - } - return nil -} - -func (d *domainI) getAccessTokenByTokenId(ctx context.Context, tokenId repos.ID) (*AccessToken, error) { - accTokenOut, err := d.authClient.GetAccessToken( - ctx, &auth.GetAccessTokenRequest{ - TokenId: string(tokenId), - }, - ) - if err != nil { - return nil, errors.NewEf(err, "finding accessToken") - } - return &AccessToken{ - Id: repos.ID(accTokenOut.Id), - UserId: repos.ID(accTokenOut.UserId), - Email: accTokenOut.Email, - Provider: accTokenOut.Provider, - Token: &oauth2.Token{ - AccessToken: accTokenOut.OauthToken.AccessToken, - TokenType: accTokenOut.OauthToken.TokenType, - RefreshToken: accTokenOut.OauthToken.RefreshToken, - Expiry: time.UnixMilli(accTokenOut.OauthToken.Expiry), - }, - }, err -} - -func (d *domainI) getAccessTokenByUserId(ctx context.Context, provider string, userId repos.ID) (*AccessToken, error) { - accTokenOut, err := d.authClient.GetAccessToken( - ctx, &auth.GetAccessTokenRequest{ - UserId: string(userId), - Provider: provider, - }, - ) - if err != nil { - return nil, errors.NewEf(err, "finding accessToken") - } - return &AccessToken{ - Id: repos.ID(accTokenOut.Id), - UserId: repos.ID(accTokenOut.UserId), - Email: accTokenOut.Email, - Provider: accTokenOut.Provider, - Token: &oauth2.Token{ - AccessToken: accTokenOut.OauthToken.AccessToken, - TokenType: accTokenOut.OauthToken.TokenType, - RefreshToken: accTokenOut.OauthToken.RefreshToken, - Expiry: time.UnixMilli(accTokenOut.OauthToken.Expiry), - }, - }, err -} - -func (d *domainI) GithubInstallationToken(ctx context.Context, repoUrl string) (string, error) { - return d.github.GetInstallationToken(ctx, repoUrl) -} - -func (d *domainI) GithubListBranches(ctx context.Context, userId repos.ID, repoUrl string, pagination *t.Pagination) (any, error) { - token, err := d.getAccessTokenByUserId(ctx, "github", userId) - if err != nil { - return "", err - } - return d.github.ListBranches(ctx, token, repoUrl, pagination) -} - -func (d *domainI) GithubAddWebhook(ctx context.Context, userId repos.ID, repoUrl string) (repos.ID, error) { - grHook, err := d.gitRepoHookRepo.Upsert( - ctx, repos.Filter{"httpUrl": repoUrl}, &GitRepositoryHook{ - HttpUrl: repoUrl, - GitProvider: GithubProvider, - }, - ) - if err != nil { - return "", err - } - - return grHook.Id, nil - - // grHook, err := d.gitRepoHookRepo.FindOne(ctx, repos.Filter{"httpUrl": d.githubWebhookUrl}) - // if err != nil { - // return "", err - // } - - // token, err := d.getAccessTokenByUserId(ctx, "github", userId) - // if err != nil { - // return "", err - // } - - // if grHook != nil { - // exists, _ := d.github.CheckWebhookExists(ctx, token, repoUrl, grHook.GithubWebhookId) - // if exists { - // return grHook.Id, nil - // } - // if err := d.gitRepoHookRepo.DeleteById(ctx, grHook.Id); err != nil { - // return "", err - // } - // } - - // webhookId, err := d.github.AddWebhook(ctx, token, repoUrl, d.githubWebhookUrl) - // if err != nil { - // return "", err - // } - - // grHook, err = d.gitRepoHookRepo.Create( - // ctx, &GitRepositoryHook{ - // HttpUrl: d.githubWebhookUrl, - // GitProvider: GithubProvider, - // // GithubWebhookId: webhookId, - // }, - // ) - - // if err != nil { - // return "", err - // } - // return grHook.Id, nil -} - -func (d *domainI) GithubSearchRepos(ctx context.Context, userId repos.ID, q, org string, pagination *t.Pagination) (any, error) { - token, err := d.getAccessTokenByUserId(ctx, "github", userId) - if err != nil { - return nil, err - } - if err != nil { - return nil, errors.NewEf(err, "while finding accessToken") - } - return d.github.SearchRepos(ctx, token, q, org, pagination) -} - -func (d *domainI) GithubListRepos(ctx context.Context, userId repos.ID, installationId int64, pagination *t.Pagination) (any, error) { - token, err := d.getAccessTokenByUserId(ctx, "github", userId) - if err != nil { - return nil, err - } - return d.github.ListRepos(ctx, token, installationId, pagination) -} - -func (d *domainI) GithubListInstallations(ctx context.Context, userId repos.ID, pagination *t.Pagination) (any, error) { - token, err := d.getAccessTokenByUserId(ctx, "github", userId) - if err != nil { - return nil, err - } - i, err := d.github.ListInstallations(ctx, token, pagination) - if err != nil { - return nil, err - } - return i, nil -} - -func (d *domainI) CreatePipeline(ctx context.Context, userId repos.ID, pipeline Pipeline) (*Pipeline, error) { - exP, err := d.pipelineRepo.FindOne( - ctx, repos.Filter{ - "project_id": pipeline.ProjectId, - "app_id": pipeline.AppId, - "container_name": pipeline.ContainerName, - }, - ) - if err != nil { - return nil, err - } - - if exP != nil { - pipeline.Id = exP.Id - } else { - pipeline.Id = d.pipelineRepo.NewId() - } - - // latestCommit := "" - // return nil, err - // } - // - // pipeline.AccessTokenId = token.Id - // hookId, err := d.GithubAddWebhook(ctx, userId, pipeline.GitRepoUrl) - // if err != nil { - // return nil, err - // } - // pipeline.WebhookId = hookId - // - // // pipeline.WebhookId = hookId - // commit, err := d.github.GetLatestCommit(ctx, token, pipeline.GitRepoUrl, pipeline.GitBranch) - // if err != nil { - // return nil, err - // } - // latestCommit = commit - // } - - if pipeline.GitProvider == constants.ProviderGitlab { - token, err := d.getAccessTokenByUserId(ctx, pipeline.GitProvider, userId) - if err != nil { - return nil, err - } - pipeline.AccessTokenId = token.Id - hookId, err := d.GitlabAddWebhook(ctx, userId, d.gitlab.GetRepoId(pipeline.GitRepoUrl), pipeline.Id) - if err != nil { - return nil, err - } - pipeline.WebhookId = hookId - - // commit, err := d.gitlab.GetLatestCommit(ctx, token, pipeline.GitRepoUrl, pipeline.GitBranch) - // if err != nil { - // return nil, err - // } - // latestCommit = commit - } - - p, err := d.pipelineRepo.Upsert(ctx, repos.Filter{"id": pipeline.Id}, &pipeline) - if err != nil { - return nil, err - } - if err := d.TriggerPipeline(ctx, userId, p.Id); err != nil { - return nil, errors.NewEf(err, "failed to trigger pipeline run") - } - return p, nil -} - -func (d *domainI) DeletePipeline(ctx context.Context, pipelineId repos.ID) error { - return d.pipelineRepo.DeleteById(ctx, pipelineId) - - // if pipeline.GitProvider == common.ProviderGithub { - // token, err := d.getAccessTokenByUserId(ctx, "github", userId) - // if err != nil { - // return err - // } - // //if err := d.github.DeleteWebhook(ctx, token, pipeline.GitRepoUrl, *pipeline.WebhookId); err != nil { - // // return err - // //} - // } - // - // if pipeline.GitProvider == common.ProviderGitlab { - // token, err := d.getAccessTokenByUserId(ctx, "gitlab", userId) - // if err != nil { - // return err - // } - // //if err := d.gitlab.DeleteWebhook(ctx, token, pipeline.GitRepoUrl, *pipeline.WebhookId); err != nil { - // // return err - // //} - // } -} - -func (d *domainI) TriggerPipeline(ctx context.Context, userId repos.ID, pipelineId repos.ID) error { - // TODO: (nxtcoder17) Can this userId, trigger pipeline ? - - pipeline, err := d.pipelineRepo.FindById(ctx, pipelineId) - if err != nil { - return err - } - - cluster, err := d.financeClient.GetAttachedCluster(ctx, &finance.GetAttachedClusterIn{AccountId: pipeline.AccountId}) - if err != nil { - return err - } - - pRun, err := d.createNewPipelineRun(ctx, pipeline) - if err != nil { - return err - } - - pRunParams, err := d.GetPipelineRunParams(ctx, pipeline, pRun) - if err != nil { - return err - } - - b, err := d.pipelineTemplate.RenderPipelineRun([]*TektonVars{pRunParams}) - if err != nil { - return err - } - - agentMsgBytes, err := json.Marshal(map[string]any{"action": "create", "yamls": b.Bytes()}) - if err != nil { - return err - } - - ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second) - defer cancelFn() - topicName := cluster.ClusterId + "-incoming" - - pMsg, err := d.producer.Produce(ctx, topicName, pRunParams.GitRepo, agentMsgBytes) - if err != nil { - d.logger.Errorf(err, "error processing message, could not pipeline output into topic=%s", topicName) - return err - } - d.logger.Infof("processed git webhook, pipelined output into to topic=%s, offset=%d", pMsg.Topic, pMsg.Offset) - return nil -} - -func (d *domainI) GetPipeline(ctx context.Context, pipelineId repos.ID) (*Pipeline, error) { - id, err := d.pipelineRepo.FindById(ctx, pipelineId) - if err != nil { - return nil, err - } - return id, nil -} - -var Module = fx.Module( - "domain", - - fx.Provide(config.LoadEnv[Env]()), - fx.Provide( - func( - pipelineRepo repos.DbRepo[*Pipeline], - pipelineRunRepo repos.DbRepo[*PipelineRun], - authClient auth.AuthClient, - gitlab Gitlab, - github Github, - harborHost HarborHost, - logger logging.Logger, - harborCli *harbor.Client, - gitRepoHookRepo repos.DbRepo[*GitRepositoryHook], - producer redpanda.Producer, - financeClient finance.FinanceClient, - pt PipelineTemplate, - env *Env, - ) Domain { - return &domainI{ - env: env, - authClient: authClient, - pipelineRepo: pipelineRepo, - pipelineRunRepo: pipelineRunRepo, - gitlab: gitlab, - github: github, - harborHost: harborHost, - logger: logger.WithName("[ci]:domain/main.go"), - harborCli: harborCli, - gitRepoHookRepo: gitRepoHookRepo, - gitlabWebhookUrl: env.GitlabWebhookUrl, - githubWebhookUrl: env.GithubWebhookUrl, - financeClient: financeClient, - producer: producer, - pipelineTemplate: pt, - } - }, - ), -) diff --git a/apps/ci/internal/domain/ports.go b/apps/ci/internal/domain/ports.go deleted file mode 100644 index b69160d6c..000000000 --- a/apps/ci/internal/domain/ports.go +++ /dev/null @@ -1,43 +0,0 @@ -package domain - -import ( - "bytes" - "context" - // "github.com/google/go-github/v43/github" - "github.com/google/go-github/v45/github" - "github.com/xanzy/go-gitlab" - "golang.org/x/oauth2" - "kloudlite.io/pkg/types" -) - -type Github interface { - Callback(ctx context.Context, code, state string) (*github.User, *oauth2.Token, error) - GetToken(ctx context.Context, token *oauth2.Token) (*oauth2.Token, error) - GetInstallationToken(ctx context.Context, repoUrl string) (string, error) - ListInstallations(ctx context.Context, accToken *AccessToken, pagination *types.Pagination) ([]*github.Installation, error) - ListRepos(ctx context.Context, accToken *AccessToken, instId int64, pagination *types.Pagination) (*github.ListRepositories, error) - SearchRepos(ctx context.Context, accToken *AccessToken, q, org string, pagination *types.Pagination) (*github.RepositoriesSearchResult, error) - ListBranches(ctx context.Context, accToken *AccessToken, repoUrl string, pagination *types.Pagination) ([]*github.Branch, error) - CheckWebhookExists(ctx context.Context, token *AccessToken, repoId string, webhookId *GithubWebhookId) (bool, error) - AddWebhook(ctx context.Context, accToken *AccessToken, repoUrl string, webhookUrl string) (*GithubWebhookId, error) - DeleteWebhook(ctx context.Context, accToken *AccessToken, repoUrl string, hookId GithubWebhookId) error - GetLatestCommit(ctx context.Context, accToken *AccessToken, repoUrl string, branchName string) (string, error) -} - -type Gitlab interface { - Callback(ctx context.Context, code, state string) (*gitlab.User, *oauth2.Token, error) - ListGroups(ctx context.Context, token *AccessToken, query *string, pagination *types.Pagination) ([]GitlabGroup, error) - ListRepos(ctx context.Context, token *AccessToken, gid string, query *string, pagination *types.Pagination) ([]*gitlab.Project, error) - ListBranches(ctx context.Context, token *AccessToken, repoId string, query *string, pagination *types.Pagination) ([]*gitlab.Branch, error) - CheckWebhookExists(ctx context.Context, token *AccessToken, repoId string, webhookId *GitlabWebhookId) (bool, error) - AddWebhook(ctx context.Context, token *AccessToken, repoId string, pipelineId string) (*GitlabWebhookId, error) - DeleteWebhook(ctx context.Context, token *AccessToken, repoUrl string, hookId GitlabWebhookId) error - RepoToken(ctx context.Context, token *AccessToken) (*oauth2.Token, error) - GetRepoId(repoUrl string) string - GetLatestCommit(ctx context.Context, token *AccessToken, repoUrl string, branchName string) (string, error) - GetTriggerWebhookUrl() string -} - -type PipelineTemplate interface { - RenderPipelineRun(runs []*TektonVars) (*bytes.Buffer, error) -} diff --git a/apps/ci/internal/framework/main.go b/apps/ci/internal/framework/main.go deleted file mode 100644 index d2b2c9338..000000000 --- a/apps/ci/internal/framework/main.go +++ /dev/null @@ -1,120 +0,0 @@ -package framework - -import ( - "go.uber.org/fx" - "kloudlite.io/apps/ci/internal/app" - "kloudlite.io/pkg/cache" - "kloudlite.io/pkg/config" - rpc "kloudlite.io/pkg/grpc" - httpServer "kloudlite.io/pkg/http-server" - "kloudlite.io/pkg/redpanda" - "kloudlite.io/pkg/repos" -) - -type GrpcAuthConfig struct { - Addr string `env:"AUTH_ADDR" required:"true"` -} - -func (e *GrpcAuthConfig) GetGRPCServerURL() string { - return e.Addr -} - -type GrpcConsoleConfig struct { - Addr string `env:"CONSOLE_ADDR" required:"true"` -} - -func (e *GrpcConsoleConfig) GetGRPCServerURL() string { - return e.Addr -} - -type GrpcFinanceConfig struct { - Addr string `env:"FINANCE_ADDR" required:"true"` -} - -func (e *GrpcFinanceConfig) GetGRPCServerURL() string { - return e.Addr -} - -type Env struct { - DBName string `env:"MONGO_DB_NAME" required:"true"` - DBUrl string `env:"MONGO_URI" required:"true"` - RedisHost string `env:"REDIS_HOSTS" required:"true"` - RedisUserName string `env:"REDIS_USERNAME" required:"true"` - RedisPassword string `env:"REDIS_PASSWORD" required:"true"` - RedisPrefix string `env:"REDIS_PREFIX" required:"true"` - - HttpPort uint16 `env:"PORT" required:"true"` - HttpCors string `env:"ORIGINS" required:"true"` - GrpcPort uint16 `env:"GRPC_PORT" required:"true"` - - AuthRedisHost string `env:"AUTH_REDIS_HOSTS" required:"true"` - AuthRedisUsername string `env:"AUTH_REDIS_USERNAME" required:"true"` - AuthRedisPassword string `env:"AUTH_REDIS_PASSWORD" required:"true"` - AuthRedisPrefix string `env:"AUTH_REDIS_PREFIX" required:"true"` - - KafkaBrokers string `env:"KAFKA_BROKERS" required:"true"` - KafkaUsername string `env:"KAFKA_USERNAME" required:"true"` - KafkaPassword string `env:"KAFKA_PASSWORD" required:"true"` -} - -func (e *Env) GetKafkaSASLAuth() *redpanda.KafkaSASLAuth { - return &redpanda.KafkaSASLAuth{ - SASLMechanism: redpanda.ScramSHA256, - User: e.KafkaUsername, - Password: e.KafkaPassword, - } -} - -func (e *Env) GetBrokers() string { - return e.KafkaBrokers -} - -func (e *Env) GetGRPCPort() uint16 { - return e.GrpcPort -} - -func (e *Env) RedisOptions() (hosts, username, password, basePrefix string) { - return e.RedisHost, e.RedisUserName, e.RedisPassword, basePrefix -} - -func (e *Env) GetMongoConfig() (url string, dbName string) { - return e.DBUrl, e.DBName -} - -func (e *Env) GetHttpPort() uint16 { - return e.HttpPort -} - -func (e *Env) GetHttpCors() string { - return e.HttpCors -} - -var Module fx.Option = fx.Module( - "framework", - config.EnvFx[Env](), - config.EnvFx[GrpcAuthConfig](), - config.EnvFx[GrpcConsoleConfig](), - config.EnvFx[GrpcFinanceConfig](), - fx.Provide( - func(env *Env) app.AuthCacheClient { - return cache.NewRedisClient(env.AuthRedisHost, env.AuthRedisUsername, env.AuthRedisPassword, env.AuthRedisPrefix) - }, - ), - cache.FxLifeCycle[app.AuthCacheClient](), - - fx.Provide( - func(env *Env) app.CacheClient { - return cache.NewRedisClient(env.RedisOptions()) - }, - ), - cache.FxLifeCycle[app.CacheClient](), - - httpServer.NewHttpServerFx[*Env](), - rpc.NewGrpcServerFx[*Env](), - repos.NewMongoClientFx[*Env](), - rpc.NewGrpcClientFx[*GrpcAuthConfig, app.AuthGRPCClient](), - rpc.NewGrpcClientFx[*GrpcConsoleConfig, app.ConsoleGRPCClient](), - rpc.NewGrpcClientFx[*GrpcFinanceConfig, app.FinanceGRPCClient](), - redpanda.NewClientFx[*Env](), - app.Module, -) diff --git a/apps/ci/main.go b/apps/ci/main.go deleted file mode 100644 index 57fcd3448..000000000 --- a/apps/ci/main.go +++ /dev/null @@ -1,47 +0,0 @@ -package main - -import ( - "context" - "flag" - "fmt" - "time" - - "go.uber.org/fx" - "kloudlite.io/apps/ci/internal/framework" - fn "kloudlite.io/pkg/functions" - "kloudlite.io/pkg/logging" -) - -func main() { - var isDev bool - flag.BoolVar(&isDev, "dev", false, "--dev") - flag.Parse() - - app := fx.New( - fx.NopLogger, - fx.Provide( - func() (logging.Logger, error) { - return logging.New(&logging.Options{Name: "ci", Dev: isDev}) - }, - ), - fn.FxErrorHandler(), - framework.Module, - ) - - ctx, _ := context.WithTimeout(context.Background(), 5*time.Second) - if err := app.Start(ctx); err != nil { - panic(err) - } - - fmt.Println( - ` -██████ ███████ █████ ██████ ██ ██ -██ ██ ██ ██ ██ ██ ██ ██ ██ -██████ █████ ███████ ██ ██ ████ -██ ██ ██ ██ ██ ██ ██ ██ -██ ██ ███████ ██ ██ ██████ ██ - `, - ) - - <-app.Done() -} diff --git a/apps/comms/Dockerfile b/apps/comms/Dockerfile index 812c7e8e2..da44277bb 100644 --- a/apps/comms/Dockerfile +++ b/apps/comms/Dockerfile @@ -20,11 +20,9 @@ ENV CGO_ENABLED=1 RUN GOOS=linux GOARCH=amd64 go build -tags musl -o /tmp/bin/$APP ./main.go RUN chmod +x /tmp/bin/$APP -#FROM gcr.io/distroless/static:nonroot -FROM golang:1.18.3-alpine3.16 +FROM gcr.io/distroless/static:nonroot +WORKDIR /tmp USER 1001:1001 ARG APP -#WORKDIR /comms -COPY --from=base /tmp/app/email-templates /comms/email-templates -COPY --from=base /tmp/bin/$APP /comms/comms +COPY --from=base /tmp/bin/$APP ./comms CMD ["./comms"] diff --git a/apps/comms/Dockerfile.dev b/apps/comms/Dockerfile.dev new file mode 100644 index 000000000..0f1b4331f --- /dev/null +++ b/apps/comms/Dockerfile.dev @@ -0,0 +1,6 @@ +FROM gcr.io/distroless/static:nonroot +WORKDIR /tmp +USER 1001:1001 +ARG BINARY +COPY --from=builder BINARY ./comms +CMD ["./comms"] diff --git a/apps/comms/Taskfile.yml b/apps/comms/Taskfile.yml index 75437e65e..9cf127727 100644 --- a/apps/comms/Taskfile.yml +++ b/apps/comms/Taskfile.yml @@ -2,6 +2,9 @@ version: "3" dotenv: [".secrets/env"] +vars: + ImagePrefix: ghcr.io/kloudlite/platform/apis + tasks: run: env: @@ -11,16 +14,25 @@ tasks: cmds: - nodemon -e go --signal SIGKILL --exec 'go run -tags dynamic main.go --dev || exit 1' + build: + env: + CGO_ENABLED: 0 + GOOS: linux + GOARCH: amd64 + preconditions: + - sh: '[ -n "{{.Out}}" ]' + msg: var Out must have a value + cmds: + - go build -ldflags="-s -w" -o {{.Out}} + - upx {{.Out}} + docker-build: vars: APP: comms - IMAGE: registry.kloudlite.io/kloudlite/{{.EnvName}}/{{.APP}}-api:{{.Tag}} + IMAGE: "{{.ImagePrefix}}/{{.APP}}:{{.Tag}}" preconditions: - sh: '[[ -n "{{.Tag}}" ]]' msg: 'var Tag must have a value' - - - sh: '[[ "{{.EnvName}}" == "development" ]] || [[ "{{.EnvName}}" == "staging" ]] || [[ "{{.EnvName}}" == "production" ]]' - msg: 'var EnvName must have one of [development, staging, production] as its value' cmds: - docker buildx build -f ./Dockerfile -t {{.IMAGE}} . --build-arg APP={{.APP}} --platform linux/amd64 --build-context project-root=../.. - docker push {{.IMAGE}} @@ -28,17 +40,10 @@ tasks: local-build: vars: APP: comms - IMAGE: registry.kloudlite.io/kloudlite/{{.EnvName}}/{{.APP}}-api:{{.Tag}} + IMAGE: "{{.ImagePrefix}}/{{.APP}}:{{.Tag}}" preconditions: - sh: '[[ -n "{{.Tag}}" ]]' msg: 'var Tag must have a value' - - - sh: '[[ "{{.EnvName}}" == "development" ]] || [[ "{{.EnvName}}" == "staging" ]] || [[ "{{.EnvName}}" == "production" ]]' - msg: 'var EnvName must have one of [development, staging, production] as its value' - env: - CGO_ENABLED: 0 - GOOS: linux - GOARCH: amd64 silent: true cmds: - |+ @@ -53,7 +58,7 @@ tasks: echo "$nDockerfile" | sed "1 i # syntax=docker/dockerfile:1.4" > $tDir/Dockerfile.base #lineNo=$(cat Dockerfile | grep -i '^FROM' -n | tail -1 | awk -F: '{print $1}') - CGO_ENABLED=0 go build -o $tDir/{{.APP}} . + task build Out="$tDir/{{.APP}}" cat $tDir/Dockerfile.base | sed "5 i COPY --from=local-builder ./{{.APP}} ./{{.APP}}" > $tDir/Dockerfile cat $tDir/Dockerfile diff --git a/apps/comms/email-templates/account-invite/email.html b/apps/comms/email-templates/account-invite/email.html index 0f7e5d86a..8aff7a9eb 100644 --- a/apps/comms/email-templates/account-invite/email.html +++ b/apps/comms/email-templates/account-invite/email.html @@ -1,6 +1,6 @@ - + - + @@ -42,30 +42,28 @@ display: block; margin: 13px 0; } - </style> <!--[if mso]> - <noscript> - <xml> - <o:OfficeDocumentSettings> - <o:AllowPNG/> - <o:PixelsPerInch>96</o:PixelsPerInch> - </o:OfficeDocumentSettings> - </xml> - </noscript> - <![endif]--> + <noscript> + <xml> + <o:OfficeDocumentSettings> + <o:AllowPNG/> + <o:PixelsPerInch>96</o:PixelsPerInch> + </o:OfficeDocumentSettings> + </xml> + </noscript> + <![endif]--> <!--[if lte mso 11]> - <style type="text/css"> - .mj-outlook-group-fix { width:100% !important; } - </style> - <![endif]--> + <style type="text/css"> + .mj-outlook-group-fix { width:100% !important; } + </style> + <![endif]--> <!--[if !mso]><!--> <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,500,700" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700" rel="stylesheet" type="text/css"> <style type="text/css"> @import url(https://fonts.googleapis.com/css?family=Open+Sans:300,400,500,700); @import url(https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700); - </style> <!--<![endif]--> <style type="text/css"> @@ -75,14 +73,12 @@ max-width: 100%; } } - </style> <style media="screen and (min-width:480px)"> .moz-text-html .mj-column-per-100 { width: 100% !important; max-width: 100%; } - </style> <style type="text/css"> @media only screen and (max-width:480px) { @@ -94,15 +90,12 @@ width: auto !important; } } - - </style> - <style type="text/css"> </style> </head> -<body style="word-spacing:normal;"> - <div style=""> - <!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" class="" role="presentation" style="width:600px;" width="600" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]--> +<body style="word-spacing:normal;background-color:#f7f7f7;"> + <div style="background-color:#f7f7f7;"> + <!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" class="" style="width:600px;" width="600" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]--> <div style="margin:0px auto;max-width:600px;"> <table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;"> <tbody> @@ -118,49 +111,68 @@ <tbody> <tr> <td style="width:100px;"> - <img height="auto" src="https://ik.imagekit.io/kloudlite/logo-scalable_c56EcJLdd.png?ik-sdk-version=javascript-1.4.3&updatedAt=1651786453856" style="border:0;display:block;outline:none;text-decoration:none;height:auto;width:100%;font-size:13px;" width="100" /> + <img alt="kloudlite logo" height="auto" src="https://ik.imagekit.io/kloudlite/logo-scalable_c56EcJLdd.png?ik-sdk-version=javascript-1.4.3&updatedAt=1651786453856" style="border:0;display:block;outline:none;text-decoration:none;height:auto;width:100%;font-size:13px;" width="100" /> </td> </tr> </tbody> </table> </td> </tr> + <tr> + <td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;"> + <p style="border-top:solid 1px #dddddd;font-size:1px;margin:0px auto;width:100%;"> + </p> + <!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" style="border-top:solid 1px #dddddd;font-size:1px;margin:0px auto;width:550px;" role="presentation" width="550px" ><tr><td style="height:0;line-height:0;">   +</td></tr></table><![endif]--> + </td> + </tr> <tr> <td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;"> - <div style="font-family:Open Sans, Arial;font-size:13px;line-height:1.5;text-align:left;color:#000000;">Hey {{.Name}},</div> + <div style="font-family:Open Sans, Arial;font-size:18px;line-height:1.5;text-align:left;color:#333333;">Hello {{.Name}},</div> </td> </tr> <tr> <td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;"> - <div style="font-family:Open Sans, Arial;font-size:13px;line-height:1.5;text-align:left;color:#000000;">You have recieved invitation to manage account - {{.AccountName}}</div> + <div style="font-family:Open Sans, Arial;font-size:16px;line-height:1.5;text-align:left;color:#555555;"><strong>{{.InvitedBy}}</strong> has invited you to join Kloudlite Account - <strong>{{.AccountName}}</strong></div> </td> </tr> <tr> <td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;"> - <div style="font-family:Open Sans, Arial;font-size:13px;line-height:1.5;text-align:left;color:#000000;">To accept, please click the button below.</div> + <div style="font-family:Open Sans, Arial;font-size:16px;line-height:1.5;text-align:left;color:#555555;">To accept, please click the button below.</div> </td> </tr> <tr> <td align="left" vertical-align="middle" style="font-size:0px;padding:10px 25px;word-break:break-word;"> <table border="0" cellpadding="0" cellspacing="0" role="presentation" style="border-collapse:separate;line-height:100%;"> - <tbody> - <tr> - <td align="center" bgcolor="#2563EB" role="presentation" style="border:none;border-radius:3px;cursor:auto;mso-padding-alt:10px 25px;background:#2563EB;" valign="middle"> - <a href="{{.Link}}" style="display:inline-block;background:#2563EB;color:#ffffff;font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:13px;font-weight:normal;line-height:120%;margin:0;text-decoration:none;text-transform:none;padding:10px 25px;mso-padding-alt:0px;border-radius:3px;" target="_blank"> Accept Invite </a> - </td> - </tr> - </tbody> + <tr> + <td align="center" bgcolor="#2563EB" role="presentation" style="border:none;border-radius:3px;cursor:auto;mso-padding-alt:10px 25px;background:#2563EB;" valign="middle"> + <a href="{{.Link}}" rel="noopener noreferrer" style="display:inline-block;background:#2563EB;color:#ffffff;font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:16px;font-weight:normal;line-height:120%;margin:0;text-decoration:none;text-transform:none;padding:10px 25px;mso-padding-alt:0px;border-radius:3px;" target="_blank"> Accept Invite </a> + </td> + </tr> </table> </td> </tr> <tr> <td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;"> - <div style="font-family:Open Sans, Arial;font-size:13px;line-height:1.5;text-align:left;color:#000000;">Or Copy this url in the browser: <a href="https://mjml.io/try-it-live/JiyoIAC3N">{{.Link}}</a></div> + <div style="font-family:Open Sans, Arial;font-size:16px;line-height:1.5;text-align:left;color:#555555;">Alternatively, you can copy and paste the following URL into your browser: <a href="{{.Link}}" rel="noopener noreferrer">{{.Link}}</a></div> </td> </tr> <tr> <td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;"> - <div style="font-family:Open Sans, Arial;font-size:13px;line-height:1;text-align:left;color:#000000;">- Team Kloudlite</div> + <div style="font-family:Open Sans, Arial;font-size:14px;line-height:1;text-align:left;color:#888888;">If you have any questions or need assistance, please don't hesitate to contact us.</div> + </td> + </tr> + <tr> + <td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;"> + <div style="font-family:Open Sans, Arial;font-size:14px;line-height:1;text-align:left;color:#888888;">- Team Kloudlite</div> + </td> + </tr> + <tr> + <td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;"> + <p style="border-top:solid 1px #dddddd;font-size:1px;margin:0px auto;width:100%;"> + </p> + <!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" style="border-top:solid 1px #dddddd;font-size:1px;margin:0px auto;width:550px;" role="presentation" width="550px" ><tr><td style="height:0;line-height:0;">   +</td></tr></table><![endif]--> </td> </tr> </tbody> @@ -177,4 +189,3 @@ </body> </html> - diff --git a/apps/comms/email-templates/account-invite/email.mjml b/apps/comms/email-templates/account-invite/email.mjml index 8fda31288..8e73ae372 100644 --- a/apps/comms/email-templates/account-invite/email.mjml +++ b/apps/comms/email-templates/account-invite/email.mjml @@ -1,27 +1,35 @@ +<!-- vim: set ft=html: --> <mjml> - <mj-body> - <mj-section> - <mj-column> - <mj-image align="left" width="100px" src="https://ik.imagekit.io/kloudlite/logo-scalable_c56EcJLdd.png?ik-sdk-version=javascript-1.4.3&updatedAt=1651786453856"></mj-image> - - <mj-text font-family="Open Sans, Arial" line-height="1.5"> - Hey {{.Name}}, + <mj-body background-color="#f7f7f7"> + <mj-section padding="20px 0"> + <mj-column width="100%"> + <mj-image align="left" width="100px" src="https://ik.imagekit.io/kloudlite/logo-scalable_c56EcJLdd.png?ik-sdk-version=javascript-1.4.3&updatedAt=1651786453856" alt="kloudlite logo"></mj-image> + <mj-divider border-color="#ddd" border-width="1px"></mj-divider> + <mj-text font-family="Open Sans, Arial" font-size="18px" color="#333" line-height="1.5"> + Hello {{.Name}}, </mj-text> - <mj-text font-family="Open Sans, Arial" line-height="1.5"> - You have recieved invitation to manage account - {{.AccountName}} - </mj-text> - <mj-text font-family="Open Sans, Arial" line-height="1.5"> -To accept, please click the button below. -</mj-text> - <mj-button align="left" href="{{.Link}}" background-color="#2563EB">Accept Invite</mj-button> - - <mj-text font-family="Open Sans, Arial" line-height="1.5"> -Or Copy this url in the browser: <a href="https://mjml.io/try-it-live/JiyoIAC3N">{{.Link}}</a> -</mj-text> - <mj-text font-family="Open Sans, Arial"> - - Team Kloudlite + <mj-text font-family="Open Sans, Arial" font-size="16px" color="#555" line-height="1.5"> + <strong>{{.InvitedBy}}</strong> has invited you to join Kloudlite Account - <strong>{{.AccountName}}</strong> + </mj-text> + <mj-text font-family="Open Sans, Arial" font-size="16px" color="#555" line-height="1.5"> + To accept, please click the button below. + </mj-text> + <mj-button align="left" href="{{.Link}}" rel="noopener noreferrer" background-color="#2563EB" font-size="16px" color="#fff"> + Accept Invite + </mj-button> + <mj-text font-family="Open Sans, Arial" font-size="16px" color="#555" line-height="1.5"> + Alternatively, you can copy and paste the following URL into your browser: + <a href="{{.Link}}" rel="noopener noreferrer">{{.Link}}</a> </mj-text> + <mj-text font-family="Open Sans, Arial" font-size="14px" color="#888"> + If you have any questions or need assistance, please don't hesitate to contact us. + </mj-text> + <mj-text font-family="Open Sans, Arial" font-size="14px" color="#888"> + - Team Kloudlite + </mj-text> + <mj-divider border-color="#ddd" border-width="1px"></mj-divider> </mj-column> </mj-section> </mj-body> </mjml> + diff --git a/apps/comms/email-templates/account-invite/email.txt b/apps/comms/email-templates/account-invite/email.txt new file mode 100644 index 000000000..510cb9001 --- /dev/null +++ b/apps/comms/email-templates/account-invite/email.txt @@ -0,0 +1,9 @@ +Hello {{.Name}}, + +{{.InvitedBy}} has invited you to join kloudlite account - {{.AccountName}} . + +To Accept, go to: {{.Link}} + +If you have any questions or need assistance, please don't hesitate to contact us. + +- Team Kloudlite diff --git a/apps/comms/email-templates/account-invite/email.yaml b/apps/comms/email-templates/account-invite/email.yaml deleted file mode 100644 index 9a9a88f97..000000000 --- a/apps/comms/email-templates/account-invite/email.yaml +++ /dev/null @@ -1,9 +0,0 @@ -subject: "[KloudLite] Account Invite" - -plain: >- - Hey {{.Name}}, - - You have recieved invitation to manage account - {{.AccountName}} - To Accept go to: {{.Link}} - - - Team Kloudlite diff --git a/apps/comms/email-templates/billing/email.html b/apps/comms/email-templates/billing/email.html deleted file mode 100644 index 95192d79c..000000000 --- a/apps/comms/email-templates/billing/email.html +++ /dev/null @@ -1,24 +0,0 @@ -<!doctype html><html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head><title>
Hey {{.Name}},
Forgot your password?
We recieved request to reset password for your account.
To reset password please click the button below.

Verify Email

Or Copy this url in the browser: https://mjml.io/try-it-live/JiyoIAC3N
- Team Kloudlite
diff --git a/apps/comms/email-templates/billing/email.mjml b/apps/comms/email-templates/billing/email.mjml deleted file mode 100644 index e6f3bc53c..000000000 --- a/apps/comms/email-templates/billing/email.mjml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - Hey {{.Name}}, - - -Forgot your password? - - -We recieved request to reset password for your account. - - -To reset password please click the button below. - - Verify Email - -Or Copy this url in the browser: https://mjml.io/try-it-live/JiyoIAC3N - - - - Team Kloudlite - - - - - diff --git a/apps/comms/email-templates/billing/email.yaml b/apps/comms/email-templates/billing/email.yaml deleted file mode 100644 index e709e4e7a..000000000 --- a/apps/comms/email-templates/billing/email.yaml +++ /dev/null @@ -1,10 +0,0 @@ -subject: "[KloudLite] Reset Password" - -plain: >- - Hello {{.Name}}, - - Verify your email by navigating to the following link - {{.Link}} - - Thanks, - Team KloudLite diff --git a/apps/comms/email-templates/project-invite/email.html b/apps/comms/email-templates/project-invite/email.html index d0a719fa7..caf64ad1a 100644 --- a/apps/comms/email-templates/project-invite/email.html +++ b/apps/comms/email-templates/project-invite/email.html @@ -1,180 +1,191 @@ - + - + - - - - - - - - - - - - - - - - - - + + + + + + + + + - + td.mj-full-width-mobile { + width: auto !important; + } + } + - -
- + +
+
- - - - + + +
- -
- - +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + - - -
+ + - + - - - - - - - - - - - - - - - - - - - +
- - - - - - -
- -
-
+ +
-
Hey {{.Name}},
-
-
You have recieved invitation to manage project - {{.ProjectName}}
-
-
To accept, please click the button below.
-
- - - - - - -
- Accept Invite -
-
-
Or Copy this url in the browser: {{.Link}}
-
-
- Team Kloudlite
-
- - -
+
+

+

+ +
+
Hello {{.Name}},
+
+
{{.InvitedBy}} has invited you to join kloudlite project {{.ProjectName}}.
+
+
To accept, please click the button below.
+
+ + + + +
+ Accept Invite +
+
+
Alternatively, you can copy and paste the following URL into your browser: {{.Link}}
+
+
If you have any questions or need assistance, please don't hesitate to contact us.
+
+
- Team Kloudlite
+
+

+

+ +
+
+ +
-
+
- diff --git a/apps/comms/email-templates/project-invite/email.mjml b/apps/comms/email-templates/project-invite/email.mjml index bd2649c40..c88446d1b 100644 --- a/apps/comms/email-templates/project-invite/email.mjml +++ b/apps/comms/email-templates/project-invite/email.mjml @@ -1,26 +1,33 @@ + - - - + + + - - - Hey {{.Name}}, + + + Hello {{.Name}}, - - You have recieved invitation to manage prject - {{.ProjectName}} - - -To accept, please click the button below. - - Accept Invite - - -Or Copy this url in the browser: {{.Link}} - - - - Team Kloudlite + + {{.InvitedBy}} has invited you to join kloudlite project {{.ProjectName}}. + + To accept, please click the button below. + + + Accept Invite + + + Alternatively, you can copy and paste the following URL into your browser: + {{.Link}} + + + If you have any questions or need assistance, please don't hesitate to contact us. + + + - Team Kloudlite + + diff --git a/apps/comms/email-templates/project-invite/email.txt b/apps/comms/email-templates/project-invite/email.txt new file mode 100644 index 000000000..4710c9f57 --- /dev/null +++ b/apps/comms/email-templates/project-invite/email.txt @@ -0,0 +1,9 @@ +Hey {{.Name}}, + +{{.InvitedBy}} has invited you to join kloudlite project - {{.ProjectName}} . + +To Accept, go to: {{.Link}} + +If you have any questions or need assistance, please don't hesitate to contact us. + +- Team Kloudlite diff --git a/apps/comms/email-templates/project-invite/email.yaml b/apps/comms/email-templates/project-invite/email.yaml deleted file mode 100644 index 06e835f52..000000000 --- a/apps/comms/email-templates/project-invite/email.yaml +++ /dev/null @@ -1,9 +0,0 @@ -subject: "[KloudLite] Project Invite" - -plain: >- - Hey {{.Name}}, - - You have recieved invitation to manage project - {{.ProjectName}} - To Accept go to: {{.Link}} - - - Team Kloudlite diff --git a/apps/comms/email-templates/reset-password/email.html b/apps/comms/email-templates/reset-password/email.html index 88788ab9c..89d522fe3 100644 --- a/apps/comms/email-templates/reset-password/email.html +++ b/apps/comms/email-templates/reset-password/email.html @@ -1,6 +1,6 @@ - + - + @@ -42,30 +42,28 @@ display: block; margin: 13px 0; } - </style> <!--[if mso]> - <noscript> - <xml> - <o:OfficeDocumentSettings> - <o:AllowPNG/> - <o:PixelsPerInch>96</o:PixelsPerInch> - </o:OfficeDocumentSettings> - </xml> - </noscript> - <![endif]--> + <noscript> + <xml> + <o:OfficeDocumentSettings> + <o:AllowPNG/> + <o:PixelsPerInch>96</o:PixelsPerInch> + </o:OfficeDocumentSettings> + </xml> + </noscript> + <![endif]--> <!--[if lte mso 11]> - <style type="text/css"> - .mj-outlook-group-fix { width:100% !important; } - </style> - <![endif]--> + <style type="text/css"> + .mj-outlook-group-fix { width:100% !important; } + </style> + <![endif]--> <!--[if !mso]><!--> <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,500,700" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700" rel="stylesheet" type="text/css"> <style type="text/css"> @import url(https://fonts.googleapis.com/css?family=Open+Sans:300,400,500,700); @import url(https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700); - </style> <!--<![endif]--> <style type="text/css"> @@ -75,14 +73,12 @@ max-width: 100%; } } - </style> <style media="screen and (min-width:480px)"> .moz-text-html .mj-column-per-100 { width: 100% !important; max-width: 100%; } - </style> <style type="text/css"> @media only screen and (max-width:480px) { @@ -94,15 +90,12 @@ width: auto !important; } } - - </style> - <style type="text/css"> </style> </head> -<body style="word-spacing:normal;"> - <div style=""> - <!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" class="" role="presentation" style="width:600px;" width="600" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]--> +<body style="word-spacing:normal;background-color:#f7f7f7;"> + <div style="background-color:#f7f7f7;"> + <!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" class="" style="width:600px;" width="600" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]--> <div style="margin:0px auto;max-width:600px;"> <table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;"> <tbody> @@ -126,46 +119,60 @@ </td> </tr> <tr> - <td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;"> - <div style="font-family:Open Sans, Arial;font-size:13px;line-height:1.5;text-align:left;color:#000000;">Hey {{.Name}},</div> + <td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;"> + <p style="border-top:solid 1px #dddddd;font-size:1px;margin:0px auto;width:100%;"> + </p> + <!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" style="border-top:solid 1px #dddddd;font-size:1px;margin:0px auto;width:550px;" role="presentation" width="550px" ><tr><td style="height:0;line-height:0;">   +</td></tr></table><![endif]--> </td> </tr> <tr> <td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;"> - <div style="font-family:Open Sans, Arial;font-size:13px;line-height:1.5;text-align:left;color:#000000;">Forgot your password?</div> + <div style="font-family:Open Sans, Arial;font-size:18px;line-height:1.5;text-align:left;color:#333333;">Hello {{.Name}},</div> </td> </tr> <tr> <td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;"> - <div style="font-family:Open Sans, Arial;font-size:13px;line-height:1.5;text-align:left;color:#000000;">We recieved request to reset password for your account.</div> + <div style="font-family:Open Sans, Arial;font-size:16px;line-height:1.5;text-align:left;color:#555555;">We've received a request to reset password for your account.</div> </td> </tr> <tr> <td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;"> - <div style="font-family:Open Sans, Arial;font-size:13px;line-height:1.5;text-align:left;color:#000000;">To reset password please click the button below.</div> + <div style="font-family:Open Sans, Arial;font-size:16px;line-height:1.5;text-align:left;color:#555555;">To proceed, please click the button below.</div> </td> </tr> <tr> <td align="left" vertical-align="middle" style="font-size:0px;padding:10px 25px;word-break:break-word;"> <table border="0" cellpadding="0" cellspacing="0" role="presentation" style="border-collapse:separate;line-height:100%;"> - <tbody> - <tr> - <td align="center" bgcolor="#2563EB" role="presentation" style="border:none;border-radius:3px;cursor:auto;mso-padding-alt:10px 25px;background:#2563EB;" valign="middle"> - <a href="{{.Link}}" style="display:inline-block;background:#2563EB;color:#ffffff;font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:13px;font-weight:normal;line-height:120%;margin:0;text-decoration:none;text-transform:none;padding:10px 25px;mso-padding-alt:0px;border-radius:3px;" target="_blank"> Verify Email </a> - </td> - </tr> - </tbody> + <tr> + <td align="center" bgcolor="#2563EB" role="presentation" style="border:none;border-radius:3px;cursor:auto;mso-padding-alt:10px 25px;background:#2563EB;" valign="middle"> + <a href="{{.Link}}" rel="noopener noreferrer" style="display:inline-block;background:#2563EB;color:#ffffff;font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:16px;font-weight:normal;line-height:120%;margin:0;text-decoration:none;text-transform:none;padding:10px 25px;mso-padding-alt:0px;border-radius:3px;" target="_blank"> Reset Password </a> + </td> + </tr> </table> </td> </tr> <tr> <td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;"> - <div style="font-family:Open Sans, Arial;font-size:13px;line-height:1.5;text-align:left;color:#000000;">Or Copy this url in the browser: <a href="{{.Link}}">{{.Link}}</a></div> + <div style="font-family:Open Sans, Arial;font-size:16px;line-height:1.5;text-align:left;color:#555555;">Alternatively, you can copy and paste the following URL into your browser: <a href="{{.Link}}" rel="noopener noreferrer">{{.Link}}</a></div> + </td> + </tr> + <tr> + <td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;"> + <div style="font-family:Open Sans, Arial;font-size:14px;line-height:1;text-align:left;color:#888888;">If you did not request a password reset or need further assistance, please contact us immediately.</div> </td> </tr> <tr> <td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;"> - <div style="font-family:Open Sans, Arial;font-size:13px;line-height:1;text-align:left;color:#000000;">- Team Kloudlite</div> + <div style="font-family:Open Sans, Arial;font-size:14px;line-height:1;text-align:left;color:#888888;">- Team Kloudlite</div> + </td> + </tr> + <tr> + <td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;"> + <p style="border-top:solid 1px #dddddd;font-size:1px;margin:0px auto;width:100%;"> + </p> + <!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" style="border-top:solid 1px #dddddd;font-size:1px;margin:0px auto;width:550px;" role="presentation" width="550px" ><tr><td style="height:0;line-height:0;">   +</td></tr></table><![endif]--> </td> </tr> </tbody> @@ -182,4 +189,3 @@ </body> </html> - diff --git a/apps/comms/email-templates/reset-password/email.mjml b/apps/comms/email-templates/reset-password/email.mjml index 17d786387..39d284973 100644 --- a/apps/comms/email-templates/reset-password/email.mjml +++ b/apps/comms/email-templates/reset-password/email.mjml @@ -1,28 +1,33 @@ +<!-- vim: set ft=html: --> <mjml> - <mj-body> - <mj-section> - <mj-column> + <mj-body background-color="#f7f7f7"> + <mj-section padding="20px 0"> + <mj-column width="100%"> <mj-image align="left" width="100px" src="https://ik.imagekit.io/kloudlite/logo-scalable_c56EcJLdd.png?ik-sdk-version=javascript-1.4.3&updatedAt=1651786453856"></mj-image> - - <mj-text font-family="Open Sans, Arial" line-height="1.5"> - Hey {{.Name}}, + <mj-divider border-color="#ddd" border-width="1px"></mj-divider> + <mj-text font-family="Open Sans, Arial" font-size="18px" color="#333" line-height="1.5"> + Hello {{.Name}}, + </mj-text> + <mj-text font-family="Open Sans, Arial" font-size="16px" color="#555" line-height="1.5"> + We've received a request to reset password for your account. + </mj-text> + <mj-text font-family="Open Sans, Arial" font-size="16px" color="#555" line-height="1.5"> + To proceed, please click the button below. + </mj-text> + <mj-button align="left" href="{{.Link}}" rel="noopener noreferrer" background-color="#2563EB" font-size="16px" color="#fff"> + Reset Password + </mj-button> + <mj-text font-family="Open Sans, Arial" font-size="16px" color="#555" line-height="1.5"> + Alternatively, you can copy and paste the following URL into your browser: + <a href="{{.Link}}" rel="noopener noreferrer">{{.Link}}</a> + </mj-text> + <mj-text font-family="Open Sans, Arial" font-size="14px" color="#888"> + If you did not request a password reset or need further assistance, please contact us immediately. </mj-text> - <mj-text font-family="Open Sans, Arial" line-height="1.5"> -Forgot your password? -</mj-text> - <mj-text font-family="Open Sans, Arial" line-height="1.5"> -We recieved request to reset password for your account. -</mj-text> - <mj-text font-family="Open Sans, Arial" line-height="1.5"> -To reset password please click the button below. -</mj-text> - <mj-button href="{{.Link}}" align="left" background-color="#2563EB">Verify Email</mj-button> -<mj-text font-family="Open Sans, Arial" line-height="1.5"> -Or Copy this url in the browser: <a href="{{.Link}}">{{.Link}}</a> -</mj-text> - <mj-text font-family="Open Sans, Arial"> - - Team Kloudlite + <mj-text font-family="Open Sans, Arial" font-size="14px" color="#888"> + - Team Kloudlite </mj-text> + <mj-divider border-color="#ddd" border-width="1px"></mj-divider> </mj-column> </mj-section> </mj-body> diff --git a/apps/comms/email-templates/reset-password/email.txt b/apps/comms/email-templates/reset-password/email.txt new file mode 100644 index 000000000..710320a8f --- /dev/null +++ b/apps/comms/email-templates/reset-password/email.txt @@ -0,0 +1,11 @@ +Hello {{.Name}}, + +We've received a request to reset password for your account. +To proceed, please follow the link below. + +{{.Link}} + +If you did not request a password reset or need further assistance, please contact us immediately. + +Thanks, +Team KloudLite diff --git a/apps/comms/email-templates/reset-password/email.yaml b/apps/comms/email-templates/reset-password/email.yaml deleted file mode 100644 index e709e4e7a..000000000 --- a/apps/comms/email-templates/reset-password/email.yaml +++ /dev/null @@ -1,10 +0,0 @@ -subject: "[KloudLite] Reset Password" - -plain: >- - Hello {{.Name}}, - - Verify your email by navigating to the following link - {{.Link}} - - Thanks, - Team KloudLite diff --git a/apps/comms/email-templates/user-verification/email.html b/apps/comms/email-templates/user-verification/email.html index 39b15bfe7..5ec94ff21 100644 --- a/apps/comms/email-templates/user-verification/email.html +++ b/apps/comms/email-templates/user-verification/email.html @@ -1,6 +1,6 @@ -<!-- FILE: email.mjml --> +<!-- DO NOT EDIT: generated with `email.mjml` in their online editor --> <!doctype html> -<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"> +<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> @@ -42,30 +42,28 @@ display: block; margin: 13px 0; } - </style> <!--[if mso]> - <noscript> - <xml> - <o:OfficeDocumentSettings> - <o:AllowPNG/> - <o:PixelsPerInch>96</o:PixelsPerInch> - </o:OfficeDocumentSettings> - </xml> - </noscript> - <![endif]--> + <noscript> + <xml> + <o:OfficeDocumentSettings> + <o:AllowPNG/> + <o:PixelsPerInch>96</o:PixelsPerInch> + </o:OfficeDocumentSettings> + </xml> + </noscript> + <![endif]--> <!--[if lte mso 11]> - <style type="text/css"> - .mj-outlook-group-fix { width:100% !important; } - </style> - <![endif]--> + <style type="text/css"> + .mj-outlook-group-fix { width:100% !important; } + </style> + <![endif]--> <!--[if !mso]><!--> <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,500,700" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700" rel="stylesheet" type="text/css"> <style type="text/css"> @import url(https://fonts.googleapis.com/css?family=Open+Sans:300,400,500,700); @import url(https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700); - </style> <!--<![endif]--> <style type="text/css"> @@ -75,14 +73,12 @@ max-width: 100%; } } - </style> <style media="screen and (min-width:480px)"> .moz-text-html .mj-column-per-100 { width: 100% !important; max-width: 100%; } - </style> <style type="text/css"> @media only screen and (max-width:480px) { @@ -94,15 +90,12 @@ width: auto !important; } } - - </style> - <style type="text/css"> </style> </head> -<body style="word-spacing:normal;"> - <div style=""> - <!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" class="" role="presentation" style="width:600px;" width="600" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]--> +<body style="word-spacing:normal;background-color:#f7f7f7;"> + <div style="background-color:#f7f7f7;"> + <!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" class="" style="width:600px;" width="600" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]--> <div style="margin:0px auto;max-width:600px;"> <table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;"> <tbody> @@ -134,7 +127,7 @@ </tbody> </table> </div> - <!--[if mso | IE]></td></tr></table><table align="center" border="0" cellpadding="0" cellspacing="0" class="" role="presentation" style="width:600px;" width="600" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]--> + <!--[if mso | IE]></td></tr></table><table align="center" border="0" cellpadding="0" cellspacing="0" class="" style="width:600px;" width="600" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]--> <div style="margin:0px auto;max-width:600px;"> <table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;"> <tbody> @@ -146,35 +139,43 @@ <tbody> <tr> <td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;"> - <div style="font-family:Open Sans, Arial;font-size:13px;line-height:1.5;text-align:left;color:#000000;">Hey {{.Name}},</div> + <div style="font-family:Open Sans, Arial;font-size:18px;line-height:1.5;text-align:left;color:#333333;">Hello {{.Name}},</div> + </td> + </tr> + <tr> + <td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;"> + <div style="font-family:Open Sans, Arial;font-size:16px;line-height:1.5;text-align:left;color:#555555;">Welcome to Kloudlite! We're excited to have you onboard.</div> </td> </tr> <tr> <td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;"> - <div style="font-family:Open Sans, Arial;font-size:13px;line-height:1.5;text-align:left;color:#000000;">We are happy you singed up for kloudlite. To start exploring kloudlite. Please confirm your email address.</div> + <div style="font-family:Open Sans, Arial;font-size:16px;line-height:1.5;text-align:left;color:#555555;">To start exploring Kloudlite, please confirm your email address by clicking the button below.</div> </td> </tr> <tr> <td align="left" vertical-align="middle" style="font-size:0px;padding:10px 25px;word-break:break-word;"> <table border="0" cellpadding="0" cellspacing="0" role="presentation" style="border-collapse:separate;line-height:100%;"> - <tbody> - <tr> - <td align="center" bgcolor="#2563EB" role="presentation" style="border:none;border-radius:3px;cursor:auto;mso-padding-alt:10px 25px;background:#2563EB;" valign="middle"> - <a href="{{.Link}}" style="display:inline-block;background:#2563EB;color:#ffffff;font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:13px;font-weight:normal;line-height:120%;margin:0;text-decoration:none;text-transform:none;padding:10px 25px;mso-padding-alt:0px;border-radius:3px;" target="_blank"> Verify Email </a> - </td> - </tr> - </tbody> + <tr> + <td align="center" bgcolor="#2563EB" role="presentation" style="border:none;border-radius:3px;cursor:auto;mso-padding-alt:10px 25px;background:#2563EB;" valign="middle"> + <a href="{{.Link}}" rel="noopener noreferrer" style="display:inline-block;background:#2563EB;color:#ffffff;font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:16px;font-weight:normal;line-height:120%;margin:0;text-decoration:none;text-transform:none;padding:10px 25px;mso-padding-alt:0px;border-radius:3px;" target="_blank"> Verify Email </a> + </td> + </tr> </table> </td> </tr> <tr> <td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;"> - <div style="font-family:Open Sans, Arial;font-size:13px;line-height:1.5;text-align:left;color:#000000;">Or Copy this url in the browser: <a href="{{.Link}}">{{.Link}}</a></div> + <div style="font-family:Open Sans, Arial;font-size:16px;line-height:1.5;text-align:left;color:#555555;">Alternatively, you can copy and paste the following URL into your browser: <a href="{{.Link}}" rel="noopener noreferrer">{{.Link}}</a></div> </td> </tr> <tr> <td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;"> - <div style="font-family:Open Sans, Arial;font-size:13px;line-height:1;text-align:left;color:#000000;">- Team Kloudlite</div> + <div style="font-family:Open Sans, Arial;font-size:14px;line-height:1;text-align:left;color:#888888;">If you didn't sign up for Kloudlite or have any questions, please contact us immediately.</div> + </td> + </tr> + <tr> + <td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;"> + <div style="font-family:Open Sans, Arial;font-size:14px;line-height:1;text-align:left;color:#888888;">- Team Kloudlite</div> </td> </tr> </tbody> @@ -191,4 +192,3 @@ </body> </html> - diff --git a/apps/comms/email-templates/user-verification/email.mjml b/apps/comms/email-templates/user-verification/email.mjml index 8c5029571..aed5fdb6f 100644 --- a/apps/comms/email-templates/user-verification/email.mjml +++ b/apps/comms/email-templates/user-verification/email.mjml @@ -1,26 +1,36 @@ +<!-- vim: set ft=html: --> <mjml> - <mj-body> - <mj-section> - <mj-column> + <mj-body background-color="#f7f7f7"> + <mj-section padding="20px 0"> + <mj-column width="100%"> <mj-image align="left" width="120px" src="https://ik.imagekit.io/kloudlite/logo-scalable_c56EcJLdd.png?ik-sdk-version=javascript-1.4.3&updatedAt=1651786453856"></mj-image> </mj-column> - </mj-section> - <mj-section> + </mj-section> + <mj-section padding="20px 0"> <mj-column> - <mj-text font-family="Open Sans, Arial" line-height="1.5"> -Hey {{.Name}}, + <mj-text font-family="Open Sans, Arial" font-size="18px" color="#333" line-height="1.5"> + Hello {{.Name}}, + </mj-text> + <mj-text font-family="Open Sans, Arial" font-size="16px" color="#555" line-height="1.5"> + Welcome to Kloudlite! We're excited to have you onboard. + </mj-text> + <mj-text font-family="Open Sans, Arial" font-size="16px" color="#555" line-height="1.5"> + To start exploring Kloudlite, please confirm your email address by clicking the button below. </mj-text> - <mj-text font-family="Open Sans, Arial" line-height="1.5"> -We are happy you singed up for kloudlite. To start exploring kloudlite. Please confirm your email address. -</mj-text> - <mj-button align="left" background-color="#2563EB" href="{{.Link}}">Verify Email</mj-button> -<mj-text font-family="Open Sans, Arial" line-height="1.5"> -Or Copy this url in the browser: <a href="{{.Link}}">{{.Link}}</a> -</mj-text> - <mj-text font-family="Open Sans, Arial"> -- Team Kloudlite + <mj-button align="left" href="{{.Link}}" rel="noopener noreferrer" background-color="#2563EB" font-size="16px" color="#fff"> + Verify Email + </mj-button> + <mj-text font-family="Open Sans, Arial" font-size="16px" color="#555" line-height="1.5"> + Alternatively, you can copy and paste the following URL into your browser: + <a href="{{.Link}}" rel="noopener noreferrer">{{.Link}}</a> </mj-text> -</mj-column> + <mj-text font-family="Open Sans, Arial" font-size="14px" color="#888"> + If you didn't sign up for Kloudlite or have any questions, please contact us immediately. + </mj-text> + <mj-text font-family="Open Sans, Arial" font-size="14px" color="#888"> + - Team Kloudlite + </mj-text> + </mj-column> </mj-section> </mj-body> </mjml> diff --git a/apps/comms/email-templates/user-verification/email.txt b/apps/comms/email-templates/user-verification/email.txt new file mode 100644 index 000000000..48327ed04 --- /dev/null +++ b/apps/comms/email-templates/user-verification/email.txt @@ -0,0 +1,11 @@ +Hello {{.Name}}, + +Welcome to Kloudlite! We're excited to have you onboard. + +To start exploring Kloudlite, please follow the link below to verify your email address: +{{.Link}} + +If you didn't sign up for Kloudlite or have any questions, please contact us immediately. + +Thanks, +Team KloudLite diff --git a/apps/comms/email-templates/user-verification/email.yaml b/apps/comms/email-templates/user-verification/email.yaml deleted file mode 100644 index e4c8069ba..000000000 --- a/apps/comms/email-templates/user-verification/email.yaml +++ /dev/null @@ -1,12 +0,0 @@ -subject: "[KloudLite] Verify your email" - -plain: >- - Hello {{.Name}}, - - We are happy you singed up for kloudlite. To start exploring kloudlite. - - Please confirm your email address, by opening url below - {{.Link}} - - Thanks, - Team KloudLite diff --git a/apps/comms/email-templates/welcome/email.html b/apps/comms/email-templates/welcome/email.html index 66625dd23..5a1b06be8 100644 --- a/apps/comms/email-templates/welcome/email.html +++ b/apps/comms/email-templates/welcome/email.html @@ -1,23 +1,180 @@ -<!doctype html><html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head><title> + + + + + +
Hey {{Name}},
I’m Karthik, the founder of Kloudlite Inc and I’d like to personally thank you for signing up to our service.
We established Kloudlite in order to make your DevOps Simple, Cloud Agnostic & Cost Effective.
I’d love to hear what you think of our product and if there is anything we can improve. If you have any questions, please reply to this email. I’m always happy to help!
- Karthik
+ + + + + + + + + + + + + +
+ +
+ + + + + + +
+ +
+ + + + + + +
+ + + + + + +
+ +
+
+
+ +
+
+ +
+ + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + +
+
Hello {{.Name}},
+
+
I’m Karthik, the founder of Kloudlite Inc, and I’d like to personally thank you for signing up for our service.
+
+
We established Kloudlite to make DevOps simple, cloud-agnostic, and cost-effective for you.
+
+
I’d love to hear what you think of our product and if there is anything we can improve. If you have any questions, please reply to this email. I’m always happy to help!
+
+
Best Regards,
+
+
Karthik
+
+
+ +
+
+ +
+ + + diff --git a/apps/comms/email-templates/welcome/email.mjml b/apps/comms/email-templates/welcome/email.mjml index 45da74840..9b1739f1f 100644 --- a/apps/comms/email-templates/welcome/email.mjml +++ b/apps/comms/email-templates/welcome/email.mjml @@ -1,24 +1,33 @@ + - - - + + + - -Hey {{Name}}, + + + + + + Hello {{.Name}}, + + + I’m Karthik, the founder of Kloudlite Inc, and I’d like to personally thank you for signing up for our service. + + + We established Kloudlite to make DevOps simple, cloud-agnostic, and cost-effective for you. + + + I’d love to hear what you think of our product and if there is anything we can improve. If you have any questions, please reply to this email. I’m always happy to help! + + + Best Regards, - -I’m Karthik, the founder of Kloudlite Inc and I’d like to personally thank you for signing up to our service. - - -We established Kloudlite in order to make your DevOps Simple, Cloud Agnostic & Cost Effective. - - -I’d love to hear what you think of our product and if there is anything we can improve. If you have any questions, please reply to this email. I’m always happy to help! - - -- Karthik + + Karthik + diff --git a/apps/comms/email-templates/welcome/email.txt b/apps/comms/email-templates/welcome/email.txt new file mode 100644 index 000000000..b69c50601 --- /dev/null +++ b/apps/comms/email-templates/welcome/email.txt @@ -0,0 +1,10 @@ +Hello {{.Name}}, + +I’m Karthik, the founder of Kloudlite Inc and I’d like to personally thank you for signing up to our service. + +We established Kloudlite in order to make your DevOps Simple, Cloud Agnostic & Cost Effective. + +I’d love to hear what you think of our product and if there is anything we can improve. If you have any questions, please reply to this email. I’m always happy to help! + +Best Regards, +Karthik diff --git a/apps/comms/email-templates/welcome/email.yaml b/apps/comms/email-templates/welcome/email.yaml deleted file mode 100644 index 57a8c5255..000000000 --- a/apps/comms/email-templates/welcome/email.yaml +++ /dev/null @@ -1,10 +0,0 @@ -subject: "[KloudLite] Welcome" - -plain: >- - Hello {{.Name}}, - - I’m Karthik, the founder of Kloudlite Inc and I’d like to personally thank you for signing up to our service. - We established Kloudlite in order to make your DevOps Simple, Cloud Agnostic & Cost Effective. - I’d love to hear what you think of our product and if there is anything we can improve. If you have any questions, please reply to this email. I’m always happy to help! - - - Karthik diff --git a/apps/comms/internal/app/app.go b/apps/comms/internal/app/app.go new file mode 100644 index 000000000..71b1e6838 --- /dev/null +++ b/apps/comms/internal/app/app.go @@ -0,0 +1,81 @@ +package app + +import ( + "embed" + "fmt" + "github.com/kloudlite/api/pkg/errors" + "text/template" + + "github.com/kloudlite/api/pkg/grpc" + + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/comms" + "go.uber.org/fx" +) + +type CommsGrpcServer grpc.Server + +type EmailTemplatesDir struct { + embed.FS +} + +type EmailTemplate struct { + Subject string + Html *template.Template + PlainText *template.Template +} + +type AccountInviteEmail *EmailTemplate +type ProjectInviteEmail *EmailTemplate +type RestPasswordEmail *EmailTemplate +type UserVerificationEmail *EmailTemplate +type WelcomeEmail *EmailTemplate + +func parseTemplate(et EmailTemplatesDir, templateName string, subject string) (*EmailTemplate, error) { + txtFile, err := et.ReadFile(fmt.Sprintf("email-templates/%v/email.txt", templateName)) + if err != nil { + return nil, errors.NewE(err) + } + txt, err := template.New("email-text").Parse(string(txtFile)) + if err != nil { + return nil, errors.NewE(err) + } + + htmlFile, err := et.ReadFile(fmt.Sprintf("email-templates/%v/email.html", templateName)) + if err != nil { + return nil, errors.NewE(err) + } + html, err := template.New(templateName).Parse(string(htmlFile)) + if err != nil { + return nil, errors.NewE(err) + } + + return &EmailTemplate{ + Subject: subject, + Html: html, + PlainText: txt, + }, nil +} + +var Module = fx.Module("app", + fx.Provide(func(et EmailTemplatesDir) (AccountInviteEmail, error) { + return parseTemplate(et, "account-invite", "[Kloudlite] Account Invite") + }), + fx.Provide(func(et EmailTemplatesDir) (ProjectInviteEmail, error) { + return parseTemplate(et, "project-invite", "[Kloudlite] Project Invite") + }), + fx.Provide(func(et EmailTemplatesDir) (RestPasswordEmail, error) { + return parseTemplate(et, "reset-password", "[Kloudlite] Reset Password") + }), + fx.Provide(func(et EmailTemplatesDir) (UserVerificationEmail, error) { + return parseTemplate(et, "user-verification", "[Kloudlite] Verify Email") + }), + fx.Provide(func(et EmailTemplatesDir) (WelcomeEmail, error) { + return parseTemplate(et, "welcome", "[Kloudlite] Welcome to Kloudlite") + }), + + fx.Provide(newCommsSvc), + + fx.Invoke(func(server CommsGrpcServer, commsServer comms.CommsServer) { + comms.RegisterCommsServer(server, commsServer) + }), +) diff --git a/apps/comms/internal/app/grpc-server.go b/apps/comms/internal/app/grpc-server.go new file mode 100644 index 000000000..d1df87bda --- /dev/null +++ b/apps/comms/internal/app/grpc-server.go @@ -0,0 +1,196 @@ +package app + +import ( + "bytes" + "context" + "fmt" + "github.com/kloudlite/api/apps/comms/internal/env" + "github.com/kloudlite/api/pkg/errors" + + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/comms" + "github.com/kloudlite/api/pkg/mail" +) + +type commsSvc struct { + comms.UnimplementedCommsServer + mailer mail.Mailer + + supportEmail string + + ev *env.Env + + accountInviteEmail AccountInviteEmail + projectInviteEmail ProjectInviteEmail + resetPasswordEmail RestPasswordEmail + userVerificationEmail UserVerificationEmail + welcomeEmail WelcomeEmail +} + +func (r *commsSvc) sendSupportEmail(ctx context.Context, subject string, toEmail string, toName string, plainText string, htmlContent string) error { + err := r.mailer.SendEmail(ctx, mail.Email{ + FromEmailAddress: r.supportEmail, + FromName: "Kloudlite Support", + Subject: subject, + ToEmailAddress: toEmail, + ToName: toName, + PlainText: plainText, + HtmlText: htmlContent, + }) + if err != nil { + return errors.NewE(err) + } + return nil +} + +func (r *commsSvc) SendAccountMemberInviteEmail(ctx context.Context, input *comms.AccountMemberInviteEmailInput) (*comms.Void, error) { + plainText := new(bytes.Buffer) + args := map[string]any{ + "Name": func() string { + if input.Name != "" { + return input.Name + } + return "there" + }(), + "InvitedBy": input.InvitedBy, + "AccountName": input.AccountName, + "Link": fmt.Sprintf("%v?token=%v", r.ev.AccountsWebInviteUrl, input.InvitationToken), + } + + if err := r.accountInviteEmail.PlainText.Execute(plainText, args); err != nil { + return nil, errors.NewEf(err, "failed to execute plain-text template") + } + + html := new(bytes.Buffer) + if err := r.accountInviteEmail.Html.Execute(html, args); err != nil { + return nil, errors.NewEf(err, "failed to execute html template") + } + + if err := r.sendSupportEmail(ctx, r.accountInviteEmail.Subject, input.Email, input.Name, plainText.String(), html.String()); err != nil { + return nil, errors.NewE(err) + } + return &comms.Void{}, nil +} + +func (r *commsSvc) SendProjectMemberInviteEmail(ctx context.Context, input *comms.ProjectMemberInviteEmailInput) (*comms.Void, error) { + plainText := new(bytes.Buffer) + args := map[string]any{ + "Name": func() string { + if input.Name != "" { + return input.Name + } + return "there" + }(), + "InvitedBy": input.InvitedBy, + "AccountName": input.ProjectName, + "Link": fmt.Sprintf("%v?token=%v", r.ev.ProjectsWebInviteUrl, input.InvitationToken), + } + + if err := r.projectInviteEmail.PlainText.Execute(plainText, args); err != nil { + return nil, errors.NewEf(err, "failed to execute plain-text template") + } + + html := new(bytes.Buffer) + if err := r.projectInviteEmail.Html.Execute(html, args); err != nil { + return nil, errors.NewEf(err, "failed to execute html template") + } + + if err := r.sendSupportEmail(ctx, r.projectInviteEmail.Subject, input.Email, input.Name, plainText.String(), html.String()); err != nil { + return nil, errors.NewE(err) + } + + return &comms.Void{}, nil +} + +func (r *commsSvc) SendPasswordResetEmail(ctx context.Context, input *comms.PasswordResetEmailInput) (*comms.Void, error) { + plainText := new(bytes.Buffer) + args := map[string]any{ + "Name": func() string { + if input.Name != "" { + return input.Name + } + return "there" + }(), + "Link": fmt.Sprintf("%v?token=%v", r.ev.ResetPasswordWebUrl, input.ResetToken), + } + + if err := r.resetPasswordEmail.PlainText.Execute(plainText, args); err != nil { + return nil, errors.NewEf(err, "failed to execute plain text template") + } + + html := new(bytes.Buffer) + if err := r.resetPasswordEmail.Html.Execute(html, args); err != nil { + return nil, errors.NewEf(err, "failed to execute html template") + } + + if err := r.sendSupportEmail(ctx, r.resetPasswordEmail.Subject, input.Email, input.Name, plainText.String(), html.String()); err != nil { + return nil, errors.NewE(err) + } + + return &comms.Void{}, nil +} + +func (r *commsSvc) SendWelcomeEmail(ctx context.Context, input *comms.WelcomeEmailInput) (*comms.Void, error) { + plainText := new(bytes.Buffer) + args := map[string]any{ + "Name": func() string { + if input.Name != "" { + return input.Name + } + return "there" + }(), + } + + if err := r.welcomeEmail.PlainText.Execute(plainText, args); err != nil { + return nil, errors.NewEf(err, "failed to execute plain text template") + } + + html := new(bytes.Buffer) + if err := r.welcomeEmail.Html.Execute(html, args); err != nil { + return nil, errors.NewEf(err, "failed to execute html template") + } + + if err := r.sendSupportEmail(ctx, r.welcomeEmail.Subject, input.Email, input.Name, plainText.String(), html.String()); err != nil { + return nil, errors.NewE(err) + } + + return &comms.Void{}, nil +} + +func (r *commsSvc) SendVerificationEmail(ctx context.Context, input *comms.VerificationEmailInput) (*comms.Void, error) { + plainText := new(bytes.Buffer) + args := map[string]any{ + "Name": func() string { + if input.Name != "" { + return input.Name + } + return "there" + }(), + "Link": fmt.Sprintf("%v?token=%v", r.ev.VerifyEmailWebUrl, input.VerificationToken), + } + + if err := r.userVerificationEmail.PlainText.Execute(plainText, args); err != nil { + return nil, errors.NewEf(err, "failed to execute plain text template") + } + + html := new(bytes.Buffer) + if err := r.userVerificationEmail.Html.Execute(html, args); err != nil { + return nil, errors.NewEf(err, "failed to execute html template") + } + + if err := r.sendSupportEmail(ctx, r.userVerificationEmail.Subject, input.Email, input.Name, plainText.String(), html.String()); err != nil { + return nil, errors.NewE(err) + } + return &comms.Void{}, nil +} +func newCommsSvc(mailer mail.Mailer, ev *env.Env, ai AccountInviteEmail, pi ProjectInviteEmail, rp RestPasswordEmail, uv UserVerificationEmail, wl WelcomeEmail) comms.CommsServer { + return &commsSvc{ + mailer: mailer, + supportEmail: ev.SupportEmail, + ev: ev, + accountInviteEmail: ai, + projectInviteEmail: pi, + resetPasswordEmail: rp, + userVerificationEmail: uv, + welcomeEmail: wl, + } +} diff --git a/apps/comms/internal/app/mails.go b/apps/comms/internal/app/mails.go deleted file mode 100644 index ba98fddd1..000000000 --- a/apps/comms/internal/app/mails.go +++ /dev/null @@ -1,144 +0,0 @@ -package app - -import ( - "bytes" - "embed" - "fmt" - "io/ioutil" - "text/template" - - "gopkg.in/yaml.v2" -) - -type email struct { - Subject string `json:"subject,omitempty" yaml:"subject,omitempty"` - PlainText string `json:"plain,omitempty" yaml:"plain,omitempty"` - HTMLText string `json:"html,omitempty" yaml:"html,omitempty"` -} - -type EmailTemplatesDir struct { - embed.FS -} - -func (r *rpcImpl) loadEmailFromYaml(templateName string, params any) (*email, error) { - - file, err := r.emailTemplatesDir.ReadFile(fmt.Sprintf("email-templates/%v/email.yaml", templateName)) - // file, err := ioutil.ReadFile(fmt.Sprintf("email-templates/%v/email.yaml", templateName)) - // htmlFile, err := ioutil.ReadFile(fmt.Sprintf("email-templates/%v/email.html", templateName)) - htmlFile, err := r.emailTemplatesDir.ReadFile(fmt.Sprintf("email-templates/%v/email.html", templateName)) - if err != nil { - return nil, err - } - parse, err := template.New("email-template").Parse(string(file)) - parseHtml, err := template.New("email-html").Parse(string(htmlFile)) - if err != nil { - return nil, err - } - var emailBuffer bytes.Buffer - var htmlBuffer bytes.Buffer - err = parse.Execute(&emailBuffer, params) - err = parseHtml.Execute(&htmlBuffer, params) - if err != nil { - return nil, err - } - var email email - parsedEmail, err := ioutil.ReadAll(&emailBuffer) - if err != nil { - return nil, err - } - err = yaml.Unmarshal(parsedEmail, &email) - email.HTMLText = string(htmlBuffer.Bytes()) - if err != nil { - return nil, err - } - return &email, nil -} - -func (r *rpcImpl) constructVerificationEmail(name string, token string, emailLinksBaseUrl string) (subject string, plainText string, htmlContent string, err error) { - email, err := r.loadEmailFromYaml("user-verification", struct { - Name string - Link string - }{ - Name: name, - Link: fmt.Sprintf("%v/verify-email/?token=%v", emailLinksBaseUrl, token), - }) - if err != nil { - return - } - subject = email.Subject - plainText = email.PlainText - htmlContent = email.HTMLText - return -} - -func (r *rpcImpl) constructResetPasswordEmail(name string, token string, baseUrl string) (subject string, plainText string, htmlContent string, err error) { - email, err := r.loadEmailFromYaml("reset-password", struct { - Name string - Link string - }{ - Name: name, - Link: fmt.Sprintf("%v/reset-password/?token=%v", baseUrl, token), - }) - if err != nil { - return - } - subject = email.Subject - plainText = email.PlainText - htmlContent = email.HTMLText - return -} - -func (r *rpcImpl) constructWelcomeEmail(name string) (subject string, plainText string, htmlContent string, err error) { - email, err := r.loadEmailFromYaml("welcome", struct { - Name string - }{ - Name: name, - }) - if err != nil { - return - } - subject = email.Subject - plainText = email.PlainText - htmlContent = email.HTMLText - return -} - -func (r *rpcImpl) constructAccountInvitationEmail(name string, accountName string, invitationToken string, baseUrl string) (subject string, plainText string, htmlContent string, err error) { - email, err := r.loadEmailFromYaml("account-invite", struct { - Name string - Link string - AccountName string - }{ - Name: name, - Link: fmt.Sprintf("%v/invite-callback/?token=%v", baseUrl, invitationToken), - AccountName: accountName, - }) - fmt.Sprintf("%v/invite-callback/?token=%v", baseUrl, invitationToken) - if err != nil { - return - } - subject = email.Subject - plainText = email.PlainText - htmlContent = email.HTMLText - return -} - -func (r *rpcImpl) constructProjectInvitationEmail(name string, projectName string, invitationToken string, baseUrl string) (subject string, plainText string, htmlContent string, err error) { - email, err := r.loadEmailFromYaml("project-invite", struct { - Name string - Link string - ProjectName string - }{ - Name: name, - Link: fmt.Sprintf("%v/invite-callback/?token=%v", baseUrl, invitationToken), - ProjectName: projectName, - }) - fmt.Sprintf("%v/invite-callback/?token=%v", baseUrl, invitationToken) - if err != nil { - return - } - subject = email.Subject - plainText = email.PlainText - htmlContent = email.HTMLText - return -} diff --git a/apps/comms/internal/app/main.go b/apps/comms/internal/app/main.go deleted file mode 100644 index 393c6a067..000000000 --- a/apps/comms/internal/app/main.go +++ /dev/null @@ -1,21 +0,0 @@ -package app - -import ( - "go.uber.org/fx" - "google.golang.org/grpc" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/comms" - "kloudlite.io/pkg/config" -) - -type Env struct { - SupportEmail string `env:"SUPPORT_EMAIL"` - EmailsBaseUrl string `env:"EMAIL_LINKS_BASE_URL"` -} - -var Module = fx.Module("app", - config.EnvFx[Env](), - fx.Provide(fxRPCServer), - fx.Invoke(func(server *grpc.Server, commsServer comms.CommsServer) { - comms.RegisterCommsServer(server, commsServer) - }), -) diff --git a/apps/comms/internal/app/rpc-server.go b/apps/comms/internal/app/rpc-server.go deleted file mode 100644 index 7c068d312..000000000 --- a/apps/comms/internal/app/rpc-server.go +++ /dev/null @@ -1,115 +0,0 @@ -package app - -import ( - "context" - - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/comms" - "kloudlite.io/pkg/mail" -) - -type rpcImpl struct { - comms.UnimplementedCommsServer - mailer mail.Mailer - supportEmail string - emailLinksBaseUrl string - emailTemplatesDir EmailTemplatesDir -} - -func (r *rpcImpl) sendSupportEmail( - subject string, - email string, - name string, - plainText string, - htmlContent string, -) error { - err := r.mailer.SendEmail( - r.supportEmail, - "Support", - subject, - email, - name, - plainText, - htmlContent, - ) - if err != nil { - return err - } - return nil -} - -func (r *rpcImpl) SendAccountMemberInviteEmail(ctx context.Context, input *comms.AccountMemberInviteEmailInput) (*comms.Void, error) { - subject, plainText, htmlContent, err := r.constructAccountInvitationEmail( - input.Name, input.AccountName, input.InvitationToken, r.emailLinksBaseUrl, - ) - if err != nil { - return nil, err - } - err = r.sendSupportEmail(subject, input.Email, input.Name, plainText, htmlContent) - if err != nil { - return nil, err - } - return &comms.Void{}, nil -} - -func (r *rpcImpl) SendProjectMemberInviteEmail(ctx context.Context, input *comms.ProjectMemberInviteEmailInput) (*comms.Void, error) { - subject, plainText, htmlContent, err := r.constructProjectInvitationEmail( - input.Name, input.ProjectName, input.InvitationToken, r.emailLinksBaseUrl, - ) - if err != nil { - return nil, err - } - err = r.sendSupportEmail(subject, input.Email, input.Name, plainText, htmlContent) - if err != nil { - return nil, err - } - return &comms.Void{}, nil -} - -func (r *rpcImpl) SendPasswordResetEmail(_ context.Context, input *comms.PasswordResetEmailInput) (*comms.Void, error) { - subject, plainText, htmlContent, err := r.constructResetPasswordEmail(input.Name, input.ResetToken, r.emailLinksBaseUrl) - if err != nil { - return nil, err - } - err = r.sendSupportEmail(subject, input.Email, input.Name, plainText, htmlContent) - if err != nil { - return nil, err - } - return &comms.Void{}, nil -} - -func (r *rpcImpl) SendWelcomeEmail(ctx context.Context, input *comms.WelcomeEmailInput) (*comms.Void, error) { - subject, plainText, htmlContent, err := r.constructWelcomeEmail(input.Name) - if err != nil { - return nil, err - } - err = r.sendSupportEmail(subject, input.Email, input.Name, plainText, htmlContent) - if err != nil { - return nil, err - } - return &comms.Void{}, nil -} - -func (r *rpcImpl) SendVerificationEmail(_ context.Context, input *comms.VerificationEmailInput) (*comms.Void, error) { - subject, plainText, htmlContent, err := r.constructVerificationEmail( - input.Name, - input.VerificationToken, - r.emailLinksBaseUrl, - ) - if err != nil { - return nil, err - } - err = r.sendSupportEmail(subject, input.Email, input.Name, plainText, htmlContent) - if err != nil { - return nil, err - } - return &comms.Void{}, nil -} - -func fxRPCServer(mailer mail.Mailer, env *Env, templatesDir EmailTemplatesDir) comms.CommsServer { - return &rpcImpl{ - mailer: mailer, - supportEmail: env.SupportEmail, - emailLinksBaseUrl: env.EmailsBaseUrl, - emailTemplatesDir: templatesDir, - } -} diff --git a/apps/comms/internal/env/env.go b/apps/comms/internal/env/env.go new file mode 100644 index 000000000..4fddf1497 --- /dev/null +++ b/apps/comms/internal/env/env.go @@ -0,0 +1,27 @@ +package env + +import ( + "github.com/codingconcepts/env" + "github.com/kloudlite/api/pkg/errors" +) + +type Env struct { + SupportEmail string `env:"SUPPORT_EMAIL" required:"true"` + SendgridApiKey string `env:"SENDGRID_API_KEY" required:"true"` + GrpcPort uint16 `env:"GRPC_PORT" required:"true"` + + AccountsWebInviteUrl string `env:"ACCOUNTS_WEB_INVITE_URL" required:"true"` + ProjectsWebInviteUrl string `env:"PROJECTS_WEB_INVITE_URL" required:"true"` + KloudliteConsoleWebUrl string `env:"KLOUDLITE_CONSOLE_WEB_URL" required:"true"` + + ResetPasswordWebUrl string `env:"RESET_PASSWORD_WEB_URL" required:"true"` + VerifyEmailWebUrl string `env:"VERIFY_EMAIL_WEB_URL" required:"true"` +} + +func LoadEnv() (*Env, error) { + var ev Env + if err := env.Set(&ev); err != nil { + return nil, errors.NewE(err) + } + return &ev, nil +} diff --git a/apps/comms/internal/framework/framework.go b/apps/comms/internal/framework/framework.go new file mode 100644 index 000000000..23c466da2 --- /dev/null +++ b/apps/comms/internal/framework/framework.go @@ -0,0 +1,60 @@ +package framework + +import ( + "context" + "fmt" + "github.com/kloudlite/api/apps/comms/internal/app" + "github.com/kloudlite/api/apps/comms/internal/env" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/grpc" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/api/pkg/mail" + "go.uber.org/fx" + "time" +) + +var Module = fx.Module( + "framework", + + fx.Provide(func(ev *env.Env) mail.Mailer { + return mail.NewSendgridMailer(ev.SendgridApiKey) + }), + + fx.Provide(func(logger logging.Logger) (app.CommsGrpcServer, error) { + return grpc.NewGrpcServer(grpc.ServerOpts{Logger: logger}) + }), + + app.Module, + + fx.Invoke(func(lf fx.Lifecycle, server app.CommsGrpcServer, ev *env.Env, logger logging.Logger) { + lf.Append(fx.Hook{ + OnStart: func(ctx context.Context) error { + errCh := make(chan error, 1) + + tctx, cf := context.WithTimeout(ctx, 2*time.Second) + defer cf() + + go func() { + err := server.Listen(fmt.Sprintf(":%d", ev.GrpcPort)) + if err != nil { + errCh <- err + logger.Errorf(err, "failed to start grpc server") + } + }() + + select { + case <-tctx.Done(): + case err := <-errCh: + return errors.NewE(err) + } + + return nil + }, + + OnStop: func(context.Context) error { + server.Stop() + return nil + }, + }) + }), +) diff --git a/apps/comms/internal/framework/main.go b/apps/comms/internal/framework/main.go deleted file mode 100644 index 8bbc08946..000000000 --- a/apps/comms/internal/framework/main.go +++ /dev/null @@ -1,30 +0,0 @@ -package framework - -import ( - "go.uber.org/fx" - "kloudlite.io/apps/comms/internal/app" - "kloudlite.io/pkg/config" - rpc "kloudlite.io/pkg/grpc" - "kloudlite.io/pkg/mail" -) - -type Env struct { - SendGridKey string `env:"SENDGRID_API_KEY" required:"true"` - GrpcPort uint16 `env:"GRPC_PORT" required:"true"` -} - -func (e *Env) GetSendGridApiKey() string { - return e.SendGridKey -} - -func (e *Env) GetGRPCPort() uint16 { - return e.GrpcPort -} - -var Module = fx.Module( - "framework", - config.EnvFx[Env](), - rpc.NewGrpcServerFx[*Env](), - mail.NewSendGridMailerFx[*Env](), - app.Module, -) diff --git a/apps/comms/main.go b/apps/comms/main.go index 87dbf01b7..c808af88a 100644 --- a/apps/comms/main.go +++ b/apps/comms/main.go @@ -1,39 +1,60 @@ package main import ( + "context" "embed" "flag" + "os" + "time" + "github.com/kloudlite/api/apps/comms/internal/app" + "github.com/kloudlite/api/apps/comms/internal/env" + "github.com/kloudlite/api/apps/comms/internal/framework" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/logging" "go.uber.org/fx" - "kloudlite.io/apps/comms/internal/app" - "kloudlite.io/apps/comms/internal/framework" - fn "kloudlite.io/pkg/functions" - "kloudlite.io/pkg/logging" ) -var ( - //go:embed email-templates - EmailTemplatesDir embed.FS -) +//go:embed email-templates +var EmailTemplatesDir embed.FS func main() { var isDev bool flag.BoolVar(&isDev, "dev", false, "--dev") flag.Parse() - fx.New( + logger, err := logging.New(&logging.Options{Name: "comms", Dev: isDev}) + if err != nil { + panic(err) + } + + webApp := fx.New( fx.NopLogger, fx.Provide( - func() (logging.Logger, error) { - return logging.New(&logging.Options{Name: "comms", Dev: isDev}) + func() logging.Logger { + return logger }, ), - fn.FxErrorHandler(), + fx.Provide(func() (*env.Env, error) { + return env.LoadEnv() + }), fx.Provide(func() app.EmailTemplatesDir { return app.EmailTemplatesDir{ FS: EmailTemplatesDir, } }), framework.Module, - ).Run() + ) + + ctx, cf := context.WithTimeout(context.Background(), 5*time.Second) + defer cf() + + if err := webApp.Start(ctx); err != nil { + logger.Errorf(err, "comms-api startup errors") + logger.Infof("EXITING as errors encountered during startup") + os.Exit(1) + } + + common.PrintReadyBanner() + <-webApp.Done() } diff --git a/apps/console/Containerfile.local b/apps/console/Containerfile.local new file mode 100644 index 000000000..f989f68fd --- /dev/null +++ b/apps/console/Containerfile.local @@ -0,0 +1,6 @@ +#syntax=docker/dockerfile:1 +FROM gcr.io/distroless/static-debian11:nonroot +WORKDIR /app +ARG APP +COPY --from=local-builder --chown=1001 $APP ./console +ENTRYPOINT ["./console"] diff --git a/apps/console/Dockerfile b/apps/console/Dockerfile index 3a7ff4ed4..f9e277e55 100644 --- a/apps/console/Dockerfile +++ b/apps/console/Dockerfile @@ -13,10 +13,10 @@ ARG APP RUN mkdir -p ./apps/$APP WORKDIR /tmp/app/apps/$APP COPY --chown=1001 ./ ./ -RUN CGO_ENABLED=0 go build -tags musl -o /tmp/bin/$APP ./main.go +RUN CGO_ENABLED=0 go build -o /tmp/bin/$APP ./main.go RUN chmod +x /tmp/bin/$APP -FROM gcr.io/distroless/static-debian11 +FROM gcr.io/distroless/static-debian11:nonroot ARG APP -COPY --from=base --chown=1001 /tmp/bin/$APP /console-api -CMD ["/console"] +COPY --from=base --chown=1001 /tmp/bin/$APP ./console +CMD ["./console"] diff --git a/apps/console/Taskfile.yml b/apps/console/Taskfile.yml index 72262a02e..c2c668b7c 100644 --- a/apps/console/Taskfile.yml +++ b/apps/console/Taskfile.yml @@ -3,88 +3,90 @@ version: "3" dotenv: - .secrets/env +vars: + ImagePrefix: "ghcr.io/kloudlite/api" + tasks: gql: dir: ./internal/app cmds: - - go run -tags dynamic github.com/99designs/gqlgen generate - - rm ./graph/scalars.resolvers.go + - go run github.com/99designs/gqlgen generate + - gofmt -w -d -r '"errors" -> "github.com/kloudlite/api/pkg/errors"' graph/*.resolvers.go + build: env: CGO_ENABLED: 0 + GOOS: linux + GOARCH: amd64 + vars: + BuiltAt: + sh: date | sed 's/\s/_/g' preconditions: - sh: '[ -n "{{.Out}}" ]' msg: var Out must have a value cmds: - - go build -ldflags="-s -w" -o {{.Out}} + - go generate ./internal/entities/field-constants/ + - go build -ldflags="-s -w -X github.com/kloudlite/api/common.BuiltAt=\"{{.BuiltAt}}\"" -o {{.Out}} - upx {{.Out}} k8s-schema: cmds: - - mkdir -p "./internal/app/graph/crd-to-gql" - - go run ../../cmd/crd-to-gql --dev - --output "./internal/app/graph/crd-to-gql" - --crd Project=projects.crds.kloudlite.io - --crd Workspace=envs.crds.kloudlite.io - --crd App=apps.crds.kloudlite.io - --crd Secret=secrets.crds.kloudlite.io - --crd Config=configs.crds.kloudlite.io - --crd Secret=secrets.crds.kloudlite.io - --crd Router=routers.crds.kloudlite.io - --crd ManagedService=managedservices.crds.kloudlite.io - --crd ManagedResource=managedresources.crds.kloudlite.io + - mkdir -p "./internal/app/_struct-to-graphql" + - go run ../../cmd/struct-to-graphql + --struct github.com/kloudlite/api/apps/console/internal/entities.Project + --struct github.com/kloudlite/api/apps/console/internal/entities.Environment + --struct github.com/kloudlite/api/apps/console/internal/entities.App + --struct github.com/kloudlite/api/apps/console/internal/entities.Secret + --struct github.com/kloudlite/api/apps/console/internal/entities.Config + --struct github.com/kloudlite/api/apps/console/internal/entities.ConsoleVPNDevice + --struct github.com/kloudlite/operator/apis/wireguard/v1.Port + --struct github.com/kloudlite/api/apps/console/internal/domain.ConfigKeyRef + --struct github.com/kloudlite/api/apps/console/internal/domain.ConfigKeyValueRef + --struct github.com/kloudlite/api/apps/console/internal/domain.SecretKeyRef + --struct github.com/kloudlite/api/apps/console/internal/domain.SecretKeyValueRef + --struct github.com/kloudlite/api/apps/console/internal/domain.ManagedResourceKeyRef + --struct github.com/kloudlite/api/apps/console/internal/domain.ManagedResourceKeyValueRef + --struct github.com/kloudlite/api/apps/console/internal/entities.Router + --struct github.com/kloudlite/api/apps/console/internal/entities.ManagedResource + --struct github.com/kloudlite/api/apps/console/internal/entities.ImagePullSecret + --struct github.com/kloudlite/api/apps/console/internal/entities.ProjectManagedService + --struct github.com/kloudlite/api/pkg/repos.MatchFilter + --struct github.com/kloudlite/api/pkg/repos.CursorPagination + > ./internal/app/_struct-to-graphql/main.go + - |+ + pushd ./internal/app/_struct-to-graphql + go run main.go --dev --out-dir ../graph/struct-to-graphql --with-pagination Project,Environment,App,Secret,Config,Router,ManagedResource,ProjectManagedService,ImagePullSecret,ConsoleVPNDevice + popd + - rm -rf ./internal/app/_struct-to-graphql docker-build: vars: APP: console - IMAGE: registry.kloudlite.io/kloudlite/{{.EnvName}}/{{.APP}}-api:{{.Tag}} + IMAGE: "{{.ImagePrefix}}/{{.APP}}:{{.Tag}}" preconditions: - sh: '[[ -n "{{.Tag}}" ]]' msg: 'var Tag must have a value' - - - sh: '[[ "{{.EnvName}}" == "development" ]] || [[ "{{.EnvName}}" == "staging" ]] || [[ "{{.EnvName}}" == "production" ]]' - msg: 'var EnvName must have one of [development, staging, production] as its value' cmds: - docker buildx build -f ./Dockerfile -t {{.IMAGE}} . --build-arg APP={{.APP}} --platform linux/amd64 --build-context project-root=../.. - docker push {{.IMAGE}} - local-build: - preconditions: - - sh: '[ -n "{{.EnvName}}" ]' - msg: 'var EnvName must have a value' - - sh: '[ -n "{{.Tag}}" ]' - msg: 'var Tag must have a value' vars: APP: console - IMAGE: registry.kloudlite.io/kloudlite/{{.EnvName}}/{{.APP}}-api:{{.Tag}} - env: - CGO_ENABLED: 0 - GOOS: linux - GOARCH: amd64 + IMAGE: "{{.ImagePrefix}}/{{.APP}}:{{.Tag}}" + preconditions: + - sh: '[[ -n "{{.Tag}}" ]]' + msg: 'var Tag must have a value' silent: true cmds: - |+ - lineNumbers=$(cat Dockerfile | grep -i '^FROM' -n | tail +2 | awk -F: '{print $1}') - - startLineNo=$(echo "$lineNumbers" | head -n+1) - finalLineNo=$(echo "$lineNumbers" | tail -1) - - tDir=$(mktemp -d) - - nDockerfile=$(cat Dockerfile | tail --lines=+$startLineNo | grep -i --invert-match 'from=base') - echo "$nDockerfile" | sed "1 i # syntax=docker/dockerfile:1.4" > $tDir/Dockerfile.base - - cat $tDir/Dockerfile.base | sed "4 i COPY --from=local-builder ./{{.APP}} /{{.APP}}" > $tDir/Dockerfile - cat $tDir/Dockerfile - - echo "building application ..." - task build Out=$tDir/{{.APP}} + tdir=$(mktemp -d) + task build Out=$tdir/{{.APP}} - docker buildx build -f $tDir/Dockerfile -t {{.IMAGE}} . --build-context local-builder=${tDir} - docker push {{.IMAGE}} - rm -rf $tDir + podman buildx build -f ./Containerfile.local -t {{.IMAGE}} . --build-context local-builder=${tdir} --build-arg APP="{{.APP}}" + podman push {{.IMAGE}} + rm -rf $tdir run: vars: @@ -94,6 +96,4 @@ tasks: env: CGO_ENABLED: 0 cmds: - - go build -o /tmp/{{.Name}} ./main.go - # - dlv exec -l 127.0.0.1:31117 --headless /tmp/console -- --dev - - /tmp/{{.Name}} --dev + - go run ./main.go --dev diff --git a/apps/console/internal/app/adapter-resource-update-publish.go b/apps/console/internal/app/adapter-resource-update-publish.go new file mode 100644 index 000000000..b230c0615 --- /dev/null +++ b/apps/console/internal/app/adapter-resource-update-publish.go @@ -0,0 +1,38 @@ +package app + +import ( + "fmt" + + "github.com/kloudlite/api/apps/console/internal/domain" + "github.com/kloudlite/api/apps/console/internal/entities" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/api/pkg/nats" +) + +type ResourceEventPublisherImpl struct { + cli *nats.Client + logger logging.Logger +} + +func (r *ResourceEventPublisherImpl) PublishConsoleEvent(ctx domain.ConsoleContext, resourceType entities.ResourceType, name string, update domain.PublishMsg) { + subject := fmt.Sprintf("res-updates.account.%s.resourceType.%s.%s", ctx.AccountName, resourceType, name) + r.publish(subject, update) +} + +func (r *ResourceEventPublisherImpl) PublishResourceEvent(ctx domain.ResourceContext, resourceType entities.ResourceType, name string, update domain.PublishMsg) { + subject := fmt.Sprintf("res-updates.account.%s.project.%s.%s.%s", ctx.AccountName, ctx.ProjectName, resourceType, name) + r.publish(subject, update) +} + +func (r *ResourceEventPublisherImpl) publish(subject string, msg domain.PublishMsg) { + if err := r.cli.Conn.Publish(subject, []byte(msg)); err != nil { + r.logger.Errorf(err, "failed to publish message to subject %q", subject) + } +} + +func NewResourceEventPublisher(cli *nats.Client, logger logging.Logger) domain.ResourceEventPublisher { + return &ResourceEventPublisherImpl{ + cli, + logger, + } +} diff --git a/apps/console/internal/app/app.go b/apps/console/internal/app/app.go index 672f73d9e..c2f8f0d06 100644 --- a/apps/console/internal/app/app.go +++ b/apps/console/internal/app/app.go @@ -2,77 +2,181 @@ package app import ( "context" - "fmt" + "net/http" + "strconv" + "time" + + "github.com/kloudlite/api/pkg/errors" "github.com/99designs/gqlgen/graphql" "github.com/gofiber/fiber/v2" "go.uber.org/fx" - "google.golang.org/grpc" - - "kloudlite.io/apps/console/internal/app/graph" - "kloudlite.io/apps/console/internal/app/graph/generated" - domain "kloudlite.io/apps/console/internal/domain" - "kloudlite.io/apps/console/internal/domain/entities" - "kloudlite.io/apps/console/internal/env" - "kloudlite.io/common" - "kloudlite.io/constants" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/iam" - "kloudlite.io/pkg/cache" - httpServer "kloudlite.io/pkg/http-server" - "kloudlite.io/pkg/logging" - "kloudlite.io/pkg/redpanda" - "kloudlite.io/pkg/repos" + + "github.com/kloudlite/api/apps/console/internal/app/graph" + "github.com/kloudlite/api/apps/console/internal/app/graph/generated" + "github.com/kloudlite/api/apps/console/internal/domain" + "github.com/kloudlite/api/apps/console/internal/entities" + "github.com/kloudlite/api/apps/console/internal/env" + iamT "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/constants" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/infra" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/grpc" + httpServer "github.com/kloudlite/api/pkg/http-server" + "github.com/kloudlite/api/pkg/kv" + "github.com/kloudlite/api/pkg/logging" + msg_nats "github.com/kloudlite/api/pkg/messaging/nats" + "github.com/kloudlite/api/pkg/nats" + "github.com/kloudlite/api/pkg/repos" +) + +type ( + IAMGrpcClient grpc.Client + InfraClient grpc.Client + LogsAndMetricsHttpServer httpServer.Server ) -type AuthCacheClient cache.Client +func toConsoleContext(requestCtx context.Context, accountCookieName string) (domain.ConsoleContext, error) { + sess := httpServer.GetSession[*common.AuthSession](requestCtx) + if sess == nil { + return domain.ConsoleContext{}, fiber.ErrUnauthorized + } + m := httpServer.GetHttpCookies(requestCtx) + klAccount := m[accountCookieName] + if klAccount == "" { + return domain.ConsoleContext{}, errors.Newf("no cookie named '%s' present in request", accountCookieName) + } -type IAMGrpcClient *grpc.ClientConn + return domain.NewConsoleContext(requestCtx, sess.UserId, klAccount), nil +} var Module = fx.Module("app", repos.NewFxMongoRepo[*entities.Project]("projects", "prj", entities.ProjectIndexes), - repos.NewFxMongoRepo[*entities.Workspace]("workspaces", "ws", entities.WorkspaceIndexes), + repos.NewFxMongoRepo[*entities.ProjectManagedService]("project_managed_service", "pmsvc", entities.ProjectManagedServiceIndices), + repos.NewFxMongoRepo[*entities.Environment]("environments", "env", entities.EnvironmentIndexes), repos.NewFxMongoRepo[*entities.App]("apps", "app", entities.AppIndexes), repos.NewFxMongoRepo[*entities.Config]("configs", "cfg", entities.ConfigIndexes), repos.NewFxMongoRepo[*entities.Secret]("secrets", "scrt", entities.SecretIndexes), - repos.NewFxMongoRepo[*entities.MRes]("managed_resources", "mres", entities.MresIndexes), - repos.NewFxMongoRepo[*entities.MSvc]("managed_services", "msvc", entities.MsvcIndexes), + repos.NewFxMongoRepo[*entities.ManagedResource]("managed_resources", "mres", entities.MresIndexes), repos.NewFxMongoRepo[*entities.Router]("routers", "rt", entities.RouterIndexes), + repos.NewFxMongoRepo[*entities.ImagePullSecret]("image_pull_secrets", "ips", entities.ImagePullSecretIndexes), + repos.NewFxMongoRepo[*entities.ResourceMapping]("resource_mappings", "rmap", entities.ResourceMappingIndices), + repos.NewFxMongoRepo[*entities.ConsoleVPNDevice]("vpn_devices", "devs", entities.VPNDeviceIndexes), + fx.Provide( + func(conn IAMGrpcClient) iam.IAMClient { + return iam.NewIAMClient(conn) + }, + ), + + // streaming logs fx.Invoke( - func( - server *fiber.App, - d domain.Domain, - cacheClient AuthCacheClient, - ev *env.Env, + func(logAndMetricsServer LogsAndMetricsHttpServer, ev *env.Env, sessionRepo kv.Repo[*common.AuthSession], iamCli iam.IAMClient, ) { + a := logAndMetricsServer.Raw() + + a.Use( + httpServer.NewSessionMiddleware( + sessionRepo, + constants.CookieName, + ev.CookieDomain, + constants.CacheSessionPrefix, + ), + ) + + a.Get("/observability/metrics/:metric_type", func(c *fiber.Ctx) error { + cc, err := toConsoleContext(c.Context(), ev.AccountCookieName) + if err != nil { + return errors.NewE(err) + } + + clusterName := c.Query("cluster_name") + if clusterName == "" { + return errors.New("query param (cluster_name) must be provided") + } + + trackingId := c.Query("tracking_id") + if trackingId == "" { + return errors.New("query param (tracking_id) must be provided") + } + + can, err := iamCli.Can(c.Context(), &iam.CanIn{ + UserId: string(cc.UserId), + ResourceRefs: []string{ + iamT.NewResourceRef(cc.AccountName, iamT.ResourceAccount, cc.AccountName), + }, + Action: string(iamT.ReadMetrics), + }) + if err != nil { + return &fiber.Error{Code: http.StatusUnauthorized, Message: errors.NewEf(err, "unauthorized to view metrics for resources belonging to account (%s)", cc.AccountName).Error()} + } + + if !can.Status { + return &fiber.Error{Code: http.StatusUnauthorized, Message: errors.NewEf(err, "unauthorized to view metrics for resources belonging to account (%s)", cc.AccountName).Error()} + } + + metricType := c.Params("metric_type") + + st := c.Query("start_time") + et := c.Query("end_time") + + var startTime *time.Time + var endTime *time.Time + + if st != "" { + st, err := strconv.ParseInt(st, 10, 64) + if err != nil { + return errors.NewE(err) + } + startTime = fn.New(time.Unix(st, 0)) + } + + if et != "" { + et, err := strconv.ParseInt(et, 10, 64) + if err != nil { + return errors.NewE(err) + } + endTime = fn.New(time.Unix(et, 0)) + } + + return queryProm(ev.PromHttpAddr, PromMetricsType(metricType), map[string]string{ + "kl_account_name": cc.AccountName, + "kl_cluster_name": clusterName, + "kl_tracking_id": trackingId, + }, startTime, endTime, c.Response().BodyWriter()) + }) + }, + ), + + fx.Invoke( + func(server httpServer.Server, d domain.Domain, sessionRepo kv.Repo[*common.AuthSession], ev *env.Env) { gqlConfig := generated.Config{Resolvers: &graph.Resolver{Domain: d}} + gqlConfig.Directives.IsLoggedIn = func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) { sess := httpServer.GetSession[*common.AuthSession](ctx) if sess == nil { return nil, fiber.ErrUnauthorized } - return next(ctx) + return next(context.WithValue(ctx, "user-session", sess)) } - gqlConfig.Directives.HasAccountAndCluster = func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) { + gqlConfig.Directives.IsLoggedInAndVerified = func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) { sess := httpServer.GetSession[*common.AuthSession](ctx) if sess == nil { return nil, fiber.ErrUnauthorized } - m := httpServer.GetHttpCookies(ctx) - klAccount := m["kloudlite-account"] - if klAccount == "" { - return nil, fmt.Errorf("no cookie named '%s' present in request", "kloudlite-account") - } - klCluster := m["kloudlite-cluster"] - if klCluster == "" { - return nil, fmt.Errorf("no cookie named '%s' present in request", "kloudlite-cluster") + if !sess.UserVerified { + return nil, &fiber.Error{ + Code: fiber.StatusForbidden, + Message: "user's email is not verified", + } } - cc := domain.NewConsoleContext(ctx, sess.UserId, klAccount, klCluster) - return next(context.WithValue(ctx, "kloudlite-ctx", cc)) + return next(context.WithValue(ctx, "user-session", sess)) } gqlConfig.Directives.HasAccount = func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) { @@ -81,21 +185,20 @@ var Module = fx.Module("app", return nil, fiber.ErrUnauthorized } m := httpServer.GetHttpCookies(ctx) - klAccount := m["kloudlite-account"] + klAccount := m[ev.AccountCookieName] if klAccount == "" { - return nil, fmt.Errorf("no cookie named %q present in request", "kloudlite-account") + return nil, errors.Newf("no cookie named %q present in request", ev.AccountCookieName) } - cc := domain.NewConsoleContext(ctx, sess.UserId, klAccount, "") - return next(context.WithValue(ctx, "kloudlite-ctx", cc)) + nctx := context.WithValue(ctx, "user-session", sess) + nctx = context.WithValue(nctx, "account-name", klAccount) + return next(nctx) } schema := generated.NewExecutableSchema(gqlConfig) - httpServer.SetupGQLServer( - server, - schema, - httpServer.NewSessionMiddleware[*common.AuthSession]( - cacheClient, + server.SetupGraphqlServer(schema, + httpServer.NewSessionMiddleware( + sessionRepo, constants.CookieName, ev.CookieDomain, constants.CacheSessionPrefix, @@ -103,30 +206,80 @@ var Module = fx.Module("app", ) }, ), - redpanda.NewProducerFx[redpanda.Client](), - fx.Provide(func(cli redpanda.Client, ev *env.Env, logger logging.Logger) (ErrorOnApplyConsumer, error) { - return redpanda.NewConsumer(cli.GetBrokerHosts(), ev.KafkaConsumerGroupId, redpanda.ConsumerOpts{ - SASLAuth: cli.GetKafkaSASLAuth(), - Logger: logger, - }, []string{ev.KafkaErrorOnApplyTopic}) + fx.Provide(func(jc *nats.JetstreamClient, logger logging.Logger) domain.MessageDispatcher { + return msg_nats.NewJetstreamProducer(jc) }), - fx.Invoke(ProcessErrorOnApply), - fx.Provide(func(cli redpanda.Client, ev *env.Env, logger logging.Logger) (ResourceUpdateConsumer, error) { - return redpanda.NewConsumer(cli.GetBrokerHosts(), ev.KafkaConsumerGroupId, redpanda.ConsumerOpts{ - SASLAuth: cli.GetKafkaSASLAuth(), - Logger: logger, - }, []string{ev.KafkaStatusUpdatesTopic}) + fx.Invoke(func(lf fx.Lifecycle, producer domain.MessageDispatcher) { + lf.Append(fx.Hook{ + OnStop: func(ctx context.Context) error { + return producer.Stop(ctx) + }, + }) }), - fx.Invoke(ProcessResourceUpdates), - fx.Provide( - func(clientConn IAMGrpcClient) iam.IAMClient { - return iam.NewIAMClient((*grpc.ClientConn)(clientConn)) + func(conn InfraClient) infra.InfraClient { + return infra.NewInfraClient(conn) }, ), + fx.Provide(func(cli *nats.Client, logger logging.Logger) domain.ResourceEventPublisher { + return NewResourceEventPublisher(cli, logger) + }), + domain.Module, + + fx.Provide(func(jc *nats.JetstreamClient, ev *env.Env, logger logging.Logger) (ErrorOnApplyConsumer, error) { + topic := common.GetPlatformClusterMessagingTopic("*", "*", common.ConsoleReceiver, common.EventErrorOnApply) + consumerName := "console:error-on-apply" + return msg_nats.NewJetstreamConsumer(context.TODO(), jc, msg_nats.JetstreamConsumerArgs{ + Stream: ev.NatsResourceSyncStream, + ConsumerConfig: msg_nats.ConsumerConfig{ + Name: consumerName, + Durable: consumerName, + Description: "this consumer reads message from a subject dedicated to errors, that occurred when the resource was applied at the agent", + FilterSubjects: []string{topic}, + }, + }) + }), + + fx.Invoke(func(lf fx.Lifecycle, consumer ErrorOnApplyConsumer, d domain.Domain, logger logging.Logger) { + lf.Append(fx.Hook{ + OnStart: func(context.Context) error { + go ProcessErrorOnApply(consumer, d, logger) + return nil + }, + OnStop: func(ctx context.Context) error { + return consumer.Stop(ctx) + }, + }) + }), + + fx.Provide(func(jc *nats.JetstreamClient, ev *env.Env, logger logging.Logger) (ResourceUpdateConsumer, error) { + topic := common.GetPlatformClusterMessagingTopic("*", "*", common.ConsoleReceiver, common.EventResourceUpdate) + + consumerName := "console:resource-updates" + return msg_nats.NewJetstreamConsumer(context.TODO(), jc, msg_nats.JetstreamConsumerArgs{ + Stream: ev.NatsResourceSyncStream, + ConsumerConfig: msg_nats.ConsumerConfig{ + Name: consumerName, + Durable: consumerName, + Description: "this consumer reads message from a subject dedicated to console resource updates from tenant clusters", + FilterSubjects: []string{topic}, + }, + }) + }), + fx.Invoke(func(lf fx.Lifecycle, consumer ResourceUpdateConsumer, d domain.Domain, logger logging.Logger) { + lf.Append(fx.Hook{ + OnStart: func(context.Context) error { + go ProcessResourceUpdates(consumer, d, logger) + return nil + }, + OnStop: func(ctx context.Context) error { + return consumer.Stop(ctx) + }, + }) + }), ) diff --git a/apps/console/internal/app/gqlgen.yml b/apps/console/internal/app/gqlgen.yml index 7fda466c8..f88ebc97e 100644 --- a/apps/console/internal/app/gqlgen.yml +++ b/apps/console/internal/app/gqlgen.yml @@ -1,7 +1,9 @@ + # Where are all the schema files located? globs are supported eg src/**/*.graphqls schema: - graph/*.graphqls - - graph/crd-to-gql/*.graphqls + # - graph/crd-to-gql/*.graphqls + - graph/struct-to-graphql/*.graphqls # Where should the generated server code go? exec: @@ -25,6 +27,8 @@ resolver: dir: graph package: graph +skip_mod_tidy: true + # Optional: turn on use ` + "`" + `gqlgen:"fieldName"` + "`" + ` tags in your models # struct_tag: json @@ -37,8 +41,8 @@ resolver: # 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: - - "kloudlite.io/pkg/errors" - # - "kloudlite.io/apps/wireguard/internal/domain/entities" + - "github.com/kloudlite/api/pkg/errors" + # - "github.com/kloudlite/api/apps/wireguard/internal/domain/entities" # This section declares type mapping between the GraphQL and go type systems # @@ -50,7 +54,7 @@ skip_validation: true models: ID: model: - - kloudlite.io/pkg/repos.ID + - github.com/kloudlite/api/pkg/repos.ID Int: model: - github.com/99designs/gqlgen/graphql.Int @@ -60,213 +64,126 @@ models: model: - github.com/99designs/gqlgen/graphql.Map - Metadata: + Metadata: &metadata-model model: k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta + MetadataIn: *metadata-model - MetadataIn: - model: k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta + Account: &account-model + model: github.com/kloudlite/api/apps/console/internal/entities.Account + AccountIn: *account-model - Project: - model: kloudlite.io/apps/console/internal/domain/entities.Project - ProjectIn: - model: kloudlite.io/apps/console/internal/domain/entities.Project + Project: &project-model + model: github.com/kloudlite/api/apps/console/internal/entities.Project + ProjectIn: *project-model - Workspace: - model: kloudlite.io/apps/console/internal/domain/entities.Workspace - WorkspaceIn: - model: kloudlite.io/apps/console/internal/domain/entities.Workspace + Environment: &environment-model + model: github.com/kloudlite/api/apps/console/internal/entities.Environment + EnvironmentIn: *environment-model - Secret: - model: - - kloudlite.io/apps/console/internal/domain/entities.Secret - SecretIn: - model: - - kloudlite.io/apps/console/internal/domain/entities.Secret + Secret: &secret-model + model: github.com/kloudlite/api/apps/console/internal/entities.Secret + SecretIn: *secret-model +# + SecretKeyRefIn: + model: github.com/kloudlite/api/apps/console/internal/domain.SecretKeyRef + + SecretKeyValueRef: + model: github.com/kloudlite/api/apps/console/internal/domain.SecretKeyValueRef + + PortIn: + model: github.com/kloudlite/operator/apis/wireguard/v1.Port + + ConsoleVPNDevice: &vpn-device-model + model: github.com/kloudlite/api/apps/console/internal/entities.ConsoleVPNDevice + ConsoleVPNDeviceIn: *vpn-device-model + + Config: &config-model + model: github.com/kloudlite/api/apps/console/internal/entities.Config + ConfigIn: *config-model + + ConfigKeyRefIn: + model: github.com/kloudlite/api/apps/console/internal/domain.ConfigKeyRef + + ConfigKeyValueRef: + model: github.com/kloudlite/api/apps/console/internal/domain.ConfigKeyValueRef + + App: &app-model + model: github.com/kloudlite/api/apps/console/internal/entities.App + AppIn: *app-model + + Router: &router-model + model: github.com/kloudlite/api/apps/console/internal/entities.Router + RouterIn: *router-model + + Patch: &patch-model + model: github.com/kloudlite/operator/pkg/json-patch.PatchOperation + PatchIn: *patch-model - Config: - model: - - kloudlite.io/apps/console/internal/domain/entities.Config - ConfigIn: - model: - - kloudlite.io/apps/console/internal/domain/entities.Config - App: - model: - - kloudlite.io/apps/console/internal/domain/entities.App - AppIn: - model: - - kloudlite.io/apps/console/internal/domain/entities.App - - # AppSpec: - # model: - # - github.com/kloudlite/operator/apis/crds/v1.AppSpec - # AppSpecIn: - # model: - # - github.com/kloudlite/operator/apis/crds/v1.AppSpec - # - # AppSpecInterception: - # model: - # - github.com/kloudlite/operator/apis/crds/v1.Interception - # - # AppSpecServices: - # fields: - # port: - # resolver: false - # targetPort: - # resolver: false - # model: - # - github.com/kloudlite/operator/apis/crds/v1.AppSvc - # AppSpecServicesIn: - # fields: - # port: - # resolver: false - # targetPort: - # resolver: false - # model: - # - github.com/kloudlite/operator/apis/crds/v1.AppSvc - # - # AppSpecHpa: - # model: - # - github.com/kloudlite/operator/apis/crds/v1.HPA - # AppSpecHpaIn: - # model: - # - github.com/kloudlite/operator/apis/crds/v1.HPA - # - # AppSpecVolumes: - # model: - # - k8s.io/api/core/v1.Volume - # AppSpecVolumesIn: - # model: - # - k8s.io/api/core/v1.Volume - # - # AppSpecTolerations: - # model: k8s.io/api/core/v1.Toleration - # AppSpecTolerationsIn: - # model: k8s.io/api/core/v1.Toleration - # - # AppSpecContainers: - # fields: - # readinessProbe: - # resolver: false - # livenessProbe: - # resolver: false - # model: - # - github.com/kloudlite/operator/apis/crds/v1.AppContainer - # AppSpecContainersIn: - # model: - # - github.com/kloudlite/operator/apis/crds/v1.AppContainer - - # AppSpecContainersResourceMemory: - # model: - # - github.com/kloudlite/operator/apis/crds/v1.ContainerResource - # AppSpecContainersResourceMemoryIn: - # model: - # - github.com/kloudlite/operator/apis/crds/v1.ContainerResource - # AppSpecContainersResourceCpu: - # model: - # - github.com/kloudlite/operator/apis/crds/v1.ContainerResource - # AppSpecContainersResourceCpuIn: - # model: - # - github.com/kloudlite/operator/apis/crds/v1.ContainerResource - # AppSpecContainersEnv: - # model: - # - github.com/kloudlite/operator/apis/crds/v1.ContainerEnv - # AppSpecContainersEnvIn: - # model: - # - github.com/kloudlite/operator/apis/crds/v1.ContainerEnv - # AppSpecContainersEnvFrom: - # model: - # - github.com/kloudlite/operator/apis/crds/v1.EnvFrom - # AppSpecContainersEnvFromIn: - # model: - # - github.com/kloudlite/operator/apis/crds/v1.EnvFrom - # - # AppSpecContainersReadinessProbe: - # model: &containerProbe - # - github.com/kloudlite/operator/apis/crds/v1.Probe - # AppSpecContainersReadinessProbeIn: - # model: *containerProbe - - # AppSpecContainersVolumes: - # model: - # - github.com/kloudlite/operator/apis/crds/v1.ContainerVolume - # AppSpecContainersVolumesIn: - # model: - # - github.com/kloudlite/operator/apis/crds/v1.ContainerVolume - # AppSpecContainersVolumesItems: - # model: &containerVolumeItem - # - github.com/kloudlite/operator/apis/crds/v1.ContainerVolumeItem - # AppSpecContainersVolumesItemsIn: - # model: *containerVolumeItem - - Router: - model: - - kloudlite.io/apps/console/internal/domain/entities.Router - RouterIn: - model: - - kloudlite.io/apps/console/internal/domain/entities.Router - # RouterSpec: - # model: - # - github.com/kloudlite/operator/apis/crds/v1.RouterSpec - # RouterSpecIn: - # model: - # - github.com/kloudlite/operator/apis/crds/v1.RouterSpec - - Patch: - model: - - github.com/kloudlite/operator/pkg/json-patch.PatchOperation - PatchIn: - model: - - github.com/kloudlite/operator/pkg/json-patch.PatchOperation Check: - model: - - github.com/kloudlite/operator/pkg/operator.Check - ManagedService: - model: - - kloudlite.io/apps/console/internal/domain/entities.MSvc - ManagedServiceIn: - model: - - kloudlite.io/apps/console/internal/domain/entities.MSvc - # ManagedServiceSpec: - # model: - # - github.com/kloudlite/operator/apis/crds/v1.ManagedServiceSpec - # ManagedServiceSpecIn: - # model: - # - github.com/kloudlite/operator/apis/crds/v1.ManagedServiceSpec - - ManagedResource: - model: kloudlite.io/apps/console/internal/domain/entities.MRes - ManagedResourceIn: - model: kloudlite.io/apps/console/internal/domain/entities.MRes - - # ManagedResourceSpec: - # model: - # - github.com/kloudlite/operator/apis/crds/v1.ManagedResourceSpec - # ManagedResourceSpecIn: - # model: - # - github.com/kloudlite/operator/apis/crds/v1.ManagedResourceSpec - - Status: - model: github.com/kloudlite/operator/pkg/operator.Status + model: github.com/kloudlite/operator/pkg/operator.Check - Overrides: - model: - - github.com/kloudlite/operator/apis/crds/v1.JsonPatch - OverridesIn: - model: - - github.com/kloudlite/operator/apis/crds/v1.JsonPatch + ManagedService: &managed-service-model + model: github.com/kloudlite/api/apps/console/internal/entities.ManagedService + ManagedServiceIn: *managed-service-model + + ProjectManagedService: &project-managed-service-model + model: github.com/kloudlite/api/apps/console/internal/entities.ProjectManagedService + ProjectManagedServiceIn: *project-managed-service-model + + ManagedResource: &managed-resource-model + model: github.com/kloudlite/api/apps/console/internal/entities.ManagedResource + ManagedResourceIn: *managed-resource-model + + ManagedResourceKeyRefIn: + model: github.com/kloudlite/api/apps/console/internal/domain.ManagedResourceKeyRef + + ManagedResourceKeyValueRef: + model: github.com/kloudlite/api/apps/console/internal/domain.ManagedResourceKeyValueRef - SyncStatus: - model: kloudlite.io/pkg/types.SyncStatus + ImagePullSecret: &image-pull-secret-model + model: github.com/kloudlite/api/apps/console/internal/entities.ImagePullSecret + ImagePullSecretIn: *image-pull-secret-model - SyncAction: - model: kloudlite.io/pkg/types.SyncAction + Overrides: &overrides-model + model: github.com/kloudlite/operator/apis/crds/v1.JsonPatch + OverridesIn: *overrides-model - SyncState: - model: kloudlite.io/pkg/types.SyncState + Github__com___kloudlite___api___pkg___types__SyncAction: + model: github.com/kloudlite/api/pkg/types.SyncAction + + Github__com___kloudlite___api___pkg___types__SyncState: + model: github.com/kloudlite/api/pkg/types.SyncState ConsoleResType: - model: kloudlite.io/apps/console/internal/domain.ResType + model: github.com/kloudlite/api/apps/console/internal/entities.ResourceType ConsoleCheckNameAvailabilityOutput: - model: kloudlite.io/apps/console/internal/domain.CheckNameAvailabilityOutput + model: github.com/kloudlite/api/apps/console/internal/domain.CheckNameAvailabilityOutput + + MatchFilter: &match-filter-model + model: github.com/kloudlite/api/pkg/repos.MatchFilter + MatchFilterIn: *match-filter-model + + MatchFilterMatchType: + model: github.com/kloudlite/api/pkg/repos.MatchType + + CursorPagination: &cursor-pagination-model + model: github.com/kloudlite/api/pkg/repos.CursorPagination + CursorPaginationIn: *cursor-pagination-model + + CursorPaginationSortDirection: &cursor-pagination-sort-direction + model: github.com/kloudlite/api/pkg/repos.SortDirection + + Github__com___kloudlite___api___common__CreatedOrUpdatedBy: + model: github.com/kloudlite/api/common.CreatedOrUpdatedBy + + Github__com___kloudlite___operator___pkg___operator__Status: + model: github.com/kloudlite/operator/pkg/operator.Status + + Github__com___kloudlite___api___pkg___types__SyncStatus: &sync-status-model + model: github.com/kloudlite/api/pkg/types.SyncStatus + Github__com___kloudlite___api___pkg___types__SyncStatusIn: *sync-status-model + + Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingMode: + model: github.com/kloudlite/operator/apis/crds/v1.EnvironmentRoutingMode diff --git a/apps/console/internal/app/graph/app.resolvers.go b/apps/console/internal/app/graph/app.resolvers.go index 8beafae0c..52f1101d6 100644 --- a/apps/console/internal/app/graph/app.resolvers.go +++ b/apps/console/internal/app/graph/app.resolvers.go @@ -6,30 +6,66 @@ package graph import ( "context" + "github.com/kloudlite/api/pkg/errors" + "time" - "kloudlite.io/apps/console/internal/app/graph/generated" - "kloudlite.io/apps/console/internal/app/graph/model" - "kloudlite.io/apps/console/internal/domain/entities" - fn "kloudlite.io/pkg/functions" + "github.com/kloudlite/api/apps/console/internal/app/graph/generated" + "github.com/kloudlite/api/apps/console/internal/app/graph/model" + "github.com/kloudlite/api/apps/console/internal/entities" + fn "github.com/kloudlite/api/pkg/functions" + "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// Spec is the resolver for the spec field. -func (r *appResolver) Spec(ctx context.Context, obj *entities.App) (*model.AppSpec, error) { - var app model.AppSpec - if err := fn.JsonConversion(obj.App.Spec, &app); err != nil { - return nil, err +// CreationTime is the resolver for the creationTime field. +func (r *appResolver) CreationTime(ctx context.Context, obj *entities.App) (string, error) { + if obj == nil { + return "", errNilApp } - return &app, nil + return obj.BaseEntity.CreationTime.Format(time.RFC3339), nil +} + +// ID is the resolver for the id field. +func (r *appResolver) ID(ctx context.Context, obj *entities.App) (string, error) { + return string(obj.Id), nil } // Spec is the resolver for the spec field. -func (r *appInResolver) Spec(ctx context.Context, obj *entities.App, data *model.AppSpecIn) error { - if err := fn.JsonConversion(*data, &obj.App.Spec); err != nil { - return err +func (r *appResolver) Spec(ctx context.Context, obj *entities.App) (*model.GithubComKloudliteOperatorApisCrdsV1AppSpec, error) { + m := model.GithubComKloudliteOperatorApisCrdsV1AppSpec{} + if err := fn.JsonConversion(obj.Spec, &m); err != nil { + return nil, errors.NewE(err) + } + return &m, nil +} + +// UpdateTime is the resolver for the updateTime field. +func (r *appResolver) UpdateTime(ctx context.Context, obj *entities.App) (string, error) { + if obj == nil { + return "", errors.Newf("obj is nil") + } + + return obj.BaseEntity.UpdateTime.Format(time.RFC3339), nil +} + +// Metadata is the resolver for the metadata field. +func (r *appInResolver) Metadata(ctx context.Context, obj *entities.App, data *v1.ObjectMeta) error { + if obj == nil { + return errNilApp + } + if data != nil { + obj.ObjectMeta = *data } return nil } +// Spec is the resolver for the spec field. +func (r *appInResolver) Spec(ctx context.Context, obj *entities.App, data *model.GithubComKloudliteOperatorApisCrdsV1AppSpecIn) error { + if obj == nil { + return errNilApp + } + return fn.JsonConversion(data, &obj.Spec) +} + // App returns generated.AppResolver implementation. func (r *Resolver) App() generated.AppResolver { return &appResolver{r} } diff --git a/apps/console/internal/app/graph/common-types.resolvers.go b/apps/console/internal/app/graph/common-types.resolvers.go new file mode 100644 index 000000000..bfb232f72 --- /dev/null +++ b/apps/console/internal/app/graph/common-types.resolvers.go @@ -0,0 +1,165 @@ +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.28 + +import ( + "context" + "fmt" + "github.com/kloudlite/api/pkg/errors" + "time" + + "github.com/kloudlite/api/apps/console/internal/app/graph/generated" + "github.com/kloudlite/api/apps/console/internal/app/graph/model" + "github.com/kloudlite/api/common" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/types" + "github.com/kloudlite/operator/pkg/operator" + "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// UserID is the resolver for the userId field. +func (r *github__com___kloudlite___api___common__CreatedOrUpdatedByResolver) UserID(ctx context.Context, obj *common.CreatedOrUpdatedBy) (string, error) { + if obj == nil { + return "", fmt.Errorf("obj is nil") + } + return string(obj.UserId), nil +} + +// LastSyncedAt is the resolver for the lastSyncedAt field. +func (r *github__com___kloudlite___api___pkg___types__SyncStatusResolver) LastSyncedAt(ctx context.Context, obj *types.SyncStatus) (*string, error) { + return fn.New(obj.LastSyncedAt.Format(time.RFC3339)), nil +} + +// SyncScheduledAt is the resolver for the syncScheduledAt field. +func (r *github__com___kloudlite___api___pkg___types__SyncStatusResolver) SyncScheduledAt(ctx context.Context, obj *types.SyncStatus) (*string, error) { + return fn.New(obj.SyncScheduledAt.Format(time.RFC3339)), nil +} + +// Checks is the resolver for the checks field. +func (r *github__com___kloudlite___operator___pkg___operator__StatusResolver) Checks(ctx context.Context, obj *operator.Status) (map[string]interface{}, error) { + if obj == nil { + return nil, errors.Newf("obj is nil") + } + var m map[string]any + if err := fn.JsonConversion(obj.Checks, &m); err != nil { + return nil, errors.NewE(err) + } + return m, nil +} + +// LastReconcileTime is the resolver for the lastReconcileTime field. +func (r *github__com___kloudlite___operator___pkg___operator__StatusResolver) LastReconcileTime(ctx context.Context, obj *operator.Status) (*string, error) { + if obj == nil { + return nil, errors.Newf("obj is nil") + } + + if obj.LastReconcileTime == nil { + return nil, nil + } + + return fn.New(obj.LastReconcileTime.Format(time.RFC3339)), nil +} + +// Message is the resolver for the message field. +func (r *github__com___kloudlite___operator___pkg___operator__StatusResolver) Message(ctx context.Context, obj *operator.Status) (*model.GithubComKloudliteOperatorPkgRawJSONRawJSON, error) { + return &model.GithubComKloudliteOperatorPkgRawJSONRawJSON{ + RawMessage: obj.Message, + }, nil +} + +// Resources is the resolver for the resources field. +func (r *github__com___kloudlite___operator___pkg___operator__StatusResolver) Resources(ctx context.Context, obj *operator.Status) ([]*model.GithubComKloudliteOperatorPkgOperatorResourceRef, error) { + var m []*model.GithubComKloudliteOperatorPkgOperatorResourceRef + if err := fn.JsonConversion(obj.Resources, &m); err != nil { + return nil, errors.NewE(err) + } + return m, nil +} + +// Annotations is the resolver for the annotations field. +func (r *metadataResolver) Annotations(ctx context.Context, obj *v1.ObjectMeta) (map[string]interface{}, error) { + var m map[string]any + if err := fn.JsonConversion(obj.Annotations, &m); err != nil { + return nil, errors.NewE(err) + } + return m, nil +} + +// CreationTimestamp is the resolver for the creationTimestamp field. +func (r *metadataResolver) CreationTimestamp(ctx context.Context, obj *v1.ObjectMeta) (string, error) { + if obj == nil { + return "", errors.Newf("metadata is nil") + } + return obj.CreationTimestamp.Format(time.RFC3339), nil +} + +// DeletionTimestamp is the resolver for the deletionTimestamp field. +func (r *metadataResolver) DeletionTimestamp(ctx context.Context, obj *v1.ObjectMeta) (*string, error) { + if obj == nil { + return nil, errors.Newf("metadata is nil") + } + + if obj.DeletionTimestamp == nil { + return nil, nil + } + + return fn.New(obj.DeletionTimestamp.Format(time.RFC3339)), nil +} + +// Labels is the resolver for the labels field. +func (r *metadataResolver) Labels(ctx context.Context, obj *v1.ObjectMeta) (map[string]interface{}, error) { + var m map[string]any + if err := fn.JsonConversion(obj.Labels, &m); err != nil { + return nil, errors.NewE(err) + } + return m, nil +} + +// Annotations is the resolver for the annotations field. +func (r *metadataInResolver) Annotations(ctx context.Context, obj *v1.ObjectMeta, data map[string]interface{}) error { + var m map[string]string + if err := fn.JsonConversion(data, &m); err != nil { + return errors.NewE(err) + } + obj.SetAnnotations(m) + return nil +} + +// Labels is the resolver for the labels field. +func (r *metadataInResolver) Labels(ctx context.Context, obj *v1.ObjectMeta, data map[string]interface{}) error { + var m map[string]string + if err := fn.JsonConversion(data, &m); err != nil { + return errors.NewE(err) + } + obj.SetLabels(m) + return nil +} + +// Github__com___kloudlite___api___common__CreatedOrUpdatedBy returns generated.Github__com___kloudlite___api___common__CreatedOrUpdatedByResolver implementation. +func (r *Resolver) Github__com___kloudlite___api___common__CreatedOrUpdatedBy() generated.Github__com___kloudlite___api___common__CreatedOrUpdatedByResolver { + return &github__com___kloudlite___api___common__CreatedOrUpdatedByResolver{r} +} + +// Github__com___kloudlite___api___pkg___types__SyncStatus returns generated.Github__com___kloudlite___api___pkg___types__SyncStatusResolver implementation. +func (r *Resolver) Github__com___kloudlite___api___pkg___types__SyncStatus() generated.Github__com___kloudlite___api___pkg___types__SyncStatusResolver { + return &github__com___kloudlite___api___pkg___types__SyncStatusResolver{r} +} + +// Github__com___kloudlite___operator___pkg___operator__Status returns generated.Github__com___kloudlite___operator___pkg___operator__StatusResolver implementation. +func (r *Resolver) Github__com___kloudlite___operator___pkg___operator__Status() generated.Github__com___kloudlite___operator___pkg___operator__StatusResolver { + return &github__com___kloudlite___operator___pkg___operator__StatusResolver{r} +} + +// Metadata returns generated.MetadataResolver implementation. +func (r *Resolver) Metadata() generated.MetadataResolver { return &metadataResolver{r} } + +// MetadataIn returns generated.MetadataInResolver implementation. +func (r *Resolver) MetadataIn() generated.MetadataInResolver { return &metadataInResolver{r} } + +type github__com___kloudlite___api___common__CreatedOrUpdatedByResolver struct{ *Resolver } +type github__com___kloudlite___api___pkg___types__SyncStatusResolver struct{ *Resolver } +type github__com___kloudlite___operator___pkg___operator__StatusResolver struct{ *Resolver } +type metadataResolver struct{ *Resolver } +type metadataInResolver struct{ *Resolver } diff --git a/apps/console/internal/app/graph/config.resolvers.go b/apps/console/internal/app/graph/config.resolvers.go index aaa276d65..db50dfb76 100644 --- a/apps/console/internal/app/graph/config.resolvers.go +++ b/apps/console/internal/app/graph/config.resolvers.go @@ -6,26 +6,92 @@ package graph import ( "context" + "github.com/kloudlite/api/pkg/errors" + "time" - "kloudlite.io/apps/console/internal/app/graph/generated" - "kloudlite.io/apps/console/internal/domain/entities" - fn "kloudlite.io/pkg/functions" + "github.com/kloudlite/api/apps/console/internal/app/graph/generated" + "github.com/kloudlite/api/apps/console/internal/entities" + fn "github.com/kloudlite/api/pkg/functions" + "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// BinaryData is the resolver for the binaryData field. +func (r *configResolver) BinaryData(ctx context.Context, obj *entities.Config) (map[string]interface{}, error) { + if obj == nil { + return nil, errNilConfig + } + var m map[string]any + if err := fn.JsonConversion(obj.Data, &m); err != nil { + return nil, errors.NewE(err) + } + return m, nil +} + +// CreationTime is the resolver for the creationTime field. +func (r *configResolver) CreationTime(ctx context.Context, obj *entities.Config) (string, error) { + if obj == nil { + return "", errNilConfig + } + return obj.BaseEntity.CreationTime.Format(time.RFC3339), nil +} + // Data is the resolver for the data field. func (r *configResolver) Data(ctx context.Context, obj *entities.Config) (map[string]interface{}, error) { + if obj == nil { + return nil, errNilConfig + } m := make(map[string]any, len(obj.Data)) if err := fn.JsonConversion(obj.Data, &m); err != nil { - return nil, err + return nil, errors.NewE(err) } return m, nil } +// ID is the resolver for the id field. +func (r *configResolver) ID(ctx context.Context, obj *entities.Config) (string, error) { + if obj == nil { + return "", errNilConfig + } + + return string(obj.Id), nil +} + +// UpdateTime is the resolver for the updateTime field. +func (r *configResolver) UpdateTime(ctx context.Context, obj *entities.Config) (string, error) { + if obj == nil { + return "", errNilConfig + } + + return obj.BaseEntity.UpdateTime.Format(time.RFC3339), nil +} + +// BinaryData is the resolver for the binaryData field. +func (r *configInResolver) BinaryData(ctx context.Context, obj *entities.Config, data map[string]interface{}) error { + if obj == nil { + return errNilConfig + } + return fn.JsonConversion(data, &obj.BinaryData) +} + // Data is the resolver for the data field. func (r *configInResolver) Data(ctx context.Context, obj *entities.Config, data map[string]interface{}) error { + if obj == nil { + return errNilConfig + } return fn.JsonConversion(data, &obj.Data) } +// Metadata is the resolver for the metadata field. +func (r *configInResolver) Metadata(ctx context.Context, obj *entities.Config, data *v1.ObjectMeta) error { + if obj == nil { + return errNilConfig + } + if data != nil { + obj.ObjectMeta = *data + } + return nil +} + // Config returns generated.ConfigResolver implementation. func (r *Resolver) Config() generated.ConfigResolver { return &configResolver{r} } diff --git a/apps/console/internal/app/graph/consolevpndevice.resolvers.go b/apps/console/internal/app/graph/consolevpndevice.resolvers.go new file mode 100644 index 000000000..1137754c8 --- /dev/null +++ b/apps/console/internal/app/graph/consolevpndevice.resolvers.go @@ -0,0 +1,107 @@ +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.28 + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + "time" + + "github.com/kloudlite/api/apps/console/internal/app/graph/generated" + "github.com/kloudlite/api/apps/console/internal/app/graph/model" + "github.com/kloudlite/api/apps/console/internal/entities" + fn "github.com/kloudlite/api/pkg/functions" + "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// CreationTime is the resolver for the creationTime field. +func (r *consoleVPNDeviceResolver) CreationTime(ctx context.Context, obj *entities.ConsoleVPNDevice) (string, error) { + if obj == nil { + return "", errNilVPNDevice + } + return obj.BaseEntity.CreationTime.Format(time.RFC3339), nil +} + +// ID is the resolver for the id field. +func (r *consoleVPNDeviceResolver) ID(ctx context.Context, obj *entities.ConsoleVPNDevice) (string, error) { + if obj == nil { + return "", errNilVPNDevice + } + return string(obj.Id), nil +} + +// Spec is the resolver for the spec field. +func (r *consoleVPNDeviceResolver) Spec(ctx context.Context, obj *entities.ConsoleVPNDevice) (*model.GithubComKloudliteOperatorApisWireguardV1DeviceSpec, error) { + if obj == nil { + return nil, errNilVPNDevice + } + + m := &model.GithubComKloudliteOperatorApisWireguardV1DeviceSpec{} + + if err := fn.JsonConversion(obj.Spec, &m); err != nil { + return nil, errors.NewE(err) + } + + return m, nil +} + +// UpdateTime is the resolver for the updateTime field. +func (r *consoleVPNDeviceResolver) UpdateTime(ctx context.Context, obj *entities.ConsoleVPNDevice) (string, error) { + if obj == nil { + return "", errNilVPNDevice + } + + return obj.BaseEntity.UpdateTime.Format(time.RFC3339), nil +} + +// WireguardConfig is the resolver for the wireguardConfig field. +func (r *consoleVPNDeviceResolver) WireguardConfig(ctx context.Context, obj *entities.ConsoleVPNDevice) (*model.GithubComKloudliteAPIPkgTypesEncodedString, error) { + if obj == nil { + return nil, errNilVPNDevice + } + + m := &model.GithubComKloudliteAPIPkgTypesEncodedString{} + + if err := fn.JsonConversion(obj.WireguardConfig, &m); err != nil { + return nil, errors.NewE(err) + } + + return m, nil +} + +// Metadata is the resolver for the metadata field. +func (r *consoleVPNDeviceInResolver) Metadata(ctx context.Context, obj *entities.ConsoleVPNDevice, data *v1.ObjectMeta) error { + if obj == nil { + return errNilVPNDevice + } + + if data != nil { + obj.ObjectMeta = *data + } + + return nil +} + +// Spec is the resolver for the spec field. +func (r *consoleVPNDeviceInResolver) Spec(ctx context.Context, obj *entities.ConsoleVPNDevice, data *model.GithubComKloudliteOperatorApisWireguardV1DeviceSpecIn) error { + if obj == nil { + return errNilVPNDevice + } + + return fn.JsonConversion(data, &obj.Spec) +} + +// ConsoleVPNDevice returns generated.ConsoleVPNDeviceResolver implementation. +func (r *Resolver) ConsoleVPNDevice() generated.ConsoleVPNDeviceResolver { + return &consoleVPNDeviceResolver{r} +} + +// ConsoleVPNDeviceIn returns generated.ConsoleVPNDeviceInResolver implementation. +func (r *Resolver) ConsoleVPNDeviceIn() generated.ConsoleVPNDeviceInResolver { + return &consoleVPNDeviceInResolver{r} +} + +type consoleVPNDeviceResolver struct{ *Resolver } +type consoleVPNDeviceInResolver struct{ *Resolver } diff --git a/apps/console/internal/app/graph/crd-to-gql/app.graphqls b/apps/console/internal/app/graph/crd-to-gql/app.graphqls deleted file mode 100644 index deaa0c09e..000000000 --- a/apps/console/internal/app/graph/crd-to-gql/app.graphqls +++ /dev/null @@ -1,304 +0,0 @@ -input AppSpecContainersEnvFromIn { - type: String! - refName: String! -} - -type AppSpecContainersLivenessProbeTcp @shareable { - port: Int! -} - -input AppSpecContainersLivenessProbeIn { - failureThreshold: Int - httpGet: AppSpecContainersLivenessProbeHttpGetIn - initialDelay: Int - interval: Int - shell: AppSpecContainersLivenessProbeShellIn - tcp: AppSpecContainersLivenessProbeTcpIn - type: String! -} - -type AppSpecServices @shareable { - name: String - port: Int! - targetPort: Int - type: String -} - -type AppSpecContainersEnvFrom @shareable { - type: String! - refName: String! -} - -input AppSpecContainersLivenessProbeShellIn { - command: [String] -} - -input AppSpecContainersReadinessProbeShellIn { - command: [String] -} - -type AppSpecContainersReadinessProbeTcp @shareable { - port: Int! -} - -input AppSpecContainersResourceMemoryIn { - max: String - min: String -} - -type AppSpec @shareable { - containers: [AppSpecContainers]! - displayName: String - intercept: AppSpecIntercept - region: String - replicas: Int - freeze: Boolean - hpa: AppSpecHpa - nodeSelector: Map - serviceAccount: String - services: [AppSpecServices] - tolerations: [AppSpecTolerations] -} - -input AppSpecContainersVolumesIn { - mountPath: String! - refName: String! - type: String! - items: [AppSpecContainersVolumesItemsIn] -} - -type AppSpecContainers @shareable { - name: String! - args: [String] - env: [AppSpecContainersEnv] - envFrom: [AppSpecContainersEnvFrom] - image: String! - imagePullPolicy: String - volumes: [AppSpecContainersVolumes] - command: [String] - livenessProbe: AppSpecContainersLivenessProbe - readinessProbe: AppSpecContainersReadinessProbe - resourceCpu: AppSpecContainersResourceCpu - resourceMemory: AppSpecContainersResourceMemory -} - -type AppSpecHpa @shareable { - enabled: Boolean - maxReplicas: Int - minReplicas: Int - thresholdCpu: Int - thresholdMemory: Int -} - -type App @shareable { - kind: String - metadata: Metadata! @goField(name: "objectMeta") - overrides: Overrides - restart: Boolean - syncStatus: SyncStatus - spec: AppSpec - status: Status - apiVersion: String - enabled: Boolean -} - -type AppSpecContainersResourceCpu @shareable { - max: String - min: String -} - -input AppSpecContainersIn { - name: String! - args: [String] - env: [AppSpecContainersEnvIn] - envFrom: [AppSpecContainersEnvFromIn] - image: String! - imagePullPolicy: String - volumes: [AppSpecContainersVolumesIn] - command: [String] - livenessProbe: AppSpecContainersLivenessProbeIn - readinessProbe: AppSpecContainersReadinessProbeIn - resourceCpu: AppSpecContainersResourceCpuIn - resourceMemory: AppSpecContainersResourceMemoryIn -} - -input AppSpecTolerationsIn { - effect: String - key: String - operator: String - tolerationSeconds: Int - value: String -} - -input AppSpecIn { - containers: [AppSpecContainersIn]! - displayName: String - intercept: AppSpecInterceptIn - region: String - replicas: Int - freeze: Boolean - hpa: AppSpecHpaIn - nodeSelector: Map - serviceAccount: String - services: [AppSpecServicesIn] - tolerations: [AppSpecTolerationsIn] -} - -input AppIn { - kind: String - metadata: MetadataIn! @goField(name: "objectMeta") - overrides: OverridesIn - restart: Boolean - spec: AppSpecIn - apiVersion: String - enabled: Boolean -} - -input AppSpecHpaIn { - enabled: Boolean - maxReplicas: Int - minReplicas: Int - thresholdCpu: Int - thresholdMemory: Int -} - -type AppSpecContainersEnv @shareable { - key: String! - optional: Boolean - refKey: String - refName: String - type: String - value: String -} - -type AppSpecContainersVolumesItems @shareable { - key: String! - fileName: String -} - -input AppSpecContainersLivenessProbeTcpIn { - port: Int! -} - -input AppSpecContainersReadinessProbeTcpIn { - port: Int! -} - -input AppSpecContainersReadinessProbeHttpGetIn { - httpHeaders: Map - path: String! - port: Int! -} - -input AppSpecContainersResourceCpuIn { - max: String - min: String -} - -type AppSpecContainersResourceMemory @shareable { - max: String - min: String -} - -type AppSpecTolerations @shareable { - effect: String - key: String - operator: String - tolerationSeconds: Int - value: String -} - -input AppSpecContainersVolumesItemsIn { - key: String! - fileName: String -} - -type AppSpecContainersReadinessProbeShell @shareable { - command: [String] -} - -type AppSpecContainersReadinessProbeHttpGet @shareable { - httpHeaders: Map - path: String! - port: Int! -} - -type AppSpecIntercept @shareable { - enabled: Boolean! - toDevice: String! -} - -input AppSpecInterceptIn { - enabled: Boolean! - toDevice: String! -} - -type AppSpecContainersLivenessProbeHttpGet @shareable { - httpHeaders: Map - path: String! - port: Int! -} - -input AppSpecContainersLivenessProbeHttpGetIn { - httpHeaders: Map - path: String! - port: Int! -} - -type AppSpecContainersLivenessProbeShell @shareable { - command: [String] -} - -type AppSpecContainersReadinessProbe @shareable { - interval: Int - shell: AppSpecContainersReadinessProbeShell - tcp: AppSpecContainersReadinessProbeTcp - type: String! - failureThreshold: Int - httpGet: AppSpecContainersReadinessProbeHttpGet - initialDelay: Int -} - -input AppSpecContainersReadinessProbeIn { - interval: Int - shell: AppSpecContainersReadinessProbeShellIn - tcp: AppSpecContainersReadinessProbeTcpIn - type: String! - failureThreshold: Int - httpGet: AppSpecContainersReadinessProbeHttpGetIn - initialDelay: Int -} - -input AppSpecServicesIn { - name: String - port: Int! - targetPort: Int - type: String -} - -input AppSpecContainersEnvIn { - key: String! - optional: Boolean - refKey: String - refName: String - type: String - value: String -} - -type AppSpecContainersVolumes @shareable { - mountPath: String! - refName: String! - type: String! - items: [AppSpecContainersVolumesItems] -} - -type AppSpecContainersLivenessProbe @shareable { - failureThreshold: Int - httpGet: AppSpecContainersLivenessProbeHttpGet - initialDelay: Int - interval: Int - shell: AppSpecContainersLivenessProbeShell - tcp: AppSpecContainersLivenessProbeTcp - type: String! -} - diff --git a/apps/console/internal/app/graph/crd-to-gql/config.graphqls b/apps/console/internal/app/graph/crd-to-gql/config.graphqls deleted file mode 100644 index bdf412bf7..000000000 --- a/apps/console/internal/app/graph/crd-to-gql/config.graphqls +++ /dev/null @@ -1,20 +0,0 @@ -type Config @shareable { - enabled: Boolean - kind: String - metadata: Metadata! @goField(name: "objectMeta") - overrides: Overrides - status: Status - apiVersion: String - syncStatus: SyncStatus - data: Map -} - -input ConfigIn { - enabled: Boolean - kind: String - metadata: MetadataIn! @goField(name: "objectMeta") - overrides: OverridesIn - apiVersion: String - data: Map -} - diff --git a/apps/console/internal/app/graph/crd-to-gql/managedresource.graphqls b/apps/console/internal/app/graph/crd-to-gql/managedresource.graphqls deleted file mode 100644 index 74ff59e79..000000000 --- a/apps/console/internal/app/graph/crd-to-gql/managedresource.graphqls +++ /dev/null @@ -1,52 +0,0 @@ -type ManagedResourceSpecMsvcRef @shareable { - apiVersion: String! - kind: String - name: String! -} - -input ManagedResourceSpecMsvcRefIn { - apiVersion: String! - kind: String - name: String! -} - -type ManagedResourceSpec @shareable { - inputs: Map - mresKind: ManagedResourceSpecMresKind! - msvcRef: ManagedResourceSpecMsvcRef! -} - -input ManagedResourceSpecIn { - inputs: Map - mresKind: ManagedResourceSpecMresKindIn! - msvcRef: ManagedResourceSpecMsvcRefIn! -} - -type ManagedResource @shareable { - overrides: Overrides - syncStatus: SyncStatus - spec: ManagedResourceSpec - status: Status - apiVersion: String - enabled: Boolean - kind: String - metadata: Metadata! @goField(name: "objectMeta") -} - -input ManagedResourceIn { - overrides: OverridesIn - spec: ManagedResourceSpecIn - apiVersion: String - enabled: Boolean - kind: String - metadata: MetadataIn! @goField(name: "objectMeta") -} - -type ManagedResourceSpecMresKind @shareable { - kind: String! -} - -input ManagedResourceSpecMresKindIn { - kind: String! -} - diff --git a/apps/console/internal/app/graph/crd-to-gql/managedservice.graphqls b/apps/console/internal/app/graph/crd-to-gql/managedservice.graphqls deleted file mode 100644 index c7b352e88..000000000 --- a/apps/console/internal/app/graph/crd-to-gql/managedservice.graphqls +++ /dev/null @@ -1,62 +0,0 @@ -type ManagedService @shareable { - overrides: Overrides - syncStatus: SyncStatus - spec: ManagedServiceSpec - status: Status - apiVersion: String - enabled: Boolean - kind: String - metadata: Metadata! @goField(name: "objectMeta") -} - -input ManagedServiceIn { - overrides: OverridesIn - spec: ManagedServiceSpecIn - apiVersion: String - enabled: Boolean - kind: String - metadata: MetadataIn! @goField(name: "objectMeta") -} - -type ManagedServiceSpecMsvcKind @shareable { - kind: String - apiVersion: String! -} - -input ManagedServiceSpecMsvcKindIn { - kind: String - apiVersion: String! -} - -type ManagedServiceSpecTolerations @shareable { - effect: String - key: String - operator: String - tolerationSeconds: Int - value: String -} - -input ManagedServiceSpecTolerationsIn { - effect: String - key: String - operator: String - tolerationSeconds: Int - value: String -} - -type ManagedServiceSpec @shareable { - inputs: Map - msvcKind: ManagedServiceSpecMsvcKind! - nodeSelector: Map - region: String - tolerations: [ManagedServiceSpecTolerations] -} - -input ManagedServiceSpecIn { - inputs: Map - msvcKind: ManagedServiceSpecMsvcKindIn! - nodeSelector: Map - region: String - tolerations: [ManagedServiceSpecTolerationsIn] -} - diff --git a/apps/console/internal/app/graph/crd-to-gql/project.graphqls b/apps/console/internal/app/graph/crd-to-gql/project.graphqls deleted file mode 100644 index 534623da4..000000000 --- a/apps/console/internal/app/graph/crd-to-gql/project.graphqls +++ /dev/null @@ -1,32 +0,0 @@ -type ProjectSpec @shareable { - displayName: String - logo: String - targetNamespace: String! - accountName: String! - clusterName: String! -} - -input ProjectSpecIn { - displayName: String - logo: String - targetNamespace: String! - accountName: String! - clusterName: String! -} - -type Project @shareable { - apiVersion: String - kind: String - metadata: Metadata! @goField(name: "objectMeta") - syncStatus: SyncStatus - spec: ProjectSpec - status: Status -} - -input ProjectIn { - apiVersion: String - kind: String - metadata: MetadataIn! @goField(name: "objectMeta") - spec: ProjectSpecIn -} - diff --git a/apps/console/internal/app/graph/crd-to-gql/router.graphqls b/apps/console/internal/app/graph/crd-to-gql/router.graphqls deleted file mode 100644 index 17c24447e..000000000 --- a/apps/console/internal/app/graph/crd-to-gql/router.graphqls +++ /dev/null @@ -1,110 +0,0 @@ -input RouterSpecRateLimitIn { - connections: Int - enabled: Boolean - rpm: Int - rps: Int -} - -type Router @shareable { - apiVersion: String - kind: String - metadata: Metadata! @goField(name: "objectMeta") - overrides: Overrides - syncStatus: SyncStatus - spec: RouterSpec - status: Status -} - -input RouterSpecBasicAuthIn { - enabled: Boolean! - secretName: String - username: String -} - -type RouterSpecHttps @shareable { - clusterIssuer: String - enabled: Boolean! - forceRedirect: Boolean -} - -input RouterSpecHttpsIn { - clusterIssuer: String - enabled: Boolean! - forceRedirect: Boolean -} - -type RouterSpecRateLimit @shareable { - connections: Int - enabled: Boolean - rpm: Int - rps: Int -} - -type RouterSpec @shareable { - cors: RouterSpecCors - ingressClass: String - maxBodySizeInMB: Int - region: String - routes: [RouterSpecRoutes] - backendProtocol: String - basicAuth: RouterSpecBasicAuth - domains: [String]! - https: RouterSpecHttps - rateLimit: RouterSpecRateLimit -} - -input RouterSpecIn { - cors: RouterSpecCorsIn - ingressClass: String - maxBodySizeInMB: Int - region: String - routes: [RouterSpecRoutesIn] - backendProtocol: String - basicAuth: RouterSpecBasicAuthIn - domains: [String]! - https: RouterSpecHttpsIn - rateLimit: RouterSpecRateLimitIn -} - -input RouterIn { - apiVersion: String - kind: String - metadata: MetadataIn! @goField(name: "objectMeta") - overrides: OverridesIn - spec: RouterSpecIn -} - -input RouterSpecCorsIn { - allowCredentials: Boolean - enabled: Boolean - origins: [String] -} - -type RouterSpecRoutes @shareable { - app: String - lambda: String - path: String! - port: Int! - rewrite: Boolean -} - -input RouterSpecRoutesIn { - app: String - lambda: String - path: String! - port: Int! - rewrite: Boolean -} - -type RouterSpecCors @shareable { - allowCredentials: Boolean - enabled: Boolean - origins: [String] -} - -type RouterSpecBasicAuth @shareable { - enabled: Boolean! - secretName: String - username: String -} - diff --git a/apps/console/internal/app/graph/crd-to-gql/scalars.graphqls b/apps/console/internal/app/graph/crd-to-gql/scalars.graphqls deleted file mode 100644 index 5a803012e..000000000 --- a/apps/console/internal/app/graph/crd-to-gql/scalars.graphqls +++ /dev/null @@ -1,76 +0,0 @@ - -scalar Any -scalar Json -scalar Map -scalar Date - -type Metadata @shareable { - name: String! - namespace: String - labels: Json - annotations: Json - creationTimestamp: Date! - deletionTimestamp: Date - generation: Int! -} - -input MetadataIn { - name: String! - namespace: String - labels: Json - annotations: Json -} - -type Status @shareable { - isReady: Boolean! - checks: Map - displayVars: Json -} - -type Check @shareable { - status: Boolean - message: String - generation: Int -} - -type Patch @shareable { - op: String! - path: String! - value: Any -} - -type Overrides @shareable{ - applied: Boolean - patches: [Patch!] -} - -input PatchIn { - op: String! - path: String! - value: Any -} - -input OverridesIn{ - patches: [PatchIn!] -} - -enum SyncAction { - APPLY - DELETE -} - -enum SyncState { - IDLE - IN_PROGRESS - READY - NOT_READY -} - -type SyncStatus @shareable{ - syncScheduledAt: Date! - lastSyncedAt: Date - action: SyncAction! - generation: Int! - state: SyncState! - error: String -} diff --git a/apps/console/internal/app/graph/crd-to-gql/secret.graphqls b/apps/console/internal/app/graph/crd-to-gql/secret.graphqls deleted file mode 100644 index 375993acc..000000000 --- a/apps/console/internal/app/graph/crd-to-gql/secret.graphqls +++ /dev/null @@ -1,26 +0,0 @@ -type Secret @shareable { - syncStatus: SyncStatus - data: Map - enabled: Boolean - kind: String - metadata: Metadata! @goField(name: "objectMeta") - projectName: String - status: Status - apiVersion: String - overrides: Overrides - stringData: Map - type: String -} - -input SecretIn { - data: Map - enabled: Boolean - kind: String - metadata: MetadataIn! @goField(name: "objectMeta") - projectName: String - apiVersion: String - overrides: OverridesIn - stringData: Map - type: String -} - diff --git a/apps/console/internal/app/graph/crd-to-gql/workspace.graphqls b/apps/console/internal/app/graph/crd-to-gql/workspace.graphqls deleted file mode 100644 index 0da7bae71..000000000 --- a/apps/console/internal/app/graph/crd-to-gql/workspace.graphqls +++ /dev/null @@ -1,26 +0,0 @@ -input WorkspaceSpecIn { - projectName: String! - targetNamespace: String! -} - -type Workspace @shareable { - metadata: Metadata! @goField(name: "objectMeta") - syncStatus: SyncStatus - spec: WorkspaceSpec - status: Status - apiVersion: String - kind: String -} - -input WorkspaceIn { - metadata: MetadataIn! @goField(name: "objectMeta") - spec: WorkspaceSpecIn - apiVersion: String - kind: String -} - -type WorkspaceSpec @shareable { - projectName: String! - targetNamespace: String! -} - diff --git a/apps/console/internal/app/graph/environment.resolvers.go b/apps/console/internal/app/graph/environment.resolvers.go new file mode 100644 index 000000000..4db4e0948 --- /dev/null +++ b/apps/console/internal/app/graph/environment.resolvers.go @@ -0,0 +1,81 @@ +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.28 + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + "time" + + "github.com/kloudlite/api/apps/console/internal/app/graph/generated" + "github.com/kloudlite/api/apps/console/internal/app/graph/model" + "github.com/kloudlite/api/apps/console/internal/entities" + fn "github.com/kloudlite/api/pkg/functions" + "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// CreationTime is the resolver for the creationTime field. +func (r *environmentResolver) CreationTime(ctx context.Context, obj *entities.Environment) (string, error) { + if obj == nil { + return "", errNilEnvironment + } + return obj.BaseEntity.CreationTime.Format(time.RFC3339), nil +} + +// ID is the resolver for the id field. +func (r *environmentResolver) ID(ctx context.Context, obj *entities.Environment) (string, error) { + if obj == nil { + return "", errNilEnvironment + } + return string(obj.Id), nil +} + +// Spec is the resolver for the spec field. +func (r *environmentResolver) Spec(ctx context.Context, obj *entities.Environment) (*model.GithubComKloudliteOperatorApisCrdsV1EnvironmentSpec, error) { + if obj == nil { + return nil, errNilEnvironment + } + m := &model.GithubComKloudliteOperatorApisCrdsV1EnvironmentSpec{} + if err := fn.JsonConversion(obj.Spec, &m); err != nil { + return nil, errors.NewE(err) + } + return m, nil +} + +// UpdateTime is the resolver for the updateTime field. +func (r *environmentResolver) UpdateTime(ctx context.Context, obj *entities.Environment) (string, error) { + if obj == nil { + return "", errNilEnvironment + } + return obj.BaseEntity.UpdateTime.Format(time.RFC3339), nil +} + +// Metadata is the resolver for the metadata field. +func (r *environmentInResolver) Metadata(ctx context.Context, obj *entities.Environment, data *v1.ObjectMeta) error { + if obj == nil { + return errNilEnvironment + } + if data != nil { + obj.ObjectMeta = *data + } + return nil +} + +// Spec is the resolver for the spec field. +func (r *environmentInResolver) Spec(ctx context.Context, obj *entities.Environment, data *model.GithubComKloudliteOperatorApisCrdsV1EnvironmentSpecIn) error { + if obj == nil { + return errNilEnvironment + } + return fn.JsonConversion(data, &obj.Spec) +} + +// Environment returns generated.EnvironmentResolver implementation. +func (r *Resolver) Environment() generated.EnvironmentResolver { return &environmentResolver{r} } + +// EnvironmentIn returns generated.EnvironmentInResolver implementation. +func (r *Resolver) EnvironmentIn() generated.EnvironmentInResolver { return &environmentInResolver{r} } + +type environmentResolver struct{ *Resolver } +type environmentInResolver struct{ *Resolver } diff --git a/apps/console/internal/app/graph/generated/generated.go b/apps/console/internal/app/graph/generated/generated.go index fa6cf8962..0ad7d3474 100644 --- a/apps/console/internal/app/graph/generated/generated.go +++ b/apps/console/internal/app/graph/generated/generated.go @@ -14,16 +14,18 @@ import ( "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/introspection" "github.com/99designs/gqlgen/plugin/federation/fedruntime" - v11 "github.com/kloudlite/operator/apis/crds/v1" - json_patch "github.com/kloudlite/operator/pkg/json-patch" + "github.com/kloudlite/api/apps/console/internal/app/graph/model" + "github.com/kloudlite/api/apps/console/internal/domain" + "github.com/kloudlite/api/apps/console/internal/entities" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/repos" + "github.com/kloudlite/api/pkg/types" + "github.com/kloudlite/operator/apis/crds/v1" + v11 "github.com/kloudlite/operator/apis/wireguard/v1" "github.com/kloudlite/operator/pkg/operator" gqlparser "github.com/vektah/gqlparser/v2" "github.com/vektah/gqlparser/v2/ast" - "k8s.io/apimachinery/pkg/apis/meta/v1" - "kloudlite.io/apps/console/internal/app/graph/model" - "kloudlite.io/apps/console/internal/domain" - "kloudlite.io/apps/console/internal/domain/entities" - "kloudlite.io/pkg/types" + v12 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // region ************************** generated!.gotpl ************************** @@ -46,64 +48,214 @@ type Config struct { type ResolverRoot interface { App() AppResolver Config() ConfigResolver + ConsoleVPNDevice() ConsoleVPNDeviceResolver + Environment() EnvironmentResolver + Github__com___kloudlite___api___common__CreatedOrUpdatedBy() Github__com___kloudlite___api___common__CreatedOrUpdatedByResolver + Github__com___kloudlite___api___pkg___types__SyncStatus() Github__com___kloudlite___api___pkg___types__SyncStatusResolver + Github__com___kloudlite___operator___pkg___operator__Status() Github__com___kloudlite___operator___pkg___operator__StatusResolver + ImagePullSecret() ImagePullSecretResolver ManagedResource() ManagedResourceResolver - ManagedService() ManagedServiceResolver Metadata() MetadataResolver Mutation() MutationResolver - Patch() PatchResolver Project() ProjectResolver + ProjectManagedService() ProjectManagedServiceResolver Query() QueryResolver Router() RouterResolver Secret() SecretResolver - Status() StatusResolver - SyncStatus() SyncStatusResolver - Workspace() WorkspaceResolver AppIn() AppInResolver ConfigIn() ConfigInResolver + ConsoleVPNDeviceIn() ConsoleVPNDeviceInResolver + EnvironmentIn() EnvironmentInResolver + ImagePullSecretIn() ImagePullSecretInResolver ManagedResourceIn() ManagedResourceInResolver - ManagedServiceIn() ManagedServiceInResolver MetadataIn() MetadataInResolver - PatchIn() PatchInResolver ProjectIn() ProjectInResolver + ProjectManagedServiceIn() ProjectManagedServiceInResolver RouterIn() RouterInResolver SecretIn() SecretInResolver - WorkspaceIn() WorkspaceInResolver } type DirectiveRoot struct { - HasAccount func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) - HasAccountAndCluster func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) - IsLoggedIn func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) + HasAccount func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) + IsLoggedIn func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) + IsLoggedInAndVerified func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) } type ComplexityRoot struct { App struct { - APIVersion func(childComplexity int) int - Enabled func(childComplexity int) int - Kind func(childComplexity int) int - ObjectMeta func(childComplexity int) int - Overrides func(childComplexity int) int - Restart func(childComplexity int) int - Spec func(childComplexity int) int - Status func(childComplexity int) int - SyncStatus func(childComplexity int) int + APIVersion func(childComplexity int) int + AccountName func(childComplexity int) int + CreatedBy func(childComplexity int) int + CreationTime func(childComplexity int) int + DisplayName func(childComplexity int) int + Enabled func(childComplexity int) int + EnvironmentName func(childComplexity int) int + ID func(childComplexity int) int + Kind func(childComplexity int) int + LastUpdatedBy func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + ObjectMeta func(childComplexity int) int + ProjectName func(childComplexity int) int + RecordVersion func(childComplexity int) int + Spec func(childComplexity int) int + Status func(childComplexity int) int + SyncStatus func(childComplexity int) int + UpdateTime func(childComplexity int) int + } + + AppEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + AppPaginatedRecords struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int } - AppSpec struct { - Containers func(childComplexity int) int - DisplayName func(childComplexity int) int - Freeze func(childComplexity int) int - Hpa func(childComplexity int) int - Intercept func(childComplexity int) int - NodeSelector func(childComplexity int) int - Region func(childComplexity int) int - Replicas func(childComplexity int) int - ServiceAccount func(childComplexity int) int - Services func(childComplexity int) int - Tolerations func(childComplexity int) int + Config struct { + APIVersion func(childComplexity int) int + AccountName func(childComplexity int) int + BinaryData func(childComplexity int) int + CreatedBy func(childComplexity int) int + CreationTime func(childComplexity int) int + Data func(childComplexity int) int + DisplayName func(childComplexity int) int + EnvironmentName func(childComplexity int) int + ID func(childComplexity int) int + Immutable func(childComplexity int) int + Kind func(childComplexity int) int + LastUpdatedBy func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + ObjectMeta func(childComplexity int) int + ProjectName func(childComplexity int) int + RecordVersion func(childComplexity int) int + SyncStatus func(childComplexity int) int + UpdateTime func(childComplexity int) int + } + + ConfigEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + ConfigKeyRef struct { + ConfigName func(childComplexity int) int + Key func(childComplexity int) int } - AppSpecContainers struct { + ConfigKeyValueRef struct { + ConfigName func(childComplexity int) int + Key func(childComplexity int) int + Value func(childComplexity int) int + } + + ConfigPaginatedRecords struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + ConsoleCheckNameAvailabilityOutput struct { + Result func(childComplexity int) int + SuggestedNames func(childComplexity int) int + } + + ConsoleVPNDevice struct { + APIVersion func(childComplexity int) int + AccountName func(childComplexity int) int + ClusterName func(childComplexity int) int + CreatedBy func(childComplexity int) int + CreationTime func(childComplexity int) int + DisplayName func(childComplexity int) int + EnvironmentName func(childComplexity int) int + ID func(childComplexity int) int + Kind func(childComplexity int) int + LastUpdatedBy func(childComplexity int) int + LinkedClusters func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + ObjectMeta func(childComplexity int) int + ProjectName func(childComplexity int) int + RecordVersion func(childComplexity int) int + Spec func(childComplexity int) int + Status func(childComplexity int) int + SyncStatus func(childComplexity int) int + UpdateTime func(childComplexity int) int + WireguardConfig func(childComplexity int) int + } + + ConsoleVPNDeviceEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + ConsoleVPNDevicePaginatedRecords struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + CursorPagination struct { + After func(childComplexity int) int + Before func(childComplexity int) int + First func(childComplexity int) int + Last func(childComplexity int) int + OrderBy func(childComplexity int) int + SortDirection func(childComplexity int) int + } + + Environment struct { + APIVersion func(childComplexity int) int + AccountName func(childComplexity int) int + CreatedBy func(childComplexity int) int + CreationTime func(childComplexity int) int + DisplayName func(childComplexity int) int + ID func(childComplexity int) int + Kind func(childComplexity int) int + LastUpdatedBy func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + ObjectMeta func(childComplexity int) int + ProjectName func(childComplexity int) int + RecordVersion func(childComplexity int) int + Spec func(childComplexity int) int + Status func(childComplexity int) int + SyncStatus func(childComplexity int) int + UpdateTime func(childComplexity int) int + } + + EnvironmentEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + EnvironmentPaginatedRecords struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + Github__com___kloudlite___api___common__CreatedOrUpdatedBy struct { + UserEmail func(childComplexity int) int + UserID func(childComplexity int) int + UserName func(childComplexity int) int + } + + Github__com___kloudlite___api___pkg___types__EncodedString struct { + Encoding func(childComplexity int) int + Value func(childComplexity int) int + } + + Github__com___kloudlite___api___pkg___types__SyncStatus struct { + Action func(childComplexity int) int + Error func(childComplexity int) int + LastSyncedAt func(childComplexity int) int + RecordVersion func(childComplexity int) int + State func(childComplexity int) int + SyncScheduledAt func(childComplexity int) int + } + + Github__com___kloudlite___operator___apis___crds___v1__AppContainer struct { Args func(childComplexity int) int Command func(childComplexity int) int Env func(childComplexity int) int @@ -118,7 +270,34 @@ type ComplexityRoot struct { Volumes func(childComplexity int) int } - AppSpecContainersEnv struct { + Github__com___kloudlite___operator___apis___crds___v1__AppSpec struct { + Containers func(childComplexity int) int + DisplayName func(childComplexity int) int + Freeze func(childComplexity int) int + Hpa func(childComplexity int) int + Intercept func(childComplexity int) int + NodeSelector func(childComplexity int) int + Region func(childComplexity int) int + Replicas func(childComplexity int) int + ServiceAccount func(childComplexity int) int + Services func(childComplexity int) int + Tolerations func(childComplexity int) int + } + + Github__com___kloudlite___operator___apis___crds___v1__AppSvc struct { + Name func(childComplexity int) int + Port func(childComplexity int) int + TargetPort func(childComplexity int) int + Type func(childComplexity int) int + } + + Github__com___kloudlite___operator___apis___crds___v1__BasicAuth struct { + Enabled func(childComplexity int) int + SecretName func(childComplexity int) int + Username func(childComplexity int) int + } + + Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv struct { Key func(childComplexity int) int Optional func(childComplexity int) int RefKey func(childComplexity int) int @@ -127,36 +306,95 @@ type ComplexityRoot struct { Value func(childComplexity int) int } - AppSpecContainersEnvFrom struct { + Github__com___kloudlite___operator___apis___crds___v1__ContainerResource struct { + Max func(childComplexity int) int + Min func(childComplexity int) int + } + + Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume struct { + Items func(childComplexity int) int + MountPath func(childComplexity int) int + RefName func(childComplexity int) int + Type func(childComplexity int) int + } + + Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem struct { + FileName func(childComplexity int) int + Key func(childComplexity int) int + } + + Github__com___kloudlite___operator___apis___crds___v1__Cors struct { + AllowCredentials func(childComplexity int) int + Enabled func(childComplexity int) int + Origins func(childComplexity int) int + } + + Github__com___kloudlite___operator___apis___crds___v1__EnvFrom struct { RefName func(childComplexity int) int Type func(childComplexity int) int } - AppSpecContainersLivenessProbe struct { - FailureThreshold func(childComplexity int) int - HTTPGet func(childComplexity int) int - InitialDelay func(childComplexity int) int - Interval func(childComplexity int) int - Shell func(childComplexity int) int - TCP func(childComplexity int) int - Type func(childComplexity int) int + Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting struct { + Mode func(childComplexity int) int + PrivateIngressClass func(childComplexity int) int + PublicIngressClass func(childComplexity int) int } - AppSpecContainersLivenessProbeHttpGet struct { + Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec struct { + ProjectName func(childComplexity int) int + Routing func(childComplexity int) int + TargetNamespace func(childComplexity int) int + } + + Github__com___kloudlite___operator___apis___crds___v1__HPA struct { + Enabled func(childComplexity int) int + MaxReplicas func(childComplexity int) int + MinReplicas func(childComplexity int) int + ThresholdCPU func(childComplexity int) int + ThresholdMemory func(childComplexity int) int + } + + Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe struct { HTTPHeaders func(childComplexity int) int Path func(childComplexity int) int Port func(childComplexity int) int } - AppSpecContainersLivenessProbeShell struct { - Command func(childComplexity int) int + Github__com___kloudlite___operator___apis___crds___v1__Https struct { + ClusterIssuer func(childComplexity int) int + Enabled func(childComplexity int) int + ForceRedirect func(childComplexity int) int } - AppSpecContainersLivenessProbeTcp struct { - Port func(childComplexity int) int + Github__com___kloudlite___operator___apis___crds___v1__Intercept struct { + Enabled func(childComplexity int) int + ToDevice func(childComplexity int) int } - AppSpecContainersReadinessProbe struct { + Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec struct { + ResourceName func(childComplexity int) int + ResourceTemplate func(childComplexity int) int + } + + Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec struct { + ServiceTemplate func(childComplexity int) int + } + + Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate struct { + APIVersion func(childComplexity int) int + Kind func(childComplexity int) int + MsvcRef func(childComplexity int) int + Spec func(childComplexity int) int + } + + Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef struct { + APIVersion func(childComplexity int) int + Kind func(childComplexity int) int + Name func(childComplexity int) int + Namespace func(childComplexity int) int + } + + Github__com___kloudlite___operator___apis___crds___v1__Probe struct { FailureThreshold func(childComplexity int) int HTTPGet func(childComplexity int) int InitialDelay func(childComplexity int) int @@ -166,149 +404,189 @@ type ComplexityRoot struct { Type func(childComplexity int) int } - AppSpecContainersReadinessProbeHttpGet struct { - HTTPHeaders func(childComplexity int) int - Path func(childComplexity int) int - Port func(childComplexity int) int + Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec struct { + MsvcSpec func(childComplexity int) int + TargetNamespace func(childComplexity int) int } - AppSpecContainersReadinessProbeShell struct { - Command func(childComplexity int) int + Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec struct { + TargetNamespace func(childComplexity int) int } - AppSpecContainersReadinessProbeTcp struct { - Port func(childComplexity int) int + Github__com___kloudlite___operator___apis___crds___v1__RateLimit struct { + Connections func(childComplexity int) int + Enabled func(childComplexity int) int + Rpm func(childComplexity int) int + Rps func(childComplexity int) int } - AppSpecContainersResourceCpu struct { - Max func(childComplexity int) int - Min func(childComplexity int) int + Github__com___kloudlite___operator___apis___crds___v1__Route struct { + App func(childComplexity int) int + Lambda func(childComplexity int) int + Path func(childComplexity int) int + Port func(childComplexity int) int + Rewrite func(childComplexity int) int } - AppSpecContainersResourceMemory struct { - Max func(childComplexity int) int - Min func(childComplexity int) int + Github__com___kloudlite___operator___apis___crds___v1__RouterSpec struct { + BackendProtocol func(childComplexity int) int + BasicAuth func(childComplexity int) int + Cors func(childComplexity int) int + Domains func(childComplexity int) int + HTTPS func(childComplexity int) int + IngressClass func(childComplexity int) int + MaxBodySizeInMb func(childComplexity int) int + RateLimit func(childComplexity int) int + Routes func(childComplexity int) int } - AppSpecContainersVolumes struct { - Items func(childComplexity int) int - MountPath func(childComplexity int) int - RefName func(childComplexity int) int - Type func(childComplexity int) int + Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate struct { + APIVersion func(childComplexity int) int + Kind func(childComplexity int) int + Spec func(childComplexity int) int } - AppSpecContainersVolumesItems struct { - FileName func(childComplexity int) int - Key func(childComplexity int) int + Github__com___kloudlite___operator___apis___crds___v1__ShellProbe struct { + Command func(childComplexity int) int } - AppSpecHpa struct { - Enabled func(childComplexity int) int - MaxReplicas func(childComplexity int) int - MinReplicas func(childComplexity int) int - ThresholdCPU func(childComplexity int) int - ThresholdMemory func(childComplexity int) int + Github__com___kloudlite___operator___apis___crds___v1__TcpProbe struct { + Port func(childComplexity int) int } - AppSpecIntercept struct { - Enabled func(childComplexity int) int - ToDevice func(childComplexity int) int + Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord struct { + Host func(childComplexity int) int + Target func(childComplexity int) int } - AppSpecServices struct { - Name func(childComplexity int) int - Port func(childComplexity int) int - TargetPort func(childComplexity int) int - Type func(childComplexity int) int + Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec struct { + ActiveNamespace func(childComplexity int) int + CnameRecords func(childComplexity int) int + Disabled func(childComplexity int) int + NoExternalService func(childComplexity int) int + NodeSelector func(childComplexity int) int + Ports func(childComplexity int) int } - AppSpecTolerations struct { - Effect func(childComplexity int) int - Key func(childComplexity int) int - Operator func(childComplexity int) int - TolerationSeconds func(childComplexity int) int - Value func(childComplexity int) int + Github__com___kloudlite___operator___apis___wireguard___v1__Port struct { + Port func(childComplexity int) int + TargetPort func(childComplexity int) int } - Check struct { + Github__com___kloudlite___operator___pkg___operator__Check struct { Generation func(childComplexity int) int Message func(childComplexity int) int Status func(childComplexity int) int } - Config struct { + Github__com___kloudlite___operator___pkg___operator__ResourceRef struct { APIVersion func(childComplexity int) int - Data func(childComplexity int) int - Enabled func(childComplexity int) int Kind func(childComplexity int) int - ObjectMeta func(childComplexity int) int - Overrides func(childComplexity int) int - Status func(childComplexity int) int - SyncStatus func(childComplexity int) int + Name func(childComplexity int) int + Namespace func(childComplexity int) int } - ConsoleCheckNameAvailabilityOutput struct { - Result func(childComplexity int) int - SuggestedNames func(childComplexity int) int + Github__com___kloudlite___operator___pkg___operator__Status struct { + Checks func(childComplexity int) int + IsReady func(childComplexity int) int + LastReadyGeneration func(childComplexity int) int + LastReconcileTime func(childComplexity int) int + Message func(childComplexity int) int + Resources func(childComplexity int) int } - ManagedResource struct { - APIVersion func(childComplexity int) int - Enabled func(childComplexity int) int - Kind func(childComplexity int) int - ObjectMeta func(childComplexity int) int - Overrides func(childComplexity int) int - Spec func(childComplexity int) int - Status func(childComplexity int) int - SyncStatus func(childComplexity int) int + Github__com___kloudlite___operator___pkg___raw____json__RawJson struct { + RawMessage func(childComplexity int) int } - ManagedResourceSpec struct { - Inputs func(childComplexity int) int - MresKind func(childComplexity int) int - MsvcRef func(childComplexity int) int + ImagePullSecret struct { + AccountName func(childComplexity int) int + CreatedBy func(childComplexity int) int + CreationTime func(childComplexity int) int + DisplayName func(childComplexity int) int + DockerConfigJson func(childComplexity int) int + EnvironmentName func(childComplexity int) int + Format func(childComplexity int) int + ID func(childComplexity int) int + LastUpdatedBy func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + ObjectMeta func(childComplexity int) int + ProjectName func(childComplexity int) int + RecordVersion func(childComplexity int) int + RegistryPassword func(childComplexity int) int + RegistryURL func(childComplexity int) int + RegistryUsername func(childComplexity int) int + SyncStatus func(childComplexity int) int + UpdateTime func(childComplexity int) int } - ManagedResourceSpecMresKind struct { - Kind func(childComplexity int) int + ImagePullSecretEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int } - ManagedResourceSpecMsvcRef struct { - APIVersion func(childComplexity int) int - Kind func(childComplexity int) int - Name func(childComplexity int) int + ImagePullSecretPaginatedRecords struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int } - ManagedService struct { - APIVersion func(childComplexity int) int - Enabled func(childComplexity int) int - Kind func(childComplexity int) int - ObjectMeta func(childComplexity int) int - Overrides func(childComplexity int) int - Spec func(childComplexity int) int - Status func(childComplexity int) int - SyncStatus func(childComplexity int) int + K8s__io___api___core___v1__Toleration struct { + Effect func(childComplexity int) int + Key func(childComplexity int) int + Operator func(childComplexity int) int + TolerationSeconds func(childComplexity int) int + Value func(childComplexity int) int } - ManagedServiceSpec struct { - Inputs func(childComplexity int) int - MsvcKind func(childComplexity int) int - NodeSelector func(childComplexity int) int - Region func(childComplexity int) int - Tolerations func(childComplexity int) int + ManagedResource struct { + APIVersion func(childComplexity int) int + AccountName func(childComplexity int) int + CreatedBy func(childComplexity int) int + CreationTime func(childComplexity int) int + DisplayName func(childComplexity int) int + Enabled func(childComplexity int) int + EnvironmentName func(childComplexity int) int + ID func(childComplexity int) int + Kind func(childComplexity int) int + LastUpdatedBy func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + ObjectMeta func(childComplexity int) int + ProjectName func(childComplexity int) int + RecordVersion func(childComplexity int) int + Spec func(childComplexity int) int + Status func(childComplexity int) int + SyncStatus func(childComplexity int) int + UpdateTime func(childComplexity int) int + } + + ManagedResourceEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + ManagedResourceKeyRef struct { + Key func(childComplexity int) int + MresName func(childComplexity int) int } - ManagedServiceSpecMsvcKind struct { - APIVersion func(childComplexity int) int - Kind func(childComplexity int) int + ManagedResourceKeyValueRef struct { + Key func(childComplexity int) int + MresName func(childComplexity int) int + Value func(childComplexity int) int } - ManagedServiceSpecTolerations struct { - Effect func(childComplexity int) int - Key func(childComplexity int) int - Operator func(childComplexity int) int - TolerationSeconds func(childComplexity int) int - Value func(childComplexity int) int + ManagedResourcePaginatedRecords struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + MatchFilter struct { + Array func(childComplexity int) int + Exact func(childComplexity int) int + MatchType func(childComplexity int) int + Regex func(childComplexity int) int } Metadata struct { @@ -322,324 +600,478 @@ type ComplexityRoot struct { } Mutation struct { - CoreCreateApp func(childComplexity int, app entities.App) int - CoreCreateConfig func(childComplexity int, config entities.Config) int - CoreCreateManagedResource func(childComplexity int, mres entities.MRes) int - CoreCreateManagedService func(childComplexity int, msvc entities.MSvc) int - CoreCreateProject func(childComplexity int, project entities.Project) int - CoreCreateRouter func(childComplexity int, router entities.Router) int - CoreCreateSecret func(childComplexity int, secret entities.Secret) int - CoreCreateWorkspace func(childComplexity int, env entities.Workspace) int - CoreDeleteApp func(childComplexity int, namespace string, name string) int - CoreDeleteConfig func(childComplexity int, namespace string, name string) int - CoreDeleteManagedResource func(childComplexity int, namespace string, name string) int - CoreDeleteManagedService func(childComplexity int, namespace string, name string) int - CoreDeleteProject func(childComplexity int, name string) int - CoreDeleteRouter func(childComplexity int, namespace string, name string) int - CoreDeleteSecret func(childComplexity int, namespace string, name string) int - CoreDeleteWorkspace func(childComplexity int, namespace string, name string) int - CoreUpdateApp func(childComplexity int, app entities.App) int - CoreUpdateConfig func(childComplexity int, config entities.Config) int - CoreUpdateManagedResource func(childComplexity int, mres entities.MRes) int - CoreUpdateManagedService func(childComplexity int, msvc entities.MSvc) int - CoreUpdateProject func(childComplexity int, project entities.Project) int - CoreUpdateRouter func(childComplexity int, router entities.Router) int - CoreUpdateSecret func(childComplexity int, secret entities.Secret) int - CoreUpdateWorkspace func(childComplexity int, env entities.Workspace) int - } - - Overrides struct { - Applied func(childComplexity int) int - Patches func(childComplexity int) int - } - - Patch struct { - Op func(childComplexity int) int - Path func(childComplexity int) int - Value func(childComplexity int) int + CoreCloneEnvironment func(childComplexity int, projectName string, sourceEnvName string, destinationEnvName string, displayName string, environmentRoutingMode v1.EnvironmentRoutingMode) int + CoreCreateApp func(childComplexity int, projectName string, envName string, app entities.App) int + CoreCreateConfig func(childComplexity int, projectName string, envName string, config entities.Config) int + CoreCreateEnvironment func(childComplexity int, projectName string, env entities.Environment) int + CoreCreateImagePullSecret func(childComplexity int, projectName string, envName string, imagePullSecretIn entities.ImagePullSecret) int + CoreCreateManagedResource func(childComplexity int, projectName string, envName string, mres entities.ManagedResource) int + CoreCreateProject func(childComplexity int, project entities.Project) int + CoreCreateProjectManagedService func(childComplexity int, projectName string, pmsvc entities.ProjectManagedService) int + CoreCreateRouter func(childComplexity int, projectName string, envName string, router entities.Router) int + CoreCreateSecret func(childComplexity int, projectName string, envName string, secret entities.Secret) int + CoreCreateVPNDevice func(childComplexity int, vpnDevice entities.ConsoleVPNDevice) int + CoreDeleteApp func(childComplexity int, projectName string, envName string, appName string) int + CoreDeleteConfig func(childComplexity int, projectName string, envName string, configName string) int + CoreDeleteEnvironment func(childComplexity int, projectName string, envName string) int + CoreDeleteImagePullSecret func(childComplexity int, projectName string, envName string, secretName string) int + CoreDeleteManagedResource func(childComplexity int, projectName string, envName string, mresName string) int + CoreDeleteProject func(childComplexity int, name string) int + CoreDeleteProjectManagedService func(childComplexity int, projectName string, pmsvcName string) int + CoreDeleteRouter func(childComplexity int, projectName string, envName string, routerName string) int + CoreDeleteSecret func(childComplexity int, projectName string, envName string, secretName string) int + CoreDeleteVPNDevice func(childComplexity int, deviceName string) int + CoreInterceptApp func(childComplexity int, projectName string, envName string, appname string, deviceName string, intercept bool) int + CoreUpdateApp func(childComplexity int, projectName string, envName string, app entities.App) int + CoreUpdateConfig func(childComplexity int, projectName string, envName string, config entities.Config) int + CoreUpdateEnvironment func(childComplexity int, projectName string, env entities.Environment) int + CoreUpdateManagedResource func(childComplexity int, projectName string, envName string, mres entities.ManagedResource) int + CoreUpdateProject func(childComplexity int, project entities.Project) int + CoreUpdateProjectManagedService func(childComplexity int, projectName string, pmsvc entities.ProjectManagedService) int + CoreUpdateRouter func(childComplexity int, projectName string, envName string, router entities.Router) int + CoreUpdateSecret func(childComplexity int, projectName string, envName string, secret entities.Secret) int + CoreUpdateVPNDevice func(childComplexity int, vpnDevice entities.ConsoleVPNDevice) int + CoreUpdateVPNDeviceEnv func(childComplexity int, deviceName string, projectName string, envName string) int + CoreUpdateVPNDevicePorts func(childComplexity int, deviceName string, ports []*v11.Port) int + CoreUpdateVpnClusterName func(childComplexity int, deviceName string, clusterName string) int + CoreUpdateVpnDeviceNs func(childComplexity int, deviceName string, ns string) int + } + + PageInfo struct { + EndCursor func(childComplexity int) int + HasNextPage func(childComplexity int) int + HasPreviousPage func(childComplexity int) int + StartCursor func(childComplexity int) int + } + + Port struct { + Port func(childComplexity int) int + TargetPort func(childComplexity int) int } Project struct { - APIVersion func(childComplexity int) int - Kind func(childComplexity int) int - ObjectMeta func(childComplexity int) int - Spec func(childComplexity int) int - Status func(childComplexity int) int - SyncStatus func(childComplexity int) int - } - - ProjectSpec struct { - AccountName func(childComplexity int) int - ClusterName func(childComplexity int) int - DisplayName func(childComplexity int) int - Logo func(childComplexity int) int - TargetNamespace func(childComplexity int) int + APIVersion func(childComplexity int) int + AccountName func(childComplexity int) int + ClusterName func(childComplexity int) int + CreatedBy func(childComplexity int) int + CreationTime func(childComplexity int) int + DisplayName func(childComplexity int) int + ID func(childComplexity int) int + Kind func(childComplexity int) int + LastUpdatedBy func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + ObjectMeta func(childComplexity int) int + RecordVersion func(childComplexity int) int + Spec func(childComplexity int) int + Status func(childComplexity int) int + SyncStatus func(childComplexity int) int + UpdateTime func(childComplexity int) int + } + + ProjectEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + ProjectManagedService struct { + APIVersion func(childComplexity int) int + AccountName func(childComplexity int) int + CreatedBy func(childComplexity int) int + CreationTime func(childComplexity int) int + DisplayName func(childComplexity int) int + ID func(childComplexity int) int + Kind func(childComplexity int) int + LastUpdatedBy func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + ObjectMeta func(childComplexity int) int + ProjectName func(childComplexity int) int + RecordVersion func(childComplexity int) int + Spec func(childComplexity int) int + Status func(childComplexity int) int + SyncStatus func(childComplexity int) int + UpdateTime func(childComplexity int) int + } + + ProjectManagedServiceEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + ProjectManagedServicePaginatedRecords struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + ProjectPaginatedRecords struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int } Query struct { - CoreCheckNameAvailability func(childComplexity int, resType domain.ResType, name string) int - CoreGetApp func(childComplexity int, namespace string, name string) int - CoreGetConfig func(childComplexity int, namespace string, name string) int - CoreGetManagedResource func(childComplexity int, namespace string, name string) int - CoreGetManagedService func(childComplexity int, namespace string, name string) int - CoreGetProject func(childComplexity int, name string) int - CoreGetRouter func(childComplexity int, namespace string, name string) int - CoreGetSecret func(childComplexity int, namespace string, name string) int - CoreGetWorkspace func(childComplexity int, namespace string, name string) int - CoreListApps func(childComplexity int, namespace string) int - CoreListConfigs func(childComplexity int, namespace string) int - CoreListManagedResources func(childComplexity int, namespace string) int - CoreListManagedServices func(childComplexity int, namespace string) int - CoreListProjects func(childComplexity int, clusterName *string) int - CoreListRouters func(childComplexity int, namespace string) int - CoreListSecrets func(childComplexity int, namespace string) int - CoreListWorkspaces func(childComplexity int, namespace string) int - CoreResyncApp func(childComplexity int, namespace string, name string) int - CoreResyncConfig func(childComplexity int, namespace string, name string) int - CoreResyncManagedResource func(childComplexity int, namespace string, name string) int - CoreResyncManagedService func(childComplexity int, namespace string, name string) int - CoreResyncProject func(childComplexity int, name string) int - CoreResyncRouter func(childComplexity int, namespace string, name string) int - CoreResyncSecret func(childComplexity int, namespace string, name string) int - CoreResyncWorkspace func(childComplexity int, namespace string, name string) int - __resolve__service func(childComplexity int) int + CoreCheckNameAvailability func(childComplexity int, projectName *string, envName *string, resType entities.ResourceType, name string) int + CoreGetApp func(childComplexity int, projectName string, envName string, name string) int + CoreGetConfig func(childComplexity int, projectName string, envName string, name string) int + CoreGetConfigValues func(childComplexity int, projectName string, envName string, queries []*domain.ConfigKeyRef) int + CoreGetEnvironment func(childComplexity int, projectName string, name string) int + CoreGetImagePullSecret func(childComplexity int, projectName string, envName string, name string) int + CoreGetManagedResouceOutputKeyValues func(childComplexity int, projectName string, envName string, keyrefs []*domain.ManagedResourceKeyRef) int + CoreGetManagedResouceOutputKeys func(childComplexity int, projectName string, envName string, name string) int + CoreGetManagedResource func(childComplexity int, projectName string, envName string, name string) int + CoreGetProject func(childComplexity int, name string) int + CoreGetProjectManagedService func(childComplexity int, projectName string, name string) int + CoreGetRouter func(childComplexity int, projectName string, envName string, name string) int + CoreGetSecret func(childComplexity int, projectName string, envName string, name string) int + CoreGetSecretValues func(childComplexity int, projectName string, envName string, queries []*domain.SecretKeyRef) int + CoreGetVPNDevice func(childComplexity int, name string) int + CoreListApps func(childComplexity int, projectName string, envName string, search *model.SearchApps, pq *repos.CursorPagination) int + CoreListConfigs func(childComplexity int, projectName string, envName string, search *model.SearchConfigs, pq *repos.CursorPagination) int + CoreListEnvironments func(childComplexity int, projectName string, search *model.SearchEnvironments, pq *repos.CursorPagination) int + CoreListImagePullSecrets func(childComplexity int, projectName string, envName string, search *model.SearchImagePullSecrets, pq *repos.CursorPagination) int + CoreListManagedResources func(childComplexity int, projectName string, envName string, search *model.SearchManagedResources, pq *repos.CursorPagination) int + CoreListProjectManagedServices func(childComplexity int, projectName string, search *model.SearchProjectManagedService, pq *repos.CursorPagination) int + CoreListProjects func(childComplexity int, search *model.SearchProjects, pq *repos.CursorPagination) int + CoreListRouters func(childComplexity int, projectName string, envName string, search *model.SearchRouters, pq *repos.CursorPagination) int + CoreListSecrets func(childComplexity int, projectName string, envName string, search *model.SearchSecrets, pq *repos.CursorPagination) int + CoreListVPNDevices func(childComplexity int, search *model.CoreSearchVPNDevices, pq *repos.CursorPagination) int + CoreListVPNDevicesForUser func(childComplexity int) int + CoreRestartApp func(childComplexity int, projectName string, envName string, appName string) int + CoreRestartProjectManagedService func(childComplexity int, projectName string, name string) int + CoreResyncApp func(childComplexity int, projectName string, envName string, name string) int + CoreResyncConfig func(childComplexity int, projectName string, envName string, name string) int + CoreResyncEnvironment func(childComplexity int, projectName string, name string) int + CoreResyncImagePullSecret func(childComplexity int, projectName string, envName string, name string) int + CoreResyncManagedResource func(childComplexity int, projectName string, envName string, name string) int + CoreResyncProject func(childComplexity int, name string) int + CoreResyncProjectManagedService func(childComplexity int, projectName string, name string) int + CoreResyncRouter func(childComplexity int, projectName string, envName string, name string) int + CoreResyncSecret func(childComplexity int, projectName string, envName string, name string) int + __resolve__service func(childComplexity int) int } Router struct { - APIVersion func(childComplexity int) int - Kind func(childComplexity int) int - ObjectMeta func(childComplexity int) int - Overrides func(childComplexity int) int - Spec func(childComplexity int) int - Status func(childComplexity int) int - SyncStatus func(childComplexity int) int + APIVersion func(childComplexity int) int + AccountName func(childComplexity int) int + CreatedBy func(childComplexity int) int + CreationTime func(childComplexity int) int + DisplayName func(childComplexity int) int + Enabled func(childComplexity int) int + EnvironmentName func(childComplexity int) int + ID func(childComplexity int) int + Kind func(childComplexity int) int + LastUpdatedBy func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + ObjectMeta func(childComplexity int) int + ProjectName func(childComplexity int) int + RecordVersion func(childComplexity int) int + Spec func(childComplexity int) int + Status func(childComplexity int) int + SyncStatus func(childComplexity int) int + UpdateTime func(childComplexity int) int + } + + RouterEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + RouterPaginatedRecords struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int } - RouterSpec struct { - BackendProtocol func(childComplexity int) int - BasicAuth func(childComplexity int) int - Cors func(childComplexity int) int - Domains func(childComplexity int) int - HTTPS func(childComplexity int) int - IngressClass func(childComplexity int) int - MaxBodySizeInMb func(childComplexity int) int - RateLimit func(childComplexity int) int - Region func(childComplexity int) int - Routes func(childComplexity int) int + Secret struct { + APIVersion func(childComplexity int) int + AccountName func(childComplexity int) int + CreatedBy func(childComplexity int) int + CreationTime func(childComplexity int) int + Data func(childComplexity int) int + DisplayName func(childComplexity int) int + EnvironmentName func(childComplexity int) int + ID func(childComplexity int) int + Immutable func(childComplexity int) int + Kind func(childComplexity int) int + LastUpdatedBy func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + ObjectMeta func(childComplexity int) int + ProjectName func(childComplexity int) int + RecordVersion func(childComplexity int) int + StringData func(childComplexity int) int + SyncStatus func(childComplexity int) int + Type func(childComplexity int) int + UpdateTime func(childComplexity int) int + } + + SecretEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + SecretKeyRef struct { + Key func(childComplexity int) int + SecretName func(childComplexity int) int } - RouterSpecBasicAuth struct { - Enabled func(childComplexity int) int + SecretKeyValueRef struct { + Key func(childComplexity int) int SecretName func(childComplexity int) int - Username func(childComplexity int) int + Value func(childComplexity int) int } - RouterSpecCors struct { - AllowCredentials func(childComplexity int) int - Enabled func(childComplexity int) int - Origins func(childComplexity int) int + SecretPaginatedRecords struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int } - RouterSpecHttps struct { - ClusterIssuer func(childComplexity int) int - Enabled func(childComplexity int) int - ForceRedirect func(childComplexity int) int + _Service struct { + SDL func(childComplexity int) int } +} - RouterSpecRateLimit struct { - Connections func(childComplexity int) int - Enabled func(childComplexity int) int - Rpm func(childComplexity int) int - Rps func(childComplexity int) int - } +type AppResolver interface { + CreationTime(ctx context.Context, obj *entities.App) (string, error) - RouterSpecRoutes struct { - App func(childComplexity int) int - Lambda func(childComplexity int) int - Path func(childComplexity int) int - Port func(childComplexity int) int - Rewrite func(childComplexity int) int - } + ID(ctx context.Context, obj *entities.App) (string, error) - Secret struct { - APIVersion func(childComplexity int) int - Data func(childComplexity int) int - Enabled func(childComplexity int) int - Kind func(childComplexity int) int - ObjectMeta func(childComplexity int) int - Overrides func(childComplexity int) int - ProjectName func(childComplexity int) int - Status func(childComplexity int) int - StringData func(childComplexity int) int - SyncStatus func(childComplexity int) int - Type func(childComplexity int) int - } + Spec(ctx context.Context, obj *entities.App) (*model.GithubComKloudliteOperatorApisCrdsV1AppSpec, error) - Status struct { - Checks func(childComplexity int) int - DisplayVars func(childComplexity int) int - IsReady func(childComplexity int) int - } + UpdateTime(ctx context.Context, obj *entities.App) (string, error) +} +type ConfigResolver interface { + BinaryData(ctx context.Context, obj *entities.Config) (map[string]interface{}, error) - SyncStatus struct { - Action func(childComplexity int) int - Error func(childComplexity int) int - Generation func(childComplexity int) int - LastSyncedAt func(childComplexity int) int - State func(childComplexity int) int - SyncScheduledAt func(childComplexity int) int - } + CreationTime(ctx context.Context, obj *entities.Config) (string, error) + Data(ctx context.Context, obj *entities.Config) (map[string]interface{}, error) - Workspace struct { - APIVersion func(childComplexity int) int - Kind func(childComplexity int) int - ObjectMeta func(childComplexity int) int - Spec func(childComplexity int) int - Status func(childComplexity int) int - SyncStatus func(childComplexity int) int - } + ID(ctx context.Context, obj *entities.Config) (string, error) - WorkspaceSpec struct { - ProjectName func(childComplexity int) int - TargetNamespace func(childComplexity int) int - } + UpdateTime(ctx context.Context, obj *entities.Config) (string, error) +} +type ConsoleVPNDeviceResolver interface { + CreationTime(ctx context.Context, obj *entities.ConsoleVPNDevice) (string, error) - _Service struct { - SDL func(childComplexity int) int - } + ID(ctx context.Context, obj *entities.ConsoleVPNDevice) (string, error) + + Spec(ctx context.Context, obj *entities.ConsoleVPNDevice) (*model.GithubComKloudliteOperatorApisWireguardV1DeviceSpec, error) + + UpdateTime(ctx context.Context, obj *entities.ConsoleVPNDevice) (string, error) + WireguardConfig(ctx context.Context, obj *entities.ConsoleVPNDevice) (*model.GithubComKloudliteAPIPkgTypesEncodedString, error) } +type EnvironmentResolver interface { + CreationTime(ctx context.Context, obj *entities.Environment) (string, error) -type AppResolver interface { - Spec(ctx context.Context, obj *entities.App) (*model.AppSpec, error) + ID(ctx context.Context, obj *entities.Environment) (string, error) + + Spec(ctx context.Context, obj *entities.Environment) (*model.GithubComKloudliteOperatorApisCrdsV1EnvironmentSpec, error) + + UpdateTime(ctx context.Context, obj *entities.Environment) (string, error) } -type ConfigResolver interface { - Data(ctx context.Context, obj *entities.Config) (map[string]interface{}, error) +type Github__com___kloudlite___api___common__CreatedOrUpdatedByResolver interface { + UserID(ctx context.Context, obj *common.CreatedOrUpdatedBy) (string, error) } -type ManagedResourceResolver interface { - Spec(ctx context.Context, obj *entities.MRes) (*model.ManagedResourceSpec, error) +type Github__com___kloudlite___api___pkg___types__SyncStatusResolver interface { + LastSyncedAt(ctx context.Context, obj *types.SyncStatus) (*string, error) + + SyncScheduledAt(ctx context.Context, obj *types.SyncStatus) (*string, error) +} +type Github__com___kloudlite___operator___pkg___operator__StatusResolver interface { + Checks(ctx context.Context, obj *operator.Status) (map[string]interface{}, error) + + LastReconcileTime(ctx context.Context, obj *operator.Status) (*string, error) + Message(ctx context.Context, obj *operator.Status) (*model.GithubComKloudliteOperatorPkgRawJSONRawJSON, error) + Resources(ctx context.Context, obj *operator.Status) ([]*model.GithubComKloudliteOperatorPkgOperatorResourceRef, error) +} +type ImagePullSecretResolver interface { + CreationTime(ctx context.Context, obj *entities.ImagePullSecret) (string, error) + + Format(ctx context.Context, obj *entities.ImagePullSecret) (model.GithubComKloudliteAPIAppsConsoleInternalEntitiesPullSecretFormat, error) + ID(ctx context.Context, obj *entities.ImagePullSecret) (string, error) + + UpdateTime(ctx context.Context, obj *entities.ImagePullSecret) (string, error) } -type ManagedServiceResolver interface { - Spec(ctx context.Context, obj *entities.MSvc) (*model.ManagedServiceSpec, error) +type ManagedResourceResolver interface { + CreationTime(ctx context.Context, obj *entities.ManagedResource) (string, error) + + ID(ctx context.Context, obj *entities.ManagedResource) (string, error) + + Spec(ctx context.Context, obj *entities.ManagedResource) (*model.GithubComKloudliteOperatorApisCrdsV1ManagedResourceSpec, error) + + UpdateTime(ctx context.Context, obj *entities.ManagedResource) (string, error) } type MetadataResolver interface { - Labels(ctx context.Context, obj *v1.ObjectMeta) (map[string]interface{}, error) - Annotations(ctx context.Context, obj *v1.ObjectMeta) (map[string]interface{}, error) - CreationTimestamp(ctx context.Context, obj *v1.ObjectMeta) (string, error) - DeletionTimestamp(ctx context.Context, obj *v1.ObjectMeta) (*string, error) + Annotations(ctx context.Context, obj *v12.ObjectMeta) (map[string]interface{}, error) + CreationTimestamp(ctx context.Context, obj *v12.ObjectMeta) (string, error) + DeletionTimestamp(ctx context.Context, obj *v12.ObjectMeta) (*string, error) + + Labels(ctx context.Context, obj *v12.ObjectMeta) (map[string]interface{}, error) } type MutationResolver interface { CoreCreateProject(ctx context.Context, project entities.Project) (*entities.Project, error) CoreUpdateProject(ctx context.Context, project entities.Project) (*entities.Project, error) CoreDeleteProject(ctx context.Context, name string) (bool, error) - CoreCreateWorkspace(ctx context.Context, env entities.Workspace) (*entities.Workspace, error) - CoreUpdateWorkspace(ctx context.Context, env entities.Workspace) (*entities.Workspace, error) - CoreDeleteWorkspace(ctx context.Context, namespace string, name string) (bool, error) - CoreCreateApp(ctx context.Context, app entities.App) (*entities.App, error) - CoreUpdateApp(ctx context.Context, app entities.App) (*entities.App, error) - CoreDeleteApp(ctx context.Context, namespace string, name string) (bool, error) - CoreCreateConfig(ctx context.Context, config entities.Config) (*entities.Config, error) - CoreUpdateConfig(ctx context.Context, config entities.Config) (*entities.Config, error) - CoreDeleteConfig(ctx context.Context, namespace string, name string) (bool, error) - CoreCreateSecret(ctx context.Context, secret entities.Secret) (*entities.Secret, error) - CoreUpdateSecret(ctx context.Context, secret entities.Secret) (*entities.Secret, error) - CoreDeleteSecret(ctx context.Context, namespace string, name string) (bool, error) - CoreCreateRouter(ctx context.Context, router entities.Router) (*entities.Router, error) - CoreUpdateRouter(ctx context.Context, router entities.Router) (*entities.Router, error) - CoreDeleteRouter(ctx context.Context, namespace string, name string) (bool, error) - CoreCreateManagedService(ctx context.Context, msvc entities.MSvc) (*entities.MSvc, error) - CoreUpdateManagedService(ctx context.Context, msvc entities.MSvc) (*entities.MSvc, error) - CoreDeleteManagedService(ctx context.Context, namespace string, name string) (bool, error) - CoreCreateManagedResource(ctx context.Context, mres entities.MRes) (*entities.MRes, error) - CoreUpdateManagedResource(ctx context.Context, mres entities.MRes) (*entities.MRes, error) - CoreDeleteManagedResource(ctx context.Context, namespace string, name string) (bool, error) -} -type PatchResolver interface { - Value(ctx context.Context, obj *json_patch.PatchOperation) (interface{}, error) + CoreCreateEnvironment(ctx context.Context, projectName string, env entities.Environment) (*entities.Environment, error) + CoreUpdateEnvironment(ctx context.Context, projectName string, env entities.Environment) (*entities.Environment, error) + CoreDeleteEnvironment(ctx context.Context, projectName string, envName string) (bool, error) + CoreCloneEnvironment(ctx context.Context, projectName string, sourceEnvName string, destinationEnvName string, displayName string, environmentRoutingMode v1.EnvironmentRoutingMode) (*entities.Environment, error) + CoreCreateImagePullSecret(ctx context.Context, projectName string, envName string, imagePullSecretIn entities.ImagePullSecret) (*entities.ImagePullSecret, error) + CoreDeleteImagePullSecret(ctx context.Context, projectName string, envName string, secretName string) (bool, error) + CoreCreateApp(ctx context.Context, projectName string, envName string, app entities.App) (*entities.App, error) + CoreUpdateApp(ctx context.Context, projectName string, envName string, app entities.App) (*entities.App, error) + CoreDeleteApp(ctx context.Context, projectName string, envName string, appName string) (bool, error) + CoreInterceptApp(ctx context.Context, projectName string, envName string, appname string, deviceName string, intercept bool) (bool, error) + CoreCreateConfig(ctx context.Context, projectName string, envName string, config entities.Config) (*entities.Config, error) + CoreUpdateConfig(ctx context.Context, projectName string, envName string, config entities.Config) (*entities.Config, error) + CoreDeleteConfig(ctx context.Context, projectName string, envName string, configName string) (bool, error) + CoreCreateSecret(ctx context.Context, projectName string, envName string, secret entities.Secret) (*entities.Secret, error) + CoreUpdateSecret(ctx context.Context, projectName string, envName string, secret entities.Secret) (*entities.Secret, error) + CoreDeleteSecret(ctx context.Context, projectName string, envName string, secretName string) (bool, error) + CoreCreateRouter(ctx context.Context, projectName string, envName string, router entities.Router) (*entities.Router, error) + CoreUpdateRouter(ctx context.Context, projectName string, envName string, router entities.Router) (*entities.Router, error) + CoreDeleteRouter(ctx context.Context, projectName string, envName string, routerName string) (bool, error) + CoreCreateManagedResource(ctx context.Context, projectName string, envName string, mres entities.ManagedResource) (*entities.ManagedResource, error) + CoreUpdateManagedResource(ctx context.Context, projectName string, envName string, mres entities.ManagedResource) (*entities.ManagedResource, error) + CoreDeleteManagedResource(ctx context.Context, projectName string, envName string, mresName string) (bool, error) + CoreCreateProjectManagedService(ctx context.Context, projectName string, pmsvc entities.ProjectManagedService) (*entities.ProjectManagedService, error) + CoreUpdateProjectManagedService(ctx context.Context, projectName string, pmsvc entities.ProjectManagedService) (*entities.ProjectManagedService, error) + CoreDeleteProjectManagedService(ctx context.Context, projectName string, pmsvcName string) (bool, error) + CoreCreateVPNDevice(ctx context.Context, vpnDevice entities.ConsoleVPNDevice) (*entities.ConsoleVPNDevice, error) + CoreUpdateVPNDevice(ctx context.Context, vpnDevice entities.ConsoleVPNDevice) (*entities.ConsoleVPNDevice, error) + CoreUpdateVPNDevicePorts(ctx context.Context, deviceName string, ports []*v11.Port) (bool, error) + CoreUpdateVPNDeviceEnv(ctx context.Context, deviceName string, projectName string, envName string) (bool, error) + CoreUpdateVpnDeviceNs(ctx context.Context, deviceName string, ns string) (bool, error) + CoreUpdateVpnClusterName(ctx context.Context, deviceName string, clusterName string) (bool, error) + CoreDeleteVPNDevice(ctx context.Context, deviceName string) (bool, error) } type ProjectResolver interface { - Spec(ctx context.Context, obj *entities.Project) (*model.ProjectSpec, error) + CreationTime(ctx context.Context, obj *entities.Project) (string, error) + + ID(ctx context.Context, obj *entities.Project) (string, error) + + Spec(ctx context.Context, obj *entities.Project) (*model.GithubComKloudliteOperatorApisCrdsV1ProjectSpec, error) + + UpdateTime(ctx context.Context, obj *entities.Project) (string, error) +} +type ProjectManagedServiceResolver interface { + CreationTime(ctx context.Context, obj *entities.ProjectManagedService) (string, error) + + ID(ctx context.Context, obj *entities.ProjectManagedService) (string, error) + + Spec(ctx context.Context, obj *entities.ProjectManagedService) (*model.GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpec, error) + + UpdateTime(ctx context.Context, obj *entities.ProjectManagedService) (string, error) } type QueryResolver interface { - CoreCheckNameAvailability(ctx context.Context, resType domain.ResType, name string) (*domain.CheckNameAvailabilityOutput, error) - CoreListProjects(ctx context.Context, clusterName *string) ([]*entities.Project, error) + CoreCheckNameAvailability(ctx context.Context, projectName *string, envName *string, resType entities.ResourceType, name string) (*domain.CheckNameAvailabilityOutput, error) + CoreListProjects(ctx context.Context, search *model.SearchProjects, pq *repos.CursorPagination) (*model.ProjectPaginatedRecords, error) CoreGetProject(ctx context.Context, name string) (*entities.Project, error) CoreResyncProject(ctx context.Context, name string) (bool, error) - CoreListWorkspaces(ctx context.Context, namespace string) ([]*entities.Workspace, error) - CoreGetWorkspace(ctx context.Context, namespace string, name string) (*entities.Workspace, error) - CoreResyncWorkspace(ctx context.Context, namespace string, name string) (bool, error) - CoreListApps(ctx context.Context, namespace string) ([]*entities.App, error) - CoreGetApp(ctx context.Context, namespace string, name string) (*entities.App, error) - CoreResyncApp(ctx context.Context, namespace string, name string) (bool, error) - CoreListConfigs(ctx context.Context, namespace string) ([]*entities.Config, error) - CoreGetConfig(ctx context.Context, namespace string, name string) (*entities.Config, error) - CoreResyncConfig(ctx context.Context, namespace string, name string) (bool, error) - CoreListSecrets(ctx context.Context, namespace string) ([]*entities.Secret, error) - CoreGetSecret(ctx context.Context, namespace string, name string) (*entities.Secret, error) - CoreResyncSecret(ctx context.Context, namespace string, name string) (bool, error) - CoreListRouters(ctx context.Context, namespace string) ([]*entities.Router, error) - CoreGetRouter(ctx context.Context, namespace string, name string) (*entities.Router, error) - CoreResyncRouter(ctx context.Context, namespace string, name string) (bool, error) - CoreListManagedServices(ctx context.Context, namespace string) ([]*entities.MSvc, error) - CoreGetManagedService(ctx context.Context, namespace string, name string) (*entities.MSvc, error) - CoreResyncManagedService(ctx context.Context, namespace string, name string) (bool, error) - CoreListManagedResources(ctx context.Context, namespace string) ([]*entities.MRes, error) - CoreGetManagedResource(ctx context.Context, namespace string, name string) (*entities.MRes, error) - CoreResyncManagedResource(ctx context.Context, namespace string, name string) (bool, error) + CoreListEnvironments(ctx context.Context, projectName string, search *model.SearchEnvironments, pq *repos.CursorPagination) (*model.EnvironmentPaginatedRecords, error) + CoreGetEnvironment(ctx context.Context, projectName string, name string) (*entities.Environment, error) + CoreResyncEnvironment(ctx context.Context, projectName string, name string) (bool, error) + CoreListImagePullSecrets(ctx context.Context, projectName string, envName string, search *model.SearchImagePullSecrets, pq *repos.CursorPagination) (*model.ImagePullSecretPaginatedRecords, error) + CoreGetImagePullSecret(ctx context.Context, projectName string, envName string, name string) (*entities.ImagePullSecret, error) + CoreResyncImagePullSecret(ctx context.Context, projectName string, envName string, name string) (bool, error) + CoreListApps(ctx context.Context, projectName string, envName string, search *model.SearchApps, pq *repos.CursorPagination) (*model.AppPaginatedRecords, error) + CoreGetApp(ctx context.Context, projectName string, envName string, name string) (*entities.App, error) + CoreResyncApp(ctx context.Context, projectName string, envName string, name string) (bool, error) + CoreRestartApp(ctx context.Context, projectName string, envName string, appName string) (bool, error) + CoreGetConfigValues(ctx context.Context, projectName string, envName string, queries []*domain.ConfigKeyRef) ([]*domain.ConfigKeyValueRef, error) + CoreListConfigs(ctx context.Context, projectName string, envName string, search *model.SearchConfigs, pq *repos.CursorPagination) (*model.ConfigPaginatedRecords, error) + CoreGetConfig(ctx context.Context, projectName string, envName string, name string) (*entities.Config, error) + CoreResyncConfig(ctx context.Context, projectName string, envName string, name string) (bool, error) + CoreGetSecretValues(ctx context.Context, projectName string, envName string, queries []*domain.SecretKeyRef) ([]*domain.SecretKeyValueRef, error) + CoreListSecrets(ctx context.Context, projectName string, envName string, search *model.SearchSecrets, pq *repos.CursorPagination) (*model.SecretPaginatedRecords, error) + CoreGetSecret(ctx context.Context, projectName string, envName string, name string) (*entities.Secret, error) + CoreResyncSecret(ctx context.Context, projectName string, envName string, name string) (bool, error) + CoreListRouters(ctx context.Context, projectName string, envName string, search *model.SearchRouters, pq *repos.CursorPagination) (*model.RouterPaginatedRecords, error) + CoreGetRouter(ctx context.Context, projectName string, envName string, name string) (*entities.Router, error) + CoreResyncRouter(ctx context.Context, projectName string, envName string, name string) (bool, error) + CoreGetManagedResouceOutputKeys(ctx context.Context, projectName string, envName string, name string) ([]string, error) + CoreGetManagedResouceOutputKeyValues(ctx context.Context, projectName string, envName string, keyrefs []*domain.ManagedResourceKeyRef) ([]*domain.ManagedResourceKeyValueRef, error) + CoreListManagedResources(ctx context.Context, projectName string, envName string, search *model.SearchManagedResources, pq *repos.CursorPagination) (*model.ManagedResourcePaginatedRecords, error) + CoreGetManagedResource(ctx context.Context, projectName string, envName string, name string) (*entities.ManagedResource, error) + CoreResyncManagedResource(ctx context.Context, projectName string, envName string, name string) (bool, error) + CoreListProjectManagedServices(ctx context.Context, projectName string, search *model.SearchProjectManagedService, pq *repos.CursorPagination) (*model.ProjectManagedServicePaginatedRecords, error) + CoreGetProjectManagedService(ctx context.Context, projectName string, name string) (*entities.ProjectManagedService, error) + CoreResyncProjectManagedService(ctx context.Context, projectName string, name string) (bool, error) + CoreRestartProjectManagedService(ctx context.Context, projectName string, name string) (bool, error) + CoreListVPNDevices(ctx context.Context, search *model.CoreSearchVPNDevices, pq *repos.CursorPagination) (*model.ConsoleVPNDevicePaginatedRecords, error) + CoreListVPNDevicesForUser(ctx context.Context) ([]*entities.ConsoleVPNDevice, error) + CoreGetVPNDevice(ctx context.Context, name string) (*entities.ConsoleVPNDevice, error) } type RouterResolver interface { - Spec(ctx context.Context, obj *entities.Router) (*model.RouterSpec, error) + CreationTime(ctx context.Context, obj *entities.Router) (string, error) + + ID(ctx context.Context, obj *entities.Router) (string, error) + + Spec(ctx context.Context, obj *entities.Router) (*model.GithubComKloudliteOperatorApisCrdsV1RouterSpec, error) + + UpdateTime(ctx context.Context, obj *entities.Router) (string, error) } type SecretResolver interface { + CreationTime(ctx context.Context, obj *entities.Secret) (string, error) Data(ctx context.Context, obj *entities.Secret) (map[string]interface{}, error) + ID(ctx context.Context, obj *entities.Secret) (string, error) + StringData(ctx context.Context, obj *entities.Secret) (map[string]interface{}, error) - Type(ctx context.Context, obj *entities.Secret) (*string, error) -} -type StatusResolver interface { - Checks(ctx context.Context, obj *operator.Status) (map[string]interface{}, error) - DisplayVars(ctx context.Context, obj *operator.Status) (map[string]interface{}, error) -} -type SyncStatusResolver interface { - SyncScheduledAt(ctx context.Context, obj *types.SyncStatus) (string, error) - LastSyncedAt(ctx context.Context, obj *types.SyncStatus) (*string, error) -} -type WorkspaceResolver interface { - Spec(ctx context.Context, obj *entities.Workspace) (*model.WorkspaceSpec, error) + + Type(ctx context.Context, obj *entities.Secret) (*model.K8sIoAPICoreV1SecretType, error) + UpdateTime(ctx context.Context, obj *entities.Secret) (string, error) } type AppInResolver interface { - Spec(ctx context.Context, obj *entities.App, data *model.AppSpecIn) error + Metadata(ctx context.Context, obj *entities.App, data *v12.ObjectMeta) error + Spec(ctx context.Context, obj *entities.App, data *model.GithubComKloudliteOperatorApisCrdsV1AppSpecIn) error } type ConfigInResolver interface { + BinaryData(ctx context.Context, obj *entities.Config, data map[string]interface{}) error Data(ctx context.Context, obj *entities.Config, data map[string]interface{}) error + + Metadata(ctx context.Context, obj *entities.Config, data *v12.ObjectMeta) error } -type ManagedResourceInResolver interface { - Spec(ctx context.Context, obj *entities.MRes, data *model.ManagedResourceSpecIn) error +type ConsoleVPNDeviceInResolver interface { + Metadata(ctx context.Context, obj *entities.ConsoleVPNDevice, data *v12.ObjectMeta) error + + Spec(ctx context.Context, obj *entities.ConsoleVPNDevice, data *model.GithubComKloudliteOperatorApisWireguardV1DeviceSpecIn) error } -type ManagedServiceInResolver interface { - Spec(ctx context.Context, obj *entities.MSvc, data *model.ManagedServiceSpecIn) error +type EnvironmentInResolver interface { + Metadata(ctx context.Context, obj *entities.Environment, data *v12.ObjectMeta) error + Spec(ctx context.Context, obj *entities.Environment, data *model.GithubComKloudliteOperatorApisCrdsV1EnvironmentSpecIn) error } -type MetadataInResolver interface { - Labels(ctx context.Context, obj *v1.ObjectMeta, data map[string]interface{}) error - Annotations(ctx context.Context, obj *v1.ObjectMeta, data map[string]interface{}) error +type ImagePullSecretInResolver interface { + Format(ctx context.Context, obj *entities.ImagePullSecret, data model.GithubComKloudliteAPIAppsConsoleInternalEntitiesPullSecretFormat) error + Metadata(ctx context.Context, obj *entities.ImagePullSecret, data *v12.ObjectMeta) error +} +type ManagedResourceInResolver interface { + Metadata(ctx context.Context, obj *entities.ManagedResource, data *v12.ObjectMeta) error + Spec(ctx context.Context, obj *entities.ManagedResource, data *model.GithubComKloudliteOperatorApisCrdsV1ManagedResourceSpecIn) error } -type PatchInResolver interface { - Value(ctx context.Context, obj *json_patch.PatchOperation, data interface{}) error +type MetadataInResolver interface { + Annotations(ctx context.Context, obj *v12.ObjectMeta, data map[string]interface{}) error + Labels(ctx context.Context, obj *v12.ObjectMeta, data map[string]interface{}) error } type ProjectInResolver interface { - Spec(ctx context.Context, obj *entities.Project, data *model.ProjectSpecIn) error + Metadata(ctx context.Context, obj *entities.Project, data *v12.ObjectMeta) error + Spec(ctx context.Context, obj *entities.Project, data *model.GithubComKloudliteOperatorApisCrdsV1ProjectSpecIn) error +} +type ProjectManagedServiceInResolver interface { + Metadata(ctx context.Context, obj *entities.ProjectManagedService, data *v12.ObjectMeta) error + Spec(ctx context.Context, obj *entities.ProjectManagedService, data *model.GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpecIn) error } type RouterInResolver interface { - Spec(ctx context.Context, obj *entities.Router, data *model.RouterSpecIn) error + Metadata(ctx context.Context, obj *entities.Router, data *v12.ObjectMeta) error + Spec(ctx context.Context, obj *entities.Router, data *model.GithubComKloudliteOperatorApisCrdsV1RouterSpecIn) error } type SecretInResolver interface { Data(ctx context.Context, obj *entities.Secret, data map[string]interface{}) error + Metadata(ctx context.Context, obj *entities.Secret, data *v12.ObjectMeta) error StringData(ctx context.Context, obj *entities.Secret, data map[string]interface{}) error - Type(ctx context.Context, obj *entities.Secret, data *string) error -} -type WorkspaceInResolver interface { - Spec(ctx context.Context, obj *entities.Workspace, data *model.WorkspaceSpecIn) error + Type(ctx context.Context, obj *entities.Secret, data *model.K8sIoAPICoreV1SecretType) error } type executableSchema struct { @@ -664,6 +1096,34 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.App.APIVersion(childComplexity), true + case "App.accountName": + if e.complexity.App.AccountName == nil { + break + } + + return e.complexity.App.AccountName(childComplexity), true + + case "App.createdBy": + if e.complexity.App.CreatedBy == nil { + break + } + + return e.complexity.App.CreatedBy(childComplexity), true + + case "App.creationTime": + if e.complexity.App.CreationTime == nil { + break + } + + return e.complexity.App.CreationTime(childComplexity), true + + case "App.displayName": + if e.complexity.App.DisplayName == nil { + break + } + + return e.complexity.App.DisplayName(childComplexity), true + case "App.enabled": if e.complexity.App.Enabled == nil { break @@ -671,6 +1131,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.App.Enabled(childComplexity), true + case "App.environmentName": + if e.complexity.App.EnvironmentName == nil { + break + } + + return e.complexity.App.EnvironmentName(childComplexity), true + + case "App.id": + if e.complexity.App.ID == nil { + break + } + + return e.complexity.App.ID(childComplexity), true + case "App.kind": if e.complexity.App.Kind == nil { break @@ -678,6 +1152,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.App.Kind(childComplexity), true + case "App.lastUpdatedBy": + if e.complexity.App.LastUpdatedBy == nil { + break + } + + return e.complexity.App.LastUpdatedBy(childComplexity), true + + case "App.markedForDeletion": + if e.complexity.App.MarkedForDeletion == nil { + break + } + + return e.complexity.App.MarkedForDeletion(childComplexity), true + case "App.metadata": if e.complexity.App.ObjectMeta == nil { break @@ -685,19 +1173,19 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.App.ObjectMeta(childComplexity), true - case "App.overrides": - if e.complexity.App.Overrides == nil { + case "App.projectName": + if e.complexity.App.ProjectName == nil { break } - return e.complexity.App.Overrides(childComplexity), true + return e.complexity.App.ProjectName(childComplexity), true - case "App.restart": - if e.complexity.App.Restart == nil { + case "App.recordVersion": + if e.complexity.App.RecordVersion == nil { break } - return e.complexity.App.Restart(childComplexity), true + return e.complexity.App.RecordVersion(childComplexity), true case "App.spec": if e.complexity.App.Spec == nil { @@ -720,10040 +1208,7364 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.App.SyncStatus(childComplexity), true - case "AppSpec.containers": - if e.complexity.AppSpec.Containers == nil { + case "App.updateTime": + if e.complexity.App.UpdateTime == nil { break } - return e.complexity.AppSpec.Containers(childComplexity), true + return e.complexity.App.UpdateTime(childComplexity), true - case "AppSpec.displayName": - if e.complexity.AppSpec.DisplayName == nil { + case "AppEdge.cursor": + if e.complexity.AppEdge.Cursor == nil { break } - return e.complexity.AppSpec.DisplayName(childComplexity), true + return e.complexity.AppEdge.Cursor(childComplexity), true - case "AppSpec.freeze": - if e.complexity.AppSpec.Freeze == nil { + case "AppEdge.node": + if e.complexity.AppEdge.Node == nil { break } - return e.complexity.AppSpec.Freeze(childComplexity), true + return e.complexity.AppEdge.Node(childComplexity), true - case "AppSpec.hpa": - if e.complexity.AppSpec.Hpa == nil { + case "AppPaginatedRecords.edges": + if e.complexity.AppPaginatedRecords.Edges == nil { break } - return e.complexity.AppSpec.Hpa(childComplexity), true + return e.complexity.AppPaginatedRecords.Edges(childComplexity), true - case "AppSpec.intercept": - if e.complexity.AppSpec.Intercept == nil { + case "AppPaginatedRecords.pageInfo": + if e.complexity.AppPaginatedRecords.PageInfo == nil { break } - return e.complexity.AppSpec.Intercept(childComplexity), true + return e.complexity.AppPaginatedRecords.PageInfo(childComplexity), true - case "AppSpec.nodeSelector": - if e.complexity.AppSpec.NodeSelector == nil { + case "AppPaginatedRecords.totalCount": + if e.complexity.AppPaginatedRecords.TotalCount == nil { break } - return e.complexity.AppSpec.NodeSelector(childComplexity), true + return e.complexity.AppPaginatedRecords.TotalCount(childComplexity), true - case "AppSpec.region": - if e.complexity.AppSpec.Region == nil { + case "Config.apiVersion": + if e.complexity.Config.APIVersion == nil { break } - return e.complexity.AppSpec.Region(childComplexity), true + return e.complexity.Config.APIVersion(childComplexity), true - case "AppSpec.replicas": - if e.complexity.AppSpec.Replicas == nil { + case "Config.accountName": + if e.complexity.Config.AccountName == nil { break } - return e.complexity.AppSpec.Replicas(childComplexity), true + return e.complexity.Config.AccountName(childComplexity), true - case "AppSpec.serviceAccount": - if e.complexity.AppSpec.ServiceAccount == nil { + case "Config.binaryData": + if e.complexity.Config.BinaryData == nil { break } - return e.complexity.AppSpec.ServiceAccount(childComplexity), true + return e.complexity.Config.BinaryData(childComplexity), true - case "AppSpec.services": - if e.complexity.AppSpec.Services == nil { + case "Config.createdBy": + if e.complexity.Config.CreatedBy == nil { break } - return e.complexity.AppSpec.Services(childComplexity), true + return e.complexity.Config.CreatedBy(childComplexity), true - case "AppSpec.tolerations": - if e.complexity.AppSpec.Tolerations == nil { + case "Config.creationTime": + if e.complexity.Config.CreationTime == nil { break } - return e.complexity.AppSpec.Tolerations(childComplexity), true + return e.complexity.Config.CreationTime(childComplexity), true - case "AppSpecContainers.args": - if e.complexity.AppSpecContainers.Args == nil { + case "Config.data": + if e.complexity.Config.Data == nil { break } - return e.complexity.AppSpecContainers.Args(childComplexity), true + return e.complexity.Config.Data(childComplexity), true - case "AppSpecContainers.command": - if e.complexity.AppSpecContainers.Command == nil { + case "Config.displayName": + if e.complexity.Config.DisplayName == nil { break } - return e.complexity.AppSpecContainers.Command(childComplexity), true + return e.complexity.Config.DisplayName(childComplexity), true - case "AppSpecContainers.env": - if e.complexity.AppSpecContainers.Env == nil { + case "Config.environmentName": + if e.complexity.Config.EnvironmentName == nil { break } - return e.complexity.AppSpecContainers.Env(childComplexity), true + return e.complexity.Config.EnvironmentName(childComplexity), true - case "AppSpecContainers.envFrom": - if e.complexity.AppSpecContainers.EnvFrom == nil { + case "Config.id": + if e.complexity.Config.ID == nil { break } - return e.complexity.AppSpecContainers.EnvFrom(childComplexity), true + return e.complexity.Config.ID(childComplexity), true - case "AppSpecContainers.image": - if e.complexity.AppSpecContainers.Image == nil { + case "Config.immutable": + if e.complexity.Config.Immutable == nil { break } - return e.complexity.AppSpecContainers.Image(childComplexity), true + return e.complexity.Config.Immutable(childComplexity), true - case "AppSpecContainers.imagePullPolicy": - if e.complexity.AppSpecContainers.ImagePullPolicy == nil { + case "Config.kind": + if e.complexity.Config.Kind == nil { break } - return e.complexity.AppSpecContainers.ImagePullPolicy(childComplexity), true + return e.complexity.Config.Kind(childComplexity), true - case "AppSpecContainers.livenessProbe": - if e.complexity.AppSpecContainers.LivenessProbe == nil { + case "Config.lastUpdatedBy": + if e.complexity.Config.LastUpdatedBy == nil { break } - return e.complexity.AppSpecContainers.LivenessProbe(childComplexity), true + return e.complexity.Config.LastUpdatedBy(childComplexity), true - case "AppSpecContainers.name": - if e.complexity.AppSpecContainers.Name == nil { + case "Config.markedForDeletion": + if e.complexity.Config.MarkedForDeletion == nil { break } - return e.complexity.AppSpecContainers.Name(childComplexity), true + return e.complexity.Config.MarkedForDeletion(childComplexity), true - case "AppSpecContainers.readinessProbe": - if e.complexity.AppSpecContainers.ReadinessProbe == nil { + case "Config.metadata": + if e.complexity.Config.ObjectMeta == nil { break } - return e.complexity.AppSpecContainers.ReadinessProbe(childComplexity), true + return e.complexity.Config.ObjectMeta(childComplexity), true - case "AppSpecContainers.resourceCpu": - if e.complexity.AppSpecContainers.ResourceCPU == nil { + case "Config.projectName": + if e.complexity.Config.ProjectName == nil { break } - return e.complexity.AppSpecContainers.ResourceCPU(childComplexity), true + return e.complexity.Config.ProjectName(childComplexity), true - case "AppSpecContainers.resourceMemory": - if e.complexity.AppSpecContainers.ResourceMemory == nil { + case "Config.recordVersion": + if e.complexity.Config.RecordVersion == nil { break } - return e.complexity.AppSpecContainers.ResourceMemory(childComplexity), true + return e.complexity.Config.RecordVersion(childComplexity), true - case "AppSpecContainers.volumes": - if e.complexity.AppSpecContainers.Volumes == nil { + case "Config.syncStatus": + if e.complexity.Config.SyncStatus == nil { break } - return e.complexity.AppSpecContainers.Volumes(childComplexity), true + return e.complexity.Config.SyncStatus(childComplexity), true - case "AppSpecContainersEnv.key": - if e.complexity.AppSpecContainersEnv.Key == nil { + case "Config.updateTime": + if e.complexity.Config.UpdateTime == nil { break } - return e.complexity.AppSpecContainersEnv.Key(childComplexity), true + return e.complexity.Config.UpdateTime(childComplexity), true - case "AppSpecContainersEnv.optional": - if e.complexity.AppSpecContainersEnv.Optional == nil { + case "ConfigEdge.cursor": + if e.complexity.ConfigEdge.Cursor == nil { break } - return e.complexity.AppSpecContainersEnv.Optional(childComplexity), true + return e.complexity.ConfigEdge.Cursor(childComplexity), true - case "AppSpecContainersEnv.refKey": - if e.complexity.AppSpecContainersEnv.RefKey == nil { + case "ConfigEdge.node": + if e.complexity.ConfigEdge.Node == nil { break } - return e.complexity.AppSpecContainersEnv.RefKey(childComplexity), true + return e.complexity.ConfigEdge.Node(childComplexity), true - case "AppSpecContainersEnv.refName": - if e.complexity.AppSpecContainersEnv.RefName == nil { + case "ConfigKeyRef.configName": + if e.complexity.ConfigKeyRef.ConfigName == nil { break } - return e.complexity.AppSpecContainersEnv.RefName(childComplexity), true + return e.complexity.ConfigKeyRef.ConfigName(childComplexity), true - case "AppSpecContainersEnv.type": - if e.complexity.AppSpecContainersEnv.Type == nil { + case "ConfigKeyRef.key": + if e.complexity.ConfigKeyRef.Key == nil { break } - return e.complexity.AppSpecContainersEnv.Type(childComplexity), true + return e.complexity.ConfigKeyRef.Key(childComplexity), true - case "AppSpecContainersEnv.value": - if e.complexity.AppSpecContainersEnv.Value == nil { + case "ConfigKeyValueRef.configName": + if e.complexity.ConfigKeyValueRef.ConfigName == nil { break } - return e.complexity.AppSpecContainersEnv.Value(childComplexity), true + return e.complexity.ConfigKeyValueRef.ConfigName(childComplexity), true - case "AppSpecContainersEnvFrom.refName": - if e.complexity.AppSpecContainersEnvFrom.RefName == nil { + case "ConfigKeyValueRef.key": + if e.complexity.ConfigKeyValueRef.Key == nil { break } - return e.complexity.AppSpecContainersEnvFrom.RefName(childComplexity), true + return e.complexity.ConfigKeyValueRef.Key(childComplexity), true - case "AppSpecContainersEnvFrom.type": - if e.complexity.AppSpecContainersEnvFrom.Type == nil { + case "ConfigKeyValueRef.value": + if e.complexity.ConfigKeyValueRef.Value == nil { break } - return e.complexity.AppSpecContainersEnvFrom.Type(childComplexity), true + return e.complexity.ConfigKeyValueRef.Value(childComplexity), true - case "AppSpecContainersLivenessProbe.failureThreshold": - if e.complexity.AppSpecContainersLivenessProbe.FailureThreshold == nil { + case "ConfigPaginatedRecords.edges": + if e.complexity.ConfigPaginatedRecords.Edges == nil { break } - return e.complexity.AppSpecContainersLivenessProbe.FailureThreshold(childComplexity), true + return e.complexity.ConfigPaginatedRecords.Edges(childComplexity), true - case "AppSpecContainersLivenessProbe.httpGet": - if e.complexity.AppSpecContainersLivenessProbe.HTTPGet == nil { + case "ConfigPaginatedRecords.pageInfo": + if e.complexity.ConfigPaginatedRecords.PageInfo == nil { break } - return e.complexity.AppSpecContainersLivenessProbe.HTTPGet(childComplexity), true + return e.complexity.ConfigPaginatedRecords.PageInfo(childComplexity), true - case "AppSpecContainersLivenessProbe.initialDelay": - if e.complexity.AppSpecContainersLivenessProbe.InitialDelay == nil { + case "ConfigPaginatedRecords.totalCount": + if e.complexity.ConfigPaginatedRecords.TotalCount == nil { break } - return e.complexity.AppSpecContainersLivenessProbe.InitialDelay(childComplexity), true + return e.complexity.ConfigPaginatedRecords.TotalCount(childComplexity), true - case "AppSpecContainersLivenessProbe.interval": - if e.complexity.AppSpecContainersLivenessProbe.Interval == nil { + case "ConsoleCheckNameAvailabilityOutput.result": + if e.complexity.ConsoleCheckNameAvailabilityOutput.Result == nil { break } - return e.complexity.AppSpecContainersLivenessProbe.Interval(childComplexity), true + return e.complexity.ConsoleCheckNameAvailabilityOutput.Result(childComplexity), true - case "AppSpecContainersLivenessProbe.shell": - if e.complexity.AppSpecContainersLivenessProbe.Shell == nil { + case "ConsoleCheckNameAvailabilityOutput.suggestedNames": + if e.complexity.ConsoleCheckNameAvailabilityOutput.SuggestedNames == nil { break } - return e.complexity.AppSpecContainersLivenessProbe.Shell(childComplexity), true + return e.complexity.ConsoleCheckNameAvailabilityOutput.SuggestedNames(childComplexity), true - case "AppSpecContainersLivenessProbe.tcp": - if e.complexity.AppSpecContainersLivenessProbe.TCP == nil { + case "ConsoleVPNDevice.apiVersion": + if e.complexity.ConsoleVPNDevice.APIVersion == nil { break } - return e.complexity.AppSpecContainersLivenessProbe.TCP(childComplexity), true + return e.complexity.ConsoleVPNDevice.APIVersion(childComplexity), true - case "AppSpecContainersLivenessProbe.type": - if e.complexity.AppSpecContainersLivenessProbe.Type == nil { + case "ConsoleVPNDevice.accountName": + if e.complexity.ConsoleVPNDevice.AccountName == nil { break } - return e.complexity.AppSpecContainersLivenessProbe.Type(childComplexity), true + return e.complexity.ConsoleVPNDevice.AccountName(childComplexity), true - case "AppSpecContainersLivenessProbeHttpGet.httpHeaders": - if e.complexity.AppSpecContainersLivenessProbeHttpGet.HTTPHeaders == nil { + case "ConsoleVPNDevice.clusterName": + if e.complexity.ConsoleVPNDevice.ClusterName == nil { break } - return e.complexity.AppSpecContainersLivenessProbeHttpGet.HTTPHeaders(childComplexity), true + return e.complexity.ConsoleVPNDevice.ClusterName(childComplexity), true - case "AppSpecContainersLivenessProbeHttpGet.path": - if e.complexity.AppSpecContainersLivenessProbeHttpGet.Path == nil { + case "ConsoleVPNDevice.createdBy": + if e.complexity.ConsoleVPNDevice.CreatedBy == nil { break } - return e.complexity.AppSpecContainersLivenessProbeHttpGet.Path(childComplexity), true + return e.complexity.ConsoleVPNDevice.CreatedBy(childComplexity), true - case "AppSpecContainersLivenessProbeHttpGet.port": - if e.complexity.AppSpecContainersLivenessProbeHttpGet.Port == nil { + case "ConsoleVPNDevice.creationTime": + if e.complexity.ConsoleVPNDevice.CreationTime == nil { break } - return e.complexity.AppSpecContainersLivenessProbeHttpGet.Port(childComplexity), true + return e.complexity.ConsoleVPNDevice.CreationTime(childComplexity), true - case "AppSpecContainersLivenessProbeShell.command": - if e.complexity.AppSpecContainersLivenessProbeShell.Command == nil { + case "ConsoleVPNDevice.displayName": + if e.complexity.ConsoleVPNDevice.DisplayName == nil { break } - return e.complexity.AppSpecContainersLivenessProbeShell.Command(childComplexity), true + return e.complexity.ConsoleVPNDevice.DisplayName(childComplexity), true - case "AppSpecContainersLivenessProbeTcp.port": - if e.complexity.AppSpecContainersLivenessProbeTcp.Port == nil { + case "ConsoleVPNDevice.environmentName": + if e.complexity.ConsoleVPNDevice.EnvironmentName == nil { break } - return e.complexity.AppSpecContainersLivenessProbeTcp.Port(childComplexity), true + return e.complexity.ConsoleVPNDevice.EnvironmentName(childComplexity), true - case "AppSpecContainersReadinessProbe.failureThreshold": - if e.complexity.AppSpecContainersReadinessProbe.FailureThreshold == nil { + case "ConsoleVPNDevice.id": + if e.complexity.ConsoleVPNDevice.ID == nil { break } - return e.complexity.AppSpecContainersReadinessProbe.FailureThreshold(childComplexity), true + return e.complexity.ConsoleVPNDevice.ID(childComplexity), true - case "AppSpecContainersReadinessProbe.httpGet": - if e.complexity.AppSpecContainersReadinessProbe.HTTPGet == nil { + case "ConsoleVPNDevice.kind": + if e.complexity.ConsoleVPNDevice.Kind == nil { break } - return e.complexity.AppSpecContainersReadinessProbe.HTTPGet(childComplexity), true + return e.complexity.ConsoleVPNDevice.Kind(childComplexity), true - case "AppSpecContainersReadinessProbe.initialDelay": - if e.complexity.AppSpecContainersReadinessProbe.InitialDelay == nil { + case "ConsoleVPNDevice.lastUpdatedBy": + if e.complexity.ConsoleVPNDevice.LastUpdatedBy == nil { break } - return e.complexity.AppSpecContainersReadinessProbe.InitialDelay(childComplexity), true + return e.complexity.ConsoleVPNDevice.LastUpdatedBy(childComplexity), true - case "AppSpecContainersReadinessProbe.interval": - if e.complexity.AppSpecContainersReadinessProbe.Interval == nil { + case "ConsoleVPNDevice.linkedClusters": + if e.complexity.ConsoleVPNDevice.LinkedClusters == nil { break } - return e.complexity.AppSpecContainersReadinessProbe.Interval(childComplexity), true + return e.complexity.ConsoleVPNDevice.LinkedClusters(childComplexity), true - case "AppSpecContainersReadinessProbe.shell": - if e.complexity.AppSpecContainersReadinessProbe.Shell == nil { + case "ConsoleVPNDevice.markedForDeletion": + if e.complexity.ConsoleVPNDevice.MarkedForDeletion == nil { break } - return e.complexity.AppSpecContainersReadinessProbe.Shell(childComplexity), true + return e.complexity.ConsoleVPNDevice.MarkedForDeletion(childComplexity), true - case "AppSpecContainersReadinessProbe.tcp": - if e.complexity.AppSpecContainersReadinessProbe.TCP == nil { + case "ConsoleVPNDevice.metadata": + if e.complexity.ConsoleVPNDevice.ObjectMeta == nil { break } - return e.complexity.AppSpecContainersReadinessProbe.TCP(childComplexity), true + return e.complexity.ConsoleVPNDevice.ObjectMeta(childComplexity), true - case "AppSpecContainersReadinessProbe.type": - if e.complexity.AppSpecContainersReadinessProbe.Type == nil { + case "ConsoleVPNDevice.projectName": + if e.complexity.ConsoleVPNDevice.ProjectName == nil { break } - return e.complexity.AppSpecContainersReadinessProbe.Type(childComplexity), true + return e.complexity.ConsoleVPNDevice.ProjectName(childComplexity), true - case "AppSpecContainersReadinessProbeHttpGet.httpHeaders": - if e.complexity.AppSpecContainersReadinessProbeHttpGet.HTTPHeaders == nil { + case "ConsoleVPNDevice.recordVersion": + if e.complexity.ConsoleVPNDevice.RecordVersion == nil { break } - return e.complexity.AppSpecContainersReadinessProbeHttpGet.HTTPHeaders(childComplexity), true + return e.complexity.ConsoleVPNDevice.RecordVersion(childComplexity), true - case "AppSpecContainersReadinessProbeHttpGet.path": - if e.complexity.AppSpecContainersReadinessProbeHttpGet.Path == nil { + case "ConsoleVPNDevice.spec": + if e.complexity.ConsoleVPNDevice.Spec == nil { break } - return e.complexity.AppSpecContainersReadinessProbeHttpGet.Path(childComplexity), true + return e.complexity.ConsoleVPNDevice.Spec(childComplexity), true - case "AppSpecContainersReadinessProbeHttpGet.port": - if e.complexity.AppSpecContainersReadinessProbeHttpGet.Port == nil { + case "ConsoleVPNDevice.status": + if e.complexity.ConsoleVPNDevice.Status == nil { break } - return e.complexity.AppSpecContainersReadinessProbeHttpGet.Port(childComplexity), true + return e.complexity.ConsoleVPNDevice.Status(childComplexity), true - case "AppSpecContainersReadinessProbeShell.command": - if e.complexity.AppSpecContainersReadinessProbeShell.Command == nil { + case "ConsoleVPNDevice.syncStatus": + if e.complexity.ConsoleVPNDevice.SyncStatus == nil { break } - return e.complexity.AppSpecContainersReadinessProbeShell.Command(childComplexity), true + return e.complexity.ConsoleVPNDevice.SyncStatus(childComplexity), true - case "AppSpecContainersReadinessProbeTcp.port": - if e.complexity.AppSpecContainersReadinessProbeTcp.Port == nil { + case "ConsoleVPNDevice.updateTime": + if e.complexity.ConsoleVPNDevice.UpdateTime == nil { break } - return e.complexity.AppSpecContainersReadinessProbeTcp.Port(childComplexity), true + return e.complexity.ConsoleVPNDevice.UpdateTime(childComplexity), true - case "AppSpecContainersResourceCpu.max": - if e.complexity.AppSpecContainersResourceCpu.Max == nil { + case "ConsoleVPNDevice.wireguardConfig": + if e.complexity.ConsoleVPNDevice.WireguardConfig == nil { break } - return e.complexity.AppSpecContainersResourceCpu.Max(childComplexity), true + return e.complexity.ConsoleVPNDevice.WireguardConfig(childComplexity), true - case "AppSpecContainersResourceCpu.min": - if e.complexity.AppSpecContainersResourceCpu.Min == nil { + case "ConsoleVPNDeviceEdge.cursor": + if e.complexity.ConsoleVPNDeviceEdge.Cursor == nil { break } - return e.complexity.AppSpecContainersResourceCpu.Min(childComplexity), true + return e.complexity.ConsoleVPNDeviceEdge.Cursor(childComplexity), true - case "AppSpecContainersResourceMemory.max": - if e.complexity.AppSpecContainersResourceMemory.Max == nil { + case "ConsoleVPNDeviceEdge.node": + if e.complexity.ConsoleVPNDeviceEdge.Node == nil { break } - return e.complexity.AppSpecContainersResourceMemory.Max(childComplexity), true + return e.complexity.ConsoleVPNDeviceEdge.Node(childComplexity), true - case "AppSpecContainersResourceMemory.min": - if e.complexity.AppSpecContainersResourceMemory.Min == nil { + case "ConsoleVPNDevicePaginatedRecords.edges": + if e.complexity.ConsoleVPNDevicePaginatedRecords.Edges == nil { break } - return e.complexity.AppSpecContainersResourceMemory.Min(childComplexity), true + return e.complexity.ConsoleVPNDevicePaginatedRecords.Edges(childComplexity), true - case "AppSpecContainersVolumes.items": - if e.complexity.AppSpecContainersVolumes.Items == nil { + case "ConsoleVPNDevicePaginatedRecords.pageInfo": + if e.complexity.ConsoleVPNDevicePaginatedRecords.PageInfo == nil { break } - return e.complexity.AppSpecContainersVolumes.Items(childComplexity), true + return e.complexity.ConsoleVPNDevicePaginatedRecords.PageInfo(childComplexity), true - case "AppSpecContainersVolumes.mountPath": - if e.complexity.AppSpecContainersVolumes.MountPath == nil { + case "ConsoleVPNDevicePaginatedRecords.totalCount": + if e.complexity.ConsoleVPNDevicePaginatedRecords.TotalCount == nil { break } - return e.complexity.AppSpecContainersVolumes.MountPath(childComplexity), true + return e.complexity.ConsoleVPNDevicePaginatedRecords.TotalCount(childComplexity), true - case "AppSpecContainersVolumes.refName": - if e.complexity.AppSpecContainersVolumes.RefName == nil { + case "CursorPagination.after": + if e.complexity.CursorPagination.After == nil { break } - return e.complexity.AppSpecContainersVolumes.RefName(childComplexity), true + return e.complexity.CursorPagination.After(childComplexity), true - case "AppSpecContainersVolumes.type": - if e.complexity.AppSpecContainersVolumes.Type == nil { + case "CursorPagination.before": + if e.complexity.CursorPagination.Before == nil { break } - return e.complexity.AppSpecContainersVolumes.Type(childComplexity), true + return e.complexity.CursorPagination.Before(childComplexity), true - case "AppSpecContainersVolumesItems.fileName": - if e.complexity.AppSpecContainersVolumesItems.FileName == nil { + case "CursorPagination.first": + if e.complexity.CursorPagination.First == nil { break } - return e.complexity.AppSpecContainersVolumesItems.FileName(childComplexity), true + return e.complexity.CursorPagination.First(childComplexity), true - case "AppSpecContainersVolumesItems.key": - if e.complexity.AppSpecContainersVolumesItems.Key == nil { + case "CursorPagination.last": + if e.complexity.CursorPagination.Last == nil { break } - return e.complexity.AppSpecContainersVolumesItems.Key(childComplexity), true + return e.complexity.CursorPagination.Last(childComplexity), true - case "AppSpecHpa.enabled": - if e.complexity.AppSpecHpa.Enabled == nil { + case "CursorPagination.orderBy": + if e.complexity.CursorPagination.OrderBy == nil { break } - return e.complexity.AppSpecHpa.Enabled(childComplexity), true + return e.complexity.CursorPagination.OrderBy(childComplexity), true - case "AppSpecHpa.maxReplicas": - if e.complexity.AppSpecHpa.MaxReplicas == nil { + case "CursorPagination.sortDirection": + if e.complexity.CursorPagination.SortDirection == nil { break } - return e.complexity.AppSpecHpa.MaxReplicas(childComplexity), true + return e.complexity.CursorPagination.SortDirection(childComplexity), true - case "AppSpecHpa.minReplicas": - if e.complexity.AppSpecHpa.MinReplicas == nil { + case "Environment.apiVersion": + if e.complexity.Environment.APIVersion == nil { break } - return e.complexity.AppSpecHpa.MinReplicas(childComplexity), true + return e.complexity.Environment.APIVersion(childComplexity), true - case "AppSpecHpa.thresholdCpu": - if e.complexity.AppSpecHpa.ThresholdCPU == nil { + case "Environment.accountName": + if e.complexity.Environment.AccountName == nil { break } - return e.complexity.AppSpecHpa.ThresholdCPU(childComplexity), true + return e.complexity.Environment.AccountName(childComplexity), true - case "AppSpecHpa.thresholdMemory": - if e.complexity.AppSpecHpa.ThresholdMemory == nil { + case "Environment.createdBy": + if e.complexity.Environment.CreatedBy == nil { break } - return e.complexity.AppSpecHpa.ThresholdMemory(childComplexity), true + return e.complexity.Environment.CreatedBy(childComplexity), true - case "AppSpecIntercept.enabled": - if e.complexity.AppSpecIntercept.Enabled == nil { + case "Environment.creationTime": + if e.complexity.Environment.CreationTime == nil { break } - return e.complexity.AppSpecIntercept.Enabled(childComplexity), true + return e.complexity.Environment.CreationTime(childComplexity), true - case "AppSpecIntercept.toDevice": - if e.complexity.AppSpecIntercept.ToDevice == nil { + case "Environment.displayName": + if e.complexity.Environment.DisplayName == nil { break } - return e.complexity.AppSpecIntercept.ToDevice(childComplexity), true + return e.complexity.Environment.DisplayName(childComplexity), true - case "AppSpecServices.name": - if e.complexity.AppSpecServices.Name == nil { + case "Environment.id": + if e.complexity.Environment.ID == nil { break } - return e.complexity.AppSpecServices.Name(childComplexity), true + return e.complexity.Environment.ID(childComplexity), true - case "AppSpecServices.port": - if e.complexity.AppSpecServices.Port == nil { + case "Environment.kind": + if e.complexity.Environment.Kind == nil { break } - return e.complexity.AppSpecServices.Port(childComplexity), true + return e.complexity.Environment.Kind(childComplexity), true - case "AppSpecServices.targetPort": - if e.complexity.AppSpecServices.TargetPort == nil { + case "Environment.lastUpdatedBy": + if e.complexity.Environment.LastUpdatedBy == nil { break } - return e.complexity.AppSpecServices.TargetPort(childComplexity), true + return e.complexity.Environment.LastUpdatedBy(childComplexity), true - case "AppSpecServices.type": - if e.complexity.AppSpecServices.Type == nil { + case "Environment.markedForDeletion": + if e.complexity.Environment.MarkedForDeletion == nil { break } - return e.complexity.AppSpecServices.Type(childComplexity), true + return e.complexity.Environment.MarkedForDeletion(childComplexity), true - case "AppSpecTolerations.effect": - if e.complexity.AppSpecTolerations.Effect == nil { + case "Environment.metadata": + if e.complexity.Environment.ObjectMeta == nil { break } - return e.complexity.AppSpecTolerations.Effect(childComplexity), true + return e.complexity.Environment.ObjectMeta(childComplexity), true - case "AppSpecTolerations.key": - if e.complexity.AppSpecTolerations.Key == nil { + case "Environment.projectName": + if e.complexity.Environment.ProjectName == nil { break } - return e.complexity.AppSpecTolerations.Key(childComplexity), true + return e.complexity.Environment.ProjectName(childComplexity), true - case "AppSpecTolerations.operator": - if e.complexity.AppSpecTolerations.Operator == nil { + case "Environment.recordVersion": + if e.complexity.Environment.RecordVersion == nil { break } - return e.complexity.AppSpecTolerations.Operator(childComplexity), true + return e.complexity.Environment.RecordVersion(childComplexity), true - case "AppSpecTolerations.tolerationSeconds": - if e.complexity.AppSpecTolerations.TolerationSeconds == nil { + case "Environment.spec": + if e.complexity.Environment.Spec == nil { break } - return e.complexity.AppSpecTolerations.TolerationSeconds(childComplexity), true + return e.complexity.Environment.Spec(childComplexity), true - case "AppSpecTolerations.value": - if e.complexity.AppSpecTolerations.Value == nil { + case "Environment.status": + if e.complexity.Environment.Status == nil { break } - return e.complexity.AppSpecTolerations.Value(childComplexity), true + return e.complexity.Environment.Status(childComplexity), true - case "Check.generation": - if e.complexity.Check.Generation == nil { + case "Environment.syncStatus": + if e.complexity.Environment.SyncStatus == nil { break } - return e.complexity.Check.Generation(childComplexity), true + return e.complexity.Environment.SyncStatus(childComplexity), true - case "Check.message": - if e.complexity.Check.Message == nil { + case "Environment.updateTime": + if e.complexity.Environment.UpdateTime == nil { break } - return e.complexity.Check.Message(childComplexity), true + return e.complexity.Environment.UpdateTime(childComplexity), true - case "Check.status": - if e.complexity.Check.Status == nil { + case "EnvironmentEdge.cursor": + if e.complexity.EnvironmentEdge.Cursor == nil { break } - return e.complexity.Check.Status(childComplexity), true + return e.complexity.EnvironmentEdge.Cursor(childComplexity), true - case "Config.apiVersion": - if e.complexity.Config.APIVersion == nil { + case "EnvironmentEdge.node": + if e.complexity.EnvironmentEdge.Node == nil { break } - return e.complexity.Config.APIVersion(childComplexity), true + return e.complexity.EnvironmentEdge.Node(childComplexity), true - case "Config.data": - if e.complexity.Config.Data == nil { + case "EnvironmentPaginatedRecords.edges": + if e.complexity.EnvironmentPaginatedRecords.Edges == nil { break } - return e.complexity.Config.Data(childComplexity), true + return e.complexity.EnvironmentPaginatedRecords.Edges(childComplexity), true - case "Config.enabled": - if e.complexity.Config.Enabled == nil { + case "EnvironmentPaginatedRecords.pageInfo": + if e.complexity.EnvironmentPaginatedRecords.PageInfo == nil { break } - return e.complexity.Config.Enabled(childComplexity), true + return e.complexity.EnvironmentPaginatedRecords.PageInfo(childComplexity), true - case "Config.kind": - if e.complexity.Config.Kind == nil { + case "EnvironmentPaginatedRecords.totalCount": + if e.complexity.EnvironmentPaginatedRecords.TotalCount == nil { break } - return e.complexity.Config.Kind(childComplexity), true + return e.complexity.EnvironmentPaginatedRecords.TotalCount(childComplexity), true - case "Config.metadata": - if e.complexity.Config.ObjectMeta == nil { + case "Github__com___kloudlite___api___common__CreatedOrUpdatedBy.userEmail": + if e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserEmail == nil { break } - return e.complexity.Config.ObjectMeta(childComplexity), true + return e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserEmail(childComplexity), true - case "Config.overrides": - if e.complexity.Config.Overrides == nil { + case "Github__com___kloudlite___api___common__CreatedOrUpdatedBy.userId": + if e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserID == nil { break } - return e.complexity.Config.Overrides(childComplexity), true + return e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserID(childComplexity), true - case "Config.status": - if e.complexity.Config.Status == nil { + case "Github__com___kloudlite___api___common__CreatedOrUpdatedBy.userName": + if e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserName == nil { break } - return e.complexity.Config.Status(childComplexity), true + return e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserName(childComplexity), true - case "Config.syncStatus": - if e.complexity.Config.SyncStatus == nil { + case "Github__com___kloudlite___api___pkg___types__EncodedString.encoding": + if e.complexity.Github__com___kloudlite___api___pkg___types__EncodedString.Encoding == nil { break } - return e.complexity.Config.SyncStatus(childComplexity), true + return e.complexity.Github__com___kloudlite___api___pkg___types__EncodedString.Encoding(childComplexity), true - case "ConsoleCheckNameAvailabilityOutput.result": - if e.complexity.ConsoleCheckNameAvailabilityOutput.Result == nil { + case "Github__com___kloudlite___api___pkg___types__EncodedString.value": + if e.complexity.Github__com___kloudlite___api___pkg___types__EncodedString.Value == nil { break } - return e.complexity.ConsoleCheckNameAvailabilityOutput.Result(childComplexity), true + return e.complexity.Github__com___kloudlite___api___pkg___types__EncodedString.Value(childComplexity), true - case "ConsoleCheckNameAvailabilityOutput.suggestedNames": - if e.complexity.ConsoleCheckNameAvailabilityOutput.SuggestedNames == nil { + case "Github__com___kloudlite___api___pkg___types__SyncStatus.action": + if e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.Action == nil { break } - return e.complexity.ConsoleCheckNameAvailabilityOutput.SuggestedNames(childComplexity), true + return e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.Action(childComplexity), true - case "ManagedResource.apiVersion": - if e.complexity.ManagedResource.APIVersion == nil { + case "Github__com___kloudlite___api___pkg___types__SyncStatus.error": + if e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.Error == nil { break } - return e.complexity.ManagedResource.APIVersion(childComplexity), true + return e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.Error(childComplexity), true - case "ManagedResource.enabled": - if e.complexity.ManagedResource.Enabled == nil { + case "Github__com___kloudlite___api___pkg___types__SyncStatus.lastSyncedAt": + if e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.LastSyncedAt == nil { break } - return e.complexity.ManagedResource.Enabled(childComplexity), true + return e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.LastSyncedAt(childComplexity), true - case "ManagedResource.kind": - if e.complexity.ManagedResource.Kind == nil { + case "Github__com___kloudlite___api___pkg___types__SyncStatus.recordVersion": + if e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.RecordVersion == nil { break } - return e.complexity.ManagedResource.Kind(childComplexity), true + return e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.RecordVersion(childComplexity), true - case "ManagedResource.metadata": - if e.complexity.ManagedResource.ObjectMeta == nil { + case "Github__com___kloudlite___api___pkg___types__SyncStatus.state": + if e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.State == nil { break } - return e.complexity.ManagedResource.ObjectMeta(childComplexity), true + return e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.State(childComplexity), true - case "ManagedResource.overrides": - if e.complexity.ManagedResource.Overrides == nil { + case "Github__com___kloudlite___api___pkg___types__SyncStatus.syncScheduledAt": + if e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.SyncScheduledAt == nil { break } - return e.complexity.ManagedResource.Overrides(childComplexity), true + return e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.SyncScheduledAt(childComplexity), true - case "ManagedResource.spec": - if e.complexity.ManagedResource.Spec == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__AppContainer.args": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppContainer.Args == nil { break } - return e.complexity.ManagedResource.Spec(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppContainer.Args(childComplexity), true - case "ManagedResource.status": - if e.complexity.ManagedResource.Status == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__AppContainer.command": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppContainer.Command == nil { break } - return e.complexity.ManagedResource.Status(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppContainer.Command(childComplexity), true - case "ManagedResource.syncStatus": - if e.complexity.ManagedResource.SyncStatus == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__AppContainer.env": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppContainer.Env == nil { break } - return e.complexity.ManagedResource.SyncStatus(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppContainer.Env(childComplexity), true - case "ManagedResourceSpec.inputs": - if e.complexity.ManagedResourceSpec.Inputs == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__AppContainer.envFrom": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppContainer.EnvFrom == nil { break } - return e.complexity.ManagedResourceSpec.Inputs(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppContainer.EnvFrom(childComplexity), true - case "ManagedResourceSpec.mresKind": - if e.complexity.ManagedResourceSpec.MresKind == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__AppContainer.image": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppContainer.Image == nil { break } - return e.complexity.ManagedResourceSpec.MresKind(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppContainer.Image(childComplexity), true - case "ManagedResourceSpec.msvcRef": - if e.complexity.ManagedResourceSpec.MsvcRef == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__AppContainer.imagePullPolicy": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppContainer.ImagePullPolicy == nil { break } - return e.complexity.ManagedResourceSpec.MsvcRef(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppContainer.ImagePullPolicy(childComplexity), true - case "ManagedResourceSpecMresKind.kind": - if e.complexity.ManagedResourceSpecMresKind.Kind == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__AppContainer.livenessProbe": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppContainer.LivenessProbe == nil { break } - return e.complexity.ManagedResourceSpecMresKind.Kind(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppContainer.LivenessProbe(childComplexity), true - case "ManagedResourceSpecMsvcRef.apiVersion": - if e.complexity.ManagedResourceSpecMsvcRef.APIVersion == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__AppContainer.name": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppContainer.Name == nil { break } - return e.complexity.ManagedResourceSpecMsvcRef.APIVersion(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppContainer.Name(childComplexity), true - case "ManagedResourceSpecMsvcRef.kind": - if e.complexity.ManagedResourceSpecMsvcRef.Kind == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__AppContainer.readinessProbe": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppContainer.ReadinessProbe == nil { break } - return e.complexity.ManagedResourceSpecMsvcRef.Kind(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppContainer.ReadinessProbe(childComplexity), true - case "ManagedResourceSpecMsvcRef.name": - if e.complexity.ManagedResourceSpecMsvcRef.Name == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__AppContainer.resourceCpu": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppContainer.ResourceCPU == nil { break } - return e.complexity.ManagedResourceSpecMsvcRef.Name(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppContainer.ResourceCPU(childComplexity), true - case "ManagedService.apiVersion": - if e.complexity.ManagedService.APIVersion == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__AppContainer.resourceMemory": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppContainer.ResourceMemory == nil { break } - return e.complexity.ManagedService.APIVersion(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppContainer.ResourceMemory(childComplexity), true - case "ManagedService.enabled": - if e.complexity.ManagedService.Enabled == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__AppContainer.volumes": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppContainer.Volumes == nil { break } - return e.complexity.ManagedService.Enabled(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppContainer.Volumes(childComplexity), true - case "ManagedService.kind": - if e.complexity.ManagedService.Kind == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__AppSpec.containers": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSpec.Containers == nil { break } - return e.complexity.ManagedService.Kind(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSpec.Containers(childComplexity), true - case "ManagedService.metadata": - if e.complexity.ManagedService.ObjectMeta == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__AppSpec.displayName": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSpec.DisplayName == nil { break } - return e.complexity.ManagedService.ObjectMeta(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSpec.DisplayName(childComplexity), true - case "ManagedService.overrides": - if e.complexity.ManagedService.Overrides == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__AppSpec.freeze": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSpec.Freeze == nil { break } - return e.complexity.ManagedService.Overrides(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSpec.Freeze(childComplexity), true - case "ManagedService.spec": - if e.complexity.ManagedService.Spec == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__AppSpec.hpa": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSpec.Hpa == nil { break } - return e.complexity.ManagedService.Spec(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSpec.Hpa(childComplexity), true - case "ManagedService.status": - if e.complexity.ManagedService.Status == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__AppSpec.intercept": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSpec.Intercept == nil { break } - return e.complexity.ManagedService.Status(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSpec.Intercept(childComplexity), true - case "ManagedService.syncStatus": - if e.complexity.ManagedService.SyncStatus == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__AppSpec.nodeSelector": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSpec.NodeSelector == nil { break } - return e.complexity.ManagedService.SyncStatus(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSpec.NodeSelector(childComplexity), true - case "ManagedServiceSpec.inputs": - if e.complexity.ManagedServiceSpec.Inputs == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__AppSpec.region": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSpec.Region == nil { break } - return e.complexity.ManagedServiceSpec.Inputs(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSpec.Region(childComplexity), true - case "ManagedServiceSpec.msvcKind": - if e.complexity.ManagedServiceSpec.MsvcKind == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__AppSpec.replicas": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSpec.Replicas == nil { break } - return e.complexity.ManagedServiceSpec.MsvcKind(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSpec.Replicas(childComplexity), true - case "ManagedServiceSpec.nodeSelector": - if e.complexity.ManagedServiceSpec.NodeSelector == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__AppSpec.serviceAccount": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSpec.ServiceAccount == nil { break } - return e.complexity.ManagedServiceSpec.NodeSelector(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSpec.ServiceAccount(childComplexity), true - case "ManagedServiceSpec.region": - if e.complexity.ManagedServiceSpec.Region == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__AppSpec.services": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSpec.Services == nil { break } - return e.complexity.ManagedServiceSpec.Region(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSpec.Services(childComplexity), true - case "ManagedServiceSpec.tolerations": - if e.complexity.ManagedServiceSpec.Tolerations == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__AppSpec.tolerations": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSpec.Tolerations == nil { break } - return e.complexity.ManagedServiceSpec.Tolerations(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSpec.Tolerations(childComplexity), true - case "ManagedServiceSpecMsvcKind.apiVersion": - if e.complexity.ManagedServiceSpecMsvcKind.APIVersion == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__AppSvc.name": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSvc.Name == nil { break } - return e.complexity.ManagedServiceSpecMsvcKind.APIVersion(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSvc.Name(childComplexity), true - case "ManagedServiceSpecMsvcKind.kind": - if e.complexity.ManagedServiceSpecMsvcKind.Kind == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__AppSvc.port": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSvc.Port == nil { break } - return e.complexity.ManagedServiceSpecMsvcKind.Kind(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSvc.Port(childComplexity), true - case "ManagedServiceSpecTolerations.effect": - if e.complexity.ManagedServiceSpecTolerations.Effect == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__AppSvc.targetPort": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSvc.TargetPort == nil { break } - return e.complexity.ManagedServiceSpecTolerations.Effect(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSvc.TargetPort(childComplexity), true - case "ManagedServiceSpecTolerations.key": - if e.complexity.ManagedServiceSpecTolerations.Key == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__AppSvc.type": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSvc.Type == nil { break } - return e.complexity.ManagedServiceSpecTolerations.Key(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSvc.Type(childComplexity), true - case "ManagedServiceSpecTolerations.operator": - if e.complexity.ManagedServiceSpecTolerations.Operator == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__BasicAuth.enabled": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__BasicAuth.Enabled == nil { break } - return e.complexity.ManagedServiceSpecTolerations.Operator(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__BasicAuth.Enabled(childComplexity), true - case "ManagedServiceSpecTolerations.tolerationSeconds": - if e.complexity.ManagedServiceSpecTolerations.TolerationSeconds == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__BasicAuth.secretName": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__BasicAuth.SecretName == nil { break } - return e.complexity.ManagedServiceSpecTolerations.TolerationSeconds(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__BasicAuth.SecretName(childComplexity), true - case "ManagedServiceSpecTolerations.value": - if e.complexity.ManagedServiceSpecTolerations.Value == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__BasicAuth.username": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__BasicAuth.Username == nil { break } - return e.complexity.ManagedServiceSpecTolerations.Value(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__BasicAuth.Username(childComplexity), true - case "Metadata.annotations": - if e.complexity.Metadata.Annotations == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv.key": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv.Key == nil { break } - return e.complexity.Metadata.Annotations(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv.Key(childComplexity), true - case "Metadata.creationTimestamp": - if e.complexity.Metadata.CreationTimestamp == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv.optional": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv.Optional == nil { break } - return e.complexity.Metadata.CreationTimestamp(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv.Optional(childComplexity), true - case "Metadata.deletionTimestamp": - if e.complexity.Metadata.DeletionTimestamp == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv.refKey": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv.RefKey == nil { break } - return e.complexity.Metadata.DeletionTimestamp(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv.RefKey(childComplexity), true - case "Metadata.generation": - if e.complexity.Metadata.Generation == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv.refName": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv.RefName == nil { break } - return e.complexity.Metadata.Generation(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv.RefName(childComplexity), true - case "Metadata.labels": - if e.complexity.Metadata.Labels == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv.type": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv.Type == nil { break } - return e.complexity.Metadata.Labels(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv.Type(childComplexity), true - case "Metadata.name": - if e.complexity.Metadata.Name == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv.value": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv.Value == nil { break } - return e.complexity.Metadata.Name(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv.Value(childComplexity), true - case "Metadata.namespace": - if e.complexity.Metadata.Namespace == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__ContainerResource.max": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ContainerResource.Max == nil { break } - return e.complexity.Metadata.Namespace(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ContainerResource.Max(childComplexity), true - case "Mutation.core_createApp": - if e.complexity.Mutation.CoreCreateApp == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__ContainerResource.min": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ContainerResource.Min == nil { break } - args, err := ec.field_Mutation_core_createApp_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ContainerResource.Min(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume.items": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume.Items == nil { + break } - return e.complexity.Mutation.CoreCreateApp(childComplexity, args["app"].(entities.App)), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume.Items(childComplexity), true - case "Mutation.core_createConfig": - if e.complexity.Mutation.CoreCreateConfig == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume.mountPath": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume.MountPath == nil { break } - args, err := ec.field_Mutation_core_createConfig_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume.MountPath(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume.refName": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume.RefName == nil { + break } - return e.complexity.Mutation.CoreCreateConfig(childComplexity, args["config"].(entities.Config)), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume.RefName(childComplexity), true - case "Mutation.core_createManagedResource": - if e.complexity.Mutation.CoreCreateManagedResource == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume.type": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume.Type == nil { break } - args, err := ec.field_Mutation_core_createManagedResource_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume.Type(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem.fileName": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem.FileName == nil { + break } - return e.complexity.Mutation.CoreCreateManagedResource(childComplexity, args["mres"].(entities.MRes)), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem.FileName(childComplexity), true - case "Mutation.core_createManagedService": - if e.complexity.Mutation.CoreCreateManagedService == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem.key": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem.Key == nil { break } - args, err := ec.field_Mutation_core_createManagedService_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem.Key(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__Cors.allowCredentials": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Cors.AllowCredentials == nil { + break } - return e.complexity.Mutation.CoreCreateManagedService(childComplexity, args["msvc"].(entities.MSvc)), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Cors.AllowCredentials(childComplexity), true - case "Mutation.core_createProject": - if e.complexity.Mutation.CoreCreateProject == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__Cors.enabled": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Cors.Enabled == nil { break } - args, err := ec.field_Mutation_core_createProject_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Cors.Enabled(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__Cors.origins": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Cors.Origins == nil { + break } - return e.complexity.Mutation.CoreCreateProject(childComplexity, args["project"].(entities.Project)), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Cors.Origins(childComplexity), true - case "Mutation.core_createRouter": - if e.complexity.Mutation.CoreCreateRouter == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__EnvFrom.refName": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__EnvFrom.RefName == nil { break } - args, err := ec.field_Mutation_core_createRouter_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__EnvFrom.RefName(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__EnvFrom.type": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__EnvFrom.Type == nil { + break } - return e.complexity.Mutation.CoreCreateRouter(childComplexity, args["router"].(entities.Router)), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__EnvFrom.Type(childComplexity), true - case "Mutation.core_createSecret": - if e.complexity.Mutation.CoreCreateSecret == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting.mode": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting.Mode == nil { break } - args, err := ec.field_Mutation_core_createSecret_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting.Mode(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting.privateIngressClass": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting.PrivateIngressClass == nil { + break } - return e.complexity.Mutation.CoreCreateSecret(childComplexity, args["secret"].(entities.Secret)), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting.PrivateIngressClass(childComplexity), true - case "Mutation.core_createWorkspace": - if e.complexity.Mutation.CoreCreateWorkspace == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting.publicIngressClass": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting.PublicIngressClass == nil { break } - args, err := ec.field_Mutation_core_createWorkspace_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting.PublicIngressClass(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec.projectName": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec.ProjectName == nil { + break } - return e.complexity.Mutation.CoreCreateWorkspace(childComplexity, args["env"].(entities.Workspace)), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec.ProjectName(childComplexity), true - case "Mutation.core_deleteApp": - if e.complexity.Mutation.CoreDeleteApp == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec.routing": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec.Routing == nil { break } - args, err := ec.field_Mutation_core_deleteApp_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec.Routing(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec.targetNamespace": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec.TargetNamespace == nil { + break } - return e.complexity.Mutation.CoreDeleteApp(childComplexity, args["namespace"].(string), args["name"].(string)), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec.TargetNamespace(childComplexity), true - case "Mutation.core_deleteConfig": - if e.complexity.Mutation.CoreDeleteConfig == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__HPA.enabled": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HPA.Enabled == nil { break } - args, err := ec.field_Mutation_core_deleteConfig_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HPA.Enabled(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__HPA.maxReplicas": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HPA.MaxReplicas == nil { + break } - return e.complexity.Mutation.CoreDeleteConfig(childComplexity, args["namespace"].(string), args["name"].(string)), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HPA.MaxReplicas(childComplexity), true - case "Mutation.core_deleteManagedResource": - if e.complexity.Mutation.CoreDeleteManagedResource == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__HPA.minReplicas": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HPA.MinReplicas == nil { break } - args, err := ec.field_Mutation_core_deleteManagedResource_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HPA.MinReplicas(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__HPA.thresholdCpu": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HPA.ThresholdCPU == nil { + break } - return e.complexity.Mutation.CoreDeleteManagedResource(childComplexity, args["namespace"].(string), args["name"].(string)), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HPA.ThresholdCPU(childComplexity), true - case "Mutation.core_deleteManagedService": - if e.complexity.Mutation.CoreDeleteManagedService == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__HPA.thresholdMemory": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HPA.ThresholdMemory == nil { break } - args, err := ec.field_Mutation_core_deleteManagedService_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HPA.ThresholdMemory(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe.httpHeaders": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe.HTTPHeaders == nil { + break } - return e.complexity.Mutation.CoreDeleteManagedService(childComplexity, args["namespace"].(string), args["name"].(string)), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe.HTTPHeaders(childComplexity), true - case "Mutation.core_deleteProject": - if e.complexity.Mutation.CoreDeleteProject == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe.path": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe.Path == nil { break } - args, err := ec.field_Mutation_core_deleteProject_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe.Path(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe.port": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe.Port == nil { + break } - return e.complexity.Mutation.CoreDeleteProject(childComplexity, args["name"].(string)), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe.Port(childComplexity), true - case "Mutation.core_deleteRouter": - if e.complexity.Mutation.CoreDeleteRouter == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__Https.clusterIssuer": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Https.ClusterIssuer == nil { break } - args, err := ec.field_Mutation_core_deleteRouter_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Https.ClusterIssuer(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__Https.enabled": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Https.Enabled == nil { + break } - return e.complexity.Mutation.CoreDeleteRouter(childComplexity, args["namespace"].(string), args["name"].(string)), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Https.Enabled(childComplexity), true - case "Mutation.core_deleteSecret": - if e.complexity.Mutation.CoreDeleteSecret == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__Https.forceRedirect": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Https.ForceRedirect == nil { break } - args, err := ec.field_Mutation_core_deleteSecret_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Https.ForceRedirect(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__Intercept.enabled": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Intercept.Enabled == nil { + break } - return e.complexity.Mutation.CoreDeleteSecret(childComplexity, args["namespace"].(string), args["name"].(string)), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Intercept.Enabled(childComplexity), true - case "Mutation.core_deleteWorkspace": - if e.complexity.Mutation.CoreDeleteWorkspace == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__Intercept.toDevice": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Intercept.ToDevice == nil { break } - args, err := ec.field_Mutation_core_deleteWorkspace_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Intercept.ToDevice(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec.resourceName": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec.ResourceName == nil { + break } - return e.complexity.Mutation.CoreDeleteWorkspace(childComplexity, args["namespace"].(string), args["name"].(string)), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec.ResourceName(childComplexity), true - case "Mutation.core_updateApp": - if e.complexity.Mutation.CoreUpdateApp == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec.resourceTemplate": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec.ResourceTemplate == nil { break } - args, err := ec.field_Mutation_core_updateApp_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec.ResourceTemplate(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec.serviceTemplate": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec.ServiceTemplate == nil { + break } - return e.complexity.Mutation.CoreUpdateApp(childComplexity, args["app"].(entities.App)), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec.ServiceTemplate(childComplexity), true - case "Mutation.core_updateConfig": - if e.complexity.Mutation.CoreUpdateConfig == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate.apiVersion": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate.APIVersion == nil { break } - args, err := ec.field_Mutation_core_updateConfig_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate.APIVersion(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate.kind": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate.Kind == nil { + break } - return e.complexity.Mutation.CoreUpdateConfig(childComplexity, args["config"].(entities.Config)), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate.Kind(childComplexity), true - case "Mutation.core_updateManagedResource": - if e.complexity.Mutation.CoreUpdateManagedResource == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate.msvcRef": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate.MsvcRef == nil { break } - args, err := ec.field_Mutation_core_updateManagedResource_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate.MsvcRef(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate.spec": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate.Spec == nil { + break } - return e.complexity.Mutation.CoreUpdateManagedResource(childComplexity, args["mres"].(entities.MRes)), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate.Spec(childComplexity), true - case "Mutation.core_updateManagedService": - if e.complexity.Mutation.CoreUpdateManagedService == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef.apiVersion": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef.APIVersion == nil { break } - args, err := ec.field_Mutation_core_updateManagedService_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef.APIVersion(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef.kind": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef.Kind == nil { + break } - return e.complexity.Mutation.CoreUpdateManagedService(childComplexity, args["msvc"].(entities.MSvc)), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef.Kind(childComplexity), true - case "Mutation.core_updateProject": - if e.complexity.Mutation.CoreUpdateProject == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef.name": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef.Name == nil { break } - args, err := ec.field_Mutation_core_updateProject_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef.Name(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef.namespace": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef.Namespace == nil { + break } - return e.complexity.Mutation.CoreUpdateProject(childComplexity, args["project"].(entities.Project)), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef.Namespace(childComplexity), true - case "Mutation.core_updateRouter": - if e.complexity.Mutation.CoreUpdateRouter == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__Probe.failureThreshold": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Probe.FailureThreshold == nil { break } - args, err := ec.field_Mutation_core_updateRouter_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Probe.FailureThreshold(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__Probe.httpGet": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Probe.HTTPGet == nil { + break } - return e.complexity.Mutation.CoreUpdateRouter(childComplexity, args["router"].(entities.Router)), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Probe.HTTPGet(childComplexity), true - case "Mutation.core_updateSecret": - if e.complexity.Mutation.CoreUpdateSecret == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__Probe.initialDelay": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Probe.InitialDelay == nil { break } - args, err := ec.field_Mutation_core_updateSecret_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Probe.InitialDelay(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__Probe.interval": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Probe.Interval == nil { + break } - return e.complexity.Mutation.CoreUpdateSecret(childComplexity, args["secret"].(entities.Secret)), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Probe.Interval(childComplexity), true - case "Mutation.core_updateWorkspace": - if e.complexity.Mutation.CoreUpdateWorkspace == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__Probe.shell": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Probe.Shell == nil { break } - args, err := ec.field_Mutation_core_updateWorkspace_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Probe.Shell(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__Probe.tcp": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Probe.TCP == nil { + break } - return e.complexity.Mutation.CoreUpdateWorkspace(childComplexity, args["env"].(entities.Workspace)), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Probe.TCP(childComplexity), true - case "Overrides.applied": - if e.complexity.Overrides.Applied == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__Probe.type": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Probe.Type == nil { break } - return e.complexity.Overrides.Applied(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Probe.Type(childComplexity), true - case "Overrides.patches": - if e.complexity.Overrides.Patches == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec.msvcSpec": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec.MsvcSpec == nil { break } - return e.complexity.Overrides.Patches(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec.MsvcSpec(childComplexity), true - case "Patch.op": - if e.complexity.Patch.Op == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec.targetNamespace": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec.TargetNamespace == nil { break } - return e.complexity.Patch.Op(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec.TargetNamespace(childComplexity), true - case "Patch.path": - if e.complexity.Patch.Path == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec.targetNamespace": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec.TargetNamespace == nil { break } - return e.complexity.Patch.Path(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec.TargetNamespace(childComplexity), true - case "Patch.value": - if e.complexity.Patch.Value == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__RateLimit.connections": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__RateLimit.Connections == nil { break } - return e.complexity.Patch.Value(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__RateLimit.Connections(childComplexity), true - case "Project.apiVersion": - if e.complexity.Project.APIVersion == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__RateLimit.enabled": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__RateLimit.Enabled == nil { break } - return e.complexity.Project.APIVersion(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__RateLimit.Enabled(childComplexity), true - case "Project.kind": - if e.complexity.Project.Kind == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__RateLimit.rpm": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__RateLimit.Rpm == nil { break } - return e.complexity.Project.Kind(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__RateLimit.Rpm(childComplexity), true - case "Project.metadata": - if e.complexity.Project.ObjectMeta == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__RateLimit.rps": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__RateLimit.Rps == nil { break } - return e.complexity.Project.ObjectMeta(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__RateLimit.Rps(childComplexity), true - case "Project.spec": - if e.complexity.Project.Spec == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__Route.app": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Route.App == nil { break } - return e.complexity.Project.Spec(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Route.App(childComplexity), true - case "Project.status": - if e.complexity.Project.Status == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__Route.lambda": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Route.Lambda == nil { break } - return e.complexity.Project.Status(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Route.Lambda(childComplexity), true - case "Project.syncStatus": - if e.complexity.Project.SyncStatus == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__Route.path": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Route.Path == nil { break } - return e.complexity.Project.SyncStatus(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Route.Path(childComplexity), true - case "ProjectSpec.accountName": - if e.complexity.ProjectSpec.AccountName == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__Route.port": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Route.Port == nil { break } - return e.complexity.ProjectSpec.AccountName(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Route.Port(childComplexity), true - case "ProjectSpec.clusterName": - if e.complexity.ProjectSpec.ClusterName == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__Route.rewrite": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Route.Rewrite == nil { break } - return e.complexity.ProjectSpec.ClusterName(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Route.Rewrite(childComplexity), true - case "ProjectSpec.displayName": - if e.complexity.ProjectSpec.DisplayName == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__RouterSpec.backendProtocol": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__RouterSpec.BackendProtocol == nil { break } - return e.complexity.ProjectSpec.DisplayName(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__RouterSpec.BackendProtocol(childComplexity), true - case "ProjectSpec.logo": - if e.complexity.ProjectSpec.Logo == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__RouterSpec.basicAuth": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__RouterSpec.BasicAuth == nil { break } - return e.complexity.ProjectSpec.Logo(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__RouterSpec.BasicAuth(childComplexity), true - case "ProjectSpec.targetNamespace": - if e.complexity.ProjectSpec.TargetNamespace == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__RouterSpec.cors": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__RouterSpec.Cors == nil { break } - return e.complexity.ProjectSpec.TargetNamespace(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__RouterSpec.Cors(childComplexity), true - case "Query.core_checkNameAvailability": - if e.complexity.Query.CoreCheckNameAvailability == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__RouterSpec.domains": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__RouterSpec.Domains == nil { break } - args, err := ec.field_Query_core_checkNameAvailability_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__RouterSpec.Domains(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__RouterSpec.https": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__RouterSpec.HTTPS == nil { + break } - return e.complexity.Query.CoreCheckNameAvailability(childComplexity, args["resType"].(domain.ResType), args["name"].(string)), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__RouterSpec.HTTPS(childComplexity), true - case "Query.core_getApp": - if e.complexity.Query.CoreGetApp == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__RouterSpec.ingressClass": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__RouterSpec.IngressClass == nil { break } - args, err := ec.field_Query_core_getApp_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__RouterSpec.IngressClass(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__RouterSpec.maxBodySizeInMB": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__RouterSpec.MaxBodySizeInMb == nil { + break } - return e.complexity.Query.CoreGetApp(childComplexity, args["namespace"].(string), args["name"].(string)), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__RouterSpec.MaxBodySizeInMb(childComplexity), true - case "Query.core_getConfig": - if e.complexity.Query.CoreGetConfig == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__RouterSpec.rateLimit": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__RouterSpec.RateLimit == nil { break } - args, err := ec.field_Query_core_getConfig_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__RouterSpec.RateLimit(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__RouterSpec.routes": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__RouterSpec.Routes == nil { + break } - return e.complexity.Query.CoreGetConfig(childComplexity, args["namespace"].(string), args["name"].(string)), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__RouterSpec.Routes(childComplexity), true - case "Query.core_getManagedResource": - if e.complexity.Query.CoreGetManagedResource == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate.apiVersion": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate.APIVersion == nil { break } - args, err := ec.field_Query_core_getManagedResource_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate.APIVersion(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate.kind": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate.Kind == nil { + break } - return e.complexity.Query.CoreGetManagedResource(childComplexity, args["namespace"].(string), args["name"].(string)), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate.Kind(childComplexity), true - case "Query.core_getManagedService": - if e.complexity.Query.CoreGetManagedService == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate.spec": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate.Spec == nil { break } - args, err := ec.field_Query_core_getManagedService_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate.Spec(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__ShellProbe.command": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ShellProbe.Command == nil { + break } - return e.complexity.Query.CoreGetManagedService(childComplexity, args["namespace"].(string), args["name"].(string)), true + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ShellProbe.Command(childComplexity), true - case "Query.core_getProject": - if e.complexity.Query.CoreGetProject == nil { + case "Github__com___kloudlite___operator___apis___crds___v1__TcpProbe.port": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__TcpProbe.Port == nil { break } - args, err := ec.field_Query_core_getProject_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__TcpProbe.Port(childComplexity), true + + case "Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord.host": + if e.complexity.Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord.Host == nil { + break } - return e.complexity.Query.CoreGetProject(childComplexity, args["name"].(string)), true + return e.complexity.Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord.Host(childComplexity), true - case "Query.core_getRouter": - if e.complexity.Query.CoreGetRouter == nil { + case "Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord.target": + if e.complexity.Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord.Target == nil { break } - args, err := ec.field_Query_core_getRouter_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord.Target(childComplexity), true + + case "Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec.activeNamespace": + if e.complexity.Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec.ActiveNamespace == nil { + break } - return e.complexity.Query.CoreGetRouter(childComplexity, args["namespace"].(string), args["name"].(string)), true + return e.complexity.Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec.ActiveNamespace(childComplexity), true - case "Query.core_getSecret": - if e.complexity.Query.CoreGetSecret == nil { + case "Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec.cnameRecords": + if e.complexity.Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec.CnameRecords == nil { break } - args, err := ec.field_Query_core_getSecret_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec.CnameRecords(childComplexity), true + + case "Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec.disabled": + if e.complexity.Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec.Disabled == nil { + break } - return e.complexity.Query.CoreGetSecret(childComplexity, args["namespace"].(string), args["name"].(string)), true + return e.complexity.Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec.Disabled(childComplexity), true - case "Query.core_getWorkspace": - if e.complexity.Query.CoreGetWorkspace == nil { + case "Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec.noExternalService": + if e.complexity.Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec.NoExternalService == nil { break } - args, err := ec.field_Query_core_getWorkspace_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec.NoExternalService(childComplexity), true + + case "Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec.nodeSelector": + if e.complexity.Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec.NodeSelector == nil { + break } - return e.complexity.Query.CoreGetWorkspace(childComplexity, args["namespace"].(string), args["name"].(string)), true + return e.complexity.Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec.NodeSelector(childComplexity), true - case "Query.core_listApps": - if e.complexity.Query.CoreListApps == nil { + case "Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec.ports": + if e.complexity.Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec.Ports == nil { break } - args, err := ec.field_Query_core_listApps_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec.Ports(childComplexity), true + + case "Github__com___kloudlite___operator___apis___wireguard___v1__Port.port": + if e.complexity.Github__com___kloudlite___operator___apis___wireguard___v1__Port.Port == nil { + break } - return e.complexity.Query.CoreListApps(childComplexity, args["namespace"].(string)), true + return e.complexity.Github__com___kloudlite___operator___apis___wireguard___v1__Port.Port(childComplexity), true - case "Query.core_listConfigs": - if e.complexity.Query.CoreListConfigs == nil { + case "Github__com___kloudlite___operator___apis___wireguard___v1__Port.targetPort": + if e.complexity.Github__com___kloudlite___operator___apis___wireguard___v1__Port.TargetPort == nil { break } - args, err := ec.field_Query_core_listConfigs_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___apis___wireguard___v1__Port.TargetPort(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__Check.generation": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Generation == nil { + break } - return e.complexity.Query.CoreListConfigs(childComplexity, args["namespace"].(string)), true + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Generation(childComplexity), true - case "Query.core_listManagedResources": - if e.complexity.Query.CoreListManagedResources == nil { + case "Github__com___kloudlite___operator___pkg___operator__Check.message": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Message == nil { break } - args, err := ec.field_Query_core_listManagedResources_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Message(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__Check.status": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Status == nil { + break } - return e.complexity.Query.CoreListManagedResources(childComplexity, args["namespace"].(string)), true + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Status(childComplexity), true - case "Query.core_listManagedServices": - if e.complexity.Query.CoreListManagedServices == nil { + case "Github__com___kloudlite___operator___pkg___operator__ResourceRef.apiVersion": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.APIVersion == nil { break } - args, err := ec.field_Query_core_listManagedServices_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.APIVersion(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__ResourceRef.kind": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.Kind == nil { + break } - return e.complexity.Query.CoreListManagedServices(childComplexity, args["namespace"].(string)), true + return e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.Kind(childComplexity), true - case "Query.core_listProjects": - if e.complexity.Query.CoreListProjects == nil { + case "Github__com___kloudlite___operator___pkg___operator__ResourceRef.name": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.Name == nil { break } - args, err := ec.field_Query_core_listProjects_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.Name(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__ResourceRef.namespace": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.Namespace == nil { + break } - return e.complexity.Query.CoreListProjects(childComplexity, args["clusterName"].(*string)), true + return e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.Namespace(childComplexity), true - case "Query.core_listRouters": - if e.complexity.Query.CoreListRouters == nil { + case "Github__com___kloudlite___operator___pkg___operator__Status.checks": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.Checks == nil { break } - args, err := ec.field_Query_core_listRouters_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.Checks(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__Status.isReady": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.IsReady == nil { + break } - return e.complexity.Query.CoreListRouters(childComplexity, args["namespace"].(string)), true + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.IsReady(childComplexity), true - case "Query.core_listSecrets": - if e.complexity.Query.CoreListSecrets == nil { + case "Github__com___kloudlite___operator___pkg___operator__Status.lastReadyGeneration": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.LastReadyGeneration == nil { break } - args, err := ec.field_Query_core_listSecrets_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.LastReadyGeneration(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__Status.lastReconcileTime": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.LastReconcileTime == nil { + break } - return e.complexity.Query.CoreListSecrets(childComplexity, args["namespace"].(string)), true + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.LastReconcileTime(childComplexity), true - case "Query.core_listWorkspaces": - if e.complexity.Query.CoreListWorkspaces == nil { + case "Github__com___kloudlite___operator___pkg___operator__Status.message": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.Message == nil { break } - args, err := ec.field_Query_core_listWorkspaces_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.Message(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__Status.resources": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.Resources == nil { + break } - return e.complexity.Query.CoreListWorkspaces(childComplexity, args["namespace"].(string)), true + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.Resources(childComplexity), true - case "Query.core_resyncApp": - if e.complexity.Query.CoreResyncApp == nil { + case "Github__com___kloudlite___operator___pkg___raw____json__RawJson.RawMessage": + if e.complexity.Github__com___kloudlite___operator___pkg___raw____json__RawJson.RawMessage == nil { break } - args, err := ec.field_Query_core_resyncApp_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___operator___pkg___raw____json__RawJson.RawMessage(childComplexity), true + + case "ImagePullSecret.accountName": + if e.complexity.ImagePullSecret.AccountName == nil { + break } - return e.complexity.Query.CoreResyncApp(childComplexity, args["namespace"].(string), args["name"].(string)), true + return e.complexity.ImagePullSecret.AccountName(childComplexity), true - case "Query.core_resyncConfig": - if e.complexity.Query.CoreResyncConfig == nil { + case "ImagePullSecret.createdBy": + if e.complexity.ImagePullSecret.CreatedBy == nil { break } - args, err := ec.field_Query_core_resyncConfig_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.ImagePullSecret.CreatedBy(childComplexity), true + + case "ImagePullSecret.creationTime": + if e.complexity.ImagePullSecret.CreationTime == nil { + break } - return e.complexity.Query.CoreResyncConfig(childComplexity, args["namespace"].(string), args["name"].(string)), true + return e.complexity.ImagePullSecret.CreationTime(childComplexity), true - case "Query.core_resyncManagedResource": - if e.complexity.Query.CoreResyncManagedResource == nil { + case "ImagePullSecret.displayName": + if e.complexity.ImagePullSecret.DisplayName == nil { break } - args, err := ec.field_Query_core_resyncManagedResource_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.ImagePullSecret.DisplayName(childComplexity), true + + case "ImagePullSecret.dockerConfigJson": + if e.complexity.ImagePullSecret.DockerConfigJson == nil { + break } - return e.complexity.Query.CoreResyncManagedResource(childComplexity, args["namespace"].(string), args["name"].(string)), true + return e.complexity.ImagePullSecret.DockerConfigJson(childComplexity), true - case "Query.core_resyncManagedService": - if e.complexity.Query.CoreResyncManagedService == nil { + case "ImagePullSecret.environmentName": + if e.complexity.ImagePullSecret.EnvironmentName == nil { break } - args, err := ec.field_Query_core_resyncManagedService_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.ImagePullSecret.EnvironmentName(childComplexity), true + + case "ImagePullSecret.format": + if e.complexity.ImagePullSecret.Format == nil { + break } - return e.complexity.Query.CoreResyncManagedService(childComplexity, args["namespace"].(string), args["name"].(string)), true + return e.complexity.ImagePullSecret.Format(childComplexity), true - case "Query.core_resyncProject": - if e.complexity.Query.CoreResyncProject == nil { + case "ImagePullSecret.id": + if e.complexity.ImagePullSecret.ID == nil { break } - args, err := ec.field_Query_core_resyncProject_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.ImagePullSecret.ID(childComplexity), true + + case "ImagePullSecret.lastUpdatedBy": + if e.complexity.ImagePullSecret.LastUpdatedBy == nil { + break } - return e.complexity.Query.CoreResyncProject(childComplexity, args["name"].(string)), true + return e.complexity.ImagePullSecret.LastUpdatedBy(childComplexity), true - case "Query.core_resyncRouter": - if e.complexity.Query.CoreResyncRouter == nil { + case "ImagePullSecret.markedForDeletion": + if e.complexity.ImagePullSecret.MarkedForDeletion == nil { break } - args, err := ec.field_Query_core_resyncRouter_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.ImagePullSecret.MarkedForDeletion(childComplexity), true + + case "ImagePullSecret.metadata": + if e.complexity.ImagePullSecret.ObjectMeta == nil { + break } - return e.complexity.Query.CoreResyncRouter(childComplexity, args["namespace"].(string), args["name"].(string)), true + return e.complexity.ImagePullSecret.ObjectMeta(childComplexity), true - case "Query.core_resyncSecret": - if e.complexity.Query.CoreResyncSecret == nil { + case "ImagePullSecret.projectName": + if e.complexity.ImagePullSecret.ProjectName == nil { break } - args, err := ec.field_Query_core_resyncSecret_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.ImagePullSecret.ProjectName(childComplexity), true + + case "ImagePullSecret.recordVersion": + if e.complexity.ImagePullSecret.RecordVersion == nil { + break } - return e.complexity.Query.CoreResyncSecret(childComplexity, args["namespace"].(string), args["name"].(string)), true + return e.complexity.ImagePullSecret.RecordVersion(childComplexity), true - case "Query.core_resyncWorkspace": - if e.complexity.Query.CoreResyncWorkspace == nil { + case "ImagePullSecret.registryPassword": + if e.complexity.ImagePullSecret.RegistryPassword == nil { break } - args, err := ec.field_Query_core_resyncWorkspace_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.ImagePullSecret.RegistryPassword(childComplexity), true + + case "ImagePullSecret.registryURL": + if e.complexity.ImagePullSecret.RegistryURL == nil { + break } - return e.complexity.Query.CoreResyncWorkspace(childComplexity, args["namespace"].(string), args["name"].(string)), true + return e.complexity.ImagePullSecret.RegistryURL(childComplexity), true - case "Query._service": - if e.complexity.Query.__resolve__service == nil { + case "ImagePullSecret.registryUsername": + if e.complexity.ImagePullSecret.RegistryUsername == nil { break } - return e.complexity.Query.__resolve__service(childComplexity), true + return e.complexity.ImagePullSecret.RegistryUsername(childComplexity), true - case "Router.apiVersion": - if e.complexity.Router.APIVersion == nil { + case "ImagePullSecret.syncStatus": + if e.complexity.ImagePullSecret.SyncStatus == nil { break } - return e.complexity.Router.APIVersion(childComplexity), true + return e.complexity.ImagePullSecret.SyncStatus(childComplexity), true - case "Router.kind": - if e.complexity.Router.Kind == nil { + case "ImagePullSecret.updateTime": + if e.complexity.ImagePullSecret.UpdateTime == nil { break } - return e.complexity.Router.Kind(childComplexity), true + return e.complexity.ImagePullSecret.UpdateTime(childComplexity), true - case "Router.metadata": - if e.complexity.Router.ObjectMeta == nil { + case "ImagePullSecretEdge.cursor": + if e.complexity.ImagePullSecretEdge.Cursor == nil { break } - return e.complexity.Router.ObjectMeta(childComplexity), true + return e.complexity.ImagePullSecretEdge.Cursor(childComplexity), true - case "Router.overrides": - if e.complexity.Router.Overrides == nil { + case "ImagePullSecretEdge.node": + if e.complexity.ImagePullSecretEdge.Node == nil { break } - return e.complexity.Router.Overrides(childComplexity), true + return e.complexity.ImagePullSecretEdge.Node(childComplexity), true - case "Router.spec": - if e.complexity.Router.Spec == nil { + case "ImagePullSecretPaginatedRecords.edges": + if e.complexity.ImagePullSecretPaginatedRecords.Edges == nil { break } - return e.complexity.Router.Spec(childComplexity), true + return e.complexity.ImagePullSecretPaginatedRecords.Edges(childComplexity), true - case "Router.status": - if e.complexity.Router.Status == nil { + case "ImagePullSecretPaginatedRecords.pageInfo": + if e.complexity.ImagePullSecretPaginatedRecords.PageInfo == nil { break } - return e.complexity.Router.Status(childComplexity), true + return e.complexity.ImagePullSecretPaginatedRecords.PageInfo(childComplexity), true - case "Router.syncStatus": - if e.complexity.Router.SyncStatus == nil { + case "ImagePullSecretPaginatedRecords.totalCount": + if e.complexity.ImagePullSecretPaginatedRecords.TotalCount == nil { break } - return e.complexity.Router.SyncStatus(childComplexity), true + return e.complexity.ImagePullSecretPaginatedRecords.TotalCount(childComplexity), true - case "RouterSpec.backendProtocol": - if e.complexity.RouterSpec.BackendProtocol == nil { + case "K8s__io___api___core___v1__Toleration.effect": + if e.complexity.K8s__io___api___core___v1__Toleration.Effect == nil { break } - return e.complexity.RouterSpec.BackendProtocol(childComplexity), true + return e.complexity.K8s__io___api___core___v1__Toleration.Effect(childComplexity), true - case "RouterSpec.basicAuth": - if e.complexity.RouterSpec.BasicAuth == nil { + case "K8s__io___api___core___v1__Toleration.key": + if e.complexity.K8s__io___api___core___v1__Toleration.Key == nil { break } - return e.complexity.RouterSpec.BasicAuth(childComplexity), true + return e.complexity.K8s__io___api___core___v1__Toleration.Key(childComplexity), true - case "RouterSpec.cors": - if e.complexity.RouterSpec.Cors == nil { + case "K8s__io___api___core___v1__Toleration.operator": + if e.complexity.K8s__io___api___core___v1__Toleration.Operator == nil { break } - return e.complexity.RouterSpec.Cors(childComplexity), true + return e.complexity.K8s__io___api___core___v1__Toleration.Operator(childComplexity), true - case "RouterSpec.domains": - if e.complexity.RouterSpec.Domains == nil { + case "K8s__io___api___core___v1__Toleration.tolerationSeconds": + if e.complexity.K8s__io___api___core___v1__Toleration.TolerationSeconds == nil { break } - return e.complexity.RouterSpec.Domains(childComplexity), true + return e.complexity.K8s__io___api___core___v1__Toleration.TolerationSeconds(childComplexity), true - case "RouterSpec.https": - if e.complexity.RouterSpec.HTTPS == nil { + case "K8s__io___api___core___v1__Toleration.value": + if e.complexity.K8s__io___api___core___v1__Toleration.Value == nil { break } - return e.complexity.RouterSpec.HTTPS(childComplexity), true + return e.complexity.K8s__io___api___core___v1__Toleration.Value(childComplexity), true - case "RouterSpec.ingressClass": - if e.complexity.RouterSpec.IngressClass == nil { + case "ManagedResource.apiVersion": + if e.complexity.ManagedResource.APIVersion == nil { break } - return e.complexity.RouterSpec.IngressClass(childComplexity), true + return e.complexity.ManagedResource.APIVersion(childComplexity), true - case "RouterSpec.maxBodySizeInMB": - if e.complexity.RouterSpec.MaxBodySizeInMb == nil { + case "ManagedResource.accountName": + if e.complexity.ManagedResource.AccountName == nil { break } - return e.complexity.RouterSpec.MaxBodySizeInMb(childComplexity), true + return e.complexity.ManagedResource.AccountName(childComplexity), true - case "RouterSpec.rateLimit": - if e.complexity.RouterSpec.RateLimit == nil { + case "ManagedResource.createdBy": + if e.complexity.ManagedResource.CreatedBy == nil { break } - return e.complexity.RouterSpec.RateLimit(childComplexity), true + return e.complexity.ManagedResource.CreatedBy(childComplexity), true - case "RouterSpec.region": - if e.complexity.RouterSpec.Region == nil { + case "ManagedResource.creationTime": + if e.complexity.ManagedResource.CreationTime == nil { break } - return e.complexity.RouterSpec.Region(childComplexity), true + return e.complexity.ManagedResource.CreationTime(childComplexity), true - case "RouterSpec.routes": - if e.complexity.RouterSpec.Routes == nil { + case "ManagedResource.displayName": + if e.complexity.ManagedResource.DisplayName == nil { break } - return e.complexity.RouterSpec.Routes(childComplexity), true + return e.complexity.ManagedResource.DisplayName(childComplexity), true - case "RouterSpecBasicAuth.enabled": - if e.complexity.RouterSpecBasicAuth.Enabled == nil { + case "ManagedResource.enabled": + if e.complexity.ManagedResource.Enabled == nil { break } - return e.complexity.RouterSpecBasicAuth.Enabled(childComplexity), true + return e.complexity.ManagedResource.Enabled(childComplexity), true - case "RouterSpecBasicAuth.secretName": - if e.complexity.RouterSpecBasicAuth.SecretName == nil { + case "ManagedResource.environmentName": + if e.complexity.ManagedResource.EnvironmentName == nil { break } - return e.complexity.RouterSpecBasicAuth.SecretName(childComplexity), true + return e.complexity.ManagedResource.EnvironmentName(childComplexity), true - case "RouterSpecBasicAuth.username": - if e.complexity.RouterSpecBasicAuth.Username == nil { + case "ManagedResource.id": + if e.complexity.ManagedResource.ID == nil { break } - return e.complexity.RouterSpecBasicAuth.Username(childComplexity), true + return e.complexity.ManagedResource.ID(childComplexity), true - case "RouterSpecCors.allowCredentials": - if e.complexity.RouterSpecCors.AllowCredentials == nil { + case "ManagedResource.kind": + if e.complexity.ManagedResource.Kind == nil { break } - return e.complexity.RouterSpecCors.AllowCredentials(childComplexity), true + return e.complexity.ManagedResource.Kind(childComplexity), true - case "RouterSpecCors.enabled": - if e.complexity.RouterSpecCors.Enabled == nil { + case "ManagedResource.lastUpdatedBy": + if e.complexity.ManagedResource.LastUpdatedBy == nil { break } - return e.complexity.RouterSpecCors.Enabled(childComplexity), true + return e.complexity.ManagedResource.LastUpdatedBy(childComplexity), true - case "RouterSpecCors.origins": - if e.complexity.RouterSpecCors.Origins == nil { + case "ManagedResource.markedForDeletion": + if e.complexity.ManagedResource.MarkedForDeletion == nil { break } - return e.complexity.RouterSpecCors.Origins(childComplexity), true + return e.complexity.ManagedResource.MarkedForDeletion(childComplexity), true - case "RouterSpecHttps.clusterIssuer": - if e.complexity.RouterSpecHttps.ClusterIssuer == nil { + case "ManagedResource.metadata": + if e.complexity.ManagedResource.ObjectMeta == nil { break } - return e.complexity.RouterSpecHttps.ClusterIssuer(childComplexity), true + return e.complexity.ManagedResource.ObjectMeta(childComplexity), true - case "RouterSpecHttps.enabled": - if e.complexity.RouterSpecHttps.Enabled == nil { + case "ManagedResource.projectName": + if e.complexity.ManagedResource.ProjectName == nil { break } - return e.complexity.RouterSpecHttps.Enabled(childComplexity), true + return e.complexity.ManagedResource.ProjectName(childComplexity), true - case "RouterSpecHttps.forceRedirect": - if e.complexity.RouterSpecHttps.ForceRedirect == nil { + case "ManagedResource.recordVersion": + if e.complexity.ManagedResource.RecordVersion == nil { break } - return e.complexity.RouterSpecHttps.ForceRedirect(childComplexity), true + return e.complexity.ManagedResource.RecordVersion(childComplexity), true - case "RouterSpecRateLimit.connections": - if e.complexity.RouterSpecRateLimit.Connections == nil { + case "ManagedResource.spec": + if e.complexity.ManagedResource.Spec == nil { break } - return e.complexity.RouterSpecRateLimit.Connections(childComplexity), true + return e.complexity.ManagedResource.Spec(childComplexity), true - case "RouterSpecRateLimit.enabled": - if e.complexity.RouterSpecRateLimit.Enabled == nil { + case "ManagedResource.status": + if e.complexity.ManagedResource.Status == nil { break } - return e.complexity.RouterSpecRateLimit.Enabled(childComplexity), true + return e.complexity.ManagedResource.Status(childComplexity), true - case "RouterSpecRateLimit.rpm": - if e.complexity.RouterSpecRateLimit.Rpm == nil { + case "ManagedResource.syncStatus": + if e.complexity.ManagedResource.SyncStatus == nil { break } - return e.complexity.RouterSpecRateLimit.Rpm(childComplexity), true + return e.complexity.ManagedResource.SyncStatus(childComplexity), true - case "RouterSpecRateLimit.rps": - if e.complexity.RouterSpecRateLimit.Rps == nil { + case "ManagedResource.updateTime": + if e.complexity.ManagedResource.UpdateTime == nil { break } - return e.complexity.RouterSpecRateLimit.Rps(childComplexity), true + return e.complexity.ManagedResource.UpdateTime(childComplexity), true - case "RouterSpecRoutes.app": - if e.complexity.RouterSpecRoutes.App == nil { + case "ManagedResourceEdge.cursor": + if e.complexity.ManagedResourceEdge.Cursor == nil { break } - return e.complexity.RouterSpecRoutes.App(childComplexity), true + return e.complexity.ManagedResourceEdge.Cursor(childComplexity), true - case "RouterSpecRoutes.lambda": - if e.complexity.RouterSpecRoutes.Lambda == nil { + case "ManagedResourceEdge.node": + if e.complexity.ManagedResourceEdge.Node == nil { break } - return e.complexity.RouterSpecRoutes.Lambda(childComplexity), true + return e.complexity.ManagedResourceEdge.Node(childComplexity), true - case "RouterSpecRoutes.path": - if e.complexity.RouterSpecRoutes.Path == nil { + case "ManagedResourceKeyRef.key": + if e.complexity.ManagedResourceKeyRef.Key == nil { break } - return e.complexity.RouterSpecRoutes.Path(childComplexity), true + return e.complexity.ManagedResourceKeyRef.Key(childComplexity), true - case "RouterSpecRoutes.port": - if e.complexity.RouterSpecRoutes.Port == nil { + case "ManagedResourceKeyRef.mresName": + if e.complexity.ManagedResourceKeyRef.MresName == nil { break } - return e.complexity.RouterSpecRoutes.Port(childComplexity), true + return e.complexity.ManagedResourceKeyRef.MresName(childComplexity), true - case "RouterSpecRoutes.rewrite": - if e.complexity.RouterSpecRoutes.Rewrite == nil { + case "ManagedResourceKeyValueRef.key": + if e.complexity.ManagedResourceKeyValueRef.Key == nil { break } - return e.complexity.RouterSpecRoutes.Rewrite(childComplexity), true + return e.complexity.ManagedResourceKeyValueRef.Key(childComplexity), true - case "Secret.apiVersion": - if e.complexity.Secret.APIVersion == nil { + case "ManagedResourceKeyValueRef.mresName": + if e.complexity.ManagedResourceKeyValueRef.MresName == nil { break } - return e.complexity.Secret.APIVersion(childComplexity), true + return e.complexity.ManagedResourceKeyValueRef.MresName(childComplexity), true - case "Secret.data": - if e.complexity.Secret.Data == nil { + case "ManagedResourceKeyValueRef.value": + if e.complexity.ManagedResourceKeyValueRef.Value == nil { break } - return e.complexity.Secret.Data(childComplexity), true + return e.complexity.ManagedResourceKeyValueRef.Value(childComplexity), true - case "Secret.enabled": - if e.complexity.Secret.Enabled == nil { + case "ManagedResourcePaginatedRecords.edges": + if e.complexity.ManagedResourcePaginatedRecords.Edges == nil { break } - return e.complexity.Secret.Enabled(childComplexity), true + return e.complexity.ManagedResourcePaginatedRecords.Edges(childComplexity), true - case "Secret.kind": - if e.complexity.Secret.Kind == nil { + case "ManagedResourcePaginatedRecords.pageInfo": + if e.complexity.ManagedResourcePaginatedRecords.PageInfo == nil { break } - return e.complexity.Secret.Kind(childComplexity), true + return e.complexity.ManagedResourcePaginatedRecords.PageInfo(childComplexity), true - case "Secret.metadata": - if e.complexity.Secret.ObjectMeta == nil { + case "ManagedResourcePaginatedRecords.totalCount": + if e.complexity.ManagedResourcePaginatedRecords.TotalCount == nil { break } - return e.complexity.Secret.ObjectMeta(childComplexity), true + return e.complexity.ManagedResourcePaginatedRecords.TotalCount(childComplexity), true - case "Secret.overrides": - if e.complexity.Secret.Overrides == nil { + case "MatchFilter.array": + if e.complexity.MatchFilter.Array == nil { break } - return e.complexity.Secret.Overrides(childComplexity), true + return e.complexity.MatchFilter.Array(childComplexity), true - case "Secret.projectName": - if e.complexity.Secret.ProjectName == nil { + case "MatchFilter.exact": + if e.complexity.MatchFilter.Exact == nil { break } - return e.complexity.Secret.ProjectName(childComplexity), true + return e.complexity.MatchFilter.Exact(childComplexity), true - case "Secret.status": - if e.complexity.Secret.Status == nil { + case "MatchFilter.matchType": + if e.complexity.MatchFilter.MatchType == nil { break } - return e.complexity.Secret.Status(childComplexity), true + return e.complexity.MatchFilter.MatchType(childComplexity), true - case "Secret.stringData": - if e.complexity.Secret.StringData == nil { + case "MatchFilter.regex": + if e.complexity.MatchFilter.Regex == nil { break } - return e.complexity.Secret.StringData(childComplexity), true + return e.complexity.MatchFilter.Regex(childComplexity), true - case "Secret.syncStatus": - if e.complexity.Secret.SyncStatus == nil { + case "Metadata.annotations": + if e.complexity.Metadata.Annotations == nil { break } - return e.complexity.Secret.SyncStatus(childComplexity), true + return e.complexity.Metadata.Annotations(childComplexity), true - case "Secret.type": - if e.complexity.Secret.Type == nil { + case "Metadata.creationTimestamp": + if e.complexity.Metadata.CreationTimestamp == nil { break } - return e.complexity.Secret.Type(childComplexity), true + return e.complexity.Metadata.CreationTimestamp(childComplexity), true - case "Status.checks": - if e.complexity.Status.Checks == nil { + case "Metadata.deletionTimestamp": + if e.complexity.Metadata.DeletionTimestamp == nil { break } - return e.complexity.Status.Checks(childComplexity), true + return e.complexity.Metadata.DeletionTimestamp(childComplexity), true - case "Status.displayVars": - if e.complexity.Status.DisplayVars == nil { + case "Metadata.generation": + if e.complexity.Metadata.Generation == nil { break } - return e.complexity.Status.DisplayVars(childComplexity), true + return e.complexity.Metadata.Generation(childComplexity), true - case "Status.isReady": - if e.complexity.Status.IsReady == nil { + case "Metadata.labels": + if e.complexity.Metadata.Labels == nil { break } - return e.complexity.Status.IsReady(childComplexity), true + return e.complexity.Metadata.Labels(childComplexity), true - case "SyncStatus.action": - if e.complexity.SyncStatus.Action == nil { + case "Metadata.name": + if e.complexity.Metadata.Name == nil { break } - return e.complexity.SyncStatus.Action(childComplexity), true + return e.complexity.Metadata.Name(childComplexity), true - case "SyncStatus.error": - if e.complexity.SyncStatus.Error == nil { + case "Metadata.namespace": + if e.complexity.Metadata.Namespace == nil { break } - return e.complexity.SyncStatus.Error(childComplexity), true + return e.complexity.Metadata.Namespace(childComplexity), true - case "SyncStatus.generation": - if e.complexity.SyncStatus.Generation == nil { + case "Mutation.core_cloneEnvironment": + if e.complexity.Mutation.CoreCloneEnvironment == nil { break } - return e.complexity.SyncStatus.Generation(childComplexity), true + args, err := ec.field_Mutation_core_cloneEnvironment_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CoreCloneEnvironment(childComplexity, args["projectName"].(string), args["sourceEnvName"].(string), args["destinationEnvName"].(string), args["displayName"].(string), args["environmentRoutingMode"].(v1.EnvironmentRoutingMode)), true - case "SyncStatus.lastSyncedAt": - if e.complexity.SyncStatus.LastSyncedAt == nil { + case "Mutation.core_createApp": + if e.complexity.Mutation.CoreCreateApp == nil { break } - return e.complexity.SyncStatus.LastSyncedAt(childComplexity), true + args, err := ec.field_Mutation_core_createApp_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CoreCreateApp(childComplexity, args["projectName"].(string), args["envName"].(string), args["app"].(entities.App)), true - case "SyncStatus.state": - if e.complexity.SyncStatus.State == nil { + case "Mutation.core_createConfig": + if e.complexity.Mutation.CoreCreateConfig == nil { break } - return e.complexity.SyncStatus.State(childComplexity), true + args, err := ec.field_Mutation_core_createConfig_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CoreCreateConfig(childComplexity, args["projectName"].(string), args["envName"].(string), args["config"].(entities.Config)), true - case "SyncStatus.syncScheduledAt": - if e.complexity.SyncStatus.SyncScheduledAt == nil { + case "Mutation.core_createEnvironment": + if e.complexity.Mutation.CoreCreateEnvironment == nil { break } - return e.complexity.SyncStatus.SyncScheduledAt(childComplexity), true + args, err := ec.field_Mutation_core_createEnvironment_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CoreCreateEnvironment(childComplexity, args["projectName"].(string), args["env"].(entities.Environment)), true - case "Workspace.apiVersion": - if e.complexity.Workspace.APIVersion == nil { + case "Mutation.core_createImagePullSecret": + if e.complexity.Mutation.CoreCreateImagePullSecret == nil { break } - return e.complexity.Workspace.APIVersion(childComplexity), true + args, err := ec.field_Mutation_core_createImagePullSecret_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CoreCreateImagePullSecret(childComplexity, args["projectName"].(string), args["envName"].(string), args["imagePullSecretIn"].(entities.ImagePullSecret)), true - case "Workspace.kind": - if e.complexity.Workspace.Kind == nil { + case "Mutation.core_createManagedResource": + if e.complexity.Mutation.CoreCreateManagedResource == nil { break } - return e.complexity.Workspace.Kind(childComplexity), true + args, err := ec.field_Mutation_core_createManagedResource_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CoreCreateManagedResource(childComplexity, args["projectName"].(string), args["envName"].(string), args["mres"].(entities.ManagedResource)), true - case "Workspace.metadata": - if e.complexity.Workspace.ObjectMeta == nil { + case "Mutation.core_createProject": + if e.complexity.Mutation.CoreCreateProject == nil { break } - return e.complexity.Workspace.ObjectMeta(childComplexity), true + args, err := ec.field_Mutation_core_createProject_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CoreCreateProject(childComplexity, args["project"].(entities.Project)), true - case "Workspace.spec": - if e.complexity.Workspace.Spec == nil { + case "Mutation.core_createProjectManagedService": + if e.complexity.Mutation.CoreCreateProjectManagedService == nil { break } - return e.complexity.Workspace.Spec(childComplexity), true + args, err := ec.field_Mutation_core_createProjectManagedService_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CoreCreateProjectManagedService(childComplexity, args["projectName"].(string), args["pmsvc"].(entities.ProjectManagedService)), true - case "Workspace.status": - if e.complexity.Workspace.Status == nil { + case "Mutation.core_createRouter": + if e.complexity.Mutation.CoreCreateRouter == nil { break } - return e.complexity.Workspace.Status(childComplexity), true + args, err := ec.field_Mutation_core_createRouter_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CoreCreateRouter(childComplexity, args["projectName"].(string), args["envName"].(string), args["router"].(entities.Router)), true - case "Workspace.syncStatus": - if e.complexity.Workspace.SyncStatus == nil { + case "Mutation.core_createSecret": + if e.complexity.Mutation.CoreCreateSecret == nil { break } - return e.complexity.Workspace.SyncStatus(childComplexity), true + args, err := ec.field_Mutation_core_createSecret_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CoreCreateSecret(childComplexity, args["projectName"].(string), args["envName"].(string), args["secret"].(entities.Secret)), true - case "WorkspaceSpec.projectName": - if e.complexity.WorkspaceSpec.ProjectName == nil { + case "Mutation.core_createVPNDevice": + if e.complexity.Mutation.CoreCreateVPNDevice == nil { break } - return e.complexity.WorkspaceSpec.ProjectName(childComplexity), true + args, err := ec.field_Mutation_core_createVPNDevice_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CoreCreateVPNDevice(childComplexity, args["vpnDevice"].(entities.ConsoleVPNDevice)), true - case "WorkspaceSpec.targetNamespace": - if e.complexity.WorkspaceSpec.TargetNamespace == nil { + case "Mutation.core_deleteApp": + if e.complexity.Mutation.CoreDeleteApp == nil { break } - return e.complexity.WorkspaceSpec.TargetNamespace(childComplexity), true + args, err := ec.field_Mutation_core_deleteApp_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CoreDeleteApp(childComplexity, args["projectName"].(string), args["envName"].(string), args["appName"].(string)), true - case "_Service.sdl": - if e.complexity._Service.SDL == nil { + case "Mutation.core_deleteConfig": + if e.complexity.Mutation.CoreDeleteConfig == nil { break } - return e.complexity._Service.SDL(childComplexity), true + args, err := ec.field_Mutation_core_deleteConfig_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } - } - return 0, false -} + return e.complexity.Mutation.CoreDeleteConfig(childComplexity, args["projectName"].(string), args["envName"].(string), args["configName"].(string)), true -func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { - rc := graphql.GetOperationContext(ctx) - ec := executionContext{rc, e} - inputUnmarshalMap := graphql.BuildUnmarshalerMap( - ec.unmarshalInputAppIn, - ec.unmarshalInputAppSpecContainersEnvFromIn, - ec.unmarshalInputAppSpecContainersEnvIn, - ec.unmarshalInputAppSpecContainersIn, - ec.unmarshalInputAppSpecContainersLivenessProbeHttpGetIn, - ec.unmarshalInputAppSpecContainersLivenessProbeIn, - ec.unmarshalInputAppSpecContainersLivenessProbeShellIn, - ec.unmarshalInputAppSpecContainersLivenessProbeTcpIn, - ec.unmarshalInputAppSpecContainersReadinessProbeHttpGetIn, - ec.unmarshalInputAppSpecContainersReadinessProbeIn, - ec.unmarshalInputAppSpecContainersReadinessProbeShellIn, - ec.unmarshalInputAppSpecContainersReadinessProbeTcpIn, - ec.unmarshalInputAppSpecContainersResourceCpuIn, - ec.unmarshalInputAppSpecContainersResourceMemoryIn, - ec.unmarshalInputAppSpecContainersVolumesIn, - ec.unmarshalInputAppSpecContainersVolumesItemsIn, - ec.unmarshalInputAppSpecHpaIn, - ec.unmarshalInputAppSpecIn, - ec.unmarshalInputAppSpecInterceptIn, - ec.unmarshalInputAppSpecServicesIn, - ec.unmarshalInputAppSpecTolerationsIn, - ec.unmarshalInputConfigIn, - ec.unmarshalInputManagedResourceIn, - ec.unmarshalInputManagedResourceSpecIn, - ec.unmarshalInputManagedResourceSpecMresKindIn, - ec.unmarshalInputManagedResourceSpecMsvcRefIn, - ec.unmarshalInputManagedServiceIn, - ec.unmarshalInputManagedServiceSpecIn, - ec.unmarshalInputManagedServiceSpecMsvcKindIn, - ec.unmarshalInputManagedServiceSpecTolerationsIn, - ec.unmarshalInputMetadataIn, - ec.unmarshalInputOverridesIn, - ec.unmarshalInputPatchIn, - ec.unmarshalInputProjectIn, - ec.unmarshalInputProjectSpecIn, - ec.unmarshalInputRouterIn, - ec.unmarshalInputRouterSpecBasicAuthIn, - ec.unmarshalInputRouterSpecCorsIn, - ec.unmarshalInputRouterSpecHttpsIn, - ec.unmarshalInputRouterSpecIn, - ec.unmarshalInputRouterSpecRateLimitIn, - ec.unmarshalInputRouterSpecRoutesIn, - ec.unmarshalInputSecretIn, - ec.unmarshalInputWorkspaceIn, - ec.unmarshalInputWorkspaceSpecIn, - ) - first := true + case "Mutation.core_deleteEnvironment": + if e.complexity.Mutation.CoreDeleteEnvironment == nil { + break + } - switch rc.Operation.Operation { - case ast.Query: - return func(ctx context.Context) *graphql.Response { - if !first { - return nil - } - first = false - ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) - data := ec._Query(ctx, rc.Operation.SelectionSet) - var buf bytes.Buffer - data.MarshalGQL(&buf) + args, err := ec.field_Mutation_core_deleteEnvironment_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } - return &graphql.Response{ - Data: buf.Bytes(), - } + return e.complexity.Mutation.CoreDeleteEnvironment(childComplexity, args["projectName"].(string), args["envName"].(string)), true + + case "Mutation.core_deleteImagePullSecret": + if e.complexity.Mutation.CoreDeleteImagePullSecret == nil { + break } - 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(), - } + args, err := ec.field_Mutation_core_deleteImagePullSecret_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - default: - return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation")) - } -} + return e.complexity.Mutation.CoreDeleteImagePullSecret(childComplexity, args["projectName"].(string), args["envName"].(string), args["secretName"].(string)), true -type executionContext struct { - *graphql.OperationContext - *executableSchema -} + case "Mutation.core_deleteManagedResource": + if e.complexity.Mutation.CoreDeleteManagedResource == nil { + break + } -func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { - if ec.DisableIntrospection { - return nil, errors.New("introspection disabled") - } - return introspection.WrapSchema(parsedSchema), nil -} + args, err := ec.field_Mutation_core_deleteManagedResource_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { - if ec.DisableIntrospection { - return nil, errors.New("introspection disabled") - } - return introspection.WrapTypeFromDef(parsedSchema, parsedSchema.Types[name]), nil -} + return e.complexity.Mutation.CoreDeleteManagedResource(childComplexity, args["projectName"].(string), args["envName"].(string), args["mresName"].(string)), true -var sources = []*ast.Source{ - {Name: "../schema.graphqls", Input: `directive @isLoggedIn on FIELD_DEFINITION -directive @hasAccountAndCluster on FIELD_DEFINITION -directive @hasAccount on FIELD_DEFINITION + case "Mutation.core_deleteProject": + if e.complexity.Mutation.CoreDeleteProject == nil { + break + } -enum ConsoleResType { - project - app - config - secret - router - managedservice - managedresource - environment -} + args, err := ec.field_Mutation_core_deleteProject_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -type ConsoleCheckNameAvailabilityOutput @shareable { - result: Boolean! - suggestedNames: [String!] -} + return e.complexity.Mutation.CoreDeleteProject(childComplexity, args["name"].(string)), true -type Query { - core_checkNameAvailability(resType: ConsoleResType!, name: String!): ConsoleCheckNameAvailabilityOutput! @isLoggedIn @hasAccount + case "Mutation.core_deleteProjectManagedService": + if e.complexity.Mutation.CoreDeleteProjectManagedService == nil { + break + } - core_listProjects(clusterName: String): [Project!] @isLoggedIn @hasAccount - core_getProject(name: String!): Project @isLoggedIn @hasAccountAndCluster - core_resyncProject(name: String!): Boolean! @isLoggedIn @hasAccountAndCluster + args, err := ec.field_Mutation_core_deleteProjectManagedService_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } - core_listWorkspaces(namespace: String!): [Workspace!] @isLoggedIn @hasAccountAndCluster - core_getWorkspace(namespace: String!, name: String!): Workspace @isLoggedIn @hasAccountAndCluster - core_resyncWorkspace(namespace: String!, name: String!): Boolean! @isLoggedIn @hasAccountAndCluster + return e.complexity.Mutation.CoreDeleteProjectManagedService(childComplexity, args["projectName"].(string), args["pmsvcName"].(string)), true - core_listApps(namespace: String!): [App!] @isLoggedIn @hasAccountAndCluster - core_getApp(namespace: String!, name: String!): App @isLoggedIn @hasAccountAndCluster - core_resyncApp(namespace: String!, name: String!): Boolean! @isLoggedIn @hasAccountAndCluster + case "Mutation.core_deleteRouter": + if e.complexity.Mutation.CoreDeleteRouter == nil { + break + } - core_listConfigs(namespace: String!): [Config!] @isLoggedIn @hasAccountAndCluster - core_getConfig(namespace: String!, name: String!): Config @isLoggedIn @hasAccountAndCluster - core_resyncConfig(namespace: String!, name: String!): Boolean! @isLoggedIn @hasAccountAndCluster + args, err := ec.field_Mutation_core_deleteRouter_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } - core_listSecrets(namespace: String!): [Secret!] @isLoggedIn @hasAccountAndCluster - core_getSecret(namespace: String!, name: String!): Secret @isLoggedIn @hasAccountAndCluster - core_resyncSecret(namespace: String!, name: String!): Boolean! @isLoggedIn @hasAccountAndCluster + return e.complexity.Mutation.CoreDeleteRouter(childComplexity, args["projectName"].(string), args["envName"].(string), args["routerName"].(string)), true - core_listRouters(namespace: String!): [Router!] @isLoggedIn @hasAccountAndCluster - core_getRouter(namespace: String!, name: String!): Router @isLoggedIn @hasAccountAndCluster - core_resyncRouter(namespace: String!, name: String!): Boolean! @isLoggedIn @hasAccountAndCluster + case "Mutation.core_deleteSecret": + if e.complexity.Mutation.CoreDeleteSecret == nil { + break + } - core_listManagedServices(namespace: String!): [ManagedService!] @isLoggedIn @hasAccountAndCluster - core_getManagedService(namespace: String!, name: String!): ManagedService @isLoggedIn @hasAccountAndCluster - core_resyncManagedService(namespace: String!, name: String!): Boolean! @isLoggedIn @hasAccountAndCluster + args, err := ec.field_Mutation_core_deleteSecret_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } - core_listManagedResources(namespace: String!): [ManagedResource!] @isLoggedIn @hasAccountAndCluster - core_getManagedResource(namespace: String!, name: String!): ManagedResource @isLoggedIn @hasAccountAndCluster - core_resyncManagedResource(namespace: String!, name: String!): Boolean! @isLoggedIn @hasAccountAndCluster -} + return e.complexity.Mutation.CoreDeleteSecret(childComplexity, args["projectName"].(string), args["envName"].(string), args["secretName"].(string)), true -type Mutation { - core_createProject(project: ProjectIn!): Project @isLoggedIn @hasAccountAndCluster - core_updateProject(project: ProjectIn!): Project @isLoggedIn @hasAccountAndCluster - core_deleteProject(name: String!): Boolean! @isLoggedIn @hasAccountAndCluster - - core_createWorkspace(env: WorkspaceIn!): Workspace @isLoggedIn @hasAccountAndCluster - core_updateWorkspace(env: WorkspaceIn!): Workspace @isLoggedIn @hasAccountAndCluster - core_deleteWorkspace(namespace: String!, name: String!): Boolean! @isLoggedIn @hasAccountAndCluster - - core_createApp(app: AppIn!): App @isLoggedIn @hasAccountAndCluster - core_updateApp(app: AppIn!): App @isLoggedIn @hasAccountAndCluster - core_deleteApp(namespace: String!, name: String!): Boolean! @isLoggedIn @hasAccountAndCluster - - core_createConfig(config: ConfigIn!): Config @isLoggedIn @hasAccountAndCluster - core_updateConfig(config: ConfigIn!): Config @isLoggedIn @hasAccountAndCluster - core_deleteConfig(namespace: String!, name: String!): Boolean! @isLoggedIn @hasAccountAndCluster - - core_createSecret(secret: SecretIn!): Secret @isLoggedIn @hasAccountAndCluster - core_updateSecret(secret: SecretIn!): Secret @isLoggedIn @hasAccountAndCluster - core_deleteSecret(namespace: String!, name: String!): Boolean! @isLoggedIn @hasAccountAndCluster - - core_createRouter(router: RouterIn!): Router @isLoggedIn @hasAccountAndCluster - core_updateRouter(router: RouterIn!): Router @isLoggedIn @hasAccountAndCluster - core_deleteRouter(namespace: String!, name: String!): Boolean! @isLoggedIn @hasAccountAndCluster - - core_createManagedService(msvc: ManagedServiceIn!): ManagedService @isLoggedIn @hasAccountAndCluster - core_updateManagedService(msvc: ManagedServiceIn!): ManagedService @isLoggedIn @hasAccountAndCluster - core_deleteManagedService(namespace: String!, name: String!): Boolean! @isLoggedIn @hasAccountAndCluster - - core_createManagedResource(mres: ManagedResourceIn!): ManagedResource @isLoggedIn @hasAccountAndCluster - core_updateManagedResource(mres: ManagedResourceIn!): ManagedResource @isLoggedIn @hasAccountAndCluster - core_deleteManagedResource(namespace: String!, name: String!): Boolean! @isLoggedIn @hasAccountAndCluster -} -`, BuiltIn: false}, - {Name: "../crd-to-gql/app.graphqls", Input: `input AppSpecContainersEnvFromIn { - type: String! - refName: String! -} + case "Mutation.core_deleteVPNDevice": + if e.complexity.Mutation.CoreDeleteVPNDevice == nil { + break + } -type AppSpecContainersLivenessProbeTcp @shareable { - port: Int! -} + args, err := ec.field_Mutation_core_deleteVPNDevice_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -input AppSpecContainersLivenessProbeIn { - failureThreshold: Int - httpGet: AppSpecContainersLivenessProbeHttpGetIn - initialDelay: Int - interval: Int - shell: AppSpecContainersLivenessProbeShellIn - tcp: AppSpecContainersLivenessProbeTcpIn - type: String! -} + return e.complexity.Mutation.CoreDeleteVPNDevice(childComplexity, args["deviceName"].(string)), true -type AppSpecServices @shareable { - name: String - port: Int! - targetPort: Int - type: String -} + case "Mutation.core_interceptApp": + if e.complexity.Mutation.CoreInterceptApp == nil { + break + } -type AppSpecContainersEnvFrom @shareable { - type: String! - refName: String! -} + args, err := ec.field_Mutation_core_interceptApp_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -input AppSpecContainersLivenessProbeShellIn { - command: [String] -} + return e.complexity.Mutation.CoreInterceptApp(childComplexity, args["projectName"].(string), args["envName"].(string), args["appname"].(string), args["deviceName"].(string), args["intercept"].(bool)), true -input AppSpecContainersReadinessProbeShellIn { - command: [String] -} - -type AppSpecContainersReadinessProbeTcp @shareable { - port: Int! -} - -input AppSpecContainersResourceMemoryIn { - max: String - min: String -} - -type AppSpec @shareable { - containers: [AppSpecContainers]! - displayName: String - intercept: AppSpecIntercept - region: String - replicas: Int - freeze: Boolean - hpa: AppSpecHpa - nodeSelector: Map - serviceAccount: String - services: [AppSpecServices] - tolerations: [AppSpecTolerations] -} - -input AppSpecContainersVolumesIn { - mountPath: String! - refName: String! - type: String! - items: [AppSpecContainersVolumesItemsIn] -} - -type AppSpecContainers @shareable { - name: String! - args: [String] - env: [AppSpecContainersEnv] - envFrom: [AppSpecContainersEnvFrom] - image: String! - imagePullPolicy: String - volumes: [AppSpecContainersVolumes] - command: [String] - livenessProbe: AppSpecContainersLivenessProbe - readinessProbe: AppSpecContainersReadinessProbe - resourceCpu: AppSpecContainersResourceCpu - resourceMemory: AppSpecContainersResourceMemory -} - -type AppSpecHpa @shareable { - enabled: Boolean - maxReplicas: Int - minReplicas: Int - thresholdCpu: Int - thresholdMemory: Int -} - -type App @shareable { - kind: String - metadata: Metadata! @goField(name: "objectMeta") - overrides: Overrides - restart: Boolean - syncStatus: SyncStatus - spec: AppSpec - status: Status - apiVersion: String - enabled: Boolean -} - -type AppSpecContainersResourceCpu @shareable { - max: String - min: String -} - -input AppSpecContainersIn { - name: String! - args: [String] - env: [AppSpecContainersEnvIn] - envFrom: [AppSpecContainersEnvFromIn] - image: String! - imagePullPolicy: String - volumes: [AppSpecContainersVolumesIn] - command: [String] - livenessProbe: AppSpecContainersLivenessProbeIn - readinessProbe: AppSpecContainersReadinessProbeIn - resourceCpu: AppSpecContainersResourceCpuIn - resourceMemory: AppSpecContainersResourceMemoryIn -} + case "Mutation.core_updateApp": + if e.complexity.Mutation.CoreUpdateApp == nil { + break + } -input AppSpecTolerationsIn { - effect: String - key: String - operator: String - tolerationSeconds: Int - value: String -} - -input AppSpecIn { - containers: [AppSpecContainersIn]! - displayName: String - intercept: AppSpecInterceptIn - region: String - replicas: Int - freeze: Boolean - hpa: AppSpecHpaIn - nodeSelector: Map - serviceAccount: String - services: [AppSpecServicesIn] - tolerations: [AppSpecTolerationsIn] -} + args, err := ec.field_Mutation_core_updateApp_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -input AppIn { - kind: String - metadata: MetadataIn! @goField(name: "objectMeta") - overrides: OverridesIn - restart: Boolean - spec: AppSpecIn - apiVersion: String - enabled: Boolean -} + return e.complexity.Mutation.CoreUpdateApp(childComplexity, args["projectName"].(string), args["envName"].(string), args["app"].(entities.App)), true -input AppSpecHpaIn { - enabled: Boolean - maxReplicas: Int - minReplicas: Int - thresholdCpu: Int - thresholdMemory: Int -} + case "Mutation.core_updateConfig": + if e.complexity.Mutation.CoreUpdateConfig == nil { + break + } -type AppSpecContainersEnv @shareable { - key: String! - optional: Boolean - refKey: String - refName: String - type: String - value: String -} + args, err := ec.field_Mutation_core_updateConfig_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -type AppSpecContainersVolumesItems @shareable { - key: String! - fileName: String -} + return e.complexity.Mutation.CoreUpdateConfig(childComplexity, args["projectName"].(string), args["envName"].(string), args["config"].(entities.Config)), true -input AppSpecContainersLivenessProbeTcpIn { - port: Int! -} + case "Mutation.core_updateEnvironment": + if e.complexity.Mutation.CoreUpdateEnvironment == nil { + break + } -input AppSpecContainersReadinessProbeTcpIn { - port: Int! -} + args, err := ec.field_Mutation_core_updateEnvironment_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -input AppSpecContainersReadinessProbeHttpGetIn { - httpHeaders: Map - path: String! - port: Int! -} + return e.complexity.Mutation.CoreUpdateEnvironment(childComplexity, args["projectName"].(string), args["env"].(entities.Environment)), true -input AppSpecContainersResourceCpuIn { - max: String - min: String -} + case "Mutation.core_updateManagedResource": + if e.complexity.Mutation.CoreUpdateManagedResource == nil { + break + } -type AppSpecContainersResourceMemory @shareable { - max: String - min: String -} + args, err := ec.field_Mutation_core_updateManagedResource_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -type AppSpecTolerations @shareable { - effect: String - key: String - operator: String - tolerationSeconds: Int - value: String -} + return e.complexity.Mutation.CoreUpdateManagedResource(childComplexity, args["projectName"].(string), args["envName"].(string), args["mres"].(entities.ManagedResource)), true -input AppSpecContainersVolumesItemsIn { - key: String! - fileName: String -} + case "Mutation.core_updateProject": + if e.complexity.Mutation.CoreUpdateProject == nil { + break + } -type AppSpecContainersReadinessProbeShell @shareable { - command: [String] -} + args, err := ec.field_Mutation_core_updateProject_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -type AppSpecContainersReadinessProbeHttpGet @shareable { - httpHeaders: Map - path: String! - port: Int! -} + return e.complexity.Mutation.CoreUpdateProject(childComplexity, args["project"].(entities.Project)), true -type AppSpecIntercept @shareable { - enabled: Boolean! - toDevice: String! -} + case "Mutation.core_updateProjectManagedService": + if e.complexity.Mutation.CoreUpdateProjectManagedService == nil { + break + } -input AppSpecInterceptIn { - enabled: Boolean! - toDevice: String! -} + args, err := ec.field_Mutation_core_updateProjectManagedService_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -type AppSpecContainersLivenessProbeHttpGet @shareable { - httpHeaders: Map - path: String! - port: Int! -} + return e.complexity.Mutation.CoreUpdateProjectManagedService(childComplexity, args["projectName"].(string), args["pmsvc"].(entities.ProjectManagedService)), true -input AppSpecContainersLivenessProbeHttpGetIn { - httpHeaders: Map - path: String! - port: Int! -} + case "Mutation.core_updateRouter": + if e.complexity.Mutation.CoreUpdateRouter == nil { + break + } -type AppSpecContainersLivenessProbeShell @shareable { - command: [String] -} + args, err := ec.field_Mutation_core_updateRouter_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -type AppSpecContainersReadinessProbe @shareable { - interval: Int - shell: AppSpecContainersReadinessProbeShell - tcp: AppSpecContainersReadinessProbeTcp - type: String! - failureThreshold: Int - httpGet: AppSpecContainersReadinessProbeHttpGet - initialDelay: Int -} + return e.complexity.Mutation.CoreUpdateRouter(childComplexity, args["projectName"].(string), args["envName"].(string), args["router"].(entities.Router)), true -input AppSpecContainersReadinessProbeIn { - interval: Int - shell: AppSpecContainersReadinessProbeShellIn - tcp: AppSpecContainersReadinessProbeTcpIn - type: String! - failureThreshold: Int - httpGet: AppSpecContainersReadinessProbeHttpGetIn - initialDelay: Int -} + case "Mutation.core_updateSecret": + if e.complexity.Mutation.CoreUpdateSecret == nil { + break + } -input AppSpecServicesIn { - name: String - port: Int! - targetPort: Int - type: String -} + args, err := ec.field_Mutation_core_updateSecret_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -input AppSpecContainersEnvIn { - key: String! - optional: Boolean - refKey: String - refName: String - type: String - value: String -} + return e.complexity.Mutation.CoreUpdateSecret(childComplexity, args["projectName"].(string), args["envName"].(string), args["secret"].(entities.Secret)), true -type AppSpecContainersVolumes @shareable { - mountPath: String! - refName: String! - type: String! - items: [AppSpecContainersVolumesItems] -} + case "Mutation.core_updateVPNDevice": + if e.complexity.Mutation.CoreUpdateVPNDevice == nil { + break + } -type AppSpecContainersLivenessProbe @shareable { - failureThreshold: Int - httpGet: AppSpecContainersLivenessProbeHttpGet - initialDelay: Int - interval: Int - shell: AppSpecContainersLivenessProbeShell - tcp: AppSpecContainersLivenessProbeTcp - type: String! -} + args, err := ec.field_Mutation_core_updateVPNDevice_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -`, BuiltIn: false}, - {Name: "../crd-to-gql/config.graphqls", Input: `type Config @shareable { - enabled: Boolean - kind: String - metadata: Metadata! @goField(name: "objectMeta") - overrides: Overrides - status: Status - apiVersion: String - syncStatus: SyncStatus - data: Map -} + return e.complexity.Mutation.CoreUpdateVPNDevice(childComplexity, args["vpnDevice"].(entities.ConsoleVPNDevice)), true -input ConfigIn { - enabled: Boolean - kind: String - metadata: MetadataIn! @goField(name: "objectMeta") - overrides: OverridesIn - apiVersion: String - data: Map -} + case "Mutation.core_updateVPNDeviceEnv": + if e.complexity.Mutation.CoreUpdateVPNDeviceEnv == nil { + break + } -`, BuiltIn: false}, - {Name: "../crd-to-gql/directives.graphqls", Input: ` -extend schema @link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@key", "@shareable"]) + args, err := ec.field_Mutation_core_updateVPNDeviceEnv_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -directive @goField( - forceResolver: Boolean - name: String -) on INPUT_FIELD_DEFINITION | FIELD_DEFINITION -`, BuiltIn: false}, - {Name: "../crd-to-gql/managedresource.graphqls", Input: `type ManagedResourceSpecMsvcRef @shareable { - apiVersion: String! - kind: String - name: String! -} + return e.complexity.Mutation.CoreUpdateVPNDeviceEnv(childComplexity, args["deviceName"].(string), args["projectName"].(string), args["envName"].(string)), true -input ManagedResourceSpecMsvcRefIn { - apiVersion: String! - kind: String - name: String! -} + case "Mutation.core_updateVPNDevicePorts": + if e.complexity.Mutation.CoreUpdateVPNDevicePorts == nil { + break + } -type ManagedResourceSpec @shareable { - inputs: Map - mresKind: ManagedResourceSpecMresKind! - msvcRef: ManagedResourceSpecMsvcRef! -} + args, err := ec.field_Mutation_core_updateVPNDevicePorts_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -input ManagedResourceSpecIn { - inputs: Map - mresKind: ManagedResourceSpecMresKindIn! - msvcRef: ManagedResourceSpecMsvcRefIn! -} + return e.complexity.Mutation.CoreUpdateVPNDevicePorts(childComplexity, args["deviceName"].(string), args["ports"].([]*v11.Port)), true -type ManagedResource @shareable { - overrides: Overrides - syncStatus: SyncStatus - spec: ManagedResourceSpec - status: Status - apiVersion: String - enabled: Boolean - kind: String - metadata: Metadata! @goField(name: "objectMeta") -} + case "Mutation.core_updateVpnClusterName": + if e.complexity.Mutation.CoreUpdateVpnClusterName == nil { + break + } -input ManagedResourceIn { - overrides: OverridesIn - spec: ManagedResourceSpecIn - apiVersion: String - enabled: Boolean - kind: String - metadata: MetadataIn! @goField(name: "objectMeta") -} + args, err := ec.field_Mutation_core_updateVpnClusterName_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -type ManagedResourceSpecMresKind @shareable { - kind: String! -} + return e.complexity.Mutation.CoreUpdateVpnClusterName(childComplexity, args["deviceName"].(string), args["clusterName"].(string)), true -input ManagedResourceSpecMresKindIn { - kind: String! -} + case "Mutation.core_updateVpnDeviceNs": + if e.complexity.Mutation.CoreUpdateVpnDeviceNs == nil { + break + } -`, BuiltIn: false}, - {Name: "../crd-to-gql/managedservice.graphqls", Input: `type ManagedService @shareable { - overrides: Overrides - syncStatus: SyncStatus - spec: ManagedServiceSpec - status: Status - apiVersion: String - enabled: Boolean - kind: String - metadata: Metadata! @goField(name: "objectMeta") -} + args, err := ec.field_Mutation_core_updateVpnDeviceNs_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -input ManagedServiceIn { - overrides: OverridesIn - spec: ManagedServiceSpecIn - apiVersion: String - enabled: Boolean - kind: String - metadata: MetadataIn! @goField(name: "objectMeta") -} + return e.complexity.Mutation.CoreUpdateVpnDeviceNs(childComplexity, args["deviceName"].(string), args["ns"].(string)), true -type ManagedServiceSpecMsvcKind @shareable { - kind: String - apiVersion: String! -} + case "PageInfo.endCursor": + if e.complexity.PageInfo.EndCursor == nil { + break + } -input ManagedServiceSpecMsvcKindIn { - kind: String - apiVersion: String! -} + return e.complexity.PageInfo.EndCursor(childComplexity), true -type ManagedServiceSpecTolerations @shareable { - effect: String - key: String - operator: String - tolerationSeconds: Int - value: String -} + case "PageInfo.hasNextPage": + if e.complexity.PageInfo.HasNextPage == nil { + break + } -input ManagedServiceSpecTolerationsIn { - effect: String - key: String - operator: String - tolerationSeconds: Int - value: String -} + return e.complexity.PageInfo.HasNextPage(childComplexity), true -type ManagedServiceSpec @shareable { - inputs: Map - msvcKind: ManagedServiceSpecMsvcKind! - nodeSelector: Map - region: String - tolerations: [ManagedServiceSpecTolerations] -} + case "PageInfo.hasPreviousPage": + if e.complexity.PageInfo.HasPreviousPage == nil { + break + } -input ManagedServiceSpecIn { - inputs: Map - msvcKind: ManagedServiceSpecMsvcKindIn! - nodeSelector: Map - region: String - tolerations: [ManagedServiceSpecTolerationsIn] -} + return e.complexity.PageInfo.HasPreviousPage(childComplexity), true -`, BuiltIn: false}, - {Name: "../crd-to-gql/project.graphqls", Input: `type ProjectSpec @shareable { - displayName: String - logo: String - targetNamespace: String! - accountName: String! - clusterName: String! -} + case "PageInfo.startCursor": + if e.complexity.PageInfo.StartCursor == nil { + break + } -input ProjectSpecIn { - displayName: String - logo: String - targetNamespace: String! - accountName: String! - clusterName: String! -} + return e.complexity.PageInfo.StartCursor(childComplexity), true -type Project @shareable { - apiVersion: String - kind: String - metadata: Metadata! @goField(name: "objectMeta") - syncStatus: SyncStatus - spec: ProjectSpec - status: Status -} + case "Port.port": + if e.complexity.Port.Port == nil { + break + } -input ProjectIn { - apiVersion: String - kind: String - metadata: MetadataIn! @goField(name: "objectMeta") - spec: ProjectSpecIn -} + return e.complexity.Port.Port(childComplexity), true -`, BuiltIn: false}, - {Name: "../crd-to-gql/router.graphqls", Input: `input RouterSpecRateLimitIn { - connections: Int - enabled: Boolean - rpm: Int - rps: Int -} - -type Router @shareable { - apiVersion: String - kind: String - metadata: Metadata! @goField(name: "objectMeta") - overrides: Overrides - syncStatus: SyncStatus - spec: RouterSpec - status: Status -} - -input RouterSpecBasicAuthIn { - enabled: Boolean! - secretName: String - username: String -} - -type RouterSpecHttps @shareable { - clusterIssuer: String - enabled: Boolean! - forceRedirect: Boolean -} - -input RouterSpecHttpsIn { - clusterIssuer: String - enabled: Boolean! - forceRedirect: Boolean -} - -type RouterSpecRateLimit @shareable { - connections: Int - enabled: Boolean - rpm: Int - rps: Int -} - -type RouterSpec @shareable { - cors: RouterSpecCors - ingressClass: String - maxBodySizeInMB: Int - region: String - routes: [RouterSpecRoutes] - backendProtocol: String - basicAuth: RouterSpecBasicAuth - domains: [String]! - https: RouterSpecHttps - rateLimit: RouterSpecRateLimit -} - -input RouterSpecIn { - cors: RouterSpecCorsIn - ingressClass: String - maxBodySizeInMB: Int - region: String - routes: [RouterSpecRoutesIn] - backendProtocol: String - basicAuth: RouterSpecBasicAuthIn - domains: [String]! - https: RouterSpecHttpsIn - rateLimit: RouterSpecRateLimitIn -} + case "Port.targetPort": + if e.complexity.Port.TargetPort == nil { + break + } -input RouterIn { - apiVersion: String - kind: String - metadata: MetadataIn! @goField(name: "objectMeta") - overrides: OverridesIn - spec: RouterSpecIn -} + return e.complexity.Port.TargetPort(childComplexity), true -input RouterSpecCorsIn { - allowCredentials: Boolean - enabled: Boolean - origins: [String] -} + case "Project.apiVersion": + if e.complexity.Project.APIVersion == nil { + break + } -type RouterSpecRoutes @shareable { - app: String - lambda: String - path: String! - port: Int! - rewrite: Boolean -} + return e.complexity.Project.APIVersion(childComplexity), true -input RouterSpecRoutesIn { - app: String - lambda: String - path: String! - port: Int! - rewrite: Boolean -} + case "Project.accountName": + if e.complexity.Project.AccountName == nil { + break + } -type RouterSpecCors @shareable { - allowCredentials: Boolean - enabled: Boolean - origins: [String] -} + return e.complexity.Project.AccountName(childComplexity), true -type RouterSpecBasicAuth @shareable { - enabled: Boolean! - secretName: String - username: String -} + case "Project.clusterName": + if e.complexity.Project.ClusterName == nil { + break + } -`, BuiltIn: false}, - {Name: "../crd-to-gql/scalars.graphqls", Input: ` -scalar Any -scalar Json -scalar Map -scalar Date + return e.complexity.Project.ClusterName(childComplexity), true -type Metadata @shareable { - name: String! - namespace: String - labels: Json - annotations: Json - creationTimestamp: Date! - deletionTimestamp: Date - generation: Int! -} + case "Project.createdBy": + if e.complexity.Project.CreatedBy == nil { + break + } -input MetadataIn { - name: String! - namespace: String - labels: Json - annotations: Json -} + return e.complexity.Project.CreatedBy(childComplexity), true -type Status @shareable { - isReady: Boolean! - checks: Map - displayVars: Json -} + case "Project.creationTime": + if e.complexity.Project.CreationTime == nil { + break + } -type Check @shareable { - status: Boolean - message: String - generation: Int -} + return e.complexity.Project.CreationTime(childComplexity), true -type Patch @shareable { - op: String! - path: String! - value: Any -} + case "Project.displayName": + if e.complexity.Project.DisplayName == nil { + break + } -type Overrides @shareable{ - applied: Boolean - patches: [Patch!] -} + return e.complexity.Project.DisplayName(childComplexity), true -input PatchIn { - op: String! - path: String! - value: Any -} + case "Project.id": + if e.complexity.Project.ID == nil { + break + } -input OverridesIn{ - patches: [PatchIn!] -} + return e.complexity.Project.ID(childComplexity), true -enum SyncAction { - APPLY - DELETE -} + case "Project.kind": + if e.complexity.Project.Kind == nil { + break + } -enum SyncState { - IDLE - IN_PROGRESS - READY - NOT_READY -} + return e.complexity.Project.Kind(childComplexity), true -type SyncStatus @shareable{ - syncScheduledAt: Date! - lastSyncedAt: Date - action: SyncAction! - generation: Int! - state: SyncState! - error: String -} -`, BuiltIn: false}, - {Name: "../crd-to-gql/secret.graphqls", Input: `type Secret @shareable { - syncStatus: SyncStatus - data: Map - enabled: Boolean - kind: String - metadata: Metadata! @goField(name: "objectMeta") - projectName: String - status: Status - apiVersion: String - overrides: Overrides - stringData: Map - type: String -} + case "Project.lastUpdatedBy": + if e.complexity.Project.LastUpdatedBy == nil { + break + } -input SecretIn { - data: Map - enabled: Boolean - kind: String - metadata: MetadataIn! @goField(name: "objectMeta") - projectName: String - apiVersion: String - overrides: OverridesIn - stringData: Map - type: String -} + return e.complexity.Project.LastUpdatedBy(childComplexity), true -`, BuiltIn: false}, - {Name: "../crd-to-gql/workspace.graphqls", Input: `input WorkspaceSpecIn { - projectName: String! - targetNamespace: String! -} + case "Project.markedForDeletion": + if e.complexity.Project.MarkedForDeletion == nil { + break + } -type Workspace @shareable { - metadata: Metadata! @goField(name: "objectMeta") - syncStatus: SyncStatus - spec: WorkspaceSpec - status: Status - apiVersion: String - kind: String -} + return e.complexity.Project.MarkedForDeletion(childComplexity), true -input WorkspaceIn { - metadata: MetadataIn! @goField(name: "objectMeta") - spec: WorkspaceSpecIn - apiVersion: String - kind: String -} + case "Project.metadata": + if e.complexity.Project.ObjectMeta == nil { + break + } -type WorkspaceSpec @shareable { - projectName: String! - targetNamespace: String! -} + return e.complexity.Project.ObjectMeta(childComplexity), true -`, BuiltIn: false}, - {Name: "../../federation/directives.graphql", Input: ` - scalar _Any - scalar _FieldSet - directive @requires(fields: _FieldSet!) on FIELD_DEFINITION - directive @provides(fields: _FieldSet!) on FIELD_DEFINITION - directive @extends on OBJECT | INTERFACE + case "Project.recordVersion": + if e.complexity.Project.RecordVersion == nil { + break + } - directive @key(fields: _FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE - directive @external on FIELD_DEFINITION | OBJECT - directive @link(import: [String!], url: String!) repeatable on SCHEMA - directive @shareable on OBJECT | FIELD_DEFINITION - directive @tag(name: String!) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION - directive @override(from: String!) on FIELD_DEFINITION - directive @inaccessible on SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION -`, BuiltIn: true}, - {Name: "../../federation/entity.graphql", Input: ` -type _Service { - sdl: String -} + return e.complexity.Project.RecordVersion(childComplexity), true -extend type Query { - _service: _Service! -} -`, BuiltIn: true}, -} -var parsedSchema = gqlparser.MustLoadSchema(sources...) + case "Project.spec": + if e.complexity.Project.Spec == nil { + break + } -// endregion ************************** generated!.gotpl ************************** + return e.complexity.Project.Spec(childComplexity), true -// region ***************************** args.gotpl ***************************** + case "Project.status": + if e.complexity.Project.Status == nil { + break + } -func (ec *executionContext) field_Mutation_core_createApp_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 entities.App - if tmp, ok := rawArgs["app"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("app")) - arg0, err = ec.unmarshalNAppIn2kloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐApp(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.Project.Status(childComplexity), true + + case "Project.syncStatus": + if e.complexity.Project.SyncStatus == nil { + break } - } - args["app"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_core_createConfig_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 entities.Config - if tmp, ok := rawArgs["config"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("config")) - arg0, err = ec.unmarshalNConfigIn2kloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐConfig(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.Project.SyncStatus(childComplexity), true + + case "Project.updateTime": + if e.complexity.Project.UpdateTime == nil { + break } - } - args["config"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_core_createManagedResource_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 entities.MRes - if tmp, ok := rawArgs["mres"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("mres")) - arg0, err = ec.unmarshalNManagedResourceIn2kloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐMRes(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.Project.UpdateTime(childComplexity), true + + case "ProjectEdge.cursor": + if e.complexity.ProjectEdge.Cursor == nil { + break } - } - args["mres"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_core_createManagedService_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 entities.MSvc - if tmp, ok := rawArgs["msvc"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("msvc")) - arg0, err = ec.unmarshalNManagedServiceIn2kloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐMSvc(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.ProjectEdge.Cursor(childComplexity), true + + case "ProjectEdge.node": + if e.complexity.ProjectEdge.Node == nil { + break } - } - args["msvc"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_core_createProject_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 entities.Project - if tmp, ok := rawArgs["project"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("project")) - arg0, err = ec.unmarshalNProjectIn2kloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐProject(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.ProjectEdge.Node(childComplexity), true + + case "ProjectManagedService.apiVersion": + if e.complexity.ProjectManagedService.APIVersion == nil { + break } - } - args["project"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_core_createRouter_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 entities.Router - if tmp, ok := rawArgs["router"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("router")) - arg0, err = ec.unmarshalNRouterIn2kloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐRouter(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.ProjectManagedService.APIVersion(childComplexity), true + + case "ProjectManagedService.accountName": + if e.complexity.ProjectManagedService.AccountName == nil { + break } - } - args["router"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_core_createSecret_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 entities.Secret - if tmp, ok := rawArgs["secret"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secret")) - arg0, err = ec.unmarshalNSecretIn2kloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐSecret(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.ProjectManagedService.AccountName(childComplexity), true + + case "ProjectManagedService.createdBy": + if e.complexity.ProjectManagedService.CreatedBy == nil { + break } - } - args["secret"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_core_createWorkspace_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 entities.Workspace - if tmp, ok := rawArgs["env"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("env")) - arg0, err = ec.unmarshalNWorkspaceIn2kloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐWorkspace(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.ProjectManagedService.CreatedBy(childComplexity), true + + case "ProjectManagedService.creationTime": + if e.complexity.ProjectManagedService.CreationTime == nil { + break } - } - args["env"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_core_deleteApp_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 + return e.complexity.ProjectManagedService.CreationTime(childComplexity), true + + case "ProjectManagedService.displayName": + if e.complexity.ProjectManagedService.DisplayName == nil { + break } - } - args["namespace"] = arg0 - var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["name"] = arg1 - return args, nil -} -func (ec *executionContext) field_Mutation_core_deleteConfig_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 + return e.complexity.ProjectManagedService.DisplayName(childComplexity), true + + case "ProjectManagedService.id": + if e.complexity.ProjectManagedService.ID == nil { + break } - } - args["namespace"] = arg0 - var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err + + return e.complexity.ProjectManagedService.ID(childComplexity), true + + case "ProjectManagedService.kind": + if e.complexity.ProjectManagedService.Kind == nil { + break } - } - args["name"] = arg1 - return args, nil -} -func (ec *executionContext) field_Mutation_core_deleteManagedResource_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 + return e.complexity.ProjectManagedService.Kind(childComplexity), true + + case "ProjectManagedService.lastUpdatedBy": + if e.complexity.ProjectManagedService.LastUpdatedBy == nil { + break } - } - args["namespace"] = arg0 - var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err + + return e.complexity.ProjectManagedService.LastUpdatedBy(childComplexity), true + + case "ProjectManagedService.markedForDeletion": + if e.complexity.ProjectManagedService.MarkedForDeletion == nil { + break } - } - args["name"] = arg1 - return args, nil -} -func (ec *executionContext) field_Mutation_core_deleteManagedService_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 + return e.complexity.ProjectManagedService.MarkedForDeletion(childComplexity), true + + case "ProjectManagedService.metadata": + if e.complexity.ProjectManagedService.ObjectMeta == nil { + break } - } - args["namespace"] = arg0 - var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err + + return e.complexity.ProjectManagedService.ObjectMeta(childComplexity), true + + case "ProjectManagedService.projectName": + if e.complexity.ProjectManagedService.ProjectName == nil { + break } - } - args["name"] = arg1 - return args, nil -} -func (ec *executionContext) field_Mutation_core_deleteProject_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 + return e.complexity.ProjectManagedService.ProjectName(childComplexity), true + + case "ProjectManagedService.recordVersion": + if e.complexity.ProjectManagedService.RecordVersion == nil { + break } - } - args["name"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_core_deleteRouter_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 + return e.complexity.ProjectManagedService.RecordVersion(childComplexity), true + + case "ProjectManagedService.spec": + if e.complexity.ProjectManagedService.Spec == nil { + break } - } - args["namespace"] = arg0 - var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err + + return e.complexity.ProjectManagedService.Spec(childComplexity), true + + case "ProjectManagedService.status": + if e.complexity.ProjectManagedService.Status == nil { + break } - } - args["name"] = arg1 - return args, nil -} -func (ec *executionContext) field_Mutation_core_deleteSecret_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 + return e.complexity.ProjectManagedService.Status(childComplexity), true + + case "ProjectManagedService.syncStatus": + if e.complexity.ProjectManagedService.SyncStatus == nil { + break } - } - args["namespace"] = arg0 - var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err + + return e.complexity.ProjectManagedService.SyncStatus(childComplexity), true + + case "ProjectManagedService.updateTime": + if e.complexity.ProjectManagedService.UpdateTime == nil { + break } - } - args["name"] = arg1 - return args, nil -} -func (ec *executionContext) field_Mutation_core_deleteWorkspace_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 + return e.complexity.ProjectManagedService.UpdateTime(childComplexity), true + + case "ProjectManagedServiceEdge.cursor": + if e.complexity.ProjectManagedServiceEdge.Cursor == nil { + break } - } - args["namespace"] = arg0 - var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err + + return e.complexity.ProjectManagedServiceEdge.Cursor(childComplexity), true + + case "ProjectManagedServiceEdge.node": + if e.complexity.ProjectManagedServiceEdge.Node == nil { + break } - } - args["name"] = arg1 - return args, nil -} -func (ec *executionContext) field_Mutation_core_updateApp_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 entities.App - if tmp, ok := rawArgs["app"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("app")) - arg0, err = ec.unmarshalNAppIn2kloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐApp(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.ProjectManagedServiceEdge.Node(childComplexity), true + + case "ProjectManagedServicePaginatedRecords.edges": + if e.complexity.ProjectManagedServicePaginatedRecords.Edges == nil { + break } - } - args["app"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_core_updateConfig_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 entities.Config - if tmp, ok := rawArgs["config"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("config")) - arg0, err = ec.unmarshalNConfigIn2kloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐConfig(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.ProjectManagedServicePaginatedRecords.Edges(childComplexity), true + + case "ProjectManagedServicePaginatedRecords.pageInfo": + if e.complexity.ProjectManagedServicePaginatedRecords.PageInfo == nil { + break } - } - args["config"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_core_updateManagedResource_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 entities.MRes - if tmp, ok := rawArgs["mres"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("mres")) - arg0, err = ec.unmarshalNManagedResourceIn2kloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐMRes(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.ProjectManagedServicePaginatedRecords.PageInfo(childComplexity), true + + case "ProjectManagedServicePaginatedRecords.totalCount": + if e.complexity.ProjectManagedServicePaginatedRecords.TotalCount == nil { + break } - } - args["mres"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_core_updateManagedService_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 entities.MSvc - if tmp, ok := rawArgs["msvc"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("msvc")) - arg0, err = ec.unmarshalNManagedServiceIn2kloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐMSvc(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.ProjectManagedServicePaginatedRecords.TotalCount(childComplexity), true + + case "ProjectPaginatedRecords.edges": + if e.complexity.ProjectPaginatedRecords.Edges == nil { + break } - } - args["msvc"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_core_updateProject_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 entities.Project - if tmp, ok := rawArgs["project"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("project")) - arg0, err = ec.unmarshalNProjectIn2kloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐProject(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.ProjectPaginatedRecords.Edges(childComplexity), true + + case "ProjectPaginatedRecords.pageInfo": + if e.complexity.ProjectPaginatedRecords.PageInfo == nil { + break } - } - args["project"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_core_updateRouter_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 entities.Router - if tmp, ok := rawArgs["router"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("router")) - arg0, err = ec.unmarshalNRouterIn2kloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐRouter(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.ProjectPaginatedRecords.PageInfo(childComplexity), true + + case "ProjectPaginatedRecords.totalCount": + if e.complexity.ProjectPaginatedRecords.TotalCount == nil { + break } - } - args["router"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_core_updateSecret_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 entities.Secret - if tmp, ok := rawArgs["secret"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secret")) - arg0, err = ec.unmarshalNSecretIn2kloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐSecret(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.ProjectPaginatedRecords.TotalCount(childComplexity), true + + case "Query.core_checkNameAvailability": + if e.complexity.Query.CoreCheckNameAvailability == nil { + break } - } - args["secret"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_core_updateWorkspace_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 entities.Workspace - if tmp, ok := rawArgs["env"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("env")) - arg0, err = ec.unmarshalNWorkspaceIn2kloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐWorkspace(ctx, tmp) + args, err := ec.field_Query_core_checkNameAvailability_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["env"] = arg0 - 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 + return e.complexity.Query.CoreCheckNameAvailability(childComplexity, args["projectName"].(*string), args["envName"].(*string), args["resType"].(entities.ResourceType), args["name"].(string)), true + + case "Query.core_getApp": + if e.complexity.Query.CoreGetApp == nil { + break } - } - args["name"] = arg0 - return args, nil -} -func (ec *executionContext) field_Query_core_checkNameAvailability_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 domain.ResType - if tmp, ok := rawArgs["resType"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("resType")) - arg0, err = ec.unmarshalNConsoleResType2kloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚐResType(ctx, tmp) + args, err := ec.field_Query_core_getApp_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["resType"] = arg0 - var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err + + return e.complexity.Query.CoreGetApp(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + + case "Query.core_getConfig": + if e.complexity.Query.CoreGetConfig == nil { + break } - } - args["name"] = arg1 - return args, nil -} -func (ec *executionContext) field_Query_core_getApp_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) + args, err := ec.field_Query_core_getConfig_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["namespace"] = arg0 - var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err + + return e.complexity.Query.CoreGetConfig(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + + case "Query.core_getConfigValues": + if e.complexity.Query.CoreGetConfigValues == nil { + break } - } - args["name"] = arg1 - return args, nil -} -func (ec *executionContext) field_Query_core_getConfig_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) + args, err := ec.field_Query_core_getConfigValues_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["namespace"] = arg0 - var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err + + return e.complexity.Query.CoreGetConfigValues(childComplexity, args["projectName"].(string), args["envName"].(string), args["queries"].([]*domain.ConfigKeyRef)), true + + case "Query.core_getEnvironment": + if e.complexity.Query.CoreGetEnvironment == nil { + break } - } - args["name"] = arg1 - return args, nil -} -func (ec *executionContext) field_Query_core_getManagedResource_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) + args, err := ec.field_Query_core_getEnvironment_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["namespace"] = arg0 - var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err + + return e.complexity.Query.CoreGetEnvironment(childComplexity, args["projectName"].(string), args["name"].(string)), true + + case "Query.core_getImagePullSecret": + if e.complexity.Query.CoreGetImagePullSecret == nil { + break } - } - args["name"] = arg1 - return args, nil -} -func (ec *executionContext) field_Query_core_getManagedService_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) + args, err := ec.field_Query_core_getImagePullSecret_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["namespace"] = arg0 - var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err + + return e.complexity.Query.CoreGetImagePullSecret(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + + case "Query.core_getManagedResouceOutputKeyValues": + if e.complexity.Query.CoreGetManagedResouceOutputKeyValues == nil { + break } - } - args["name"] = arg1 - return args, nil -} -func (ec *executionContext) field_Query_core_getProject_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) + args, err := ec.field_Query_core_getManagedResouceOutputKeyValues_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["name"] = arg0 - return args, nil -} -func (ec *executionContext) field_Query_core_getRouter_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 + return e.complexity.Query.CoreGetManagedResouceOutputKeyValues(childComplexity, args["projectName"].(string), args["envName"].(string), args["keyrefs"].([]*domain.ManagedResourceKeyRef)), true + + case "Query.core_getManagedResouceOutputKeys": + if e.complexity.Query.CoreGetManagedResouceOutputKeys == nil { + break } - } - args["namespace"] = arg0 - var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + + args, err := ec.field_Query_core_getManagedResouceOutputKeys_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["name"] = arg1 - return args, nil -} -func (ec *executionContext) field_Query_core_getSecret_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 + return e.complexity.Query.CoreGetManagedResouceOutputKeys(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + + case "Query.core_getManagedResource": + if e.complexity.Query.CoreGetManagedResource == nil { + break } - } - args["namespace"] = arg0 - var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + + args, err := ec.field_Query_core_getManagedResource_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["name"] = arg1 - return args, nil -} -func (ec *executionContext) field_Query_core_getWorkspace_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 + return e.complexity.Query.CoreGetManagedResource(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + + case "Query.core_getProject": + if e.complexity.Query.CoreGetProject == nil { + break } - } - args["namespace"] = arg0 - var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + + args, err := ec.field_Query_core_getProject_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["name"] = arg1 - return args, nil -} -func (ec *executionContext) field_Query_core_listApps_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 + return e.complexity.Query.CoreGetProject(childComplexity, args["name"].(string)), true + + case "Query.core_getProjectManagedService": + if e.complexity.Query.CoreGetProjectManagedService == nil { + break } - } - args["namespace"] = arg0 - return args, nil -} -func (ec *executionContext) field_Query_core_listConfigs_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) + args, err := ec.field_Query_core_getProjectManagedService_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["namespace"] = arg0 - return args, nil -} -func (ec *executionContext) field_Query_core_listManagedResources_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 + return e.complexity.Query.CoreGetProjectManagedService(childComplexity, args["projectName"].(string), args["name"].(string)), true + + case "Query.core_getRouter": + if e.complexity.Query.CoreGetRouter == nil { + break } - } - args["namespace"] = arg0 - return args, nil -} -func (ec *executionContext) field_Query_core_listManagedServices_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) + args, err := ec.field_Query_core_getRouter_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["namespace"] = arg0 - return args, nil -} -func (ec *executionContext) field_Query_core_listProjects_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["clusterName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - arg0, err = ec.unmarshalOString2ᚖstring(ctx, tmp) + return e.complexity.Query.CoreGetRouter(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + + case "Query.core_getSecret": + if e.complexity.Query.CoreGetSecret == nil { + break + } + + args, err := ec.field_Query_core_getSecret_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["clusterName"] = arg0 - return args, nil -} -func (ec *executionContext) field_Query_core_listRouters_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) + return e.complexity.Query.CoreGetSecret(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + + case "Query.core_getSecretValues": + if e.complexity.Query.CoreGetSecretValues == nil { + break + } + + args, err := ec.field_Query_core_getSecretValues_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["namespace"] = arg0 - return args, nil -} -func (ec *executionContext) field_Query_core_listSecrets_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) + return e.complexity.Query.CoreGetSecretValues(childComplexity, args["projectName"].(string), args["envName"].(string), args["queries"].([]*domain.SecretKeyRef)), true + + case "Query.core_getVPNDevice": + if e.complexity.Query.CoreGetVPNDevice == nil { + break + } + + args, err := ec.field_Query_core_getVPNDevice_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["namespace"] = arg0 - return args, nil -} -func (ec *executionContext) field_Query_core_listWorkspaces_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) + return e.complexity.Query.CoreGetVPNDevice(childComplexity, args["name"].(string)), true + + case "Query.core_listApps": + if e.complexity.Query.CoreListApps == nil { + break + } + + args, err := ec.field_Query_core_listApps_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["namespace"] = arg0 - return args, nil -} -func (ec *executionContext) field_Query_core_resyncApp_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) + return e.complexity.Query.CoreListApps(childComplexity, args["projectName"].(string), args["envName"].(string), args["search"].(*model.SearchApps), args["pq"].(*repos.CursorPagination)), true + + case "Query.core_listConfigs": + if e.complexity.Query.CoreListConfigs == nil { + break + } + + args, err := ec.field_Query_core_listConfigs_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["namespace"] = arg0 - var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + + return e.complexity.Query.CoreListConfigs(childComplexity, args["projectName"].(string), args["envName"].(string), args["search"].(*model.SearchConfigs), args["pq"].(*repos.CursorPagination)), true + + case "Query.core_listEnvironments": + if e.complexity.Query.CoreListEnvironments == nil { + break + } + + args, err := ec.field_Query_core_listEnvironments_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["name"] = arg1 - return args, nil -} -func (ec *executionContext) field_Query_core_resyncConfig_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) + return e.complexity.Query.CoreListEnvironments(childComplexity, args["projectName"].(string), args["search"].(*model.SearchEnvironments), args["pq"].(*repos.CursorPagination)), true + + case "Query.core_listImagePullSecrets": + if e.complexity.Query.CoreListImagePullSecrets == nil { + break + } + + args, err := ec.field_Query_core_listImagePullSecrets_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["namespace"] = arg0 - var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + + return e.complexity.Query.CoreListImagePullSecrets(childComplexity, args["projectName"].(string), args["envName"].(string), args["search"].(*model.SearchImagePullSecrets), args["pq"].(*repos.CursorPagination)), true + + case "Query.core_listManagedResources": + if e.complexity.Query.CoreListManagedResources == nil { + break + } + + args, err := ec.field_Query_core_listManagedResources_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["name"] = arg1 - return args, nil -} -func (ec *executionContext) field_Query_core_resyncManagedResource_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) + return e.complexity.Query.CoreListManagedResources(childComplexity, args["projectName"].(string), args["envName"].(string), args["search"].(*model.SearchManagedResources), args["pq"].(*repos.CursorPagination)), true + + case "Query.core_listProjectManagedServices": + if e.complexity.Query.CoreListProjectManagedServices == nil { + break + } + + args, err := ec.field_Query_core_listProjectManagedServices_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["namespace"] = arg0 - var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + + return e.complexity.Query.CoreListProjectManagedServices(childComplexity, args["projectName"].(string), args["search"].(*model.SearchProjectManagedService), args["pq"].(*repos.CursorPagination)), true + + case "Query.core_listProjects": + if e.complexity.Query.CoreListProjects == nil { + break + } + + args, err := ec.field_Query_core_listProjects_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["name"] = arg1 - return args, nil -} -func (ec *executionContext) field_Query_core_resyncManagedService_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) + return e.complexity.Query.CoreListProjects(childComplexity, args["search"].(*model.SearchProjects), args["pq"].(*repos.CursorPagination)), true + + case "Query.core_listRouters": + if e.complexity.Query.CoreListRouters == nil { + break + } + + args, err := ec.field_Query_core_listRouters_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["namespace"] = arg0 - var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + + return e.complexity.Query.CoreListRouters(childComplexity, args["projectName"].(string), args["envName"].(string), args["search"].(*model.SearchRouters), args["pq"].(*repos.CursorPagination)), true + + case "Query.core_listSecrets": + if e.complexity.Query.CoreListSecrets == nil { + break + } + + args, err := ec.field_Query_core_listSecrets_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["name"] = arg1 - return args, nil -} -func (ec *executionContext) field_Query_core_resyncProject_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) + return e.complexity.Query.CoreListSecrets(childComplexity, args["projectName"].(string), args["envName"].(string), args["search"].(*model.SearchSecrets), args["pq"].(*repos.CursorPagination)), true + + case "Query.core_listVPNDevices": + if e.complexity.Query.CoreListVPNDevices == nil { + break + } + + args, err := ec.field_Query_core_listVPNDevices_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["name"] = arg0 - return args, nil -} -func (ec *executionContext) field_Query_core_resyncRouter_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) + return e.complexity.Query.CoreListVPNDevices(childComplexity, args["search"].(*model.CoreSearchVPNDevices), args["pq"].(*repos.CursorPagination)), true + + case "Query.core_listVPNDevicesForUser": + if e.complexity.Query.CoreListVPNDevicesForUser == nil { + break + } + + return e.complexity.Query.CoreListVPNDevicesForUser(childComplexity), true + + case "Query.core_restartApp": + if e.complexity.Query.CoreRestartApp == nil { + break + } + + args, err := ec.field_Query_core_restartApp_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["namespace"] = arg0 - var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + + return e.complexity.Query.CoreRestartApp(childComplexity, args["projectName"].(string), args["envName"].(string), args["appName"].(string)), true + + case "Query.core_restartProjectManagedService": + if e.complexity.Query.CoreRestartProjectManagedService == nil { + break + } + + args, err := ec.field_Query_core_restartProjectManagedService_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["name"] = arg1 - return args, nil -} -func (ec *executionContext) field_Query_core_resyncSecret_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) + return e.complexity.Query.CoreRestartProjectManagedService(childComplexity, args["projectName"].(string), args["name"].(string)), true + + case "Query.core_resyncApp": + if e.complexity.Query.CoreResyncApp == nil { + break + } + + args, err := ec.field_Query_core_resyncApp_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["namespace"] = arg0 - var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + + return e.complexity.Query.CoreResyncApp(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + + case "Query.core_resyncConfig": + if e.complexity.Query.CoreResyncConfig == nil { + break + } + + args, err := ec.field_Query_core_resyncConfig_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["name"] = arg1 - return args, nil -} -func (ec *executionContext) field_Query_core_resyncWorkspace_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) + return e.complexity.Query.CoreResyncConfig(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + + case "Query.core_resyncEnvironment": + if e.complexity.Query.CoreResyncEnvironment == nil { + break + } + + args, err := ec.field_Query_core_resyncEnvironment_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["namespace"] = arg0 - var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + + return e.complexity.Query.CoreResyncEnvironment(childComplexity, args["projectName"].(string), args["name"].(string)), true + + case "Query.core_resyncImagePullSecret": + if e.complexity.Query.CoreResyncImagePullSecret == nil { + break + } + + args, err := ec.field_Query_core_resyncImagePullSecret_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["name"] = arg1 - 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) + return e.complexity.Query.CoreResyncImagePullSecret(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + + case "Query.core_resyncManagedResource": + if e.complexity.Query.CoreResyncManagedResource == nil { + break + } + + args, err := ec.field_Query_core_resyncManagedResource_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - 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) + return e.complexity.Query.CoreResyncManagedResource(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + + case "Query.core_resyncProject": + if e.complexity.Query.CoreResyncProject == nil { + break + } + + args, err := ec.field_Query_core_resyncProject_args(context.TODO(), rawArgs) if err != nil { - return nil, err + return 0, false } - } - args["includeDeprecated"] = arg0 - return args, nil -} -// endregion ***************************** args.gotpl ***************************** + return e.complexity.Query.CoreResyncProject(childComplexity, args["name"].(string)), true -// region ************************** directives.gotpl ************************** + case "Query.core_resyncProjectManagedService": + if e.complexity.Query.CoreResyncProjectManagedService == nil { + break + } -// endregion ************************** directives.gotpl ************************** + args, err := ec.field_Query_core_resyncProjectManagedService_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -// region **************************** field.gotpl ***************************** + return e.complexity.Query.CoreResyncProjectManagedService(childComplexity, args["projectName"].(string), args["name"].(string)), true -func (ec *executionContext) _App_kind(ctx context.Context, field graphql.CollectedField, obj *entities.App) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_App_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 + case "Query.core_resyncRouter": + if e.complexity.Query.CoreResyncRouter == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_App_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "App", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + args, err := ec.field_Query_core_resyncRouter_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -func (ec *executionContext) _App_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.App) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_App_metadata(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.Query.CoreResyncRouter(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + + case "Query.core_resyncSecret": + if e.complexity.Query.CoreResyncSecret == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ObjectMeta, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + args, err := ec.field_Query_core_resyncSecret_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - return graphql.Null - } - res := resTmp.(v1.ObjectMeta) - fc.Result = res - return ec.marshalNMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_App_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "App", - 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_Metadata_name(ctx, field) - case "namespace": - return ec.fieldContext_Metadata_namespace(ctx, field) - case "labels": - return ec.fieldContext_Metadata_labels(ctx, field) - case "annotations": - return ec.fieldContext_Metadata_annotations(ctx, field) - case "creationTimestamp": - return ec.fieldContext_Metadata_creationTimestamp(ctx, field) - case "deletionTimestamp": - return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) - case "generation": - return ec.fieldContext_Metadata_generation(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) - }, - } - return fc, nil -} + return e.complexity.Query.CoreResyncSecret(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true -func (ec *executionContext) _App_overrides(ctx context.Context, field graphql.CollectedField, obj *entities.App) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_App_overrides(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Query._service": + if e.complexity.Query.__resolve__service == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Overrides, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*v11.JsonPatch) - fc.Result = res - return ec.marshalOOverrides2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋapisᚋcrdsᚋv1ᚐJsonPatch(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_App_overrides(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "App", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "applied": - return ec.fieldContext_Overrides_applied(ctx, field) - case "patches": - return ec.fieldContext_Overrides_patches(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Overrides", field.Name) - }, - } - return fc, nil -} + return e.complexity.Query.__resolve__service(childComplexity), true -func (ec *executionContext) _App_restart(ctx context.Context, field graphql.CollectedField, obj *entities.App) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_App_restart(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Router.apiVersion": + if e.complexity.Router.APIVersion == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Restart, 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_App_restart(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "App", - 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 -} + return e.complexity.Router.APIVersion(childComplexity), true -func (ec *executionContext) _App_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.App) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_App_syncStatus(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Router.accountName": + if e.complexity.Router.AccountName == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SyncStatus, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(types.SyncStatus) - fc.Result = res - return ec.marshalOSyncStatus2kloudliteᚗioᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_App_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "App", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "syncScheduledAt": - return ec.fieldContext_SyncStatus_syncScheduledAt(ctx, field) - case "lastSyncedAt": - return ec.fieldContext_SyncStatus_lastSyncedAt(ctx, field) - case "action": - return ec.fieldContext_SyncStatus_action(ctx, field) - case "generation": - return ec.fieldContext_SyncStatus_generation(ctx, field) - case "state": - return ec.fieldContext_SyncStatus_state(ctx, field) - case "error": - return ec.fieldContext_SyncStatus_error(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type SyncStatus", field.Name) - }, - } - return fc, nil -} + return e.complexity.Router.AccountName(childComplexity), true -func (ec *executionContext) _App_spec(ctx context.Context, field graphql.CollectedField, obj *entities.App) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_App_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 + case "Router.createdBy": + if e.complexity.Router.CreatedBy == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.App().Spec(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.AppSpec) - fc.Result = res - return ec.marshalOAppSpec2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpec(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_App_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "App", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "containers": - return ec.fieldContext_AppSpec_containers(ctx, field) - case "displayName": - return ec.fieldContext_AppSpec_displayName(ctx, field) - case "intercept": - return ec.fieldContext_AppSpec_intercept(ctx, field) - case "region": - return ec.fieldContext_AppSpec_region(ctx, field) - case "replicas": - return ec.fieldContext_AppSpec_replicas(ctx, field) - case "freeze": - return ec.fieldContext_AppSpec_freeze(ctx, field) - case "hpa": - return ec.fieldContext_AppSpec_hpa(ctx, field) - case "nodeSelector": - return ec.fieldContext_AppSpec_nodeSelector(ctx, field) - case "serviceAccount": - return ec.fieldContext_AppSpec_serviceAccount(ctx, field) - case "services": - return ec.fieldContext_AppSpec_services(ctx, field) - case "tolerations": - return ec.fieldContext_AppSpec_tolerations(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type AppSpec", field.Name) - }, - } - return fc, nil -} + return e.complexity.Router.CreatedBy(childComplexity), true -func (ec *executionContext) _App_status(ctx context.Context, field graphql.CollectedField, obj *entities.App) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_App_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 + case "Router.creationTime": + if e.complexity.Router.CreationTime == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Status, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(operator.Status) - fc.Result = res - return ec.marshalOStatus2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_App_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "App", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "isReady": - return ec.fieldContext_Status_isReady(ctx, field) - case "checks": - return ec.fieldContext_Status_checks(ctx, field) - case "displayVars": - return ec.fieldContext_Status_displayVars(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Status", field.Name) - }, - } - return fc, nil -} + return e.complexity.Router.CreationTime(childComplexity), true -func (ec *executionContext) _App_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.App) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_App_apiVersion(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Router.displayName": + if e.complexity.Router.DisplayName == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.APIVersion, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_App_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "App", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Router.DisplayName(childComplexity), true -func (ec *executionContext) _App_enabled(ctx context.Context, field graphql.CollectedField, obj *entities.App) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_App_enabled(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Router.enabled": + if e.complexity.Router.Enabled == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Enabled, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*bool) - fc.Result = res - return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_App_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "App", - 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 -} + return e.complexity.Router.Enabled(childComplexity), true -func (ec *executionContext) _AppSpec_containers(ctx context.Context, field graphql.CollectedField, obj *model.AppSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpec_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 + case "Router.environmentName": + if e.complexity.Router.EnvironmentName == nil { + break } - }() - 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 { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.Router.EnvironmentName(childComplexity), true + + case "Router.id": + if e.complexity.Router.ID == nil { + break } - return graphql.Null - } - res := resTmp.([]*model.AppSpecContainers) - fc.Result = res - return ec.marshalNAppSpecContainers2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainers(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_AppSpec_containers(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpec", - 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_AppSpecContainers_name(ctx, field) - case "args": - return ec.fieldContext_AppSpecContainers_args(ctx, field) - case "env": - return ec.fieldContext_AppSpecContainers_env(ctx, field) - case "envFrom": - return ec.fieldContext_AppSpecContainers_envFrom(ctx, field) - case "image": - return ec.fieldContext_AppSpecContainers_image(ctx, field) - case "imagePullPolicy": - return ec.fieldContext_AppSpecContainers_imagePullPolicy(ctx, field) - case "volumes": - return ec.fieldContext_AppSpecContainers_volumes(ctx, field) - case "command": - return ec.fieldContext_AppSpecContainers_command(ctx, field) - case "livenessProbe": - return ec.fieldContext_AppSpecContainers_livenessProbe(ctx, field) - case "readinessProbe": - return ec.fieldContext_AppSpecContainers_readinessProbe(ctx, field) - case "resourceCpu": - return ec.fieldContext_AppSpecContainers_resourceCpu(ctx, field) - case "resourceMemory": - return ec.fieldContext_AppSpecContainers_resourceMemory(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type AppSpecContainers", field.Name) - }, - } - return fc, nil -} + return e.complexity.Router.ID(childComplexity), true -func (ec *executionContext) _AppSpec_displayName(ctx context.Context, field graphql.CollectedField, obj *model.AppSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpec_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 + case "Router.kind": + if e.complexity.Router.Kind == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DisplayName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_AppSpec_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Router.Kind(childComplexity), true -func (ec *executionContext) _AppSpec_intercept(ctx context.Context, field graphql.CollectedField, obj *model.AppSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpec_intercept(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Router.lastUpdatedBy": + if e.complexity.Router.LastUpdatedBy == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Intercept, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.AppSpecIntercept) - fc.Result = res - return ec.marshalOAppSpecIntercept2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecIntercept(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_AppSpec_intercept(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "enabled": - return ec.fieldContext_AppSpecIntercept_enabled(ctx, field) - case "toDevice": - return ec.fieldContext_AppSpecIntercept_toDevice(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type AppSpecIntercept", field.Name) - }, - } - return fc, nil -} + return e.complexity.Router.LastUpdatedBy(childComplexity), true -func (ec *executionContext) _AppSpec_region(ctx context.Context, field graphql.CollectedField, obj *model.AppSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpec_region(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Router.markedForDeletion": + if e.complexity.Router.MarkedForDeletion == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Region, nil - }) - 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_AppSpec_region(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Router.MarkedForDeletion(childComplexity), true -func (ec *executionContext) _AppSpec_replicas(ctx context.Context, field graphql.CollectedField, obj *model.AppSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpec_replicas(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Router.metadata": + if e.complexity.Router.ObjectMeta == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Replicas, 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_AppSpec_replicas(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpec", - 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 -} + return e.complexity.Router.ObjectMeta(childComplexity), true -func (ec *executionContext) _AppSpec_freeze(ctx context.Context, field graphql.CollectedField, obj *model.AppSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpec_freeze(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Router.projectName": + if e.complexity.Router.ProjectName == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Freeze, 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_AppSpec_freeze(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpec", - 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 -} + return e.complexity.Router.ProjectName(childComplexity), true -func (ec *executionContext) _AppSpec_hpa(ctx context.Context, field graphql.CollectedField, obj *model.AppSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpec_hpa(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Router.recordVersion": + if e.complexity.Router.RecordVersion == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Hpa, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.AppSpecHpa) - fc.Result = res - return ec.marshalOAppSpecHpa2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecHpa(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_AppSpec_hpa(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "enabled": - return ec.fieldContext_AppSpecHpa_enabled(ctx, field) - case "maxReplicas": - return ec.fieldContext_AppSpecHpa_maxReplicas(ctx, field) - case "minReplicas": - return ec.fieldContext_AppSpecHpa_minReplicas(ctx, field) - case "thresholdCpu": - return ec.fieldContext_AppSpecHpa_thresholdCpu(ctx, field) - case "thresholdMemory": - return ec.fieldContext_AppSpecHpa_thresholdMemory(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type AppSpecHpa", field.Name) - }, - } - return fc, nil -} + return e.complexity.Router.RecordVersion(childComplexity), true -func (ec *executionContext) _AppSpec_nodeSelector(ctx context.Context, field graphql.CollectedField, obj *model.AppSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpec_nodeSelector(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Router.spec": + if e.complexity.Router.Spec == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.NodeSelector, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_AppSpec_nodeSelector(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Router.Spec(childComplexity), true -func (ec *executionContext) _AppSpec_serviceAccount(ctx context.Context, field graphql.CollectedField, obj *model.AppSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpec_serviceAccount(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Router.status": + if e.complexity.Router.Status == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ServiceAccount, nil - }) - 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_AppSpec_serviceAccount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Router.Status(childComplexity), true -func (ec *executionContext) _AppSpec_services(ctx context.Context, field graphql.CollectedField, obj *model.AppSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpec_services(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Router.syncStatus": + if e.complexity.Router.SyncStatus == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Services, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*model.AppSpecServices) - fc.Result = res - return ec.marshalOAppSpecServices2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecServices(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_AppSpec_services(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpec", - 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_AppSpecServices_name(ctx, field) - case "port": - return ec.fieldContext_AppSpecServices_port(ctx, field) - case "targetPort": - return ec.fieldContext_AppSpecServices_targetPort(ctx, field) - case "type": - return ec.fieldContext_AppSpecServices_type(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type AppSpecServices", field.Name) - }, - } - return fc, nil -} + return e.complexity.Router.SyncStatus(childComplexity), true -func (ec *executionContext) _AppSpec_tolerations(ctx context.Context, field graphql.CollectedField, obj *model.AppSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpec_tolerations(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Router.updateTime": + if e.complexity.Router.UpdateTime == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Tolerations, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*model.AppSpecTolerations) - fc.Result = res - return ec.marshalOAppSpecTolerations2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecTolerations(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_AppSpec_tolerations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "effect": - return ec.fieldContext_AppSpecTolerations_effect(ctx, field) - case "key": - return ec.fieldContext_AppSpecTolerations_key(ctx, field) - case "operator": - return ec.fieldContext_AppSpecTolerations_operator(ctx, field) - case "tolerationSeconds": - return ec.fieldContext_AppSpecTolerations_tolerationSeconds(ctx, field) - case "value": - return ec.fieldContext_AppSpecTolerations_value(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type AppSpecTolerations", field.Name) - }, - } - return fc, nil -} + return e.complexity.Router.UpdateTime(childComplexity), true -func (ec *executionContext) _AppSpecContainers_name(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainers) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainers_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 + case "RouterEdge.cursor": + if e.complexity.RouterEdge.Cursor == nil { + break } - }() - 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 e.complexity.RouterEdge.Cursor(childComplexity), true + + case "RouterEdge.node": + if e.complexity.RouterEdge.Node == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_AppSpecContainers_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainers", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.RouterEdge.Node(childComplexity), true -func (ec *executionContext) _AppSpecContainers_args(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainers) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainers_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 + case "RouterPaginatedRecords.edges": + if e.complexity.RouterPaginatedRecords.Edges == nil { + break } - }() - 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 { - return graphql.Null - } - res := resTmp.([]*string) - fc.Result = res - return ec.marshalOString2ᚕᚖstring(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_AppSpecContainers_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainers", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.RouterPaginatedRecords.Edges(childComplexity), true -func (ec *executionContext) _AppSpecContainers_env(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainers) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainers_env(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "RouterPaginatedRecords.pageInfo": + if e.complexity.RouterPaginatedRecords.PageInfo == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Env, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*model.AppSpecContainersEnv) - fc.Result = res - return ec.marshalOAppSpecContainersEnv2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersEnv(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_AppSpecContainers_env(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainers", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "key": - return ec.fieldContext_AppSpecContainersEnv_key(ctx, field) - case "optional": - return ec.fieldContext_AppSpecContainersEnv_optional(ctx, field) - case "refKey": - return ec.fieldContext_AppSpecContainersEnv_refKey(ctx, field) - case "refName": - return ec.fieldContext_AppSpecContainersEnv_refName(ctx, field) - case "type": - return ec.fieldContext_AppSpecContainersEnv_type(ctx, field) - case "value": - return ec.fieldContext_AppSpecContainersEnv_value(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type AppSpecContainersEnv", field.Name) - }, - } - return fc, nil -} + return e.complexity.RouterPaginatedRecords.PageInfo(childComplexity), true -func (ec *executionContext) _AppSpecContainers_envFrom(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainers) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainers_envFrom(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "RouterPaginatedRecords.totalCount": + if e.complexity.RouterPaginatedRecords.TotalCount == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.EnvFrom, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*model.AppSpecContainersEnvFrom) - fc.Result = res - return ec.marshalOAppSpecContainersEnvFrom2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersEnvFrom(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_AppSpecContainers_envFrom(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainers", - 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_AppSpecContainersEnvFrom_type(ctx, field) - case "refName": - return ec.fieldContext_AppSpecContainersEnvFrom_refName(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type AppSpecContainersEnvFrom", field.Name) - }, - } - return fc, nil -} + return e.complexity.RouterPaginatedRecords.TotalCount(childComplexity), true -func (ec *executionContext) _AppSpecContainers_image(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainers) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainers_image(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Secret.apiVersion": + if e.complexity.Secret.APIVersion == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Image, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.Secret.APIVersion(childComplexity), true + + case "Secret.accountName": + if e.complexity.Secret.AccountName == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_AppSpecContainers_image(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainers", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Secret.AccountName(childComplexity), true -func (ec *executionContext) _AppSpecContainers_imagePullPolicy(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainers) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainers_imagePullPolicy(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Secret.createdBy": + if e.complexity.Secret.CreatedBy == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ImagePullPolicy, nil - }) - 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_AppSpecContainers_imagePullPolicy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainers", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Secret.CreatedBy(childComplexity), true -func (ec *executionContext) _AppSpecContainers_volumes(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainers) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainers_volumes(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Secret.creationTime": + if e.complexity.Secret.CreationTime == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Volumes, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*model.AppSpecContainersVolumes) - fc.Result = res - return ec.marshalOAppSpecContainersVolumes2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersVolumes(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_AppSpecContainers_volumes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainers", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "mountPath": - return ec.fieldContext_AppSpecContainersVolumes_mountPath(ctx, field) - case "refName": - return ec.fieldContext_AppSpecContainersVolumes_refName(ctx, field) - case "type": - return ec.fieldContext_AppSpecContainersVolumes_type(ctx, field) - case "items": - return ec.fieldContext_AppSpecContainersVolumes_items(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type AppSpecContainersVolumes", field.Name) - }, - } - return fc, nil -} + return e.complexity.Secret.CreationTime(childComplexity), true -func (ec *executionContext) _AppSpecContainers_command(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainers) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainers_command(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Secret.data": + if e.complexity.Secret.Data == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Command, nil - }) - 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_AppSpecContainers_command(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainers", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Secret.Data(childComplexity), true -func (ec *executionContext) _AppSpecContainers_livenessProbe(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainers) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainers_livenessProbe(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Secret.displayName": + if e.complexity.Secret.DisplayName == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.LivenessProbe, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.AppSpecContainersLivenessProbe) - fc.Result = res - return ec.marshalOAppSpecContainersLivenessProbe2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersLivenessProbe(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_AppSpecContainers_livenessProbe(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainers", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "failureThreshold": - return ec.fieldContext_AppSpecContainersLivenessProbe_failureThreshold(ctx, field) - case "httpGet": - return ec.fieldContext_AppSpecContainersLivenessProbe_httpGet(ctx, field) - case "initialDelay": - return ec.fieldContext_AppSpecContainersLivenessProbe_initialDelay(ctx, field) - case "interval": - return ec.fieldContext_AppSpecContainersLivenessProbe_interval(ctx, field) - case "shell": - return ec.fieldContext_AppSpecContainersLivenessProbe_shell(ctx, field) - case "tcp": - return ec.fieldContext_AppSpecContainersLivenessProbe_tcp(ctx, field) - case "type": - return ec.fieldContext_AppSpecContainersLivenessProbe_type(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type AppSpecContainersLivenessProbe", field.Name) - }, - } - return fc, nil -} + return e.complexity.Secret.DisplayName(childComplexity), true -func (ec *executionContext) _AppSpecContainers_readinessProbe(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainers) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainers_readinessProbe(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Secret.environmentName": + if e.complexity.Secret.EnvironmentName == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ReadinessProbe, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.AppSpecContainersReadinessProbe) - fc.Result = res - return ec.marshalOAppSpecContainersReadinessProbe2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersReadinessProbe(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_AppSpecContainers_readinessProbe(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainers", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "interval": - return ec.fieldContext_AppSpecContainersReadinessProbe_interval(ctx, field) - case "shell": - return ec.fieldContext_AppSpecContainersReadinessProbe_shell(ctx, field) - case "tcp": - return ec.fieldContext_AppSpecContainersReadinessProbe_tcp(ctx, field) - case "type": - return ec.fieldContext_AppSpecContainersReadinessProbe_type(ctx, field) - case "failureThreshold": - return ec.fieldContext_AppSpecContainersReadinessProbe_failureThreshold(ctx, field) - case "httpGet": - return ec.fieldContext_AppSpecContainersReadinessProbe_httpGet(ctx, field) - case "initialDelay": - return ec.fieldContext_AppSpecContainersReadinessProbe_initialDelay(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type AppSpecContainersReadinessProbe", field.Name) - }, - } - return fc, nil -} + return e.complexity.Secret.EnvironmentName(childComplexity), true -func (ec *executionContext) _AppSpecContainers_resourceCpu(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainers) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainers_resourceCpu(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Secret.id": + if e.complexity.Secret.ID == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ResourceCPU, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.AppSpecContainersResourceCPU) - fc.Result = res - return ec.marshalOAppSpecContainersResourceCpu2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersResourceCPU(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_AppSpecContainers_resourceCpu(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainers", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "max": - return ec.fieldContext_AppSpecContainersResourceCpu_max(ctx, field) - case "min": - return ec.fieldContext_AppSpecContainersResourceCpu_min(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type AppSpecContainersResourceCpu", field.Name) - }, - } - return fc, nil -} + return e.complexity.Secret.ID(childComplexity), true -func (ec *executionContext) _AppSpecContainers_resourceMemory(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainers) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainers_resourceMemory(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Secret.immutable": + if e.complexity.Secret.Immutable == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ResourceMemory, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null + + return e.complexity.Secret.Immutable(childComplexity), true + + case "Secret.kind": + if e.complexity.Secret.Kind == nil { + break + } + + return e.complexity.Secret.Kind(childComplexity), true + + case "Secret.lastUpdatedBy": + if e.complexity.Secret.LastUpdatedBy == nil { + break + } + + return e.complexity.Secret.LastUpdatedBy(childComplexity), true + + case "Secret.markedForDeletion": + if e.complexity.Secret.MarkedForDeletion == nil { + break + } + + return e.complexity.Secret.MarkedForDeletion(childComplexity), true + + case "Secret.metadata": + if e.complexity.Secret.ObjectMeta == nil { + break + } + + return e.complexity.Secret.ObjectMeta(childComplexity), true + + case "Secret.projectName": + if e.complexity.Secret.ProjectName == nil { + break + } + + return e.complexity.Secret.ProjectName(childComplexity), true + + case "Secret.recordVersion": + if e.complexity.Secret.RecordVersion == nil { + break + } + + return e.complexity.Secret.RecordVersion(childComplexity), true + + case "Secret.stringData": + if e.complexity.Secret.StringData == nil { + break + } + + return e.complexity.Secret.StringData(childComplexity), true + + case "Secret.syncStatus": + if e.complexity.Secret.SyncStatus == nil { + break + } + + return e.complexity.Secret.SyncStatus(childComplexity), true + + case "Secret.type": + if e.complexity.Secret.Type == nil { + break + } + + return e.complexity.Secret.Type(childComplexity), true + + case "Secret.updateTime": + if e.complexity.Secret.UpdateTime == nil { + break + } + + return e.complexity.Secret.UpdateTime(childComplexity), true + + case "SecretEdge.cursor": + if e.complexity.SecretEdge.Cursor == nil { + break + } + + return e.complexity.SecretEdge.Cursor(childComplexity), true + + case "SecretEdge.node": + if e.complexity.SecretEdge.Node == nil { + break + } + + return e.complexity.SecretEdge.Node(childComplexity), true + + case "SecretKeyRef.key": + if e.complexity.SecretKeyRef.Key == nil { + break + } + + return e.complexity.SecretKeyRef.Key(childComplexity), true + + case "SecretKeyRef.secretName": + if e.complexity.SecretKeyRef.SecretName == nil { + break + } + + return e.complexity.SecretKeyRef.SecretName(childComplexity), true + + case "SecretKeyValueRef.key": + if e.complexity.SecretKeyValueRef.Key == nil { + break + } + + return e.complexity.SecretKeyValueRef.Key(childComplexity), true + + case "SecretKeyValueRef.secretName": + if e.complexity.SecretKeyValueRef.SecretName == nil { + break + } + + return e.complexity.SecretKeyValueRef.SecretName(childComplexity), true + + case "SecretKeyValueRef.value": + if e.complexity.SecretKeyValueRef.Value == nil { + break + } + + return e.complexity.SecretKeyValueRef.Value(childComplexity), true + + case "SecretPaginatedRecords.edges": + if e.complexity.SecretPaginatedRecords.Edges == nil { + break + } + + return e.complexity.SecretPaginatedRecords.Edges(childComplexity), true + + case "SecretPaginatedRecords.pageInfo": + if e.complexity.SecretPaginatedRecords.PageInfo == nil { + break + } + + return e.complexity.SecretPaginatedRecords.PageInfo(childComplexity), true + + case "SecretPaginatedRecords.totalCount": + if e.complexity.SecretPaginatedRecords.TotalCount == nil { + break + } + + return e.complexity.SecretPaginatedRecords.TotalCount(childComplexity), true + + case "_Service.sdl": + if e.complexity._Service.SDL == nil { + break + } + + return e.complexity._Service.SDL(childComplexity), true + } - res := resTmp.(*model.AppSpecContainersResourceMemory) - fc.Result = res - return ec.marshalOAppSpecContainersResourceMemory2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersResourceMemory(ctx, field.Selections, res) + return 0, false } -func (ec *executionContext) fieldContext_AppSpecContainers_resourceMemory(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainers", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "max": - return ec.fieldContext_AppSpecContainersResourceMemory_max(ctx, field) - case "min": - return ec.fieldContext_AppSpecContainersResourceMemory_min(ctx, field) +func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { + rc := graphql.GetOperationContext(ctx) + ec := executionContext{rc, e} + inputUnmarshalMap := graphql.BuildUnmarshalerMap( + ec.unmarshalInputAppIn, + ec.unmarshalInputConfigIn, + ec.unmarshalInputConfigKeyRefIn, + ec.unmarshalInputConfigKeyValueRefIn, + ec.unmarshalInputConsoleVPNDeviceIn, + ec.unmarshalInputCoreSearchVPNDevices, + ec.unmarshalInputCursorPaginationIn, + ec.unmarshalInputEnvironmentIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__AppContainerIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__AppSpecIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__AppSvcIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__BasicAuthIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ContainerEnvIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ContainerResourceIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ContainerVolumeIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItemIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__CorsIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__EnvFromIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__EnvironmentSpecIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__HPAIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__HttpGetProbeIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__HttpsIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__InterceptIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpecIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__MresResourceTemplateIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__MsvcNamedRefIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ProbeIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpecIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ProjectSpecIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__RateLimitIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__RouteIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__RouterSpecIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ShellProbeIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__TcpProbeIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___wireguard___v1__CNameRecordIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___wireguard___v1__DeviceSpecIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___wireguard___v1__PortIn, + ec.unmarshalInputImagePullSecretIn, + ec.unmarshalInputK8s__io___api___core___v1__TolerationIn, + ec.unmarshalInputManagedResourceIn, + ec.unmarshalInputManagedResourceKeyRefIn, + ec.unmarshalInputManagedResourceKeyValueRefIn, + ec.unmarshalInputMatchFilterIn, + ec.unmarshalInputMetadataIn, + ec.unmarshalInputPortIn, + ec.unmarshalInputProjectIn, + ec.unmarshalInputProjectManagedServiceIn, + ec.unmarshalInputRouterIn, + ec.unmarshalInputSearchApps, + ec.unmarshalInputSearchConfigs, + ec.unmarshalInputSearchEnvironments, + ec.unmarshalInputSearchImagePullSecrets, + ec.unmarshalInputSearchManagedResources, + ec.unmarshalInputSearchProjectManagedService, + ec.unmarshalInputSearchProjects, + ec.unmarshalInputSearchRouters, + ec.unmarshalInputSearchSecrets, + ec.unmarshalInputSecretIn, + ec.unmarshalInputSecretKeyRefIn, + ec.unmarshalInputSecretKeyValueRefIn, + ) + first := true + + switch rc.Operation.Operation { + case ast.Query: + return func(ctx context.Context) *graphql.Response { + if !first { + return nil } - return nil, fmt.Errorf("no field named %q was found under type AppSpecContainersResourceMemory", field.Name) - }, - } - return fc, nil -} + first = false + ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) + data := ec._Query(ctx, rc.Operation.SelectionSet) + var buf bytes.Buffer + data.MarshalGQL(&buf) -func (ec *executionContext) _AppSpecContainersEnv_key(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersEnv) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersEnv_key(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return &graphql.Response{ + Data: buf.Bytes(), + } } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Key, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + 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(), + } } - return graphql.Null + + default: + return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation")) } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_AppSpecContainersEnv_key(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersEnv", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +type executionContext struct { + *graphql.OperationContext + *executableSchema } -func (ec *executionContext) _AppSpecContainersEnv_optional(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersEnv) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersEnv_optional(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Optional, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null +func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") } - res := resTmp.(*bool) - fc.Result = res - return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) + return introspection.WrapSchema(parsedSchema), nil } -func (ec *executionContext) fieldContext_AppSpecContainersEnv_optional(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersEnv", - 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") - }, +func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") } - return fc, nil + return introspection.WrapTypeFromDef(parsedSchema, parsedSchema.Types[name]), nil } -func (ec *executionContext) _AppSpecContainersEnv_refKey(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersEnv) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersEnv_refKey(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.RefKey, nil - }) - 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) +var sources = []*ast.Source{ + {Name: "../schema.graphqls", Input: `directive @isLoggedIn on FIELD_DEFINITION +directive @isLoggedInAndVerified on FIELD_DEFINITION +directive @hasAccount on FIELD_DEFINITION + +enum ConsoleResType { + project + app + config + secret + router + managed_service + project_managed_service + managed_resource + environment + vpn_device } -func (ec *executionContext) fieldContext_AppSpecContainersEnv_refKey(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersEnv", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +type ConsoleCheckNameAvailabilityOutput @shareable { + result: Boolean! + suggestedNames: [String!] } -func (ec *executionContext) _AppSpecContainersEnv_refName(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersEnv) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersEnv_refName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.RefName, nil - }) - 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) +input SearchProjects { + text: MatchFilterIn + isReady: MatchFilterIn + markedForDeletion: MatchFilterIn } -func (ec *executionContext) fieldContext_AppSpecContainersEnv_refName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersEnv", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +input SearchImagePullSecrets { + text: MatchFilterIn + isReady: MatchFilterIn + markedForDeletion: MatchFilterIn } -func (ec *executionContext) _AppSpecContainersEnv_type(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersEnv) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersEnv_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 { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +input SearchEnvironments { + text: MatchFilterIn + projectName: MatchFilterIn + isReady: MatchFilterIn + markedForDeletion: MatchFilterIn } -func (ec *executionContext) fieldContext_AppSpecContainersEnv_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersEnv", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +input SearchApps { + text: MatchFilterIn + isReady: MatchFilterIn + markedForDeletion: MatchFilterIn } -func (ec *executionContext) _AppSpecContainersEnv_value(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersEnv) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersEnv_value(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Value, nil - }) - 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) +input SearchConfigs { + text: MatchFilterIn + isReady: MatchFilterIn + markedForDeletion: MatchFilterIn } -func (ec *executionContext) fieldContext_AppSpecContainersEnv_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersEnv", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +input SearchSecrets { + text: MatchFilterIn + isReady: MatchFilterIn + markedForDeletion: MatchFilterIn } -func (ec *executionContext) _AppSpecContainersEnvFrom_type(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersEnvFrom) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersEnvFrom_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) +input SearchRouters { + text: MatchFilterIn + isReady: MatchFilterIn + markedForDeletion: MatchFilterIn } -func (ec *executionContext) fieldContext_AppSpecContainersEnvFrom_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersEnvFrom", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +input SearchManagedResources { + text: MatchFilterIn + managedServiceName: MatchFilterIn + isReady: MatchFilterIn + markedForDeletion: MatchFilterIn } -func (ec *executionContext) _AppSpecContainersEnvFrom_refName(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersEnvFrom) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersEnvFrom_refName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.RefName, nil - }) - if err != nil { - ec.Error(ctx, err) - 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) +input SearchProjectManagedService { + text: MatchFilterIn + managedServiceName: MatchFilterIn + isReady: MatchFilterIn + markedForDeletion: MatchFilterIn } -func (ec *executionContext) fieldContext_AppSpecContainersEnvFrom_refName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersEnvFrom", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +input CoreSearchVPNDevices { + text: MatchFilterIn + isReady: MatchFilterIn + markedForDeletion: MatchFilterIn } -func (ec *executionContext) _AppSpecContainersLivenessProbe_failureThreshold(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersLivenessProbe) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersLivenessProbe_failureThreshold(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.FailureThreshold, 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) +type Query { + core_checkNameAvailability(projectName: String, envName: String, resType: ConsoleResType!, name: String!): ConsoleCheckNameAvailabilityOutput! @isLoggedIn @hasAccount + + core_listProjects(search: SearchProjects, pq: CursorPaginationIn): ProjectPaginatedRecords @isLoggedInAndVerified @hasAccount + core_getProject(name: String!): Project @isLoggedInAndVerified @hasAccount + core_resyncProject(name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_listEnvironments(projectName: String!, search: SearchEnvironments, pq: CursorPaginationIn): EnvironmentPaginatedRecords @isLoggedInAndVerified @hasAccount + core_getEnvironment(projectName: String!, name: String!): Environment @isLoggedInAndVerified @hasAccount + core_resyncEnvironment(projectName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + # get image pull secrets + core_listImagePullSecrets(projectName: String!, envName: String!, search: SearchImagePullSecrets, pq: CursorPaginationIn): ImagePullSecretPaginatedRecords @isLoggedInAndVerified @hasAccount + core_getImagePullSecret(projectName: String!, envName: String!, name: String!): ImagePullSecret @isLoggedInAndVerified @hasAccount + core_resyncImagePullSecret(projectName: String!, envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_listApps(projectName: String!, envName: String!, search: SearchApps, pq: CursorPaginationIn): AppPaginatedRecords @isLoggedInAndVerified @hasAccount + core_getApp(projectName: String!, envName: String!, name: String!): App @isLoggedInAndVerified @hasAccount + core_resyncApp(projectName: String!, envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_restartApp(projectName: String!, envName: String!, appName: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_getConfigValues(projectName: String!, envName: String!, queries: [ConfigKeyRefIn]): [ConfigKeyValueRef!] @isLoggedInAndVerified @hasAccount + core_listConfigs(projectName: String!, envName: String!, search: SearchConfigs, pq: CursorPaginationIn): ConfigPaginatedRecords @isLoggedInAndVerified @hasAccount + core_getConfig(projectName: String!, envName: String!, name: String!): Config @isLoggedInAndVerified @hasAccount + core_resyncConfig(projectName: String!, envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_getSecretValues(projectName: String!, envName: String!, queries: [SecretKeyRefIn!]): [SecretKeyValueRef!] @isLoggedInAndVerified @hasAccount + core_listSecrets(projectName: String!, envName: String!, search: SearchSecrets, pq: CursorPaginationIn): SecretPaginatedRecords @isLoggedInAndVerified @hasAccount + core_getSecret(projectName: String!, envName: String!, name: String!): Secret @isLoggedInAndVerified @hasAccount + core_resyncSecret(projectName: String!, envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_listRouters(projectName: String!, envName: String!, search: SearchRouters, pq: CursorPaginationIn): RouterPaginatedRecords @isLoggedInAndVerified @hasAccount + core_getRouter(projectName: String!, envName: String!, name: String!): Router @isLoggedInAndVerified @hasAccount + core_resyncRouter(projectName: String!, envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_getManagedResouceOutputKeys(projectName: String!, envName: String!, name: String!): [String!]! @isLoggedInAndVerified @hasAccount + core_getManagedResouceOutputKeyValues(projectName: String!, envName: String!, keyrefs: [ManagedResourceKeyRefIn]): [ManagedResourceKeyValueRef!]! @isLoggedInAndVerified @hasAccount + core_listManagedResources(projectName: String!, envName: String!, search: SearchManagedResources, pq: CursorPaginationIn): ManagedResourcePaginatedRecords @isLoggedInAndVerified @hasAccount + core_getManagedResource(projectName: String!, envName: String!, name: String!): ManagedResource @isLoggedInAndVerified @hasAccount + core_resyncManagedResource(projectName: String!, envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_listProjectManagedServices(projectName: String!, search: SearchProjectManagedService, pq: CursorPaginationIn): ProjectManagedServicePaginatedRecords @isLoggedInAndVerified @hasAccount + core_getProjectManagedService(projectName: String!, name: String!): ProjectManagedService @isLoggedInAndVerified @hasAccount + core_resyncProjectManagedService(projectName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_restartProjectManagedService(projectName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_listVPNDevices(search: CoreSearchVPNDevices, pq: CursorPaginationIn): ConsoleVPNDevicePaginatedRecords @isLoggedInAndVerified @hasAccount + core_listVPNDevicesForUser: [ConsoleVPNDevice!] @isLoggedInAndVerified @hasAccount + core_getVPNDevice(name: String!): ConsoleVPNDevice @isLoggedInAndVerified @hasAccount } -func (ec *executionContext) fieldContext_AppSpecContainersLivenessProbe_failureThreshold(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersLivenessProbe", - 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 +type Mutation { + core_createProject(project: ProjectIn!): Project @isLoggedInAndVerified @hasAccount + core_updateProject(project: ProjectIn!): Project @isLoggedInAndVerified @hasAccount + core_deleteProject(name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_createEnvironment(projectName: String!, env: EnvironmentIn!): Environment @isLoggedInAndVerified @hasAccount + core_updateEnvironment(projectName: String!, env: EnvironmentIn!): Environment @isLoggedInAndVerified @hasAccount + core_deleteEnvironment(projectName: String!, envName: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_cloneEnvironment(projectName: String!, sourceEnvName: String!, destinationEnvName: String!, displayName: String!, environmentRoutingMode: Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingMode!): Environment @isLoggedInAndVerified @hasAccount + + # image pull secrets + core_createImagePullSecret(projectName: String!, envName: String!, imagePullSecretIn: ImagePullSecretIn!): ImagePullSecret @isLoggedInAndVerified @hasAccount + core_deleteImagePullSecret(projectName: String!, envName: String!, secretName: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_createApp(projectName: String!, envName: String!, app: AppIn!): App @isLoggedInAndVerified @hasAccount + core_updateApp(projectName: String!, envName: String!, app: AppIn!): App @isLoggedInAndVerified @hasAccount + core_deleteApp(projectName: String!, envName: String!, appName: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_interceptApp(projectName: String!, envName: String!, appname: String!, deviceName: String!, intercept: Boolean!): Boolean! @isLoggedInAndVerified @hasAccount + + core_createConfig(projectName: String!, envName: String!, config: ConfigIn!): Config @isLoggedInAndVerified @hasAccount + core_updateConfig(projectName: String!, envName: String!, config: ConfigIn!): Config @isLoggedInAndVerified @hasAccount + core_deleteConfig(projectName: String!, envName: String!, configName: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_createSecret(projectName: String!, envName: String!, secret: SecretIn!): Secret @isLoggedInAndVerified @hasAccount + core_updateSecret(projectName: String!, envName: String!, secret: SecretIn!): Secret @isLoggedInAndVerified @hasAccount + core_deleteSecret(projectName: String!, envName: String!, secretName: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_createRouter(projectName: String!, envName: String!, router: RouterIn!): Router @isLoggedInAndVerified @hasAccount + core_updateRouter(projectName: String!, envName: String!, router: RouterIn!): Router @isLoggedInAndVerified @hasAccount + core_deleteRouter(projectName: String!, envName: String!, routerName: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_createManagedResource(projectName: String!, envName: String!, mres: ManagedResourceIn!): ManagedResource @isLoggedInAndVerified @hasAccount + core_updateManagedResource(projectName: String!, envName: String!, mres: ManagedResourceIn!): ManagedResource @isLoggedInAndVerified @hasAccount + core_deleteManagedResource(projectName: String!, envName: String!, mresName: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_createProjectManagedService(projectName: String!, pmsvc: ProjectManagedServiceIn!): ProjectManagedService @isLoggedInAndVerified @hasAccount + core_updateProjectManagedService(projectName: String!, pmsvc: ProjectManagedServiceIn!): ProjectManagedService @isLoggedInAndVerified @hasAccount + core_deleteProjectManagedService(projectName: String!, pmsvcName: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_createVPNDevice(vpnDevice: ConsoleVPNDeviceIn!): ConsoleVPNDevice @isLoggedInAndVerified @hasAccount + core_updateVPNDevice(vpnDevice: ConsoleVPNDeviceIn!): ConsoleVPNDevice @isLoggedInAndVerified @hasAccount + + core_updateVPNDevicePorts(deviceName: String!,ports: [PortIn!]!): Boolean! @isLoggedInAndVerified @hasAccount + core_updateVPNDeviceEnv(deviceName: String!,projectName: String!, envName: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_updateVpnDeviceNs(deviceName: String!,ns: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_updateVpnClusterName(deviceName: String!,clusterName: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_deleteVPNDevice(deviceName: String!): Boolean! @isLoggedInAndVerified @hasAccount } -func (ec *executionContext) _AppSpecContainersLivenessProbe_httpGet(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersLivenessProbe) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersLivenessProbe_httpGet(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.HTTPGet, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.AppSpecContainersLivenessProbeHTTPGet) - fc.Result = res - return ec.marshalOAppSpecContainersLivenessProbeHttpGet2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersLivenessProbeHTTPGet(ctx, field.Selections, res) +`, BuiltIn: false}, + {Name: "../struct-to-graphql/app.graphqls", Input: `type App @shareable { + accountName: String! + apiVersion: String + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + enabled: Boolean + environmentName: String! + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + projectName: String! + recordVersion: Int! + spec: Github__com___kloudlite___operator___apis___crds___v1__AppSpec! + status: Github__com___kloudlite___operator___pkg___operator__Status + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type AppEdge @shareable { + cursor: String! + node: App! +} + +type AppPaginatedRecords @shareable { + edges: [AppEdge!]! + pageInfo: PageInfo! + totalCount: Int! } -func (ec *executionContext) fieldContext_AppSpecContainersLivenessProbe_httpGet(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersLivenessProbe", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "httpHeaders": - return ec.fieldContext_AppSpecContainersLivenessProbeHttpGet_httpHeaders(ctx, field) - case "path": - return ec.fieldContext_AppSpecContainersLivenessProbeHttpGet_path(ctx, field) - case "port": - return ec.fieldContext_AppSpecContainersLivenessProbeHttpGet_port(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type AppSpecContainersLivenessProbeHttpGet", field.Name) - }, - } - return fc, nil +input AppIn { + apiVersion: String + displayName: String! + enabled: Boolean + kind: String + metadata: MetadataIn + spec: Github__com___kloudlite___operator___apis___crds___v1__AppSpecIn! } -func (ec *executionContext) _AppSpecContainersLivenessProbe_initialDelay(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersLivenessProbe) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersLivenessProbe_initialDelay(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.InitialDelay, 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) +`, BuiltIn: false}, + {Name: "../struct-to-graphql/common-types.graphqls", Input: `type Github__com___kloudlite___api___common__CreatedOrUpdatedBy @shareable { + userEmail: String! + userId: String! + userName: String! } -func (ec *executionContext) fieldContext_AppSpecContainersLivenessProbe_initialDelay(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersLivenessProbe", - 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 +type Github__com___kloudlite___api___pkg___types__EncodedString @shareable { + encoding: String! + value: String! } -func (ec *executionContext) _AppSpecContainersLivenessProbe_interval(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersLivenessProbe) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersLivenessProbe_interval(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Interval, 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) +type Github__com___kloudlite___api___pkg___types__SyncStatus @shareable { + action: Github__com___kloudlite___api___pkg___types__SyncAction! + error: String + lastSyncedAt: Date + recordVersion: Int! + state: Github__com___kloudlite___api___pkg___types__SyncState! + syncScheduledAt: Date } -func (ec *executionContext) fieldContext_AppSpecContainersLivenessProbe_interval(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersLivenessProbe", - 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 +type Github__com___kloudlite___operator___apis___crds___v1__AppContainer @shareable { + args: [String!] + command: [String!] + env: [Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv!] + envFrom: [Github__com___kloudlite___operator___apis___crds___v1__EnvFrom!] + image: String! + imagePullPolicy: String + livenessProbe: Github__com___kloudlite___operator___apis___crds___v1__Probe + name: String! + readinessProbe: Github__com___kloudlite___operator___apis___crds___v1__Probe + resourceCpu: Github__com___kloudlite___operator___apis___crds___v1__ContainerResource + resourceMemory: Github__com___kloudlite___operator___apis___crds___v1__ContainerResource + volumes: [Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume!] } -func (ec *executionContext) _AppSpecContainersLivenessProbe_shell(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersLivenessProbe) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersLivenessProbe_shell(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Shell, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.AppSpecContainersLivenessProbeShell) - fc.Result = res - return ec.marshalOAppSpecContainersLivenessProbeShell2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersLivenessProbeShell(ctx, field.Selections, res) +type Github__com___kloudlite___operator___apis___crds___v1__AppSpec @shareable { + containers: [Github__com___kloudlite___operator___apis___crds___v1__AppContainer!]! + displayName: String + freeze: Boolean + hpa: Github__com___kloudlite___operator___apis___crds___v1__HPA + intercept: Github__com___kloudlite___operator___apis___crds___v1__Intercept + nodeSelector: Map + region: String + replicas: Int + serviceAccount: String + services: [Github__com___kloudlite___operator___apis___crds___v1__AppSvc!] + tolerations: [K8s__io___api___core___v1__Toleration!] } -func (ec *executionContext) fieldContext_AppSpecContainersLivenessProbe_shell(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersLivenessProbe", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "command": - return ec.fieldContext_AppSpecContainersLivenessProbeShell_command(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type AppSpecContainersLivenessProbeShell", field.Name) - }, - } - return fc, nil +type Github__com___kloudlite___operator___apis___crds___v1__AppSvc @shareable { + name: String + port: Int! + targetPort: Int + type: String } -func (ec *executionContext) _AppSpecContainersLivenessProbe_tcp(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersLivenessProbe) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersLivenessProbe_tcp(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.TCP, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.AppSpecContainersLivenessProbeTCP) - fc.Result = res - return ec.marshalOAppSpecContainersLivenessProbeTcp2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersLivenessProbeTCP(ctx, field.Selections, res) +type Github__com___kloudlite___operator___apis___crds___v1__BasicAuth @shareable { + enabled: Boolean! + secretName: String + username: String } -func (ec *executionContext) fieldContext_AppSpecContainersLivenessProbe_tcp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersLivenessProbe", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "port": - return ec.fieldContext_AppSpecContainersLivenessProbeTcp_port(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type AppSpecContainersLivenessProbeTcp", field.Name) - }, - } - return fc, nil +type Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv @shareable { + key: String! + optional: Boolean + refKey: String + refName: String + type: Github__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret + value: String } -func (ec *executionContext) _AppSpecContainersLivenessProbe_type(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersLivenessProbe) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersLivenessProbe_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) +type Github__com___kloudlite___operator___apis___crds___v1__ContainerResource @shareable { + max: String + min: String } -func (ec *executionContext) fieldContext_AppSpecContainersLivenessProbe_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersLivenessProbe", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +type Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume @shareable { + items: [Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem!] + mountPath: String! + refName: String! + type: Github__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret! } -func (ec *executionContext) _AppSpecContainersLivenessProbeHttpGet_httpHeaders(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersLivenessProbeHTTPGet) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersLivenessProbeHttpGet_httpHeaders(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.HTTPHeaders, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) +type Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem @shareable { + fileName: String + key: String! } -func (ec *executionContext) fieldContext_AppSpecContainersLivenessProbeHttpGet_httpHeaders(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersLivenessProbeHttpGet", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") - }, - } - return fc, nil +type Github__com___kloudlite___operator___apis___crds___v1__Cors @shareable { + allowCredentials: Boolean + enabled: Boolean + origins: [String!] } -func (ec *executionContext) _AppSpecContainersLivenessProbeHttpGet_path(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersLivenessProbeHTTPGet) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersLivenessProbeHttpGet_path(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Path, nil - }) - if err != nil { - ec.Error(ctx, err) - 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) +type Github__com___kloudlite___operator___apis___crds___v1__EnvFrom @shareable { + refName: String! + type: Github__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret! } -func (ec *executionContext) fieldContext_AppSpecContainersLivenessProbeHttpGet_path(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersLivenessProbeHttpGet", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +type Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting @shareable { + mode: Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingMode + privateIngressClass: String + publicIngressClass: String } -func (ec *executionContext) _AppSpecContainersLivenessProbeHttpGet_port(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersLivenessProbeHTTPGet) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersLivenessProbeHttpGet_port(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Port, nil - }) - if err != nil { - ec.Error(ctx, 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) +type Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec @shareable { + projectName: String! + routing: Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting + targetNamespace: String } -func (ec *executionContext) fieldContext_AppSpecContainersLivenessProbeHttpGet_port(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersLivenessProbeHttpGet", - 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 +type Github__com___kloudlite___operator___apis___crds___v1__HPA @shareable { + enabled: Boolean + maxReplicas: Int + minReplicas: Int + thresholdCpu: Int + thresholdMemory: Int } -func (ec *executionContext) _AppSpecContainersLivenessProbeShell_command(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersLivenessProbeShell) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersLivenessProbeShell_command(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Command, nil - }) - 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) +type Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe @shareable { + httpHeaders: Map + path: String! + port: Int! } -func (ec *executionContext) fieldContext_AppSpecContainersLivenessProbeShell_command(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersLivenessProbeShell", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +type Github__com___kloudlite___operator___apis___crds___v1__Https @shareable { + clusterIssuer: String + enabled: Boolean! + forceRedirect: Boolean } -func (ec *executionContext) _AppSpecContainersLivenessProbeTcp_port(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersLivenessProbeTCP) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersLivenessProbeTcp_port(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Port, nil - }) - if err != nil { - ec.Error(ctx, 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) +type Github__com___kloudlite___operator___apis___crds___v1__Intercept @shareable { + enabled: Boolean! + toDevice: String! } -func (ec *executionContext) fieldContext_AppSpecContainersLivenessProbeTcp_port(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersLivenessProbeTcp", - 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 +type Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec @shareable { + resourceName: String + resourceTemplate: Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate! } -func (ec *executionContext) _AppSpecContainersReadinessProbe_interval(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersReadinessProbe) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersReadinessProbe_interval(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Interval, 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) +type Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec @shareable { + serviceTemplate: Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate! } -func (ec *executionContext) fieldContext_AppSpecContainersReadinessProbe_interval(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersReadinessProbe", - 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 +type Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate @shareable { + apiVersion: String! + kind: String! + msvcRef: Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef! + spec: Map! } -func (ec *executionContext) _AppSpecContainersReadinessProbe_shell(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersReadinessProbe) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersReadinessProbe_shell(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Shell, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.AppSpecContainersReadinessProbeShell) - fc.Result = res - return ec.marshalOAppSpecContainersReadinessProbeShell2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersReadinessProbeShell(ctx, field.Selections, res) +type Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef @shareable { + apiVersion: String! + kind: String! + name: String! + namespace: String! } -func (ec *executionContext) fieldContext_AppSpecContainersReadinessProbe_shell(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersReadinessProbe", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "command": - return ec.fieldContext_AppSpecContainersReadinessProbeShell_command(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type AppSpecContainersReadinessProbeShell", field.Name) - }, - } - return fc, nil +type Github__com___kloudlite___operator___apis___crds___v1__Probe @shareable { + failureThreshold: Int + httpGet: Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe + initialDelay: Int + interval: Int + shell: Github__com___kloudlite___operator___apis___crds___v1__ShellProbe + tcp: Github__com___kloudlite___operator___apis___crds___v1__TcpProbe + type: String! } -func (ec *executionContext) _AppSpecContainersReadinessProbe_tcp(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersReadinessProbe) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersReadinessProbe_tcp(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.TCP, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.AppSpecContainersReadinessProbeTCP) - fc.Result = res - return ec.marshalOAppSpecContainersReadinessProbeTcp2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersReadinessProbeTCP(ctx, field.Selections, res) +type Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec @shareable { + msvcSpec: Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec! + targetNamespace: String! } -func (ec *executionContext) fieldContext_AppSpecContainersReadinessProbe_tcp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersReadinessProbe", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "port": - return ec.fieldContext_AppSpecContainersReadinessProbeTcp_port(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type AppSpecContainersReadinessProbeTcp", field.Name) - }, - } - return fc, nil +type Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec @shareable { + targetNamespace: String! } -func (ec *executionContext) _AppSpecContainersReadinessProbe_type(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersReadinessProbe) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersReadinessProbe_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) +type Github__com___kloudlite___operator___apis___crds___v1__RateLimit @shareable { + connections: Int + enabled: Boolean + rpm: Int + rps: Int } -func (ec *executionContext) fieldContext_AppSpecContainersReadinessProbe_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersReadinessProbe", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +type Github__com___kloudlite___operator___apis___crds___v1__Route @shareable { + app: String + lambda: String + path: String! + port: Int! + rewrite: Boolean } -func (ec *executionContext) _AppSpecContainersReadinessProbe_failureThreshold(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersReadinessProbe) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersReadinessProbe_failureThreshold(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.FailureThreshold, 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) +type Github__com___kloudlite___operator___apis___crds___v1__RouterSpec @shareable { + backendProtocol: String + basicAuth: Github__com___kloudlite___operator___apis___crds___v1__BasicAuth + cors: Github__com___kloudlite___operator___apis___crds___v1__Cors + domains: [String!]! + https: Github__com___kloudlite___operator___apis___crds___v1__Https + ingressClass: String + maxBodySizeInMB: Int + rateLimit: Github__com___kloudlite___operator___apis___crds___v1__RateLimit + routes: [Github__com___kloudlite___operator___apis___crds___v1__Route!] } -func (ec *executionContext) fieldContext_AppSpecContainersReadinessProbe_failureThreshold(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersReadinessProbe", - 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 +type Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate @shareable { + apiVersion: String! + kind: String! + spec: Map! } -func (ec *executionContext) _AppSpecContainersReadinessProbe_httpGet(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersReadinessProbe) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersReadinessProbe_httpGet(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.HTTPGet, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.AppSpecContainersReadinessProbeHTTPGet) - fc.Result = res - return ec.marshalOAppSpecContainersReadinessProbeHttpGet2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersReadinessProbeHTTPGet(ctx, field.Selections, res) +type Github__com___kloudlite___operator___apis___crds___v1__ShellProbe @shareable { + command: [String!] } -func (ec *executionContext) fieldContext_AppSpecContainersReadinessProbe_httpGet(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersReadinessProbe", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "httpHeaders": - return ec.fieldContext_AppSpecContainersReadinessProbeHttpGet_httpHeaders(ctx, field) - case "path": - return ec.fieldContext_AppSpecContainersReadinessProbeHttpGet_path(ctx, field) - case "port": - return ec.fieldContext_AppSpecContainersReadinessProbeHttpGet_port(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type AppSpecContainersReadinessProbeHttpGet", field.Name) - }, - } - return fc, nil +type Github__com___kloudlite___operator___apis___crds___v1__TcpProbe @shareable { + port: Int! } -func (ec *executionContext) _AppSpecContainersReadinessProbe_initialDelay(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersReadinessProbe) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersReadinessProbe_initialDelay(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.InitialDelay, 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) +type Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord @shareable { + host: String + target: String } -func (ec *executionContext) fieldContext_AppSpecContainersReadinessProbe_initialDelay(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersReadinessProbe", - 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 +type Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec @shareable { + activeNamespace: String + cnameRecords: [Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord!] + disabled: Boolean + nodeSelector: Map + noExternalService: Boolean + ports: [Github__com___kloudlite___operator___apis___wireguard___v1__Port!] } -func (ec *executionContext) _AppSpecContainersReadinessProbeHttpGet_httpHeaders(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersReadinessProbeHTTPGet) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersReadinessProbeHttpGet_httpHeaders(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.HTTPHeaders, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) +type Github__com___kloudlite___operator___apis___wireguard___v1__Port @shareable { + port: Int + targetPort: Int } -func (ec *executionContext) fieldContext_AppSpecContainersReadinessProbeHttpGet_httpHeaders(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersReadinessProbeHttpGet", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") - }, - } - return fc, nil +type Github__com___kloudlite___operator___pkg___operator__Check @shareable { + generation: Int + message: String + status: Boolean! } -func (ec *executionContext) _AppSpecContainersReadinessProbeHttpGet_path(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersReadinessProbeHTTPGet) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersReadinessProbeHttpGet_path(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Path, nil - }) - if err != nil { - ec.Error(ctx, err) - 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) +type Github__com___kloudlite___operator___pkg___operator__ResourceRef @shareable { + apiVersion: String! + kind: String! + name: String! + namespace: String! } -func (ec *executionContext) fieldContext_AppSpecContainersReadinessProbeHttpGet_path(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersReadinessProbeHttpGet", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +type Github__com___kloudlite___operator___pkg___operator__Status @shareable { + checks: Map + isReady: Boolean! + lastReadyGeneration: Int + lastReconcileTime: Date + message: Github__com___kloudlite___operator___pkg___raw____json__RawJson + resources: [Github__com___kloudlite___operator___pkg___operator__ResourceRef!] } -func (ec *executionContext) _AppSpecContainersReadinessProbeHttpGet_port(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersReadinessProbeHTTPGet) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersReadinessProbeHttpGet_port(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Port, nil - }) - if err != nil { - ec.Error(ctx, 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) +type Github__com___kloudlite___operator___pkg___raw____json__RawJson @shareable { + RawMessage: Any } -func (ec *executionContext) fieldContext_AppSpecContainersReadinessProbeHttpGet_port(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersReadinessProbeHttpGet", - 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 +type K8s__io___api___core___v1__Toleration @shareable { + effect: K8s__io___api___core___v1__TaintEffect + key: String + operator: K8s__io___api___core___v1__TolerationOperator + tolerationSeconds: Int + value: String } -func (ec *executionContext) _AppSpecContainersReadinessProbeShell_command(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersReadinessProbeShell) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersReadinessProbeShell_command(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Command, nil - }) - 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) +type Metadata @shareable { + annotations: Map + creationTimestamp: Date! + deletionTimestamp: Date + generation: Int! + labels: Map + name: String! + namespace: String } -func (ec *executionContext) fieldContext_AppSpecContainersReadinessProbeShell_command(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersReadinessProbeShell", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +type PageInfo @shareable { + endCursor: String + hasNextPage: Boolean + hasPreviousPage: Boolean + startCursor: String } -func (ec *executionContext) _AppSpecContainersReadinessProbeTcp_port(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersReadinessProbeTCP) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersReadinessProbeTcp_port(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Port, nil - }) - if err != nil { - ec.Error(ctx, 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) +input Github__com___kloudlite___operator___apis___crds___v1__AppContainerIn { + args: [String!] + command: [String!] + env: [Github__com___kloudlite___operator___apis___crds___v1__ContainerEnvIn!] + envFrom: [Github__com___kloudlite___operator___apis___crds___v1__EnvFromIn!] + image: String! + imagePullPolicy: String + livenessProbe: Github__com___kloudlite___operator___apis___crds___v1__ProbeIn + name: String! + readinessProbe: Github__com___kloudlite___operator___apis___crds___v1__ProbeIn + resourceCpu: Github__com___kloudlite___operator___apis___crds___v1__ContainerResourceIn + resourceMemory: Github__com___kloudlite___operator___apis___crds___v1__ContainerResourceIn + volumes: [Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeIn!] } -func (ec *executionContext) fieldContext_AppSpecContainersReadinessProbeTcp_port(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersReadinessProbeTcp", - 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 +input Github__com___kloudlite___operator___apis___crds___v1__AppSpecIn { + containers: [Github__com___kloudlite___operator___apis___crds___v1__AppContainerIn!]! + displayName: String + freeze: Boolean + hpa: Github__com___kloudlite___operator___apis___crds___v1__HPAIn + intercept: Github__com___kloudlite___operator___apis___crds___v1__InterceptIn + nodeSelector: Map + region: String + replicas: Int + serviceAccount: String + services: [Github__com___kloudlite___operator___apis___crds___v1__AppSvcIn!] + tolerations: [K8s__io___api___core___v1__TolerationIn!] } -func (ec *executionContext) _AppSpecContainersResourceCpu_max(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersResourceCPU) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersResourceCpu_max(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Max, nil - }) - 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) +input Github__com___kloudlite___operator___apis___crds___v1__AppSvcIn { + name: String + port: Int! + targetPort: Int + type: String } -func (ec *executionContext) fieldContext_AppSpecContainersResourceCpu_max(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersResourceCpu", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +input Github__com___kloudlite___operator___apis___crds___v1__BasicAuthIn { + enabled: Boolean! + secretName: String + username: String } -func (ec *executionContext) _AppSpecContainersResourceCpu_min(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersResourceCPU) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersResourceCpu_min(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Min, nil - }) - 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) +input Github__com___kloudlite___operator___apis___crds___v1__ContainerEnvIn { + key: String! + optional: Boolean + refKey: String + refName: String + type: Github__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret + value: String } -func (ec *executionContext) fieldContext_AppSpecContainersResourceCpu_min(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersResourceCpu", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +input Github__com___kloudlite___operator___apis___crds___v1__ContainerResourceIn { + max: String + min: String } -func (ec *executionContext) _AppSpecContainersResourceMemory_max(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersResourceMemory) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersResourceMemory_max(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Max, nil - }) - 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) +input Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeIn { + items: [Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItemIn!] + mountPath: String! + refName: String! + type: Github__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret! } -func (ec *executionContext) fieldContext_AppSpecContainersResourceMemory_max(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersResourceMemory", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +input Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItemIn { + fileName: String + key: String! } -func (ec *executionContext) _AppSpecContainersResourceMemory_min(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersResourceMemory) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersResourceMemory_min(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Min, nil - }) - 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) +input Github__com___kloudlite___operator___apis___crds___v1__CorsIn { + allowCredentials: Boolean + enabled: Boolean + origins: [String!] } -func (ec *executionContext) fieldContext_AppSpecContainersResourceMemory_min(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersResourceMemory", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +input Github__com___kloudlite___operator___apis___crds___v1__EnvFromIn { + refName: String! + type: Github__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret! } -func (ec *executionContext) _AppSpecContainersVolumes_mountPath(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersVolumes) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersVolumes_mountPath(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MountPath, nil - }) - if err != nil { - ec.Error(ctx, err) - 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) +input Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingIn { + mode: Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingMode } -func (ec *executionContext) fieldContext_AppSpecContainersVolumes_mountPath(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersVolumes", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +input Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpecIn { + projectName: String! + routing: Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingIn + targetNamespace: String } -func (ec *executionContext) _AppSpecContainersVolumes_refName(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersVolumes) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersVolumes_refName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.RefName, nil - }) - if err != nil { - ec.Error(ctx, err) - 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) +input Github__com___kloudlite___operator___apis___crds___v1__HPAIn { + enabled: Boolean + maxReplicas: Int + minReplicas: Int + thresholdCpu: Int + thresholdMemory: Int } -func (ec *executionContext) fieldContext_AppSpecContainersVolumes_refName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersVolumes", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +input Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbeIn { + httpHeaders: Map + path: String! + port: Int! } -func (ec *executionContext) _AppSpecContainersVolumes_type(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersVolumes) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersVolumes_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) +input Github__com___kloudlite___operator___apis___crds___v1__HttpsIn { + clusterIssuer: String + enabled: Boolean! + forceRedirect: Boolean } -func (ec *executionContext) fieldContext_AppSpecContainersVolumes_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersVolumes", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +input Github__com___kloudlite___operator___apis___crds___v1__InterceptIn { + enabled: Boolean! + toDevice: String! } -func (ec *executionContext) _AppSpecContainersVolumes_items(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersVolumes) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersVolumes_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 { - return graphql.Null - } - res := resTmp.([]*model.AppSpecContainersVolumesItems) - fc.Result = res - return ec.marshalOAppSpecContainersVolumesItems2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersVolumesItems(ctx, field.Selections, res) +input Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpecIn { + resourceName: String + resourceTemplate: Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplateIn! } -func (ec *executionContext) fieldContext_AppSpecContainersVolumes_items(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersVolumes", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "key": - return ec.fieldContext_AppSpecContainersVolumesItems_key(ctx, field) - case "fileName": - return ec.fieldContext_AppSpecContainersVolumesItems_fileName(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type AppSpecContainersVolumesItems", field.Name) - }, - } - return fc, nil +input Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn { + serviceTemplate: Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn! } -func (ec *executionContext) _AppSpecContainersVolumesItems_key(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersVolumesItems) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersVolumesItems_key(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Key, nil - }) - if err != nil { - ec.Error(ctx, err) - 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) +input Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplateIn { + apiVersion: String! + kind: String! + msvcRef: Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRefIn! + spec: Map! } -func (ec *executionContext) fieldContext_AppSpecContainersVolumesItems_key(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersVolumesItems", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +input Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRefIn { + apiVersion: String! + kind: String! + name: String! + namespace: String! } -func (ec *executionContext) _AppSpecContainersVolumesItems_fileName(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecContainersVolumesItems) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecContainersVolumesItems_fileName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.FileName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +input Github__com___kloudlite___operator___apis___crds___v1__ProbeIn { + failureThreshold: Int + httpGet: Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbeIn + initialDelay: Int + interval: Int + shell: Github__com___kloudlite___operator___apis___crds___v1__ShellProbeIn + tcp: Github__com___kloudlite___operator___apis___crds___v1__TcpProbeIn + type: String! } -func (ec *executionContext) fieldContext_AppSpecContainersVolumesItems_fileName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecContainersVolumesItems", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +input Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpecIn { + msvcSpec: Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn! + targetNamespace: String! } -func (ec *executionContext) _AppSpecHpa_enabled(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecHpa) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecHpa_enabled(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Enabled, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*bool) - fc.Result = res - return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) +input Github__com___kloudlite___operator___apis___crds___v1__ProjectSpecIn { + targetNamespace: String! } -func (ec *executionContext) fieldContext_AppSpecHpa_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecHpa", - 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 +input Github__com___kloudlite___operator___apis___crds___v1__RateLimitIn { + connections: Int + enabled: Boolean + rpm: Int + rps: Int } -func (ec *executionContext) _AppSpecHpa_maxReplicas(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecHpa) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecHpa_maxReplicas(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MaxReplicas, 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) +input Github__com___kloudlite___operator___apis___crds___v1__RouteIn { + app: String + lambda: String + path: String! + port: Int! + rewrite: Boolean } -func (ec *executionContext) fieldContext_AppSpecHpa_maxReplicas(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecHpa", - 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 +input Github__com___kloudlite___operator___apis___crds___v1__RouterSpecIn { + backendProtocol: String + basicAuth: Github__com___kloudlite___operator___apis___crds___v1__BasicAuthIn + cors: Github__com___kloudlite___operator___apis___crds___v1__CorsIn + domains: [String!]! + https: Github__com___kloudlite___operator___apis___crds___v1__HttpsIn + ingressClass: String + maxBodySizeInMB: Int + rateLimit: Github__com___kloudlite___operator___apis___crds___v1__RateLimitIn + routes: [Github__com___kloudlite___operator___apis___crds___v1__RouteIn!] } -func (ec *executionContext) _AppSpecHpa_minReplicas(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecHpa) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecHpa_minReplicas(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MinReplicas, 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) +input Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn { + apiVersion: String! + kind: String! + spec: Map! } -func (ec *executionContext) fieldContext_AppSpecHpa_minReplicas(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecHpa", - 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 +input Github__com___kloudlite___operator___apis___crds___v1__ShellProbeIn { + command: [String!] } -func (ec *executionContext) _AppSpecHpa_thresholdCpu(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecHpa) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecHpa_thresholdCpu(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ThresholdCPU, 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) +input Github__com___kloudlite___operator___apis___crds___v1__TcpProbeIn { + port: Int! } -func (ec *executionContext) fieldContext_AppSpecHpa_thresholdCpu(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecHpa", - 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 +input Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecordIn { + host: String + target: String } -func (ec *executionContext) _AppSpecHpa_thresholdMemory(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecHpa) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecHpa_thresholdMemory(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ThresholdMemory, 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) +input Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpecIn { + activeNamespace: String + cnameRecords: [Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecordIn!] + ports: [Github__com___kloudlite___operator___apis___wireguard___v1__PortIn!] } -func (ec *executionContext) fieldContext_AppSpecHpa_thresholdMemory(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecHpa", - 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 +input Github__com___kloudlite___operator___apis___wireguard___v1__PortIn { + port: Int + targetPort: Int } -func (ec *executionContext) _AppSpecIntercept_enabled(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecIntercept) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecIntercept_enabled(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Enabled, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) +input K8s__io___api___core___v1__TolerationIn { + effect: K8s__io___api___core___v1__TaintEffect + key: String + operator: K8s__io___api___core___v1__TolerationOperator + tolerationSeconds: Int + value: String } -func (ec *executionContext) fieldContext_AppSpecIntercept_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecIntercept", - 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 +input MetadataIn { + annotations: Map + labels: Map + name: String! + namespace: String } -func (ec *executionContext) _AppSpecIntercept_toDevice(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecIntercept) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecIntercept_toDevice(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ToDevice, nil - }) - if err != nil { - ec.Error(ctx, err) - 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) +enum Github__com___kloudlite___api___apps___console___internal___entities__PullSecretFormat { + dockerConfigJson + params } -func (ec *executionContext) fieldContext_AppSpecIntercept_toDevice(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecIntercept", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +enum Github__com___kloudlite___api___pkg___types__SyncAction { + APPLY + DELETE } -func (ec *executionContext) _AppSpecServices_name(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecServices) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecServices_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) +enum Github__com___kloudlite___api___pkg___types__SyncState { + APPLIED_AT_AGENT + DELETED_AT_AGENT + DELETING_AT_AGENT + ERRORED_AT_AGENT + IDLE + IN_QUEUE + UPDATED_AT_AGENT } -func (ec *executionContext) fieldContext_AppSpecServices_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecServices", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +enum Github__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret { + config + secret } -func (ec *executionContext) _AppSpecServices_port(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecServices) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecServices_port(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Port, nil - }) - if err != nil { - ec.Error(ctx, 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) +enum Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingMode { + private + public } -func (ec *executionContext) fieldContext_AppSpecServices_port(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecServices", - 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 +enum K8s__io___api___core___v1__SecretType { + bootstrap__kubernetes__io___token + kubernetes__io___basic____auth + kubernetes__io___dockercfg + kubernetes__io___dockerconfigjson + kubernetes__io___service____account____token + kubernetes__io___ssh____auth + kubernetes__io___tls + Opaque } -func (ec *executionContext) _AppSpecServices_targetPort(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecServices) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecServices_targetPort(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.TargetPort, 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) +enum K8s__io___api___core___v1__TaintEffect { + NoExecute + NoSchedule + PreferNoSchedule } -func (ec *executionContext) fieldContext_AppSpecServices_targetPort(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecServices", - 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 +enum K8s__io___api___core___v1__TolerationOperator { + Equal + Exists } -func (ec *executionContext) _AppSpecServices_type(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecServices) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecServices_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 { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +`, BuiltIn: false}, + {Name: "../struct-to-graphql/config.graphqls", Input: `type Config @shareable { + accountName: String! + apiVersion: String + binaryData: Map + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + data: Map + displayName: String! + environmentName: String! + id: String! + immutable: Boolean + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + projectName: String! + recordVersion: Int! + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type ConfigEdge @shareable { + cursor: String! + node: Config! +} + +type ConfigPaginatedRecords @shareable { + edges: [ConfigEdge!]! + pageInfo: PageInfo! + totalCount: Int! } -func (ec *executionContext) fieldContext_AppSpecServices_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecServices", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +input ConfigIn { + apiVersion: String + binaryData: Map + data: Map + displayName: String! + immutable: Boolean + kind: String + metadata: MetadataIn } -func (ec *executionContext) _AppSpecTolerations_effect(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecTolerations) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecTolerations_effect(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Effect, nil - }) - 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) +`, BuiltIn: false}, + {Name: "../struct-to-graphql/configkeyref.graphqls", Input: `type ConfigKeyRef @shareable { + configName: String! + key: String! } -func (ec *executionContext) fieldContext_AppSpecTolerations_effect(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecTolerations", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +input ConfigKeyRefIn { + configName: String! + key: String! } -func (ec *executionContext) _AppSpecTolerations_key(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecTolerations) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecTolerations_key(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Key, nil - }) - 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) +`, BuiltIn: false}, + {Name: "../struct-to-graphql/configkeyvalueref.graphqls", Input: `type ConfigKeyValueRef @shareable { + configName: String! + key: String! + value: String! } -func (ec *executionContext) fieldContext_AppSpecTolerations_key(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecTolerations", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +input ConfigKeyValueRefIn { + configName: String! + key: String! + value: String! } -func (ec *executionContext) _AppSpecTolerations_operator(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecTolerations) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecTolerations_operator(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Operator, nil - }) - 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) +`, BuiltIn: false}, + {Name: "../struct-to-graphql/consolevpndevice.graphqls", Input: `type ConsoleVPNDevice @shareable { + accountName: String! + apiVersion: String + clusterName: String + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + environmentName: String + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + linkedClusters: [String!] + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + projectName: String + recordVersion: Int! + spec: Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec + status: Github__com___kloudlite___operator___pkg___operator__Status + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! + wireguardConfig: Github__com___kloudlite___api___pkg___types__EncodedString +} + +type ConsoleVPNDeviceEdge @shareable { + cursor: String! + node: ConsoleVPNDevice! +} + +type ConsoleVPNDevicePaginatedRecords @shareable { + edges: [ConsoleVPNDeviceEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input ConsoleVPNDeviceIn { + apiVersion: String + clusterName: String + displayName: String! + environmentName: String + kind: String + metadata: MetadataIn + projectName: String + spec: Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpecIn } -func (ec *executionContext) fieldContext_AppSpecTolerations_operator(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecTolerations", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +`, BuiltIn: false}, + {Name: "../struct-to-graphql/cursorpagination.graphqls", Input: `type CursorPagination @shareable { + after: String + before: String + first: Int + last: Int + orderBy: String + sortDirection: CursorPaginationSortDirection } -func (ec *executionContext) _AppSpecTolerations_tolerationSeconds(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecTolerations) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecTolerations_tolerationSeconds(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.TolerationSeconds, 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) +input CursorPaginationIn { + after: String + before: String + first: Int + last: Int + orderBy: String = "_id" + sortDirection: CursorPaginationSortDirection = "ASC" } -func (ec *executionContext) fieldContext_AppSpecTolerations_tolerationSeconds(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecTolerations", - 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 +enum CursorPaginationSortDirection { + ASC + DESC } -func (ec *executionContext) _AppSpecTolerations_value(ctx context.Context, field graphql.CollectedField, obj *model.AppSpecTolerations) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AppSpecTolerations_value(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Value, nil - }) - 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) -} +`, BuiltIn: false}, + {Name: "../struct-to-graphql/directives.graphqls", Input: `extend schema @link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@key", "@shareable", "@external"]) -func (ec *executionContext) fieldContext_AppSpecTolerations_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AppSpecTolerations", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +directive @goField( + forceResolver: Boolean + name: String +) on INPUT_FIELD_DEFINITION | FIELD_DEFINITION +`, BuiltIn: false}, + {Name: "../struct-to-graphql/environment.graphqls", Input: `type Environment @shareable { + accountName: String! + apiVersion: String + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + projectName: String! + recordVersion: Int! + spec: Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec + status: Github__com___kloudlite___operator___pkg___operator__Status + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type EnvironmentEdge @shareable { + cursor: String! + node: Environment! +} + +type EnvironmentPaginatedRecords @shareable { + edges: [EnvironmentEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input EnvironmentIn { + apiVersion: String + displayName: String! + kind: String + metadata: MetadataIn + spec: Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpecIn } -func (ec *executionContext) _Check_status(ctx context.Context, field graphql.CollectedField, obj *operator.Check) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Check_status(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Status, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalOBoolean2bool(ctx, field.Selections, res) +`, BuiltIn: false}, + {Name: "../struct-to-graphql/imagepullsecret.graphqls", Input: `type ImagePullSecret @shareable { + accountName: String! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + dockerConfigJson: String + environmentName: String! + format: Github__com___kloudlite___api___apps___console___internal___entities__PullSecretFormat! + id: String! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata! @goField(name: "objectMeta") + projectName: String! + recordVersion: Int! + registryPassword: String + registryURL: String + registryUsername: String + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type ImagePullSecretEdge @shareable { + cursor: String! + node: ImagePullSecret! +} + +type ImagePullSecretPaginatedRecords @shareable { + edges: [ImagePullSecretEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input ImagePullSecretIn { + displayName: String! + dockerConfigJson: String + format: Github__com___kloudlite___api___apps___console___internal___entities__PullSecretFormat! + metadata: MetadataIn! + registryPassword: String + registryURL: String + registryUsername: String } -func (ec *executionContext) fieldContext_Check_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Check", - 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 +`, BuiltIn: false}, + {Name: "../struct-to-graphql/managedresource.graphqls", Input: `type ManagedResource @shareable { + accountName: String! + apiVersion: String + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + enabled: Boolean + environmentName: String! + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + projectName: String! + recordVersion: Int! + spec: Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec! + status: Github__com___kloudlite___operator___pkg___operator__Status + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type ManagedResourceEdge @shareable { + cursor: String! + node: ManagedResource! +} + +type ManagedResourcePaginatedRecords @shareable { + edges: [ManagedResourceEdge!]! + pageInfo: PageInfo! + totalCount: Int! } -func (ec *executionContext) _Check_message(ctx context.Context, field graphql.CollectedField, obj *operator.Check) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Check_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.marshalOString2string(ctx, field.Selections, res) +input ManagedResourceIn { + apiVersion: String + displayName: String! + enabled: Boolean + kind: String + metadata: MetadataIn + spec: Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpecIn! } -func (ec *executionContext) fieldContext_Check_message(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Check", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +`, BuiltIn: false}, + {Name: "../struct-to-graphql/managedresourcekeyref.graphqls", Input: `type ManagedResourceKeyRef @shareable { + key: String! + mresName: String! } -func (ec *executionContext) _Check_generation(ctx context.Context, field graphql.CollectedField, obj *operator.Check) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Check_generation(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Generation, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(int64) - fc.Result = res - return ec.marshalOInt2int64(ctx, field.Selections, res) +input ManagedResourceKeyRefIn { + key: String! + mresName: String! } -func (ec *executionContext) fieldContext_Check_generation(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Check", - 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 +`, BuiltIn: false}, + {Name: "../struct-to-graphql/managedresourcekeyvalueref.graphqls", Input: `type ManagedResourceKeyValueRef @shareable { + key: String! + mresName: String! + value: String! } -func (ec *executionContext) _Config_enabled(ctx context.Context, field graphql.CollectedField, obj *entities.Config) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Config_enabled(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Enabled, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalOBoolean2bool(ctx, field.Selections, res) +input ManagedResourceKeyValueRefIn { + key: String! + mresName: String! + value: String! } -func (ec *executionContext) fieldContext_Config_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Config", - 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 +`, BuiltIn: false}, + {Name: "../struct-to-graphql/matchfilter.graphqls", Input: `type MatchFilter @shareable { + array: [Any!] + exact: Any + matchType: MatchFilterMatchType! + regex: String } -func (ec *executionContext) _Config_kind(ctx context.Context, field graphql.CollectedField, obj *entities.Config) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Config_kind(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) +input MatchFilterIn { + array: [Any!] + exact: Any + matchType: MatchFilterMatchType! + regex: String } -func (ec *executionContext) fieldContext_Config_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Config", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +enum MatchFilterMatchType { + array + exact + regex } -func (ec *executionContext) _Config_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.Config) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Config_metadata(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ObjectMeta, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(v1.ObjectMeta) - fc.Result = res - return ec.marshalNMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) +`, BuiltIn: false}, + {Name: "../struct-to-graphql/port.graphqls", Input: `type Port @shareable { + port: Int + targetPort: Int } -func (ec *executionContext) fieldContext_Config_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Config", - 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_Metadata_name(ctx, field) - case "namespace": - return ec.fieldContext_Metadata_namespace(ctx, field) - case "labels": - return ec.fieldContext_Metadata_labels(ctx, field) - case "annotations": - return ec.fieldContext_Metadata_annotations(ctx, field) - case "creationTimestamp": - return ec.fieldContext_Metadata_creationTimestamp(ctx, field) - case "deletionTimestamp": - return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) - case "generation": - return ec.fieldContext_Metadata_generation(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) - }, - } - return fc, nil +input PortIn { + port: Int + targetPort: Int } -func (ec *executionContext) _Config_overrides(ctx context.Context, field graphql.CollectedField, obj *entities.Config) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Config_overrides(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Overrides, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*v11.JsonPatch) - fc.Result = res - return ec.marshalOOverrides2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋapisᚋcrdsᚋv1ᚐJsonPatch(ctx, field.Selections, res) +`, BuiltIn: false}, + {Name: "../struct-to-graphql/project.graphqls", Input: `type Project @shareable { + accountName: String! + apiVersion: String + clusterName: String + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + recordVersion: Int! + spec: Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec! + status: Github__com___kloudlite___operator___pkg___operator__Status + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type ProjectEdge @shareable { + cursor: String! + node: Project! +} + +type ProjectPaginatedRecords @shareable { + edges: [ProjectEdge!]! + pageInfo: PageInfo! + totalCount: Int! } -func (ec *executionContext) fieldContext_Config_overrides(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Config", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "applied": - return ec.fieldContext_Overrides_applied(ctx, field) - case "patches": - return ec.fieldContext_Overrides_patches(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Overrides", field.Name) - }, - } - return fc, nil +input ProjectIn { + apiVersion: String + clusterName: String + displayName: String! + kind: String + metadata: MetadataIn + spec: Github__com___kloudlite___operator___apis___crds___v1__ProjectSpecIn! } -func (ec *executionContext) _Config_status(ctx context.Context, field graphql.CollectedField, obj *entities.Config) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Config_status(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Status, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(operator.Status) - fc.Result = res - return ec.marshalOStatus2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) +`, BuiltIn: false}, + {Name: "../struct-to-graphql/projectmanagedservice.graphqls", Input: `type ProjectManagedService @shareable { + accountName: String! + apiVersion: String + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + projectName: String! + recordVersion: Int! + spec: Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec + status: Github__com___kloudlite___operator___pkg___operator__Status + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type ProjectManagedServiceEdge @shareable { + cursor: String! + node: ProjectManagedService! +} + +type ProjectManagedServicePaginatedRecords @shareable { + edges: [ProjectManagedServiceEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input ProjectManagedServiceIn { + apiVersion: String + displayName: String! + kind: String + metadata: MetadataIn + spec: Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpecIn } -func (ec *executionContext) fieldContext_Config_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Config", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "isReady": - return ec.fieldContext_Status_isReady(ctx, field) - case "checks": - return ec.fieldContext_Status_checks(ctx, field) - case "displayVars": - return ec.fieldContext_Status_displayVars(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Status", field.Name) - }, - } - return fc, nil +`, BuiltIn: false}, + {Name: "../struct-to-graphql/router.graphqls", Input: `type Router @shareable { + accountName: String! + apiVersion: String + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + enabled: Boolean + environmentName: String! + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + projectName: String! + recordVersion: Int! + spec: Github__com___kloudlite___operator___apis___crds___v1__RouterSpec! + status: Github__com___kloudlite___operator___pkg___operator__Status + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type RouterEdge @shareable { + cursor: String! + node: Router! +} + +type RouterPaginatedRecords @shareable { + edges: [RouterEdge!]! + pageInfo: PageInfo! + totalCount: Int! } -func (ec *executionContext) _Config_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Config) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Config_apiVersion(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.APIVersion, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) +input RouterIn { + apiVersion: String + displayName: String! + enabled: Boolean + kind: String + metadata: MetadataIn + spec: Github__com___kloudlite___operator___apis___crds___v1__RouterSpecIn! } -func (ec *executionContext) fieldContext_Config_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Config", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil +`, BuiltIn: false}, + {Name: "../struct-to-graphql/scalars.graphqls", Input: `scalar Any +scalar Json +scalar Map +scalar Date +`, BuiltIn: false}, + {Name: "../struct-to-graphql/secret.graphqls", Input: `type Secret @shareable { + accountName: String! + apiVersion: String + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + data: Map + displayName: String! + environmentName: String! + id: String! + immutable: Boolean + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + projectName: String! + recordVersion: Int! + stringData: Map + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + type: K8s__io___api___core___v1__SecretType + updateTime: Date! +} + +type SecretEdge @shareable { + cursor: String! + node: Secret! +} + +type SecretPaginatedRecords @shareable { + edges: [SecretEdge!]! + pageInfo: PageInfo! + totalCount: Int! } -func (ec *executionContext) _Config_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.Config) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Config_syncStatus(ctx, field) - if err != nil { - return graphql.Null +input SecretIn { + apiVersion: String + data: Map + displayName: String! + immutable: Boolean + kind: String + metadata: MetadataIn + stringData: Map + type: K8s__io___api___core___v1__SecretType +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/secretkeyref.graphqls", Input: `type SecretKeyRef @shareable { + key: String! + secretName: String! +} + +input SecretKeyRefIn { + key: String! + secretName: String! +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/secretkeyvalueref.graphqls", Input: `type SecretKeyValueRef @shareable { + key: String! + secretName: String! + value: String! +} + +input SecretKeyValueRefIn { + key: String! + secretName: String! + value: String! +} + +`, BuiltIn: false}, + {Name: "../../federation/directives.graphql", Input: ` + scalar _Any + scalar _FieldSet + directive @requires(fields: _FieldSet!) on FIELD_DEFINITION + directive @provides(fields: _FieldSet!) on FIELD_DEFINITION + directive @extends on OBJECT | INTERFACE + + directive @key(fields: _FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE + directive @external on FIELD_DEFINITION | OBJECT + directive @link(import: [String!], url: String!) repeatable on SCHEMA + directive @shareable on OBJECT | FIELD_DEFINITION + directive @tag(name: String!) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION + directive @override(from: String!) on FIELD_DEFINITION + directive @inaccessible on SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION +`, BuiltIn: true}, + {Name: "../../federation/entity.graphql", Input: ` +type _Service { + sdl: String +} + +extend type Query { + _service: _Service! +} +`, BuiltIn: true}, +} +var parsedSchema = gqlparser.MustLoadSchema(sources...) + +// endregion ************************** generated!.gotpl ************************** + +// region ***************************** args.gotpl ***************************** + +func (ec *executionContext) field_Mutation_core_cloneEnvironment_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["sourceEnvName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sourceEnvName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SyncStatus, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - return graphql.Null + args["sourceEnvName"] = arg1 + var arg2 string + if tmp, ok := rawArgs["destinationEnvName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationEnvName")) + arg2, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - res := resTmp.(types.SyncStatus) - fc.Result = res - return ec.marshalOSyncStatus2kloudliteᚗioᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) + args["destinationEnvName"] = arg2 + var arg3 string + if tmp, ok := rawArgs["displayName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + arg3, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["displayName"] = arg3 + var arg4 v1.EnvironmentRoutingMode + if tmp, ok := rawArgs["environmentRoutingMode"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("environmentRoutingMode")) + arg4, err = ec.unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingMode2githubᚗcomᚋkloudliteᚋoperatorᚋapisᚋcrdsᚋv1ᚐEnvironmentRoutingMode(ctx, tmp) + if err != nil { + return nil, err + } + } + args["environmentRoutingMode"] = arg4 + return args, nil } -func (ec *executionContext) fieldContext_Config_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Config", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "syncScheduledAt": - return ec.fieldContext_SyncStatus_syncScheduledAt(ctx, field) - case "lastSyncedAt": - return ec.fieldContext_SyncStatus_lastSyncedAt(ctx, field) - case "action": - return ec.fieldContext_SyncStatus_action(ctx, field) - case "generation": - return ec.fieldContext_SyncStatus_generation(ctx, field) - case "state": - return ec.fieldContext_SyncStatus_state(ctx, field) - case "error": - return ec.fieldContext_SyncStatus_error(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type SyncStatus", field.Name) - }, +func (ec *executionContext) field_Mutation_core_createApp_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - return fc, nil + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["envName"] = arg1 + var arg2 entities.App + if tmp, ok := rawArgs["app"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("app")) + arg2, err = ec.unmarshalNAppIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐApp(ctx, tmp) + if err != nil { + return nil, err + } + } + args["app"] = arg2 + return args, nil } -func (ec *executionContext) _Config_data(ctx context.Context, field graphql.CollectedField, obj *entities.Config) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Config_data(ctx, field) - if err != nil { - return graphql.Null +func (ec *executionContext) field_Mutation_core_createConfig_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Config().Data(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - return graphql.Null + args["envName"] = arg1 + var arg2 entities.Config + if tmp, ok := rawArgs["config"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("config")) + arg2, err = ec.unmarshalNConfigIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConfig(ctx, tmp) + if err != nil { + return nil, err + } } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) + args["config"] = arg2 + return args, nil } -func (ec *executionContext) fieldContext_Config_data(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Config", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") - }, +func (ec *executionContext) field_Mutation_core_createEnvironment_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - return fc, nil + args["projectName"] = arg0 + var arg1 entities.Environment + if tmp, ok := rawArgs["env"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("env")) + arg1, err = ec.unmarshalNEnvironmentIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐEnvironment(ctx, tmp) + if err != nil { + return nil, err + } + } + args["env"] = arg1 + return args, nil } -func (ec *executionContext) _ConsoleCheckNameAvailabilityOutput_result(ctx context.Context, field graphql.CollectedField, obj *domain.CheckNameAvailabilityOutput) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ConsoleCheckNameAvailabilityOutput_result(ctx, field) - if err != nil { - return graphql.Null +func (ec *executionContext) field_Mutation_core_createImagePullSecret_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Result, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + args["envName"] = arg1 + var arg2 entities.ImagePullSecret + if tmp, ok := rawArgs["imagePullSecretIn"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("imagePullSecretIn")) + arg2, err = ec.unmarshalNImagePullSecretIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐImagePullSecret(ctx, tmp) + if err != nil { + return nil, err } - return graphql.Null } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + args["imagePullSecretIn"] = arg2 + return args, nil } -func (ec *executionContext) fieldContext_ConsoleCheckNameAvailabilityOutput_result(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ConsoleCheckNameAvailabilityOutput", - 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") - }, +func (ec *executionContext) field_Mutation_core_createManagedResource_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - return fc, nil + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["envName"] = arg1 + var arg2 entities.ManagedResource + if tmp, ok := rawArgs["mres"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("mres")) + arg2, err = ec.unmarshalNManagedResourceIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐManagedResource(ctx, tmp) + if err != nil { + return nil, err + } + } + args["mres"] = arg2 + return args, nil } -func (ec *executionContext) _ConsoleCheckNameAvailabilityOutput_suggestedNames(ctx context.Context, field graphql.CollectedField, obj *domain.CheckNameAvailabilityOutput) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ConsoleCheckNameAvailabilityOutput_suggestedNames(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null +func (ec *executionContext) field_Mutation_core_createProjectManagedService_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SuggestedNames, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - return graphql.Null + args["projectName"] = arg0 + var arg1 entities.ProjectManagedService + if tmp, ok := rawArgs["pmsvc"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pmsvc")) + arg1, err = ec.unmarshalNProjectManagedServiceIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProjectManagedService(ctx, tmp) + if err != nil { + return nil, err + } } - res := resTmp.([]string) - fc.Result = res - return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) + args["pmsvc"] = arg1 + return args, nil } -func (ec *executionContext) fieldContext_ConsoleCheckNameAvailabilityOutput_suggestedNames(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ConsoleCheckNameAvailabilityOutput", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, +func (ec *executionContext) field_Mutation_core_createProject_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 entities.Project + if tmp, ok := rawArgs["project"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("project")) + arg0, err = ec.unmarshalNProjectIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProject(ctx, tmp) + if err != nil { + return nil, err + } } - return fc, nil + args["project"] = arg0 + return args, nil } -func (ec *executionContext) _ManagedResource_overrides(ctx context.Context, field graphql.CollectedField, obj *entities.MRes) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedResource_overrides(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null +func (ec *executionContext) field_Mutation_core_createRouter_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Overrides, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - return graphql.Null + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - res := resTmp.(*v11.JsonPatch) - fc.Result = res - return ec.marshalOOverrides2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋapisᚋcrdsᚋv1ᚐJsonPatch(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ManagedResource_overrides(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedResource", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "applied": - return ec.fieldContext_Overrides_applied(ctx, field) - case "patches": - return ec.fieldContext_Overrides_patches(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Overrides", field.Name) - }, + args["envName"] = arg1 + var arg2 entities.Router + if tmp, ok := rawArgs["router"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("router")) + arg2, err = ec.unmarshalNRouterIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐRouter(ctx, tmp) + if err != nil { + return nil, err + } } - return fc, nil + args["router"] = arg2 + return args, nil } -func (ec *executionContext) _ManagedResource_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.MRes) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedResource_syncStatus(ctx, field) - if err != nil { - return graphql.Null +func (ec *executionContext) field_Mutation_core_createSecret_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SyncStatus, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - return graphql.Null + args["envName"] = arg1 + var arg2 entities.Secret + if tmp, ok := rawArgs["secret"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secret")) + arg2, err = ec.unmarshalNSecretIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐSecret(ctx, tmp) + if err != nil { + return nil, err + } } - res := resTmp.(types.SyncStatus) - fc.Result = res - return ec.marshalOSyncStatus2kloudliteᚗioᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) + args["secret"] = arg2 + return args, nil } -func (ec *executionContext) fieldContext_ManagedResource_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedResource", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "syncScheduledAt": - return ec.fieldContext_SyncStatus_syncScheduledAt(ctx, field) - case "lastSyncedAt": - return ec.fieldContext_SyncStatus_lastSyncedAt(ctx, field) - case "action": - return ec.fieldContext_SyncStatus_action(ctx, field) - case "generation": - return ec.fieldContext_SyncStatus_generation(ctx, field) - case "state": - return ec.fieldContext_SyncStatus_state(ctx, field) - case "error": - return ec.fieldContext_SyncStatus_error(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type SyncStatus", field.Name) - }, +func (ec *executionContext) field_Mutation_core_createVPNDevice_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 entities.ConsoleVPNDevice + if tmp, ok := rawArgs["vpnDevice"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("vpnDevice")) + arg0, err = ec.unmarshalNConsoleVPNDeviceIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConsoleVPNDevice(ctx, tmp) + if err != nil { + return nil, err + } } - return fc, nil + args["vpnDevice"] = arg0 + return args, nil } -func (ec *executionContext) _ManagedResource_spec(ctx context.Context, field graphql.CollectedField, obj *entities.MRes) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedResource_spec(ctx, field) - if err != nil { - return graphql.Null +func (ec *executionContext) field_Mutation_core_deleteApp_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.ManagedResource().Spec(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - return graphql.Null + args["envName"] = arg1 + var arg2 string + if tmp, ok := rawArgs["appName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appName")) + arg2, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - res := resTmp.(*model.ManagedResourceSpec) - fc.Result = res - return ec.marshalOManagedResourceSpec2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedResourceSpec(ctx, field.Selections, res) + args["appName"] = arg2 + return args, nil } -func (ec *executionContext) fieldContext_ManagedResource_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedResource", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "inputs": - return ec.fieldContext_ManagedResourceSpec_inputs(ctx, field) - case "mresKind": - return ec.fieldContext_ManagedResourceSpec_mresKind(ctx, field) - case "msvcRef": - return ec.fieldContext_ManagedResourceSpec_msvcRef(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ManagedResourceSpec", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _ManagedResource_status(ctx context.Context, field graphql.CollectedField, obj *entities.MRes) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedResource_status(ctx, field) - if err != nil { - return graphql.Null +func (ec *executionContext) field_Mutation_core_deleteConfig_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Status, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - return graphql.Null + args["envName"] = arg1 + var arg2 string + if tmp, ok := rawArgs["configName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configName")) + arg2, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - res := resTmp.(operator.Status) - fc.Result = res - return ec.marshalOStatus2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) + args["configName"] = arg2 + return args, nil } -func (ec *executionContext) fieldContext_ManagedResource_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedResource", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "isReady": - return ec.fieldContext_Status_isReady(ctx, field) - case "checks": - return ec.fieldContext_Status_checks(ctx, field) - case "displayVars": - return ec.fieldContext_Status_displayVars(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Status", field.Name) - }, +func (ec *executionContext) field_Mutation_core_deleteEnvironment_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - return fc, nil + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["envName"] = arg1 + return args, nil } -func (ec *executionContext) _ManagedResource_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.MRes) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedResource_apiVersion(ctx, field) - if err != nil { - return graphql.Null +func (ec *executionContext) field_Mutation_core_deleteImagePullSecret_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.APIVersion, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - return graphql.Null + args["envName"] = arg1 + var arg2 string + if tmp, ok := rawArgs["secretName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretName")) + arg2, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + args["secretName"] = arg2 + return args, nil } -func (ec *executionContext) fieldContext_ManagedResource_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedResource", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, +func (ec *executionContext) field_Mutation_core_deleteManagedResource_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - return fc, nil + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["envName"] = arg1 + var arg2 string + if tmp, ok := rawArgs["mresName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("mresName")) + arg2, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["mresName"] = arg2 + return args, nil } -func (ec *executionContext) _ManagedResource_enabled(ctx context.Context, field graphql.CollectedField, obj *entities.MRes) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedResource_enabled(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null +func (ec *executionContext) field_Mutation_core_deleteProjectManagedService_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Enabled, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - return graphql.Null + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["pmsvcName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pmsvcName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - res := resTmp.(*bool) - fc.Result = res - return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) + args["pmsvcName"] = arg1 + return args, nil } -func (ec *executionContext) fieldContext_ManagedResource_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedResource", - 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") - }, +func (ec *executionContext) field_Mutation_core_deleteProject_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 + } } - return fc, nil + args["name"] = arg0 + return args, nil } -func (ec *executionContext) _ManagedResource_kind(ctx context.Context, field graphql.CollectedField, obj *entities.MRes) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedResource_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 +func (ec *executionContext) field_Mutation_core_deleteRouter_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - return graphql.Null + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ManagedResource_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedResource", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, + args["envName"] = arg1 + var arg2 string + if tmp, ok := rawArgs["routerName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("routerName")) + arg2, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - return fc, nil + args["routerName"] = arg2 + return args, nil } -func (ec *executionContext) _ManagedResource_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.MRes) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedResource_metadata(ctx, field) - if err != nil { - return graphql.Null +func (ec *executionContext) field_Mutation_core_deleteSecret_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ObjectMeta, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + args["envName"] = arg1 + var arg2 string + if tmp, ok := rawArgs["secretName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretName")) + arg2, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - return graphql.Null } - res := resTmp.(v1.ObjectMeta) - fc.Result = res - return ec.marshalNMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) + args["secretName"] = arg2 + return args, nil } -func (ec *executionContext) fieldContext_ManagedResource_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedResource", - 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_Metadata_name(ctx, field) - case "namespace": - return ec.fieldContext_Metadata_namespace(ctx, field) - case "labels": - return ec.fieldContext_Metadata_labels(ctx, field) - case "annotations": - return ec.fieldContext_Metadata_annotations(ctx, field) - case "creationTimestamp": - return ec.fieldContext_Metadata_creationTimestamp(ctx, field) - case "deletionTimestamp": - return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) - case "generation": - return ec.fieldContext_Metadata_generation(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) - }, +func (ec *executionContext) field_Mutation_core_deleteVPNDevice_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["deviceName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deviceName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - return fc, nil + args["deviceName"] = arg0 + return args, nil } -func (ec *executionContext) _ManagedResourceSpec_inputs(ctx context.Context, field graphql.CollectedField, obj *model.ManagedResourceSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedResourceSpec_inputs(ctx, field) - if err != nil { - return graphql.Null +func (ec *executionContext) field_Mutation_core_interceptApp_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Inputs, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - return graphql.Null + args["envName"] = arg1 + var arg2 string + if tmp, ok := rawArgs["appname"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appname")) + arg2, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ManagedResourceSpec_inputs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedResourceSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") - }, + args["appname"] = arg2 + var arg3 string + if tmp, ok := rawArgs["deviceName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deviceName")) + arg3, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - return fc, nil + args["deviceName"] = arg3 + var arg4 bool + if tmp, ok := rawArgs["intercept"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("intercept")) + arg4, err = ec.unmarshalNBoolean2bool(ctx, tmp) + if err != nil { + return nil, err + } + } + args["intercept"] = arg4 + return args, nil } -func (ec *executionContext) _ManagedResourceSpec_mresKind(ctx context.Context, field graphql.CollectedField, obj *model.ManagedResourceSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedResourceSpec_mresKind(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null +func (ec *executionContext) field_Mutation_core_updateApp_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MresKind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - return graphql.Null } - res := resTmp.(*model.ManagedResourceSpecMresKind) - fc.Result = res - return ec.marshalNManagedResourceSpecMresKind2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedResourceSpecMresKind(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ManagedResourceSpec_mresKind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedResourceSpec", - 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_ManagedResourceSpecMresKind_kind(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ManagedResourceSpecMresKind", field.Name) - }, + args["envName"] = arg1 + var arg2 entities.App + if tmp, ok := rawArgs["app"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("app")) + arg2, err = ec.unmarshalNAppIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐApp(ctx, tmp) + if err != nil { + return nil, err + } } - return fc, nil + args["app"] = arg2 + return args, nil } -func (ec *executionContext) _ManagedResourceSpec_msvcRef(ctx context.Context, field graphql.CollectedField, obj *model.ManagedResourceSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedResourceSpec_msvcRef(ctx, field) - if err != nil { - return graphql.Null +func (ec *executionContext) field_Mutation_core_updateConfig_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MsvcRef, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + args["envName"] = arg1 + var arg2 entities.Config + if tmp, ok := rawArgs["config"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("config")) + arg2, err = ec.unmarshalNConfigIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConfig(ctx, tmp) + if err != nil { + return nil, err } - return graphql.Null } - res := resTmp.(*model.ManagedResourceSpecMsvcRef) - fc.Result = res - return ec.marshalNManagedResourceSpecMsvcRef2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedResourceSpecMsvcRef(ctx, field.Selections, res) + args["config"] = arg2 + return args, nil } -func (ec *executionContext) fieldContext_ManagedResourceSpec_msvcRef(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedResourceSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "apiVersion": - return ec.fieldContext_ManagedResourceSpecMsvcRef_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_ManagedResourceSpecMsvcRef_kind(ctx, field) - case "name": - return ec.fieldContext_ManagedResourceSpecMsvcRef_name(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ManagedResourceSpecMsvcRef", field.Name) - }, +func (ec *executionContext) field_Mutation_core_updateEnvironment_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - return fc, nil + args["projectName"] = arg0 + var arg1 entities.Environment + if tmp, ok := rawArgs["env"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("env")) + arg1, err = ec.unmarshalNEnvironmentIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐEnvironment(ctx, tmp) + if err != nil { + return nil, err + } + } + args["env"] = arg1 + return args, nil } -func (ec *executionContext) _ManagedResourceSpecMresKind_kind(ctx context.Context, field graphql.CollectedField, obj *model.ManagedResourceSpecMresKind) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedResourceSpecMresKind_kind(ctx, field) - if err != nil { - return graphql.Null +func (ec *executionContext) field_Mutation_core_updateManagedResource_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - }() - 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") + args["envName"] = arg1 + var arg2 entities.ManagedResource + if tmp, ok := rawArgs["mres"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("mres")) + arg2, err = ec.unmarshalNManagedResourceIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐManagedResource(ctx, tmp) + if err != nil { + return nil, err } - return graphql.Null } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + args["mres"] = arg2 + return args, nil } -func (ec *executionContext) fieldContext_ManagedResourceSpecMresKind_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedResourceSpecMresKind", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ManagedResourceSpecMsvcRef_apiVersion(ctx context.Context, field graphql.CollectedField, obj *model.ManagedResourceSpecMsvcRef) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedResourceSpecMsvcRef_apiVersion(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null +func (ec *executionContext) field_Mutation_core_updateProjectManagedService_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.APIVersion, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + args["projectName"] = arg0 + var arg1 entities.ProjectManagedService + if tmp, ok := rawArgs["pmsvc"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pmsvc")) + arg1, err = ec.unmarshalNProjectManagedServiceIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProjectManagedService(ctx, tmp) + if err != nil { + return nil, err } - return graphql.Null } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + args["pmsvc"] = arg1 + return args, nil } -func (ec *executionContext) fieldContext_ManagedResourceSpecMsvcRef_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedResourceSpecMsvcRef", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, +func (ec *executionContext) field_Mutation_core_updateProject_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 entities.Project + if tmp, ok := rawArgs["project"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("project")) + arg0, err = ec.unmarshalNProjectIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProject(ctx, tmp) + if err != nil { + return nil, err + } } - return fc, nil + args["project"] = arg0 + return args, nil } -func (ec *executionContext) _ManagedResourceSpecMsvcRef_kind(ctx context.Context, field graphql.CollectedField, obj *model.ManagedResourceSpecMsvcRef) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedResourceSpecMsvcRef_kind(ctx, field) - if err != nil { - return graphql.Null +func (ec *executionContext) field_Mutation_core_updateRouter_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - return graphql.Null + args["envName"] = arg1 + var arg2 entities.Router + if tmp, ok := rawArgs["router"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("router")) + arg2, err = ec.unmarshalNRouterIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐRouter(ctx, tmp) + if err != nil { + return nil, err + } } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + args["router"] = arg2 + return args, nil } -func (ec *executionContext) fieldContext_ManagedResourceSpecMsvcRef_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedResourceSpecMsvcRef", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, +func (ec *executionContext) field_Mutation_core_updateSecret_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - return fc, nil + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["envName"] = arg1 + var arg2 entities.Secret + if tmp, ok := rawArgs["secret"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secret")) + arg2, err = ec.unmarshalNSecretIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐSecret(ctx, tmp) + if err != nil { + return nil, err + } + } + args["secret"] = arg2 + return args, nil } -func (ec *executionContext) _ManagedResourceSpecMsvcRef_name(ctx context.Context, field graphql.CollectedField, obj *model.ManagedResourceSpecMsvcRef) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedResourceSpecMsvcRef_name(ctx, field) - if err != nil { - return graphql.Null +func (ec *executionContext) field_Mutation_core_updateVPNDeviceEnv_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["deviceName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deviceName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + args["deviceName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - }() - 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") + args["projectName"] = arg1 + var arg2 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg2, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - return graphql.Null } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + args["envName"] = arg2 + return args, nil } -func (ec *executionContext) fieldContext_ManagedResourceSpecMsvcRef_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedResourceSpecMsvcRef", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, +func (ec *executionContext) field_Mutation_core_updateVPNDevicePorts_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["deviceName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deviceName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - return fc, nil + args["deviceName"] = arg0 + var arg1 []*v11.Port + if tmp, ok := rawArgs["ports"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ports")) + arg1, err = ec.unmarshalNPortIn2ᚕᚖgithubᚗcomᚋkloudliteᚋoperatorᚋapisᚋwireguardᚋv1ᚐPortᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["ports"] = arg1 + return args, nil } -func (ec *executionContext) _ManagedService_overrides(ctx context.Context, field graphql.CollectedField, obj *entities.MSvc) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedService_overrides(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null +func (ec *executionContext) field_Mutation_core_updateVPNDevice_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 entities.ConsoleVPNDevice + if tmp, ok := rawArgs["vpnDevice"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("vpnDevice")) + arg0, err = ec.unmarshalNConsoleVPNDeviceIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConsoleVPNDevice(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Overrides, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null } - res := resTmp.(*v11.JsonPatch) - fc.Result = res - return ec.marshalOOverrides2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋapisᚋcrdsᚋv1ᚐJsonPatch(ctx, field.Selections, res) + args["vpnDevice"] = arg0 + return args, nil } -func (ec *executionContext) fieldContext_ManagedService_overrides(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedService", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "applied": - return ec.fieldContext_Overrides_applied(ctx, field) - case "patches": - return ec.fieldContext_Overrides_patches(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Overrides", field.Name) - }, +func (ec *executionContext) field_Mutation_core_updateVpnClusterName_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["deviceName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deviceName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - return fc, nil + args["deviceName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["clusterName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["clusterName"] = arg1 + return args, nil } -func (ec *executionContext) _ManagedService_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.MSvc) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedService_syncStatus(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null +func (ec *executionContext) field_Mutation_core_updateVpnDeviceNs_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["deviceName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deviceName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SyncStatus, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - return graphql.Null + args["deviceName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["ns"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ns")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - res := resTmp.(types.SyncStatus) - fc.Result = res - return ec.marshalOSyncStatus2kloudliteᚗioᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) + args["ns"] = arg1 + return args, nil } -func (ec *executionContext) fieldContext_ManagedService_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedService", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "syncScheduledAt": - return ec.fieldContext_SyncStatus_syncScheduledAt(ctx, field) - case "lastSyncedAt": - return ec.fieldContext_SyncStatus_lastSyncedAt(ctx, field) - case "action": - return ec.fieldContext_SyncStatus_action(ctx, field) - case "generation": - return ec.fieldContext_SyncStatus_generation(ctx, field) - case "state": - return ec.fieldContext_SyncStatus_state(ctx, field) - case "error": - return ec.fieldContext_SyncStatus_error(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type SyncStatus", field.Name) - }, +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 + } } - return fc, nil + args["name"] = arg0 + return args, nil } -func (ec *executionContext) _ManagedService_spec(ctx context.Context, field graphql.CollectedField, obj *entities.MSvc) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedService_spec(ctx, field) - if err != nil { - return graphql.Null +func (ec *executionContext) field_Query_core_checkNameAvailability_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalOString2ᚖstring(ctx, tmp) + if err != nil { + return nil, err + } } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + args["projectName"] = arg0 + var arg1 *string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.ManagedService().Spec(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - return graphql.Null + args["envName"] = arg1 + var arg2 entities.ResourceType + if tmp, ok := rawArgs["resType"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("resType")) + arg2, err = ec.unmarshalNConsoleResType2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐResourceType(ctx, tmp) + if err != nil { + return nil, err + } } - res := resTmp.(*model.ManagedServiceSpec) - fc.Result = res - return ec.marshalOManagedServiceSpec2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedServiceSpec(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ManagedService_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedService", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "inputs": - return ec.fieldContext_ManagedServiceSpec_inputs(ctx, field) - case "msvcKind": - return ec.fieldContext_ManagedServiceSpec_msvcKind(ctx, field) - case "nodeSelector": - return ec.fieldContext_ManagedServiceSpec_nodeSelector(ctx, field) - case "region": - return ec.fieldContext_ManagedServiceSpec_region(ctx, field) - case "tolerations": - return ec.fieldContext_ManagedServiceSpec_tolerations(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ManagedServiceSpec", field.Name) - }, + args["resType"] = arg2 + var arg3 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg3, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - return fc, nil + args["name"] = arg3 + return args, nil } -func (ec *executionContext) _ManagedService_status(ctx context.Context, field graphql.CollectedField, obj *entities.MSvc) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedService_status(ctx, field) - if err != nil { - return graphql.Null +func (ec *executionContext) field_Query_core_getApp_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Status, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - return graphql.Null + args["envName"] = arg1 + var arg2 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg2, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - res := resTmp.(operator.Status) - fc.Result = res - return ec.marshalOStatus2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) + args["name"] = arg2 + return args, nil } -func (ec *executionContext) fieldContext_ManagedService_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedService", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "isReady": - return ec.fieldContext_Status_isReady(ctx, field) - case "checks": - return ec.fieldContext_Status_checks(ctx, field) - case "displayVars": - return ec.fieldContext_Status_displayVars(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Status", field.Name) - }, +func (ec *executionContext) field_Query_core_getConfigValues_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - return fc, nil + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["envName"] = arg1 + var arg2 []*domain.ConfigKeyRef + if tmp, ok := rawArgs["queries"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("queries")) + arg2, err = ec.unmarshalOConfigKeyRefIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐConfigKeyRef(ctx, tmp) + if err != nil { + return nil, err + } + } + args["queries"] = arg2 + return args, nil } -func (ec *executionContext) _ManagedService_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.MSvc) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedService_apiVersion(ctx, field) - if err != nil { - return graphql.Null +func (ec *executionContext) field_Query_core_getConfig_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.APIVersion, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - return graphql.Null + args["envName"] = arg1 + var arg2 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg2, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + args["name"] = arg2 + return args, nil } -func (ec *executionContext) fieldContext_ManagedService_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedService", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, +func (ec *executionContext) field_Query_core_getEnvironment_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - return fc, nil + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg1 + return args, nil } -func (ec *executionContext) _ManagedService_enabled(ctx context.Context, field graphql.CollectedField, obj *entities.MSvc) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedService_enabled(ctx, field) - if err != nil { - return graphql.Null +func (ec *executionContext) field_Query_core_getImagePullSecret_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Enabled, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - return graphql.Null + args["envName"] = arg1 + var arg2 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg2, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - res := resTmp.(*bool) - fc.Result = res - return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) + args["name"] = arg2 + return args, nil } -func (ec *executionContext) fieldContext_ManagedService_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedService", - 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") - }, +func (ec *executionContext) field_Query_core_getManagedResouceOutputKeyValues_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - return fc, nil + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["envName"] = arg1 + var arg2 []*domain.ManagedResourceKeyRef + if tmp, ok := rawArgs["keyrefs"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("keyrefs")) + arg2, err = ec.unmarshalOManagedResourceKeyRefIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐManagedResourceKeyRef(ctx, tmp) + if err != nil { + return nil, err + } + } + args["keyrefs"] = arg2 + return args, nil } -func (ec *executionContext) _ManagedService_kind(ctx context.Context, field graphql.CollectedField, obj *entities.MSvc) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedService_kind(ctx, field) - if err != nil { - return graphql.Null +func (ec *executionContext) field_Query_core_getManagedResouceOutputKeys_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - return graphql.Null + args["envName"] = arg1 + var arg2 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg2, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + args["name"] = arg2 + return args, nil } -func (ec *executionContext) fieldContext_ManagedService_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedService", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, +func (ec *executionContext) field_Query_core_getManagedResource_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - return fc, nil + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["envName"] = arg1 + var arg2 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg2, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg2 + return args, nil } -func (ec *executionContext) _ManagedService_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.MSvc) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedService_metadata(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null +func (ec *executionContext) field_Query_core_getProjectManagedService_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ObjectMeta, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - return graphql.Null } - res := resTmp.(v1.ObjectMeta) - fc.Result = res - return ec.marshalNMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) + args["name"] = arg1 + return args, nil } -func (ec *executionContext) fieldContext_ManagedService_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedService", - 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_Metadata_name(ctx, field) - case "namespace": - return ec.fieldContext_Metadata_namespace(ctx, field) - case "labels": - return ec.fieldContext_Metadata_labels(ctx, field) - case "annotations": - return ec.fieldContext_Metadata_annotations(ctx, field) - case "creationTimestamp": - return ec.fieldContext_Metadata_creationTimestamp(ctx, field) - case "deletionTimestamp": - return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) - case "generation": - return ec.fieldContext_Metadata_generation(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) - }, +func (ec *executionContext) field_Query_core_getProject_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 + } } - return fc, nil + args["name"] = arg0 + return args, nil } -func (ec *executionContext) _ManagedServiceSpec_inputs(ctx context.Context, field graphql.CollectedField, obj *model.ManagedServiceSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedServiceSpec_inputs(ctx, field) - if err != nil { - return graphql.Null +func (ec *executionContext) field_Query_core_getRouter_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Inputs, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - return graphql.Null + args["envName"] = arg1 + var arg2 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg2, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) + args["name"] = arg2 + return args, nil } -func (ec *executionContext) fieldContext_ManagedServiceSpec_inputs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedServiceSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") - }, +func (ec *executionContext) field_Query_core_getSecretValues_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - return fc, nil + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["envName"] = arg1 + var arg2 []*domain.SecretKeyRef + if tmp, ok := rawArgs["queries"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("queries")) + arg2, err = ec.unmarshalOSecretKeyRefIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐSecretKeyRefᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["queries"] = arg2 + return args, nil } -func (ec *executionContext) _ManagedServiceSpec_msvcKind(ctx context.Context, field graphql.CollectedField, obj *model.ManagedServiceSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedServiceSpec_msvcKind(ctx, field) - if err != nil { - return graphql.Null +func (ec *executionContext) field_Query_core_getSecret_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MsvcKind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + args["envName"] = arg1 + var arg2 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg2, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - return graphql.Null } - res := resTmp.(*model.ManagedServiceSpecMsvcKind) - fc.Result = res - return ec.marshalNManagedServiceSpecMsvcKind2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedServiceSpecMsvcKind(ctx, field.Selections, res) + args["name"] = arg2 + return args, nil } -func (ec *executionContext) fieldContext_ManagedServiceSpec_msvcKind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedServiceSpec", - 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_ManagedServiceSpecMsvcKind_kind(ctx, field) - case "apiVersion": - return ec.fieldContext_ManagedServiceSpecMsvcKind_apiVersion(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ManagedServiceSpecMsvcKind", field.Name) - }, +func (ec *executionContext) field_Query_core_getVPNDevice_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 + } } - return fc, nil + args["name"] = arg0 + return args, nil } -func (ec *executionContext) _ManagedServiceSpec_nodeSelector(ctx context.Context, field graphql.CollectedField, obj *model.ManagedServiceSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedServiceSpec_nodeSelector(ctx, field) - if err != nil { - return graphql.Null +func (ec *executionContext) field_Query_core_listApps_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.NodeSelector, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - return graphql.Null + args["envName"] = arg1 + var arg2 *model.SearchApps + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg2, err = ec.unmarshalOSearchApps2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchApps(ctx, tmp) + if err != nil { + return nil, err + } } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ManagedServiceSpec_nodeSelector(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedServiceSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") - }, + args["search"] = arg2 + var arg3 *repos.CursorPagination + if tmp, ok := rawArgs["pq"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) + arg3, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } } - return fc, nil + args["pq"] = arg3 + return args, nil } -func (ec *executionContext) _ManagedServiceSpec_region(ctx context.Context, field graphql.CollectedField, obj *model.ManagedServiceSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedServiceSpec_region(ctx, field) - if err != nil { - return graphql.Null +func (ec *executionContext) field_Query_core_listConfigs_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Region, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - return graphql.Null + args["envName"] = arg1 + var arg2 *model.SearchConfigs + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg2, err = ec.unmarshalOSearchConfigs2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchConfigs(ctx, tmp) + if err != nil { + return nil, err + } } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ManagedServiceSpec_region(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedServiceSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, + args["search"] = arg2 + var arg3 *repos.CursorPagination + if tmp, ok := rawArgs["pq"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) + arg3, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } } - return fc, nil + args["pq"] = arg3 + return args, nil } -func (ec *executionContext) _ManagedServiceSpec_tolerations(ctx context.Context, field graphql.CollectedField, obj *model.ManagedServiceSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedServiceSpec_tolerations(ctx, field) - if err != nil { - return graphql.Null +func (ec *executionContext) field_Query_core_listEnvironments_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + args["projectName"] = arg0 + var arg1 *model.SearchEnvironments + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg1, err = ec.unmarshalOSearchEnvironments2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchEnvironments(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Tolerations, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - return graphql.Null + args["search"] = arg1 + var arg2 *repos.CursorPagination + if tmp, ok := rawArgs["pq"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) + arg2, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } } - res := resTmp.([]*model.ManagedServiceSpecTolerations) - fc.Result = res - return ec.marshalOManagedServiceSpecTolerations2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedServiceSpecTolerations(ctx, field.Selections, res) + args["pq"] = arg2 + return args, nil } -func (ec *executionContext) fieldContext_ManagedServiceSpec_tolerations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedServiceSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "effect": - return ec.fieldContext_ManagedServiceSpecTolerations_effect(ctx, field) - case "key": - return ec.fieldContext_ManagedServiceSpecTolerations_key(ctx, field) - case "operator": - return ec.fieldContext_ManagedServiceSpecTolerations_operator(ctx, field) - case "tolerationSeconds": - return ec.fieldContext_ManagedServiceSpecTolerations_tolerationSeconds(ctx, field) - case "value": - return ec.fieldContext_ManagedServiceSpecTolerations_value(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ManagedServiceSpecTolerations", field.Name) - }, +func (ec *executionContext) field_Query_core_listImagePullSecrets_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - return fc, nil -} - -func (ec *executionContext) _ManagedServiceSpecMsvcKind_kind(ctx context.Context, field graphql.CollectedField, obj *model.ManagedServiceSpecMsvcKind) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedServiceSpecMsvcKind_kind(ctx, field) - if err != nil { - return graphql.Null + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + args["envName"] = arg1 + var arg2 *model.SearchImagePullSecrets + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg2, err = ec.unmarshalOSearchImagePullSecrets2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchImagePullSecrets(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - return graphql.Null + args["search"] = arg2 + var arg3 *repos.CursorPagination + if tmp, ok := rawArgs["pq"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) + arg3, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + args["pq"] = arg3 + return args, nil } -func (ec *executionContext) fieldContext_ManagedServiceSpecMsvcKind_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedServiceSpecMsvcKind", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, +func (ec *executionContext) field_Query_core_listManagedResources_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - return fc, nil -} - -func (ec *executionContext) _ManagedServiceSpecMsvcKind_apiVersion(ctx context.Context, field graphql.CollectedField, obj *model.ManagedServiceSpecMsvcKind) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedServiceSpecMsvcKind_apiVersion(ctx, field) - if err != nil { - return graphql.Null + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + args["envName"] = arg1 + var arg2 *model.SearchManagedResources + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg2, err = ec.unmarshalOSearchManagedResources2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchManagedResources(ctx, tmp) + if err != nil { + return nil, err } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.APIVersion, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + args["search"] = arg2 + var arg3 *repos.CursorPagination + if tmp, ok := rawArgs["pq"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) + arg3, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err } - return graphql.Null } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + args["pq"] = arg3 + return args, nil } -func (ec *executionContext) fieldContext_ManagedServiceSpecMsvcKind_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedServiceSpecMsvcKind", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, +func (ec *executionContext) field_Query_core_listProjectManagedServices_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } } - return fc, nil + args["projectName"] = arg0 + var arg1 *model.SearchProjectManagedService + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg1, err = ec.unmarshalOSearchProjectManagedService2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchProjectManagedService(ctx, tmp) + if err != nil { + return nil, err + } + } + args["search"] = arg1 + var arg2 *repos.CursorPagination + if tmp, ok := rawArgs["pq"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) + arg2, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pq"] = arg2 + return args, nil +} + +func (ec *executionContext) field_Query_core_listProjects_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *model.SearchProjects + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg0, err = ec.unmarshalOSearchProjects2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchProjects(ctx, tmp) + if err != nil { + return nil, err + } + } + args["search"] = arg0 + var arg1 *repos.CursorPagination + if tmp, ok := rawArgs["pq"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) + arg1, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pq"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Query_core_listRouters_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["envName"] = arg1 + var arg2 *model.SearchRouters + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg2, err = ec.unmarshalOSearchRouters2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchRouters(ctx, tmp) + if err != nil { + return nil, err + } + } + args["search"] = arg2 + var arg3 *repos.CursorPagination + if tmp, ok := rawArgs["pq"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) + arg3, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pq"] = arg3 + return args, nil +} + +func (ec *executionContext) field_Query_core_listSecrets_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["envName"] = arg1 + var arg2 *model.SearchSecrets + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg2, err = ec.unmarshalOSearchSecrets2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchSecrets(ctx, tmp) + if err != nil { + return nil, err + } + } + args["search"] = arg2 + var arg3 *repos.CursorPagination + if tmp, ok := rawArgs["pq"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) + arg3, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pq"] = arg3 + return args, nil +} + +func (ec *executionContext) field_Query_core_listVPNDevices_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *model.CoreSearchVPNDevices + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg0, err = ec.unmarshalOCoreSearchVPNDevices2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐCoreSearchVPNDevices(ctx, tmp) + if err != nil { + return nil, err + } + } + args["search"] = arg0 + var arg1 *repos.CursorPagination + if tmp, ok := rawArgs["pq"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) + arg1, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pq"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Query_core_restartApp_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["envName"] = arg1 + var arg2 string + if tmp, ok := rawArgs["appName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appName")) + arg2, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["appName"] = arg2 + return args, nil +} + +func (ec *executionContext) field_Query_core_restartProjectManagedService_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Query_core_resyncApp_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["envName"] = arg1 + var arg2 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg2, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg2 + return args, nil +} + +func (ec *executionContext) field_Query_core_resyncConfig_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["envName"] = arg1 + var arg2 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg2, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg2 + return args, nil +} + +func (ec *executionContext) field_Query_core_resyncEnvironment_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Query_core_resyncImagePullSecret_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["envName"] = arg1 + var arg2 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg2, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg2 + return args, nil +} + +func (ec *executionContext) field_Query_core_resyncManagedResource_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["envName"] = arg1 + var arg2 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg2, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg2 + return args, nil +} + +func (ec *executionContext) field_Query_core_resyncProjectManagedService_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Query_core_resyncProject_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_core_resyncRouter_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["envName"] = arg1 + var arg2 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg2, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg2 + return args, nil +} + +func (ec *executionContext) field_Query_core_resyncSecret_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["projectName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["projectName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["envName"] = arg1 + var arg2 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg2, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg2 + 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 } -func (ec *executionContext) _ManagedServiceSpecTolerations_effect(ctx context.Context, field graphql.CollectedField, obj *model.ManagedServiceSpecTolerations) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedServiceSpecTolerations_effect(ctx, field) +// endregion ***************************** args.gotpl ***************************** + +// region ************************** directives.gotpl ************************** + +// endregion ************************** directives.gotpl ************************** + +// region **************************** field.gotpl ***************************** + +func (ec *executionContext) _App_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.App) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_App_accountName(ctx, field) if err != nil { return graphql.Null } @@ -10766,23 +8578,26 @@ func (ec *executionContext) _ManagedServiceSpecTolerations_effect(ctx context.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Effect, nil + return obj.AccountName, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(string) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ManagedServiceSpecTolerations_effect(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_App_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ManagedServiceSpecTolerations", + Object: "App", Field: field, IsMethod: false, IsResolver: false, @@ -10793,8 +8608,8 @@ func (ec *executionContext) fieldContext_ManagedServiceSpecTolerations_effect(ct return fc, nil } -func (ec *executionContext) _ManagedServiceSpecTolerations_key(ctx context.Context, field graphql.CollectedField, obj *model.ManagedServiceSpecTolerations) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedServiceSpecTolerations_key(ctx, field) +func (ec *executionContext) _App_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.App) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_App_apiVersion(ctx, field) if err != nil { return graphql.Null } @@ -10807,7 +8622,7 @@ func (ec *executionContext) _ManagedServiceSpecTolerations_key(ctx context.Conte }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Key, nil + return obj.APIVersion, nil }) if err != nil { ec.Error(ctx, err) @@ -10816,14 +8631,14 @@ func (ec *executionContext) _ManagedServiceSpecTolerations_key(ctx context.Conte if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.(string) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalOString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ManagedServiceSpecTolerations_key(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_App_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ManagedServiceSpecTolerations", + Object: "App", Field: field, IsMethod: false, IsResolver: false, @@ -10834,8 +8649,8 @@ func (ec *executionContext) fieldContext_ManagedServiceSpecTolerations_key(ctx c return fc, nil } -func (ec *executionContext) _ManagedServiceSpecTolerations_operator(ctx context.Context, field graphql.CollectedField, obj *model.ManagedServiceSpecTolerations) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedServiceSpecTolerations_operator(ctx, field) +func (ec *executionContext) _App_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.App) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_App_createdBy(ctx, field) if err != nil { return graphql.Null } @@ -10848,35 +8663,46 @@ func (ec *executionContext) _ManagedServiceSpecTolerations_operator(ctx context. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Operator, nil + return obj.CreatedBy, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(common.CreatedOrUpdatedBy) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ManagedServiceSpecTolerations_operator(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_App_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ManagedServiceSpecTolerations", + Object: "App", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) }, } return fc, nil } -func (ec *executionContext) _ManagedServiceSpecTolerations_tolerationSeconds(ctx context.Context, field graphql.CollectedField, obj *model.ManagedServiceSpecTolerations) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedServiceSpecTolerations_tolerationSeconds(ctx, field) +func (ec *executionContext) _App_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.App) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_App_creationTime(ctx, field) if err != nil { return graphql.Null } @@ -10889,35 +8715,38 @@ func (ec *executionContext) _ManagedServiceSpecTolerations_tolerationSeconds(ctx }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.TolerationSeconds, nil + return ec.resolvers.App().CreationTime(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.(*int) + res := resTmp.(string) fc.Result = res - return ec.marshalOInt2ᚖint(ctx, field.Selections, res) + return ec.marshalNDate2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ManagedServiceSpecTolerations_tolerationSeconds(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_App_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ManagedServiceSpecTolerations", + Object: "App", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type Date does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ManagedServiceSpecTolerations_value(ctx context.Context, field graphql.CollectedField, obj *model.ManagedServiceSpecTolerations) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedServiceSpecTolerations_value(ctx, field) +func (ec *executionContext) _App_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.App) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_App_displayName(ctx, field) if err != nil { return graphql.Null } @@ -10930,23 +8759,26 @@ func (ec *executionContext) _ManagedServiceSpecTolerations_value(ctx context.Con }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Value, nil + 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) + res := resTmp.(string) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ManagedServiceSpecTolerations_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_App_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ManagedServiceSpecTolerations", + Object: "App", Field: field, IsMethod: false, IsResolver: false, @@ -10957,8 +8789,8 @@ func (ec *executionContext) fieldContext_ManagedServiceSpecTolerations_value(ctx return fc, nil } -func (ec *executionContext) _Metadata_name(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Metadata_name(ctx, field) +func (ec *executionContext) _App_enabled(ctx context.Context, field graphql.CollectedField, obj *entities.App) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_App_enabled(ctx, field) if err != nil { return graphql.Null } @@ -10971,38 +8803,35 @@ func (ec *executionContext) _Metadata_name(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.Enabled, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*bool) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Metadata_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_App_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Metadata", + Object: "App", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Metadata_namespace(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Metadata_namespace(ctx, field) +func (ec *executionContext) _App_environmentName(ctx context.Context, field graphql.CollectedField, obj *entities.App) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_App_environmentName(ctx, field) if err != nil { return graphql.Null } @@ -11015,23 +8844,26 @@ func (ec *executionContext) _Metadata_namespace(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Namespace, nil + return obj.EnvironmentName, nil }) if err != nil { ec.Error(ctx, err) 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.marshalOString2string(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Metadata_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_App_environmentName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Metadata", + Object: "App", Field: field, IsMethod: false, IsResolver: false, @@ -11042,8 +8874,8 @@ func (ec *executionContext) fieldContext_Metadata_namespace(ctx context.Context, return fc, nil } -func (ec *executionContext) _Metadata_labels(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Metadata_labels(ctx, field) +func (ec *executionContext) _App_id(ctx context.Context, field graphql.CollectedField, obj *entities.App) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_App_id(ctx, field) if err != nil { return graphql.Null } @@ -11056,35 +8888,38 @@ func (ec *executionContext) _Metadata_labels(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Metadata().Labels(rctx, obj) + return ec.resolvers.App().ID(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.(map[string]interface{}) + res := resTmp.(string) fc.Result = res - return ec.marshalOJson2map(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Metadata_labels(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_App_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Metadata", + Object: "App", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Json does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Metadata_annotations(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Metadata_annotations(ctx, field) +func (ec *executionContext) _App_kind(ctx context.Context, field graphql.CollectedField, obj *entities.App) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_App_kind(ctx, field) if err != nil { return graphql.Null } @@ -11097,7 +8932,7 @@ func (ec *executionContext) _Metadata_annotations(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Metadata().Annotations(rctx, obj) + return obj.Kind, nil }) if err != nil { ec.Error(ctx, err) @@ -11106,26 +8941,26 @@ func (ec *executionContext) _Metadata_annotations(ctx context.Context, field gra if resTmp == nil { return graphql.Null } - res := resTmp.(map[string]interface{}) + res := resTmp.(string) fc.Result = res - return ec.marshalOJson2map(ctx, field.Selections, res) + return ec.marshalOString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Metadata_annotations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_App_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Metadata", + Object: "App", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Json does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Metadata_creationTimestamp(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Metadata_creationTimestamp(ctx, field) +func (ec *executionContext) _App_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.App) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_App_lastUpdatedBy(ctx, field) if err != nil { return graphql.Null } @@ -11138,7 +8973,7 @@ func (ec *executionContext) _Metadata_creationTimestamp(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Metadata().CreationTimestamp(rctx, obj) + return obj.LastUpdatedBy, nil }) if err != nil { ec.Error(ctx, err) @@ -11150,26 +8985,34 @@ func (ec *executionContext) _Metadata_creationTimestamp(ctx context.Context, fie } return graphql.Null } - res := resTmp.(string) + res := resTmp.(common.CreatedOrUpdatedBy) fc.Result = res - return ec.marshalNDate2string(ctx, field.Selections, res) + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Metadata_creationTimestamp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_App_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Metadata", + Object: "App", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Date does not have child fields") + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) }, } return fc, nil } -func (ec *executionContext) _Metadata_deletionTimestamp(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Metadata_deletionTimestamp(ctx, field) +func (ec *executionContext) _App_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.App) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_App_markedForDeletion(ctx, field) if err != nil { return graphql.Null } @@ -11182,7 +9025,7 @@ func (ec *executionContext) _Metadata_deletionTimestamp(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Metadata().DeletionTimestamp(rctx, obj) + return obj.MarkedForDeletion, nil }) if err != nil { ec.Error(ctx, err) @@ -11191,26 +9034,26 @@ func (ec *executionContext) _Metadata_deletionTimestamp(ctx context.Context, fie if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.(*bool) fc.Result = res - return ec.marshalODate2ᚖstring(ctx, field.Selections, res) + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Metadata_deletionTimestamp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_App_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Metadata", + Object: "App", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Date does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Metadata_generation(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Metadata_generation(ctx, field) +func (ec *executionContext) _App_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.App) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_App_metadata(ctx, field) if err != nil { return graphql.Null } @@ -11223,38 +9066,51 @@ func (ec *executionContext) _Metadata_generation(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Generation, nil + return obj.ObjectMeta, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(int64) + res := resTmp.(v12.ObjectMeta) fc.Result = res - return ec.marshalNInt2int64(ctx, field.Selections, res) + return ec.marshalOMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Metadata_generation(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_App_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Metadata", + Object: "App", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "annotations": + return ec.fieldContext_Metadata_annotations(ctx, field) + case "creationTimestamp": + return ec.fieldContext_Metadata_creationTimestamp(ctx, field) + case "deletionTimestamp": + return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) + case "generation": + return ec.fieldContext_Metadata_generation(ctx, field) + case "labels": + return ec.fieldContext_Metadata_labels(ctx, field) + case "name": + return ec.fieldContext_Metadata_name(ctx, field) + case "namespace": + return ec.fieldContext_Metadata_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) }, } return fc, nil } -func (ec *executionContext) _Mutation_core_createProject(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_createProject(ctx, field) +func (ec *executionContext) _App_projectName(ctx context.Context, field graphql.CollectedField, obj *entities.App) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_App_projectName(ctx, field) if err != nil { return graphql.Null } @@ -11266,87 +9122,39 @@ func (ec *executionContext) _Mutation_core_createProject(ctx context.Context, fi } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreCreateProject(rctx, fc.Args["project"].(entities.Project)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*entities.Project); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/console/internal/domain/entities.Project`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.ProjectName, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*entities.Project) + res := resTmp.(string) fc.Result = res - return ec.marshalOProject2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐProject(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_createProject(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_App_projectName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "App", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "apiVersion": - return ec.fieldContext_Project_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_Project_kind(ctx, field) - case "metadata": - return ec.fieldContext_Project_metadata(ctx, field) - case "syncStatus": - return ec.fieldContext_Project_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_Project_spec(ctx, field) - case "status": - return ec.fieldContext_Project_status(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Project", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_createProject_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_core_updateProject(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_updateProject(ctx, field) +func (ec *executionContext) _App_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.App) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_App_recordVersion(ctx, field) if err != nil { return graphql.Null } @@ -11358,87 +9166,39 @@ func (ec *executionContext) _Mutation_core_updateProject(ctx context.Context, fi } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreUpdateProject(rctx, fc.Args["project"].(entities.Project)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*entities.Project); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/console/internal/domain/entities.Project`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.RecordVersion, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*entities.Project) + res := resTmp.(int) fc.Result = res - return ec.marshalOProject2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐProject(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_updateProject(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_App_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "App", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "apiVersion": - return ec.fieldContext_Project_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_Project_kind(ctx, field) - case "metadata": - return ec.fieldContext_Project_metadata(ctx, field) - case "syncStatus": - return ec.fieldContext_Project_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_Project_spec(ctx, field) - case "status": - return ec.fieldContext_Project_status(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Project", field.Name) + return nil, errors.New("field of type Int 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_core_updateProject_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_core_deleteProject(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_deleteProject(ctx, field) +func (ec *executionContext) _App_spec(ctx context.Context, field graphql.CollectedField, obj *entities.App) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_App_spec(ctx, field) if err != nil { return graphql.Null } @@ -11450,34 +9210,8 @@ func (ec *executionContext) _Mutation_core_deleteProject(ctx context.Context, fi } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreDeleteProject(rctx, fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + ctx = rctx // use context from middleware stack in children + return ec.resolvers.App().Spec(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -11489,37 +9223,50 @@ func (ec *executionContext) _Mutation_core_deleteProject(ctx context.Context, fi } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(*model.GithubComKloudliteOperatorApisCrdsV1AppSpec) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNGithub__com___kloudlite___operator___apis___crds___v1__AppSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppSpec(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_deleteProject(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_App_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "App", 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") + switch field.Name { + case "containers": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_containers(ctx, field) + case "displayName": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_displayName(ctx, field) + case "freeze": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_freeze(ctx, field) + case "hpa": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_hpa(ctx, field) + case "intercept": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_intercept(ctx, field) + case "nodeSelector": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_nodeSelector(ctx, field) + case "region": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_region(ctx, field) + case "replicas": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_replicas(ctx, field) + case "serviceAccount": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_serviceAccount(ctx, field) + case "services": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_services(ctx, field) + case "tolerations": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_tolerations(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__AppSpec", field.Name) }, } - defer func() { - if 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_core_deleteProject_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_core_createWorkspace(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_createWorkspace(ctx, field) +func (ec *executionContext) _App_status(ctx context.Context, field graphql.CollectedField, obj *entities.App) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_App_status(ctx, field) if err != nil { return graphql.Null } @@ -11531,34 +9278,8 @@ func (ec *executionContext) _Mutation_core_createWorkspace(ctx context.Context, } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreCreateWorkspace(rctx, fc.Args["env"].(entities.Workspace)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*entities.Workspace); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/console/internal/domain/entities.Workspace`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.Status, nil }) if err != nil { ec.Error(ctx, err) @@ -11567,51 +9288,40 @@ func (ec *executionContext) _Mutation_core_createWorkspace(ctx context.Context, if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.Workspace) + res := resTmp.(operator.Status) fc.Result = res - return ec.marshalOWorkspace2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐWorkspace(ctx, field.Selections, res) + return ec.marshalOGithub__com___kloudlite___operator___pkg___operator__Status2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_createWorkspace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_App_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "App", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "metadata": - return ec.fieldContext_Workspace_metadata(ctx, field) - case "syncStatus": - return ec.fieldContext_Workspace_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_Workspace_spec(ctx, field) - case "status": - return ec.fieldContext_Workspace_status(ctx, field) - case "apiVersion": - return ec.fieldContext_Workspace_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_Workspace_kind(ctx, field) + case "checks": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx, field) + case "isReady": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_isReady(ctx, field) + case "lastReadyGeneration": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReadyGeneration(ctx, field) + case "lastReconcileTime": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReconcileTime(ctx, field) + case "message": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_message(ctx, field) + case "resources": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_resources(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Workspace", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___pkg___operator__Status", field.Name) }, } - defer func() { - if 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_core_createWorkspace_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_core_updateWorkspace(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_updateWorkspace(ctx, field) +func (ec *executionContext) _App_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.App) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_App_syncStatus(ctx, field) if err != nil { return graphql.Null } @@ -11623,87 +9333,53 @@ func (ec *executionContext) _Mutation_core_updateWorkspace(ctx context.Context, } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreUpdateWorkspace(rctx, fc.Args["env"].(entities.Workspace)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*entities.Workspace); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/console/internal/domain/entities.Workspace`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.SyncStatus, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*entities.Workspace) + res := resTmp.(types.SyncStatus) fc.Result = res - return ec.marshalOWorkspace2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐWorkspace(ctx, field.Selections, res) + return ec.marshalNGithub__com___kloudlite___api___pkg___types__SyncStatus2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_updateWorkspace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_App_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "App", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "metadata": - return ec.fieldContext_Workspace_metadata(ctx, field) - case "syncStatus": - return ec.fieldContext_Workspace_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_Workspace_spec(ctx, field) - case "status": - return ec.fieldContext_Workspace_status(ctx, field) - case "apiVersion": - return ec.fieldContext_Workspace_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_Workspace_kind(ctx, field) + case "action": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx, field) + case "error": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx, field) + case "lastSyncedAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx, field) + case "recordVersion": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx, field) + case "state": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx, field) + case "syncScheduledAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Workspace", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___pkg___types__SyncStatus", field.Name) }, } - defer func() { - if 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_core_updateWorkspace_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_core_deleteWorkspace(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_deleteWorkspace(ctx, field) +func (ec *executionContext) _App_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.App) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_App_updateTime(ctx, field) if err != nil { return graphql.Null } @@ -11715,34 +9391,8 @@ func (ec *executionContext) _Mutation_core_deleteWorkspace(ctx context.Context, } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreDeleteWorkspace(rctx, fc.Args["namespace"].(string), fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + ctx = rctx // use context from middleware stack in children + return ec.resolvers.App().UpdateTime(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -11754,37 +9404,26 @@ func (ec *executionContext) _Mutation_core_deleteWorkspace(ctx context.Context, } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNDate2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_deleteWorkspace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_App_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "App", 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") + return nil, errors.New("field of type Date 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_core_deleteWorkspace_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_core_createApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_createApp(ctx, field) +func (ec *executionContext) _AppEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.AppEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AppEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -11796,93 +9435,39 @@ func (ec *executionContext) _Mutation_core_createApp(ctx context.Context, field } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreCreateApp(rctx, fc.Args["app"].(entities.App)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*entities.App); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/console/internal/domain/entities.App`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.Cursor, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*entities.App) + res := resTmp.(string) fc.Result = res - return ec.marshalOApp2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐApp(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_createApp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_AppEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "AppEdge", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext_App_kind(ctx, field) - case "metadata": - return ec.fieldContext_App_metadata(ctx, field) - case "overrides": - return ec.fieldContext_App_overrides(ctx, field) - case "restart": - return ec.fieldContext_App_restart(ctx, field) - case "syncStatus": - return ec.fieldContext_App_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_App_spec(ctx, field) - case "status": - return ec.fieldContext_App_status(ctx, field) - case "apiVersion": - return ec.fieldContext_App_apiVersion(ctx, field) - case "enabled": - return ec.fieldContext_App_enabled(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type App", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_createApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_core_updateApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_updateApp(ctx, field) +func (ec *executionContext) _AppEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.AppEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AppEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -11894,93 +9479,77 @@ func (ec *executionContext) _Mutation_core_updateApp(ctx context.Context, field } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreUpdateApp(rctx, fc.Args["app"].(entities.App)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*entities.App); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/console/internal/domain/entities.App`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.Node, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } res := resTmp.(*entities.App) fc.Result = res - return ec.marshalOApp2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐApp(ctx, field.Selections, res) + return ec.marshalNApp2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐApp(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_updateApp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_AppEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "AppEdge", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { + case "accountName": + return ec.fieldContext_App_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_App_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_App_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_App_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_App_displayName(ctx, field) + case "enabled": + return ec.fieldContext_App_enabled(ctx, field) + case "environmentName": + return ec.fieldContext_App_environmentName(ctx, field) + case "id": + return ec.fieldContext_App_id(ctx, field) case "kind": return ec.fieldContext_App_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_App_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_App_markedForDeletion(ctx, field) case "metadata": return ec.fieldContext_App_metadata(ctx, field) - case "overrides": - return ec.fieldContext_App_overrides(ctx, field) - case "restart": - return ec.fieldContext_App_restart(ctx, field) - case "syncStatus": - return ec.fieldContext_App_syncStatus(ctx, field) + case "projectName": + return ec.fieldContext_App_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_App_recordVersion(ctx, field) case "spec": return ec.fieldContext_App_spec(ctx, field) case "status": return ec.fieldContext_App_status(ctx, field) - case "apiVersion": - return ec.fieldContext_App_apiVersion(ctx, field) - case "enabled": - return ec.fieldContext_App_enabled(ctx, field) + case "syncStatus": + return ec.fieldContext_App_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_App_updateTime(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type App", field.Name) }, } - defer func() { - if 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_core_updateApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_core_deleteApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_deleteApp(ctx, field) +func (ec *executionContext) _AppPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.AppPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AppPaginatedRecords_edges(ctx, field) if err != nil { return graphql.Null } @@ -11992,34 +9561,8 @@ func (ec *executionContext) _Mutation_core_deleteApp(ctx context.Context, field } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreDeleteApp(rctx, fc.Args["namespace"].(string), fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil }) if err != nil { ec.Error(ctx, err) @@ -12031,37 +9574,32 @@ func (ec *executionContext) _Mutation_core_deleteApp(ctx context.Context, field } return graphql.Null } - res := resTmp.(bool) + res := resTmp.([]*model.AppEdge) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNAppEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppEdgeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_deleteApp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_AppPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "AppPaginatedRecords", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "cursor": + return ec.fieldContext_AppEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_AppEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type AppEdge", field.Name) }, } - defer func() { - if 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_core_deleteApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_core_createConfig(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_createConfig(ctx, field) +func (ec *executionContext) _AppPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.AppPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AppPaginatedRecords_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -12073,91 +9611,49 @@ func (ec *executionContext) _Mutation_core_createConfig(ctx context.Context, fie } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreCreateConfig(rctx, fc.Args["config"].(entities.Config)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*entities.Config); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/console/internal/domain/entities.Config`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*entities.Config) + res := resTmp.(*model.PageInfo) fc.Result = res - return ec.marshalOConfig2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐConfig(ctx, field.Selections, res) + return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_createConfig(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_AppPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "AppPaginatedRecords", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "enabled": - return ec.fieldContext_Config_enabled(ctx, field) - case "kind": - return ec.fieldContext_Config_kind(ctx, field) - case "metadata": - return ec.fieldContext_Config_metadata(ctx, field) - case "overrides": - return ec.fieldContext_Config_overrides(ctx, field) - case "status": - return ec.fieldContext_Config_status(ctx, field) - case "apiVersion": - return ec.fieldContext_Config_apiVersion(ctx, field) - case "syncStatus": - return ec.fieldContext_Config_syncStatus(ctx, field) - case "data": - return ec.fieldContext_Config_data(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Config", field.Name) + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) }, } - defer func() { - if 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_core_createConfig_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_core_updateConfig(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_updateConfig(ctx, field) +func (ec *executionContext) _AppPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.AppPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AppPaginatedRecords_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -12169,91 +9665,39 @@ func (ec *executionContext) _Mutation_core_updateConfig(ctx context.Context, fie } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreUpdateConfig(rctx, fc.Args["config"].(entities.Config)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*entities.Config); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/console/internal/domain/entities.Config`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.TotalCount, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*entities.Config) + res := resTmp.(int) fc.Result = res - return ec.marshalOConfig2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐConfig(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_updateConfig(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_AppPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "AppPaginatedRecords", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "enabled": - return ec.fieldContext_Config_enabled(ctx, field) - case "kind": - return ec.fieldContext_Config_kind(ctx, field) - case "metadata": - return ec.fieldContext_Config_metadata(ctx, field) - case "overrides": - return ec.fieldContext_Config_overrides(ctx, field) - case "status": - return ec.fieldContext_Config_status(ctx, field) - case "apiVersion": - return ec.fieldContext_Config_apiVersion(ctx, field) - case "syncStatus": - return ec.fieldContext_Config_syncStatus(ctx, field) - case "data": - return ec.fieldContext_Config_data(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Config", field.Name) + return nil, errors.New("field of type Int 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_core_updateConfig_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_core_deleteConfig(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_deleteConfig(ctx, field) +func (ec *executionContext) _Config_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.Config) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Config_accountName(ctx, field) if err != nil { return graphql.Null } @@ -12265,34 +9709,8 @@ func (ec *executionContext) _Mutation_core_deleteConfig(ctx context.Context, fie } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreDeleteConfig(rctx, fc.Args["namespace"].(string), fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil }) if err != nil { ec.Error(ctx, err) @@ -12304,37 +9722,67 @@ func (ec *executionContext) _Mutation_core_deleteConfig(ctx context.Context, fie } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_deleteConfig(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Config_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Config", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } + return fc, nil +} + +func (ec *executionContext) _Config_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Config) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Config_apiVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null } }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_deleteConfig_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.APIVersion, nil + }) + if err != nil { ec.Error(ctx, err) - return + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Config_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Config", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, } return fc, nil } -func (ec *executionContext) _Mutation_core_createSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_createSecret(ctx, field) +func (ec *executionContext) _Config_binaryData(ctx context.Context, field graphql.CollectedField, obj *entities.Config) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Config_binaryData(ctx, field) if err != nil { return graphql.Null } @@ -12346,34 +9794,8 @@ func (ec *executionContext) _Mutation_core_createSecret(ctx context.Context, fie } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreCreateSecret(rctx, fc.Args["secret"].(entities.Secret)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*entities.Secret); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/console/internal/domain/entities.Secret`, tmp) + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Config().BinaryData(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -12382,61 +9804,26 @@ func (ec *executionContext) _Mutation_core_createSecret(ctx context.Context, fie if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.Secret) + res := resTmp.(map[string]interface{}) fc.Result = res - return ec.marshalOSecret2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐSecret(ctx, field.Selections, res) + return ec.marshalOMap2map(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_createSecret(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Config_binaryData(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Config", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "syncStatus": - return ec.fieldContext_Secret_syncStatus(ctx, field) - case "data": - return ec.fieldContext_Secret_data(ctx, field) - case "enabled": - return ec.fieldContext_Secret_enabled(ctx, field) - case "kind": - return ec.fieldContext_Secret_kind(ctx, field) - case "metadata": - return ec.fieldContext_Secret_metadata(ctx, field) - case "projectName": - return ec.fieldContext_Secret_projectName(ctx, field) - case "status": - return ec.fieldContext_Secret_status(ctx, field) - case "apiVersion": - return ec.fieldContext_Secret_apiVersion(ctx, field) - case "overrides": - return ec.fieldContext_Secret_overrides(ctx, field) - case "stringData": - return ec.fieldContext_Secret_stringData(ctx, field) - case "type": - return ec.fieldContext_Secret_type(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Secret", field.Name) + return nil, errors.New("field of type Map 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_core_createSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_core_updateSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_updateSecret(ctx, field) +func (ec *executionContext) _Config_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.Config) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Config_createdBy(ctx, field) if err != nil { return graphql.Null } @@ -12448,97 +9835,47 @@ func (ec *executionContext) _Mutation_core_updateSecret(ctx context.Context, fie } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreUpdateSecret(rctx, fc.Args["secret"].(entities.Secret)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*entities.Secret); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/console/internal/domain/entities.Secret`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*entities.Secret) + res := resTmp.(common.CreatedOrUpdatedBy) fc.Result = res - return ec.marshalOSecret2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐSecret(ctx, field.Selections, res) + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_updateSecret(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Config_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Config", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "syncStatus": - return ec.fieldContext_Secret_syncStatus(ctx, field) - case "data": - return ec.fieldContext_Secret_data(ctx, field) - case "enabled": - return ec.fieldContext_Secret_enabled(ctx, field) - case "kind": - return ec.fieldContext_Secret_kind(ctx, field) - case "metadata": - return ec.fieldContext_Secret_metadata(ctx, field) - case "projectName": - return ec.fieldContext_Secret_projectName(ctx, field) - case "status": - return ec.fieldContext_Secret_status(ctx, field) - case "apiVersion": - return ec.fieldContext_Secret_apiVersion(ctx, field) - case "overrides": - return ec.fieldContext_Secret_overrides(ctx, field) - case "stringData": - return ec.fieldContext_Secret_stringData(ctx, field) - case "type": - return ec.fieldContext_Secret_type(ctx, field) + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Secret", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) }, } - defer func() { - if 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_core_updateSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_core_deleteSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_deleteSecret(ctx, field) +func (ec *executionContext) _Config_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.Config) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Config_creationTime(ctx, field) if err != nil { return graphql.Null } @@ -12550,34 +9887,8 @@ func (ec *executionContext) _Mutation_core_deleteSecret(ctx context.Context, fie } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreDeleteSecret(rctx, fc.Args["namespace"].(string), fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Config().CreationTime(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -12589,37 +9900,26 @@ func (ec *executionContext) _Mutation_core_deleteSecret(ctx context.Context, fie } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNDate2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_deleteSecret(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Config_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Config", 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") + return nil, errors.New("field of type Date 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_core_deleteSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_core_createRouter(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_createRouter(ctx, field) +func (ec *executionContext) _Config_data(ctx context.Context, field graphql.CollectedField, obj *entities.Config) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Config_data(ctx, field) if err != nil { return graphql.Null } @@ -12631,34 +9931,8 @@ func (ec *executionContext) _Mutation_core_createRouter(ctx context.Context, fie } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreCreateRouter(rctx, fc.Args["router"].(entities.Router)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*entities.Router); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/console/internal/domain/entities.Router`, tmp) + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Config().Data(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -12667,53 +9941,26 @@ func (ec *executionContext) _Mutation_core_createRouter(ctx context.Context, fie if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.Router) + res := resTmp.(map[string]interface{}) fc.Result = res - return ec.marshalORouter2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐRouter(ctx, field.Selections, res) + return ec.marshalOMap2map(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_createRouter(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Config_data(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Config", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "apiVersion": - return ec.fieldContext_Router_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_Router_kind(ctx, field) - case "metadata": - return ec.fieldContext_Router_metadata(ctx, field) - case "overrides": - return ec.fieldContext_Router_overrides(ctx, field) - case "syncStatus": - return ec.fieldContext_Router_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_Router_spec(ctx, field) - case "status": - return ec.fieldContext_Router_status(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Router", field.Name) + return nil, errors.New("field of type Map 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_core_createRouter_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_core_updateRouter(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_updateRouter(ctx, field) +func (ec *executionContext) _Config_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.Config) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Config_displayName(ctx, field) if err != nil { return graphql.Null } @@ -12725,89 +9972,39 @@ func (ec *executionContext) _Mutation_core_updateRouter(ctx context.Context, fie } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreUpdateRouter(rctx, fc.Args["router"].(entities.Router)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*entities.Router); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/console/internal/domain/entities.Router`, tmp) + 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.(*entities.Router) + res := resTmp.(string) fc.Result = res - return ec.marshalORouter2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐRouter(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_updateRouter(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Config_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Config", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "apiVersion": - return ec.fieldContext_Router_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_Router_kind(ctx, field) - case "metadata": - return ec.fieldContext_Router_metadata(ctx, field) - case "overrides": - return ec.fieldContext_Router_overrides(ctx, field) - case "syncStatus": - return ec.fieldContext_Router_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_Router_spec(ctx, field) - case "status": - return ec.fieldContext_Router_status(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Router", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_updateRouter_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_core_deleteRouter(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_deleteRouter(ctx, field) +func (ec *executionContext) _Config_environmentName(ctx context.Context, field graphql.CollectedField, obj *entities.Config) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Config_environmentName(ctx, field) if err != nil { return graphql.Null } @@ -12819,34 +10016,8 @@ func (ec *executionContext) _Mutation_core_deleteRouter(ctx context.Context, fie } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreDeleteRouter(rctx, fc.Args["namespace"].(string), fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.EnvironmentName, nil }) if err != nil { ec.Error(ctx, err) @@ -12858,37 +10029,26 @@ func (ec *executionContext) _Mutation_core_deleteRouter(ctx context.Context, fie } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_deleteRouter(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Config_environmentName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Config", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_deleteRouter_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_core_createManagedService(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_createManagedService(ctx, field) +func (ec *executionContext) _Config_id(ctx context.Context, field graphql.CollectedField, obj *entities.Config) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Config_id(ctx, field) if err != nil { return graphql.Null } @@ -12900,91 +10060,39 @@ func (ec *executionContext) _Mutation_core_createManagedService(ctx context.Cont } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreCreateManagedService(rctx, fc.Args["msvc"].(entities.MSvc)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*entities.MSvc); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/console/internal/domain/entities.MSvc`, tmp) + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Config().ID(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.(*entities.MSvc) + res := resTmp.(string) fc.Result = res - return ec.marshalOManagedService2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐMSvc(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_createManagedService(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Config_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Config", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "overrides": - return ec.fieldContext_ManagedService_overrides(ctx, field) - case "syncStatus": - return ec.fieldContext_ManagedService_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_ManagedService_spec(ctx, field) - case "status": - return ec.fieldContext_ManagedService_status(ctx, field) - case "apiVersion": - return ec.fieldContext_ManagedService_apiVersion(ctx, field) - case "enabled": - return ec.fieldContext_ManagedService_enabled(ctx, field) - case "kind": - return ec.fieldContext_ManagedService_kind(ctx, field) - case "metadata": - return ec.fieldContext_ManagedService_metadata(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ManagedService", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_createManagedService_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_core_updateManagedService(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_updateManagedService(ctx, field) +func (ec *executionContext) _Config_immutable(ctx context.Context, field graphql.CollectedField, obj *entities.Config) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Config_immutable(ctx, field) if err != nil { return graphql.Null } @@ -12996,34 +10104,8 @@ func (ec *executionContext) _Mutation_core_updateManagedService(ctx context.Cont } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreUpdateManagedService(rctx, fc.Args["msvc"].(entities.MSvc)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*entities.MSvc); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/console/internal/domain/entities.MSvc`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.Immutable, nil }) if err != nil { ec.Error(ctx, err) @@ -13032,55 +10114,26 @@ func (ec *executionContext) _Mutation_core_updateManagedService(ctx context.Cont if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.MSvc) + res := resTmp.(*bool) fc.Result = res - return ec.marshalOManagedService2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐMSvc(ctx, field.Selections, res) + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_updateManagedService(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Config_immutable(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Config", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "overrides": - return ec.fieldContext_ManagedService_overrides(ctx, field) - case "syncStatus": - return ec.fieldContext_ManagedService_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_ManagedService_spec(ctx, field) - case "status": - return ec.fieldContext_ManagedService_status(ctx, field) - case "apiVersion": - return ec.fieldContext_ManagedService_apiVersion(ctx, field) - case "enabled": - return ec.fieldContext_ManagedService_enabled(ctx, field) - case "kind": - return ec.fieldContext_ManagedService_kind(ctx, field) - case "metadata": - return ec.fieldContext_ManagedService_metadata(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ManagedService", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_updateManagedService_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_core_deleteManagedService(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_deleteManagedService(ctx, field) +func (ec *executionContext) _Config_kind(ctx context.Context, field graphql.CollectedField, obj *entities.Config) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Config_kind(ctx, field) if err != nil { return graphql.Null } @@ -13092,76 +10145,36 @@ func (ec *executionContext) _Mutation_core_deleteManagedService(ctx context.Cont } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreDeleteManagedService(rctx, fc.Args["namespace"].(string), fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + 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.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalOString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_deleteManagedService(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Config_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Config", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_deleteManagedService_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_core_createManagedResource(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_createManagedResource(ctx, field) +func (ec *executionContext) _Config_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.Config) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Config_lastUpdatedBy(ctx, field) if err != nil { return graphql.Null } @@ -13173,91 +10186,47 @@ func (ec *executionContext) _Mutation_core_createManagedResource(ctx context.Con } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreCreateManagedResource(rctx, fc.Args["mres"].(entities.MRes)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*entities.MRes); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/console/internal/domain/entities.MRes`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.LastUpdatedBy, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*entities.MRes) + res := resTmp.(common.CreatedOrUpdatedBy) fc.Result = res - return ec.marshalOManagedResource2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐMRes(ctx, field.Selections, res) + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_createManagedResource(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Config_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Config", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "overrides": - return ec.fieldContext_ManagedResource_overrides(ctx, field) - case "syncStatus": - return ec.fieldContext_ManagedResource_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_ManagedResource_spec(ctx, field) - case "status": - return ec.fieldContext_ManagedResource_status(ctx, field) - case "apiVersion": - return ec.fieldContext_ManagedResource_apiVersion(ctx, field) - case "enabled": - return ec.fieldContext_ManagedResource_enabled(ctx, field) - case "kind": - return ec.fieldContext_ManagedResource_kind(ctx, field) - case "metadata": - return ec.fieldContext_ManagedResource_metadata(ctx, field) + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ManagedResource", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) }, } - defer func() { - if 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_core_createManagedResource_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_core_updateManagedResource(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_updateManagedResource(ctx, field) +func (ec *executionContext) _Config_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.Config) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Config_markedForDeletion(ctx, field) if err != nil { return graphql.Null } @@ -13269,34 +10238,8 @@ func (ec *executionContext) _Mutation_core_updateManagedResource(ctx context.Con } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreUpdateManagedResource(rctx, fc.Args["mres"].(entities.MRes)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*entities.MRes); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/console/internal/domain/entities.MRes`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.MarkedForDeletion, nil }) if err != nil { ec.Error(ctx, err) @@ -13305,55 +10248,26 @@ func (ec *executionContext) _Mutation_core_updateManagedResource(ctx context.Con if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.MRes) + res := resTmp.(*bool) fc.Result = res - return ec.marshalOManagedResource2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐMRes(ctx, field.Selections, res) + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_updateManagedResource(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Config_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Config", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "overrides": - return ec.fieldContext_ManagedResource_overrides(ctx, field) - case "syncStatus": - return ec.fieldContext_ManagedResource_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_ManagedResource_spec(ctx, field) - case "status": - return ec.fieldContext_ManagedResource_status(ctx, field) - case "apiVersion": - return ec.fieldContext_ManagedResource_apiVersion(ctx, field) - case "enabled": - return ec.fieldContext_ManagedResource_enabled(ctx, field) - case "kind": - return ec.fieldContext_ManagedResource_kind(ctx, field) - case "metadata": - return ec.fieldContext_ManagedResource_metadata(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ManagedResource", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_updateManagedResource_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Mutation_core_deleteManagedResource(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_deleteManagedResource(ctx, field) +func (ec *executionContext) _Config_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.Config) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Config_metadata(ctx, field) if err != nil { return graphql.Null } @@ -13365,76 +10279,52 @@ func (ec *executionContext) _Mutation_core_deleteManagedResource(ctx context.Con } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreDeleteManagedResource(rctx, fc.Args["namespace"].(string), fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.ObjectMeta, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(v12.ObjectMeta) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalOMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_deleteManagedResource(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Config_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Config", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "annotations": + return ec.fieldContext_Metadata_annotations(ctx, field) + case "creationTimestamp": + return ec.fieldContext_Metadata_creationTimestamp(ctx, field) + case "deletionTimestamp": + return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) + case "generation": + return ec.fieldContext_Metadata_generation(ctx, field) + case "labels": + return ec.fieldContext_Metadata_labels(ctx, field) + case "name": + return ec.fieldContext_Metadata_name(ctx, field) + case "namespace": + return ec.fieldContext_Metadata_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) }, } - defer func() { - if 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_core_deleteManagedResource_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Overrides_applied(ctx context.Context, field graphql.CollectedField, obj *v11.JsonPatch) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Overrides_applied(ctx, field) +func (ec *executionContext) _Config_projectName(ctx context.Context, field graphql.CollectedField, obj *entities.Config) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Config_projectName(ctx, field) if err != nil { return graphql.Null } @@ -13447,35 +10337,38 @@ func (ec *executionContext) _Overrides_applied(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Applied, nil + return obj.ProjectName, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalOBoolean2bool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Overrides_applied(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Config_projectName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Overrides", + Object: "Config", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Overrides_patches(ctx context.Context, field graphql.CollectedField, obj *v11.JsonPatch) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Overrides_patches(ctx, field) +func (ec *executionContext) _Config_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Config) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Config_recordVersion(ctx, field) if err != nil { return graphql.Null } @@ -13488,43 +10381,38 @@ func (ec *executionContext) _Overrides_patches(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Patches, nil + return obj.RecordVersion, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]json_patch.PatchOperation) + res := resTmp.(int) fc.Result = res - return ec.marshalOPatch2ᚕgithubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋjsonᚑpatchᚐPatchOperationᚄ(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Overrides_patches(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Config_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Overrides", + Object: "Config", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "op": - return ec.fieldContext_Patch_op(ctx, field) - case "path": - return ec.fieldContext_Patch_path(ctx, field) - case "value": - return ec.fieldContext_Patch_value(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Patch", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Patch_op(ctx context.Context, field graphql.CollectedField, obj *json_patch.PatchOperation) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Patch_op(ctx, field) +func (ec *executionContext) _Config_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.Config) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Config_syncStatus(ctx, field) if err != nil { return graphql.Null } @@ -13537,7 +10425,7 @@ func (ec *executionContext) _Patch_op(ctx context.Context, field graphql.Collect }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Op, nil + return obj.SyncStatus, nil }) if err != nil { ec.Error(ctx, err) @@ -13549,26 +10437,40 @@ func (ec *executionContext) _Patch_op(ctx context.Context, field graphql.Collect } return graphql.Null } - res := resTmp.(string) + res := resTmp.(types.SyncStatus) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNGithub__com___kloudlite___api___pkg___types__SyncStatus2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Patch_op(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Config_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Patch", + Object: "Config", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "action": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx, field) + case "error": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx, field) + case "lastSyncedAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx, field) + case "recordVersion": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx, field) + case "state": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx, field) + case "syncScheduledAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___pkg___types__SyncStatus", field.Name) }, } return fc, nil } -func (ec *executionContext) _Patch_path(ctx context.Context, field graphql.CollectedField, obj *json_patch.PatchOperation) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Patch_path(ctx, field) +func (ec *executionContext) _Config_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.Config) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Config_updateTime(ctx, field) if err != nil { return graphql.Null } @@ -13581,7 +10483,7 @@ func (ec *executionContext) _Patch_path(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Path, nil + return ec.resolvers.Config().UpdateTime(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -13595,24 +10497,24 @@ func (ec *executionContext) _Patch_path(ctx context.Context, field graphql.Colle } res := resTmp.(string) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNDate2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Patch_path(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Config_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Patch", + Object: "Config", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Date does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Patch_value(ctx context.Context, field graphql.CollectedField, obj *json_patch.PatchOperation) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Patch_value(ctx, field) +func (ec *executionContext) _ConfigEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.ConfigEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConfigEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -13625,35 +10527,38 @@ func (ec *executionContext) _Patch_value(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Patch().Value(rctx, obj) + return obj.Cursor, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(interface{}) + res := resTmp.(string) fc.Result = res - return ec.marshalOAny2interface(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Patch_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConfigEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Patch", + Object: "ConfigEdge", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Any does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Project_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_apiVersion(ctx, field) +func (ec *executionContext) _ConfigEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.ConfigEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConfigEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -13666,35 +10571,76 @@ func (ec *executionContext) _Project_apiVersion(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.APIVersion, nil + return obj.Node, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*entities.Config) fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + return ec.marshalNConfig2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConfig(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Project_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConfigEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Project", + Object: "ConfigEdge", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "accountName": + return ec.fieldContext_Config_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Config_apiVersion(ctx, field) + case "binaryData": + return ec.fieldContext_Config_binaryData(ctx, field) + case "createdBy": + return ec.fieldContext_Config_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Config_creationTime(ctx, field) + case "data": + return ec.fieldContext_Config_data(ctx, field) + case "displayName": + return ec.fieldContext_Config_displayName(ctx, field) + case "environmentName": + return ec.fieldContext_Config_environmentName(ctx, field) + case "id": + return ec.fieldContext_Config_id(ctx, field) + case "immutable": + return ec.fieldContext_Config_immutable(ctx, field) + case "kind": + return ec.fieldContext_Config_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Config_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Config_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Config_metadata(ctx, field) + case "projectName": + return ec.fieldContext_Config_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_Config_recordVersion(ctx, field) + case "syncStatus": + return ec.fieldContext_Config_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_Config_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Config", field.Name) }, } return fc, nil } -func (ec *executionContext) _Project_kind(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_kind(ctx, field) +func (ec *executionContext) _ConfigKeyRef_configName(ctx context.Context, field graphql.CollectedField, obj *model.ConfigKeyRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConfigKeyRef_configName(ctx, field) if err != nil { return graphql.Null } @@ -13707,23 +10653,26 @@ func (ec *executionContext) _Project_kind(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Kind, nil + return obj.ConfigName, nil }) if err != nil { ec.Error(ctx, err) 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.marshalOString2string(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Project_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConfigKeyRef_configName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Project", + Object: "ConfigKeyRef", Field: field, IsMethod: false, IsResolver: false, @@ -13734,8 +10683,8 @@ func (ec *executionContext) fieldContext_Project_kind(ctx context.Context, field return fc, nil } -func (ec *executionContext) _Project_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_metadata(ctx, field) +func (ec *executionContext) _ConfigKeyRef_key(ctx context.Context, field graphql.CollectedField, obj *model.ConfigKeyRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConfigKeyRef_key(ctx, field) if err != nil { return graphql.Null } @@ -13748,7 +10697,7 @@ func (ec *executionContext) _Project_metadata(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ObjectMeta, nil + return obj.Key, nil }) if err != nil { ec.Error(ctx, err) @@ -13760,42 +10709,26 @@ func (ec *executionContext) _Project_metadata(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(v1.ObjectMeta) + res := resTmp.(string) fc.Result = res - return ec.marshalNMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Project_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConfigKeyRef_key(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Project", + Object: "ConfigKeyRef", 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_Metadata_name(ctx, field) - case "namespace": - return ec.fieldContext_Metadata_namespace(ctx, field) - case "labels": - return ec.fieldContext_Metadata_labels(ctx, field) - case "annotations": - return ec.fieldContext_Metadata_annotations(ctx, field) - case "creationTimestamp": - return ec.fieldContext_Metadata_creationTimestamp(ctx, field) - case "deletionTimestamp": - return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) - case "generation": - return ec.fieldContext_Metadata_generation(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Project_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_syncStatus(ctx, field) +func (ec *executionContext) _ConfigKeyValueRef_configName(ctx context.Context, field graphql.CollectedField, obj *domain.ConfigKeyValueRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConfigKeyValueRef_configName(ctx, field) if err != nil { return graphql.Null } @@ -13808,49 +10741,38 @@ func (ec *executionContext) _Project_syncStatus(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.SyncStatus, nil + return obj.ConfigName, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(types.SyncStatus) + res := resTmp.(string) fc.Result = res - return ec.marshalOSyncStatus2kloudliteᚗioᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Project_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConfigKeyValueRef_configName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Project", + Object: "ConfigKeyValueRef", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "syncScheduledAt": - return ec.fieldContext_SyncStatus_syncScheduledAt(ctx, field) - case "lastSyncedAt": - return ec.fieldContext_SyncStatus_lastSyncedAt(ctx, field) - case "action": - return ec.fieldContext_SyncStatus_action(ctx, field) - case "generation": - return ec.fieldContext_SyncStatus_generation(ctx, field) - case "state": - return ec.fieldContext_SyncStatus_state(ctx, field) - case "error": - return ec.fieldContext_SyncStatus_error(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type SyncStatus", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Project_spec(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_spec(ctx, field) +func (ec *executionContext) _ConfigKeyValueRef_key(ctx context.Context, field graphql.CollectedField, obj *domain.ConfigKeyValueRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConfigKeyValueRef_key(ctx, field) if err != nil { return graphql.Null } @@ -13863,47 +10785,38 @@ func (ec *executionContext) _Project_spec(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Project().Spec(rctx, obj) + return obj.Key, nil }) if err != nil { ec.Error(ctx, 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.ProjectSpec) + res := resTmp.(string) fc.Result = res - return ec.marshalOProjectSpec2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐProjectSpec(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Project_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConfigKeyValueRef_key(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Project", + Object: "ConfigKeyValueRef", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "displayName": - return ec.fieldContext_ProjectSpec_displayName(ctx, field) - case "logo": - return ec.fieldContext_ProjectSpec_logo(ctx, field) - case "targetNamespace": - return ec.fieldContext_ProjectSpec_targetNamespace(ctx, field) - case "accountName": - return ec.fieldContext_ProjectSpec_accountName(ctx, field) - case "clusterName": - return ec.fieldContext_ProjectSpec_clusterName(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ProjectSpec", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Project_status(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_status(ctx, field) +func (ec *executionContext) _ConfigKeyValueRef_value(ctx context.Context, field graphql.CollectedField, obj *domain.ConfigKeyValueRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConfigKeyValueRef_value(ctx, field) if err != nil { return graphql.Null } @@ -13916,43 +10829,38 @@ func (ec *executionContext) _Project_status(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Status, nil + return obj.Value, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(operator.Status) + res := resTmp.(string) fc.Result = res - return ec.marshalOStatus2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Project_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConfigKeyValueRef_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Project", + Object: "ConfigKeyValueRef", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "isReady": - return ec.fieldContext_Status_isReady(ctx, field) - case "checks": - return ec.fieldContext_Status_checks(ctx, field) - case "displayVars": - return ec.fieldContext_Status_displayVars(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Status", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ProjectSpec_displayName(ctx context.Context, field graphql.CollectedField, obj *model.ProjectSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectSpec_displayName(ctx, field) +func (ec *executionContext) _ConfigPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.ConfigPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConfigPaginatedRecords_edges(ctx, field) if err != nil { return graphql.Null } @@ -13965,35 +10873,44 @@ func (ec *executionContext) _ProjectSpec_displayName(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.DisplayName, nil + return obj.Edges, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.([]*model.ConfigEdge) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNConfigEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐConfigEdgeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ProjectSpec_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConfigPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ProjectSpec", + Object: "ConfigPaginatedRecords", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "cursor": + return ec.fieldContext_ConfigEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_ConfigEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ConfigEdge", field.Name) }, } return fc, nil } -func (ec *executionContext) _ProjectSpec_logo(ctx context.Context, field graphql.CollectedField, obj *model.ProjectSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectSpec_logo(ctx, field) +func (ec *executionContext) _ConfigPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.ConfigPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConfigPaginatedRecords_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -14006,35 +10923,48 @@ func (ec *executionContext) _ProjectSpec_logo(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Logo, nil + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(*model.PageInfo) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ProjectSpec_logo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConfigPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ProjectSpec", + Object: "ConfigPaginatedRecords", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) }, } return fc, nil } -func (ec *executionContext) _ProjectSpec_targetNamespace(ctx context.Context, field graphql.CollectedField, obj *model.ProjectSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectSpec_targetNamespace(ctx, field) +func (ec *executionContext) _ConfigPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.ConfigPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConfigPaginatedRecords_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -14047,7 +10977,7 @@ func (ec *executionContext) _ProjectSpec_targetNamespace(ctx context.Context, fi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.TargetNamespace, nil + return obj.TotalCount, nil }) if err != nil { ec.Error(ctx, err) @@ -14059,26 +10989,26 @@ func (ec *executionContext) _ProjectSpec_targetNamespace(ctx context.Context, fi } return graphql.Null } - res := resTmp.(string) + res := resTmp.(int) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ProjectSpec_targetNamespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConfigPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ProjectSpec", + Object: "ConfigPaginatedRecords", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ProjectSpec_accountName(ctx context.Context, field graphql.CollectedField, obj *model.ProjectSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectSpec_accountName(ctx, field) +func (ec *executionContext) _ConsoleCheckNameAvailabilityOutput_result(ctx context.Context, field graphql.CollectedField, obj *domain.CheckNameAvailabilityOutput) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConsoleCheckNameAvailabilityOutput_result(ctx, field) if err != nil { return graphql.Null } @@ -14091,7 +11021,7 @@ func (ec *executionContext) _ProjectSpec_accountName(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.AccountName, nil + return obj.Result, nil }) if err != nil { ec.Error(ctx, err) @@ -14103,26 +11033,26 @@ func (ec *executionContext) _ProjectSpec_accountName(ctx context.Context, field } return graphql.Null } - res := resTmp.(string) + res := resTmp.(bool) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ProjectSpec_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConsoleCheckNameAvailabilityOutput_result(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ProjectSpec", + Object: "ConsoleCheckNameAvailabilityOutput", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ProjectSpec_clusterName(ctx context.Context, field graphql.CollectedField, obj *model.ProjectSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectSpec_clusterName(ctx, field) +func (ec *executionContext) _ConsoleCheckNameAvailabilityOutput_suggestedNames(ctx context.Context, field graphql.CollectedField, obj *domain.CheckNameAvailabilityOutput) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConsoleCheckNameAvailabilityOutput_suggestedNames(ctx, field) if err != nil { return graphql.Null } @@ -14135,26 +11065,23 @@ func (ec *executionContext) _ProjectSpec_clusterName(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil + return obj.SuggestedNames, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]string) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ProjectSpec_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConsoleCheckNameAvailabilityOutput_suggestedNames(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ProjectSpec", + Object: "ConsoleCheckNameAvailabilityOutput", Field: field, IsMethod: false, IsResolver: false, @@ -14165,8 +11092,8 @@ func (ec *executionContext) fieldContext_ProjectSpec_clusterName(ctx context.Con return fc, nil } -func (ec *executionContext) _Query_core_checkNameAvailability(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_checkNameAvailability(ctx, field) +func (ec *executionContext) _ConsoleVPNDevice_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.ConsoleVPNDevice) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConsoleVPNDevice_accountName(ctx, field) if err != nil { return graphql.Null } @@ -14178,34 +11105,8 @@ func (ec *executionContext) _Query_core_checkNameAvailability(ctx context.Contex } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreCheckNameAvailability(rctx, fc.Args["resType"].(domain.ResType), fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*domain.CheckNameAvailabilityOutput); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/console/internal/domain.CheckNameAvailabilityOutput`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil }) if err != nil { ec.Error(ctx, err) @@ -14217,43 +11118,26 @@ func (ec *executionContext) _Query_core_checkNameAvailability(ctx context.Contex } return graphql.Null } - res := resTmp.(*domain.CheckNameAvailabilityOutput) + res := resTmp.(string) fc.Result = res - return ec.marshalNConsoleCheckNameAvailabilityOutput2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚐCheckNameAvailabilityOutput(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_checkNameAvailability(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConsoleVPNDevice_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "ConsoleVPNDevice", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "result": - return ec.fieldContext_ConsoleCheckNameAvailabilityOutput_result(ctx, field) - case "suggestedNames": - return ec.fieldContext_ConsoleCheckNameAvailabilityOutput_suggestedNames(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ConsoleCheckNameAvailabilityOutput", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_checkNameAvailability_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query_core_listProjects(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_listProjects(ctx, field) +func (ec *executionContext) _ConsoleVPNDevice_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.ConsoleVPNDevice) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConsoleVPNDevice_apiVersion(ctx, field) if err != nil { return graphql.Null } @@ -14265,34 +11149,8 @@ func (ec *executionContext) _Query_core_listProjects(ctx context.Context, field } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreListProjects(rctx, fc.Args["clusterName"].(*string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.([]*entities.Project); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*kloudlite.io/apps/console/internal/domain/entities.Project`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.APIVersion, nil }) if err != nil { ec.Error(ctx, err) @@ -14301,51 +11159,26 @@ func (ec *executionContext) _Query_core_listProjects(ctx context.Context, field if resTmp == nil { return graphql.Null } - res := resTmp.([]*entities.Project) + res := resTmp.(string) fc.Result = res - return ec.marshalOProject2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐProjectᚄ(ctx, field.Selections, res) + return ec.marshalOString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_listProjects(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConsoleVPNDevice_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "ConsoleVPNDevice", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "apiVersion": - return ec.fieldContext_Project_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_Project_kind(ctx, field) - case "metadata": - return ec.fieldContext_Project_metadata(ctx, field) - case "syncStatus": - return ec.fieldContext_Project_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_Project_spec(ctx, field) - case "status": - return ec.fieldContext_Project_status(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Project", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_listProjects_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query_core_getProject(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_getProject(ctx, field) +func (ec *executionContext) _ConsoleVPNDevice_clusterName(ctx context.Context, field graphql.CollectedField, obj *entities.ConsoleVPNDevice) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConsoleVPNDevice_clusterName(ctx, field) if err != nil { return graphql.Null } @@ -14357,34 +11190,8 @@ func (ec *executionContext) _Query_core_getProject(ctx context.Context, field gr } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetProject(rctx, fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*entities.Project); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/console/internal/domain/entities.Project`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.ClusterName, nil }) if err != nil { ec.Error(ctx, err) @@ -14393,51 +11200,26 @@ func (ec *executionContext) _Query_core_getProject(ctx context.Context, field gr if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.Project) + res := resTmp.(*string) fc.Result = res - return ec.marshalOProject2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐProject(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_getProject(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConsoleVPNDevice_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "ConsoleVPNDevice", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "apiVersion": - return ec.fieldContext_Project_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_Project_kind(ctx, field) - case "metadata": - return ec.fieldContext_Project_metadata(ctx, field) - case "syncStatus": - return ec.fieldContext_Project_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_Project_spec(ctx, field) - case "status": - return ec.fieldContext_Project_status(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Project", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_getProject_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query_core_resyncProject(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_resyncProject(ctx, field) +func (ec *executionContext) _ConsoleVPNDevice_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.ConsoleVPNDevice) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConsoleVPNDevice_createdBy(ctx, field) if err != nil { return graphql.Null } @@ -14449,34 +11231,8 @@ func (ec *executionContext) _Query_core_resyncProject(ctx context.Context, field } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreResyncProject(rctx, fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil }) if err != nil { ec.Error(ctx, err) @@ -14488,37 +11244,34 @@ func (ec *executionContext) _Query_core_resyncProject(ctx context.Context, field } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(common.CreatedOrUpdatedBy) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_resyncProject(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConsoleVPNDevice_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "ConsoleVPNDevice", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) }, } - defer func() { - if 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_core_resyncProject_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query_core_listWorkspaces(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_listWorkspaces(ctx, field) +func (ec *executionContext) _ConsoleVPNDevice_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.ConsoleVPNDevice) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConsoleVPNDevice_creationTime(ctx, field) if err != nil { return graphql.Null } @@ -14530,87 +11283,39 @@ func (ec *executionContext) _Query_core_listWorkspaces(ctx context.Context, fiel } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreListWorkspaces(rctx, fc.Args["namespace"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.([]*entities.Workspace); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*kloudlite.io/apps/console/internal/domain/entities.Workspace`, tmp) + ctx = rctx // use context from middleware stack in children + return ec.resolvers.ConsoleVPNDevice().CreationTime(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.([]*entities.Workspace) + res := resTmp.(string) fc.Result = res - return ec.marshalOWorkspace2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐWorkspaceᚄ(ctx, field.Selections, res) + return ec.marshalNDate2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_listWorkspaces(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConsoleVPNDevice_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "ConsoleVPNDevice", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "metadata": - return ec.fieldContext_Workspace_metadata(ctx, field) - case "syncStatus": - return ec.fieldContext_Workspace_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_Workspace_spec(ctx, field) - case "status": - return ec.fieldContext_Workspace_status(ctx, field) - case "apiVersion": - return ec.fieldContext_Workspace_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_Workspace_kind(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Workspace", field.Name) + return nil, errors.New("field of type Date does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_listWorkspaces_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query_core_getWorkspace(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_getWorkspace(ctx, field) +func (ec *executionContext) _ConsoleVPNDevice_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.ConsoleVPNDevice) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConsoleVPNDevice_displayName(ctx, field) if err != nil { return graphql.Null } @@ -14622,87 +11327,80 @@ func (ec *executionContext) _Query_core_getWorkspace(ctx context.Context, field } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetWorkspace(rctx, fc.Args["namespace"].(string), fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*entities.Workspace); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/console/internal/domain/entities.Workspace`, tmp) + 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.(*entities.Workspace) + res := resTmp.(string) fc.Result = res - return ec.marshalOWorkspace2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐWorkspace(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_getWorkspace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConsoleVPNDevice_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "ConsoleVPNDevice", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "metadata": - return ec.fieldContext_Workspace_metadata(ctx, field) - case "syncStatus": - return ec.fieldContext_Workspace_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_Workspace_spec(ctx, field) - case "status": - return ec.fieldContext_Workspace_status(ctx, field) - case "apiVersion": - return ec.fieldContext_Workspace_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_Workspace_kind(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Workspace", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } + return fc, nil +} + +func (ec *executionContext) _ConsoleVPNDevice_environmentName(ctx context.Context, field graphql.CollectedField, obj *entities.ConsoleVPNDevice) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConsoleVPNDevice_environmentName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null } }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_getWorkspace_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.EnvironmentName, nil + }) + if err != nil { ec.Error(ctx, err) - return + 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_ConsoleVPNDevice_environmentName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ConsoleVPNDevice", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field 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_core_resyncWorkspace(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_resyncWorkspace(ctx, field) +func (ec *executionContext) _ConsoleVPNDevice_id(ctx context.Context, field graphql.CollectedField, obj *entities.ConsoleVPNDevice) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConsoleVPNDevice_id(ctx, field) if err != nil { return graphql.Null } @@ -14714,34 +11412,8 @@ func (ec *executionContext) _Query_core_resyncWorkspace(ctx context.Context, fie } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreResyncWorkspace(rctx, fc.Args["namespace"].(string), fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + ctx = rctx // use context from middleware stack in children + return ec.resolvers.ConsoleVPNDevice().ID(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -14753,37 +11425,26 @@ func (ec *executionContext) _Query_core_resyncWorkspace(ctx context.Context, fie } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_resyncWorkspace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConsoleVPNDevice_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "ConsoleVPNDevice", 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") + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_resyncWorkspace_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query_core_listApps(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_listApps(ctx, field) +func (ec *executionContext) _ConsoleVPNDevice_kind(ctx context.Context, field graphql.CollectedField, obj *entities.ConsoleVPNDevice) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConsoleVPNDevice_kind(ctx, field) if err != nil { return graphql.Null } @@ -14795,34 +11456,8 @@ func (ec *executionContext) _Query_core_listApps(ctx context.Context, field grap } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreListApps(rctx, fc.Args["namespace"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.([]*entities.App); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*kloudlite.io/apps/console/internal/domain/entities.App`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.Kind, nil }) if err != nil { ec.Error(ctx, err) @@ -14831,57 +11466,26 @@ func (ec *executionContext) _Query_core_listApps(ctx context.Context, field grap if resTmp == nil { return graphql.Null } - res := resTmp.([]*entities.App) + res := resTmp.(string) fc.Result = res - return ec.marshalOApp2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐAppᚄ(ctx, field.Selections, res) + return ec.marshalOString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_listApps(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConsoleVPNDevice_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "ConsoleVPNDevice", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext_App_kind(ctx, field) - case "metadata": - return ec.fieldContext_App_metadata(ctx, field) - case "overrides": - return ec.fieldContext_App_overrides(ctx, field) - case "restart": - return ec.fieldContext_App_restart(ctx, field) - case "syncStatus": - return ec.fieldContext_App_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_App_spec(ctx, field) - case "status": - return ec.fieldContext_App_status(ctx, field) - case "apiVersion": - return ec.fieldContext_App_apiVersion(ctx, field) - case "enabled": - return ec.fieldContext_App_enabled(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type App", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_listApps_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query_core_getApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_getApp(ctx, field) +func (ec *executionContext) _ConsoleVPNDevice_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.ConsoleVPNDevice) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConsoleVPNDevice_lastUpdatedBy(ctx, field) if err != nil { return graphql.Null } @@ -14893,93 +11497,88 @@ func (ec *executionContext) _Query_core_getApp(ctx context.Context, field graphq } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetApp(rctx, fc.Args["namespace"].(string), fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*entities.App); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/console/internal/domain/entities.App`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.LastUpdatedBy, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*entities.App) + res := resTmp.(common.CreatedOrUpdatedBy) fc.Result = res - return ec.marshalOApp2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐApp(ctx, field.Selections, res) + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_getApp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConsoleVPNDevice_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "ConsoleVPNDevice", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "kind": - return ec.fieldContext_App_kind(ctx, field) - case "metadata": - return ec.fieldContext_App_metadata(ctx, field) - case "overrides": - return ec.fieldContext_App_overrides(ctx, field) - case "restart": - return ec.fieldContext_App_restart(ctx, field) - case "syncStatus": - return ec.fieldContext_App_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_App_spec(ctx, field) - case "status": - return ec.fieldContext_App_status(ctx, field) - case "apiVersion": - return ec.fieldContext_App_apiVersion(ctx, field) - case "enabled": - return ec.fieldContext_App_enabled(ctx, field) + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type App", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) }, } + return fc, nil +} + +func (ec *executionContext) _ConsoleVPNDevice_linkedClusters(ctx context.Context, field graphql.CollectedField, obj *entities.ConsoleVPNDevice) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConsoleVPNDevice_linkedClusters(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null } }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_getApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LinkedClusters, nil + }) + if err != nil { ec.Error(ctx, err) - return + 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_ConsoleVPNDevice_linkedClusters(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ConsoleVPNDevice", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field 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_core_resyncApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_resyncApp(ctx, field) +func (ec *executionContext) _ConsoleVPNDevice_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.ConsoleVPNDevice) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConsoleVPNDevice_markedForDeletion(ctx, field) if err != nil { return graphql.Null } @@ -14991,76 +11590,36 @@ func (ec *executionContext) _Query_core_resyncApp(ctx context.Context, field gra } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreResyncApp(rctx, fc.Args["namespace"].(string), fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.MarkedForDeletion, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(*bool) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_resyncApp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConsoleVPNDevice_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "ConsoleVPNDevice", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type Boolean does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_resyncApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query_core_listConfigs(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_listConfigs(ctx, field) +func (ec *executionContext) _ConsoleVPNDevice_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.ConsoleVPNDevice) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConsoleVPNDevice_metadata(ctx, field) if err != nil { return graphql.Null } @@ -15072,34 +11631,8 @@ func (ec *executionContext) _Query_core_listConfigs(ctx context.Context, field g } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreListConfigs(rctx, fc.Args["namespace"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.([]*entities.Config); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*kloudlite.io/apps/console/internal/domain/entities.Config`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.ObjectMeta, nil }) if err != nil { ec.Error(ctx, err) @@ -15108,55 +11641,42 @@ func (ec *executionContext) _Query_core_listConfigs(ctx context.Context, field g if resTmp == nil { return graphql.Null } - res := resTmp.([]*entities.Config) + res := resTmp.(v12.ObjectMeta) fc.Result = res - return ec.marshalOConfig2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐConfigᚄ(ctx, field.Selections, res) + return ec.marshalOMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_listConfigs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConsoleVPNDevice_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "ConsoleVPNDevice", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "enabled": - return ec.fieldContext_Config_enabled(ctx, field) - case "kind": - return ec.fieldContext_Config_kind(ctx, field) - case "metadata": - return ec.fieldContext_Config_metadata(ctx, field) - case "overrides": - return ec.fieldContext_Config_overrides(ctx, field) - case "status": - return ec.fieldContext_Config_status(ctx, field) - case "apiVersion": - return ec.fieldContext_Config_apiVersion(ctx, field) - case "syncStatus": - return ec.fieldContext_Config_syncStatus(ctx, field) - case "data": - return ec.fieldContext_Config_data(ctx, field) + case "annotations": + return ec.fieldContext_Metadata_annotations(ctx, field) + case "creationTimestamp": + return ec.fieldContext_Metadata_creationTimestamp(ctx, field) + case "deletionTimestamp": + return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) + case "generation": + return ec.fieldContext_Metadata_generation(ctx, field) + case "labels": + return ec.fieldContext_Metadata_labels(ctx, field) + case "name": + return ec.fieldContext_Metadata_name(ctx, field) + case "namespace": + return ec.fieldContext_Metadata_namespace(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Config", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) }, } - defer func() { - if 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_core_listConfigs_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query_core_getConfig(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_getConfig(ctx, field) +func (ec *executionContext) _ConsoleVPNDevice_projectName(ctx context.Context, field graphql.CollectedField, obj *entities.ConsoleVPNDevice) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConsoleVPNDevice_projectName(ctx, field) if err != nil { return graphql.Null } @@ -15168,34 +11688,8 @@ func (ec *executionContext) _Query_core_getConfig(ctx context.Context, field gra } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetConfig(rctx, fc.Args["namespace"].(string), fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*entities.Config); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/console/internal/domain/entities.Config`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.ProjectName, nil }) if err != nil { ec.Error(ctx, err) @@ -15204,55 +11698,26 @@ func (ec *executionContext) _Query_core_getConfig(ctx context.Context, field gra if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.Config) + res := resTmp.(*string) fc.Result = res - return ec.marshalOConfig2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐConfig(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_getConfig(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConsoleVPNDevice_projectName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "ConsoleVPNDevice", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "enabled": - return ec.fieldContext_Config_enabled(ctx, field) - case "kind": - return ec.fieldContext_Config_kind(ctx, field) - case "metadata": - return ec.fieldContext_Config_metadata(ctx, field) - case "overrides": - return ec.fieldContext_Config_overrides(ctx, field) - case "status": - return ec.fieldContext_Config_status(ctx, field) - case "apiVersion": - return ec.fieldContext_Config_apiVersion(ctx, field) - case "syncStatus": - return ec.fieldContext_Config_syncStatus(ctx, field) - case "data": - return ec.fieldContext_Config_data(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Config", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_getConfig_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query_core_resyncConfig(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_resyncConfig(ctx, field) +func (ec *executionContext) _ConsoleVPNDevice_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.ConsoleVPNDevice) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConsoleVPNDevice_recordVersion(ctx, field) if err != nil { return graphql.Null } @@ -15264,34 +11729,8 @@ func (ec *executionContext) _Query_core_resyncConfig(ctx context.Context, field } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreResyncConfig(rctx, fc.Args["namespace"].(string), fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.RecordVersion, nil }) if err != nil { ec.Error(ctx, err) @@ -15303,37 +11742,26 @@ func (ec *executionContext) _Query_core_resyncConfig(ctx context.Context, field } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(int) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_resyncConfig(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConsoleVPNDevice_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "ConsoleVPNDevice", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_resyncConfig_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query_core_listSecrets(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_listSecrets(ctx, field) +func (ec *executionContext) _ConsoleVPNDevice_spec(ctx context.Context, field graphql.CollectedField, obj *entities.ConsoleVPNDevice) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConsoleVPNDevice_spec(ctx, field) if err != nil { return graphql.Null } @@ -15345,34 +11773,8 @@ func (ec *executionContext) _Query_core_listSecrets(ctx context.Context, field g } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreListSecrets(rctx, fc.Args["namespace"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.([]*entities.Secret); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*kloudlite.io/apps/console/internal/domain/entities.Secret`, tmp) + ctx = rctx // use context from middleware stack in children + return ec.resolvers.ConsoleVPNDevice().Spec(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -15381,61 +11783,40 @@ func (ec *executionContext) _Query_core_listSecrets(ctx context.Context, field g if resTmp == nil { return graphql.Null } - res := resTmp.([]*entities.Secret) + res := resTmp.(*model.GithubComKloudliteOperatorApisWireguardV1DeviceSpec) fc.Result = res - return ec.marshalOSecret2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐSecretᚄ(ctx, field.Selections, res) + return ec.marshalOGithub__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisWireguardV1DeviceSpec(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_listSecrets(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConsoleVPNDevice_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "ConsoleVPNDevice", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "syncStatus": - return ec.fieldContext_Secret_syncStatus(ctx, field) - case "data": - return ec.fieldContext_Secret_data(ctx, field) - case "enabled": - return ec.fieldContext_Secret_enabled(ctx, field) - case "kind": - return ec.fieldContext_Secret_kind(ctx, field) - case "metadata": - return ec.fieldContext_Secret_metadata(ctx, field) - case "projectName": - return ec.fieldContext_Secret_projectName(ctx, field) - case "status": - return ec.fieldContext_Secret_status(ctx, field) - case "apiVersion": - return ec.fieldContext_Secret_apiVersion(ctx, field) - case "overrides": - return ec.fieldContext_Secret_overrides(ctx, field) - case "stringData": - return ec.fieldContext_Secret_stringData(ctx, field) - case "type": - return ec.fieldContext_Secret_type(ctx, field) + case "activeNamespace": + return ec.fieldContext_Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_activeNamespace(ctx, field) + case "cnameRecords": + return ec.fieldContext_Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_cnameRecords(ctx, field) + case "disabled": + return ec.fieldContext_Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_disabled(ctx, field) + case "nodeSelector": + return ec.fieldContext_Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_nodeSelector(ctx, field) + case "noExternalService": + return ec.fieldContext_Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_noExternalService(ctx, field) + case "ports": + return ec.fieldContext_Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_ports(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Secret", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec", field.Name) }, } - defer func() { - if 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_core_listSecrets_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query_core_getSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_getSecret(ctx, field) +func (ec *executionContext) _ConsoleVPNDevice_status(ctx context.Context, field graphql.CollectedField, obj *entities.ConsoleVPNDevice) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConsoleVPNDevice_status(ctx, field) if err != nil { return graphql.Null } @@ -15447,34 +11828,8 @@ func (ec *executionContext) _Query_core_getSecret(ctx context.Context, field gra } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetSecret(rctx, fc.Args["namespace"].(string), fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*entities.Secret); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/console/internal/domain/entities.Secret`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.Status, nil }) if err != nil { ec.Error(ctx, err) @@ -15483,61 +11838,40 @@ func (ec *executionContext) _Query_core_getSecret(ctx context.Context, field gra if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.Secret) + res := resTmp.(operator.Status) fc.Result = res - return ec.marshalOSecret2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐSecret(ctx, field.Selections, res) + return ec.marshalOGithub__com___kloudlite___operator___pkg___operator__Status2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_getSecret(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConsoleVPNDevice_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "ConsoleVPNDevice", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "syncStatus": - return ec.fieldContext_Secret_syncStatus(ctx, field) - case "data": - return ec.fieldContext_Secret_data(ctx, field) - case "enabled": - return ec.fieldContext_Secret_enabled(ctx, field) - case "kind": - return ec.fieldContext_Secret_kind(ctx, field) - case "metadata": - return ec.fieldContext_Secret_metadata(ctx, field) - case "projectName": - return ec.fieldContext_Secret_projectName(ctx, field) - case "status": - return ec.fieldContext_Secret_status(ctx, field) - case "apiVersion": - return ec.fieldContext_Secret_apiVersion(ctx, field) - case "overrides": - return ec.fieldContext_Secret_overrides(ctx, field) - case "stringData": - return ec.fieldContext_Secret_stringData(ctx, field) - case "type": - return ec.fieldContext_Secret_type(ctx, field) + case "checks": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx, field) + case "isReady": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_isReady(ctx, field) + case "lastReadyGeneration": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReadyGeneration(ctx, field) + case "lastReconcileTime": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReconcileTime(ctx, field) + case "message": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_message(ctx, field) + case "resources": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_resources(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Secret", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___pkg___operator__Status", field.Name) }, } - defer func() { - if 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_core_getSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query_core_resyncSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_resyncSecret(ctx, field) +func (ec *executionContext) _ConsoleVPNDevice_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.ConsoleVPNDevice) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConsoleVPNDevice_syncStatus(ctx, field) if err != nil { return graphql.Null } @@ -15549,34 +11883,8 @@ func (ec *executionContext) _Query_core_resyncSecret(ctx context.Context, field } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreResyncSecret(rctx, fc.Args["namespace"].(string), fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.SyncStatus, nil }) if err != nil { ec.Error(ctx, err) @@ -15588,37 +11896,40 @@ func (ec *executionContext) _Query_core_resyncSecret(ctx context.Context, field } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(types.SyncStatus) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNGithub__com___kloudlite___api___pkg___types__SyncStatus2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_resyncSecret(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConsoleVPNDevice_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "ConsoleVPNDevice", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "action": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx, field) + case "error": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx, field) + case "lastSyncedAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx, field) + case "recordVersion": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx, field) + case "state": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx, field) + case "syncScheduledAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___pkg___types__SyncStatus", field.Name) }, } - defer func() { - if 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_core_resyncSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query_core_listRouters(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_listRouters(ctx, field) +func (ec *executionContext) _ConsoleVPNDevice_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.ConsoleVPNDevice) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConsoleVPNDevice_updateTime(ctx, field) if err != nil { return graphql.Null } @@ -15630,89 +11941,39 @@ func (ec *executionContext) _Query_core_listRouters(ctx context.Context, field g } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreListRouters(rctx, fc.Args["namespace"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.([]*entities.Router); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*kloudlite.io/apps/console/internal/domain/entities.Router`, tmp) + ctx = rctx // use context from middleware stack in children + return ec.resolvers.ConsoleVPNDevice().UpdateTime(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.([]*entities.Router) + res := resTmp.(string) fc.Result = res - return ec.marshalORouter2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐRouterᚄ(ctx, field.Selections, res) + return ec.marshalNDate2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_listRouters(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConsoleVPNDevice_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "ConsoleVPNDevice", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "apiVersion": - return ec.fieldContext_Router_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_Router_kind(ctx, field) - case "metadata": - return ec.fieldContext_Router_metadata(ctx, field) - case "overrides": - return ec.fieldContext_Router_overrides(ctx, field) - case "syncStatus": - return ec.fieldContext_Router_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_Router_spec(ctx, field) - case "status": - return ec.fieldContext_Router_status(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Router", field.Name) + return nil, errors.New("field of type Date does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_listRouters_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query_core_getRouter(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_getRouter(ctx, field) +func (ec *executionContext) _ConsoleVPNDevice_wireguardConfig(ctx context.Context, field graphql.CollectedField, obj *entities.ConsoleVPNDevice) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConsoleVPNDevice_wireguardConfig(ctx, field) if err != nil { return graphql.Null } @@ -15724,34 +11985,8 @@ func (ec *executionContext) _Query_core_getRouter(ctx context.Context, field gra } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetRouter(rctx, fc.Args["namespace"].(string), fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*entities.Router); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/console/internal/domain/entities.Router`, tmp) + ctx = rctx // use context from middleware stack in children + return ec.resolvers.ConsoleVPNDevice().WireguardConfig(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -15760,53 +11995,32 @@ func (ec *executionContext) _Query_core_getRouter(ctx context.Context, field gra if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.Router) + res := resTmp.(*model.GithubComKloudliteAPIPkgTypesEncodedString) fc.Result = res - return ec.marshalORouter2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐRouter(ctx, field.Selections, res) + return ec.marshalOGithub__com___kloudlite___api___pkg___types__EncodedString2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIPkgTypesEncodedString(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_getRouter(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConsoleVPNDevice_wireguardConfig(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "ConsoleVPNDevice", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "apiVersion": - return ec.fieldContext_Router_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_Router_kind(ctx, field) - case "metadata": - return ec.fieldContext_Router_metadata(ctx, field) - case "overrides": - return ec.fieldContext_Router_overrides(ctx, field) - case "syncStatus": - return ec.fieldContext_Router_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_Router_spec(ctx, field) - case "status": - return ec.fieldContext_Router_status(ctx, field) + case "encoding": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__EncodedString_encoding(ctx, field) + case "value": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__EncodedString_value(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Router", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___pkg___types__EncodedString", field.Name) }, } - defer func() { - if 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_core_getRouter_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query_core_resyncRouter(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_resyncRouter(ctx, field) +func (ec *executionContext) _ConsoleVPNDeviceEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.ConsoleVPNDeviceEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConsoleVPNDeviceEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -15818,34 +12032,8 @@ func (ec *executionContext) _Query_core_resyncRouter(ctx context.Context, field } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreResyncRouter(rctx, fc.Args["namespace"].(string), fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.Cursor, nil }) if err != nil { ec.Error(ctx, err) @@ -15857,37 +12045,26 @@ func (ec *executionContext) _Query_core_resyncRouter(ctx context.Context, field } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_resyncRouter(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConsoleVPNDeviceEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "ConsoleVPNDeviceEdge", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_resyncRouter_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query_core_listManagedServices(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_listManagedServices(ctx, field) +func (ec *executionContext) _ConsoleVPNDeviceEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.ConsoleVPNDeviceEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConsoleVPNDeviceEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -15899,91 +12076,81 @@ func (ec *executionContext) _Query_core_listManagedServices(ctx context.Context, } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreListManagedServices(rctx, fc.Args["namespace"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.([]*entities.MSvc); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*kloudlite.io/apps/console/internal/domain/entities.MSvc`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.Node, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*entities.MSvc) + res := resTmp.(*entities.ConsoleVPNDevice) fc.Result = res - return ec.marshalOManagedService2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐMSvcᚄ(ctx, field.Selections, res) + return ec.marshalNConsoleVPNDevice2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConsoleVPNDevice(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_listManagedServices(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConsoleVPNDeviceEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "ConsoleVPNDeviceEdge", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "overrides": - return ec.fieldContext_ManagedService_overrides(ctx, field) - case "syncStatus": - return ec.fieldContext_ManagedService_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_ManagedService_spec(ctx, field) - case "status": - return ec.fieldContext_ManagedService_status(ctx, field) + case "accountName": + return ec.fieldContext_ConsoleVPNDevice_accountName(ctx, field) case "apiVersion": - return ec.fieldContext_ManagedService_apiVersion(ctx, field) - case "enabled": - return ec.fieldContext_ManagedService_enabled(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_ConsoleVPNDevice_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_ConsoleVPNDevice_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_ConsoleVPNDevice_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_ConsoleVPNDevice_displayName(ctx, field) + case "environmentName": + return ec.fieldContext_ConsoleVPNDevice_environmentName(ctx, field) + case "id": + return ec.fieldContext_ConsoleVPNDevice_id(ctx, field) case "kind": - return ec.fieldContext_ManagedService_kind(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_ConsoleVPNDevice_lastUpdatedBy(ctx, field) + case "linkedClusters": + return ec.fieldContext_ConsoleVPNDevice_linkedClusters(ctx, field) + case "markedForDeletion": + return ec.fieldContext_ConsoleVPNDevice_markedForDeletion(ctx, field) case "metadata": - return ec.fieldContext_ManagedService_metadata(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_metadata(ctx, field) + case "projectName": + return ec.fieldContext_ConsoleVPNDevice_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_ConsoleVPNDevice_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_ConsoleVPNDevice_spec(ctx, field) + case "status": + return ec.fieldContext_ConsoleVPNDevice_status(ctx, field) + case "syncStatus": + return ec.fieldContext_ConsoleVPNDevice_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_ConsoleVPNDevice_updateTime(ctx, field) + case "wireguardConfig": + return ec.fieldContext_ConsoleVPNDevice_wireguardConfig(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ManagedService", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ConsoleVPNDevice", field.Name) }, } - defer func() { - if 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_core_listManagedServices_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query_core_getManagedService(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_getManagedService(ctx, field) +func (ec *executionContext) _ConsoleVPNDevicePaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.ConsoleVPNDevicePaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConsoleVPNDevicePaginatedRecords_edges(ctx, field) if err != nil { return graphql.Null } @@ -15995,91 +12162,45 @@ func (ec *executionContext) _Query_core_getManagedService(ctx context.Context, f } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetManagedService(rctx, fc.Args["namespace"].(string), fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*entities.MSvc); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/console/internal/domain/entities.MSvc`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*entities.MSvc) + res := resTmp.([]*model.ConsoleVPNDeviceEdge) fc.Result = res - return ec.marshalOManagedService2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐMSvc(ctx, field.Selections, res) + return ec.marshalNConsoleVPNDeviceEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐConsoleVPNDeviceEdgeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_getManagedService(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConsoleVPNDevicePaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "ConsoleVPNDevicePaginatedRecords", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "overrides": - return ec.fieldContext_ManagedService_overrides(ctx, field) - case "syncStatus": - return ec.fieldContext_ManagedService_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_ManagedService_spec(ctx, field) - case "status": - return ec.fieldContext_ManagedService_status(ctx, field) - case "apiVersion": - return ec.fieldContext_ManagedService_apiVersion(ctx, field) - case "enabled": - return ec.fieldContext_ManagedService_enabled(ctx, field) - case "kind": - return ec.fieldContext_ManagedService_kind(ctx, field) - case "metadata": - return ec.fieldContext_ManagedService_metadata(ctx, field) + case "cursor": + return ec.fieldContext_ConsoleVPNDeviceEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_ConsoleVPNDeviceEdge_node(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ManagedService", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ConsoleVPNDeviceEdge", field.Name) }, } - defer func() { - if 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_core_getManagedService_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query_core_resyncManagedService(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_resyncManagedService(ctx, field) +func (ec *executionContext) _ConsoleVPNDevicePaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.ConsoleVPNDevicePaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConsoleVPNDevicePaginatedRecords_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -16091,34 +12212,8 @@ func (ec *executionContext) _Query_core_resyncManagedService(ctx context.Context } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreResyncManagedService(rctx, fc.Args["namespace"].(string), fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) @@ -16130,37 +12225,36 @@ func (ec *executionContext) _Query_core_resyncManagedService(ctx context.Context } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(*model.PageInfo) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_resyncManagedService(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConsoleVPNDevicePaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "ConsoleVPNDevicePaginatedRecords", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) }, } - defer func() { - if 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_core_resyncManagedService_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query_core_listManagedResources(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_listManagedResources(ctx, field) +func (ec *executionContext) _ConsoleVPNDevicePaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.ConsoleVPNDevicePaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConsoleVPNDevicePaginatedRecords_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -16172,91 +12266,39 @@ func (ec *executionContext) _Query_core_listManagedResources(ctx context.Context } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreListManagedResources(rctx, fc.Args["namespace"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.([]*entities.MRes); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*kloudlite.io/apps/console/internal/domain/entities.MRes`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.TotalCount, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*entities.MRes) + res := resTmp.(int) fc.Result = res - return ec.marshalOManagedResource2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐMResᚄ(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_listManagedResources(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConsoleVPNDevicePaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "ConsoleVPNDevicePaginatedRecords", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "overrides": - return ec.fieldContext_ManagedResource_overrides(ctx, field) - case "syncStatus": - return ec.fieldContext_ManagedResource_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_ManagedResource_spec(ctx, field) - case "status": - return ec.fieldContext_ManagedResource_status(ctx, field) - case "apiVersion": - return ec.fieldContext_ManagedResource_apiVersion(ctx, field) - case "enabled": - return ec.fieldContext_ManagedResource_enabled(ctx, field) - case "kind": - return ec.fieldContext_ManagedResource_kind(ctx, field) - case "metadata": - return ec.fieldContext_ManagedResource_metadata(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ManagedResource", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_listManagedResources_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query_core_getManagedResource(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_getManagedResource(ctx, field) +func (ec *executionContext) _CursorPagination_after(ctx context.Context, field graphql.CollectedField, obj *repos.CursorPagination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CursorPagination_after(ctx, field) if err != nil { return graphql.Null } @@ -16268,34 +12310,8 @@ func (ec *executionContext) _Query_core_getManagedResource(ctx context.Context, } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetManagedResource(rctx, fc.Args["namespace"].(string), fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*entities.MRes); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/console/internal/domain/entities.MRes`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.After, nil }) if err != nil { ec.Error(ctx, err) @@ -16304,55 +12320,26 @@ func (ec *executionContext) _Query_core_getManagedResource(ctx context.Context, if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.MRes) + res := resTmp.(*string) fc.Result = res - return ec.marshalOManagedResource2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐMRes(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_getManagedResource(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_CursorPagination_after(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "CursorPagination", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "overrides": - return ec.fieldContext_ManagedResource_overrides(ctx, field) - case "syncStatus": - return ec.fieldContext_ManagedResource_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_ManagedResource_spec(ctx, field) - case "status": - return ec.fieldContext_ManagedResource_status(ctx, field) - case "apiVersion": - return ec.fieldContext_ManagedResource_apiVersion(ctx, field) - case "enabled": - return ec.fieldContext_ManagedResource_enabled(ctx, field) - case "kind": - return ec.fieldContext_ManagedResource_kind(ctx, field) - case "metadata": - return ec.fieldContext_ManagedResource_metadata(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ManagedResource", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_getManagedResource_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query_core_resyncManagedResource(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_resyncManagedResource(ctx, field) +func (ec *executionContext) _CursorPagination_before(ctx context.Context, field graphql.CollectedField, obj *repos.CursorPagination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CursorPagination_before(ctx, field) if err != nil { return graphql.Null } @@ -16364,76 +12351,36 @@ func (ec *executionContext) _Query_core_resyncManagedResource(ctx context.Contex } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreResyncManagedResource(rctx, fc.Args["namespace"].(string), fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccountAndCluster == nil { - return nil, errors.New("directive hasAccountAndCluster is not implemented") - } - return ec.directives.HasAccountAndCluster(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.Before, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(*string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_resyncManagedResource(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_CursorPagination_before(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "CursorPagination", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_resyncManagedResource_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query__service(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query__service(ctx, field) +func (ec *executionContext) _CursorPagination_first(ctx context.Context, field graphql.CollectedField, obj *repos.CursorPagination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CursorPagination_first(ctx, field) if err != nil { return graphql.Null } @@ -16446,42 +12393,35 @@ func (ec *executionContext) _Query__service(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.__resolve__service(ctx) + return obj.First, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(fedruntime.Service) + res := resTmp.(*int64) fc.Result = res - return ec.marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx, field.Selections, res) + return ec.marshalOInt2ᚖint64(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query__service(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_CursorPagination_first(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "CursorPagination", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "sdl": - return ec.fieldContext__Service_sdl(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type _Service", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query___type(ctx, field) +func (ec *executionContext) _CursorPagination_last(ctx context.Context, field graphql.CollectedField, obj *repos.CursorPagination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CursorPagination_last(ctx, field) if err != nil { return graphql.Null } @@ -16494,7 +12434,7 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.introspectType(fc.Args["name"].(string)) + return obj.Last, nil }) if err != nil { ec.Error(ctx, err) @@ -16503,59 +12443,26 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col if resTmp == nil { return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(*int64) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalOInt2ᚖint64(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_CursorPagination_last(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "CursorPagination", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } return fc, nil } -func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query___schema(ctx, field) +func (ec *executionContext) _CursorPagination_orderBy(ctx context.Context, field graphql.CollectedField, obj *repos.CursorPagination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CursorPagination_orderBy(ctx, field) if err != nil { return graphql.Null } @@ -16568,7 +12475,7 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.introspectSchema() + return obj.OrderBy, nil }) if err != nil { ec.Error(ctx, err) @@ -16577,40 +12484,26 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C if resTmp == nil { return graphql.Null } - res := resTmp.(*introspection.Schema) + res := resTmp.(string) fc.Result = res - return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) + return ec.marshalOString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query___schema(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_CursorPagination_orderBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "CursorPagination", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "description": - return ec.fieldContext___Schema_description(ctx, field) - case "types": - return ec.fieldContext___Schema_types(ctx, field) - case "queryType": - return ec.fieldContext___Schema_queryType(ctx, field) - case "mutationType": - return ec.fieldContext___Schema_mutationType(ctx, field) - case "subscriptionType": - return ec.fieldContext___Schema_subscriptionType(ctx, field) - case "directives": - return ec.fieldContext___Schema_directives(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Router_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Router_apiVersion(ctx, field) +func (ec *executionContext) _CursorPagination_sortDirection(ctx context.Context, field graphql.CollectedField, obj *repos.CursorPagination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CursorPagination_sortDirection(ctx, field) if err != nil { return graphql.Null } @@ -16623,7 +12516,7 @@ func (ec *executionContext) _Router_apiVersion(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.APIVersion, nil + return obj.SortDirection, nil }) if err != nil { ec.Error(ctx, err) @@ -16632,26 +12525,26 @@ func (ec *executionContext) _Router_apiVersion(ctx context.Context, field graphq if resTmp == nil { return graphql.Null } - res := resTmp.(string) + res := resTmp.(repos.SortDirection) fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + return ec.marshalOCursorPaginationSortDirection2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐSortDirection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Router_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_CursorPagination_sortDirection(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Router", + Object: "CursorPagination", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type CursorPaginationSortDirection does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Router_kind(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Router_kind(ctx, field) +func (ec *executionContext) _Environment_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.Environment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Environment_accountName(ctx, field) if err != nil { return graphql.Null } @@ -16664,23 +12557,26 @@ func (ec *executionContext) _Router_kind(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Kind, nil + return obj.AccountName, nil }) if err != nil { ec.Error(ctx, err) 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.marshalOString2string(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Router_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Environment_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Router", + Object: "Environment", Field: field, IsMethod: false, IsResolver: false, @@ -16691,8 +12587,8 @@ func (ec *executionContext) fieldContext_Router_kind(ctx context.Context, field return fc, nil } -func (ec *executionContext) _Router_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Router_metadata(ctx, field) +func (ec *executionContext) _Environment_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Environment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Environment_apiVersion(ctx, field) if err != nil { return graphql.Null } @@ -16705,54 +12601,35 @@ func (ec *executionContext) _Router_metadata(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ObjectMeta, nil + return obj.APIVersion, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(v1.ObjectMeta) + res := resTmp.(string) fc.Result = res - return ec.marshalNMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) + return ec.marshalOString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Router_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Environment_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Router", + Object: "Environment", 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_Metadata_name(ctx, field) - case "namespace": - return ec.fieldContext_Metadata_namespace(ctx, field) - case "labels": - return ec.fieldContext_Metadata_labels(ctx, field) - case "annotations": - return ec.fieldContext_Metadata_annotations(ctx, field) - case "creationTimestamp": - return ec.fieldContext_Metadata_creationTimestamp(ctx, field) - case "deletionTimestamp": - return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) - case "generation": - return ec.fieldContext_Metadata_generation(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Router_overrides(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Router_overrides(ctx, field) +func (ec *executionContext) _Environment_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.Environment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Environment_createdBy(ctx, field) if err != nil { return graphql.Null } @@ -16765,41 +12642,46 @@ func (ec *executionContext) _Router_overrides(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Overrides, nil + return obj.CreatedBy, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*v11.JsonPatch) + res := resTmp.(common.CreatedOrUpdatedBy) fc.Result = res - return ec.marshalOOverrides2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋapisᚋcrdsᚋv1ᚐJsonPatch(ctx, field.Selections, res) + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Router_overrides(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Environment_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Router", + Object: "Environment", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "applied": - return ec.fieldContext_Overrides_applied(ctx, field) - case "patches": - return ec.fieldContext_Overrides_patches(ctx, field) + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Overrides", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) }, } return fc, nil } -func (ec *executionContext) _Router_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Router_syncStatus(ctx, field) +func (ec *executionContext) _Environment_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.Environment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Environment_creationTime(ctx, field) if err != nil { return graphql.Null } @@ -16812,49 +12694,38 @@ func (ec *executionContext) _Router_syncStatus(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.SyncStatus, nil + return ec.resolvers.Environment().CreationTime(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.(types.SyncStatus) + res := resTmp.(string) fc.Result = res - return ec.marshalOSyncStatus2kloudliteᚗioᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) + return ec.marshalNDate2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Router_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Environment_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Router", + Object: "Environment", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "syncScheduledAt": - return ec.fieldContext_SyncStatus_syncScheduledAt(ctx, field) - case "lastSyncedAt": - return ec.fieldContext_SyncStatus_lastSyncedAt(ctx, field) - case "action": - return ec.fieldContext_SyncStatus_action(ctx, field) - case "generation": - return ec.fieldContext_SyncStatus_generation(ctx, field) - case "state": - return ec.fieldContext_SyncStatus_state(ctx, field) - case "error": - return ec.fieldContext_SyncStatus_error(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type SyncStatus", field.Name) + return nil, errors.New("field of type Date does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Router_spec(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Router_spec(ctx, field) +func (ec *executionContext) _Environment_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.Environment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Environment_displayName(ctx, field) if err != nil { return graphql.Null } @@ -16867,57 +12738,38 @@ func (ec *executionContext) _Router_spec(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Router().Spec(rctx, obj) + 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.(*model.RouterSpec) + res := resTmp.(string) fc.Result = res - return ec.marshalORouterSpec2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterSpec(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Router_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Environment_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Router", + Object: "Environment", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "cors": - return ec.fieldContext_RouterSpec_cors(ctx, field) - case "ingressClass": - return ec.fieldContext_RouterSpec_ingressClass(ctx, field) - case "maxBodySizeInMB": - return ec.fieldContext_RouterSpec_maxBodySizeInMB(ctx, field) - case "region": - return ec.fieldContext_RouterSpec_region(ctx, field) - case "routes": - return ec.fieldContext_RouterSpec_routes(ctx, field) - case "backendProtocol": - return ec.fieldContext_RouterSpec_backendProtocol(ctx, field) - case "basicAuth": - return ec.fieldContext_RouterSpec_basicAuth(ctx, field) - case "domains": - return ec.fieldContext_RouterSpec_domains(ctx, field) - case "https": - return ec.fieldContext_RouterSpec_https(ctx, field) - case "rateLimit": - return ec.fieldContext_RouterSpec_rateLimit(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type RouterSpec", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Router_status(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Router_status(ctx, field) +func (ec *executionContext) _Environment_id(ctx context.Context, field graphql.CollectedField, obj *entities.Environment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Environment_id(ctx, field) if err != nil { return graphql.Null } @@ -16930,43 +12782,38 @@ func (ec *executionContext) _Router_status(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Status, nil + return ec.resolvers.Environment().ID(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.(operator.Status) + res := resTmp.(string) fc.Result = res - return ec.marshalOStatus2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Router_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Environment_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Router", + Object: "Environment", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "isReady": - return ec.fieldContext_Status_isReady(ctx, field) - case "checks": - return ec.fieldContext_Status_checks(ctx, field) - case "displayVars": - return ec.fieldContext_Status_displayVars(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Status", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _RouterSpec_cors(ctx context.Context, field graphql.CollectedField, obj *model.RouterSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterSpec_cors(ctx, field) +func (ec *executionContext) _Environment_kind(ctx context.Context, field graphql.CollectedField, obj *entities.Environment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Environment_kind(ctx, field) if err != nil { return graphql.Null } @@ -16979,7 +12826,7 @@ func (ec *executionContext) _RouterSpec_cors(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Cors, nil + return obj.Kind, nil }) if err != nil { ec.Error(ctx, err) @@ -16988,34 +12835,26 @@ func (ec *executionContext) _RouterSpec_cors(ctx context.Context, field graphql. if resTmp == nil { return graphql.Null } - res := resTmp.(*model.RouterSpecCors) + res := resTmp.(string) fc.Result = res - return ec.marshalORouterSpecCors2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterSpecCors(ctx, field.Selections, res) + return ec.marshalOString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterSpec_cors(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Environment_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterSpec", + Object: "Environment", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "allowCredentials": - return ec.fieldContext_RouterSpecCors_allowCredentials(ctx, field) - case "enabled": - return ec.fieldContext_RouterSpecCors_enabled(ctx, field) - case "origins": - return ec.fieldContext_RouterSpecCors_origins(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type RouterSpecCors", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _RouterSpec_ingressClass(ctx context.Context, field graphql.CollectedField, obj *model.RouterSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterSpec_ingressClass(ctx, field) +func (ec *executionContext) _Environment_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.Environment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Environment_lastUpdatedBy(ctx, field) if err != nil { return graphql.Null } @@ -17028,35 +12867,46 @@ func (ec *executionContext) _RouterSpec_ingressClass(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.IngressClass, nil + return obj.LastUpdatedBy, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(common.CreatedOrUpdatedBy) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterSpec_ingressClass(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Environment_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterSpec", + Object: "Environment", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) }, } return fc, nil } -func (ec *executionContext) _RouterSpec_maxBodySizeInMB(ctx context.Context, field graphql.CollectedField, obj *model.RouterSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterSpec_maxBodySizeInMB(ctx, field) +func (ec *executionContext) _Environment_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.Environment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Environment_markedForDeletion(ctx, field) if err != nil { return graphql.Null } @@ -17069,7 +12919,7 @@ func (ec *executionContext) _RouterSpec_maxBodySizeInMB(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.MaxBodySizeInMb, nil + return obj.MarkedForDeletion, nil }) if err != nil { ec.Error(ctx, err) @@ -17078,26 +12928,26 @@ func (ec *executionContext) _RouterSpec_maxBodySizeInMB(ctx context.Context, fie if resTmp == nil { return graphql.Null } - res := resTmp.(*int) + res := resTmp.(*bool) fc.Result = res - return ec.marshalOInt2ᚖint(ctx, field.Selections, res) + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterSpec_maxBodySizeInMB(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Environment_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterSpec", + Object: "Environment", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _RouterSpec_region(ctx context.Context, field graphql.CollectedField, obj *model.RouterSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterSpec_region(ctx, field) +func (ec *executionContext) _Environment_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.Environment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Environment_metadata(ctx, field) if err != nil { return graphql.Null } @@ -17110,7 +12960,7 @@ func (ec *executionContext) _RouterSpec_region(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Region, nil + return obj.ObjectMeta, nil }) if err != nil { ec.Error(ctx, err) @@ -17119,26 +12969,42 @@ func (ec *executionContext) _RouterSpec_region(ctx context.Context, field graphq if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.(v12.ObjectMeta) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalOMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterSpec_region(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Environment_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterSpec", + Object: "Environment", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "annotations": + return ec.fieldContext_Metadata_annotations(ctx, field) + case "creationTimestamp": + return ec.fieldContext_Metadata_creationTimestamp(ctx, field) + case "deletionTimestamp": + return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) + case "generation": + return ec.fieldContext_Metadata_generation(ctx, field) + case "labels": + return ec.fieldContext_Metadata_labels(ctx, field) + case "name": + return ec.fieldContext_Metadata_name(ctx, field) + case "namespace": + return ec.fieldContext_Metadata_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) }, } return fc, nil } -func (ec *executionContext) _RouterSpec_routes(ctx context.Context, field graphql.CollectedField, obj *model.RouterSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterSpec_routes(ctx, field) +func (ec *executionContext) _Environment_projectName(ctx context.Context, field graphql.CollectedField, obj *entities.Environment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Environment_projectName(ctx, field) if err != nil { return graphql.Null } @@ -17151,47 +13017,38 @@ func (ec *executionContext) _RouterSpec_routes(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Routes, nil + return obj.ProjectName, nil }) if err != nil { ec.Error(ctx, 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.RouterSpecRoutes) + res := resTmp.(string) fc.Result = res - return ec.marshalORouterSpecRoutes2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterSpecRoutes(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterSpec_routes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Environment_projectName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterSpec", + Object: "Environment", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "app": - return ec.fieldContext_RouterSpecRoutes_app(ctx, field) - case "lambda": - return ec.fieldContext_RouterSpecRoutes_lambda(ctx, field) - case "path": - return ec.fieldContext_RouterSpecRoutes_path(ctx, field) - case "port": - return ec.fieldContext_RouterSpecRoutes_port(ctx, field) - case "rewrite": - return ec.fieldContext_RouterSpecRoutes_rewrite(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type RouterSpecRoutes", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _RouterSpec_backendProtocol(ctx context.Context, field graphql.CollectedField, obj *model.RouterSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterSpec_backendProtocol(ctx, field) +func (ec *executionContext) _Environment_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Environment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Environment_recordVersion(ctx, field) if err != nil { return graphql.Null } @@ -17204,35 +13061,38 @@ func (ec *executionContext) _RouterSpec_backendProtocol(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.BackendProtocol, nil + return obj.RecordVersion, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(int) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterSpec_backendProtocol(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Environment_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterSpec", + Object: "Environment", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _RouterSpec_basicAuth(ctx context.Context, field graphql.CollectedField, obj *model.RouterSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterSpec_basicAuth(ctx, field) +func (ec *executionContext) _Environment_spec(ctx context.Context, field graphql.CollectedField, obj *entities.Environment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Environment_spec(ctx, field) if err != nil { return graphql.Null } @@ -17245,7 +13105,7 @@ func (ec *executionContext) _RouterSpec_basicAuth(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.BasicAuth, nil + return ec.resolvers.Environment().Spec(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -17254,34 +13114,34 @@ func (ec *executionContext) _RouterSpec_basicAuth(ctx context.Context, field gra if resTmp == nil { return graphql.Null } - res := resTmp.(*model.RouterSpecBasicAuth) + res := resTmp.(*model.GithubComKloudliteOperatorApisCrdsV1EnvironmentSpec) fc.Result = res - return ec.marshalORouterSpecBasicAuth2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterSpecBasicAuth(ctx, field.Selections, res) + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1EnvironmentSpec(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterSpec_basicAuth(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Environment_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterSpec", + Object: "Environment", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "enabled": - return ec.fieldContext_RouterSpecBasicAuth_enabled(ctx, field) - case "secretName": - return ec.fieldContext_RouterSpecBasicAuth_secretName(ctx, field) - case "username": - return ec.fieldContext_RouterSpecBasicAuth_username(ctx, field) + case "projectName": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec_projectName(ctx, field) + case "routing": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec_routing(ctx, field) + case "targetNamespace": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec_targetNamespace(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type RouterSpecBasicAuth", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec", field.Name) }, } return fc, nil } -func (ec *executionContext) _RouterSpec_domains(ctx context.Context, field graphql.CollectedField, obj *model.RouterSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterSpec_domains(ctx, field) +func (ec *executionContext) _Environment_status(ctx context.Context, field graphql.CollectedField, obj *entities.Environment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Environment_status(ctx, field) if err != nil { return graphql.Null } @@ -17294,38 +13154,49 @@ func (ec *executionContext) _RouterSpec_domains(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Domains, nil + 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.([]*string) + res := resTmp.(operator.Status) fc.Result = res - return ec.marshalNString2ᚕᚖstring(ctx, field.Selections, res) + return ec.marshalOGithub__com___kloudlite___operator___pkg___operator__Status2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterSpec_domains(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Environment_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterSpec", + Object: "Environment", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "checks": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx, field) + case "isReady": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_isReady(ctx, field) + case "lastReadyGeneration": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReadyGeneration(ctx, field) + case "lastReconcileTime": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReconcileTime(ctx, field) + case "message": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_message(ctx, field) + case "resources": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_resources(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___pkg___operator__Status", field.Name) }, } return fc, nil } -func (ec *executionContext) _RouterSpec_https(ctx context.Context, field graphql.CollectedField, obj *model.RouterSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterSpec_https(ctx, field) +func (ec *executionContext) _Environment_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.Environment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Environment_syncStatus(ctx, field) if err != nil { return graphql.Null } @@ -17338,43 +13209,52 @@ func (ec *executionContext) _RouterSpec_https(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.HTTPS, nil + return obj.SyncStatus, nil }) if err != nil { ec.Error(ctx, 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.RouterSpecHTTPS) + res := resTmp.(types.SyncStatus) fc.Result = res - return ec.marshalORouterSpecHttps2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterSpecHTTPS(ctx, field.Selections, res) + return ec.marshalNGithub__com___kloudlite___api___pkg___types__SyncStatus2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterSpec_https(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Environment_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterSpec", + Object: "Environment", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "clusterIssuer": - return ec.fieldContext_RouterSpecHttps_clusterIssuer(ctx, field) - case "enabled": - return ec.fieldContext_RouterSpecHttps_enabled(ctx, field) - case "forceRedirect": - return ec.fieldContext_RouterSpecHttps_forceRedirect(ctx, field) + case "action": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx, field) + case "error": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx, field) + case "lastSyncedAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx, field) + case "recordVersion": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx, field) + case "state": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx, field) + case "syncScheduledAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type RouterSpecHttps", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___pkg___types__SyncStatus", field.Name) }, } return fc, nil } -func (ec *executionContext) _RouterSpec_rateLimit(ctx context.Context, field graphql.CollectedField, obj *model.RouterSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterSpec_rateLimit(ctx, field) +func (ec *executionContext) _Environment_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.Environment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Environment_updateTime(ctx, field) if err != nil { return graphql.Null } @@ -17387,45 +13267,38 @@ func (ec *executionContext) _RouterSpec_rateLimit(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.RateLimit, nil + return ec.resolvers.Environment().UpdateTime(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.RouterSpecRateLimit) + res := resTmp.(string) fc.Result = res - return ec.marshalORouterSpecRateLimit2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterSpecRateLimit(ctx, field.Selections, res) + return ec.marshalNDate2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterSpec_rateLimit(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Environment_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterSpec", + Object: "Environment", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "connections": - return ec.fieldContext_RouterSpecRateLimit_connections(ctx, field) - case "enabled": - return ec.fieldContext_RouterSpecRateLimit_enabled(ctx, field) - case "rpm": - return ec.fieldContext_RouterSpecRateLimit_rpm(ctx, field) - case "rps": - return ec.fieldContext_RouterSpecRateLimit_rps(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type RouterSpecRateLimit", field.Name) + return nil, errors.New("field of type Date does not have child fields") }, } return fc, nil } -func (ec *executionContext) _RouterSpecBasicAuth_enabled(ctx context.Context, field graphql.CollectedField, obj *model.RouterSpecBasicAuth) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterSpecBasicAuth_enabled(ctx, field) +func (ec *executionContext) _EnvironmentEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.EnvironmentEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EnvironmentEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -17438,7 +13311,7 @@ func (ec *executionContext) _RouterSpecBasicAuth_enabled(ctx context.Context, fi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Enabled, nil + return obj.Cursor, nil }) if err != nil { ec.Error(ctx, err) @@ -17450,26 +13323,26 @@ func (ec *executionContext) _RouterSpecBasicAuth_enabled(ctx context.Context, fi } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterSpecBasicAuth_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_EnvironmentEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterSpecBasicAuth", + Object: "EnvironmentEdge", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _RouterSpecBasicAuth_secretName(ctx context.Context, field graphql.CollectedField, obj *model.RouterSpecBasicAuth) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterSpecBasicAuth_secretName(ctx, field) +func (ec *executionContext) _EnvironmentEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.EnvironmentEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EnvironmentEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -17482,35 +13355,72 @@ func (ec *executionContext) _RouterSpecBasicAuth_secretName(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.SecretName, nil + return obj.Node, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(*entities.Environment) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNEnvironment2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐEnvironment(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterSpecBasicAuth_secretName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_EnvironmentEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterSpecBasicAuth", + Object: "EnvironmentEdge", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "accountName": + return ec.fieldContext_Environment_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Environment_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_Environment_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Environment_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_Environment_displayName(ctx, field) + case "id": + return ec.fieldContext_Environment_id(ctx, field) + case "kind": + return ec.fieldContext_Environment_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Environment_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Environment_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Environment_metadata(ctx, field) + case "projectName": + return ec.fieldContext_Environment_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_Environment_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_Environment_spec(ctx, field) + case "status": + return ec.fieldContext_Environment_status(ctx, field) + case "syncStatus": + return ec.fieldContext_Environment_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_Environment_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Environment", field.Name) }, } return fc, nil } -func (ec *executionContext) _RouterSpecBasicAuth_username(ctx context.Context, field graphql.CollectedField, obj *model.RouterSpecBasicAuth) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterSpecBasicAuth_username(ctx, field) +func (ec *executionContext) _EnvironmentPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.EnvironmentPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EnvironmentPaginatedRecords_edges(ctx, field) if err != nil { return graphql.Null } @@ -17523,35 +13433,44 @@ func (ec *executionContext) _RouterSpecBasicAuth_username(ctx context.Context, f }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Username, nil + return obj.Edges, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.([]*model.EnvironmentEdge) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNEnvironmentEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐEnvironmentEdgeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterSpecBasicAuth_username(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_EnvironmentPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterSpecBasicAuth", + Object: "EnvironmentPaginatedRecords", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "cursor": + return ec.fieldContext_EnvironmentEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_EnvironmentEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EnvironmentEdge", field.Name) }, } return fc, nil } -func (ec *executionContext) _RouterSpecCors_allowCredentials(ctx context.Context, field graphql.CollectedField, obj *model.RouterSpecCors) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterSpecCors_allowCredentials(ctx, field) +func (ec *executionContext) _EnvironmentPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.EnvironmentPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EnvironmentPaginatedRecords_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -17564,35 +13483,48 @@ func (ec *executionContext) _RouterSpecCors_allowCredentials(ctx context.Context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.AllowCredentials, nil + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*bool) + res := resTmp.(*model.PageInfo) fc.Result = res - return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) + return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterSpecCors_allowCredentials(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_EnvironmentPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterSpecCors", + Object: "EnvironmentPaginatedRecords", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) }, } return fc, nil } -func (ec *executionContext) _RouterSpecCors_enabled(ctx context.Context, field graphql.CollectedField, obj *model.RouterSpecCors) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterSpecCors_enabled(ctx, field) +func (ec *executionContext) _EnvironmentPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.EnvironmentPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EnvironmentPaginatedRecords_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -17605,35 +13537,38 @@ func (ec *executionContext) _RouterSpecCors_enabled(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Enabled, nil + return obj.TotalCount, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*bool) + res := resTmp.(int) fc.Result = res - return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterSpecCors_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_EnvironmentPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterSpecCors", + Object: "EnvironmentPaginatedRecords", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _RouterSpecCors_origins(ctx context.Context, field graphql.CollectedField, obj *model.RouterSpecCors) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterSpecCors_origins(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx context.Context, field graphql.CollectedField, obj *common.CreatedOrUpdatedBy) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) if err != nil { return graphql.Null } @@ -17646,23 +13581,26 @@ func (ec *executionContext) _RouterSpecCors_origins(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Origins, nil + return obj.UserEmail, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*string) + res := resTmp.(string) fc.Result = res - return ec.marshalOString2ᚕᚖstring(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterSpecCors_origins(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterSpecCors", + Object: "Github__com___kloudlite___api___common__CreatedOrUpdatedBy", Field: field, IsMethod: false, IsResolver: false, @@ -17673,8 +13611,8 @@ func (ec *executionContext) fieldContext_RouterSpecCors_origins(ctx context.Cont return fc, nil } -func (ec *executionContext) _RouterSpecHttps_clusterIssuer(ctx context.Context, field graphql.CollectedField, obj *model.RouterSpecHTTPS) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterSpecHttps_clusterIssuer(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx context.Context, field graphql.CollectedField, obj *common.CreatedOrUpdatedBy) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) if err != nil { return graphql.Null } @@ -17687,26 +13625,29 @@ func (ec *executionContext) _RouterSpecHttps_clusterIssuer(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ClusterIssuer, nil + return ec.resolvers.Github__com___kloudlite___api___common__CreatedOrUpdatedBy().UserID(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) + res := resTmp.(string) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterSpecHttps_clusterIssuer(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterSpecHttps", + Object: "Github__com___kloudlite___api___common__CreatedOrUpdatedBy", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") }, @@ -17714,8 +13655,8 @@ func (ec *executionContext) fieldContext_RouterSpecHttps_clusterIssuer(ctx conte return fc, nil } -func (ec *executionContext) _RouterSpecHttps_enabled(ctx context.Context, field graphql.CollectedField, obj *model.RouterSpecHTTPS) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterSpecHttps_enabled(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx context.Context, field graphql.CollectedField, obj *common.CreatedOrUpdatedBy) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) if err != nil { return graphql.Null } @@ -17728,7 +13669,7 @@ func (ec *executionContext) _RouterSpecHttps_enabled(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Enabled, nil + return obj.UserName, nil }) if err != nil { ec.Error(ctx, err) @@ -17740,26 +13681,26 @@ func (ec *executionContext) _RouterSpecHttps_enabled(ctx context.Context, field } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterSpecHttps_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterSpecHttps", + Object: "Github__com___kloudlite___api___common__CreatedOrUpdatedBy", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _RouterSpecHttps_forceRedirect(ctx context.Context, field graphql.CollectedField, obj *model.RouterSpecHTTPS) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterSpecHttps_forceRedirect(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___api___pkg___types__EncodedString_encoding(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIPkgTypesEncodedString) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___pkg___types__EncodedString_encoding(ctx, field) if err != nil { return graphql.Null } @@ -17772,76 +13713,38 @@ func (ec *executionContext) _RouterSpecHttps_forceRedirect(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ForceRedirect, nil + return obj.Encoding, 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_RouterSpecHttps_forceRedirect(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "RouterSpecHttps", - 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) _RouterSpecRateLimit_connections(ctx context.Context, field graphql.CollectedField, obj *model.RouterSpecRateLimit) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterSpecRateLimit_connections(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Connections, nil - }) - if err != nil { - ec.Error(ctx, err) return graphql.Null } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*int) + res := resTmp.(string) fc.Result = res - return ec.marshalOInt2ᚖint(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterSpecRateLimit_connections(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___pkg___types__EncodedString_encoding(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterSpecRateLimit", + Object: "Github__com___kloudlite___api___pkg___types__EncodedString", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _RouterSpecRateLimit_enabled(ctx context.Context, field graphql.CollectedField, obj *model.RouterSpecRateLimit) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterSpecRateLimit_enabled(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___api___pkg___types__EncodedString_value(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIPkgTypesEncodedString) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___pkg___types__EncodedString_value(ctx, field) if err != nil { return graphql.Null } @@ -17854,76 +13757,38 @@ func (ec *executionContext) _RouterSpecRateLimit_enabled(ctx context.Context, fi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Enabled, nil + return obj.Value, 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_RouterSpecRateLimit_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "RouterSpecRateLimit", - 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) _RouterSpecRateLimit_rpm(ctx context.Context, field graphql.CollectedField, obj *model.RouterSpecRateLimit) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterSpecRateLimit_rpm(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Rpm, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { return graphql.Null } - res := resTmp.(*int) + res := resTmp.(string) fc.Result = res - return ec.marshalOInt2ᚖint(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterSpecRateLimit_rpm(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___pkg___types__EncodedString_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterSpecRateLimit", + Object: "Github__com___kloudlite___api___pkg___types__EncodedString", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _RouterSpecRateLimit_rps(ctx context.Context, field graphql.CollectedField, obj *model.RouterSpecRateLimit) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterSpecRateLimit_rps(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx, field) if err != nil { return graphql.Null } @@ -17936,35 +13801,38 @@ func (ec *executionContext) _RouterSpecRateLimit_rps(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Rps, nil + return obj.Action, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*int) + res := resTmp.(types.SyncAction) fc.Result = res - return ec.marshalOInt2ᚖint(ctx, field.Selections, res) + return ec.marshalNGithub__com___kloudlite___api___pkg___types__SyncAction2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncAction(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterSpecRateLimit_rps(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterSpecRateLimit", + Object: "Github__com___kloudlite___api___pkg___types__SyncStatus", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type Github__com___kloudlite___api___pkg___types__SyncAction does not have child fields") }, } return fc, nil } -func (ec *executionContext) _RouterSpecRoutes_app(ctx context.Context, field graphql.CollectedField, obj *model.RouterSpecRoutes) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterSpecRoutes_app(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx, field) if err != nil { return graphql.Null } @@ -17977,7 +13845,7 @@ func (ec *executionContext) _RouterSpecRoutes_app(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.App, nil + return obj.Error, nil }) if err != nil { ec.Error(ctx, err) @@ -17991,9 +13859,9 @@ func (ec *executionContext) _RouterSpecRoutes_app(ctx context.Context, field gra return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterSpecRoutes_app(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterSpecRoutes", + Object: "Github__com___kloudlite___api___pkg___types__SyncStatus", Field: field, IsMethod: false, IsResolver: false, @@ -18004,8 +13872,8 @@ func (ec *executionContext) fieldContext_RouterSpecRoutes_app(ctx context.Contex return fc, nil } -func (ec *executionContext) _RouterSpecRoutes_lambda(ctx context.Context, field graphql.CollectedField, obj *model.RouterSpecRoutes) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterSpecRoutes_lambda(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx, field) if err != nil { return graphql.Null } @@ -18018,7 +13886,7 @@ func (ec *executionContext) _RouterSpecRoutes_lambda(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Lambda, nil + return ec.resolvers.Github__com___kloudlite___api___pkg___types__SyncStatus().LastSyncedAt(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -18029,24 +13897,24 @@ func (ec *executionContext) _RouterSpecRoutes_lambda(ctx context.Context, field } res := resTmp.(*string) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalODate2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterSpecRoutes_lambda(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterSpecRoutes", + Object: "Github__com___kloudlite___api___pkg___types__SyncStatus", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Date does not have child fields") }, } return fc, nil } -func (ec *executionContext) _RouterSpecRoutes_path(ctx context.Context, field graphql.CollectedField, obj *model.RouterSpecRoutes) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterSpecRoutes_path(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx, field) if err != nil { return graphql.Null } @@ -18059,7 +13927,7 @@ func (ec *executionContext) _RouterSpecRoutes_path(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Path, nil + return obj.RecordVersion, nil }) if err != nil { ec.Error(ctx, err) @@ -18071,26 +13939,26 @@ func (ec *executionContext) _RouterSpecRoutes_path(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(string) + res := resTmp.(int) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterSpecRoutes_path(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterSpecRoutes", + Object: "Github__com___kloudlite___api___pkg___types__SyncStatus", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _RouterSpecRoutes_port(ctx context.Context, field graphql.CollectedField, obj *model.RouterSpecRoutes) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterSpecRoutes_port(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx, field) if err != nil { return graphql.Null } @@ -18103,7 +13971,7 @@ func (ec *executionContext) _RouterSpecRoutes_port(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Port, nil + return obj.State, nil }) if err != nil { ec.Error(ctx, err) @@ -18115,26 +13983,26 @@ func (ec *executionContext) _RouterSpecRoutes_port(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(int) + res := resTmp.(types.SyncState) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNGithub__com___kloudlite___api___pkg___types__SyncState2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncState(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterSpecRoutes_port(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterSpecRoutes", + Object: "Github__com___kloudlite___api___pkg___types__SyncStatus", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type Github__com___kloudlite___api___pkg___types__SyncState does not have child fields") }, } return fc, nil } -func (ec *executionContext) _RouterSpecRoutes_rewrite(ctx context.Context, field graphql.CollectedField, obj *model.RouterSpecRoutes) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterSpecRoutes_rewrite(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx, field) if err != nil { return graphql.Null } @@ -18147,7 +14015,7 @@ func (ec *executionContext) _RouterSpecRoutes_rewrite(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Rewrite, nil + return ec.resolvers.Github__com___kloudlite___api___pkg___types__SyncStatus().SyncScheduledAt(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -18156,26 +14024,26 @@ func (ec *executionContext) _RouterSpecRoutes_rewrite(ctx context.Context, field if resTmp == nil { return graphql.Null } - res := resTmp.(*bool) + res := resTmp.(*string) fc.Result = res - return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) + return ec.marshalODate2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterSpecRoutes_rewrite(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterSpecRoutes", + Object: "Github__com___kloudlite___api___pkg___types__SyncStatus", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type Date does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Secret_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_syncStatus(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppContainer_args(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppContainer) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_args(ctx, field) if err != nil { return graphql.Null } @@ -18188,7 +14056,7 @@ func (ec *executionContext) _Secret_syncStatus(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.SyncStatus, nil + return obj.Args, nil }) if err != nil { ec.Error(ctx, err) @@ -18197,40 +14065,26 @@ func (ec *executionContext) _Secret_syncStatus(ctx context.Context, field graphq if resTmp == nil { return graphql.Null } - res := resTmp.(types.SyncStatus) + res := resTmp.([]string) fc.Result = res - return ec.marshalOSyncStatus2kloudliteᚗioᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) + return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Secret_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Secret", + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppContainer", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "syncScheduledAt": - return ec.fieldContext_SyncStatus_syncScheduledAt(ctx, field) - case "lastSyncedAt": - return ec.fieldContext_SyncStatus_lastSyncedAt(ctx, field) - case "action": - return ec.fieldContext_SyncStatus_action(ctx, field) - case "generation": - return ec.fieldContext_SyncStatus_generation(ctx, field) - case "state": - return ec.fieldContext_SyncStatus_state(ctx, field) - case "error": - return ec.fieldContext_SyncStatus_error(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type SyncStatus", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Secret_data(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_data(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppContainer_command(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppContainer) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_command(ctx, field) if err != nil { return graphql.Null } @@ -18243,7 +14097,7 @@ func (ec *executionContext) _Secret_data(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Secret().Data(rctx, obj) + return obj.Command, nil }) if err != nil { ec.Error(ctx, err) @@ -18252,26 +14106,26 @@ func (ec *executionContext) _Secret_data(ctx context.Context, field graphql.Coll if resTmp == nil { return graphql.Null } - res := resTmp.(map[string]interface{}) + res := resTmp.([]string) fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) + return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Secret_data(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_command(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Secret", + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppContainer", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Secret_enabled(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_enabled(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppContainer_env(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppContainer) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_env(ctx, field) if err != nil { return graphql.Null } @@ -18284,7 +14138,7 @@ func (ec *executionContext) _Secret_enabled(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Enabled, nil + return obj.Env, nil }) if err != nil { ec.Error(ctx, err) @@ -18293,26 +14147,40 @@ func (ec *executionContext) _Secret_enabled(ctx context.Context, field graphql.C if resTmp == nil { return graphql.Null } - res := resTmp.(bool) + res := resTmp.([]*model.GithubComKloudliteOperatorApisCrdsV1ContainerEnv) fc.Result = res - return ec.marshalOBoolean2bool(ctx, field.Selections, res) + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__ContainerEnv2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerEnvᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Secret_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_env(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Secret", + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppContainer", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "key": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_key(ctx, field) + case "optional": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_optional(ctx, field) + case "refKey": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_refKey(ctx, field) + case "refName": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_refName(ctx, field) + case "type": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_type(ctx, field) + case "value": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_value(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv", field.Name) }, } return fc, nil } -func (ec *executionContext) _Secret_kind(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_kind(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppContainer_envFrom(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppContainer) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_envFrom(ctx, field) if err != nil { return graphql.Null } @@ -18325,7 +14193,7 @@ func (ec *executionContext) _Secret_kind(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Kind, nil + return obj.EnvFrom, nil }) if err != nil { ec.Error(ctx, err) @@ -18334,26 +14202,32 @@ func (ec *executionContext) _Secret_kind(ctx context.Context, field graphql.Coll if resTmp == nil { return graphql.Null } - res := resTmp.(string) + res := resTmp.([]*model.GithubComKloudliteOperatorApisCrdsV1EnvFrom) fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__EnvFrom2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1EnvFromᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Secret_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_envFrom(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Secret", + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppContainer", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "refName": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__EnvFrom_refName(ctx, field) + case "type": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__EnvFrom_type(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__EnvFrom", field.Name) }, } return fc, nil } -func (ec *executionContext) _Secret_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_metadata(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppContainer_image(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppContainer) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_image(ctx, field) if err != nil { return graphql.Null } @@ -18366,7 +14240,7 @@ func (ec *executionContext) _Secret_metadata(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ObjectMeta, nil + return obj.Image, nil }) if err != nil { ec.Error(ctx, err) @@ -18378,42 +14252,26 @@ func (ec *executionContext) _Secret_metadata(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.(v1.ObjectMeta) + res := resTmp.(string) fc.Result = res - return ec.marshalNMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Secret_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_image(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Secret", + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppContainer", 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_Metadata_name(ctx, field) - case "namespace": - return ec.fieldContext_Metadata_namespace(ctx, field) - case "labels": - return ec.fieldContext_Metadata_labels(ctx, field) - case "annotations": - return ec.fieldContext_Metadata_annotations(ctx, field) - case "creationTimestamp": - return ec.fieldContext_Metadata_creationTimestamp(ctx, field) - case "deletionTimestamp": - return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) - case "generation": - return ec.fieldContext_Metadata_generation(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Secret_projectName(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_projectName(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppContainer_imagePullPolicy(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppContainer) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_imagePullPolicy(ctx, field) if err != nil { return graphql.Null } @@ -18426,7 +14284,7 @@ func (ec *executionContext) _Secret_projectName(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ProjectName, nil + return obj.ImagePullPolicy, nil }) if err != nil { ec.Error(ctx, err) @@ -18435,14 +14293,14 @@ func (ec *executionContext) _Secret_projectName(ctx context.Context, field graph if resTmp == nil { return graphql.Null } - res := resTmp.(string) + res := resTmp.(*string) fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Secret_projectName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_imagePullPolicy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Secret", + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppContainer", Field: field, IsMethod: false, IsResolver: false, @@ -18453,8 +14311,8 @@ func (ec *executionContext) fieldContext_Secret_projectName(ctx context.Context, return fc, nil } -func (ec *executionContext) _Secret_status(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_status(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppContainer_livenessProbe(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppContainer) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_livenessProbe(ctx, field) if err != nil { return graphql.Null } @@ -18467,7 +14325,7 @@ func (ec *executionContext) _Secret_status(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Status, nil + return obj.LivenessProbe, nil }) if err != nil { ec.Error(ctx, err) @@ -18476,34 +14334,42 @@ func (ec *executionContext) _Secret_status(ctx context.Context, field graphql.Co if resTmp == nil { return graphql.Null } - res := resTmp.(operator.Status) + res := resTmp.(*model.GithubComKloudliteOperatorApisCrdsV1Probe) fc.Result = res - return ec.marshalOStatus2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__Probe2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1Probe(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Secret_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_livenessProbe(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Secret", + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppContainer", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "isReady": - return ec.fieldContext_Status_isReady(ctx, field) - case "checks": - return ec.fieldContext_Status_checks(ctx, field) - case "displayVars": - return ec.fieldContext_Status_displayVars(ctx, field) + case "failureThreshold": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Probe_failureThreshold(ctx, field) + case "httpGet": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Probe_httpGet(ctx, field) + case "initialDelay": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Probe_initialDelay(ctx, field) + case "interval": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Probe_interval(ctx, field) + case "shell": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Probe_shell(ctx, field) + case "tcp": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Probe_tcp(ctx, field) + case "type": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Probe_type(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Status", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__Probe", field.Name) }, } return fc, nil } -func (ec *executionContext) _Secret_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_apiVersion(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppContainer_name(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppContainer) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_name(ctx, field) if err != nil { return graphql.Null } @@ -18516,23 +14382,26 @@ func (ec *executionContext) _Secret_apiVersion(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.APIVersion, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } res := resTmp.(string) fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Secret_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Secret", + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppContainer", Field: field, IsMethod: false, IsResolver: false, @@ -18543,8 +14412,8 @@ func (ec *executionContext) fieldContext_Secret_apiVersion(ctx context.Context, return fc, nil } -func (ec *executionContext) _Secret_overrides(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_overrides(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppContainer_readinessProbe(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppContainer) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_readinessProbe(ctx, field) if err != nil { return graphql.Null } @@ -18557,7 +14426,7 @@ func (ec *executionContext) _Secret_overrides(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Overrides, nil + return obj.ReadinessProbe, nil }) if err != nil { ec.Error(ctx, err) @@ -18566,32 +14435,42 @@ func (ec *executionContext) _Secret_overrides(ctx context.Context, field graphql if resTmp == nil { return graphql.Null } - res := resTmp.(*v11.JsonPatch) + res := resTmp.(*model.GithubComKloudliteOperatorApisCrdsV1Probe) fc.Result = res - return ec.marshalOOverrides2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋapisᚋcrdsᚋv1ᚐJsonPatch(ctx, field.Selections, res) + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__Probe2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1Probe(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Secret_overrides(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_readinessProbe(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Secret", + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppContainer", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "applied": - return ec.fieldContext_Overrides_applied(ctx, field) - case "patches": - return ec.fieldContext_Overrides_patches(ctx, field) + case "failureThreshold": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Probe_failureThreshold(ctx, field) + case "httpGet": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Probe_httpGet(ctx, field) + case "initialDelay": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Probe_initialDelay(ctx, field) + case "interval": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Probe_interval(ctx, field) + case "shell": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Probe_shell(ctx, field) + case "tcp": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Probe_tcp(ctx, field) + case "type": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Probe_type(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Overrides", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__Probe", field.Name) }, } return fc, nil } -func (ec *executionContext) _Secret_stringData(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_stringData(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppContainer_resourceCpu(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppContainer) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_resourceCpu(ctx, field) if err != nil { return graphql.Null } @@ -18604,7 +14483,7 @@ func (ec *executionContext) _Secret_stringData(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Secret().StringData(rctx, obj) + return obj.ResourceCPU, nil }) if err != nil { ec.Error(ctx, err) @@ -18613,26 +14492,32 @@ func (ec *executionContext) _Secret_stringData(ctx context.Context, field graphq if resTmp == nil { return graphql.Null } - res := resTmp.(map[string]interface{}) + res := resTmp.(*model.GithubComKloudliteOperatorApisCrdsV1ContainerResource) fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__ContainerResource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerResource(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Secret_stringData(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_resourceCpu(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Secret", + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppContainer", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") + switch field.Name { + case "max": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerResource_max(ctx, field) + case "min": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerResource_min(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__ContainerResource", field.Name) }, } return fc, nil } -func (ec *executionContext) _Secret_type(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_type(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppContainer_resourceMemory(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppContainer) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_resourceMemory(ctx, field) if err != nil { return graphql.Null } @@ -18645,7 +14530,7 @@ func (ec *executionContext) _Secret_type(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Secret().Type(rctx, obj) + return obj.ResourceMemory, nil }) if err != nil { ec.Error(ctx, err) @@ -18654,26 +14539,32 @@ func (ec *executionContext) _Secret_type(ctx context.Context, field graphql.Coll if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.(*model.GithubComKloudliteOperatorApisCrdsV1ContainerResource) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__ContainerResource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerResource(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Secret_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_resourceMemory(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Secret", + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppContainer", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "max": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerResource_max(ctx, field) + case "min": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerResource_min(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__ContainerResource", field.Name) }, } return fc, nil } -func (ec *executionContext) _Status_isReady(ctx context.Context, field graphql.CollectedField, obj *operator.Status) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Status_isReady(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppContainer_volumes(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppContainer) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_volumes(ctx, field) if err != nil { return graphql.Null } @@ -18686,7 +14577,58 @@ func (ec *executionContext) _Status_isReady(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.IsReady, nil + return obj.Volumes, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.GithubComKloudliteOperatorApisCrdsV1ContainerVolume) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__ContainerVolume2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerVolumeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_volumes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppContainer", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "items": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume_items(ctx, field) + case "mountPath": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume_mountPath(ctx, field) + case "refName": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume_refName(ctx, field) + case "type": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume_type(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppSpec_containers(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_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) @@ -18698,26 +14640,52 @@ func (ec *executionContext) _Status_isReady(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.(bool) + res := resTmp.([]*model.GithubComKloudliteOperatorApisCrdsV1AppContainer) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNGithub__com___kloudlite___operator___apis___crds___v1__AppContainer2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppContainerᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Status_isReady(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_containers(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Status", + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppSpec", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "args": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_args(ctx, field) + case "command": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_command(ctx, field) + case "env": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_env(ctx, field) + case "envFrom": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_envFrom(ctx, field) + case "image": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_image(ctx, field) + case "imagePullPolicy": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_imagePullPolicy(ctx, field) + case "livenessProbe": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_livenessProbe(ctx, field) + case "name": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_name(ctx, field) + case "readinessProbe": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_readinessProbe(ctx, field) + case "resourceCpu": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_resourceCpu(ctx, field) + case "resourceMemory": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_resourceMemory(ctx, field) + case "volumes": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppContainer_volumes(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__AppContainer", field.Name) }, } return fc, nil } -func (ec *executionContext) _Status_checks(ctx context.Context, field graphql.CollectedField, obj *operator.Status) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Status_checks(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppSpec_displayName(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_displayName(ctx, field) if err != nil { return graphql.Null } @@ -18730,7 +14698,7 @@ func (ec *executionContext) _Status_checks(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Status().Checks(rctx, obj) + return obj.DisplayName, nil }) if err != nil { ec.Error(ctx, err) @@ -18739,26 +14707,26 @@ func (ec *executionContext) _Status_checks(ctx context.Context, field graphql.Co if resTmp == nil { return graphql.Null } - res := resTmp.(map[string]interface{}) + res := resTmp.(*string) fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Status_checks(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Status", + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppSpec", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Status_displayVars(ctx context.Context, field graphql.CollectedField, obj *operator.Status) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Status_displayVars(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppSpec_freeze(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_freeze(ctx, field) if err != nil { return graphql.Null } @@ -18771,7 +14739,7 @@ func (ec *executionContext) _Status_displayVars(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Status().DisplayVars(rctx, obj) + return obj.Freeze, nil }) if err != nil { ec.Error(ctx, err) @@ -18780,26 +14748,26 @@ func (ec *executionContext) _Status_displayVars(ctx context.Context, field graph if resTmp == nil { return graphql.Null } - res := resTmp.(map[string]interface{}) + res := resTmp.(*bool) fc.Result = res - return ec.marshalOJson2map(ctx, field.Selections, res) + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Status_displayVars(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_freeze(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Status", + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppSpec", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Json does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _SyncStatus_syncScheduledAt(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SyncStatus_syncScheduledAt(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppSpec_hpa(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_hpa(ctx, field) if err != nil { return graphql.Null } @@ -18812,38 +14780,47 @@ func (ec *executionContext) _SyncStatus_syncScheduledAt(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.SyncStatus().SyncScheduledAt(rctx, obj) + return obj.Hpa, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*model.GithubComKloudliteOperatorApisCrdsV1Hpa) fc.Result = res - return ec.marshalNDate2string(ctx, field.Selections, res) + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__HPA2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1Hpa(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SyncStatus_syncScheduledAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_hpa(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SyncStatus", + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppSpec", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Date does not have child fields") + switch field.Name { + case "enabled": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HPA_enabled(ctx, field) + case "maxReplicas": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HPA_maxReplicas(ctx, field) + case "minReplicas": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HPA_minReplicas(ctx, field) + case "thresholdCpu": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HPA_thresholdCpu(ctx, field) + case "thresholdMemory": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HPA_thresholdMemory(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__HPA", field.Name) }, } return fc, nil } -func (ec *executionContext) _SyncStatus_lastSyncedAt(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SyncStatus_lastSyncedAt(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppSpec_intercept(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_intercept(ctx, field) if err != nil { return graphql.Null } @@ -18856,7 +14833,7 @@ func (ec *executionContext) _SyncStatus_lastSyncedAt(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.SyncStatus().LastSyncedAt(rctx, obj) + return obj.Intercept, nil }) if err != nil { ec.Error(ctx, err) @@ -18865,26 +14842,32 @@ func (ec *executionContext) _SyncStatus_lastSyncedAt(ctx context.Context, field if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.(*model.GithubComKloudliteOperatorApisCrdsV1Intercept) fc.Result = res - return ec.marshalODate2ᚖstring(ctx, field.Selections, res) + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__Intercept2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1Intercept(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SyncStatus_lastSyncedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_intercept(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SyncStatus", + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppSpec", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Date does not have child fields") + switch field.Name { + case "enabled": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Intercept_enabled(ctx, field) + case "toDevice": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Intercept_toDevice(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__Intercept", field.Name) }, } return fc, nil } -func (ec *executionContext) _SyncStatus_action(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SyncStatus_action(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppSpec_nodeSelector(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_nodeSelector(ctx, field) if err != nil { return graphql.Null } @@ -18897,38 +14880,35 @@ func (ec *executionContext) _SyncStatus_action(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Action, nil + return obj.NodeSelector, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(types.SyncAction) + res := resTmp.(map[string]interface{}) fc.Result = res - return ec.marshalNSyncAction2kloudliteᚗioᚋpkgᚋtypesᚐSyncAction(ctx, field.Selections, res) + return ec.marshalOMap2map(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SyncStatus_action(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_nodeSelector(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SyncStatus", + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppSpec", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type SyncAction does not have child fields") + return nil, errors.New("field of type Map does not have child fields") }, } return fc, nil } -func (ec *executionContext) _SyncStatus_generation(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SyncStatus_generation(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppSpec_region(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_region(ctx, field) if err != nil { return graphql.Null } @@ -18941,38 +14921,35 @@ func (ec *executionContext) _SyncStatus_generation(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Generation, nil + return obj.Region, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(int64) + res := resTmp.(*string) fc.Result = res - return ec.marshalNInt2int64(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SyncStatus_generation(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_region(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SyncStatus", + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppSpec", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _SyncStatus_state(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SyncStatus_state(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppSpec_replicas(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_replicas(ctx, field) if err != nil { return graphql.Null } @@ -18985,38 +14962,35 @@ func (ec *executionContext) _SyncStatus_state(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.State, nil + return obj.Replicas, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(types.SyncState) + res := resTmp.(*int) fc.Result = res - return ec.marshalNSyncState2kloudliteᚗioᚋpkgᚋtypesᚐSyncState(ctx, field.Selections, res) + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SyncStatus_state(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_replicas(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SyncStatus", + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppSpec", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type SyncState does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _SyncStatus_error(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SyncStatus_error(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppSpec_serviceAccount(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_serviceAccount(ctx, field) if err != nil { return graphql.Null } @@ -19029,7 +15003,7 @@ func (ec *executionContext) _SyncStatus_error(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Error, nil + return obj.ServiceAccount, nil }) if err != nil { ec.Error(ctx, err) @@ -19043,9 +15017,9 @@ func (ec *executionContext) _SyncStatus_error(ctx context.Context, field graphql return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SyncStatus_error(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_serviceAccount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SyncStatus", + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppSpec", Field: field, IsMethod: false, IsResolver: false, @@ -19056,8 +15030,8 @@ func (ec *executionContext) fieldContext_SyncStatus_error(ctx context.Context, f return fc, nil } -func (ec *executionContext) _Workspace_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.Workspace) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Workspace_metadata(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppSpec_services(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_services(ctx, field) if err != nil { return graphql.Null } @@ -19070,54 +15044,45 @@ func (ec *executionContext) _Workspace_metadata(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ObjectMeta, nil + return obj.Services, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(v1.ObjectMeta) + res := resTmp.([]*model.GithubComKloudliteOperatorApisCrdsV1AppSvc) fc.Result = res - return ec.marshalNMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__AppSvc2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppSvcᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Workspace_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_services(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Workspace", + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppSpec", 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_Metadata_name(ctx, field) - case "namespace": - return ec.fieldContext_Metadata_namespace(ctx, field) - case "labels": - return ec.fieldContext_Metadata_labels(ctx, field) - case "annotations": - return ec.fieldContext_Metadata_annotations(ctx, field) - case "creationTimestamp": - return ec.fieldContext_Metadata_creationTimestamp(ctx, field) - case "deletionTimestamp": - return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) - case "generation": - return ec.fieldContext_Metadata_generation(ctx, field) + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSvc_name(ctx, field) + case "port": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSvc_port(ctx, field) + case "targetPort": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSvc_targetPort(ctx, field) + case "type": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSvc_type(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__AppSvc", field.Name) }, } return fc, nil } -func (ec *executionContext) _Workspace_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.Workspace) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Workspace_syncStatus(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppSpec_tolerations(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_tolerations(ctx, field) if err != nil { return graphql.Null } @@ -19130,7 +15095,7 @@ func (ec *executionContext) _Workspace_syncStatus(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.SyncStatus, nil + return obj.Tolerations, nil }) if err != nil { ec.Error(ctx, err) @@ -19139,40 +15104,38 @@ func (ec *executionContext) _Workspace_syncStatus(ctx context.Context, field gra if resTmp == nil { return graphql.Null } - res := resTmp.(types.SyncStatus) + res := resTmp.([]*model.K8sIoAPICoreV1Toleration) fc.Result = res - return ec.marshalOSyncStatus2kloudliteᚗioᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) + return ec.marshalOK8s__io___api___core___v1__Toleration2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1Tolerationᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Workspace_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_tolerations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Workspace", + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppSpec", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "syncScheduledAt": - return ec.fieldContext_SyncStatus_syncScheduledAt(ctx, field) - case "lastSyncedAt": - return ec.fieldContext_SyncStatus_lastSyncedAt(ctx, field) - case "action": - return ec.fieldContext_SyncStatus_action(ctx, field) - case "generation": - return ec.fieldContext_SyncStatus_generation(ctx, field) - case "state": - return ec.fieldContext_SyncStatus_state(ctx, field) - case "error": - return ec.fieldContext_SyncStatus_error(ctx, field) + case "effect": + return ec.fieldContext_K8s__io___api___core___v1__Toleration_effect(ctx, field) + case "key": + return ec.fieldContext_K8s__io___api___core___v1__Toleration_key(ctx, field) + case "operator": + return ec.fieldContext_K8s__io___api___core___v1__Toleration_operator(ctx, field) + case "tolerationSeconds": + return ec.fieldContext_K8s__io___api___core___v1__Toleration_tolerationSeconds(ctx, field) + case "value": + return ec.fieldContext_K8s__io___api___core___v1__Toleration_value(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type SyncStatus", field.Name) + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__Toleration", field.Name) }, } return fc, nil } -func (ec *executionContext) _Workspace_spec(ctx context.Context, field graphql.CollectedField, obj *entities.Workspace) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Workspace_spec(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppSvc_name(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppSvc) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSvc_name(ctx, field) if err != nil { return graphql.Null } @@ -19185,7 +15148,7 @@ func (ec *executionContext) _Workspace_spec(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Workspace().Spec(rctx, obj) + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -19194,32 +15157,26 @@ func (ec *executionContext) _Workspace_spec(ctx context.Context, field graphql.C if resTmp == nil { return graphql.Null } - res := resTmp.(*model.WorkspaceSpec) + res := resTmp.(*string) fc.Result = res - return ec.marshalOWorkspaceSpec2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐWorkspaceSpec(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Workspace_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSvc_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Workspace", + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppSvc", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "projectName": - return ec.fieldContext_WorkspaceSpec_projectName(ctx, field) - case "targetNamespace": - return ec.fieldContext_WorkspaceSpec_targetNamespace(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type WorkspaceSpec", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Workspace_status(ctx context.Context, field graphql.CollectedField, obj *entities.Workspace) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Workspace_status(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppSvc_port(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppSvc) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSvc_port(ctx, field) if err != nil { return graphql.Null } @@ -19232,43 +15189,38 @@ func (ec *executionContext) _Workspace_status(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Status, nil + return obj.Port, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(operator.Status) + res := resTmp.(int) fc.Result = res - return ec.marshalOStatus2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Workspace_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSvc_port(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Workspace", + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppSvc", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "isReady": - return ec.fieldContext_Status_isReady(ctx, field) - case "checks": - return ec.fieldContext_Status_checks(ctx, field) - case "displayVars": - return ec.fieldContext_Status_displayVars(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Status", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Workspace_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Workspace) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Workspace_apiVersion(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppSvc_targetPort(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppSvc) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSvc_targetPort(ctx, field) if err != nil { return graphql.Null } @@ -19281,7 +15233,7 @@ func (ec *executionContext) _Workspace_apiVersion(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.APIVersion, nil + return obj.TargetPort, nil }) if err != nil { ec.Error(ctx, err) @@ -19290,26 +15242,26 @@ func (ec *executionContext) _Workspace_apiVersion(ctx context.Context, field gra if resTmp == nil { return graphql.Null } - res := resTmp.(string) + res := resTmp.(*int) fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Workspace_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSvc_targetPort(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Workspace", + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppSvc", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Workspace_kind(ctx context.Context, field graphql.CollectedField, obj *entities.Workspace) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Workspace_kind(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppSvc_type(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppSvc) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSvc_type(ctx, field) if err != nil { return graphql.Null } @@ -19322,7 +15274,7 @@ func (ec *executionContext) _Workspace_kind(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Kind, nil + return obj.Type, nil }) if err != nil { ec.Error(ctx, err) @@ -19331,14 +15283,14 @@ func (ec *executionContext) _Workspace_kind(ctx context.Context, field graphql.C if resTmp == nil { return graphql.Null } - res := resTmp.(string) + res := resTmp.(*string) fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Workspace_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSvc_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Workspace", + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppSvc", Field: field, IsMethod: false, IsResolver: false, @@ -19349,8 +15301,8 @@ func (ec *executionContext) fieldContext_Workspace_kind(ctx context.Context, fie return fc, nil } -func (ec *executionContext) _WorkspaceSpec_projectName(ctx context.Context, field graphql.CollectedField, obj *model.WorkspaceSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_WorkspaceSpec_projectName(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__BasicAuth_enabled(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1BasicAuth) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__BasicAuth_enabled(ctx, field) if err != nil { return graphql.Null } @@ -19363,7 +15315,7 @@ func (ec *executionContext) _WorkspaceSpec_projectName(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ProjectName, nil + return obj.Enabled, nil }) if err != nil { ec.Error(ctx, err) @@ -19375,26 +15327,26 @@ func (ec *executionContext) _WorkspaceSpec_projectName(ctx context.Context, fiel } return graphql.Null } - res := resTmp.(string) + res := resTmp.(bool) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_WorkspaceSpec_projectName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__BasicAuth_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "WorkspaceSpec", + Object: "Github__com___kloudlite___operator___apis___crds___v1__BasicAuth", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _WorkspaceSpec_targetNamespace(ctx context.Context, field graphql.CollectedField, obj *model.WorkspaceSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_WorkspaceSpec_targetNamespace(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__BasicAuth_secretName(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1BasicAuth) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__BasicAuth_secretName(ctx, field) if err != nil { return graphql.Null } @@ -19407,26 +15359,23 @@ func (ec *executionContext) _WorkspaceSpec_targetNamespace(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.TargetNamespace, nil + return obj.SecretName, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*string) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_WorkspaceSpec_targetNamespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__BasicAuth_secretName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "WorkspaceSpec", + Object: "Github__com___kloudlite___operator___apis___crds___v1__BasicAuth", Field: field, IsMethod: false, IsResolver: false, @@ -19437,8 +15386,8 @@ func (ec *executionContext) fieldContext_WorkspaceSpec_targetNamespace(ctx conte return fc, nil } -func (ec *executionContext) __Service_sdl(ctx context.Context, field graphql.CollectedField, obj *fedruntime.Service) (ret graphql.Marshaler) { - fc, err := ec.fieldContext__Service_sdl(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__BasicAuth_username(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1BasicAuth) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__BasicAuth_username(ctx, field) if err != nil { return graphql.Null } @@ -19451,7 +15400,7 @@ func (ec *executionContext) __Service_sdl(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.SDL, nil + return obj.Username, nil }) if err != nil { ec.Error(ctx, err) @@ -19460,14 +15409,14 @@ func (ec *executionContext) __Service_sdl(ctx context.Context, field graphql.Col if resTmp == nil { return graphql.Null } - res := resTmp.(string) + res := resTmp.(*string) fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext__Service_sdl(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__BasicAuth_username(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "_Service", + Object: "Github__com___kloudlite___operator___apis___crds___v1__BasicAuth", Field: field, IsMethod: false, IsResolver: false, @@ -19478,8 +15427,8 @@ func (ec *executionContext) fieldContext__Service_sdl(ctx context.Context, field return fc, nil } -func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_name(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_key(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ContainerEnv) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_key(ctx, field) if err != nil { return graphql.Null } @@ -19492,7 +15441,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.Key, nil }) if err != nil { ec.Error(ctx, err) @@ -19509,9 +15458,9 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_key(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv", Field: field, IsMethod: false, IsResolver: false, @@ -19522,8 +15471,8 @@ func (ec *executionContext) fieldContext___Directive_name(ctx context.Context, f return fc, nil } -func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_description(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_optional(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ContainerEnv) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_optional(ctx, field) if err != nil { return graphql.Null } @@ -19536,7 +15485,48 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.Optional, 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_Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_optional(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv", + 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) _Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_refKey(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ContainerEnv) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_refKey(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RefKey, nil }) if err != nil { ec.Error(ctx, err) @@ -19550,11 +15540,11 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_refKey(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") @@ -19563,8 +15553,8 @@ func (ec *executionContext) fieldContext___Directive_description(ctx context.Con return fc, nil } -func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_locations(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_refName(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ContainerEnv) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_refName(ctx, field) if err != nil { return graphql.Null } @@ -19577,38 +15567,76 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Locations, nil + return obj.RefName, nil }) if err != nil { ec.Error(ctx, err) 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.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_refName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_type(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ContainerEnv) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_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 } - res := resTmp.([]string) + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorApisCrdsV1ConfigOrSecret) fc.Result = res - return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ConfigOrSecret(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_locations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv", 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 nil, errors.New("field of type Github__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret 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) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_value(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ContainerEnv) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_value(ctx, field) if err != nil { return graphql.Null } @@ -19621,48 +15649,164 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Args, nil + return obj.Value, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ContainerResource_max(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ContainerResource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerResource_max(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Max, nil + }) + if err != nil { + ec.Error(ctx, err) return graphql.Null } - res := resTmp.([]introspection.InputValue) + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) fc.Result = res - return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerResource_max(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "Github__com___kloudlite___operator___apis___crds___v1__ContainerResource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ContainerResource_min(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ContainerResource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerResource_min(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Min, nil + }) + 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_Github__com___kloudlite___operator___apis___crds___v1__ContainerResource_min(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__ContainerResource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume_items(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ContainerVolume) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume_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 { + return graphql.Null + } + res := resTmp.([]*model.GithubComKloudliteOperatorApisCrdsV1ContainerVolumeItem) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerVolumeItemᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume_items(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume", 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) + case "fileName": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem_fileName(ctx, field) + case "key": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem_key(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume_mountPath(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ContainerVolume) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume_mountPath(ctx, field) if err != nil { return graphql.Null } @@ -19675,7 +15819,7 @@ func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.IsRepeatable, nil + return obj.MountPath, nil }) if err != nil { ec.Error(ctx, err) @@ -19687,26 +15831,26 @@ func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume_mountPath(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_name(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume_refName(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ContainerVolume) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume_refName(ctx, field) if err != nil { return graphql.Null } @@ -19719,7 +15863,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.RefName, nil }) if err != nil { ec.Error(ctx, err) @@ -19736,9 +15880,9 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume_refName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume", Field: field, IsMethod: false, IsResolver: false, @@ -19749,8 +15893,8 @@ func (ec *executionContext) fieldContext___EnumValue_name(ctx context.Context, f return fc, nil } -func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_description(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume_type(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ContainerVolume) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume_type(ctx, field) if err != nil { return graphql.Null } @@ -19763,7 +15907,51 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.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.(model.GithubComKloudliteOperatorApisCrdsV1ConfigOrSecret) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ConfigOrSecret(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Github__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem_fileName(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ContainerVolumeItem) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem_fileName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.FileName, nil }) if err != nil { ec.Error(ctx, err) @@ -19777,11 +15965,11 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem_fileName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") @@ -19790,8 +15978,8 @@ func (ec *executionContext) fieldContext___EnumValue_description(ctx context.Con return fc, nil } -func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem_key(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ContainerVolumeItem) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem_key(ctx, field) if err != nil { return graphql.Null } @@ -19804,7 +15992,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.IsDeprecated(), nil + return obj.Key, nil }) if err != nil { ec.Error(ctx, err) @@ -19816,16 +16004,57 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem_key(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem", Field: field, - IsMethod: true, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__Cors_allowCredentials(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1Cors) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Cors_allowCredentials(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AllowCredentials, 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_Github__com___kloudlite___operator___apis___crds___v1__Cors_allowCredentials(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__Cors", + 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") @@ -19834,8 +16063,8 @@ func (ec *executionContext) fieldContext___EnumValue_isDeprecated(ctx context.Co return fc, nil } -func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__Cors_enabled(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1Cors) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Cors_enabled(ctx, field) if err != nil { return graphql.Null } @@ -19848,7 +16077,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.DeprecationReason(), nil + return obj.Enabled, nil }) if err != nil { ec.Error(ctx, err) @@ -19857,16 +16086,57 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.(*bool) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Cors_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "Github__com___kloudlite___operator___apis___crds___v1__Cors", Field: field, - IsMethod: true, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__Cors_origins(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1Cors) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Cors_origins(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Origins, nil + }) + 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_Github__com___kloudlite___operator___apis___crds___v1__Cors_origins(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__Cors", + Field: field, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") @@ -19875,8 +16145,8 @@ func (ec *executionContext) fieldContext___EnumValue_deprecationReason(ctx conte return fc, nil } -func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_name(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__EnvFrom_refName(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1EnvFrom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__EnvFrom_refName(ctx, field) if err != nil { return graphql.Null } @@ -19889,7 +16159,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.RefName, nil }) if err != nil { ec.Error(ctx, err) @@ -19906,9 +16176,9 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__EnvFrom_refName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "Github__com___kloudlite___operator___apis___crds___v1__EnvFrom", Field: field, IsMethod: false, IsResolver: false, @@ -19919,8 +16189,8 @@ func (ec *executionContext) fieldContext___Field_name(ctx context.Context, field return fc, nil } -func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_description(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__EnvFrom_type(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1EnvFrom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__EnvFrom_type(ctx, field) if err != nil { return graphql.Null } @@ -19933,7 +16203,92 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.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.(model.GithubComKloudliteOperatorApisCrdsV1ConfigOrSecret) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ConfigOrSecret(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__EnvFrom_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__EnvFrom", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Github__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting_mode(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1EnvironmentRouting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting_mode(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Mode, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*v1.EnvironmentRoutingMode) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingMode2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋapisᚋcrdsᚋv1ᚐEnvironmentRoutingMode(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting_mode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingMode does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting_privateIngressClass(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1EnvironmentRouting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting_privateIngressClass(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PrivateIngressClass, nil }) if err != nil { ec.Error(ctx, err) @@ -19947,11 +16302,11 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting_privateIngressClass(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") @@ -19960,8 +16315,8 @@ func (ec *executionContext) fieldContext___Field_description(ctx context.Context return fc, nil } -func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_args(ctx, field) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting_publicIngressClass(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1EnvironmentRouting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting_publicIngressClass(ctx, field) if err != nil { return graphql.Null } @@ -19974,1354 +16329,22824 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Args, nil + return obj.PublicIngressClass, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.([]introspection.InputValue) + res := resTmp.(*string) fc.Result = res - return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting_publicIngressClass(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec_projectName(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1EnvironmentSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec_projectName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ProjectName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec_projectName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec_routing(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1EnvironmentSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec_routing(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Routing, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorApisCrdsV1EnvironmentRouting) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1EnvironmentRouting(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec_routing(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec", 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) + case "mode": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting_mode(ctx, field) + case "privateIngressClass": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting_privateIngressClass(ctx, field) + case "publicIngressClass": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting_publicIngressClass(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec_targetNamespace(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1EnvironmentSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec_targetNamespace(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TargetNamespace, nil + }) + 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_Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec_targetNamespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__HPA_enabled(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1Hpa) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HPA_enabled(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Enabled, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*bool) + fc.Result = res + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HPA_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__HPA", + 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) _Github__com___kloudlite___operator___apis___crds___v1__HPA_maxReplicas(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1Hpa) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HPA_maxReplicas(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MaxReplicas, 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_Github__com___kloudlite___operator___apis___crds___v1__HPA_maxReplicas(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__HPA", + 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) _Github__com___kloudlite___operator___apis___crds___v1__HPA_minReplicas(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1Hpa) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HPA_minReplicas(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MinReplicas, 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_Github__com___kloudlite___operator___apis___crds___v1__HPA_minReplicas(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__HPA", + 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) _Github__com___kloudlite___operator___apis___crds___v1__HPA_thresholdCpu(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1Hpa) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HPA_thresholdCpu(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ThresholdCPU, 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_Github__com___kloudlite___operator___apis___crds___v1__HPA_thresholdCpu(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__HPA", + 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) _Github__com___kloudlite___operator___apis___crds___v1__HPA_thresholdMemory(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1Hpa) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HPA_thresholdMemory(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ThresholdMemory, 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_Github__com___kloudlite___operator___apis___crds___v1__HPA_thresholdMemory(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__HPA", + 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) _Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe_httpHeaders(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1HTTPGetProbe) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe_httpHeaders(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.HTTPHeaders, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe_httpHeaders(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe_path(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1HTTPGetProbe) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe_path(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Path, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe_path(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe_port(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1HTTPGetProbe) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe_port(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Port, nil + }) + if err != nil { + ec.Error(ctx, 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_Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe_port(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe", + 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) _Github__com___kloudlite___operator___apis___crds___v1__Https_clusterIssuer(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1HTTPS) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Https_clusterIssuer(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ClusterIssuer, nil + }) + 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_Github__com___kloudlite___operator___apis___crds___v1__Https_clusterIssuer(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__Https", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__Https_enabled(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1HTTPS) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Https_enabled(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Enabled, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Https_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__Https", + 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) _Github__com___kloudlite___operator___apis___crds___v1__Https_forceRedirect(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1HTTPS) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Https_forceRedirect(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ForceRedirect, 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_Github__com___kloudlite___operator___apis___crds___v1__Https_forceRedirect(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__Https", + 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) _Github__com___kloudlite___operator___apis___crds___v1__Intercept_enabled(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1Intercept) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Intercept_enabled(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Enabled, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Intercept_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__Intercept", + 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) _Github__com___kloudlite___operator___apis___crds___v1__Intercept_toDevice(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1Intercept) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Intercept_toDevice(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ToDevice, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___crds___v1__Intercept_toDevice(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__Intercept", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec_resourceName(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ManagedResourceSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec_resourceName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ResourceName, nil + }) + 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_Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec_resourceName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec_resourceTemplate(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ManagedResourceSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec_resourceTemplate(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ResourceTemplate, nil + }) + if err != nil { + ec.Error(ctx, 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.GithubComKloudliteOperatorApisCrdsV1MresResourceTemplate) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1MresResourceTemplate(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec_resourceTemplate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "apiVersion": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_apiVersion(ctx, field) + case "kind": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_kind(ctx, field) + case "msvcRef": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_msvcRef(ctx, field) + case "spec": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_spec(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec_serviceTemplate(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec_serviceTemplate(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ServiceTemplate, nil + }) + if err != nil { + ec.Error(ctx, 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.GithubComKloudliteOperatorApisCrdsV1ServiceTemplate) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___operator___apis___crds___v1__ServiceTemplate2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ServiceTemplate(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec_serviceTemplate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "apiVersion": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_apiVersion(ctx, field) + case "kind": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_kind(ctx, field) + case "spec": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_spec(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_apiVersion(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1MresResourceTemplate) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_apiVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.APIVersion, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_kind(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1MresResourceTemplate) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_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_Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_msvcRef(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1MresResourceTemplate) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_msvcRef(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MsvcRef, nil + }) + if err != nil { + ec.Error(ctx, 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.GithubComKloudliteOperatorApisCrdsV1MsvcNamedRef) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1MsvcNamedRef(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_msvcRef(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "apiVersion": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef_apiVersion(ctx, field) + case "kind": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef_kind(ctx, field) + case "name": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef_name(ctx, field) + case "namespace": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_spec(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1MresResourceTemplate) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_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.(map[string]interface{}) + fc.Result = res + return ec.marshalNMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef_apiVersion(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1MsvcNamedRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef_apiVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.APIVersion, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef_kind(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1MsvcNamedRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef_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_Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef_name(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1MsvcNamedRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef_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_Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef_namespace(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1MsvcNamedRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef_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_Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__Probe_failureThreshold(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1Probe) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Probe_failureThreshold(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.FailureThreshold, 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_Github__com___kloudlite___operator___apis___crds___v1__Probe_failureThreshold(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__Probe", + 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) _Github__com___kloudlite___operator___apis___crds___v1__Probe_httpGet(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1Probe) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Probe_httpGet(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.HTTPGet, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorApisCrdsV1HTTPGetProbe) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__HttpGetProbe2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1HTTPGetProbe(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Probe_httpGet(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__Probe", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "httpHeaders": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe_httpHeaders(ctx, field) + case "path": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe_path(ctx, field) + case "port": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe_port(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__Probe_initialDelay(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1Probe) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Probe_initialDelay(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.InitialDelay, 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_Github__com___kloudlite___operator___apis___crds___v1__Probe_initialDelay(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__Probe", + 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) _Github__com___kloudlite___operator___apis___crds___v1__Probe_interval(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1Probe) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Probe_interval(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Interval, 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_Github__com___kloudlite___operator___apis___crds___v1__Probe_interval(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__Probe", + 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) _Github__com___kloudlite___operator___apis___crds___v1__Probe_shell(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1Probe) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Probe_shell(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Shell, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorApisCrdsV1ShellProbe) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__ShellProbe2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ShellProbe(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Probe_shell(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__Probe", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "command": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ShellProbe_command(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__ShellProbe", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__Probe_tcp(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1Probe) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Probe_tcp(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TCP, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorApisCrdsV1TCPProbe) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__TcpProbe2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1TCPProbe(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Probe_tcp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__Probe", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "port": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__TcpProbe_port(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__TcpProbe", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__Probe_type(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1Probe) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Probe_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_Github__com___kloudlite___operator___apis___crds___v1__Probe_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__Probe", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec_msvcSpec(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec_msvcSpec(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MsvcSpec, nil + }) + if err != nil { + ec.Error(ctx, 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.GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpec) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ManagedServiceSpec(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec_msvcSpec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "serviceTemplate": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec_serviceTemplate(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec_targetNamespace(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec_targetNamespace(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TargetNamespace, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec_targetNamespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec_targetNamespace(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ProjectSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec_targetNamespace(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TargetNamespace, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec_targetNamespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__RateLimit_connections(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1RateLimit) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RateLimit_connections(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Connections, 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_Github__com___kloudlite___operator___apis___crds___v1__RateLimit_connections(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__RateLimit", + 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) _Github__com___kloudlite___operator___apis___crds___v1__RateLimit_enabled(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1RateLimit) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RateLimit_enabled(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Enabled, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*bool) + fc.Result = res + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RateLimit_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__RateLimit", + 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) _Github__com___kloudlite___operator___apis___crds___v1__RateLimit_rpm(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1RateLimit) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RateLimit_rpm(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Rpm, 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_Github__com___kloudlite___operator___apis___crds___v1__RateLimit_rpm(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__RateLimit", + 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) _Github__com___kloudlite___operator___apis___crds___v1__RateLimit_rps(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1RateLimit) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RateLimit_rps(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Rps, 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_Github__com___kloudlite___operator___apis___crds___v1__RateLimit_rps(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__RateLimit", + 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) _Github__com___kloudlite___operator___apis___crds___v1__Route_app(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1Route) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Route_app(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.App, nil + }) + 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_Github__com___kloudlite___operator___apis___crds___v1__Route_app(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__Route", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__Route_lambda(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1Route) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Route_lambda(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Lambda, nil + }) + 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_Github__com___kloudlite___operator___apis___crds___v1__Route_lambda(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__Route", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__Route_path(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1Route) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Route_path(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Path, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___crds___v1__Route_path(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__Route", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__Route_port(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1Route) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Route_port(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Port, nil + }) + if err != nil { + ec.Error(ctx, 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_Github__com___kloudlite___operator___apis___crds___v1__Route_port(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__Route", + 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) _Github__com___kloudlite___operator___apis___crds___v1__Route_rewrite(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1Route) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Route_rewrite(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Rewrite, 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_Github__com___kloudlite___operator___apis___crds___v1__Route_rewrite(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__Route", + 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) _Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_backendProtocol(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1RouterSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_backendProtocol(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.BackendProtocol, nil + }) + 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_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_backendProtocol(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__RouterSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_basicAuth(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1RouterSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_basicAuth(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.BasicAuth, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorApisCrdsV1BasicAuth) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__BasicAuth2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1BasicAuth(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_basicAuth(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__RouterSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "enabled": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__BasicAuth_enabled(ctx, field) + case "secretName": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__BasicAuth_secretName(ctx, field) + case "username": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__BasicAuth_username(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__BasicAuth", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_cors(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1RouterSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_cors(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Cors, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorApisCrdsV1Cors) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__Cors2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1Cors(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_cors(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__RouterSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "allowCredentials": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Cors_allowCredentials(ctx, field) + case "enabled": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Cors_enabled(ctx, field) + case "origins": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Cors_origins(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__Cors", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_domains(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1RouterSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_domains(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Domains, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + 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_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_domains(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__RouterSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_https(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1RouterSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_https(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.HTTPS, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorApisCrdsV1HTTPS) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__Https2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1HTTPS(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_https(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__RouterSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "clusterIssuer": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Https_clusterIssuer(ctx, field) + case "enabled": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Https_enabled(ctx, field) + case "forceRedirect": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Https_forceRedirect(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__Https", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_ingressClass(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1RouterSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_ingressClass(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IngressClass, nil + }) + 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_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_ingressClass(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__RouterSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_maxBodySizeInMB(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1RouterSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_maxBodySizeInMB(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MaxBodySizeInMb, 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_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_maxBodySizeInMB(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__RouterSpec", + 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) _Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_rateLimit(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1RouterSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_rateLimit(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RateLimit, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorApisCrdsV1RateLimit) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__RateLimit2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1RateLimit(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_rateLimit(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__RouterSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "connections": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RateLimit_connections(ctx, field) + case "enabled": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RateLimit_enabled(ctx, field) + case "rpm": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RateLimit_rpm(ctx, field) + case "rps": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RateLimit_rps(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__RateLimit", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_routes(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1RouterSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_routes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Routes, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.GithubComKloudliteOperatorApisCrdsV1Route) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__Route2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1Routeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_routes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__RouterSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "app": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Route_app(ctx, field) + case "lambda": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Route_lambda(ctx, field) + case "path": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Route_path(ctx, field) + case "port": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Route_port(ctx, field) + case "rewrite": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Route_rewrite(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__Route", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_apiVersion(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ServiceTemplate) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_apiVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.APIVersion, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_kind(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ServiceTemplate) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_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_Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_spec(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ServiceTemplate) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_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.(map[string]interface{}) + fc.Result = res + return ec.marshalNMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ShellProbe_command(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ShellProbe) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ShellProbe_command(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Command, nil + }) + 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_Github__com___kloudlite___operator___apis___crds___v1__ShellProbe_command(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__ShellProbe", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__TcpProbe_port(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1TCPProbe) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__TcpProbe_port(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Port, nil + }) + if err != nil { + ec.Error(ctx, 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_Github__com___kloudlite___operator___apis___crds___v1__TcpProbe_port(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__TcpProbe", + 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) _Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord_host(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisWireguardV1CNameRecord) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord_host(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Host, nil + }) + 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_Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord_host(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord_target(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisWireguardV1CNameRecord) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord_target(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Target, nil + }) + 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_Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord_target(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_activeNamespace(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisWireguardV1DeviceSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_activeNamespace(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ActiveNamespace, nil + }) + 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_Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_activeNamespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_cnameRecords(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisWireguardV1DeviceSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_cnameRecords(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CnameRecords, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.GithubComKloudliteOperatorApisWireguardV1CNameRecord) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___wireguard___v1__CNameRecord2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisWireguardV1CNameRecordᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_cnameRecords(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "host": + return ec.fieldContext_Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord_host(ctx, field) + case "target": + return ec.fieldContext_Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord_target(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_disabled(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisWireguardV1DeviceSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_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_Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_disabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec", + 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) _Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_nodeSelector(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisWireguardV1DeviceSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_nodeSelector(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.NodeSelector, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_nodeSelector(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_noExternalService(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisWireguardV1DeviceSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_noExternalService(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.NoExternalService, 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_Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_noExternalService(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec", + 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) _Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_ports(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisWireguardV1DeviceSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_ports(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Ports, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.GithubComKloudliteOperatorApisWireguardV1Port) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___wireguard___v1__Port2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisWireguardV1Portᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_ports(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "port": + return ec.fieldContext_Github__com___kloudlite___operator___apis___wireguard___v1__Port_port(ctx, field) + case "targetPort": + return ec.fieldContext_Github__com___kloudlite___operator___apis___wireguard___v1__Port_targetPort(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___wireguard___v1__Port", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___wireguard___v1__Port_port(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisWireguardV1Port) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___wireguard___v1__Port_port(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Port, 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_Github__com___kloudlite___operator___apis___wireguard___v1__Port_port(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___wireguard___v1__Port", + 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) _Github__com___kloudlite___operator___apis___wireguard___v1__Port_targetPort(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisWireguardV1Port) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___wireguard___v1__Port_targetPort(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TargetPort, 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_Github__com___kloudlite___operator___apis___wireguard___v1__Port_targetPort(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___wireguard___v1__Port", + 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) _Github__com___kloudlite___operator___pkg___operator__Check_generation(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheck) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_generation(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Generation, 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_Github__com___kloudlite___operator___pkg___operator__Check_generation(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Check", + 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) _Github__com___kloudlite___operator___pkg___operator__Check_message(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheck) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_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_Github__com___kloudlite___operator___pkg___operator__Check_message(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Check", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Check_status(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheck) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_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.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Check", + 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) _Github__com___kloudlite___operator___pkg___operator__ResourceRef_apiVersion(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorResourceRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_apiVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.APIVersion, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___pkg___operator__ResourceRef_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__ResourceRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__ResourceRef_kind(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorResourceRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_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_Github__com___kloudlite___operator___pkg___operator__ResourceRef_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__ResourceRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__ResourceRef_name(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorResourceRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_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_Github__com___kloudlite___operator___pkg___operator__ResourceRef_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__ResourceRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__ResourceRef_namespace(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorResourceRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_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_Github__com___kloudlite___operator___pkg___operator__ResourceRef_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__ResourceRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx context.Context, field graphql.CollectedField, obj *operator.Status) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Github__com___kloudlite___operator___pkg___operator__Status().Checks(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Status", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Status_isReady(ctx context.Context, field graphql.CollectedField, obj *operator.Status) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_isReady(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsReady, nil + }) + if err != nil { + ec.Error(ctx, 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_Github__com___kloudlite___operator___pkg___operator__Status_isReady(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Status", + 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) _Github__com___kloudlite___operator___pkg___operator__Status_lastReadyGeneration(ctx context.Context, field graphql.CollectedField, obj *operator.Status) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReadyGeneration(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastReadyGeneration, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int64) + fc.Result = res + return ec.marshalOInt2int64(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReadyGeneration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Status", + 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) _Github__com___kloudlite___operator___pkg___operator__Status_lastReconcileTime(ctx context.Context, field graphql.CollectedField, obj *operator.Status) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReconcileTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Github__com___kloudlite___operator___pkg___operator__Status().LastReconcileTime(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalODate2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReconcileTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Status", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Status_message(ctx context.Context, field graphql.CollectedField, obj *operator.Status) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_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 ec.resolvers.Github__com___kloudlite___operator___pkg___operator__Status().Message(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorPkgRawJSONRawJSON) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___pkg___raw____json__RawJson2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgRawJSONRawJSON(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_message(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Status", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "RawMessage": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___raw____json__RawJson_RawMessage(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___pkg___raw____json__RawJson", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Status_resources(ctx context.Context, field graphql.CollectedField, obj *operator.Status) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_resources(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Github__com___kloudlite___operator___pkg___operator__Status().Resources(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.GithubComKloudliteOperatorPkgOperatorResourceRef) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___pkg___operator__ResourceRef2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorResourceRefᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_resources(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Status", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "apiVersion": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_apiVersion(ctx, field) + case "kind": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_kind(ctx, field) + case "name": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_name(ctx, field) + case "namespace": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___pkg___operator__ResourceRef", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___raw____json__RawJson_RawMessage(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgRawJSONRawJSON) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___raw____json__RawJson_RawMessage(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RawMessage, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(interface{}) + fc.Result = res + return ec.marshalOAny2interface(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___raw____json__RawJson_RawMessage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___raw____json__RawJson", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Any does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ImagePullSecret_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.ImagePullSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ImagePullSecret_accountName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_ImagePullSecret_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ImagePullSecret", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ImagePullSecret_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.ImagePullSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ImagePullSecret_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ImagePullSecret_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ImagePullSecret", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ImagePullSecret_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.ImagePullSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ImagePullSecret_creationTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.ImagePullSecret().CreationTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ImagePullSecret_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ImagePullSecret", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ImagePullSecret_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.ImagePullSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ImagePullSecret_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_ImagePullSecret_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ImagePullSecret", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ImagePullSecret_dockerConfigJson(ctx context.Context, field graphql.CollectedField, obj *entities.ImagePullSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ImagePullSecret_dockerConfigJson(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DockerConfigJson, nil + }) + 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_ImagePullSecret_dockerConfigJson(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ImagePullSecret", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ImagePullSecret_environmentName(ctx context.Context, field graphql.CollectedField, obj *entities.ImagePullSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ImagePullSecret_environmentName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.EnvironmentName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_ImagePullSecret_environmentName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ImagePullSecret", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ImagePullSecret_format(ctx context.Context, field graphql.CollectedField, obj *entities.ImagePullSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ImagePullSecret_format(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.ImagePullSecret().Format(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.GithubComKloudliteAPIAppsConsoleInternalEntitiesPullSecretFormat) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___apps___console___internal___entities__PullSecretFormat2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsConsoleInternalEntitiesPullSecretFormat(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ImagePullSecret_format(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ImagePullSecret", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Github__com___kloudlite___api___apps___console___internal___entities__PullSecretFormat does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ImagePullSecret_id(ctx context.Context, field graphql.CollectedField, obj *entities.ImagePullSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ImagePullSecret_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 ec.resolvers.ImagePullSecret().ID(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_ImagePullSecret_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ImagePullSecret", + 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) _ImagePullSecret_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.ImagePullSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ImagePullSecret_lastUpdatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastUpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ImagePullSecret_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ImagePullSecret", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ImagePullSecret_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.ImagePullSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ImagePullSecret_markedForDeletion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MarkedForDeletion, 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_ImagePullSecret_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ImagePullSecret", + 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) _ImagePullSecret_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.ImagePullSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ImagePullSecret_metadata(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ObjectMeta, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(v12.ObjectMeta) + fc.Result = res + return ec.marshalNMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ImagePullSecret_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ImagePullSecret", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "annotations": + return ec.fieldContext_Metadata_annotations(ctx, field) + case "creationTimestamp": + return ec.fieldContext_Metadata_creationTimestamp(ctx, field) + case "deletionTimestamp": + return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) + case "generation": + return ec.fieldContext_Metadata_generation(ctx, field) + case "labels": + return ec.fieldContext_Metadata_labels(ctx, field) + case "name": + return ec.fieldContext_Metadata_name(ctx, field) + case "namespace": + return ec.fieldContext_Metadata_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ImagePullSecret_projectName(ctx context.Context, field graphql.CollectedField, obj *entities.ImagePullSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ImagePullSecret_projectName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ProjectName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_ImagePullSecret_projectName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ImagePullSecret", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ImagePullSecret_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.ImagePullSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ImagePullSecret_recordVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RecordVersion, nil + }) + if err != nil { + ec.Error(ctx, 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_ImagePullSecret_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ImagePullSecret", + 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) _ImagePullSecret_registryPassword(ctx context.Context, field graphql.CollectedField, obj *entities.ImagePullSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ImagePullSecret_registryPassword(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RegistryPassword, nil + }) + 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_ImagePullSecret_registryPassword(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ImagePullSecret", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ImagePullSecret_registryURL(ctx context.Context, field graphql.CollectedField, obj *entities.ImagePullSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ImagePullSecret_registryURL(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RegistryURL, nil + }) + 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_ImagePullSecret_registryURL(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ImagePullSecret", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ImagePullSecret_registryUsername(ctx context.Context, field graphql.CollectedField, obj *entities.ImagePullSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ImagePullSecret_registryUsername(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RegistryUsername, nil + }) + 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_ImagePullSecret_registryUsername(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ImagePullSecret", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ImagePullSecret_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.ImagePullSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ImagePullSecret_syncStatus(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SyncStatus, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(types.SyncStatus) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___pkg___types__SyncStatus2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ImagePullSecret_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ImagePullSecret", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "action": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx, field) + case "error": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx, field) + case "lastSyncedAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx, field) + case "recordVersion": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx, field) + case "state": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx, field) + case "syncScheduledAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___pkg___types__SyncStatus", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ImagePullSecret_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.ImagePullSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ImagePullSecret_updateTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.ImagePullSecret().UpdateTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ImagePullSecret_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ImagePullSecret", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ImagePullSecretEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.ImagePullSecretEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ImagePullSecretEdge_cursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ImagePullSecretEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ImagePullSecretEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ImagePullSecretEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.ImagePullSecretEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ImagePullSecretEdge_node(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*entities.ImagePullSecret) + fc.Result = res + return ec.marshalNImagePullSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐImagePullSecret(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ImagePullSecretEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ImagePullSecretEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accountName": + return ec.fieldContext_ImagePullSecret_accountName(ctx, field) + case "createdBy": + return ec.fieldContext_ImagePullSecret_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_ImagePullSecret_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_ImagePullSecret_displayName(ctx, field) + case "dockerConfigJson": + return ec.fieldContext_ImagePullSecret_dockerConfigJson(ctx, field) + case "environmentName": + return ec.fieldContext_ImagePullSecret_environmentName(ctx, field) + case "format": + return ec.fieldContext_ImagePullSecret_format(ctx, field) + case "id": + return ec.fieldContext_ImagePullSecret_id(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_ImagePullSecret_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_ImagePullSecret_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_ImagePullSecret_metadata(ctx, field) + case "projectName": + return ec.fieldContext_ImagePullSecret_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_ImagePullSecret_recordVersion(ctx, field) + case "registryPassword": + return ec.fieldContext_ImagePullSecret_registryPassword(ctx, field) + case "registryURL": + return ec.fieldContext_ImagePullSecret_registryURL(ctx, field) + case "registryUsername": + return ec.fieldContext_ImagePullSecret_registryUsername(ctx, field) + case "syncStatus": + return ec.fieldContext_ImagePullSecret_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_ImagePullSecret_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ImagePullSecret", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ImagePullSecretPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.ImagePullSecretPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ImagePullSecretPaginatedRecords_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.ImagePullSecretEdge) + fc.Result = res + return ec.marshalNImagePullSecretEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐImagePullSecretEdgeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ImagePullSecretPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ImagePullSecretPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cursor": + return ec.fieldContext_ImagePullSecretEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_ImagePullSecretEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ImagePullSecretEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ImagePullSecretPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.ImagePullSecretPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ImagePullSecretPaginatedRecords_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.PageInfo) + fc.Result = res + return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ImagePullSecretPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ImagePullSecretPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ImagePullSecretPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.ImagePullSecretPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ImagePullSecretPaginatedRecords_totalCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalCount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ImagePullSecretPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ImagePullSecretPaginatedRecords", + 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) _K8s__io___api___core___v1__Toleration_effect(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1Toleration) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__Toleration_effect(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Effect, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1TaintEffect) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__TaintEffect2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TaintEffect(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__Toleration_effect(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__Toleration", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type K8s__io___api___core___v1__TaintEffect does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__Toleration_key(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1Toleration) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__Toleration_key(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Key, nil + }) + 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_K8s__io___api___core___v1__Toleration_key(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__Toleration", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__Toleration_operator(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1Toleration) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__Toleration_operator(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Operator, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1TolerationOperator) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__TolerationOperator2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TolerationOperator(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__Toleration_operator(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__Toleration", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type K8s__io___api___core___v1__TolerationOperator does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__Toleration_tolerationSeconds(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1Toleration) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__Toleration_tolerationSeconds(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TolerationSeconds, 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_K8s__io___api___core___v1__Toleration_tolerationSeconds(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__Toleration", + 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) _K8s__io___api___core___v1__Toleration_value(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1Toleration) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__Toleration_value(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + 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_K8s__io___api___core___v1__Toleration_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__Toleration", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ManagedResource_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.ManagedResource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ManagedResource_accountName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_ManagedResource_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ManagedResource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ManagedResource_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.ManagedResource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ManagedResource_apiVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.APIVersion, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ManagedResource_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ManagedResource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ManagedResource_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.ManagedResource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ManagedResource_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ManagedResource_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ManagedResource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ManagedResource_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.ManagedResource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ManagedResource_creationTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.ManagedResource().CreationTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ManagedResource_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ManagedResource", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ManagedResource_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.ManagedResource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ManagedResource_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_ManagedResource_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ManagedResource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ManagedResource_enabled(ctx context.Context, field graphql.CollectedField, obj *entities.ManagedResource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ManagedResource_enabled(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Enabled, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*bool) + fc.Result = res + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ManagedResource_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ManagedResource", + 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) _ManagedResource_environmentName(ctx context.Context, field graphql.CollectedField, obj *entities.ManagedResource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ManagedResource_environmentName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.EnvironmentName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_ManagedResource_environmentName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ManagedResource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ManagedResource_id(ctx context.Context, field graphql.CollectedField, obj *entities.ManagedResource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ManagedResource_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 ec.resolvers.ManagedResource().ID(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_ManagedResource_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ManagedResource", + 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) _ManagedResource_kind(ctx context.Context, field graphql.CollectedField, obj *entities.ManagedResource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ManagedResource_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ManagedResource_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ManagedResource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ManagedResource_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.ManagedResource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ManagedResource_lastUpdatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastUpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ManagedResource_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ManagedResource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ManagedResource_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.ManagedResource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ManagedResource_markedForDeletion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MarkedForDeletion, 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_ManagedResource_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ManagedResource", + 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) _ManagedResource_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.ManagedResource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ManagedResource_metadata(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ObjectMeta, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(v12.ObjectMeta) + fc.Result = res + return ec.marshalOMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ManagedResource_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ManagedResource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "annotations": + return ec.fieldContext_Metadata_annotations(ctx, field) + case "creationTimestamp": + return ec.fieldContext_Metadata_creationTimestamp(ctx, field) + case "deletionTimestamp": + return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) + case "generation": + return ec.fieldContext_Metadata_generation(ctx, field) + case "labels": + return ec.fieldContext_Metadata_labels(ctx, field) + case "name": + return ec.fieldContext_Metadata_name(ctx, field) + case "namespace": + return ec.fieldContext_Metadata_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ManagedResource_projectName(ctx context.Context, field graphql.CollectedField, obj *entities.ManagedResource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ManagedResource_projectName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ProjectName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_ManagedResource_projectName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ManagedResource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ManagedResource_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.ManagedResource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ManagedResource_recordVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RecordVersion, nil + }) + if err != nil { + ec.Error(ctx, 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_ManagedResource_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ManagedResource", + 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) _ManagedResource_spec(ctx context.Context, field graphql.CollectedField, obj *entities.ManagedResource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ManagedResource_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 ec.resolvers.ManagedResource().Spec(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.GithubComKloudliteOperatorApisCrdsV1ManagedResourceSpec) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ManagedResourceSpec(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ManagedResource_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ManagedResource", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "resourceName": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec_resourceName(ctx, field) + case "resourceTemplate": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec_resourceTemplate(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ManagedResource_status(ctx context.Context, field graphql.CollectedField, obj *entities.ManagedResource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ManagedResource_status(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Status, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(operator.Status) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___pkg___operator__Status2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ManagedResource_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ManagedResource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "checks": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx, field) + case "isReady": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_isReady(ctx, field) + case "lastReadyGeneration": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReadyGeneration(ctx, field) + case "lastReconcileTime": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReconcileTime(ctx, field) + case "message": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_message(ctx, field) + case "resources": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_resources(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___pkg___operator__Status", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ManagedResource_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.ManagedResource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ManagedResource_syncStatus(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SyncStatus, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(types.SyncStatus) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___pkg___types__SyncStatus2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ManagedResource_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ManagedResource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "action": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx, field) + case "error": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx, field) + case "lastSyncedAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx, field) + case "recordVersion": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx, field) + case "state": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx, field) + case "syncScheduledAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___pkg___types__SyncStatus", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ManagedResource_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.ManagedResource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ManagedResource_updateTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.ManagedResource().UpdateTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ManagedResource_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ManagedResource", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ManagedResourceEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.ManagedResourceEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ManagedResourceEdge_cursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ManagedResourceEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ManagedResourceEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ManagedResourceEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.ManagedResourceEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ManagedResourceEdge_node(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*entities.ManagedResource) + fc.Result = res + return ec.marshalNManagedResource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐManagedResource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ManagedResourceEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ManagedResourceEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accountName": + return ec.fieldContext_ManagedResource_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_ManagedResource_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_ManagedResource_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_ManagedResource_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_ManagedResource_displayName(ctx, field) + case "enabled": + return ec.fieldContext_ManagedResource_enabled(ctx, field) + case "environmentName": + return ec.fieldContext_ManagedResource_environmentName(ctx, field) + case "id": + return ec.fieldContext_ManagedResource_id(ctx, field) + case "kind": + return ec.fieldContext_ManagedResource_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_ManagedResource_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_ManagedResource_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_ManagedResource_metadata(ctx, field) + case "projectName": + return ec.fieldContext_ManagedResource_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_ManagedResource_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_ManagedResource_spec(ctx, field) + case "status": + return ec.fieldContext_ManagedResource_status(ctx, field) + case "syncStatus": + return ec.fieldContext_ManagedResource_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_ManagedResource_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ManagedResource", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ManagedResourceKeyRef_key(ctx context.Context, field graphql.CollectedField, obj *model.ManagedResourceKeyRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ManagedResourceKeyRef_key(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Key, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_ManagedResourceKeyRef_key(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ManagedResourceKeyRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ManagedResourceKeyRef_mresName(ctx context.Context, field graphql.CollectedField, obj *model.ManagedResourceKeyRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ManagedResourceKeyRef_mresName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MresName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_ManagedResourceKeyRef_mresName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ManagedResourceKeyRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ManagedResourceKeyValueRef_key(ctx context.Context, field graphql.CollectedField, obj *domain.ManagedResourceKeyValueRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ManagedResourceKeyValueRef_key(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Key, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_ManagedResourceKeyValueRef_key(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ManagedResourceKeyValueRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ManagedResourceKeyValueRef_mresName(ctx context.Context, field graphql.CollectedField, obj *domain.ManagedResourceKeyValueRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ManagedResourceKeyValueRef_mresName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MresName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_ManagedResourceKeyValueRef_mresName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ManagedResourceKeyValueRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ManagedResourceKeyValueRef_value(ctx context.Context, field graphql.CollectedField, obj *domain.ManagedResourceKeyValueRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ManagedResourceKeyValueRef_value(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ManagedResourceKeyValueRef_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ManagedResourceKeyValueRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ManagedResourcePaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.ManagedResourcePaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ManagedResourcePaginatedRecords_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.ManagedResourceEdge) + fc.Result = res + return ec.marshalNManagedResourceEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedResourceEdgeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ManagedResourcePaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ManagedResourcePaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cursor": + return ec.fieldContext_ManagedResourceEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_ManagedResourceEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ManagedResourceEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ManagedResourcePaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.ManagedResourcePaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ManagedResourcePaginatedRecords_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.PageInfo) + fc.Result = res + return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ManagedResourcePaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ManagedResourcePaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ManagedResourcePaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.ManagedResourcePaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ManagedResourcePaginatedRecords_totalCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalCount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ManagedResourcePaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ManagedResourcePaginatedRecords", + 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) _MatchFilter_array(ctx context.Context, field graphql.CollectedField, obj *repos.MatchFilter) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_MatchFilter_array(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Array, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]any) + fc.Result = res + return ec.marshalOAny2ᚕinterfaceᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_MatchFilter_array(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "MatchFilter", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Any does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _MatchFilter_exact(ctx context.Context, field graphql.CollectedField, obj *repos.MatchFilter) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_MatchFilter_exact(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Exact, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(any) + fc.Result = res + return ec.marshalOAny2interface(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_MatchFilter_exact(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "MatchFilter", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Any does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _MatchFilter_matchType(ctx context.Context, field graphql.CollectedField, obj *repos.MatchFilter) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_MatchFilter_matchType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MatchType, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(repos.MatchType) + fc.Result = res + return ec.marshalNMatchFilterMatchType2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_MatchFilter_matchType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "MatchFilter", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type MatchFilterMatchType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _MatchFilter_regex(ctx context.Context, field graphql.CollectedField, obj *repos.MatchFilter) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_MatchFilter_regex(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Regex, nil + }) + 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_MatchFilter_regex(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "MatchFilter", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Metadata_annotations(ctx context.Context, field graphql.CollectedField, obj *v12.ObjectMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_annotations(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Metadata().Annotations(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Metadata_annotations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Metadata", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Metadata_creationTimestamp(ctx context.Context, field graphql.CollectedField, obj *v12.ObjectMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_creationTimestamp(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Metadata().CreationTimestamp(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Metadata_creationTimestamp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Metadata", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Metadata_deletionTimestamp(ctx context.Context, field graphql.CollectedField, obj *v12.ObjectMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_deletionTimestamp(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Metadata().DeletionTimestamp(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalODate2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Metadata_deletionTimestamp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Metadata", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Metadata_generation(ctx context.Context, field graphql.CollectedField, obj *v12.ObjectMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_generation(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Generation, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int64) + fc.Result = res + return ec.marshalNInt2int64(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Metadata_generation(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Metadata", + 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) _Metadata_labels(ctx context.Context, field graphql.CollectedField, obj *v12.ObjectMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_labels(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Metadata().Labels(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Metadata_labels(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Metadata", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Metadata_name(ctx context.Context, field graphql.CollectedField, obj *v12.ObjectMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_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_Metadata_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Metadata", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Metadata_namespace(ctx context.Context, field graphql.CollectedField, obj *v12.ObjectMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_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 { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Metadata_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Metadata", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_createProject(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_createProject(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreCreateProject(rctx, fc.Args["project"].(entities.Project)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Project); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Project`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.Project) + fc.Result = res + return ec.marshalOProject2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProject(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_core_createProject(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 "accountName": + return ec.fieldContext_Project_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Project_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_Project_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_Project_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Project_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_Project_displayName(ctx, field) + case "id": + return ec.fieldContext_Project_id(ctx, field) + case "kind": + return ec.fieldContext_Project_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Project_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Project_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Project_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_Project_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_Project_spec(ctx, field) + case "status": + return ec.fieldContext_Project_status(ctx, field) + case "syncStatus": + return ec.fieldContext_Project_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_Project_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Project", field.Name) + }, + } + defer func() { + if 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_core_createProject_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_updateProject(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_updateProject(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreUpdateProject(rctx, fc.Args["project"].(entities.Project)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Project); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Project`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.Project) + fc.Result = res + return ec.marshalOProject2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProject(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_core_updateProject(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 "accountName": + return ec.fieldContext_Project_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Project_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_Project_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_Project_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Project_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_Project_displayName(ctx, field) + case "id": + return ec.fieldContext_Project_id(ctx, field) + case "kind": + return ec.fieldContext_Project_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Project_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Project_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Project_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_Project_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_Project_spec(ctx, field) + case "status": + return ec.fieldContext_Project_status(ctx, field) + case "syncStatus": + return ec.fieldContext_Project_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_Project_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Project", field.Name) + }, + } + defer func() { + if 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_core_updateProject_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_deleteProject(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_deleteProject(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreDeleteProject(rctx, fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_core_deleteProject(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_core_deleteProject_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_createEnvironment(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_createEnvironment(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreCreateEnvironment(rctx, fc.Args["projectName"].(string), fc.Args["env"].(entities.Environment)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Environment); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Environment`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.Environment) + fc.Result = res + return ec.marshalOEnvironment2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐEnvironment(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_core_createEnvironment(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 "accountName": + return ec.fieldContext_Environment_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Environment_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_Environment_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Environment_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_Environment_displayName(ctx, field) + case "id": + return ec.fieldContext_Environment_id(ctx, field) + case "kind": + return ec.fieldContext_Environment_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Environment_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Environment_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Environment_metadata(ctx, field) + case "projectName": + return ec.fieldContext_Environment_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_Environment_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_Environment_spec(ctx, field) + case "status": + return ec.fieldContext_Environment_status(ctx, field) + case "syncStatus": + return ec.fieldContext_Environment_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_Environment_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Environment", field.Name) + }, + } + defer func() { + if 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_core_createEnvironment_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_updateEnvironment(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_updateEnvironment(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreUpdateEnvironment(rctx, fc.Args["projectName"].(string), fc.Args["env"].(entities.Environment)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Environment); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Environment`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.Environment) + fc.Result = res + return ec.marshalOEnvironment2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐEnvironment(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_core_updateEnvironment(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 "accountName": + return ec.fieldContext_Environment_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Environment_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_Environment_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Environment_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_Environment_displayName(ctx, field) + case "id": + return ec.fieldContext_Environment_id(ctx, field) + case "kind": + return ec.fieldContext_Environment_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Environment_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Environment_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Environment_metadata(ctx, field) + case "projectName": + return ec.fieldContext_Environment_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_Environment_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_Environment_spec(ctx, field) + case "status": + return ec.fieldContext_Environment_status(ctx, field) + case "syncStatus": + return ec.fieldContext_Environment_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_Environment_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Environment", field.Name) + }, + } + defer func() { + if 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_core_updateEnvironment_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_deleteEnvironment(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_deleteEnvironment(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreDeleteEnvironment(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_core_deleteEnvironment(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_core_deleteEnvironment_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_cloneEnvironment(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_cloneEnvironment(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreCloneEnvironment(rctx, fc.Args["projectName"].(string), fc.Args["sourceEnvName"].(string), fc.Args["destinationEnvName"].(string), fc.Args["displayName"].(string), fc.Args["environmentRoutingMode"].(v1.EnvironmentRoutingMode)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Environment); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Environment`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.Environment) + fc.Result = res + return ec.marshalOEnvironment2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐEnvironment(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_core_cloneEnvironment(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 "accountName": + return ec.fieldContext_Environment_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Environment_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_Environment_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Environment_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_Environment_displayName(ctx, field) + case "id": + return ec.fieldContext_Environment_id(ctx, field) + case "kind": + return ec.fieldContext_Environment_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Environment_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Environment_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Environment_metadata(ctx, field) + case "projectName": + return ec.fieldContext_Environment_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_Environment_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_Environment_spec(ctx, field) + case "status": + return ec.fieldContext_Environment_status(ctx, field) + case "syncStatus": + return ec.fieldContext_Environment_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_Environment_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Environment", field.Name) + }, + } + defer func() { + if 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_core_cloneEnvironment_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_createImagePullSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_createImagePullSecret(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreCreateImagePullSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["imagePullSecretIn"].(entities.ImagePullSecret)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.ImagePullSecret); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ImagePullSecret`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.ImagePullSecret) + fc.Result = res + return ec.marshalOImagePullSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐImagePullSecret(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_core_createImagePullSecret(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 "accountName": + return ec.fieldContext_ImagePullSecret_accountName(ctx, field) + case "createdBy": + return ec.fieldContext_ImagePullSecret_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_ImagePullSecret_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_ImagePullSecret_displayName(ctx, field) + case "dockerConfigJson": + return ec.fieldContext_ImagePullSecret_dockerConfigJson(ctx, field) + case "environmentName": + return ec.fieldContext_ImagePullSecret_environmentName(ctx, field) + case "format": + return ec.fieldContext_ImagePullSecret_format(ctx, field) + case "id": + return ec.fieldContext_ImagePullSecret_id(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_ImagePullSecret_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_ImagePullSecret_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_ImagePullSecret_metadata(ctx, field) + case "projectName": + return ec.fieldContext_ImagePullSecret_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_ImagePullSecret_recordVersion(ctx, field) + case "registryPassword": + return ec.fieldContext_ImagePullSecret_registryPassword(ctx, field) + case "registryURL": + return ec.fieldContext_ImagePullSecret_registryURL(ctx, field) + case "registryUsername": + return ec.fieldContext_ImagePullSecret_registryUsername(ctx, field) + case "syncStatus": + return ec.fieldContext_ImagePullSecret_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_ImagePullSecret_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ImagePullSecret", field.Name) + }, + } + defer func() { + if 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_core_createImagePullSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_deleteImagePullSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_deleteImagePullSecret(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreDeleteImagePullSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["secretName"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_core_deleteImagePullSecret(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_core_deleteImagePullSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_createApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_createApp(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreCreateApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["app"].(entities.App)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.App); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.App`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.App) + fc.Result = res + return ec.marshalOApp2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐApp(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_core_createApp(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 "accountName": + return ec.fieldContext_App_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_App_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_App_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_App_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_App_displayName(ctx, field) + case "enabled": + return ec.fieldContext_App_enabled(ctx, field) + case "environmentName": + return ec.fieldContext_App_environmentName(ctx, field) + case "id": + return ec.fieldContext_App_id(ctx, field) + case "kind": + return ec.fieldContext_App_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_App_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_App_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_App_metadata(ctx, field) + case "projectName": + return ec.fieldContext_App_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_App_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_App_spec(ctx, field) + case "status": + return ec.fieldContext_App_status(ctx, field) + case "syncStatus": + return ec.fieldContext_App_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_App_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type App", field.Name) + }, + } + defer func() { + if 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_core_createApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_updateApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_updateApp(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreUpdateApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["app"].(entities.App)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.App); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.App`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.App) + fc.Result = res + return ec.marshalOApp2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐApp(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_core_updateApp(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 "accountName": + return ec.fieldContext_App_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_App_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_App_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_App_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_App_displayName(ctx, field) + case "enabled": + return ec.fieldContext_App_enabled(ctx, field) + case "environmentName": + return ec.fieldContext_App_environmentName(ctx, field) + case "id": + return ec.fieldContext_App_id(ctx, field) + case "kind": + return ec.fieldContext_App_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_App_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_App_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_App_metadata(ctx, field) + case "projectName": + return ec.fieldContext_App_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_App_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_App_spec(ctx, field) + case "status": + return ec.fieldContext_App_status(ctx, field) + case "syncStatus": + return ec.fieldContext_App_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_App_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type App", field.Name) + }, + } + defer func() { + if 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_core_updateApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_deleteApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_deleteApp(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreDeleteApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["appName"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_core_deleteApp(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_core_deleteApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_interceptApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_interceptApp(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreInterceptApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["appname"].(string), fc.Args["deviceName"].(string), fc.Args["intercept"].(bool)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_core_interceptApp(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_core_interceptApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_createConfig(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_createConfig(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreCreateConfig(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["config"].(entities.Config)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Config); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Config`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.Config) + fc.Result = res + return ec.marshalOConfig2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConfig(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_core_createConfig(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 "accountName": + return ec.fieldContext_Config_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Config_apiVersion(ctx, field) + case "binaryData": + return ec.fieldContext_Config_binaryData(ctx, field) + case "createdBy": + return ec.fieldContext_Config_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Config_creationTime(ctx, field) + case "data": + return ec.fieldContext_Config_data(ctx, field) + case "displayName": + return ec.fieldContext_Config_displayName(ctx, field) + case "environmentName": + return ec.fieldContext_Config_environmentName(ctx, field) + case "id": + return ec.fieldContext_Config_id(ctx, field) + case "immutable": + return ec.fieldContext_Config_immutable(ctx, field) + case "kind": + return ec.fieldContext_Config_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Config_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Config_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Config_metadata(ctx, field) + case "projectName": + return ec.fieldContext_Config_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_Config_recordVersion(ctx, field) + case "syncStatus": + return ec.fieldContext_Config_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_Config_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Config", field.Name) + }, + } + defer func() { + if 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_core_createConfig_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_updateConfig(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_updateConfig(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreUpdateConfig(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["config"].(entities.Config)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Config); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Config`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.Config) + fc.Result = res + return ec.marshalOConfig2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConfig(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_core_updateConfig(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 "accountName": + return ec.fieldContext_Config_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Config_apiVersion(ctx, field) + case "binaryData": + return ec.fieldContext_Config_binaryData(ctx, field) + case "createdBy": + return ec.fieldContext_Config_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Config_creationTime(ctx, field) + case "data": + return ec.fieldContext_Config_data(ctx, field) + case "displayName": + return ec.fieldContext_Config_displayName(ctx, field) + case "environmentName": + return ec.fieldContext_Config_environmentName(ctx, field) + case "id": + return ec.fieldContext_Config_id(ctx, field) + case "immutable": + return ec.fieldContext_Config_immutable(ctx, field) + case "kind": + return ec.fieldContext_Config_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Config_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Config_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Config_metadata(ctx, field) + case "projectName": + return ec.fieldContext_Config_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_Config_recordVersion(ctx, field) + case "syncStatus": + return ec.fieldContext_Config_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_Config_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Config", field.Name) + }, + } + defer func() { + if 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_core_updateConfig_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_deleteConfig(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_deleteConfig(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreDeleteConfig(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["configName"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_core_deleteConfig(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_core_deleteConfig_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_createSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_createSecret(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreCreateSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["secret"].(entities.Secret)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Secret); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Secret`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.Secret) + fc.Result = res + return ec.marshalOSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐSecret(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_core_createSecret(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 "accountName": + return ec.fieldContext_Secret_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Secret_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_Secret_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Secret_creationTime(ctx, field) + case "data": + return ec.fieldContext_Secret_data(ctx, field) + case "displayName": + return ec.fieldContext_Secret_displayName(ctx, field) + case "environmentName": + return ec.fieldContext_Secret_environmentName(ctx, field) + case "id": + return ec.fieldContext_Secret_id(ctx, field) + case "immutable": + return ec.fieldContext_Secret_immutable(ctx, field) + case "kind": + return ec.fieldContext_Secret_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Secret_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Secret_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Secret_metadata(ctx, field) + case "projectName": + return ec.fieldContext_Secret_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_Secret_recordVersion(ctx, field) + case "stringData": + return ec.fieldContext_Secret_stringData(ctx, field) + case "syncStatus": + return ec.fieldContext_Secret_syncStatus(ctx, field) + case "type": + return ec.fieldContext_Secret_type(ctx, field) + case "updateTime": + return ec.fieldContext_Secret_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Secret", field.Name) + }, + } + defer func() { + if 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_core_createSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_updateSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_updateSecret(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreUpdateSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["secret"].(entities.Secret)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Secret); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Secret`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.Secret) + fc.Result = res + return ec.marshalOSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐSecret(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_core_updateSecret(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 "accountName": + return ec.fieldContext_Secret_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Secret_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_Secret_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Secret_creationTime(ctx, field) + case "data": + return ec.fieldContext_Secret_data(ctx, field) + case "displayName": + return ec.fieldContext_Secret_displayName(ctx, field) + case "environmentName": + return ec.fieldContext_Secret_environmentName(ctx, field) + case "id": + return ec.fieldContext_Secret_id(ctx, field) + case "immutable": + return ec.fieldContext_Secret_immutable(ctx, field) + case "kind": + return ec.fieldContext_Secret_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Secret_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Secret_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Secret_metadata(ctx, field) + case "projectName": + return ec.fieldContext_Secret_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_Secret_recordVersion(ctx, field) + case "stringData": + return ec.fieldContext_Secret_stringData(ctx, field) + case "syncStatus": + return ec.fieldContext_Secret_syncStatus(ctx, field) + case "type": + return ec.fieldContext_Secret_type(ctx, field) + case "updateTime": + return ec.fieldContext_Secret_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Secret", field.Name) + }, + } + defer func() { + if 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_core_updateSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_deleteSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_deleteSecret(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreDeleteSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["secretName"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_core_deleteSecret(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_core_deleteSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_createRouter(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_createRouter(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreCreateRouter(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["router"].(entities.Router)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Router); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Router`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.Router) + fc.Result = res + return ec.marshalORouter2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐRouter(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_core_createRouter(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 "accountName": + return ec.fieldContext_Router_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Router_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_Router_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Router_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_Router_displayName(ctx, field) + case "enabled": + return ec.fieldContext_Router_enabled(ctx, field) + case "environmentName": + return ec.fieldContext_Router_environmentName(ctx, field) + case "id": + return ec.fieldContext_Router_id(ctx, field) + case "kind": + return ec.fieldContext_Router_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Router_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Router_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Router_metadata(ctx, field) + case "projectName": + return ec.fieldContext_Router_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_Router_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_Router_spec(ctx, field) + case "status": + return ec.fieldContext_Router_status(ctx, field) + case "syncStatus": + return ec.fieldContext_Router_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_Router_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Router", field.Name) + }, + } + defer func() { + if 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_core_createRouter_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_updateRouter(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_updateRouter(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreUpdateRouter(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["router"].(entities.Router)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Router); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Router`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.Router) + fc.Result = res + return ec.marshalORouter2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐRouter(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_core_updateRouter(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 "accountName": + return ec.fieldContext_Router_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Router_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_Router_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Router_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_Router_displayName(ctx, field) + case "enabled": + return ec.fieldContext_Router_enabled(ctx, field) + case "environmentName": + return ec.fieldContext_Router_environmentName(ctx, field) + case "id": + return ec.fieldContext_Router_id(ctx, field) + case "kind": + return ec.fieldContext_Router_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Router_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Router_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Router_metadata(ctx, field) + case "projectName": + return ec.fieldContext_Router_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_Router_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_Router_spec(ctx, field) + case "status": + return ec.fieldContext_Router_status(ctx, field) + case "syncStatus": + return ec.fieldContext_Router_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_Router_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Router", field.Name) + }, + } + defer func() { + if 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_core_updateRouter_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_deleteRouter(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_deleteRouter(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreDeleteRouter(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["routerName"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_core_deleteRouter(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_core_deleteRouter_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_createManagedResource(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_createManagedResource(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreCreateManagedResource(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["mres"].(entities.ManagedResource)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.ManagedResource); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ManagedResource`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.ManagedResource) + fc.Result = res + return ec.marshalOManagedResource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐManagedResource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_core_createManagedResource(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 "accountName": + return ec.fieldContext_ManagedResource_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_ManagedResource_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_ManagedResource_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_ManagedResource_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_ManagedResource_displayName(ctx, field) + case "enabled": + return ec.fieldContext_ManagedResource_enabled(ctx, field) + case "environmentName": + return ec.fieldContext_ManagedResource_environmentName(ctx, field) + case "id": + return ec.fieldContext_ManagedResource_id(ctx, field) + case "kind": + return ec.fieldContext_ManagedResource_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_ManagedResource_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_ManagedResource_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_ManagedResource_metadata(ctx, field) + case "projectName": + return ec.fieldContext_ManagedResource_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_ManagedResource_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_ManagedResource_spec(ctx, field) + case "status": + return ec.fieldContext_ManagedResource_status(ctx, field) + case "syncStatus": + return ec.fieldContext_ManagedResource_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_ManagedResource_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ManagedResource", field.Name) + }, + } + defer func() { + if 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_core_createManagedResource_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_updateManagedResource(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_updateManagedResource(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreUpdateManagedResource(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["mres"].(entities.ManagedResource)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.ManagedResource); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ManagedResource`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.ManagedResource) + fc.Result = res + return ec.marshalOManagedResource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐManagedResource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_core_updateManagedResource(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 "accountName": + return ec.fieldContext_ManagedResource_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_ManagedResource_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_ManagedResource_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_ManagedResource_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_ManagedResource_displayName(ctx, field) + case "enabled": + return ec.fieldContext_ManagedResource_enabled(ctx, field) + case "environmentName": + return ec.fieldContext_ManagedResource_environmentName(ctx, field) + case "id": + return ec.fieldContext_ManagedResource_id(ctx, field) + case "kind": + return ec.fieldContext_ManagedResource_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_ManagedResource_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_ManagedResource_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_ManagedResource_metadata(ctx, field) + case "projectName": + return ec.fieldContext_ManagedResource_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_ManagedResource_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_ManagedResource_spec(ctx, field) + case "status": + return ec.fieldContext_ManagedResource_status(ctx, field) + case "syncStatus": + return ec.fieldContext_ManagedResource_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_ManagedResource_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ManagedResource", field.Name) + }, + } + defer func() { + if 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_core_updateManagedResource_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_deleteManagedResource(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_deleteManagedResource(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreDeleteManagedResource(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["mresName"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_core_deleteManagedResource(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_core_deleteManagedResource_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_createProjectManagedService(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_createProjectManagedService(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreCreateProjectManagedService(rctx, fc.Args["projectName"].(string), fc.Args["pmsvc"].(entities.ProjectManagedService)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.ProjectManagedService); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ProjectManagedService`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.ProjectManagedService) + fc.Result = res + return ec.marshalOProjectManagedService2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProjectManagedService(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_core_createProjectManagedService(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 "accountName": + return ec.fieldContext_ProjectManagedService_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_ProjectManagedService_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_ProjectManagedService_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_ProjectManagedService_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_ProjectManagedService_displayName(ctx, field) + case "id": + return ec.fieldContext_ProjectManagedService_id(ctx, field) + case "kind": + return ec.fieldContext_ProjectManagedService_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_ProjectManagedService_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_ProjectManagedService_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_ProjectManagedService_metadata(ctx, field) + case "projectName": + return ec.fieldContext_ProjectManagedService_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_ProjectManagedService_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_ProjectManagedService_spec(ctx, field) + case "status": + return ec.fieldContext_ProjectManagedService_status(ctx, field) + case "syncStatus": + return ec.fieldContext_ProjectManagedService_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_ProjectManagedService_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ProjectManagedService", field.Name) + }, + } + defer func() { + if 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_core_createProjectManagedService_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_updateProjectManagedService(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_updateProjectManagedService(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreUpdateProjectManagedService(rctx, fc.Args["projectName"].(string), fc.Args["pmsvc"].(entities.ProjectManagedService)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.ProjectManagedService); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ProjectManagedService`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.ProjectManagedService) + fc.Result = res + return ec.marshalOProjectManagedService2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProjectManagedService(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_core_updateProjectManagedService(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 "accountName": + return ec.fieldContext_ProjectManagedService_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_ProjectManagedService_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_ProjectManagedService_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_ProjectManagedService_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_ProjectManagedService_displayName(ctx, field) + case "id": + return ec.fieldContext_ProjectManagedService_id(ctx, field) + case "kind": + return ec.fieldContext_ProjectManagedService_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_ProjectManagedService_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_ProjectManagedService_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_ProjectManagedService_metadata(ctx, field) + case "projectName": + return ec.fieldContext_ProjectManagedService_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_ProjectManagedService_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_ProjectManagedService_spec(ctx, field) + case "status": + return ec.fieldContext_ProjectManagedService_status(ctx, field) + case "syncStatus": + return ec.fieldContext_ProjectManagedService_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_ProjectManagedService_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ProjectManagedService", field.Name) + }, + } + defer func() { + if 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_core_updateProjectManagedService_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_deleteProjectManagedService(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_deleteProjectManagedService(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreDeleteProjectManagedService(rctx, fc.Args["projectName"].(string), fc.Args["pmsvcName"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_core_deleteProjectManagedService(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_core_deleteProjectManagedService_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_createVPNDevice(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_createVPNDevice(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreCreateVPNDevice(rctx, fc.Args["vpnDevice"].(entities.ConsoleVPNDevice)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.ConsoleVPNDevice); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ConsoleVPNDevice`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.ConsoleVPNDevice) + fc.Result = res + return ec.marshalOConsoleVPNDevice2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConsoleVPNDevice(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_core_createVPNDevice(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 "accountName": + return ec.fieldContext_ConsoleVPNDevice_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_ConsoleVPNDevice_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_ConsoleVPNDevice_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_ConsoleVPNDevice_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_ConsoleVPNDevice_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_ConsoleVPNDevice_displayName(ctx, field) + case "environmentName": + return ec.fieldContext_ConsoleVPNDevice_environmentName(ctx, field) + case "id": + return ec.fieldContext_ConsoleVPNDevice_id(ctx, field) + case "kind": + return ec.fieldContext_ConsoleVPNDevice_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_ConsoleVPNDevice_lastUpdatedBy(ctx, field) + case "linkedClusters": + return ec.fieldContext_ConsoleVPNDevice_linkedClusters(ctx, field) + case "markedForDeletion": + return ec.fieldContext_ConsoleVPNDevice_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_ConsoleVPNDevice_metadata(ctx, field) + case "projectName": + return ec.fieldContext_ConsoleVPNDevice_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_ConsoleVPNDevice_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_ConsoleVPNDevice_spec(ctx, field) + case "status": + return ec.fieldContext_ConsoleVPNDevice_status(ctx, field) + case "syncStatus": + return ec.fieldContext_ConsoleVPNDevice_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_ConsoleVPNDevice_updateTime(ctx, field) + case "wireguardConfig": + return ec.fieldContext_ConsoleVPNDevice_wireguardConfig(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ConsoleVPNDevice", field.Name) + }, + } + defer func() { + if 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_core_createVPNDevice_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_updateVPNDevice(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_updateVPNDevice(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreUpdateVPNDevice(rctx, fc.Args["vpnDevice"].(entities.ConsoleVPNDevice)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.ConsoleVPNDevice); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ConsoleVPNDevice`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.ConsoleVPNDevice) + fc.Result = res + return ec.marshalOConsoleVPNDevice2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConsoleVPNDevice(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_core_updateVPNDevice(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 "accountName": + return ec.fieldContext_ConsoleVPNDevice_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_ConsoleVPNDevice_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_ConsoleVPNDevice_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_ConsoleVPNDevice_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_ConsoleVPNDevice_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_ConsoleVPNDevice_displayName(ctx, field) + case "environmentName": + return ec.fieldContext_ConsoleVPNDevice_environmentName(ctx, field) + case "id": + return ec.fieldContext_ConsoleVPNDevice_id(ctx, field) + case "kind": + return ec.fieldContext_ConsoleVPNDevice_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_ConsoleVPNDevice_lastUpdatedBy(ctx, field) + case "linkedClusters": + return ec.fieldContext_ConsoleVPNDevice_linkedClusters(ctx, field) + case "markedForDeletion": + return ec.fieldContext_ConsoleVPNDevice_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_ConsoleVPNDevice_metadata(ctx, field) + case "projectName": + return ec.fieldContext_ConsoleVPNDevice_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_ConsoleVPNDevice_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_ConsoleVPNDevice_spec(ctx, field) + case "status": + return ec.fieldContext_ConsoleVPNDevice_status(ctx, field) + case "syncStatus": + return ec.fieldContext_ConsoleVPNDevice_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_ConsoleVPNDevice_updateTime(ctx, field) + case "wireguardConfig": + return ec.fieldContext_ConsoleVPNDevice_wireguardConfig(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ConsoleVPNDevice", field.Name) + }, + } + defer func() { + if 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_core_updateVPNDevice_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_updateVPNDevicePorts(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_updateVPNDevicePorts(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreUpdateVPNDevicePorts(rctx, fc.Args["deviceName"].(string), fc.Args["ports"].([]*v11.Port)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_core_updateVPNDevicePorts(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_core_updateVPNDevicePorts_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_updateVPNDeviceEnv(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_updateVPNDeviceEnv(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreUpdateVPNDeviceEnv(rctx, fc.Args["deviceName"].(string), fc.Args["projectName"].(string), fc.Args["envName"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_core_updateVPNDeviceEnv(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_core_updateVPNDeviceEnv_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_updateVpnDeviceNs(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_updateVpnDeviceNs(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreUpdateVpnDeviceNs(rctx, fc.Args["deviceName"].(string), fc.Args["ns"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_core_updateVpnDeviceNs(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_core_updateVpnDeviceNs_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_updateVpnClusterName(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_updateVpnClusterName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreUpdateVpnClusterName(rctx, fc.Args["deviceName"].(string), fc.Args["clusterName"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_core_updateVpnClusterName(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_core_updateVpnClusterName_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_core_deleteVPNDevice(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_deleteVPNDevice(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CoreDeleteVPNDevice(rctx, fc.Args["deviceName"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_core_deleteVPNDevice(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_core_deleteVPNDevice_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_endCursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.EndCursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PageInfo_endCursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PageInfo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_hasNextPage(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.HasNextPage, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*bool) + fc.Result = res + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PageInfo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.HasPreviousPage, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*bool) + fc.Result = res + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PageInfo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_startCursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.StartCursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PageInfo_startCursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PageInfo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Port_port(ctx context.Context, field graphql.CollectedField, obj *model.Port) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Port_port(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Port, 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_Port_port(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Port", + 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) _Port_targetPort(ctx context.Context, field graphql.CollectedField, obj *model.Port) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Port_targetPort(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TargetPort, 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_Port_targetPort(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Port", + 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) _Project_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Project_accountName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Project_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Project", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Project_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Project_apiVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.APIVersion, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Project_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Project", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Project_clusterName(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Project_clusterName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ClusterName, nil + }) + 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_Project_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Project", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Project_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Project_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Project_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Project", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Project_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Project_creationTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Project().CreationTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Project_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Project", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Project_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Project_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_Project_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Project", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Project_id(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Project_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 ec.resolvers.Project().ID(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_Project_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Project", + 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) _Project_kind(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Project_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Project_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Project", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Project_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Project_lastUpdatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastUpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Project_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Project", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Project_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Project_markedForDeletion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MarkedForDeletion, 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_Project_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Project", + 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) _Project_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Project_metadata(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ObjectMeta, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(v12.ObjectMeta) + fc.Result = res + return ec.marshalOMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Project_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Project", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "annotations": + return ec.fieldContext_Metadata_annotations(ctx, field) + case "creationTimestamp": + return ec.fieldContext_Metadata_creationTimestamp(ctx, field) + case "deletionTimestamp": + return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) + case "generation": + return ec.fieldContext_Metadata_generation(ctx, field) + case "labels": + return ec.fieldContext_Metadata_labels(ctx, field) + case "name": + return ec.fieldContext_Metadata_name(ctx, field) + case "namespace": + return ec.fieldContext_Metadata_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Project_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Project_recordVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RecordVersion, nil + }) + if err != nil { + ec.Error(ctx, 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_Project_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Project", + 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) _Project_spec(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Project_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 ec.resolvers.Project().Spec(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.GithubComKloudliteOperatorApisCrdsV1ProjectSpec) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___operator___apis___crds___v1__ProjectSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ProjectSpec(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Project_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Project", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "targetNamespace": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec_targetNamespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Project_status(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Project_status(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Status, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(operator.Status) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___pkg___operator__Status2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Project_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Project", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "checks": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx, field) + case "isReady": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_isReady(ctx, field) + case "lastReadyGeneration": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReadyGeneration(ctx, field) + case "lastReconcileTime": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReconcileTime(ctx, field) + case "message": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_message(ctx, field) + case "resources": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_resources(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___pkg___operator__Status", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Project_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Project_syncStatus(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SyncStatus, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(types.SyncStatus) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___pkg___types__SyncStatus2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Project_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Project", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "action": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx, field) + case "error": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx, field) + case "lastSyncedAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx, field) + case "recordVersion": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx, field) + case "state": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx, field) + case "syncScheduledAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___pkg___types__SyncStatus", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Project_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Project_updateTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Project().UpdateTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Project_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Project", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ProjectEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.ProjectEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProjectEdge_cursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ProjectEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProjectEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ProjectEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.ProjectEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProjectEdge_node(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*entities.Project) + fc.Result = res + return ec.marshalNProject2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProject(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ProjectEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProjectEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accountName": + return ec.fieldContext_Project_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Project_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_Project_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_Project_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Project_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_Project_displayName(ctx, field) + case "id": + return ec.fieldContext_Project_id(ctx, field) + case "kind": + return ec.fieldContext_Project_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Project_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Project_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Project_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_Project_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_Project_spec(ctx, field) + case "status": + return ec.fieldContext_Project_status(ctx, field) + case "syncStatus": + return ec.fieldContext_Project_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_Project_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Project", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ProjectManagedService_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProjectManagedService_accountName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_ProjectManagedService_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProjectManagedService", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ProjectManagedService_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProjectManagedService_apiVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.APIVersion, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ProjectManagedService_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProjectManagedService", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ProjectManagedService_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProjectManagedService_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ProjectManagedService_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProjectManagedService", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ProjectManagedService_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProjectManagedService_creationTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.ProjectManagedService().CreationTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ProjectManagedService_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProjectManagedService", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ProjectManagedService_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProjectManagedService_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_ProjectManagedService_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProjectManagedService", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ProjectManagedService_id(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProjectManagedService_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 ec.resolvers.ProjectManagedService().ID(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_ProjectManagedService_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProjectManagedService", + 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) _ProjectManagedService_kind(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProjectManagedService_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ProjectManagedService_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProjectManagedService", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ProjectManagedService_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProjectManagedService_lastUpdatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastUpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ProjectManagedService_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProjectManagedService", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ProjectManagedService_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProjectManagedService_markedForDeletion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MarkedForDeletion, 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_ProjectManagedService_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProjectManagedService", + 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) _ProjectManagedService_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProjectManagedService_metadata(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ObjectMeta, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(v12.ObjectMeta) + fc.Result = res + return ec.marshalOMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ProjectManagedService_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProjectManagedService", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "annotations": + return ec.fieldContext_Metadata_annotations(ctx, field) + case "creationTimestamp": + return ec.fieldContext_Metadata_creationTimestamp(ctx, field) + case "deletionTimestamp": + return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) + case "generation": + return ec.fieldContext_Metadata_generation(ctx, field) + case "labels": + return ec.fieldContext_Metadata_labels(ctx, field) + case "name": + return ec.fieldContext_Metadata_name(ctx, field) + case "namespace": + return ec.fieldContext_Metadata_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ProjectManagedService_projectName(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProjectManagedService_projectName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ProjectName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_ProjectManagedService_projectName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProjectManagedService", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ProjectManagedService_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProjectManagedService_recordVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RecordVersion, nil + }) + if err != nil { + ec.Error(ctx, 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_ProjectManagedService_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProjectManagedService", + 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) _ProjectManagedService_spec(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProjectManagedService_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 ec.resolvers.ProjectManagedService().Spec(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpec) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpec(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ProjectManagedService_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProjectManagedService", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "msvcSpec": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec_msvcSpec(ctx, field) + case "targetNamespace": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec_targetNamespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ProjectManagedService_status(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProjectManagedService_status(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Status, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(operator.Status) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___pkg___operator__Status2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ProjectManagedService_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProjectManagedService", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "checks": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx, field) + case "isReady": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_isReady(ctx, field) + case "lastReadyGeneration": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReadyGeneration(ctx, field) + case "lastReconcileTime": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReconcileTime(ctx, field) + case "message": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_message(ctx, field) + case "resources": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_resources(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___pkg___operator__Status", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ProjectManagedService_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProjectManagedService_syncStatus(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SyncStatus, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(types.SyncStatus) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___pkg___types__SyncStatus2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ProjectManagedService_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProjectManagedService", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "action": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx, field) + case "error": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx, field) + case "lastSyncedAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx, field) + case "recordVersion": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx, field) + case "state": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx, field) + case "syncScheduledAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___pkg___types__SyncStatus", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ProjectManagedService_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProjectManagedService_updateTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.ProjectManagedService().UpdateTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ProjectManagedService_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProjectManagedService", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ProjectManagedServiceEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.ProjectManagedServiceEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProjectManagedServiceEdge_cursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ProjectManagedServiceEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProjectManagedServiceEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ProjectManagedServiceEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.ProjectManagedServiceEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProjectManagedServiceEdge_node(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*entities.ProjectManagedService) + fc.Result = res + return ec.marshalNProjectManagedService2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProjectManagedService(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ProjectManagedServiceEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProjectManagedServiceEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accountName": + return ec.fieldContext_ProjectManagedService_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_ProjectManagedService_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_ProjectManagedService_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_ProjectManagedService_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_ProjectManagedService_displayName(ctx, field) + case "id": + return ec.fieldContext_ProjectManagedService_id(ctx, field) + case "kind": + return ec.fieldContext_ProjectManagedService_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_ProjectManagedService_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_ProjectManagedService_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_ProjectManagedService_metadata(ctx, field) + case "projectName": + return ec.fieldContext_ProjectManagedService_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_ProjectManagedService_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_ProjectManagedService_spec(ctx, field) + case "status": + return ec.fieldContext_ProjectManagedService_status(ctx, field) + case "syncStatus": + return ec.fieldContext_ProjectManagedService_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_ProjectManagedService_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ProjectManagedService", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ProjectManagedServicePaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.ProjectManagedServicePaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProjectManagedServicePaginatedRecords_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.ProjectManagedServiceEdge) + fc.Result = res + return ec.marshalNProjectManagedServiceEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐProjectManagedServiceEdgeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ProjectManagedServicePaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProjectManagedServicePaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cursor": + return ec.fieldContext_ProjectManagedServiceEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_ProjectManagedServiceEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ProjectManagedServiceEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ProjectManagedServicePaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.ProjectManagedServicePaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProjectManagedServicePaginatedRecords_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.PageInfo) + fc.Result = res + return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ProjectManagedServicePaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProjectManagedServicePaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ProjectManagedServicePaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.ProjectManagedServicePaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProjectManagedServicePaginatedRecords_totalCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalCount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ProjectManagedServicePaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProjectManagedServicePaginatedRecords", + 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) _ProjectPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.ProjectPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProjectPaginatedRecords_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.ProjectEdge) + fc.Result = res + return ec.marshalNProjectEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐProjectEdgeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ProjectPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProjectPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cursor": + return ec.fieldContext_ProjectEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_ProjectEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ProjectEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ProjectPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.ProjectPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProjectPaginatedRecords_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.PageInfo) + fc.Result = res + return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ProjectPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProjectPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ProjectPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.ProjectPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ProjectPaginatedRecords_totalCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalCount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ProjectPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProjectPaginatedRecords", + 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) _Query_core_checkNameAvailability(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_checkNameAvailability(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreCheckNameAvailability(rctx, fc.Args["projectName"].(*string), fc.Args["envName"].(*string), fc.Args["resType"].(entities.ResourceType), fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedIn == nil { + return nil, errors.New("directive isLoggedIn is not implemented") + } + return ec.directives.IsLoggedIn(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*domain.CheckNameAvailabilityOutput); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/domain.CheckNameAvailabilityOutput`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*domain.CheckNameAvailabilityOutput) + fc.Result = res + return ec.marshalNConsoleCheckNameAvailabilityOutput2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐCheckNameAvailabilityOutput(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_core_checkNameAvailability(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 "result": + return ec.fieldContext_ConsoleCheckNameAvailabilityOutput_result(ctx, field) + case "suggestedNames": + return ec.fieldContext_ConsoleCheckNameAvailabilityOutput_suggestedNames(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ConsoleCheckNameAvailabilityOutput", field.Name) + }, + } + defer func() { + if 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_core_checkNameAvailability_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_listProjects(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_listProjects(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreListProjects(rctx, fc.Args["search"].(*model.SearchProjects), fc.Args["pq"].(*repos.CursorPagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.ProjectPaginatedRecords); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.ProjectPaginatedRecords`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.ProjectPaginatedRecords) + fc.Result = res + return ec.marshalOProjectPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐProjectPaginatedRecords(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_core_listProjects(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_ProjectPaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_ProjectPaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_ProjectPaginatedRecords_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ProjectPaginatedRecords", field.Name) + }, + } + defer func() { + if 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_core_listProjects_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_getProject(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_getProject(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreGetProject(rctx, fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Project); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Project`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.Project) + fc.Result = res + return ec.marshalOProject2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProject(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_core_getProject(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 "accountName": + return ec.fieldContext_Project_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Project_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_Project_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_Project_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Project_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_Project_displayName(ctx, field) + case "id": + return ec.fieldContext_Project_id(ctx, field) + case "kind": + return ec.fieldContext_Project_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Project_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Project_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Project_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_Project_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_Project_spec(ctx, field) + case "status": + return ec.fieldContext_Project_status(ctx, field) + case "syncStatus": + return ec.fieldContext_Project_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_Project_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Project", field.Name) + }, + } + defer func() { + if 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_core_getProject_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_resyncProject(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_resyncProject(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreResyncProject(rctx, fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_Query_core_resyncProject(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_core_resyncProject_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_listEnvironments(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_listEnvironments(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreListEnvironments(rctx, fc.Args["projectName"].(string), fc.Args["search"].(*model.SearchEnvironments), fc.Args["pq"].(*repos.CursorPagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.EnvironmentPaginatedRecords); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.EnvironmentPaginatedRecords`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.EnvironmentPaginatedRecords) + fc.Result = res + return ec.marshalOEnvironmentPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐEnvironmentPaginatedRecords(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_core_listEnvironments(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_EnvironmentPaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_EnvironmentPaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_EnvironmentPaginatedRecords_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EnvironmentPaginatedRecords", field.Name) + }, + } + defer func() { + if 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_core_listEnvironments_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_getEnvironment(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_getEnvironment(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreGetEnvironment(rctx, fc.Args["projectName"].(string), fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Environment); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Environment`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.Environment) + fc.Result = res + return ec.marshalOEnvironment2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐEnvironment(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_core_getEnvironment(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 "accountName": + return ec.fieldContext_Environment_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Environment_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_Environment_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Environment_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_Environment_displayName(ctx, field) + case "id": + return ec.fieldContext_Environment_id(ctx, field) + case "kind": + return ec.fieldContext_Environment_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Environment_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Environment_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Environment_metadata(ctx, field) + case "projectName": + return ec.fieldContext_Environment_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_Environment_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_Environment_spec(ctx, field) + case "status": + return ec.fieldContext_Environment_status(ctx, field) + case "syncStatus": + return ec.fieldContext_Environment_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_Environment_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Environment", field.Name) + }, + } + defer func() { + if 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_core_getEnvironment_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_resyncEnvironment(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_resyncEnvironment(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreResyncEnvironment(rctx, fc.Args["projectName"].(string), fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_Query_core_resyncEnvironment(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_core_resyncEnvironment_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_listImagePullSecrets(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_listImagePullSecrets(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreListImagePullSecrets(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["search"].(*model.SearchImagePullSecrets), fc.Args["pq"].(*repos.CursorPagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.ImagePullSecretPaginatedRecords); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.ImagePullSecretPaginatedRecords`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.ImagePullSecretPaginatedRecords) + fc.Result = res + return ec.marshalOImagePullSecretPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐImagePullSecretPaginatedRecords(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_core_listImagePullSecrets(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_ImagePullSecretPaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_ImagePullSecretPaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_ImagePullSecretPaginatedRecords_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ImagePullSecretPaginatedRecords", field.Name) + }, + } + defer func() { + if 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_core_listImagePullSecrets_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_getImagePullSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_getImagePullSecret(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreGetImagePullSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.ImagePullSecret); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ImagePullSecret`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.ImagePullSecret) + fc.Result = res + return ec.marshalOImagePullSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐImagePullSecret(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_core_getImagePullSecret(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 "accountName": + return ec.fieldContext_ImagePullSecret_accountName(ctx, field) + case "createdBy": + return ec.fieldContext_ImagePullSecret_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_ImagePullSecret_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_ImagePullSecret_displayName(ctx, field) + case "dockerConfigJson": + return ec.fieldContext_ImagePullSecret_dockerConfigJson(ctx, field) + case "environmentName": + return ec.fieldContext_ImagePullSecret_environmentName(ctx, field) + case "format": + return ec.fieldContext_ImagePullSecret_format(ctx, field) + case "id": + return ec.fieldContext_ImagePullSecret_id(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_ImagePullSecret_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_ImagePullSecret_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_ImagePullSecret_metadata(ctx, field) + case "projectName": + return ec.fieldContext_ImagePullSecret_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_ImagePullSecret_recordVersion(ctx, field) + case "registryPassword": + return ec.fieldContext_ImagePullSecret_registryPassword(ctx, field) + case "registryURL": + return ec.fieldContext_ImagePullSecret_registryURL(ctx, field) + case "registryUsername": + return ec.fieldContext_ImagePullSecret_registryUsername(ctx, field) + case "syncStatus": + return ec.fieldContext_ImagePullSecret_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_ImagePullSecret_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ImagePullSecret", field.Name) + }, + } + defer func() { + if 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_core_getImagePullSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_resyncImagePullSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_resyncImagePullSecret(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreResyncImagePullSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_Query_core_resyncImagePullSecret(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_core_resyncImagePullSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_listApps(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_listApps(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreListApps(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["search"].(*model.SearchApps), fc.Args["pq"].(*repos.CursorPagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.AppPaginatedRecords); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.AppPaginatedRecords`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.AppPaginatedRecords) + fc.Result = res + return ec.marshalOAppPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppPaginatedRecords(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_core_listApps(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_AppPaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_AppPaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_AppPaginatedRecords_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type AppPaginatedRecords", field.Name) + }, + } + defer func() { + if 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_core_listApps_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_getApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_getApp(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreGetApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.App); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.App`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.App) + fc.Result = res + return ec.marshalOApp2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐApp(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_core_getApp(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 "accountName": + return ec.fieldContext_App_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_App_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_App_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_App_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_App_displayName(ctx, field) + case "enabled": + return ec.fieldContext_App_enabled(ctx, field) + case "environmentName": + return ec.fieldContext_App_environmentName(ctx, field) + case "id": + return ec.fieldContext_App_id(ctx, field) + case "kind": + return ec.fieldContext_App_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_App_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_App_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_App_metadata(ctx, field) + case "projectName": + return ec.fieldContext_App_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_App_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_App_spec(ctx, field) + case "status": + return ec.fieldContext_App_status(ctx, field) + case "syncStatus": + return ec.fieldContext_App_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_App_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type App", field.Name) + }, + } + defer func() { + if 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_core_getApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_resyncApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_resyncApp(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreResyncApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_Query_core_resyncApp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_core_resyncApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_restartApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_restartApp(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreRestartApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["appName"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_Query_core_restartApp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_core_restartApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_getConfigValues(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_getConfigValues(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreGetConfigValues(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["queries"].([]*domain.ConfigKeyRef)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.([]*domain.ConfigKeyValueRef); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/kloudlite/api/apps/console/internal/domain.ConfigKeyValueRef`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*domain.ConfigKeyValueRef) + fc.Result = res + return ec.marshalOConfigKeyValueRef2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐConfigKeyValueRefᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_core_getConfigValues(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 "configName": + return ec.fieldContext_ConfigKeyValueRef_configName(ctx, field) + case "key": + return ec.fieldContext_ConfigKeyValueRef_key(ctx, field) + case "value": + return ec.fieldContext_ConfigKeyValueRef_value(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ConfigKeyValueRef", field.Name) + }, + } + defer func() { + if 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_core_getConfigValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_listConfigs(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_listConfigs(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreListConfigs(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["search"].(*model.SearchConfigs), fc.Args["pq"].(*repos.CursorPagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.ConfigPaginatedRecords); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.ConfigPaginatedRecords`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.ConfigPaginatedRecords) + fc.Result = res + return ec.marshalOConfigPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐConfigPaginatedRecords(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_core_listConfigs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_ConfigPaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_ConfigPaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_ConfigPaginatedRecords_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ConfigPaginatedRecords", field.Name) + }, + } + defer func() { + if 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_core_listConfigs_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_getConfig(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_getConfig(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreGetConfig(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Config); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Config`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.Config) + fc.Result = res + return ec.marshalOConfig2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConfig(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_core_getConfig(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 "accountName": + return ec.fieldContext_Config_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Config_apiVersion(ctx, field) + case "binaryData": + return ec.fieldContext_Config_binaryData(ctx, field) + case "createdBy": + return ec.fieldContext_Config_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Config_creationTime(ctx, field) + case "data": + return ec.fieldContext_Config_data(ctx, field) + case "displayName": + return ec.fieldContext_Config_displayName(ctx, field) + case "environmentName": + return ec.fieldContext_Config_environmentName(ctx, field) + case "id": + return ec.fieldContext_Config_id(ctx, field) + case "immutable": + return ec.fieldContext_Config_immutable(ctx, field) + case "kind": + return ec.fieldContext_Config_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Config_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Config_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Config_metadata(ctx, field) + case "projectName": + return ec.fieldContext_Config_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_Config_recordVersion(ctx, field) + case "syncStatus": + return ec.fieldContext_Config_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_Config_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Config", field.Name) + }, + } + defer func() { + if 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_core_getConfig_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_resyncConfig(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_resyncConfig(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreResyncConfig(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_Query_core_resyncConfig(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_core_resyncConfig_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_getSecretValues(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_getSecretValues(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreGetSecretValues(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["queries"].([]*domain.SecretKeyRef)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.([]*domain.SecretKeyValueRef); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/kloudlite/api/apps/console/internal/domain.SecretKeyValueRef`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*domain.SecretKeyValueRef) + fc.Result = res + return ec.marshalOSecretKeyValueRef2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐSecretKeyValueRefᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_core_getSecretValues(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 "key": + return ec.fieldContext_SecretKeyValueRef_key(ctx, field) + case "secretName": + return ec.fieldContext_SecretKeyValueRef_secretName(ctx, field) + case "value": + return ec.fieldContext_SecretKeyValueRef_value(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type SecretKeyValueRef", field.Name) + }, + } + defer func() { + if 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_core_getSecretValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_listSecrets(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_listSecrets(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreListSecrets(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["search"].(*model.SearchSecrets), fc.Args["pq"].(*repos.CursorPagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.SecretPaginatedRecords); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.SecretPaginatedRecords`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.SecretPaginatedRecords) + fc.Result = res + return ec.marshalOSecretPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSecretPaginatedRecords(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_core_listSecrets(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_SecretPaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_SecretPaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_SecretPaginatedRecords_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type SecretPaginatedRecords", field.Name) + }, + } + defer func() { + if 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_core_listSecrets_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_getSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_getSecret(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreGetSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Secret); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Secret`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.Secret) + fc.Result = res + return ec.marshalOSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐSecret(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_core_getSecret(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 "accountName": + return ec.fieldContext_Secret_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Secret_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_Secret_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Secret_creationTime(ctx, field) + case "data": + return ec.fieldContext_Secret_data(ctx, field) + case "displayName": + return ec.fieldContext_Secret_displayName(ctx, field) + case "environmentName": + return ec.fieldContext_Secret_environmentName(ctx, field) + case "id": + return ec.fieldContext_Secret_id(ctx, field) + case "immutable": + return ec.fieldContext_Secret_immutable(ctx, field) + case "kind": + return ec.fieldContext_Secret_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Secret_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Secret_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Secret_metadata(ctx, field) + case "projectName": + return ec.fieldContext_Secret_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_Secret_recordVersion(ctx, field) + case "stringData": + return ec.fieldContext_Secret_stringData(ctx, field) + case "syncStatus": + return ec.fieldContext_Secret_syncStatus(ctx, field) + case "type": + return ec.fieldContext_Secret_type(ctx, field) + case "updateTime": + return ec.fieldContext_Secret_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Secret", field.Name) + }, + } + defer func() { + if 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_core_getSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_resyncSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_resyncSecret(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreResyncSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_Query_core_resyncSecret(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_core_resyncSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_listRouters(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_listRouters(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreListRouters(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["search"].(*model.SearchRouters), fc.Args["pq"].(*repos.CursorPagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.RouterPaginatedRecords); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.RouterPaginatedRecords`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.RouterPaginatedRecords) + fc.Result = res + return ec.marshalORouterPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterPaginatedRecords(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_core_listRouters(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_RouterPaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_RouterPaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_RouterPaginatedRecords_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type RouterPaginatedRecords", field.Name) + }, + } + defer func() { + if 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_core_listRouters_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_getRouter(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_getRouter(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreGetRouter(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Router); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Router`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.Router) + fc.Result = res + return ec.marshalORouter2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐRouter(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_core_getRouter(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 "accountName": + return ec.fieldContext_Router_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Router_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_Router_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Router_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_Router_displayName(ctx, field) + case "enabled": + return ec.fieldContext_Router_enabled(ctx, field) + case "environmentName": + return ec.fieldContext_Router_environmentName(ctx, field) + case "id": + return ec.fieldContext_Router_id(ctx, field) + case "kind": + return ec.fieldContext_Router_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Router_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Router_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Router_metadata(ctx, field) + case "projectName": + return ec.fieldContext_Router_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_Router_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_Router_spec(ctx, field) + case "status": + return ec.fieldContext_Router_status(ctx, field) + case "syncStatus": + return ec.fieldContext_Router_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_Router_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Router", field.Name) + }, + } + defer func() { + if 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_core_getRouter_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_resyncRouter(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_resyncRouter(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreResyncRouter(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_Query_core_resyncRouter(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_core_resyncRouter_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_getManagedResouceOutputKeys(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_getManagedResouceOutputKeys(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreGetManagedResouceOutputKeys(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.([]string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be []string`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + 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_Query_core_getManagedResouceOutputKeys(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_core_getManagedResouceOutputKeys_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_getManagedResouceOutputKeyValues(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_getManagedResouceOutputKeyValues(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreGetManagedResouceOutputKeyValues(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["keyrefs"].([]*domain.ManagedResourceKeyRef)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.([]*domain.ManagedResourceKeyValueRef); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/kloudlite/api/apps/console/internal/domain.ManagedResourceKeyValueRef`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*domain.ManagedResourceKeyValueRef) + fc.Result = res + return ec.marshalNManagedResourceKeyValueRef2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐManagedResourceKeyValueRefᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_core_getManagedResouceOutputKeyValues(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 "key": + return ec.fieldContext_ManagedResourceKeyValueRef_key(ctx, field) + case "mresName": + return ec.fieldContext_ManagedResourceKeyValueRef_mresName(ctx, field) + case "value": + return ec.fieldContext_ManagedResourceKeyValueRef_value(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ManagedResourceKeyValueRef", field.Name) + }, + } + defer func() { + if 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_core_getManagedResouceOutputKeyValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_listManagedResources(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_listManagedResources(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreListManagedResources(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["search"].(*model.SearchManagedResources), fc.Args["pq"].(*repos.CursorPagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.ManagedResourcePaginatedRecords); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.ManagedResourcePaginatedRecords`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.ManagedResourcePaginatedRecords) + fc.Result = res + return ec.marshalOManagedResourcePaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedResourcePaginatedRecords(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_core_listManagedResources(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_ManagedResourcePaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_ManagedResourcePaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_ManagedResourcePaginatedRecords_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ManagedResourcePaginatedRecords", field.Name) + }, + } + defer func() { + if 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_core_listManagedResources_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_getManagedResource(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_getManagedResource(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreGetManagedResource(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.ManagedResource); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ManagedResource`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.ManagedResource) + fc.Result = res + return ec.marshalOManagedResource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐManagedResource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_core_getManagedResource(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 "accountName": + return ec.fieldContext_ManagedResource_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_ManagedResource_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_ManagedResource_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_ManagedResource_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_ManagedResource_displayName(ctx, field) + case "enabled": + return ec.fieldContext_ManagedResource_enabled(ctx, field) + case "environmentName": + return ec.fieldContext_ManagedResource_environmentName(ctx, field) + case "id": + return ec.fieldContext_ManagedResource_id(ctx, field) + case "kind": + return ec.fieldContext_ManagedResource_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_ManagedResource_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_ManagedResource_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_ManagedResource_metadata(ctx, field) + case "projectName": + return ec.fieldContext_ManagedResource_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_ManagedResource_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_ManagedResource_spec(ctx, field) + case "status": + return ec.fieldContext_ManagedResource_status(ctx, field) + case "syncStatus": + return ec.fieldContext_ManagedResource_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_ManagedResource_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ManagedResource", field.Name) + }, + } + defer func() { + if 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_core_getManagedResource_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_resyncManagedResource(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_resyncManagedResource(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreResyncManagedResource(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_Query_core_resyncManagedResource(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_core_resyncManagedResource_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_listProjectManagedServices(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_listProjectManagedServices(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreListProjectManagedServices(rctx, fc.Args["projectName"].(string), fc.Args["search"].(*model.SearchProjectManagedService), fc.Args["pq"].(*repos.CursorPagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.ProjectManagedServicePaginatedRecords); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.ProjectManagedServicePaginatedRecords`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.ProjectManagedServicePaginatedRecords) + fc.Result = res + return ec.marshalOProjectManagedServicePaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐProjectManagedServicePaginatedRecords(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_core_listProjectManagedServices(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_ProjectManagedServicePaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_ProjectManagedServicePaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_ProjectManagedServicePaginatedRecords_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ProjectManagedServicePaginatedRecords", field.Name) + }, + } + defer func() { + if 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_core_listProjectManagedServices_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_getProjectManagedService(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_getProjectManagedService(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreGetProjectManagedService(rctx, fc.Args["projectName"].(string), fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.ProjectManagedService); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ProjectManagedService`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.ProjectManagedService) + fc.Result = res + return ec.marshalOProjectManagedService2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProjectManagedService(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_core_getProjectManagedService(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 "accountName": + return ec.fieldContext_ProjectManagedService_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_ProjectManagedService_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_ProjectManagedService_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_ProjectManagedService_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_ProjectManagedService_displayName(ctx, field) + case "id": + return ec.fieldContext_ProjectManagedService_id(ctx, field) + case "kind": + return ec.fieldContext_ProjectManagedService_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_ProjectManagedService_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_ProjectManagedService_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_ProjectManagedService_metadata(ctx, field) + case "projectName": + return ec.fieldContext_ProjectManagedService_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_ProjectManagedService_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_ProjectManagedService_spec(ctx, field) + case "status": + return ec.fieldContext_ProjectManagedService_status(ctx, field) + case "syncStatus": + return ec.fieldContext_ProjectManagedService_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_ProjectManagedService_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ProjectManagedService", field.Name) + }, + } + defer func() { + if 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_core_getProjectManagedService_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_resyncProjectManagedService(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_resyncProjectManagedService(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreResyncProjectManagedService(rctx, fc.Args["projectName"].(string), fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_Query_core_resyncProjectManagedService(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_core_resyncProjectManagedService_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_restartProjectManagedService(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_restartProjectManagedService(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreRestartProjectManagedService(rctx, fc.Args["projectName"].(string), fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_Query_core_restartProjectManagedService(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_core_restartProjectManagedService_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_listVPNDevices(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_listVPNDevices(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreListVPNDevices(rctx, fc.Args["search"].(*model.CoreSearchVPNDevices), fc.Args["pq"].(*repos.CursorPagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.ConsoleVPNDevicePaginatedRecords); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.ConsoleVPNDevicePaginatedRecords`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.ConsoleVPNDevicePaginatedRecords) + fc.Result = res + return ec.marshalOConsoleVPNDevicePaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐConsoleVPNDevicePaginatedRecords(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_core_listVPNDevices(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_ConsoleVPNDevicePaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_ConsoleVPNDevicePaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_ConsoleVPNDevicePaginatedRecords_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ConsoleVPNDevicePaginatedRecords", field.Name) + }, + } + defer func() { + if 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_core_listVPNDevices_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_core_listVPNDevicesForUser(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_listVPNDevicesForUser(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreListVPNDevicesForUser(rctx) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.([]*entities.ConsoleVPNDevice); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/kloudlite/api/apps/console/internal/entities.ConsoleVPNDevice`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*entities.ConsoleVPNDevice) + fc.Result = res + return ec.marshalOConsoleVPNDevice2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConsoleVPNDeviceᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_core_listVPNDevicesForUser(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 "accountName": + return ec.fieldContext_ConsoleVPNDevice_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_ConsoleVPNDevice_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_ConsoleVPNDevice_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_ConsoleVPNDevice_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_ConsoleVPNDevice_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_ConsoleVPNDevice_displayName(ctx, field) + case "environmentName": + return ec.fieldContext_ConsoleVPNDevice_environmentName(ctx, field) + case "id": + return ec.fieldContext_ConsoleVPNDevice_id(ctx, field) + case "kind": + return ec.fieldContext_ConsoleVPNDevice_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_ConsoleVPNDevice_lastUpdatedBy(ctx, field) + case "linkedClusters": + return ec.fieldContext_ConsoleVPNDevice_linkedClusters(ctx, field) + case "markedForDeletion": + return ec.fieldContext_ConsoleVPNDevice_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_ConsoleVPNDevice_metadata(ctx, field) + case "projectName": + return ec.fieldContext_ConsoleVPNDevice_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_ConsoleVPNDevice_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_ConsoleVPNDevice_spec(ctx, field) + case "status": + return ec.fieldContext_ConsoleVPNDevice_status(ctx, field) + case "syncStatus": + return ec.fieldContext_ConsoleVPNDevice_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_ConsoleVPNDevice_updateTime(ctx, field) + case "wireguardConfig": + return ec.fieldContext_ConsoleVPNDevice_wireguardConfig(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ConsoleVPNDevice", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_core_getVPNDevice(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_getVPNDevice(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreGetVPNDevice(rctx, fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.ConsoleVPNDevice); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ConsoleVPNDevice`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.ConsoleVPNDevice) + fc.Result = res + return ec.marshalOConsoleVPNDevice2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConsoleVPNDevice(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_core_getVPNDevice(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 "accountName": + return ec.fieldContext_ConsoleVPNDevice_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_ConsoleVPNDevice_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_ConsoleVPNDevice_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_ConsoleVPNDevice_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_ConsoleVPNDevice_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_ConsoleVPNDevice_displayName(ctx, field) + case "environmentName": + return ec.fieldContext_ConsoleVPNDevice_environmentName(ctx, field) + case "id": + return ec.fieldContext_ConsoleVPNDevice_id(ctx, field) + case "kind": + return ec.fieldContext_ConsoleVPNDevice_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_ConsoleVPNDevice_lastUpdatedBy(ctx, field) + case "linkedClusters": + return ec.fieldContext_ConsoleVPNDevice_linkedClusters(ctx, field) + case "markedForDeletion": + return ec.fieldContext_ConsoleVPNDevice_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_ConsoleVPNDevice_metadata(ctx, field) + case "projectName": + return ec.fieldContext_ConsoleVPNDevice_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_ConsoleVPNDevice_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_ConsoleVPNDevice_spec(ctx, field) + case "status": + return ec.fieldContext_ConsoleVPNDevice_status(ctx, field) + case "syncStatus": + return ec.fieldContext_ConsoleVPNDevice_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_ConsoleVPNDevice_updateTime(ctx, field) + case "wireguardConfig": + return ec.fieldContext_ConsoleVPNDevice_wireguardConfig(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ConsoleVPNDevice", field.Name) + }, + } + defer func() { + if 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_core_getVPNDevice_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query__service(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query__service(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.__resolve__service(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(fedruntime.Service) + fc.Result = res + return ec.marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query__service(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 "sdl": + return ec.fieldContext__Service_sdl(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type _Service", 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 + } + 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(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 "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) _Router_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_accountName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Router_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Router", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Router_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_apiVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.APIVersion, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Router_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Router", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Router_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Router_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Router", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Router_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_creationTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Router().CreationTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Router_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Router", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Router_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_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_Router_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Router", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Router_enabled(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_enabled(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Enabled, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalOBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Router_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Router", + 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) _Router_environmentName(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_environmentName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.EnvironmentName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Router_environmentName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Router", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Router_id(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_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 ec.resolvers.Router().ID(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_Router_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Router", + 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) _Router_kind(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Router_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Router", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Router_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_lastUpdatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastUpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Router_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Router", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Router_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_markedForDeletion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MarkedForDeletion, 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_Router_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Router", + 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) _Router_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_metadata(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ObjectMeta, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(v12.ObjectMeta) + fc.Result = res + return ec.marshalOMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Router_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Router", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "annotations": + return ec.fieldContext_Metadata_annotations(ctx, field) + case "creationTimestamp": + return ec.fieldContext_Metadata_creationTimestamp(ctx, field) + case "deletionTimestamp": + return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) + case "generation": + return ec.fieldContext_Metadata_generation(ctx, field) + case "labels": + return ec.fieldContext_Metadata_labels(ctx, field) + case "name": + return ec.fieldContext_Metadata_name(ctx, field) + case "namespace": + return ec.fieldContext_Metadata_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Router_projectName(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_projectName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ProjectName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Router_projectName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Router", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Router_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_recordVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RecordVersion, nil + }) + if err != nil { + ec.Error(ctx, 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_Router_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Router", + 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) _Router_spec(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_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 ec.resolvers.Router().Spec(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.GithubComKloudliteOperatorApisCrdsV1RouterSpec) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___operator___apis___crds___v1__RouterSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1RouterSpec(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Router_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Router", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "backendProtocol": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_backendProtocol(ctx, field) + case "basicAuth": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_basicAuth(ctx, field) + case "cors": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_cors(ctx, field) + case "domains": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_domains(ctx, field) + case "https": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_https(ctx, field) + case "ingressClass": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_ingressClass(ctx, field) + case "maxBodySizeInMB": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_maxBodySizeInMB(ctx, field) + case "rateLimit": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_rateLimit(ctx, field) + case "routes": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_routes(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__RouterSpec", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Router_status(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_status(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Status, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(operator.Status) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___pkg___operator__Status2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Router_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Router", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "checks": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx, field) + case "isReady": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_isReady(ctx, field) + case "lastReadyGeneration": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReadyGeneration(ctx, field) + case "lastReconcileTime": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReconcileTime(ctx, field) + case "message": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_message(ctx, field) + case "resources": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_resources(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___pkg___operator__Status", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Router_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_syncStatus(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SyncStatus, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(types.SyncStatus) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___pkg___types__SyncStatus2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Router_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Router", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "action": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx, field) + case "error": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx, field) + case "lastSyncedAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx, field) + case "recordVersion": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx, field) + case "state": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx, field) + case "syncScheduledAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___pkg___types__SyncStatus", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Router_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_updateTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Router().UpdateTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Router_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Router", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _RouterEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.RouterEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RouterEdge_cursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_RouterEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "RouterEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _RouterEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.RouterEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RouterEdge_node(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*entities.Router) + fc.Result = res + return ec.marshalNRouter2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐRouter(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_RouterEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "RouterEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accountName": + return ec.fieldContext_Router_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Router_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_Router_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Router_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_Router_displayName(ctx, field) + case "enabled": + return ec.fieldContext_Router_enabled(ctx, field) + case "environmentName": + return ec.fieldContext_Router_environmentName(ctx, field) + case "id": + return ec.fieldContext_Router_id(ctx, field) + case "kind": + return ec.fieldContext_Router_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Router_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Router_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Router_metadata(ctx, field) + case "projectName": + return ec.fieldContext_Router_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_Router_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_Router_spec(ctx, field) + case "status": + return ec.fieldContext_Router_status(ctx, field) + case "syncStatus": + return ec.fieldContext_Router_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_Router_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Router", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _RouterPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.RouterPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RouterPaginatedRecords_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.RouterEdge) + fc.Result = res + return ec.marshalNRouterEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterEdgeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_RouterPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "RouterPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cursor": + return ec.fieldContext_RouterEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_RouterEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type RouterEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _RouterPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.RouterPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RouterPaginatedRecords_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.PageInfo) + fc.Result = res + return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_RouterPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "RouterPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _RouterPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.RouterPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RouterPaginatedRecords_totalCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalCount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_RouterPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "RouterPaginatedRecords", + 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) _Secret_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Secret_accountName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Secret_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Secret", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Secret_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Secret_apiVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.APIVersion, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Secret_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Secret", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Secret_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Secret_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Secret_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Secret", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Secret_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Secret_creationTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Secret().CreationTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Secret_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Secret", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Secret_data(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Secret_data(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Secret().Data(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Secret_data(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Secret", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Secret_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Secret_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_Secret_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Secret", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Secret_environmentName(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Secret_environmentName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.EnvironmentName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Secret_environmentName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Secret", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Secret_id(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Secret_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 ec.resolvers.Secret().ID(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_Secret_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Secret", + 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) _Secret_immutable(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Secret_immutable(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Immutable, 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_Secret_immutable(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Secret", + 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) _Secret_kind(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Secret_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Secret_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Secret", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Secret_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Secret_lastUpdatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastUpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Secret_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Secret", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Secret_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Secret_markedForDeletion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MarkedForDeletion, 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_Secret_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Secret", + 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) _Secret_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Secret_metadata(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ObjectMeta, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(v12.ObjectMeta) + fc.Result = res + return ec.marshalOMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Secret_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Secret", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "annotations": + return ec.fieldContext_Metadata_annotations(ctx, field) + case "creationTimestamp": + return ec.fieldContext_Metadata_creationTimestamp(ctx, field) + case "deletionTimestamp": + return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) + case "generation": + return ec.fieldContext_Metadata_generation(ctx, field) + case "labels": + return ec.fieldContext_Metadata_labels(ctx, field) + case "name": + return ec.fieldContext_Metadata_name(ctx, field) + case "namespace": + return ec.fieldContext_Metadata_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Secret_projectName(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Secret_projectName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ProjectName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Secret_projectName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Secret", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Secret_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Secret_recordVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RecordVersion, nil + }) + if err != nil { + ec.Error(ctx, 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_Secret_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Secret", + 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) _Secret_stringData(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Secret_stringData(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Secret().StringData(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Secret_stringData(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Secret", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Secret_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Secret_syncStatus(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SyncStatus, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(types.SyncStatus) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___pkg___types__SyncStatus2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Secret_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Secret", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "action": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx, field) + case "error": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx, field) + case "lastSyncedAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx, field) + case "recordVersion": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx, field) + case "state": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx, field) + case "syncScheduledAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___pkg___types__SyncStatus", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Secret_type(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Secret_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.Secret().Type(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1SecretType) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__SecretType2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1SecretType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Secret_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Secret", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type K8s__io___api___core___v1__SecretType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Secret_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Secret_updateTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Secret().UpdateTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Secret_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Secret", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _SecretEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.SecretEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SecretEdge_cursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SecretEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SecretEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _SecretEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.SecretEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SecretEdge_node(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*entities.Secret) + fc.Result = res + return ec.marshalNSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐSecret(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SecretEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SecretEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accountName": + return ec.fieldContext_Secret_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Secret_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_Secret_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Secret_creationTime(ctx, field) + case "data": + return ec.fieldContext_Secret_data(ctx, field) + case "displayName": + return ec.fieldContext_Secret_displayName(ctx, field) + case "environmentName": + return ec.fieldContext_Secret_environmentName(ctx, field) + case "id": + return ec.fieldContext_Secret_id(ctx, field) + case "immutable": + return ec.fieldContext_Secret_immutable(ctx, field) + case "kind": + return ec.fieldContext_Secret_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Secret_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Secret_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Secret_metadata(ctx, field) + case "projectName": + return ec.fieldContext_Secret_projectName(ctx, field) + case "recordVersion": + return ec.fieldContext_Secret_recordVersion(ctx, field) + case "stringData": + return ec.fieldContext_Secret_stringData(ctx, field) + case "syncStatus": + return ec.fieldContext_Secret_syncStatus(ctx, field) + case "type": + return ec.fieldContext_Secret_type(ctx, field) + case "updateTime": + return ec.fieldContext_Secret_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Secret", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _SecretKeyRef_key(ctx context.Context, field graphql.CollectedField, obj *model.SecretKeyRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SecretKeyRef_key(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Key, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_SecretKeyRef_key(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SecretKeyRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _SecretKeyRef_secretName(ctx context.Context, field graphql.CollectedField, obj *model.SecretKeyRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SecretKeyRef_secretName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SecretName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + 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_SecretKeyRef_secretName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SecretKeyRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _SecretKeyValueRef_key(ctx context.Context, field graphql.CollectedField, obj *domain.SecretKeyValueRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SecretKeyValueRef_key(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Key, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_SecretKeyValueRef_key(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SecretKeyValueRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _SecretKeyValueRef_secretName(ctx context.Context, field graphql.CollectedField, obj *domain.SecretKeyValueRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SecretKeyValueRef_secretName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SecretName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + 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_SecretKeyValueRef_secretName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SecretKeyValueRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _SecretKeyValueRef_value(ctx context.Context, field graphql.CollectedField, obj *domain.SecretKeyValueRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SecretKeyValueRef_value(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SecretKeyValueRef_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SecretKeyValueRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _SecretPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.SecretPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SecretPaginatedRecords_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.SecretEdge) + fc.Result = res + return ec.marshalNSecretEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSecretEdgeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SecretPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SecretPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cursor": + return ec.fieldContext_SecretEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_SecretEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type SecretEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _SecretPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.SecretPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SecretPaginatedRecords_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.PageInfo) + fc.Result = res + return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SecretPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SecretPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _SecretPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.SecretPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SecretPaginatedRecords_totalCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalCount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SecretPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SecretPaginatedRecords", + 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) __Service_sdl(ctx context.Context, field graphql.CollectedField, obj *fedruntime.Service) (ret graphql.Marshaler) { + fc, err := ec.fieldContext__Service_sdl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SDL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext__Service_sdl(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "_Service", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field 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(ctx 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(ctx 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(ctx 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(ctx 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(ctx 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(ctx 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(ctx 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(ctx 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(ctx 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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + 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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, 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(ctx 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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + 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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, 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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_types(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Types(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_types(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_queryType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.QueryType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_queryType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_mutationType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MutationType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_mutationType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SubscriptionType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_directives(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Directives(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Directive) + fc.Result = res + return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_directives(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Directive_name(ctx, field) + case "description": + return ec.fieldContext___Directive_description(ctx, field) + case "locations": + return ec.fieldContext___Directive_locations(ctx, field) + case "args": + return ec.fieldContext___Directive_args(ctx, field) + case "isRepeatable": + return ec.fieldContext___Directive_isRepeatable(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalN__TypeKind2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __TypeKind does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_fields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Field) + fc.Result = res + return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Field_name(ctx, field) + case "description": + return ec.fieldContext___Field_description(ctx, field) + case "args": + return ec.fieldContext___Field_args(ctx, field) + case "type": + return ec.fieldContext___Field_type(ctx, field) + case "isDeprecated": + return ec.fieldContext___Field_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___Field_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_interfaces(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Interfaces(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_interfaces(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PossibleTypes(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_possibleTypes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_enumValues(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.EnumValue) + fc.Result = res + return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___EnumValue_name(ctx, field) + case "description": + return ec.fieldContext___EnumValue_description(ctx, field) + case "isDeprecated": + return ec.fieldContext___EnumValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___EnumValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_inputFields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.InputFields(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_inputFields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_ofType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OfType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_ofType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SpecifiedByURL(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +// endregion **************************** field.gotpl ***************************** + +// region **************************** input.gotpl ***************************** + +func (ec *executionContext) unmarshalInputAppIn(ctx context.Context, obj interface{}) (entities.App, error) { + var it entities.App + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"apiVersion", "displayName", "enabled", "kind", "metadata", "spec"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "apiVersion": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) + it.APIVersion, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "displayName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + it.DisplayName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "enabled": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) + it.Enabled, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + case "kind": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + it.Kind, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "metadata": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalOMetadataIn2ᚖk8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.AppIn().Metadata(ctx, &it, data); err != nil { + return it, err + } + case "spec": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) + data, err := ec.unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__AppSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppSpecIn(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.AppIn().Spec(ctx, &it, data); err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputConfigIn(ctx context.Context, obj interface{}) (entities.Config, error) { + var it entities.Config + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"apiVersion", "binaryData", "data", "displayName", "immutable", "kind", "metadata"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "apiVersion": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) + it.APIVersion, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "binaryData": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("binaryData")) + data, err := ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.ConfigIn().BinaryData(ctx, &it, data); err != nil { + return it, err + } + case "data": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("data")) + data, err := ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.ConfigIn().Data(ctx, &it, data); err != nil { + return it, err + } + case "displayName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + it.DisplayName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "immutable": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("immutable")) + it.Immutable, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + case "kind": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + it.Kind, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "metadata": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalOMetadataIn2ᚖk8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.ConfigIn().Metadata(ctx, &it, data); err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputConfigKeyRefIn(ctx context.Context, obj interface{}) (domain.ConfigKeyRef, error) { + var it domain.ConfigKeyRef + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"configName", "key"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "configName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configName")) + it.ConfigName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "key": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + it.Key, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputConfigKeyValueRefIn(ctx context.Context, obj interface{}) (model.ConfigKeyValueRefIn, error) { + var it model.ConfigKeyValueRefIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"configName", "key", "value"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "configName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configName")) + it.ConfigName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "key": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + it.Key, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "value": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + it.Value, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputConsoleVPNDeviceIn(ctx context.Context, obj interface{}) (entities.ConsoleVPNDevice, error) { + var it entities.ConsoleVPNDevice + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"apiVersion", "clusterName", "displayName", "environmentName", "kind", "metadata", "projectName", "spec"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "apiVersion": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) + it.APIVersion, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "clusterName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + it.ClusterName, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "displayName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + it.DisplayName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "environmentName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("environmentName")) + it.EnvironmentName, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "kind": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + it.Kind, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "metadata": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalOMetadataIn2ᚖk8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.ConsoleVPNDeviceIn().Metadata(ctx, &it, data); err != nil { + return it, err + } + case "projectName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + it.ProjectName, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "spec": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) + data, err := ec.unmarshalOGithub__com___kloudlite___operator___apis___wireguard___v1__DeviceSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisWireguardV1DeviceSpecIn(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.ConsoleVPNDeviceIn().Spec(ctx, &it, data); err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCoreSearchVPNDevices(ctx context.Context, obj interface{}) (model.CoreSearchVPNDevices, error) { + var it model.CoreSearchVPNDevices + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"text", "isReady", "markedForDeletion"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "text": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + it.Text, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + case "isReady": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) + it.IsReady, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + case "markedForDeletion": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("markedForDeletion")) + it.MarkedForDeletion, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCursorPaginationIn(ctx context.Context, obj interface{}) (repos.CursorPagination, error) { + var it repos.CursorPagination + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + if _, present := asMap["orderBy"]; !present { + asMap["orderBy"] = "_id" + } + if _, present := asMap["sortDirection"]; !present { + asMap["sortDirection"] = "ASC" + } + + fieldsInOrder := [...]string{"after", "before", "first", "last", "orderBy", "sortDirection"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "after": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + it.After, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "before": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + it.Before, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "first": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + it.First, err = ec.unmarshalOInt2ᚖint64(ctx, v) + if err != nil { + return it, err + } + case "last": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + it.Last, err = ec.unmarshalOInt2ᚖint64(ctx, v) + if err != nil { + return it, err + } + case "orderBy": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) + it.OrderBy, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "sortDirection": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sortDirection")) + it.SortDirection, err = ec.unmarshalOCursorPaginationSortDirection2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐSortDirection(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputEnvironmentIn(ctx context.Context, obj interface{}) (entities.Environment, error) { + var it entities.Environment + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"apiVersion", "displayName", "kind", "metadata", "spec"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "apiVersion": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) + it.APIVersion, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "displayName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + it.DisplayName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "kind": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + it.Kind, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "metadata": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalOMetadataIn2ᚖk8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.EnvironmentIn().Metadata(ctx, &it, data); err != nil { + return it, err + } + case "spec": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) + data, err := ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__EnvironmentSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1EnvironmentSpecIn(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.EnvironmentIn().Spec(ctx, &it, data); err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__AppContainerIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1AppContainerIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1AppContainerIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"args", "command", "env", "envFrom", "image", "imagePullPolicy", "livenessProbe", "name", "readinessProbe", "resourceCpu", "resourceMemory", "volumes"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "args": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("args")) + it.Args, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + case "command": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("command")) + it.Command, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + case "env": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("env")) + it.Env, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__ContainerEnvIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerEnvInᚄ(ctx, v) + if err != nil { + return it, err + } + case "envFrom": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envFrom")) + it.EnvFrom, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__EnvFromIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1EnvFromInᚄ(ctx, v) + if err != nil { + return it, err + } + case "image": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("image")) + it.Image, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "imagePullPolicy": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("imagePullPolicy")) + it.ImagePullPolicy, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "livenessProbe": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("livenessProbe")) + it.LivenessProbe, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__ProbeIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ProbeIn(ctx, v) + if err != nil { + return it, err + } + case "name": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + it.Name, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "readinessProbe": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("readinessProbe")) + it.ReadinessProbe, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__ProbeIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ProbeIn(ctx, v) + if err != nil { + return it, err + } + case "resourceCpu": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("resourceCpu")) + it.ResourceCPU, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__ContainerResourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerResourceIn(ctx, v) + if err != nil { + return it, err + } + case "resourceMemory": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("resourceMemory")) + it.ResourceMemory, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__ContainerResourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerResourceIn(ctx, v) + if err != nil { + return it, err + } + case "volumes": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("volumes")) + it.Volumes, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__ContainerVolumeIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerVolumeInᚄ(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__AppSpecIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1AppSpecIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1AppSpecIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"containers", "displayName", "freeze", "hpa", "intercept", "nodeSelector", "region", "replicas", "serviceAccount", "services", "tolerations"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "containers": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("containers")) + it.Containers, err = ec.unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__AppContainerIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppContainerInᚄ(ctx, v) + if err != nil { + return it, err + } + case "displayName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + it.DisplayName, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "freeze": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("freeze")) + it.Freeze, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + case "hpa": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hpa")) + it.Hpa, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__HPAIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1HPAIn(ctx, v) + if err != nil { + return it, err + } + case "intercept": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("intercept")) + it.Intercept, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__InterceptIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1InterceptIn(ctx, v) + if err != nil { + return it, err + } + case "nodeSelector": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nodeSelector")) + it.NodeSelector, err = ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + case "region": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("region")) + it.Region, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "replicas": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("replicas")) + it.Replicas, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + case "serviceAccount": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("serviceAccount")) + it.ServiceAccount, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "services": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("services")) + it.Services, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__AppSvcIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppSvcInᚄ(ctx, v) + if err != nil { + return it, err + } + case "tolerations": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tolerations")) + it.Tolerations, err = ec.unmarshalOK8s__io___api___core___v1__TolerationIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TolerationInᚄ(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__AppSvcIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1AppSvcIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1AppSvcIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"name", "port", "targetPort", "type"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "name": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + it.Name, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "port": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("port")) + it.Port, err = ec.unmarshalNInt2int(ctx, v) + if err != nil { + return it, err + } + case "targetPort": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetPort")) + it.TargetPort, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + case "type": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) + it.Type, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__BasicAuthIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1BasicAuthIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1BasicAuthIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"enabled", "secretName", "username"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "enabled": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) + it.Enabled, err = ec.unmarshalNBoolean2bool(ctx, v) + if err != nil { + return it, err + } + case "secretName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretName")) + it.SecretName, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "username": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("username")) + it.Username, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ContainerEnvIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1ContainerEnvIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1ContainerEnvIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"key", "optional", "refKey", "refName", "type", "value"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "key": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + it.Key, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "optional": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("optional")) + it.Optional, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + case "refKey": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refKey")) + it.RefKey, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "refName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refName")) + it.RefName, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "type": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) + it.Type, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ConfigOrSecret(ctx, v) + if err != nil { + return it, err + } + case "value": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + it.Value, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ContainerResourceIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1ContainerResourceIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1ContainerResourceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"max", "min"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "max": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("max")) + it.Max, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) - }, + case "min": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("min")) + it.Min, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } } - return fc, nil + + return it, 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 +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ContainerVolumeIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1ContainerVolumeIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1ContainerVolumeIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + + fieldsInOrder := [...]string{"items", "mountPath", "refName", "type"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue } - }() - 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") + switch k { + case "items": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("items")) + it.Items, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItemIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerVolumeItemInᚄ(ctx, v) + if err != nil { + return it, err + } + case "mountPath": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("mountPath")) + it.MountPath, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "refName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refName")) + it.RefName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "type": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) + it.Type, err = ec.unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ConfigOrSecret(ctx, v) + if err != nil { + return it, err + } } - return graphql.Null } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + + return it, nil } -func (ec *executionContext) fieldContext___Field_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItemIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1ContainerVolumeItemIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1ContainerVolumeItemIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"fileName", "key"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "fileName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileName")) + it.FileName, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, + case "key": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + it.Key, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } } - return fc, nil + + return it, 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 +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__CorsIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1CorsIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1CorsIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + + fieldsInOrder := [...]string{"allowCredentials", "enabled", "origins"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue } - }() - 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") + switch k { + case "allowCredentials": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("allowCredentials")) + it.AllowCredentials, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + case "enabled": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) + it.Enabled, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + case "origins": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("origins")) + it.Origins, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } } - return graphql.Null } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___Field_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") - }, - } - return fc, nil + return it, 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 +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__EnvFromIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1EnvFromIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1EnvFromIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + + fieldsInOrder := [...]string{"refName", "type"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue } - }() - 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) -} + switch k { + case "refName": + var err error -func (ec *executionContext) fieldContext___Field_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refName")) + it.RefName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "type": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) + it.Type, err = ec.unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ConfigOrSecret(ctx, v) + if err != nil { + return it, err + } + } } - return fc, nil + + return it, 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 +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1EnvironmentRoutingIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1EnvironmentRoutingIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + + fieldsInOrder := [...]string{"mode"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue } - }() - 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") + switch k { + case "mode": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("mode")) + it.Mode, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingMode2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋapisᚋcrdsᚋv1ᚐEnvironmentRoutingMode(ctx, v) + if err != nil { + return it, err + } } - return graphql.Null } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___InputValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil + return it, 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 +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__EnvironmentSpecIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1EnvironmentSpecIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1EnvironmentSpecIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + + fieldsInOrder := [...]string{"projectName", "routing", "targetNamespace"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue } - }() - 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) -} + switch k { + case "projectName": + var err error -func (ec *executionContext) fieldContext___InputValue_description(ctx 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") - }, + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + it.ProjectName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "routing": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("routing")) + it.Routing, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1EnvironmentRoutingIn(ctx, v) + if err != nil { + return it, err + } + case "targetNamespace": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetNamespace")) + it.TargetNamespace, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } } - return fc, nil + + return it, 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 +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__HPAIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1HPAIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1HPAIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + + fieldsInOrder := [...]string{"enabled", "maxReplicas", "minReplicas", "thresholdCpu", "thresholdMemory"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue } - }() - 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") + switch k { + case "enabled": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) + it.Enabled, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + case "maxReplicas": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("maxReplicas")) + it.MaxReplicas, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + case "minReplicas": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("minReplicas")) + it.MinReplicas, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + case "thresholdCpu": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("thresholdCpu")) + it.ThresholdCPU, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + case "thresholdMemory": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("thresholdMemory")) + it.ThresholdMemory, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } } - return graphql.Null } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + + return it, nil } -func (ec *executionContext) fieldContext___InputValue_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - 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) +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__HttpGetProbeIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1HTTPGetProbeIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1HTTPGetProbeIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"httpHeaders", "path", "port"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "httpHeaders": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("httpHeaders")) + it.HTTPHeaders, err = ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, + case "path": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("path")) + it.Path, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "port": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("port")) + it.Port, err = ec.unmarshalNInt2int(ctx, v) + if err != nil { + return it, err + } + } } - return fc, nil + + return it, 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 +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__HttpsIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1HTTPSIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1HTTPSIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + + fieldsInOrder := [...]string{"clusterIssuer", "enabled", "forceRedirect"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue } - }() - 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) -} + switch k { + case "clusterIssuer": + var err error -func (ec *executionContext) fieldContext___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterIssuer")) + it.ClusterIssuer, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "enabled": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) + it.Enabled, err = ec.unmarshalNBoolean2bool(ctx, v) + if err != nil { + return it, err + } + case "forceRedirect": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("forceRedirect")) + it.ForceRedirect, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + } } - return fc, nil + + return it, 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 +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__InterceptIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1InterceptIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1InterceptIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + + fieldsInOrder := [...]string{"enabled", "toDevice"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue } - }() - 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) -} + switch k { + case "enabled": + var err error -func (ec *executionContext) fieldContext___Schema_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) + it.Enabled, err = ec.unmarshalNBoolean2bool(ctx, v) + if err != nil { + return it, err + } + case "toDevice": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("toDevice")) + it.ToDevice, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } } - return fc, nil + + return it, 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 +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpecIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1ManagedResourceSpecIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1ManagedResourceSpecIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + + fieldsInOrder := [...]string{"resourceName", "resourceTemplate"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue } - }() - 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") + switch k { + case "resourceName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("resourceName")) + it.ResourceName, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "resourceTemplate": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("resourceTemplate")) + it.ResourceTemplate, err = ec.unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__MresResourceTemplateIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1MresResourceTemplateIn(ctx, v) + if err != nil { + return it, err + } } - return graphql.Null } - res := resTmp.([]introspection.Type) - fc.Result = res - return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + + return it, nil } -func (ec *executionContext) fieldContext___Schema_types(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpecIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpecIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"serviceTemplate"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "serviceTemplate": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("serviceTemplate")) + it.ServiceTemplate, err = ec.unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ServiceTemplateIn(ctx, v) + if err != nil { + return it, err } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, + } } - return fc, nil + + return it, 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 +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__MresResourceTemplateIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1MresResourceTemplateIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1MresResourceTemplateIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + + fieldsInOrder := [...]string{"apiVersion", "kind", "msvcRef", "spec"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue } - }() - 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") + switch k { + case "apiVersion": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) + it.APIVersion, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "kind": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + it.Kind, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "msvcRef": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("msvcRef")) + it.MsvcRef, err = ec.unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__MsvcNamedRefIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1MsvcNamedRefIn(ctx, v) + if err != nil { + return it, err + } + case "spec": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) + it.Spec, err = ec.unmarshalNMap2map(ctx, v) + if err != nil { + return it, err + } } - return graphql.Null } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + + return it, nil } -func (ec *executionContext) fieldContext___Schema_queryType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__MsvcNamedRefIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1MsvcNamedRefIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1MsvcNamedRefIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"apiVersion", "kind", "name", "namespace"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "apiVersion": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) + it.APIVersion, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, + case "kind": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + it.Kind, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "name": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + it.Name, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "namespace": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) + it.Namespace, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } } - return fc, nil + + return it, 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 +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ProbeIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1ProbeIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1ProbeIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + + fieldsInOrder := [...]string{"failureThreshold", "httpGet", "initialDelay", "interval", "shell", "tcp", "type"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue } - }() - 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) -} + switch k { + case "failureThreshold": + var err error -func (ec *executionContext) fieldContext___Schema_mutationType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("failureThreshold")) + it.FailureThreshold, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + case "httpGet": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("httpGet")) + it.HTTPGet, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__HttpGetProbeIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1HTTPGetProbeIn(ctx, v) + if err != nil { + return it, err + } + case "initialDelay": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("initialDelay")) + it.InitialDelay, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + case "interval": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("interval")) + it.Interval, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + case "shell": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("shell")) + it.Shell, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__ShellProbeIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ShellProbeIn(ctx, v) + if err != nil { + return it, err + } + case "tcp": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tcp")) + it.TCP, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__TcpProbeIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1TCPProbeIn(ctx, v) + if err != nil { + return it, err + } + case "type": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) + it.Type, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, + } } - return fc, nil + + return it, 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 +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpecIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpecIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpecIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + + fieldsInOrder := [...]string{"msvcSpec", "targetNamespace"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue } - }() - 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) -} + switch k { + case "msvcSpec": + var err error -func (ec *executionContext) fieldContext___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("msvcSpec")) + it.MsvcSpec, err = ec.unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ManagedServiceSpecIn(ctx, v) + if err != nil { + return it, err } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, + case "targetNamespace": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetNamespace")) + it.TargetNamespace, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } } - return fc, nil + + return it, 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 +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ProjectSpecIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1ProjectSpecIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1ProjectSpecIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + fieldsInOrder := [...]string{"targetNamespace"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue } - 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) -} + switch k { + case "targetNamespace": + var err error -func (ec *executionContext) fieldContext___Schema_directives(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___Directive_name(ctx, field) - case "description": - return ec.fieldContext___Directive_description(ctx, field) - case "locations": - return ec.fieldContext___Directive_locations(ctx, field) - case "args": - return ec.fieldContext___Directive_args(ctx, field) - case "isRepeatable": - return ec.fieldContext___Directive_isRepeatable(ctx, field) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetNamespace")) + it.TargetNamespace, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err } - return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) - }, + } } - return fc, nil + + return it, 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 +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__RateLimitIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1RateLimitIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1RateLimitIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + + fieldsInOrder := [...]string{"connections", "enabled", "rpm", "rps"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue } - }() - 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") + switch k { + case "connections": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("connections")) + it.Connections, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + case "enabled": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) + it.Enabled, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + case "rpm": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("rpm")) + it.Rpm, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + case "rps": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("rps")) + it.Rps, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } } - return graphql.Null } - res := resTmp.(string) - fc.Result = res - return ec.marshalN__TypeKind2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___Type_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type __TypeKind does not have child fields") - }, - } - return fc, nil + return it, 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 +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__RouteIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1RouteIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1RouteIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + + fieldsInOrder := [...]string{"app", "lambda", "path", "port", "rewrite"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue } - }() - 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) -} + switch k { + case "app": + var err error -func (ec *executionContext) fieldContext___Type_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("app")) + it.App, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "lambda": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lambda")) + it.Lambda, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "path": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("path")) + it.Path, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "port": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("port")) + it.Port, err = ec.unmarshalNInt2int(ctx, v) + if err != nil { + return it, err + } + case "rewrite": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("rewrite")) + it.Rewrite, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + } } - return fc, nil + + return it, 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 +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__RouterSpecIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1RouterSpecIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1RouterSpecIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + + fieldsInOrder := [...]string{"backendProtocol", "basicAuth", "cors", "domains", "https", "ingressClass", "maxBodySizeInMB", "rateLimit", "routes"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue } - }() - 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) -} + switch k { + case "backendProtocol": + var err error -func (ec *executionContext) fieldContext___Type_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("backendProtocol")) + it.BackendProtocol, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "basicAuth": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("basicAuth")) + it.BasicAuth, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__BasicAuthIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1BasicAuthIn(ctx, v) + if err != nil { + return it, err + } + case "cors": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cors")) + it.Cors, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__CorsIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1CorsIn(ctx, v) + if err != nil { + return it, err + } + case "domains": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("domains")) + it.Domains, err = ec.unmarshalNString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + case "https": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("https")) + it.HTTPS, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__HttpsIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1HTTPSIn(ctx, v) + if err != nil { + return it, err + } + case "ingressClass": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ingressClass")) + it.IngressClass, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "maxBodySizeInMB": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("maxBodySizeInMB")) + it.MaxBodySizeInMb, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + case "rateLimit": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("rateLimit")) + it.RateLimit, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__RateLimitIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1RateLimitIn(ctx, v) + if err != nil { + return it, err + } + case "routes": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("routes")) + it.Routes, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__RouteIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1RouteInᚄ(ctx, v) + if err != nil { + return it, err + } + } } - return fc, nil + + return it, 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 +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1ServiceTemplateIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1ServiceTemplateIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + + fieldsInOrder := [...]string{"apiVersion", "kind", "spec"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue } - }() - 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) -} + switch k { + case "apiVersion": + var err error -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) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) + it.APIVersion, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "kind": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + it.Kind, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "spec": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) + it.Spec, err = ec.unmarshalNMap2map(ctx, v) + if err != nil { + return it, err } - return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return } - return fc, nil + + return it, 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 +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ShellProbeIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1ShellProbeIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1ShellProbeIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + + fieldsInOrder := [...]string{"command"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue } - }() - 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) -} + switch k { + case "command": + var err error -func (ec *executionContext) fieldContext___Type_interfaces(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("command")) + it.Command, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, + } } - return fc, nil + + return it, 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 +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__TcpProbeIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1TCPProbeIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1TCPProbeIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + + fieldsInOrder := [...]string{"port"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue } - }() - 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) -} + switch k { + case "port": + var err error -func (ec *executionContext) fieldContext___Type_possibleTypes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("port")) + it.Port, err = ec.unmarshalNInt2int(ctx, v) + if err != nil { + return it, err } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, + } } - return fc, nil + + return it, 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 +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___wireguard___v1__CNameRecordIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisWireguardV1CNameRecordIn, error) { + var it model.GithubComKloudliteOperatorApisWireguardV1CNameRecordIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + + fieldsInOrder := [...]string{"host", "target"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue } - }() - 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) -} + switch k { + case "host": + var err error -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) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("host")) + it.Host, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "target": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("target")) + it.Target, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err } - return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return } - return fc, nil + + return it, 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 +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___wireguard___v1__DeviceSpecIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisWireguardV1DeviceSpecIn, error) { + var it model.GithubComKloudliteOperatorApisWireguardV1DeviceSpecIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + + fieldsInOrder := [...]string{"activeNamespace", "cnameRecords", "ports"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue } - }() - 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) -} + switch k { + case "activeNamespace": + var err error -func (ec *executionContext) fieldContext___Type_inputFields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___InputValue_name(ctx, field) - case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("activeNamespace")) + it.ActiveNamespace, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) - }, + case "cnameRecords": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cnameRecords")) + it.CnameRecords, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___wireguard___v1__CNameRecordIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisWireguardV1CNameRecordInᚄ(ctx, v) + if err != nil { + return it, err + } + case "ports": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ports")) + it.Ports, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___wireguard___v1__PortIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisWireguardV1PortInᚄ(ctx, v) + if err != nil { + return it, err + } + } } - return fc, nil + + return it, 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 +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___wireguard___v1__PortIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisWireguardV1PortIn, error) { + var it model.GithubComKloudliteOperatorApisWireguardV1PortIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + + fieldsInOrder := [...]string{"port", "targetPort"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue } - }() - 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) -} + switch k { + case "port": + var err error -func (ec *executionContext) fieldContext___Type_ofType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("port")) + it.Port, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, + case "targetPort": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetPort")) + it.TargetPort, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + } } - return fc, nil + + return it, 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 +func (ec *executionContext) unmarshalInputImagePullSecretIn(ctx context.Context, obj interface{}) (entities.ImagePullSecret, error) { + var it entities.ImagePullSecret + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + + fieldsInOrder := [...]string{"displayName", "dockerConfigJson", "format", "metadata", "registryPassword", "registryURL", "registryUsername"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "displayName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + it.DisplayName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "dockerConfigJson": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("dockerConfigJson")) + it.DockerConfigJson, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "format": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("format")) + data, err := ec.unmarshalNGithub__com___kloudlite___api___apps___console___internal___entities__PullSecretFormat2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsConsoleInternalEntitiesPullSecretFormat(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.ImagePullSecretIn().Format(ctx, &it, data); err != nil { + return it, err + } + case "metadata": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalNMetadataIn2ᚖk8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.ImagePullSecretIn().Metadata(ctx, &it, data); err != nil { + return it, err + } + case "registryPassword": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("registryPassword")) + it.RegistryPassword, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "registryURL": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("registryURL")) + it.RegistryURL, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "registryUsername": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("registryUsername")) + it.RegistryUsername, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } } - }() - 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) + + return it, nil } -func (ec *executionContext) fieldContext___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__TolerationIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1TolerationIn, error) { + var it model.K8sIoAPICoreV1TolerationIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v } - return fc, nil -} -// endregion **************************** field.gotpl ***************************** + fieldsInOrder := [...]string{"effect", "key", "operator", "tolerationSeconds", "value"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "effect": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("effect")) + it.Effect, err = ec.unmarshalOK8s__io___api___core___v1__TaintEffect2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TaintEffect(ctx, v) + if err != nil { + return it, err + } + case "key": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + it.Key, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "operator": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operator")) + it.Operator, err = ec.unmarshalOK8s__io___api___core___v1__TolerationOperator2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TolerationOperator(ctx, v) + if err != nil { + return it, err + } + case "tolerationSeconds": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tolerationSeconds")) + it.TolerationSeconds, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + case "value": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + it.Value, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } + } -// region **************************** input.gotpl ***************************** + return it, nil +} -func (ec *executionContext) unmarshalInputAppIn(ctx context.Context, obj interface{}) (entities.App, error) { - var it entities.App +func (ec *executionContext) unmarshalInputManagedResourceIn(ctx context.Context, obj interface{}) (entities.ManagedResource, error) { + var it entities.ManagedResource asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"kind", "metadata", "overrides", "restart", "spec", "apiVersion", "enabled"} + fieldsInOrder := [...]string{"apiVersion", "displayName", "enabled", "kind", "metadata", "spec"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "kind": + case "apiVersion": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) - it.Kind, err = ec.unmarshalOString2string(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) + it.APIVersion, err = ec.unmarshalOString2string(ctx, v) if err != nil { return it, err } - case "metadata": + case "displayName": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) - it.ObjectMeta, err = ec.unmarshalNMetadataIn2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + it.DisplayName, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } - case "overrides": + case "enabled": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("overrides")) - it.Overrides, err = ec.unmarshalOOverridesIn2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋapisᚋcrdsᚋv1ᚐJsonPatch(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) + it.Enabled, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - case "restart": + case "kind": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("restart")) - it.Restart, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + it.Kind, err = ec.unmarshalOString2string(ctx, v) if err != nil { return it, err } - case "spec": + case "metadata": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) - data, err := ec.unmarshalOAppSpecIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecIn(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalOMetadataIn2ᚖk8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) if err != nil { return it, err } - if err = ec.resolvers.AppIn().Spec(ctx, &it, data); err != nil { + if err = ec.resolvers.ManagedResourceIn().Metadata(ctx, &it, data); err != nil { return it, err } - case "apiVersion": + case "spec": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) - it.APIVersion, err = ec.unmarshalOString2string(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) + data, err := ec.unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ManagedResourceSpecIn(ctx, v) if err != nil { return it, err } - case "enabled": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) - it.Enabled, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) - if err != nil { + if err = ec.resolvers.ManagedResourceIn().Spec(ctx, &it, data); err != nil { return it, err } } @@ -21330,33 +39155,33 @@ func (ec *executionContext) unmarshalInputAppIn(ctx context.Context, obj interfa return it, nil } -func (ec *executionContext) unmarshalInputAppSpecContainersEnvFromIn(ctx context.Context, obj interface{}) (model.AppSpecContainersEnvFromIn, error) { - var it model.AppSpecContainersEnvFromIn +func (ec *executionContext) unmarshalInputManagedResourceKeyRefIn(ctx context.Context, obj interface{}) (domain.ManagedResourceKeyRef, error) { + var it domain.ManagedResourceKeyRef asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"type", "refName"} + fieldsInOrder := [...]string{"key", "mresName"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "type": + case "key": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) - it.Type, err = ec.unmarshalNString2string(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + it.Key, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } - case "refName": + case "mresName": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refName")) - it.RefName, err = ec.unmarshalNString2string(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("mresName")) + it.MresName, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } @@ -21366,14 +39191,14 @@ func (ec *executionContext) unmarshalInputAppSpecContainersEnvFromIn(ctx context return it, nil } -func (ec *executionContext) unmarshalInputAppSpecContainersEnvIn(ctx context.Context, obj interface{}) (model.AppSpecContainersEnvIn, error) { - var it model.AppSpecContainersEnvIn +func (ec *executionContext) unmarshalInputManagedResourceKeyValueRefIn(ctx context.Context, obj interface{}) (model.ManagedResourceKeyValueRefIn, error) { + var it model.ManagedResourceKeyValueRefIn asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"key", "optional", "refKey", "refName", "type", "value"} + fieldsInOrder := [...]string{"key", "mresName", "value"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -21388,43 +39213,71 @@ func (ec *executionContext) unmarshalInputAppSpecContainersEnvIn(ctx context.Con if err != nil { return it, err } - case "optional": + case "mresName": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("optional")) - it.Optional, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("mresName")) + it.MresName, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } - case "refKey": + case "value": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refKey")) - it.RefKey, err = ec.unmarshalOString2ᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + it.Value, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } - case "refName": + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMatchFilterIn(ctx context.Context, obj interface{}) (repos.MatchFilter, error) { + var it repos.MatchFilter + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"array", "exact", "matchType", "regex"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "array": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refName")) - it.RefName, err = ec.unmarshalOString2ᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("array")) + it.Array, err = ec.unmarshalOAny2ᚕinterfaceᚄ(ctx, v) if err != nil { return it, err } - case "type": + case "exact": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) - it.Type, err = ec.unmarshalOString2ᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("exact")) + it.Exact, err = ec.unmarshalOAny2interface(ctx, v) if err != nil { return it, err } - case "value": + case "matchType": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) - it.Value, err = ec.unmarshalOString2ᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("matchType")) + it.MatchType, err = ec.unmarshalNMatchFilterMatchType2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchType(ctx, v) + if err != nil { + return it, err + } + case "regex": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("regex")) + it.Regex, err = ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } @@ -21434,233 +39287,349 @@ func (ec *executionContext) unmarshalInputAppSpecContainersEnvIn(ctx context.Con return it, nil } -func (ec *executionContext) unmarshalInputAppSpecContainersIn(ctx context.Context, obj interface{}) (model.AppSpecContainersIn, error) { - var it model.AppSpecContainersIn +func (ec *executionContext) unmarshalInputMetadataIn(ctx context.Context, obj interface{}) (v12.ObjectMeta, error) { + var it v12.ObjectMeta asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"name", "args", "env", "envFrom", "image", "imagePullPolicy", "volumes", "command", "livenessProbe", "readinessProbe", "resourceCpu", "resourceMemory"} + fieldsInOrder := [...]string{"annotations", "labels", "name", "namespace"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "name": + case "annotations": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - it.Name, err = ec.unmarshalNString2string(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotations")) + data, err := ec.unmarshalOMap2map(ctx, v) if err != nil { return it, err } - case "args": + if err = ec.resolvers.MetadataIn().Annotations(ctx, &it, data); err != nil { + return it, err + } + case "labels": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("args")) - it.Args, err = ec.unmarshalOString2ᚕᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("labels")) + data, err := ec.unmarshalOMap2map(ctx, v) if err != nil { return it, err } - case "env": + if err = ec.resolvers.MetadataIn().Labels(ctx, &it, data); err != nil { + return it, err + } + case "name": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("env")) - it.Env, err = ec.unmarshalOAppSpecContainersEnvIn2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersEnvIn(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + it.Name, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } - case "envFrom": + case "namespace": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envFrom")) - it.EnvFrom, err = ec.unmarshalOAppSpecContainersEnvFromIn2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersEnvFromIn(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) + it.Namespace, err = ec.unmarshalOString2string(ctx, v) if err != nil { return it, err } - case "image": + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputPortIn(ctx context.Context, obj interface{}) (v11.Port, error) { + var it v11.Port + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"port", "targetPort"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "port": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("image")) - it.Image, err = ec.unmarshalNString2string(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("port")) + it.Port, err = ec.unmarshalOInt2int32(ctx, v) if err != nil { return it, err } - case "imagePullPolicy": + case "targetPort": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("imagePullPolicy")) - it.ImagePullPolicy, err = ec.unmarshalOString2ᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetPort")) + it.TargetPort, err = ec.unmarshalOInt2int32(ctx, v) if err != nil { return it, err } - case "volumes": + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputProjectIn(ctx context.Context, obj interface{}) (entities.Project, error) { + var it entities.Project + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"apiVersion", "clusterName", "displayName", "kind", "metadata", "spec"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "apiVersion": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("volumes")) - it.Volumes, err = ec.unmarshalOAppSpecContainersVolumesIn2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersVolumesIn(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) + it.APIVersion, err = ec.unmarshalOString2string(ctx, v) if err != nil { return it, err } - case "command": + case "clusterName": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("command")) - it.Command, err = ec.unmarshalOString2ᚕᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + it.ClusterName, err = ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - case "livenessProbe": + case "displayName": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("livenessProbe")) - it.LivenessProbe, err = ec.unmarshalOAppSpecContainersLivenessProbeIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersLivenessProbeIn(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + it.DisplayName, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } - case "readinessProbe": + case "kind": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("readinessProbe")) - it.ReadinessProbe, err = ec.unmarshalOAppSpecContainersReadinessProbeIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersReadinessProbeIn(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + it.Kind, err = ec.unmarshalOString2string(ctx, v) if err != nil { return it, err } - case "resourceCpu": + case "metadata": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("resourceCpu")) - it.ResourceCPU, err = ec.unmarshalOAppSpecContainersResourceCpuIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersResourceCPUIn(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalOMetadataIn2ᚖk8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) if err != nil { return it, err } - case "resourceMemory": + if err = ec.resolvers.ProjectIn().Metadata(ctx, &it, data); err != nil { + return it, err + } + case "spec": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("resourceMemory")) - it.ResourceMemory, err = ec.unmarshalOAppSpecContainersResourceMemoryIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersResourceMemoryIn(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) + data, err := ec.unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ProjectSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ProjectSpecIn(ctx, v) if err != nil { return it, err } + if err = ec.resolvers.ProjectIn().Spec(ctx, &it, data); err != nil { + return it, err + } } } return it, nil } -func (ec *executionContext) unmarshalInputAppSpecContainersLivenessProbeHttpGetIn(ctx context.Context, obj interface{}) (model.AppSpecContainersLivenessProbeHTTPGetIn, error) { - var it model.AppSpecContainersLivenessProbeHTTPGetIn +func (ec *executionContext) unmarshalInputProjectManagedServiceIn(ctx context.Context, obj interface{}) (entities.ProjectManagedService, error) { + var it entities.ProjectManagedService asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"httpHeaders", "path", "port"} + fieldsInOrder := [...]string{"apiVersion", "displayName", "kind", "metadata", "spec"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "httpHeaders": + case "apiVersion": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("httpHeaders")) - it.HTTPHeaders, err = ec.unmarshalOMap2map(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) + it.APIVersion, err = ec.unmarshalOString2string(ctx, v) if err != nil { return it, err } - case "path": + case "displayName": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("path")) - it.Path, err = ec.unmarshalNString2string(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + it.DisplayName, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } - case "port": + case "kind": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("port")) - it.Port, err = ec.unmarshalNInt2int(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + it.Kind, err = ec.unmarshalOString2string(ctx, v) if err != nil { return it, err } + case "metadata": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalOMetadataIn2ᚖk8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.ProjectManagedServiceIn().Metadata(ctx, &it, data); err != nil { + return it, err + } + case "spec": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) + data, err := ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpecIn(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.ProjectManagedServiceIn().Spec(ctx, &it, data); err != nil { + return it, err + } } } return it, nil } -func (ec *executionContext) unmarshalInputAppSpecContainersLivenessProbeIn(ctx context.Context, obj interface{}) (model.AppSpecContainersLivenessProbeIn, error) { - var it model.AppSpecContainersLivenessProbeIn +func (ec *executionContext) unmarshalInputRouterIn(ctx context.Context, obj interface{}) (entities.Router, error) { + var it entities.Router asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"failureThreshold", "httpGet", "initialDelay", "interval", "shell", "tcp", "type"} + fieldsInOrder := [...]string{"apiVersion", "displayName", "enabled", "kind", "metadata", "spec"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "failureThreshold": + case "apiVersion": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("failureThreshold")) - it.FailureThreshold, err = ec.unmarshalOInt2ᚖint(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) + it.APIVersion, err = ec.unmarshalOString2string(ctx, v) if err != nil { return it, err } - case "httpGet": + case "displayName": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("httpGet")) - it.HTTPGet, err = ec.unmarshalOAppSpecContainersLivenessProbeHttpGetIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersLivenessProbeHTTPGetIn(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + it.DisplayName, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } - case "initialDelay": + case "enabled": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("initialDelay")) - it.InitialDelay, err = ec.unmarshalOInt2ᚖint(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) + it.Enabled, err = ec.unmarshalOBoolean2bool(ctx, v) if err != nil { return it, err } - case "interval": + case "kind": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("interval")) - it.Interval, err = ec.unmarshalOInt2ᚖint(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + it.Kind, err = ec.unmarshalOString2string(ctx, v) if err != nil { return it, err } - case "shell": + case "metadata": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("shell")) - it.Shell, err = ec.unmarshalOAppSpecContainersLivenessProbeShellIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersLivenessProbeShellIn(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalOMetadataIn2ᚖk8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) if err != nil { return it, err } - case "tcp": + if err = ec.resolvers.RouterIn().Metadata(ctx, &it, data); err != nil { + return it, err + } + case "spec": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tcp")) - it.TCP, err = ec.unmarshalOAppSpecContainersLivenessProbeTcpIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersLivenessProbeTCPIn(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) + data, err := ec.unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__RouterSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1RouterSpecIn(ctx, v) if err != nil { return it, err } - case "type": + if err = ec.resolvers.RouterIn().Spec(ctx, &it, data); err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputSearchApps(ctx context.Context, obj interface{}) (model.SearchApps, error) { + var it model.SearchApps + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"text", "isReady", "markedForDeletion"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "text": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) - it.Type, err = ec.unmarshalNString2string(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + it.Text, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + case "isReady": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) + it.IsReady, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + case "markedForDeletion": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("markedForDeletion")) + it.MarkedForDeletion, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) if err != nil { return it, err } @@ -21670,25 +39639,41 @@ func (ec *executionContext) unmarshalInputAppSpecContainersLivenessProbeIn(ctx c return it, nil } -func (ec *executionContext) unmarshalInputAppSpecContainersLivenessProbeShellIn(ctx context.Context, obj interface{}) (model.AppSpecContainersLivenessProbeShellIn, error) { - var it model.AppSpecContainersLivenessProbeShellIn +func (ec *executionContext) unmarshalInputSearchConfigs(ctx context.Context, obj interface{}) (model.SearchConfigs, error) { + var it model.SearchConfigs asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"command"} + fieldsInOrder := [...]string{"text", "isReady", "markedForDeletion"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "command": + case "text": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("command")) - it.Command, err = ec.unmarshalOString2ᚕᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + it.Text, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + case "isReady": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) + it.IsReady, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + case "markedForDeletion": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("markedForDeletion")) + it.MarkedForDeletion, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) if err != nil { return it, err } @@ -21698,25 +39683,49 @@ func (ec *executionContext) unmarshalInputAppSpecContainersLivenessProbeShellIn( return it, nil } -func (ec *executionContext) unmarshalInputAppSpecContainersLivenessProbeTcpIn(ctx context.Context, obj interface{}) (model.AppSpecContainersLivenessProbeTCPIn, error) { - var it model.AppSpecContainersLivenessProbeTCPIn +func (ec *executionContext) unmarshalInputSearchEnvironments(ctx context.Context, obj interface{}) (model.SearchEnvironments, error) { + var it model.SearchEnvironments asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"port"} + fieldsInOrder := [...]string{"text", "projectName", "isReady", "markedForDeletion"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "port": + case "text": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("port")) - it.Port, err = ec.unmarshalNInt2int(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + it.Text, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + case "projectName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + it.ProjectName, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + case "isReady": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) + it.IsReady, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + case "markedForDeletion": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("markedForDeletion")) + it.MarkedForDeletion, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) if err != nil { return it, err } @@ -21726,41 +39735,41 @@ func (ec *executionContext) unmarshalInputAppSpecContainersLivenessProbeTcpIn(ct return it, nil } -func (ec *executionContext) unmarshalInputAppSpecContainersReadinessProbeHttpGetIn(ctx context.Context, obj interface{}) (model.AppSpecContainersReadinessProbeHTTPGetIn, error) { - var it model.AppSpecContainersReadinessProbeHTTPGetIn +func (ec *executionContext) unmarshalInputSearchImagePullSecrets(ctx context.Context, obj interface{}) (model.SearchImagePullSecrets, error) { + var it model.SearchImagePullSecrets asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"httpHeaders", "path", "port"} + fieldsInOrder := [...]string{"text", "isReady", "markedForDeletion"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "httpHeaders": + case "text": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("httpHeaders")) - it.HTTPHeaders, err = ec.unmarshalOMap2map(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + it.Text, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) if err != nil { return it, err } - case "path": + case "isReady": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("path")) - it.Path, err = ec.unmarshalNString2string(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) + it.IsReady, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) if err != nil { return it, err } - case "port": + case "markedForDeletion": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("port")) - it.Port, err = ec.unmarshalNInt2int(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("markedForDeletion")) + it.MarkedForDeletion, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) if err != nil { return it, err } @@ -21770,73 +39779,101 @@ func (ec *executionContext) unmarshalInputAppSpecContainersReadinessProbeHttpGet return it, nil } -func (ec *executionContext) unmarshalInputAppSpecContainersReadinessProbeIn(ctx context.Context, obj interface{}) (model.AppSpecContainersReadinessProbeIn, error) { - var it model.AppSpecContainersReadinessProbeIn +func (ec *executionContext) unmarshalInputSearchManagedResources(ctx context.Context, obj interface{}) (model.SearchManagedResources, error) { + var it model.SearchManagedResources asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"interval", "shell", "tcp", "type", "failureThreshold", "httpGet", "initialDelay"} + fieldsInOrder := [...]string{"text", "managedServiceName", "isReady", "markedForDeletion"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "interval": + case "text": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("interval")) - it.Interval, err = ec.unmarshalOInt2ᚖint(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + it.Text, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) if err != nil { return it, err } - case "shell": + case "managedServiceName": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("shell")) - it.Shell, err = ec.unmarshalOAppSpecContainersReadinessProbeShellIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersReadinessProbeShellIn(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("managedServiceName")) + it.ManagedServiceName, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) if err != nil { return it, err } - case "tcp": + case "isReady": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tcp")) - it.TCP, err = ec.unmarshalOAppSpecContainersReadinessProbeTcpIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersReadinessProbeTCPIn(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) + it.IsReady, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) if err != nil { return it, err } - case "type": + case "markedForDeletion": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) - it.Type, err = ec.unmarshalNString2string(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("markedForDeletion")) + it.MarkedForDeletion, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) if err != nil { return it, err } - case "failureThreshold": + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputSearchProjectManagedService(ctx context.Context, obj interface{}) (model.SearchProjectManagedService, error) { + var it model.SearchProjectManagedService + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"text", "managedServiceName", "isReady", "markedForDeletion"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "text": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("failureThreshold")) - it.FailureThreshold, err = ec.unmarshalOInt2ᚖint(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + it.Text, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) if err != nil { return it, err } - case "httpGet": + case "managedServiceName": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("httpGet")) - it.HTTPGet, err = ec.unmarshalOAppSpecContainersReadinessProbeHttpGetIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersReadinessProbeHTTPGetIn(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("managedServiceName")) + it.ManagedServiceName, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) if err != nil { return it, err } - case "initialDelay": + case "isReady": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("initialDelay")) - it.InitialDelay, err = ec.unmarshalOInt2ᚖint(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) + it.IsReady, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + case "markedForDeletion": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("markedForDeletion")) + it.MarkedForDeletion, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) if err != nil { return it, err } @@ -21846,25 +39883,41 @@ func (ec *executionContext) unmarshalInputAppSpecContainersReadinessProbeIn(ctx return it, nil } -func (ec *executionContext) unmarshalInputAppSpecContainersReadinessProbeShellIn(ctx context.Context, obj interface{}) (model.AppSpecContainersReadinessProbeShellIn, error) { - var it model.AppSpecContainersReadinessProbeShellIn +func (ec *executionContext) unmarshalInputSearchProjects(ctx context.Context, obj interface{}) (model.SearchProjects, error) { + var it model.SearchProjects asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"command"} + fieldsInOrder := [...]string{"text", "isReady", "markedForDeletion"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "command": + case "text": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("command")) - it.Command, err = ec.unmarshalOString2ᚕᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + it.Text, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + case "isReady": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) + it.IsReady, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + case "markedForDeletion": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("markedForDeletion")) + it.MarkedForDeletion, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) if err != nil { return it, err } @@ -21874,25 +39927,41 @@ func (ec *executionContext) unmarshalInputAppSpecContainersReadinessProbeShellIn return it, nil } -func (ec *executionContext) unmarshalInputAppSpecContainersReadinessProbeTcpIn(ctx context.Context, obj interface{}) (model.AppSpecContainersReadinessProbeTCPIn, error) { - var it model.AppSpecContainersReadinessProbeTCPIn +func (ec *executionContext) unmarshalInputSearchRouters(ctx context.Context, obj interface{}) (model.SearchRouters, error) { + var it model.SearchRouters asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"port"} + fieldsInOrder := [...]string{"text", "isReady", "markedForDeletion"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "port": + case "text": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("port")) - it.Port, err = ec.unmarshalNInt2int(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + it.Text, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + case "isReady": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) + it.IsReady, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + case "markedForDeletion": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("markedForDeletion")) + it.MarkedForDeletion, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) if err != nil { return it, err } @@ -21902,69 +39971,173 @@ func (ec *executionContext) unmarshalInputAppSpecContainersReadinessProbeTcpIn(c return it, nil } -func (ec *executionContext) unmarshalInputAppSpecContainersResourceCpuIn(ctx context.Context, obj interface{}) (model.AppSpecContainersResourceCPUIn, error) { - var it model.AppSpecContainersResourceCPUIn +func (ec *executionContext) unmarshalInputSearchSecrets(ctx context.Context, obj interface{}) (model.SearchSecrets, error) { + var it model.SearchSecrets asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"max", "min"} + fieldsInOrder := [...]string{"text", "isReady", "markedForDeletion"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "max": + case "text": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + it.Text, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + case "isReady": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) + it.IsReady, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + case "markedForDeletion": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("markedForDeletion")) + it.MarkedForDeletion, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputSecretIn(ctx context.Context, obj interface{}) (entities.Secret, error) { + var it entities.Secret + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"apiVersion", "data", "displayName", "immutable", "kind", "metadata", "stringData", "type"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "apiVersion": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) + it.APIVersion, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "data": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("data")) + data, err := ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.SecretIn().Data(ctx, &it, data); err != nil { + return it, err + } + case "displayName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + it.DisplayName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "immutable": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("immutable")) + it.Immutable, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + case "kind": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + it.Kind, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "metadata": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalOMetadataIn2ᚖk8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.SecretIn().Metadata(ctx, &it, data); err != nil { + return it, err + } + case "stringData": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("max")) - it.Max, err = ec.unmarshalOString2ᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stringData")) + data, err := ec.unmarshalOMap2map(ctx, v) if err != nil { return it, err } - case "min": + if err = ec.resolvers.SecretIn().StringData(ctx, &it, data); err != nil { + return it, err + } + case "type": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("min")) - it.Min, err = ec.unmarshalOString2ᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) + data, err := ec.unmarshalOK8s__io___api___core___v1__SecretType2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1SecretType(ctx, v) if err != nil { return it, err } + if err = ec.resolvers.SecretIn().Type(ctx, &it, data); err != nil { + return it, err + } } } return it, nil } -func (ec *executionContext) unmarshalInputAppSpecContainersResourceMemoryIn(ctx context.Context, obj interface{}) (model.AppSpecContainersResourceMemoryIn, error) { - var it model.AppSpecContainersResourceMemoryIn +func (ec *executionContext) unmarshalInputSecretKeyRefIn(ctx context.Context, obj interface{}) (domain.SecretKeyRef, error) { + var it domain.SecretKeyRef asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"max", "min"} + fieldsInOrder := [...]string{"key", "secretName"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "max": + case "key": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("max")) - it.Max, err = ec.unmarshalOString2ᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + it.Key, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } - case "min": + case "secretName": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("min")) - it.Min, err = ec.unmarshalOString2ᚖstring(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretName")) + it.SecretName, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } @@ -21974,49 +40147,41 @@ func (ec *executionContext) unmarshalInputAppSpecContainersResourceMemoryIn(ctx return it, nil } -func (ec *executionContext) unmarshalInputAppSpecContainersVolumesIn(ctx context.Context, obj interface{}) (model.AppSpecContainersVolumesIn, error) { - var it model.AppSpecContainersVolumesIn +func (ec *executionContext) unmarshalInputSecretKeyValueRefIn(ctx context.Context, obj interface{}) (model.SecretKeyValueRefIn, error) { + var it model.SecretKeyValueRefIn asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"mountPath", "refName", "type", "items"} + fieldsInOrder := [...]string{"key", "secretName", "value"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "mountPath": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("mountPath")) - it.MountPath, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "refName": + case "key": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refName")) - it.RefName, err = ec.unmarshalNString2string(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + it.Key, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } - case "type": + case "secretName": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) - it.Type, err = ec.unmarshalNString2string(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretName")) + it.SecretName, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } - case "items": + case "value": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("items")) - it.Items, err = ec.unmarshalOAppSpecContainersVolumesItemsIn2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersVolumesItemsIn(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + it.Value, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } @@ -22026,1759 +40191,1918 @@ func (ec *executionContext) unmarshalInputAppSpecContainersVolumesIn(ctx context return it, nil } -func (ec *executionContext) unmarshalInputAppSpecContainersVolumesItemsIn(ctx context.Context, obj interface{}) (model.AppSpecContainersVolumesItemsIn, error) { - var it model.AppSpecContainersVolumesItemsIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } +// endregion **************************** input.gotpl ***************************** - fieldsInOrder := [...]string{"key", "fileName"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "key": - var err error +// region ************************** interface.gotpl *************************** - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) - it.Key, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err +// endregion ************************** interface.gotpl *************************** + +// region **************************** object.gotpl **************************** + +var appImplementors = []string{"App"} + +func (ec *executionContext) _App(ctx context.Context, sel ast.SelectionSet, obj *entities.App) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, appImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("App") + case "accountName": + + out.Values[i] = ec._App_accountName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - case "fileName": - var err error + case "apiVersion": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileName")) - it.FileName, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err + out.Values[i] = ec._App_apiVersion(ctx, field, obj) + + case "createdBy": + + out.Values[i] = ec._App_createdBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "creationTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._App_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "displayName": + + out.Values[i] = ec._App_displayName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "enabled": + + out.Values[i] = ec._App_enabled(ctx, field, obj) + + case "environmentName": + + out.Values[i] = ec._App_environmentName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "id": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._App_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "kind": + + out.Values[i] = ec._App_kind(ctx, field, obj) + + case "lastUpdatedBy": + + out.Values[i] = ec._App_lastUpdatedBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "markedForDeletion": + + out.Values[i] = ec._App_markedForDeletion(ctx, field, obj) + + case "metadata": + + out.Values[i] = ec._App_metadata(ctx, field, obj) + + case "projectName": + + out.Values[i] = ec._App_projectName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "recordVersion": + + out.Values[i] = ec._App_recordVersion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "spec": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._App_spec(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "status": + + out.Values[i] = ec._App_status(ctx, field, obj) + + case "syncStatus": + + out.Values[i] = ec._App_syncStatus(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "updateTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._App_updateTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) } } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} - return it, nil +var appEdgeImplementors = []string{"AppEdge"} + +func (ec *executionContext) _AppEdge(ctx context.Context, sel ast.SelectionSet, obj *model.AppEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, appEdgeImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("AppEdge") + case "cursor": + + out.Values[i] = ec._AppEdge_cursor(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "node": + + out.Values[i] = ec._AppEdge_node(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -func (ec *executionContext) unmarshalInputAppSpecHpaIn(ctx context.Context, obj interface{}) (model.AppSpecHpaIn, error) { - var it model.AppSpecHpaIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v +var appPaginatedRecordsImplementors = []string{"AppPaginatedRecords"} + +func (ec *executionContext) _AppPaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.AppPaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, appPaginatedRecordsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("AppPaginatedRecords") + case "edges": + + out.Values[i] = ec._AppPaginatedRecords_edges(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "pageInfo": + + out.Values[i] = ec._AppPaginatedRecords_pageInfo(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "totalCount": + + out.Values[i] = ec._AppPaginatedRecords_totalCount(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null } + return out +} - fieldsInOrder := [...]string{"enabled", "maxReplicas", "minReplicas", "thresholdCpu", "thresholdMemory"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue +var configImplementors = []string{"Config"} + +func (ec *executionContext) _Config(ctx context.Context, sel ast.SelectionSet, obj *entities.Config) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, configImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Config") + case "accountName": + + out.Values[i] = ec._Config_accountName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "apiVersion": + + out.Values[i] = ec._Config_apiVersion(ctx, field, obj) + + case "binaryData": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Config_binaryData(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "createdBy": + + out.Values[i] = ec._Config_createdBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "creationTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Config_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "data": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Config_data(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "displayName": + + out.Values[i] = ec._Config_displayName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "environmentName": + + out.Values[i] = ec._Config_environmentName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "id": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Config_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "immutable": + + out.Values[i] = ec._Config_immutable(ctx, field, obj) + + case "kind": + + out.Values[i] = ec._Config_kind(ctx, field, obj) + + case "lastUpdatedBy": + + out.Values[i] = ec._Config_lastUpdatedBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "markedForDeletion": + + out.Values[i] = ec._Config_markedForDeletion(ctx, field, obj) + + case "metadata": + + out.Values[i] = ec._Config_metadata(ctx, field, obj) + + case "projectName": + + out.Values[i] = ec._Config_projectName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "recordVersion": + + out.Values[i] = ec._Config_recordVersion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "syncStatus": + + out.Values[i] = ec._Config_syncStatus(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "updateTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Config_updateTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) } - switch k { - case "enabled": - var err error + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) - it.Enabled, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) - if err != nil { - return it, err +var configEdgeImplementors = []string{"ConfigEdge"} + +func (ec *executionContext) _ConfigEdge(ctx context.Context, sel ast.SelectionSet, obj *model.ConfigEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, configEdgeImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ConfigEdge") + case "cursor": + + out.Values[i] = ec._ConfigEdge_cursor(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } - case "maxReplicas": - var err error + case "node": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("maxReplicas")) - it.MaxReplicas, err = ec.unmarshalOInt2ᚖint(ctx, v) - if err != nil { - return it, err + out.Values[i] = ec._ConfigEdge_node(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } - case "minReplicas": - var err error + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var configKeyRefImplementors = []string{"ConfigKeyRef"} + +func (ec *executionContext) _ConfigKeyRef(ctx context.Context, sel ast.SelectionSet, obj *model.ConfigKeyRef) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, configKeyRefImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ConfigKeyRef") + case "configName": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("minReplicas")) - it.MinReplicas, err = ec.unmarshalOInt2ᚖint(ctx, v) - if err != nil { - return it, err - } - case "thresholdCpu": - var err error + out.Values[i] = ec._ConfigKeyRef_configName(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("thresholdCpu")) - it.ThresholdCPU, err = ec.unmarshalOInt2ᚖint(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + invalids++ } - case "thresholdMemory": - var err error + case "key": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("thresholdMemory")) - it.ThresholdMemory, err = ec.unmarshalOInt2ᚖint(ctx, v) - if err != nil { - return it, err + out.Values[i] = ec._ConfigKeyRef_key(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -func (ec *executionContext) unmarshalInputAppSpecIn(ctx context.Context, obj interface{}) (model.AppSpecIn, error) { - var it model.AppSpecIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } +var configKeyValueRefImplementors = []string{"ConfigKeyValueRef"} - fieldsInOrder := [...]string{"containers", "displayName", "intercept", "region", "replicas", "freeze", "hpa", "nodeSelector", "serviceAccount", "services", "tolerations"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "containers": - var err error +func (ec *executionContext) _ConfigKeyValueRef(ctx context.Context, sel ast.SelectionSet, obj *domain.ConfigKeyValueRef) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, configKeyValueRefImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ConfigKeyValueRef") + case "configName": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("containers")) - it.Containers, err = ec.unmarshalNAppSpecContainersIn2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersIn(ctx, v) - if err != nil { - return it, err - } - case "displayName": - var err error + out.Values[i] = ec._ConfigKeyValueRef_configName(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) - it.DisplayName, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + invalids++ } - case "intercept": - var err error + case "key": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("intercept")) - it.Intercept, err = ec.unmarshalOAppSpecInterceptIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecInterceptIn(ctx, v) - if err != nil { - return it, err - } - case "region": - var err error + out.Values[i] = ec._ConfigKeyValueRef_key(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("region")) - it.Region, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + invalids++ } - case "replicas": - var err error + case "value": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("replicas")) - it.Replicas, err = ec.unmarshalOInt2ᚖint(ctx, v) - if err != nil { - return it, err - } - case "freeze": - var err error + out.Values[i] = ec._ConfigKeyValueRef_value(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("freeze")) - it.Freeze, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + invalids++ } - case "hpa": - var err error + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hpa")) - it.Hpa, err = ec.unmarshalOAppSpecHpaIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecHpaIn(ctx, v) - if err != nil { - return it, err - } - case "nodeSelector": - var err error +var configPaginatedRecordsImplementors = []string{"ConfigPaginatedRecords"} - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nodeSelector")) - it.NodeSelector, err = ec.unmarshalOMap2map(ctx, v) - if err != nil { - return it, err - } - case "serviceAccount": - var err error +func (ec *executionContext) _ConfigPaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.ConfigPaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, configPaginatedRecordsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ConfigPaginatedRecords") + case "edges": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("serviceAccount")) - it.ServiceAccount, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err + out.Values[i] = ec._ConfigPaginatedRecords_edges(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } - case "services": - var err error + case "pageInfo": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("services")) - it.Services, err = ec.unmarshalOAppSpecServicesIn2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecServicesIn(ctx, v) - if err != nil { - return it, err + out.Values[i] = ec._ConfigPaginatedRecords_pageInfo(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } - case "tolerations": - var err error + case "totalCount": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tolerations")) - it.Tolerations, err = ec.unmarshalOAppSpecTolerationsIn2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecTolerationsIn(ctx, v) - if err != nil { - return it, err + out.Values[i] = ec._ConfigPaginatedRecords_totalCount(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -func (ec *executionContext) unmarshalInputAppSpecInterceptIn(ctx context.Context, obj interface{}) (model.AppSpecInterceptIn, error) { - var it model.AppSpecInterceptIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } +var consoleCheckNameAvailabilityOutputImplementors = []string{"ConsoleCheckNameAvailabilityOutput"} - fieldsInOrder := [...]string{"enabled", "toDevice"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "enabled": - var err error +func (ec *executionContext) _ConsoleCheckNameAvailabilityOutput(ctx context.Context, sel ast.SelectionSet, obj *domain.CheckNameAvailabilityOutput) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, consoleCheckNameAvailabilityOutputImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ConsoleCheckNameAvailabilityOutput") + case "result": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) - it.Enabled, err = ec.unmarshalNBoolean2bool(ctx, v) - if err != nil { - return it, err - } - case "toDevice": - var err error + out.Values[i] = ec._ConsoleCheckNameAvailabilityOutput_result(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("toDevice")) - it.ToDevice, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + invalids++ } + case "suggestedNames": + + out.Values[i] = ec._ConsoleCheckNameAvailabilityOutput_suggestedNames(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -func (ec *executionContext) unmarshalInputAppSpecServicesIn(ctx context.Context, obj interface{}) (model.AppSpecServicesIn, error) { - var it model.AppSpecServicesIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } +var consoleVPNDeviceImplementors = []string{"ConsoleVPNDevice"} - fieldsInOrder := [...]string{"name", "port", "targetPort", "type"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "name": - var err error +func (ec *executionContext) _ConsoleVPNDevice(ctx context.Context, sel ast.SelectionSet, obj *entities.ConsoleVPNDevice) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, consoleVPNDeviceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ConsoleVPNDevice") + case "accountName": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - it.Name, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - case "port": - var err error + out.Values[i] = ec._ConsoleVPNDevice_accountName(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("port")) - it.Port, err = ec.unmarshalNInt2int(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - case "targetPort": - var err error + case "apiVersion": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetPort")) - it.TargetPort, err = ec.unmarshalOInt2ᚖint(ctx, v) - if err != nil { - return it, err - } - case "type": - var err error + out.Values[i] = ec._ConsoleVPNDevice_apiVersion(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) - it.Type, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - } - } + case "clusterName": - return it, nil -} + out.Values[i] = ec._ConsoleVPNDevice_clusterName(ctx, field, obj) -func (ec *executionContext) unmarshalInputAppSpecTolerationsIn(ctx context.Context, obj interface{}) (model.AppSpecTolerationsIn, error) { - var it model.AppSpecTolerationsIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } + case "createdBy": - fieldsInOrder := [...]string{"effect", "key", "operator", "tolerationSeconds", "value"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "effect": - var err error + out.Values[i] = ec._ConsoleVPNDevice_createdBy(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("effect")) - it.Effect, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - case "key": - var err error + case "creationTime": + field := field - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) - it.Key, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ConsoleVPNDevice_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res } - case "operator": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operator")) - it.Operator, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - case "tolerationSeconds": - var err error + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tolerationSeconds")) - it.TolerationSeconds, err = ec.unmarshalOInt2ᚖint(ctx, v) - if err != nil { - return it, err - } - case "value": - var err error + }) + case "displayName": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) - it.Value, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - } - } + out.Values[i] = ec._ConsoleVPNDevice_displayName(ctx, field, obj) - return it, nil -} + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "environmentName": -func (ec *executionContext) unmarshalInputConfigIn(ctx context.Context, obj interface{}) (entities.Config, error) { - var it entities.Config - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } + out.Values[i] = ec._ConsoleVPNDevice_environmentName(ctx, field, obj) - fieldsInOrder := [...]string{"enabled", "kind", "metadata", "overrides", "apiVersion", "data"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "enabled": - var err error + case "id": + field := field - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) - it.Enabled, err = ec.unmarshalOBoolean2bool(ctx, v) - if err != nil { - return it, err + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ConsoleVPNDevice_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) case "kind": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) - it.Kind, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err - } - case "metadata": - var err error + out.Values[i] = ec._ConsoleVPNDevice_kind(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) - it.ObjectMeta, err = ec.unmarshalNMetadataIn2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) - if err != nil { - return it, err - } - case "overrides": - var err error + case "lastUpdatedBy": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("overrides")) - it.Overrides, err = ec.unmarshalOOverridesIn2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋapisᚋcrdsᚋv1ᚐJsonPatch(ctx, v) - if err != nil { - return it, err - } - case "apiVersion": - var err error + out.Values[i] = ec._ConsoleVPNDevice_lastUpdatedBy(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) - it.APIVersion, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - case "data": - var err error + case "linkedClusters": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("data")) - data, err := ec.unmarshalOMap2map(ctx, v) - if err != nil { - return it, err - } - if err = ec.resolvers.ConfigIn().Data(ctx, &it, data); err != nil { - return it, err - } - } - } + out.Values[i] = ec._ConsoleVPNDevice_linkedClusters(ctx, field, obj) - return it, nil -} + case "markedForDeletion": -func (ec *executionContext) unmarshalInputManagedResourceIn(ctx context.Context, obj interface{}) (entities.MRes, error) { - var it entities.MRes - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } + out.Values[i] = ec._ConsoleVPNDevice_markedForDeletion(ctx, field, obj) - fieldsInOrder := [...]string{"overrides", "spec", "apiVersion", "enabled", "kind", "metadata"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "overrides": - var err error + case "metadata": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("overrides")) - it.Overrides, err = ec.unmarshalOOverridesIn2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋapisᚋcrdsᚋv1ᚐJsonPatch(ctx, v) - if err != nil { - return it, err + out.Values[i] = ec._ConsoleVPNDevice_metadata(ctx, field, obj) + + case "projectName": + + out.Values[i] = ec._ConsoleVPNDevice_projectName(ctx, field, obj) + + case "recordVersion": + + out.Values[i] = ec._ConsoleVPNDevice_recordVersion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } case "spec": - var err error + field := field - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) - data, err := ec.unmarshalOManagedResourceSpecIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedResourceSpecIn(ctx, v) - if err != nil { - return it, err + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ConsoleVPNDevice_spec(ctx, field, obj) + return res } - if err = ec.resolvers.ManagedResourceIn().Spec(ctx, &it, data); err != nil { - return it, err + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "status": + + out.Values[i] = ec._ConsoleVPNDevice_status(ctx, field, obj) + + case "syncStatus": + + out.Values[i] = ec._ConsoleVPNDevice_syncStatus(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - case "apiVersion": - var err error + case "updateTime": + field := field - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) - it.APIVersion, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ConsoleVPNDevice_updateTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res } - case "enabled": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) - it.Enabled, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) - if err != nil { - return it, err + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "wireguardConfig": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ConsoleVPNDevice_wireguardConfig(ctx, field, obj) + return res } - case "kind": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) - it.Kind, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var consoleVPNDeviceEdgeImplementors = []string{"ConsoleVPNDeviceEdge"} + +func (ec *executionContext) _ConsoleVPNDeviceEdge(ctx context.Context, sel ast.SelectionSet, obj *model.ConsoleVPNDeviceEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, consoleVPNDeviceEdgeImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ConsoleVPNDeviceEdge") + case "cursor": + + out.Values[i] = ec._ConsoleVPNDeviceEdge_cursor(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } - case "metadata": - var err error + case "node": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) - it.ObjectMeta, err = ec.unmarshalNMetadataIn2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) - if err != nil { - return it, err + out.Values[i] = ec._ConsoleVPNDeviceEdge_node(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -func (ec *executionContext) unmarshalInputManagedResourceSpecIn(ctx context.Context, obj interface{}) (model.ManagedResourceSpecIn, error) { - var it model.ManagedResourceSpecIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } +var consoleVPNDevicePaginatedRecordsImplementors = []string{"ConsoleVPNDevicePaginatedRecords"} - fieldsInOrder := [...]string{"inputs", "mresKind", "msvcRef"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "inputs": - var err error +func (ec *executionContext) _ConsoleVPNDevicePaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.ConsoleVPNDevicePaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, consoleVPNDevicePaginatedRecordsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ConsoleVPNDevicePaginatedRecords") + case "edges": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("inputs")) - it.Inputs, err = ec.unmarshalOMap2map(ctx, v) - if err != nil { - return it, err + out.Values[i] = ec._ConsoleVPNDevicePaginatedRecords_edges(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } - case "mresKind": - var err error + case "pageInfo": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("mresKind")) - it.MresKind, err = ec.unmarshalNManagedResourceSpecMresKindIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedResourceSpecMresKindIn(ctx, v) - if err != nil { - return it, err + out.Values[i] = ec._ConsoleVPNDevicePaginatedRecords_pageInfo(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } - case "msvcRef": - var err error + case "totalCount": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("msvcRef")) - it.MsvcRef, err = ec.unmarshalNManagedResourceSpecMsvcRefIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedResourceSpecMsvcRefIn(ctx, v) - if err != nil { - return it, err + out.Values[i] = ec._ConsoleVPNDevicePaginatedRecords_totalCount(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -func (ec *executionContext) unmarshalInputManagedResourceSpecMresKindIn(ctx context.Context, obj interface{}) (model.ManagedResourceSpecMresKindIn, error) { - var it model.ManagedResourceSpecMresKindIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } +var cursorPaginationImplementors = []string{"CursorPagination"} - fieldsInOrder := [...]string{"kind"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "kind": - var err error +func (ec *executionContext) _CursorPagination(ctx context.Context, sel ast.SelectionSet, obj *repos.CursorPagination) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, cursorPaginationImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("CursorPagination") + case "after": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) - it.Kind, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - } - } + out.Values[i] = ec._CursorPagination_after(ctx, field, obj) - return it, nil -} + case "before": -func (ec *executionContext) unmarshalInputManagedResourceSpecMsvcRefIn(ctx context.Context, obj interface{}) (model.ManagedResourceSpecMsvcRefIn, error) { - var it model.ManagedResourceSpecMsvcRefIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } + out.Values[i] = ec._CursorPagination_before(ctx, field, obj) - fieldsInOrder := [...]string{"apiVersion", "kind", "name"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "apiVersion": - var err error + case "first": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) - it.APIVersion, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "kind": - var err error + out.Values[i] = ec._CursorPagination_first(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) - it.Kind, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - case "name": - var err error + case "last": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - it.Name, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } + out.Values[i] = ec._CursorPagination_last(ctx, field, obj) + + case "orderBy": + + out.Values[i] = ec._CursorPagination_orderBy(ctx, field, obj) + + case "sortDirection": + + out.Values[i] = ec._CursorPagination_sortDirection(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -func (ec *executionContext) unmarshalInputManagedServiceIn(ctx context.Context, obj interface{}) (entities.MSvc, error) { - var it entities.MSvc - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } +var environmentImplementors = []string{"Environment"} - fieldsInOrder := [...]string{"overrides", "spec", "apiVersion", "enabled", "kind", "metadata"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "overrides": - var err error +func (ec *executionContext) _Environment(ctx context.Context, sel ast.SelectionSet, obj *entities.Environment) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, environmentImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Environment") + case "accountName": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("overrides")) - it.Overrides, err = ec.unmarshalOOverridesIn2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋapisᚋcrdsᚋv1ᚐJsonPatch(ctx, v) - if err != nil { - return it, err + out.Values[i] = ec._Environment_accountName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - case "spec": - var err error + case "apiVersion": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) - data, err := ec.unmarshalOManagedServiceSpecIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedServiceSpecIn(ctx, v) - if err != nil { - return it, err + out.Values[i] = ec._Environment_apiVersion(ctx, field, obj) + + case "createdBy": + + out.Values[i] = ec._Environment_createdBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - if err = ec.resolvers.ManagedServiceIn().Spec(ctx, &it, data); err != nil { - return it, err + case "creationTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Environment_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res } - case "apiVersion": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) - it.APIVersion, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "displayName": + + out.Values[i] = ec._Environment_displayName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - case "enabled": - var err error + case "id": + field := field - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) - it.Enabled, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) - if err != nil { - return it, err + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Environment_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) case "kind": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) - it.Kind, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err - } - case "metadata": - var err error + out.Values[i] = ec._Environment_kind(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) - it.ObjectMeta, err = ec.unmarshalNMetadataIn2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) - if err != nil { - return it, err + case "lastUpdatedBy": + + out.Values[i] = ec._Environment_lastUpdatedBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - } - } + case "markedForDeletion": - return it, nil -} + out.Values[i] = ec._Environment_markedForDeletion(ctx, field, obj) -func (ec *executionContext) unmarshalInputManagedServiceSpecIn(ctx context.Context, obj interface{}) (model.ManagedServiceSpecIn, error) { - var it model.ManagedServiceSpecIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } + case "metadata": - fieldsInOrder := [...]string{"inputs", "msvcKind", "nodeSelector", "region", "tolerations"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "inputs": - var err error + out.Values[i] = ec._Environment_metadata(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("inputs")) - it.Inputs, err = ec.unmarshalOMap2map(ctx, v) - if err != nil { - return it, err + case "projectName": + + out.Values[i] = ec._Environment_projectName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - case "msvcKind": - var err error + case "recordVersion": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("msvcKind")) - it.MsvcKind, err = ec.unmarshalNManagedServiceSpecMsvcKindIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedServiceSpecMsvcKindIn(ctx, v) - if err != nil { - return it, err + out.Values[i] = ec._Environment_recordVersion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - case "nodeSelector": - var err error + case "spec": + field := field - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nodeSelector")) - it.NodeSelector, err = ec.unmarshalOMap2map(ctx, v) - if err != nil { - return it, err + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Environment_spec(ctx, field, obj) + return res } - case "region": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("region")) - it.Region, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "status": + + out.Values[i] = ec._Environment_status(ctx, field, obj) + + case "syncStatus": + + out.Values[i] = ec._Environment_syncStatus(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - case "tolerations": - var err error + case "updateTime": + field := field - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tolerations")) - it.Tolerations, err = ec.unmarshalOManagedServiceSpecTolerationsIn2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedServiceSpecTolerationsIn(ctx, v) - if err != nil { - return it, err + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Environment_updateTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -func (ec *executionContext) unmarshalInputManagedServiceSpecMsvcKindIn(ctx context.Context, obj interface{}) (model.ManagedServiceSpecMsvcKindIn, error) { - var it model.ManagedServiceSpecMsvcKindIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } +var environmentEdgeImplementors = []string{"EnvironmentEdge"} - fieldsInOrder := [...]string{"kind", "apiVersion"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "kind": - var err error +func (ec *executionContext) _EnvironmentEdge(ctx context.Context, sel ast.SelectionSet, obj *model.EnvironmentEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, environmentEdgeImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("EnvironmentEdge") + case "cursor": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) - it.Kind, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err + out.Values[i] = ec._EnvironmentEdge_cursor(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } - case "apiVersion": - var err error + case "node": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) - it.APIVersion, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + out.Values[i] = ec._EnvironmentEdge_node(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -func (ec *executionContext) unmarshalInputManagedServiceSpecTolerationsIn(ctx context.Context, obj interface{}) (model.ManagedServiceSpecTolerationsIn, error) { - var it model.ManagedServiceSpecTolerationsIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } +var environmentPaginatedRecordsImplementors = []string{"EnvironmentPaginatedRecords"} - fieldsInOrder := [...]string{"effect", "key", "operator", "tolerationSeconds", "value"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "effect": - var err error +func (ec *executionContext) _EnvironmentPaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.EnvironmentPaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, environmentPaginatedRecordsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("EnvironmentPaginatedRecords") + case "edges": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("effect")) - it.Effect, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - case "key": - var err error + out.Values[i] = ec._EnvironmentPaginatedRecords_edges(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) - it.Key, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + invalids++ } - case "operator": - var err error + case "pageInfo": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operator")) - it.Operator, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - case "tolerationSeconds": - var err error + out.Values[i] = ec._EnvironmentPaginatedRecords_pageInfo(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tolerationSeconds")) - it.TolerationSeconds, err = ec.unmarshalOInt2ᚖint(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + invalids++ } - case "value": - var err error + case "totalCount": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) - it.Value, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err + out.Values[i] = ec._EnvironmentPaginatedRecords_totalCount(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil -} - -func (ec *executionContext) unmarshalInputMetadataIn(ctx context.Context, obj interface{}) (v1.ObjectMeta, error) { - var it v1.ObjectMeta - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v + out.Dispatch() + if invalids > 0 { + return graphql.Null } + return out +} - fieldsInOrder := [...]string{"name", "namespace", "labels", "annotations"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "name": - var err error +var github__com___kloudlite___api___common__CreatedOrUpdatedByImplementors = []string{"Github__com___kloudlite___api___common__CreatedOrUpdatedBy"} - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - it.Name, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "namespace": - var err error +func (ec *executionContext) _Github__com___kloudlite___api___common__CreatedOrUpdatedBy(ctx context.Context, sel ast.SelectionSet, obj *common.CreatedOrUpdatedBy) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___api___common__CreatedOrUpdatedByImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___api___common__CreatedOrUpdatedBy") + case "userEmail": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) - it.Namespace, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err - } - case "labels": - var err error + out.Values[i] = ec._Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("labels")) - data, err := ec.unmarshalOJson2map(ctx, v) - if err != nil { - return it, err - } - if err = ec.resolvers.MetadataIn().Labels(ctx, &it, data); err != nil { - return it, err + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - case "annotations": - var err error + case "userId": + field := field - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotations")) - data, err := ec.unmarshalOJson2map(ctx, v) - if err != nil { - return it, err - } - if err = ec.resolvers.MetadataIn().Annotations(ctx, &it, data); err != nil { - return it, err + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res } - } - } - return it, nil -} + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) -func (ec *executionContext) unmarshalInputOverridesIn(ctx context.Context, obj interface{}) (v11.JsonPatch, error) { - var it v11.JsonPatch - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } + }) + case "userName": - fieldsInOrder := [...]string{"patches"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "patches": - var err error + out.Values[i] = ec._Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("patches")) - it.Patches, err = ec.unmarshalOPatchIn2ᚕgithubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋjsonᚑpatchᚐPatchOperationᚄ(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -func (ec *executionContext) unmarshalInputPatchIn(ctx context.Context, obj interface{}) (json_patch.PatchOperation, error) { - var it json_patch.PatchOperation - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } +var github__com___kloudlite___api___pkg___types__EncodedStringImplementors = []string{"Github__com___kloudlite___api___pkg___types__EncodedString"} - fieldsInOrder := [...]string{"op", "path", "value"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "op": - var err error +func (ec *executionContext) _Github__com___kloudlite___api___pkg___types__EncodedString(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteAPIPkgTypesEncodedString) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___api___pkg___types__EncodedStringImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___api___pkg___types__EncodedString") + case "encoding": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("op")) - it.Op, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "path": - var err error + out.Values[i] = ec._Github__com___kloudlite___api___pkg___types__EncodedString_encoding(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("path")) - it.Path, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + invalids++ } case "value": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) - data, err := ec.unmarshalOAny2interface(ctx, v) - if err != nil { - return it, err - } - if err = ec.resolvers.PatchIn().Value(ctx, &it, data); err != nil { - return it, err + out.Values[i] = ec._Github__com___kloudlite___api___pkg___types__EncodedString_value(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -func (ec *executionContext) unmarshalInputProjectIn(ctx context.Context, obj interface{}) (entities.Project, error) { - var it entities.Project - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } +var github__com___kloudlite___api___pkg___types__SyncStatusImplementors = []string{"Github__com___kloudlite___api___pkg___types__SyncStatus"} - fieldsInOrder := [...]string{"apiVersion", "kind", "metadata", "spec"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "apiVersion": - var err error +func (ec *executionContext) _Github__com___kloudlite___api___pkg___types__SyncStatus(ctx context.Context, sel ast.SelectionSet, obj *types.SyncStatus) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___api___pkg___types__SyncStatusImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___api___pkg___types__SyncStatus") + case "action": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) - it.APIVersion, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err - } - case "kind": - var err error + out.Values[i] = ec._Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) - it.Kind, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - case "metadata": - var err error + case "error": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) - it.ObjectMeta, err = ec.unmarshalNMetadataIn2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) - if err != nil { - return it, err - } - case "spec": - var err error + out.Values[i] = ec._Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) - data, err := ec.unmarshalOProjectSpecIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐProjectSpecIn(ctx, v) - if err != nil { - return it, err - } - if err = ec.resolvers.ProjectIn().Spec(ctx, &it, data); err != nil { - return it, err + case "lastSyncedAt": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx, field, obj) + return res } - } - } - return it, nil -} + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) -func (ec *executionContext) unmarshalInputProjectSpecIn(ctx context.Context, obj interface{}) (model.ProjectSpecIn, error) { - var it model.ProjectSpecIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } + }) + case "recordVersion": - fieldsInOrder := [...]string{"displayName", "logo", "targetNamespace", "accountName", "clusterName"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "displayName": - var err error + out.Values[i] = ec._Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) - it.DisplayName, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - case "logo": - var err error + case "state": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("logo")) - it.Logo, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - case "targetNamespace": - var err error + out.Values[i] = ec._Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetNamespace")) - it.TargetNamespace, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - case "accountName": - var err error + case "syncScheduledAt": + field := field - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("accountName")) - it.AccountName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx, field, obj) + return res } - case "clusterName": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - it.ClusterName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -func (ec *executionContext) unmarshalInputRouterIn(ctx context.Context, obj interface{}) (entities.Router, error) { - var it entities.Router - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } +var github__com___kloudlite___operator___apis___crds___v1__AppContainerImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__AppContainer"} - fieldsInOrder := [...]string{"apiVersion", "kind", "metadata", "overrides", "spec"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "apiVersion": - var err error +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppContainer(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1AppContainer) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__AppContainerImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__AppContainer") + case "args": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) - it.APIVersion, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err - } - case "kind": - var err error + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppContainer_args(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) - it.Kind, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err - } - case "metadata": - var err error + case "command": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) - it.ObjectMeta, err = ec.unmarshalNMetadataIn2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) - if err != nil { - return it, err - } - case "overrides": - var err error + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppContainer_command(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("overrides")) - it.Overrides, err = ec.unmarshalOOverridesIn2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋapisᚋcrdsᚋv1ᚐJsonPatch(ctx, v) - if err != nil { - return it, err - } - case "spec": - var err error + case "env": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) - data, err := ec.unmarshalORouterSpecIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterSpecIn(ctx, v) - if err != nil { - return it, err - } - if err = ec.resolvers.RouterIn().Spec(ctx, &it, data); err != nil { - return it, err - } - } - } + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppContainer_env(ctx, field, obj) - return it, nil -} + case "envFrom": -func (ec *executionContext) unmarshalInputRouterSpecBasicAuthIn(ctx context.Context, obj interface{}) (model.RouterSpecBasicAuthIn, error) { - var it model.RouterSpecBasicAuthIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppContainer_envFrom(ctx, field, obj) - fieldsInOrder := [...]string{"enabled", "secretName", "username"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "enabled": - var err error + case "image": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) - it.Enabled, err = ec.unmarshalNBoolean2bool(ctx, v) - if err != nil { - return it, err - } - case "secretName": - var err error + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppContainer_image(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretName")) - it.SecretName, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + invalids++ } - case "username": - var err error + case "imagePullPolicy": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("username")) - it.Username, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - } - } + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppContainer_imagePullPolicy(ctx, field, obj) - return it, nil -} + case "livenessProbe": -func (ec *executionContext) unmarshalInputRouterSpecCorsIn(ctx context.Context, obj interface{}) (model.RouterSpecCorsIn, error) { - var it model.RouterSpecCorsIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppContainer_livenessProbe(ctx, field, obj) - fieldsInOrder := [...]string{"allowCredentials", "enabled", "origins"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "allowCredentials": - var err error + case "name": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("allowCredentials")) - it.AllowCredentials, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) - if err != nil { - return it, err - } - case "enabled": - var err error + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppContainer_name(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) - it.Enabled, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + invalids++ } - case "origins": - var err error + case "readinessProbe": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("origins")) - it.Origins, err = ec.unmarshalOString2ᚕᚖstring(ctx, v) - if err != nil { - return it, err - } + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppContainer_readinessProbe(ctx, field, obj) + + case "resourceCpu": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppContainer_resourceCpu(ctx, field, obj) + + case "resourceMemory": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppContainer_resourceMemory(ctx, field, obj) + + case "volumes": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppContainer_volumes(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -func (ec *executionContext) unmarshalInputRouterSpecHttpsIn(ctx context.Context, obj interface{}) (model.RouterSpecHTTPSIn, error) { - var it model.RouterSpecHTTPSIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } +var github__com___kloudlite___operator___apis___crds___v1__AppSpecImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__AppSpec"} - fieldsInOrder := [...]string{"clusterIssuer", "enabled", "forceRedirect"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "clusterIssuer": - var err error +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppSpec(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1AppSpec) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__AppSpecImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__AppSpec") + case "containers": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterIssuer")) - it.ClusterIssuer, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - case "enabled": - var err error + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppSpec_containers(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) - it.Enabled, err = ec.unmarshalNBoolean2bool(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + invalids++ } - case "forceRedirect": - var err error + case "displayName": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("forceRedirect")) - it.ForceRedirect, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) - if err != nil { - return it, err - } + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppSpec_displayName(ctx, field, obj) + + case "freeze": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppSpec_freeze(ctx, field, obj) + + case "hpa": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppSpec_hpa(ctx, field, obj) + + case "intercept": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppSpec_intercept(ctx, field, obj) + + case "nodeSelector": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppSpec_nodeSelector(ctx, field, obj) + + case "region": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppSpec_region(ctx, field, obj) + + case "replicas": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppSpec_replicas(ctx, field, obj) + + case "serviceAccount": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppSpec_serviceAccount(ctx, field, obj) + + case "services": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppSpec_services(ctx, field, obj) + + case "tolerations": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppSpec_tolerations(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -func (ec *executionContext) unmarshalInputRouterSpecIn(ctx context.Context, obj interface{}) (model.RouterSpecIn, error) { - var it model.RouterSpecIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } +var github__com___kloudlite___operator___apis___crds___v1__AppSvcImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__AppSvc"} - fieldsInOrder := [...]string{"cors", "ingressClass", "maxBodySizeInMB", "region", "routes", "backendProtocol", "basicAuth", "domains", "https", "rateLimit"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "cors": - var err error +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppSvc(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1AppSvc) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__AppSvcImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__AppSvc") + case "name": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cors")) - it.Cors, err = ec.unmarshalORouterSpecCorsIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterSpecCorsIn(ctx, v) - if err != nil { - return it, err - } - case "ingressClass": - var err error + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppSvc_name(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ingressClass")) - it.IngressClass, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - case "maxBodySizeInMB": - var err error + case "port": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("maxBodySizeInMB")) - it.MaxBodySizeInMb, err = ec.unmarshalOInt2ᚖint(ctx, v) - if err != nil { - return it, err - } - case "region": - var err error + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppSvc_port(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("region")) - it.Region, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + invalids++ } - case "routes": - var err error + case "targetPort": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("routes")) - it.Routes, err = ec.unmarshalORouterSpecRoutesIn2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterSpecRoutesIn(ctx, v) - if err != nil { - return it, err - } - case "backendProtocol": - var err error + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppSvc_targetPort(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("backendProtocol")) - it.BackendProtocol, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - case "basicAuth": - var err error + case "type": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("basicAuth")) - it.BasicAuth, err = ec.unmarshalORouterSpecBasicAuthIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterSpecBasicAuthIn(ctx, v) - if err != nil { - return it, err - } - case "domains": - var err error + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppSvc_type(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("domains")) - it.Domains, err = ec.unmarshalNString2ᚕᚖstring(ctx, v) - if err != nil { - return it, err - } - case "https": - var err error + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("https")) - it.HTTPS, err = ec.unmarshalORouterSpecHttpsIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterSpecHTTPSIn(ctx, v) - if err != nil { - return it, err - } - case "rateLimit": - var err error +var github__com___kloudlite___operator___apis___crds___v1__BasicAuthImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__BasicAuth"} - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("rateLimit")) - it.RateLimit, err = ec.unmarshalORouterSpecRateLimitIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterSpecRateLimitIn(ctx, v) - if err != nil { - return it, err +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__BasicAuth(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1BasicAuth) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__BasicAuthImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__BasicAuth") + case "enabled": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__BasicAuth_enabled(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } + case "secretName": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__BasicAuth_secretName(ctx, field, obj) + + case "username": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__BasicAuth_username(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -func (ec *executionContext) unmarshalInputRouterSpecRateLimitIn(ctx context.Context, obj interface{}) (model.RouterSpecRateLimitIn, error) { - var it model.RouterSpecRateLimitIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } +var github__com___kloudlite___operator___apis___crds___v1__ContainerEnvImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv"} - fieldsInOrder := [...]string{"connections", "enabled", "rpm", "rps"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "connections": - var err error +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1ContainerEnv) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__ContainerEnvImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv") + case "key": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("connections")) - it.Connections, err = ec.unmarshalOInt2ᚖint(ctx, v) - if err != nil { - return it, err - } - case "enabled": - var err error + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_key(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) - it.Enabled, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + invalids++ } - case "rpm": - var err error + case "optional": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("rpm")) - it.Rpm, err = ec.unmarshalOInt2ᚖint(ctx, v) - if err != nil { - return it, err - } - case "rps": - var err error + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_optional(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("rps")) - it.Rps, err = ec.unmarshalOInt2ᚖint(ctx, v) - if err != nil { - return it, err - } - } - } + case "refKey": - return it, nil -} + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_refKey(ctx, field, obj) -func (ec *executionContext) unmarshalInputRouterSpecRoutesIn(ctx context.Context, obj interface{}) (model.RouterSpecRoutesIn, error) { - var it model.RouterSpecRoutesIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } + case "refName": - fieldsInOrder := [...]string{"app", "lambda", "path", "port", "rewrite"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "app": - var err error + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_refName(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("app")) - it.App, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - case "lambda": - var err error + case "type": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lambda")) - it.Lambda, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - case "path": - var err error + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_type(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("path")) - it.Path, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "port": - var err error + case "value": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("port")) - it.Port, err = ec.unmarshalNInt2int(ctx, v) - if err != nil { - return it, err - } - case "rewrite": - var err error + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv_value(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("rewrite")) - it.Rewrite, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) - if err != nil { - return it, err - } + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -func (ec *executionContext) unmarshalInputSecretIn(ctx context.Context, obj interface{}) (entities.Secret, error) { - var it entities.Secret - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } +var github__com___kloudlite___operator___apis___crds___v1__ContainerResourceImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__ContainerResource"} - fieldsInOrder := [...]string{"data", "enabled", "kind", "metadata", "projectName", "apiVersion", "overrides", "stringData", "type"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ContainerResource(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1ContainerResource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__ContainerResourceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__ContainerResource") + case "max": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ContainerResource_max(ctx, field, obj) + + case "min": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ContainerResource_min(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) } - switch k { - case "data": - var err error + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("data")) - data, err := ec.unmarshalOMap2map(ctx, v) - if err != nil { - return it, err - } - if err = ec.resolvers.SecretIn().Data(ctx, &it, data); err != nil { - return it, err - } - case "enabled": - var err error +var github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume"} - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) - it.Enabled, err = ec.unmarshalOBoolean2bool(ctx, v) - if err != nil { - return it, err - } - case "kind": - var err error +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1ContainerVolume) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume") + case "items": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) - it.Kind, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err - } - case "metadata": - var err error + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume_items(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) - it.ObjectMeta, err = ec.unmarshalNMetadataIn2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) - if err != nil { - return it, err - } - case "projectName": - var err error + case "mountPath": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - it.ProjectName, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err - } - case "apiVersion": - var err error + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume_mountPath(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) - it.APIVersion, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + invalids++ } - case "overrides": - var err error + case "refName": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("overrides")) - it.Overrides, err = ec.unmarshalOOverridesIn2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋapisᚋcrdsᚋv1ᚐJsonPatch(ctx, v) - if err != nil { - return it, err - } - case "stringData": - var err error + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume_refName(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stringData")) - data, err := ec.unmarshalOMap2map(ctx, v) - if err != nil { - return it, err - } - if err = ec.resolvers.SecretIn().StringData(ctx, &it, data); err != nil { - return it, err + if out.Values[i] == graphql.Null { + invalids++ } case "type": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - if err = ec.resolvers.SecretIn().Type(ctx, &it, data); err != nil { - return it, err + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume_type(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -func (ec *executionContext) unmarshalInputWorkspaceIn(ctx context.Context, obj interface{}) (entities.Workspace, error) { - var it entities.Workspace - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } +var github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItemImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem"} - fieldsInOrder := [...]string{"metadata", "spec", "apiVersion", "kind"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "metadata": - var err error +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1ContainerVolumeItem) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItemImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem") + case "fileName": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) - it.ObjectMeta, err = ec.unmarshalNMetadataIn2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) - if err != nil { - return it, err - } - case "spec": - var err error + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem_fileName(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) - data, err := ec.unmarshalOWorkspaceSpecIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐWorkspaceSpecIn(ctx, v) - if err != nil { - return it, err - } - if err = ec.resolvers.WorkspaceIn().Spec(ctx, &it, data); err != nil { - return it, err - } - case "apiVersion": - var err error + case "key": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) - it.APIVersion, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err - } - case "kind": - var err error + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem_key(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) - it.Kind, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + invalids++ } + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -func (ec *executionContext) unmarshalInputWorkspaceSpecIn(ctx context.Context, obj interface{}) (model.WorkspaceSpecIn, error) { - var it model.WorkspaceSpecIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } +var github__com___kloudlite___operator___apis___crds___v1__CorsImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__Cors"} - fieldsInOrder := [...]string{"projectName", "targetNamespace"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__Cors(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1Cors) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__CorsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__Cors") + case "allowCredentials": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__Cors_allowCredentials(ctx, field, obj) + + case "enabled": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__Cors_enabled(ctx, field, obj) + + case "origins": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__Cors_origins(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) } - switch k { - case "projectName": - var err error + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - it.ProjectName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err +var github__com___kloudlite___operator___apis___crds___v1__EnvFromImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__EnvFrom"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__EnvFrom(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1EnvFrom) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__EnvFromImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__EnvFrom") + case "refName": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__EnvFrom_refName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } - case "targetNamespace": - var err error + case "type": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetNamespace")) - it.TargetNamespace, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__EnvFrom_type(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -// endregion **************************** input.gotpl ***************************** +var github__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting"} -// region ************************** interface.gotpl *************************** +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1EnvironmentRouting) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting") + case "mode": -// endregion ************************** interface.gotpl *************************** + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting_mode(ctx, field, obj) -// region **************************** object.gotpl **************************** + case "privateIngressClass": -var appImplementors = []string{"App"} + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting_privateIngressClass(ctx, field, obj) -func (ec *executionContext) _App(ctx context.Context, sel ast.SelectionSet, obj *entities.App) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, appImplementors) + case "publicIngressClass": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting_publicIngressClass(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpecImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1EnvironmentSpec) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpecImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("App") - case "kind": - - out.Values[i] = ec._App_kind(ctx, field, obj) - - case "metadata": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec") + case "projectName": - out.Values[i] = ec._App_metadata(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec_projectName(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + invalids++ } - case "overrides": + case "routing": - out.Values[i] = ec._App_overrides(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec_routing(ctx, field, obj) - case "restart": + case "targetNamespace": - out.Values[i] = ec._App_restart(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec_targetNamespace(ctx, field, obj) - case "syncStatus": + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} - out.Values[i] = ec._App_syncStatus(ctx, field, obj) +var github__com___kloudlite___operator___apis___crds___v1__HPAImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__HPA"} - case "spec": - field := field +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__HPA(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1Hpa) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__HPAImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__HPA") + case "enabled": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._App_spec(ctx, field, obj) - return res - } + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__HPA_enabled(ctx, field, obj) - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + case "maxReplicas": - }) - case "status": + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__HPA_maxReplicas(ctx, field, obj) - out.Values[i] = ec._App_status(ctx, field, obj) + case "minReplicas": - case "apiVersion": + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__HPA_minReplicas(ctx, field, obj) - out.Values[i] = ec._App_apiVersion(ctx, field, obj) + case "thresholdCpu": - case "enabled": + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__HPA_thresholdCpu(ctx, field, obj) - out.Values[i] = ec._App_enabled(ctx, field, obj) + case "thresholdMemory": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__HPA_thresholdMemory(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -23791,63 +42115,137 @@ func (ec *executionContext) _App(ctx context.Context, sel ast.SelectionSet, obj return out } -var appSpecImplementors = []string{"AppSpec"} +var github__com___kloudlite___operator___apis___crds___v1__HttpGetProbeImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe"} -func (ec *executionContext) _AppSpec(ctx context.Context, sel ast.SelectionSet, obj *model.AppSpec) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, appSpecImplementors) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1HTTPGetProbe) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__HttpGetProbeImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("AppSpec") - case "containers": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe") + case "httpHeaders": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe_httpHeaders(ctx, field, obj) - out.Values[i] = ec._AppSpec_containers(ctx, field, obj) + case "path": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe_path(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "displayName": + case "port": - out.Values[i] = ec._AppSpec_displayName(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe_port(ctx, field, obj) - case "intercept": + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} - out.Values[i] = ec._AppSpec_intercept(ctx, field, obj) +var github__com___kloudlite___operator___apis___crds___v1__HttpsImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__Https"} - case "region": +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__Https(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1HTTPS) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__HttpsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__Https") + case "clusterIssuer": - out.Values[i] = ec._AppSpec_region(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__Https_clusterIssuer(ctx, field, obj) - case "replicas": + case "enabled": - out.Values[i] = ec._AppSpec_replicas(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__Https_enabled(ctx, field, obj) - case "freeze": + if out.Values[i] == graphql.Null { + invalids++ + } + case "forceRedirect": - out.Values[i] = ec._AppSpec_freeze(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__Https_forceRedirect(ctx, field, obj) - case "hpa": + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} - out.Values[i] = ec._AppSpec_hpa(ctx, field, obj) +var github__com___kloudlite___operator___apis___crds___v1__InterceptImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__Intercept"} - case "nodeSelector": +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__Intercept(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1Intercept) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__InterceptImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__Intercept") + case "enabled": - out.Values[i] = ec._AppSpec_nodeSelector(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__Intercept_enabled(ctx, field, obj) - case "serviceAccount": + if out.Values[i] == graphql.Null { + invalids++ + } + case "toDevice": - out.Values[i] = ec._AppSpec_serviceAccount(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__Intercept_toDevice(ctx, field, obj) - case "services": + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpecImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1ManagedResourceSpec) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpecImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec") + case "resourceName": - out.Values[i] = ec._AppSpec_services(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec_resourceName(ctx, field, obj) - case "tolerations": + case "resourceTemplate": - out.Values[i] = ec._AppSpec_tolerations(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec_resourceTemplate(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -23859,70 +42257,23 @@ func (ec *executionContext) _AppSpec(ctx context.Context, sel ast.SelectionSet, return out } -var appSpecContainersImplementors = []string{"AppSpecContainers"} +var github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec"} -func (ec *executionContext) _AppSpecContainers(ctx context.Context, sel ast.SelectionSet, obj *model.AppSpecContainers) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, appSpecContainersImplementors) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpec) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("AppSpecContainers") - case "name": - - out.Values[i] = ec._AppSpecContainers_name(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "args": - - out.Values[i] = ec._AppSpecContainers_args(ctx, field, obj) + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec") + case "serviceTemplate": - case "env": - - out.Values[i] = ec._AppSpecContainers_env(ctx, field, obj) - - case "envFrom": - - out.Values[i] = ec._AppSpecContainers_envFrom(ctx, field, obj) - - case "image": - - out.Values[i] = ec._AppSpecContainers_image(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec_serviceTemplate(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "imagePullPolicy": - - out.Values[i] = ec._AppSpecContainers_imagePullPolicy(ctx, field, obj) - - case "volumes": - - out.Values[i] = ec._AppSpecContainers_volumes(ctx, field, obj) - - case "command": - - out.Values[i] = ec._AppSpecContainers_command(ctx, field, obj) - - case "livenessProbe": - - out.Values[i] = ec._AppSpecContainers_livenessProbe(ctx, field, obj) - - case "readinessProbe": - - out.Values[i] = ec._AppSpecContainers_readinessProbe(ctx, field, obj) - - case "resourceCpu": - - out.Values[i] = ec._AppSpecContainers_resourceCpu(ctx, field, obj) - - case "resourceMemory": - - out.Values[i] = ec._AppSpecContainers_resourceMemory(ctx, field, obj) - default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -23934,43 +42285,44 @@ func (ec *executionContext) _AppSpecContainers(ctx context.Context, sel ast.Sele return out } -var appSpecContainersEnvImplementors = []string{"AppSpecContainersEnv"} +var github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplateImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate"} -func (ec *executionContext) _AppSpecContainersEnv(ctx context.Context, sel ast.SelectionSet, obj *model.AppSpecContainersEnv) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, appSpecContainersEnvImplementors) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1MresResourceTemplate) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplateImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("AppSpecContainersEnv") - case "key": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate") + case "apiVersion": - out.Values[i] = ec._AppSpecContainersEnv_key(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_apiVersion(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "optional": - - out.Values[i] = ec._AppSpecContainersEnv_optional(ctx, field, obj) - - case "refKey": - - out.Values[i] = ec._AppSpecContainersEnv_refKey(ctx, field, obj) - - case "refName": + case "kind": - out.Values[i] = ec._AppSpecContainersEnv_refName(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_kind(ctx, field, obj) - case "type": + if out.Values[i] == graphql.Null { + invalids++ + } + case "msvcRef": - out.Values[i] = ec._AppSpecContainersEnv_type(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_msvcRef(ctx, field, obj) - case "value": + if out.Values[i] == graphql.Null { + invalids++ + } + case "spec": - out.Values[i] = ec._AppSpecContainersEnv_value(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_spec(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -23982,26 +42334,40 @@ func (ec *executionContext) _AppSpecContainersEnv(ctx context.Context, sel ast.S return out } -var appSpecContainersEnvFromImplementors = []string{"AppSpecContainersEnvFrom"} +var github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRefImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef"} -func (ec *executionContext) _AppSpecContainersEnvFrom(ctx context.Context, sel ast.SelectionSet, obj *model.AppSpecContainersEnvFrom) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, appSpecContainersEnvFromImplementors) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1MsvcNamedRef) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRefImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("AppSpecContainersEnvFrom") - case "type": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef") + case "apiVersion": - out.Values[i] = ec._AppSpecContainersEnvFrom_type(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef_apiVersion(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "refName": + case "kind": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef_kind(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "name": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "namespace": - out.Values[i] = ec._AppSpecContainersEnvFrom_refName(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef_namespace(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -24017,43 +42383,43 @@ func (ec *executionContext) _AppSpecContainersEnvFrom(ctx context.Context, sel a return out } -var appSpecContainersLivenessProbeImplementors = []string{"AppSpecContainersLivenessProbe"} +var github__com___kloudlite___operator___apis___crds___v1__ProbeImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__Probe"} -func (ec *executionContext) _AppSpecContainersLivenessProbe(ctx context.Context, sel ast.SelectionSet, obj *model.AppSpecContainersLivenessProbe) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, appSpecContainersLivenessProbeImplementors) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__Probe(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1Probe) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__ProbeImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("AppSpecContainersLivenessProbe") + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__Probe") case "failureThreshold": - out.Values[i] = ec._AppSpecContainersLivenessProbe_failureThreshold(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__Probe_failureThreshold(ctx, field, obj) case "httpGet": - out.Values[i] = ec._AppSpecContainersLivenessProbe_httpGet(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__Probe_httpGet(ctx, field, obj) case "initialDelay": - out.Values[i] = ec._AppSpecContainersLivenessProbe_initialDelay(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__Probe_initialDelay(ctx, field, obj) case "interval": - out.Values[i] = ec._AppSpecContainersLivenessProbe_interval(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__Probe_interval(ctx, field, obj) case "shell": - out.Values[i] = ec._AppSpecContainersLivenessProbe_shell(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__Probe_shell(ctx, field, obj) case "tcp": - out.Values[i] = ec._AppSpecContainersLivenessProbe_tcp(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__Probe_tcp(ctx, field, obj) case "type": - out.Values[i] = ec._AppSpecContainersLivenessProbe_type(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__Probe_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -24069,30 +42435,54 @@ func (ec *executionContext) _AppSpecContainersLivenessProbe(ctx context.Context, return out } -var appSpecContainersLivenessProbeHttpGetImplementors = []string{"AppSpecContainersLivenessProbeHttpGet"} +var github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpecImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec"} -func (ec *executionContext) _AppSpecContainersLivenessProbeHttpGet(ctx context.Context, sel ast.SelectionSet, obj *model.AppSpecContainersLivenessProbeHTTPGet) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, appSpecContainersLivenessProbeHttpGetImplementors) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpec) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpecImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("AppSpecContainersLivenessProbeHttpGet") - case "httpHeaders": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec") + case "msvcSpec": - out.Values[i] = ec._AppSpecContainersLivenessProbeHttpGet_httpHeaders(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec_msvcSpec(ctx, field, obj) - case "path": + if out.Values[i] == graphql.Null { + invalids++ + } + case "targetNamespace": - out.Values[i] = ec._AppSpecContainersLivenessProbeHttpGet_path(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec_targetNamespace(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "port": + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___apis___crds___v1__ProjectSpecImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1ProjectSpec) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__ProjectSpecImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec") + case "targetNamespace": - out.Values[i] = ec._AppSpecContainersLivenessProbeHttpGet_port(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec_targetNamespace(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -24108,19 +42498,31 @@ func (ec *executionContext) _AppSpecContainersLivenessProbeHttpGet(ctx context.C return out } -var appSpecContainersLivenessProbeShellImplementors = []string{"AppSpecContainersLivenessProbeShell"} +var github__com___kloudlite___operator___apis___crds___v1__RateLimitImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__RateLimit"} -func (ec *executionContext) _AppSpecContainersLivenessProbeShell(ctx context.Context, sel ast.SelectionSet, obj *model.AppSpecContainersLivenessProbeShell) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, appSpecContainersLivenessProbeShellImplementors) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__RateLimit(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1RateLimit) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__RateLimitImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("AppSpecContainersLivenessProbeShell") - case "command": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__RateLimit") + case "connections": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__RateLimit_connections(ctx, field, obj) - out.Values[i] = ec._AppSpecContainersLivenessProbeShell_command(ctx, field, obj) + case "enabled": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__RateLimit_enabled(ctx, field, obj) + + case "rpm": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__RateLimit_rpm(ctx, field, obj) + + case "rps": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__RateLimit_rps(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -24133,23 +42535,42 @@ func (ec *executionContext) _AppSpecContainersLivenessProbeShell(ctx context.Con return out } -var appSpecContainersLivenessProbeTcpImplementors = []string{"AppSpecContainersLivenessProbeTcp"} +var github__com___kloudlite___operator___apis___crds___v1__RouteImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__Route"} -func (ec *executionContext) _AppSpecContainersLivenessProbeTcp(ctx context.Context, sel ast.SelectionSet, obj *model.AppSpecContainersLivenessProbeTCP) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, appSpecContainersLivenessProbeTcpImplementors) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__Route(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1Route) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__RouteImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("AppSpecContainersLivenessProbeTcp") + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__Route") + case "app": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__Route_app(ctx, field, obj) + + case "lambda": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__Route_lambda(ctx, field, obj) + + case "path": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__Route_path(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } case "port": - out.Values[i] = ec._AppSpecContainersLivenessProbeTcp_port(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__Route_port(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } + case "rewrite": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__Route_rewrite(ctx, field, obj) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -24161,46 +42582,54 @@ func (ec *executionContext) _AppSpecContainersLivenessProbeTcp(ctx context.Conte return out } -var appSpecContainersReadinessProbeImplementors = []string{"AppSpecContainersReadinessProbe"} +var github__com___kloudlite___operator___apis___crds___v1__RouterSpecImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__RouterSpec"} -func (ec *executionContext) _AppSpecContainersReadinessProbe(ctx context.Context, sel ast.SelectionSet, obj *model.AppSpecContainersReadinessProbe) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, appSpecContainersReadinessProbeImplementors) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__RouterSpec(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1RouterSpec) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__RouterSpecImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("AppSpecContainersReadinessProbe") - case "interval": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__RouterSpec") + case "backendProtocol": - out.Values[i] = ec._AppSpecContainersReadinessProbe_interval(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_backendProtocol(ctx, field, obj) - case "shell": + case "basicAuth": - out.Values[i] = ec._AppSpecContainersReadinessProbe_shell(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_basicAuth(ctx, field, obj) - case "tcp": + case "cors": - out.Values[i] = ec._AppSpecContainersReadinessProbe_tcp(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_cors(ctx, field, obj) - case "type": + case "domains": - out.Values[i] = ec._AppSpecContainersReadinessProbe_type(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_domains(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "failureThreshold": + case "https": - out.Values[i] = ec._AppSpecContainersReadinessProbe_failureThreshold(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_https(ctx, field, obj) - case "httpGet": + case "ingressClass": - out.Values[i] = ec._AppSpecContainersReadinessProbe_httpGet(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_ingressClass(ctx, field, obj) - case "initialDelay": + case "maxBodySizeInMB": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_maxBodySizeInMB(ctx, field, obj) + + case "rateLimit": - out.Values[i] = ec._AppSpecContainersReadinessProbe_initialDelay(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_rateLimit(ctx, field, obj) + + case "routes": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_routes(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -24213,30 +42642,33 @@ func (ec *executionContext) _AppSpecContainersReadinessProbe(ctx context.Context return out } -var appSpecContainersReadinessProbeHttpGetImplementors = []string{"AppSpecContainersReadinessProbeHttpGet"} +var github__com___kloudlite___operator___apis___crds___v1__ServiceTemplateImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate"} -func (ec *executionContext) _AppSpecContainersReadinessProbeHttpGet(ctx context.Context, sel ast.SelectionSet, obj *model.AppSpecContainersReadinessProbeHTTPGet) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, appSpecContainersReadinessProbeHttpGetImplementors) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1ServiceTemplate) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__ServiceTemplateImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("AppSpecContainersReadinessProbeHttpGet") - case "httpHeaders": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate") + case "apiVersion": - out.Values[i] = ec._AppSpecContainersReadinessProbeHttpGet_httpHeaders(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_apiVersion(ctx, field, obj) - case "path": + if out.Values[i] == graphql.Null { + invalids++ + } + case "kind": - out.Values[i] = ec._AppSpecContainersReadinessProbeHttpGet_path(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_kind(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "port": + case "spec": - out.Values[i] = ec._AppSpecContainersReadinessProbeHttpGet_port(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_spec(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -24252,19 +42684,19 @@ func (ec *executionContext) _AppSpecContainersReadinessProbeHttpGet(ctx context. return out } -var appSpecContainersReadinessProbeShellImplementors = []string{"AppSpecContainersReadinessProbeShell"} +var github__com___kloudlite___operator___apis___crds___v1__ShellProbeImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__ShellProbe"} -func (ec *executionContext) _AppSpecContainersReadinessProbeShell(ctx context.Context, sel ast.SelectionSet, obj *model.AppSpecContainersReadinessProbeShell) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, appSpecContainersReadinessProbeShellImplementors) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ShellProbe(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1ShellProbe) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__ShellProbeImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("AppSpecContainersReadinessProbeShell") + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__ShellProbe") case "command": - out.Values[i] = ec._AppSpecContainersReadinessProbeShell_command(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ShellProbe_command(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -24277,19 +42709,19 @@ func (ec *executionContext) _AppSpecContainersReadinessProbeShell(ctx context.Co return out } -var appSpecContainersReadinessProbeTcpImplementors = []string{"AppSpecContainersReadinessProbeTcp"} +var github__com___kloudlite___operator___apis___crds___v1__TcpProbeImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__TcpProbe"} -func (ec *executionContext) _AppSpecContainersReadinessProbeTcp(ctx context.Context, sel ast.SelectionSet, obj *model.AppSpecContainersReadinessProbeTCP) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, appSpecContainersReadinessProbeTcpImplementors) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__TcpProbe(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1TCPProbe) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__TcpProbeImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("AppSpecContainersReadinessProbeTcp") + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__TcpProbe") case "port": - out.Values[i] = ec._AppSpecContainersReadinessProbeTcp_port(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__TcpProbe_port(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -24305,23 +42737,23 @@ func (ec *executionContext) _AppSpecContainersReadinessProbeTcp(ctx context.Cont return out } -var appSpecContainersResourceCpuImplementors = []string{"AppSpecContainersResourceCpu"} +var github__com___kloudlite___operator___apis___wireguard___v1__CNameRecordImplementors = []string{"Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord"} -func (ec *executionContext) _AppSpecContainersResourceCpu(ctx context.Context, sel ast.SelectionSet, obj *model.AppSpecContainersResourceCPU) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, appSpecContainersResourceCpuImplementors) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisWireguardV1CNameRecord) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___wireguard___v1__CNameRecordImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("AppSpecContainersResourceCpu") - case "max": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord") + case "host": - out.Values[i] = ec._AppSpecContainersResourceCpu_max(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord_host(ctx, field, obj) - case "min": + case "target": - out.Values[i] = ec._AppSpecContainersResourceCpu_min(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord_target(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -24334,69 +42766,39 @@ func (ec *executionContext) _AppSpecContainersResourceCpu(ctx context.Context, s return out } -var appSpecContainersResourceMemoryImplementors = []string{"AppSpecContainersResourceMemory"} +var github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpecImplementors = []string{"Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec"} -func (ec *executionContext) _AppSpecContainersResourceMemory(ctx context.Context, sel ast.SelectionSet, obj *model.AppSpecContainersResourceMemory) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, appSpecContainersResourceMemoryImplementors) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisWireguardV1DeviceSpec) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpecImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("AppSpecContainersResourceMemory") - case "max": - - out.Values[i] = ec._AppSpecContainersResourceMemory_max(ctx, field, obj) + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec") + case "activeNamespace": - case "min": - - out.Values[i] = ec._AppSpecContainersResourceMemory_min(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_activeNamespace(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} + case "cnameRecords": -var appSpecContainersVolumesImplementors = []string{"AppSpecContainersVolumes"} + out.Values[i] = ec._Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_cnameRecords(ctx, field, obj) -func (ec *executionContext) _AppSpecContainersVolumes(ctx context.Context, sel ast.SelectionSet, obj *model.AppSpecContainersVolumes) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, appSpecContainersVolumesImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("AppSpecContainersVolumes") - case "mountPath": + case "disabled": - out.Values[i] = ec._AppSpecContainersVolumes_mountPath(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_disabled(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ - } - case "refName": + case "nodeSelector": - out.Values[i] = ec._AppSpecContainersVolumes_refName(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_nodeSelector(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ - } - case "type": + case "noExternalService": - out.Values[i] = ec._AppSpecContainersVolumes_type(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_noExternalService(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ - } - case "items": + case "ports": - out.Values[i] = ec._AppSpecContainersVolumes_items(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec_ports(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -24409,26 +42811,23 @@ func (ec *executionContext) _AppSpecContainersVolumes(ctx context.Context, sel a return out } -var appSpecContainersVolumesItemsImplementors = []string{"AppSpecContainersVolumesItems"} +var github__com___kloudlite___operator___apis___wireguard___v1__PortImplementors = []string{"Github__com___kloudlite___operator___apis___wireguard___v1__Port"} -func (ec *executionContext) _AppSpecContainersVolumesItems(ctx context.Context, sel ast.SelectionSet, obj *model.AppSpecContainersVolumesItems) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, appSpecContainersVolumesItemsImplementors) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___wireguard___v1__Port(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisWireguardV1Port) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___wireguard___v1__PortImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("AppSpecContainersVolumesItems") - case "key": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___wireguard___v1__Port") + case "port": - out.Values[i] = ec._AppSpecContainersVolumesItems_key(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___wireguard___v1__Port_port(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ - } - case "fileName": + case "targetPort": - out.Values[i] = ec._AppSpecContainersVolumesItems_fileName(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___apis___wireguard___v1__Port_targetPort(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -24441,36 +42840,31 @@ func (ec *executionContext) _AppSpecContainersVolumesItems(ctx context.Context, return out } -var appSpecHpaImplementors = []string{"AppSpecHpa"} +var github__com___kloudlite___operator___pkg___operator__CheckImplementors = []string{"Github__com___kloudlite___operator___pkg___operator__Check"} -func (ec *executionContext) _AppSpecHpa(ctx context.Context, sel ast.SelectionSet, obj *model.AppSpecHpa) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, appSpecHpaImplementors) +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Check(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorPkgOperatorCheck) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___pkg___operator__CheckImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("AppSpecHpa") - case "enabled": - - out.Values[i] = ec._AppSpecHpa_enabled(ctx, field, obj) - - case "maxReplicas": - - out.Values[i] = ec._AppSpecHpa_maxReplicas(ctx, field, obj) - - case "minReplicas": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___pkg___operator__Check") + case "generation": - out.Values[i] = ec._AppSpecHpa_minReplicas(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_generation(ctx, field, obj) - case "thresholdCpu": + case "message": - out.Values[i] = ec._AppSpecHpa_thresholdCpu(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_message(ctx, field, obj) - case "thresholdMemory": + case "status": - out.Values[i] = ec._AppSpecHpa_thresholdMemory(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_status(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -24482,70 +42876,44 @@ func (ec *executionContext) _AppSpecHpa(ctx context.Context, sel ast.SelectionSe return out } -var appSpecInterceptImplementors = []string{"AppSpecIntercept"} +var github__com___kloudlite___operator___pkg___operator__ResourceRefImplementors = []string{"Github__com___kloudlite___operator___pkg___operator__ResourceRef"} -func (ec *executionContext) _AppSpecIntercept(ctx context.Context, sel ast.SelectionSet, obj *model.AppSpecIntercept) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, appSpecInterceptImplementors) +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__ResourceRef(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorPkgOperatorResourceRef) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___pkg___operator__ResourceRefImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("AppSpecIntercept") - case "enabled": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___pkg___operator__ResourceRef") + case "apiVersion": - out.Values[i] = ec._AppSpecIntercept_enabled(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__ResourceRef_apiVersion(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "toDevice": + case "kind": - out.Values[i] = ec._AppSpecIntercept_toDevice(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__ResourceRef_kind(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var appSpecServicesImplementors = []string{"AppSpecServices"} - -func (ec *executionContext) _AppSpecServices(ctx context.Context, sel ast.SelectionSet, obj *model.AppSpecServices) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, appSpecServicesImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("AppSpecServices") case "name": - out.Values[i] = ec._AppSpecServices_name(ctx, field, obj) - - case "port": - - out.Values[i] = ec._AppSpecServices_port(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__ResourceRef_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "targetPort": - - out.Values[i] = ec._AppSpecServices_targetPort(ctx, field, obj) - - case "type": + case "namespace": - out.Values[i] = ec._AppSpecServices_type(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__ResourceRef_namespace(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -24557,36 +42925,95 @@ func (ec *executionContext) _AppSpecServices(ctx context.Context, sel ast.Select return out } -var appSpecTolerationsImplementors = []string{"AppSpecTolerations"} +var github__com___kloudlite___operator___pkg___operator__StatusImplementors = []string{"Github__com___kloudlite___operator___pkg___operator__Status"} -func (ec *executionContext) _AppSpecTolerations(ctx context.Context, sel ast.SelectionSet, obj *model.AppSpecTolerations) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, appSpecTolerationsImplementors) +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Status(ctx context.Context, sel ast.SelectionSet, obj *operator.Status) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___pkg___operator__StatusImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("AppSpecTolerations") - case "effect": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___pkg___operator__Status") + case "checks": + field := field - out.Values[i] = ec._AppSpecTolerations_effect(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx, field, obj) + return res + } - case "key": + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "isReady": - out.Values[i] = ec._AppSpecTolerations_key(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Status_isReady(ctx, field, obj) - case "operator": + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "lastReadyGeneration": - out.Values[i] = ec._AppSpecTolerations_operator(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Status_lastReadyGeneration(ctx, field, obj) - case "tolerationSeconds": + case "lastReconcileTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Github__com___kloudlite___operator___pkg___operator__Status_lastReconcileTime(ctx, field, obj) + return res + } - out.Values[i] = ec._AppSpecTolerations_tolerationSeconds(ctx, field, obj) + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) - case "value": + }) + case "message": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Github__com___kloudlite___operator___pkg___operator__Status_message(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "resources": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Github__com___kloudlite___operator___pkg___operator__Status_resources(ctx, field, obj) + return res + } - out.Values[i] = ec._AppSpecTolerations_value(ctx, field, obj) + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + }) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -24598,27 +43025,19 @@ func (ec *executionContext) _AppSpecTolerations(ctx context.Context, sel ast.Sel return out } -var checkImplementors = []string{"Check"} +var github__com___kloudlite___operator___pkg___raw____json__RawJsonImplementors = []string{"Github__com___kloudlite___operator___pkg___raw____json__RawJson"} -func (ec *executionContext) _Check(ctx context.Context, sel ast.SelectionSet, obj *operator.Check) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, checkImplementors) +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___raw____json__RawJson(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorPkgRawJSONRawJSON) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___pkg___raw____json__RawJsonImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Check") - case "status": - - out.Values[i] = ec._Check_status(ctx, field, obj) + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___pkg___raw____json__RawJson") + case "RawMessage": - case "message": - - out.Values[i] = ec._Check_message(ctx, field, obj) - - case "generation": - - out.Values[i] = ec._Check_generation(ctx, field, obj) + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___raw____json__RawJson_RawMessage(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -24631,48 +43050,160 @@ func (ec *executionContext) _Check(ctx context.Context, sel ast.SelectionSet, ob return out } -var configImplementors = []string{"Config"} +var imagePullSecretImplementors = []string{"ImagePullSecret"} -func (ec *executionContext) _Config(ctx context.Context, sel ast.SelectionSet, obj *entities.Config) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, configImplementors) +func (ec *executionContext) _ImagePullSecret(ctx context.Context, sel ast.SelectionSet, obj *entities.ImagePullSecret) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, imagePullSecretImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Config") - case "enabled": + out.Values[i] = graphql.MarshalString("ImagePullSecret") + case "accountName": - out.Values[i] = ec._Config_enabled(ctx, field, obj) + out.Values[i] = ec._ImagePullSecret_accountName(ctx, field, obj) - case "kind": + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "createdBy": - out.Values[i] = ec._Config_kind(ctx, field, obj) + out.Values[i] = ec._ImagePullSecret_createdBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "creationTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ImagePullSecret_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "displayName": + + out.Values[i] = ec._ImagePullSecret_displayName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "dockerConfigJson": + + out.Values[i] = ec._ImagePullSecret_dockerConfigJson(ctx, field, obj) + + case "environmentName": + + out.Values[i] = ec._ImagePullSecret_environmentName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "format": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ImagePullSecret_format(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "id": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ImagePullSecret_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "lastUpdatedBy": + + out.Values[i] = ec._ImagePullSecret_lastUpdatedBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "markedForDeletion": + + out.Values[i] = ec._ImagePullSecret_markedForDeletion(ctx, field, obj) case "metadata": - out.Values[i] = ec._Config_metadata(ctx, field, obj) + out.Values[i] = ec._ImagePullSecret_metadata(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - case "overrides": + case "projectName": - out.Values[i] = ec._Config_overrides(ctx, field, obj) + out.Values[i] = ec._ImagePullSecret_projectName(ctx, field, obj) - case "status": + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "recordVersion": - out.Values[i] = ec._Config_status(ctx, field, obj) + out.Values[i] = ec._ImagePullSecret_recordVersion(ctx, field, obj) - case "apiVersion": + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "registryPassword": - out.Values[i] = ec._Config_apiVersion(ctx, field, obj) + out.Values[i] = ec._ImagePullSecret_registryPassword(ctx, field, obj) + + case "registryURL": + + out.Values[i] = ec._ImagePullSecret_registryURL(ctx, field, obj) + + case "registryUsername": + + out.Values[i] = ec._ImagePullSecret_registryUsername(ctx, field, obj) case "syncStatus": - out.Values[i] = ec._Config_syncStatus(ctx, field, obj) + out.Values[i] = ec._ImagePullSecret_syncStatus(ctx, field, obj) - case "data": + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "updateTime": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -24681,7 +43212,10 @@ func (ec *executionContext) _Config(ctx context.Context, sel ast.SelectionSet, o ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Config_data(ctx, field, obj) + res = ec._ImagePullSecret_updateTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res } @@ -24700,26 +43234,112 @@ func (ec *executionContext) _Config(ctx context.Context, sel ast.SelectionSet, o return out } -var consoleCheckNameAvailabilityOutputImplementors = []string{"ConsoleCheckNameAvailabilityOutput"} +var imagePullSecretEdgeImplementors = []string{"ImagePullSecretEdge"} -func (ec *executionContext) _ConsoleCheckNameAvailabilityOutput(ctx context.Context, sel ast.SelectionSet, obj *domain.CheckNameAvailabilityOutput) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, consoleCheckNameAvailabilityOutputImplementors) +func (ec *executionContext) _ImagePullSecretEdge(ctx context.Context, sel ast.SelectionSet, obj *model.ImagePullSecretEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, imagePullSecretEdgeImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("ConsoleCheckNameAvailabilityOutput") - case "result": + out.Values[i] = graphql.MarshalString("ImagePullSecretEdge") + case "cursor": - out.Values[i] = ec._ConsoleCheckNameAvailabilityOutput_result(ctx, field, obj) + out.Values[i] = ec._ImagePullSecretEdge_cursor(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "suggestedNames": + case "node": - out.Values[i] = ec._ConsoleCheckNameAvailabilityOutput_suggestedNames(ctx, field, obj) + out.Values[i] = ec._ImagePullSecretEdge_node(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var imagePullSecretPaginatedRecordsImplementors = []string{"ImagePullSecretPaginatedRecords"} + +func (ec *executionContext) _ImagePullSecretPaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.ImagePullSecretPaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, imagePullSecretPaginatedRecordsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ImagePullSecretPaginatedRecords") + case "edges": + + out.Values[i] = ec._ImagePullSecretPaginatedRecords_edges(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "pageInfo": + + out.Values[i] = ec._ImagePullSecretPaginatedRecords_pageInfo(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "totalCount": + + out.Values[i] = ec._ImagePullSecretPaginatedRecords_totalCount(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__TolerationImplementors = []string{"K8s__io___api___core___v1__Toleration"} + +func (ec *executionContext) _K8s__io___api___core___v1__Toleration(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1Toleration) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__TolerationImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__Toleration") + case "effect": + + out.Values[i] = ec._K8s__io___api___core___v1__Toleration_effect(ctx, field, obj) + + case "key": + + out.Values[i] = ec._K8s__io___api___core___v1__Toleration_key(ctx, field, obj) + + case "operator": + + out.Values[i] = ec._K8s__io___api___core___v1__Toleration_operator(ctx, field, obj) + + case "tolerationSeconds": + + out.Values[i] = ec._K8s__io___api___core___v1__Toleration_tolerationSeconds(ctx, field, obj) + + case "value": + + out.Values[i] = ec._K8s__io___api___core___v1__Toleration_value(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -24734,7 +43354,7 @@ func (ec *executionContext) _ConsoleCheckNameAvailabilityOutput(ctx context.Cont var managedResourceImplementors = []string{"ManagedResource"} -func (ec *executionContext) _ManagedResource(ctx context.Context, sel ast.SelectionSet, obj *entities.MRes) graphql.Marshaler { +func (ec *executionContext) _ManagedResource(ctx context.Context, sel ast.SelectionSet, obj *entities.ManagedResource) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, managedResourceImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 @@ -24742,15 +43362,25 @@ func (ec *executionContext) _ManagedResource(ctx context.Context, sel ast.Select switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("ManagedResource") - case "overrides": + case "accountName": - out.Values[i] = ec._ManagedResource_overrides(ctx, field, obj) + out.Values[i] = ec._ManagedResource_accountName(ctx, field, obj) - case "syncStatus": + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "apiVersion": - out.Values[i] = ec._ManagedResource_syncStatus(ctx, field, obj) + out.Values[i] = ec._ManagedResource_apiVersion(ctx, field, obj) - case "spec": + case "createdBy": + + out.Values[i] = ec._ManagedResource_createdBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "creationTime": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -24759,7 +43389,10 @@ func (ec *executionContext) _ManagedResource(ctx context.Context, sel ast.Select ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._ManagedResource_spec(ctx, field, obj) + res = ec._ManagedResource_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res } @@ -24767,96 +43400,128 @@ func (ec *executionContext) _ManagedResource(ctx context.Context, sel ast.Select return innerFunc(ctx) }) - case "status": - - out.Values[i] = ec._ManagedResource_status(ctx, field, obj) - - case "apiVersion": + case "displayName": - out.Values[i] = ec._ManagedResource_apiVersion(ctx, field, obj) + out.Values[i] = ec._ManagedResource_displayName(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } case "enabled": out.Values[i] = ec._ManagedResource_enabled(ctx, field, obj) + case "environmentName": + + out.Values[i] = ec._ManagedResource_environmentName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "id": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ManagedResource_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) case "kind": out.Values[i] = ec._ManagedResource_kind(ctx, field, obj) - case "metadata": + case "lastUpdatedBy": - out.Values[i] = ec._ManagedResource_metadata(ctx, field, obj) + out.Values[i] = ec._ManagedResource_lastUpdatedBy(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} + case "markedForDeletion": -var managedResourceSpecImplementors = []string{"ManagedResourceSpec"} + out.Values[i] = ec._ManagedResource_markedForDeletion(ctx, field, obj) -func (ec *executionContext) _ManagedResourceSpec(ctx context.Context, sel ast.SelectionSet, obj *model.ManagedResourceSpec) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, managedResourceSpecImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("ManagedResourceSpec") - case "inputs": + case "metadata": - out.Values[i] = ec._ManagedResourceSpec_inputs(ctx, field, obj) + out.Values[i] = ec._ManagedResource_metadata(ctx, field, obj) - case "mresKind": + case "projectName": - out.Values[i] = ec._ManagedResourceSpec_mresKind(ctx, field, obj) + out.Values[i] = ec._ManagedResource_projectName(ctx, field, obj) if out.Values[i] == graphql.Null { - invalids++ + atomic.AddUint32(&invalids, 1) } - case "msvcRef": + case "recordVersion": - out.Values[i] = ec._ManagedResourceSpec_msvcRef(ctx, field, obj) + out.Values[i] = ec._ManagedResource_recordVersion(ctx, field, obj) if out.Values[i] == graphql.Null { - invalids++ + atomic.AddUint32(&invalids, 1) + } + case "spec": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ManagedResource_spec(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} -var managedResourceSpecMresKindImplementors = []string{"ManagedResourceSpecMresKind"} + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) -func (ec *executionContext) _ManagedResourceSpecMresKind(ctx context.Context, sel ast.SelectionSet, obj *model.ManagedResourceSpecMresKind) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, managedResourceSpecMresKindImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("ManagedResourceSpecMresKind") - case "kind": + }) + case "status": + + out.Values[i] = ec._ManagedResource_status(ctx, field, obj) + + case "syncStatus": - out.Values[i] = ec._ManagedResourceSpecMresKind_kind(ctx, field, obj) + out.Values[i] = ec._ManagedResource_syncStatus(ctx, field, obj) if out.Values[i] == graphql.Null { - invalids++ + atomic.AddUint32(&invalids, 1) + } + case "updateTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ManagedResource_updateTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -24868,30 +43533,26 @@ func (ec *executionContext) _ManagedResourceSpecMresKind(ctx context.Context, se return out } -var managedResourceSpecMsvcRefImplementors = []string{"ManagedResourceSpecMsvcRef"} +var managedResourceEdgeImplementors = []string{"ManagedResourceEdge"} -func (ec *executionContext) _ManagedResourceSpecMsvcRef(ctx context.Context, sel ast.SelectionSet, obj *model.ManagedResourceSpecMsvcRef) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, managedResourceSpecMsvcRefImplementors) +func (ec *executionContext) _ManagedResourceEdge(ctx context.Context, sel ast.SelectionSet, obj *model.ManagedResourceEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, managedResourceEdgeImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("ManagedResourceSpecMsvcRef") - case "apiVersion": + out.Values[i] = graphql.MarshalString("ManagedResourceEdge") + case "cursor": - out.Values[i] = ec._ManagedResourceSpecMsvcRef_apiVersion(ctx, field, obj) + out.Values[i] = ec._ManagedResourceEdge_cursor(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "kind": - - out.Values[i] = ec._ManagedResourceSpecMsvcRef_kind(ctx, field, obj) - - case "name": + case "node": - out.Values[i] = ec._ManagedResourceSpecMsvcRef_name(ctx, field, obj) + out.Values[i] = ec._ManagedResourceEdge_node(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -24907,63 +43568,29 @@ func (ec *executionContext) _ManagedResourceSpecMsvcRef(ctx context.Context, sel return out } -var managedServiceImplementors = []string{"ManagedService"} +var managedResourceKeyRefImplementors = []string{"ManagedResourceKeyRef"} -func (ec *executionContext) _ManagedService(ctx context.Context, sel ast.SelectionSet, obj *entities.MSvc) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, managedServiceImplementors) +func (ec *executionContext) _ManagedResourceKeyRef(ctx context.Context, sel ast.SelectionSet, obj *model.ManagedResourceKeyRef) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, managedResourceKeyRefImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("ManagedService") - case "overrides": - - out.Values[i] = ec._ManagedService_overrides(ctx, field, obj) - - case "syncStatus": - - out.Values[i] = ec._ManagedService_syncStatus(ctx, field, obj) + out.Values[i] = graphql.MarshalString("ManagedResourceKeyRef") + case "key": - case "spec": - field := field + out.Values[i] = ec._ManagedResourceKeyRef_key(ctx, field, obj) - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._ManagedService_spec(ctx, field, obj) - return res + if out.Values[i] == graphql.Null { + invalids++ } + case "mresName": - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "status": - - out.Values[i] = ec._ManagedService_status(ctx, field, obj) - - case "apiVersion": - - out.Values[i] = ec._ManagedService_apiVersion(ctx, field, obj) - - case "enabled": - - out.Values[i] = ec._ManagedService_enabled(ctx, field, obj) - - case "kind": - - out.Values[i] = ec._ManagedService_kind(ctx, field, obj) - - case "metadata": - - out.Values[i] = ec._ManagedService_metadata(ctx, field, obj) + out.Values[i] = ec._ManagedResourceKeyRef_mresName(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) @@ -24976,39 +43603,37 @@ func (ec *executionContext) _ManagedService(ctx context.Context, sel ast.Selecti return out } -var managedServiceSpecImplementors = []string{"ManagedServiceSpec"} +var managedResourceKeyValueRefImplementors = []string{"ManagedResourceKeyValueRef"} -func (ec *executionContext) _ManagedServiceSpec(ctx context.Context, sel ast.SelectionSet, obj *model.ManagedServiceSpec) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, managedServiceSpecImplementors) +func (ec *executionContext) _ManagedResourceKeyValueRef(ctx context.Context, sel ast.SelectionSet, obj *domain.ManagedResourceKeyValueRef) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, managedResourceKeyValueRefImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("ManagedServiceSpec") - case "inputs": - - out.Values[i] = ec._ManagedServiceSpec_inputs(ctx, field, obj) - - case "msvcKind": + out.Values[i] = graphql.MarshalString("ManagedResourceKeyValueRef") + case "key": - out.Values[i] = ec._ManagedServiceSpec_msvcKind(ctx, field, obj) + out.Values[i] = ec._ManagedResourceKeyValueRef_key(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "nodeSelector": - - out.Values[i] = ec._ManagedServiceSpec_nodeSelector(ctx, field, obj) - - case "region": + case "mresName": - out.Values[i] = ec._ManagedServiceSpec_region(ctx, field, obj) + out.Values[i] = ec._ManagedResourceKeyValueRef_mresName(ctx, field, obj) - case "tolerations": + if out.Values[i] == graphql.Null { + invalids++ + } + case "value": - out.Values[i] = ec._ManagedServiceSpec_tolerations(ctx, field, obj) + out.Values[i] = ec._ManagedResourceKeyValueRef_value(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -25020,23 +43645,33 @@ func (ec *executionContext) _ManagedServiceSpec(ctx context.Context, sel ast.Sel return out } -var managedServiceSpecMsvcKindImplementors = []string{"ManagedServiceSpecMsvcKind"} +var managedResourcePaginatedRecordsImplementors = []string{"ManagedResourcePaginatedRecords"} -func (ec *executionContext) _ManagedServiceSpecMsvcKind(ctx context.Context, sel ast.SelectionSet, obj *model.ManagedServiceSpecMsvcKind) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, managedServiceSpecMsvcKindImplementors) +func (ec *executionContext) _ManagedResourcePaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.ManagedResourcePaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, managedResourcePaginatedRecordsImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("ManagedServiceSpecMsvcKind") - case "kind": + out.Values[i] = graphql.MarshalString("ManagedResourcePaginatedRecords") + case "edges": - out.Values[i] = ec._ManagedServiceSpecMsvcKind_kind(ctx, field, obj) + out.Values[i] = ec._ManagedResourcePaginatedRecords_edges(ctx, field, obj) - case "apiVersion": + if out.Values[i] == graphql.Null { + invalids++ + } + case "pageInfo": + + out.Values[i] = ec._ManagedResourcePaginatedRecords_pageInfo(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "totalCount": - out.Values[i] = ec._ManagedServiceSpecMsvcKind_apiVersion(ctx, field, obj) + out.Values[i] = ec._ManagedResourcePaginatedRecords_totalCount(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -25052,35 +43687,34 @@ func (ec *executionContext) _ManagedServiceSpecMsvcKind(ctx context.Context, sel return out } -var managedServiceSpecTolerationsImplementors = []string{"ManagedServiceSpecTolerations"} +var matchFilterImplementors = []string{"MatchFilter"} -func (ec *executionContext) _ManagedServiceSpecTolerations(ctx context.Context, sel ast.SelectionSet, obj *model.ManagedServiceSpecTolerations) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, managedServiceSpecTolerationsImplementors) +func (ec *executionContext) _MatchFilter(ctx context.Context, sel ast.SelectionSet, obj *repos.MatchFilter) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, matchFilterImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("ManagedServiceSpecTolerations") - case "effect": - - out.Values[i] = ec._ManagedServiceSpecTolerations_effect(ctx, field, obj) + out.Values[i] = graphql.MarshalString("MatchFilter") + case "array": - case "key": - - out.Values[i] = ec._ManagedServiceSpecTolerations_key(ctx, field, obj) + out.Values[i] = ec._MatchFilter_array(ctx, field, obj) - case "operator": + case "exact": - out.Values[i] = ec._ManagedServiceSpecTolerations_operator(ctx, field, obj) + out.Values[i] = ec._MatchFilter_exact(ctx, field, obj) - case "tolerationSeconds": + case "matchType": - out.Values[i] = ec._ManagedServiceSpecTolerations_tolerationSeconds(ctx, field, obj) + out.Values[i] = ec._MatchFilter_matchType(ctx, field, obj) - case "value": + if out.Values[i] == graphql.Null { + invalids++ + } + case "regex": - out.Values[i] = ec._ManagedServiceSpecTolerations_value(ctx, field, obj) + out.Values[i] = ec._MatchFilter_regex(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -25095,7 +43729,7 @@ func (ec *executionContext) _ManagedServiceSpecTolerations(ctx context.Context, var metadataImplementors = []string{"Metadata"} -func (ec *executionContext) _Metadata(ctx context.Context, sel ast.SelectionSet, obj *v1.ObjectMeta) graphql.Marshaler { +func (ec *executionContext) _Metadata(ctx context.Context, sel ast.SelectionSet, obj *v12.ObjectMeta) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, metadataImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 @@ -25103,18 +43737,7 @@ func (ec *executionContext) _Metadata(ctx context.Context, sel ast.SelectionSet, switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Metadata") - case "name": - - out.Values[i] = ec._Metadata_name(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "namespace": - - out.Values[i] = ec._Metadata_namespace(ctx, field, obj) - - case "labels": + case "annotations": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -25123,7 +43746,7 @@ func (ec *executionContext) _Metadata(ctx context.Context, sel ast.SelectionSet, ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Metadata_labels(ctx, field, obj) + res = ec._Metadata_annotations(ctx, field, obj) return res } @@ -25131,7 +43754,7 @@ func (ec *executionContext) _Metadata(ctx context.Context, sel ast.SelectionSet, return innerFunc(ctx) }) - case "annotations": + case "creationTimestamp": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -25140,7 +43763,10 @@ func (ec *executionContext) _Metadata(ctx context.Context, sel ast.SelectionSet, ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Metadata_annotations(ctx, field, obj) + res = ec._Metadata_creationTimestamp(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res } @@ -25148,7 +43774,7 @@ func (ec *executionContext) _Metadata(ctx context.Context, sel ast.SelectionSet, return innerFunc(ctx) }) - case "creationTimestamp": + case "deletionTimestamp": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -25157,10 +43783,7 @@ func (ec *executionContext) _Metadata(ctx context.Context, sel ast.SelectionSet, ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Metadata_creationTimestamp(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } + res = ec._Metadata_deletionTimestamp(ctx, field, obj) return res } @@ -25168,7 +43791,14 @@ func (ec *executionContext) _Metadata(ctx context.Context, sel ast.SelectionSet, return innerFunc(ctx) }) - case "deletionTimestamp": + case "generation": + + out.Values[i] = ec._Metadata_generation(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "labels": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -25177,7 +43807,7 @@ func (ec *executionContext) _Metadata(ctx context.Context, sel ast.SelectionSet, ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Metadata_deletionTimestamp(ctx, field, obj) + res = ec._Metadata_labels(ctx, field, obj) return res } @@ -25185,13 +43815,17 @@ func (ec *executionContext) _Metadata(ctx context.Context, sel ast.SelectionSet, return innerFunc(ctx) }) - case "generation": + case "name": - out.Values[i] = ec._Metadata_generation(ctx, field, obj) + out.Values[i] = ec._Metadata_name(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } + case "namespace": + + out.Values[i] = ec._Metadata_namespace(ctx, field, obj) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -25243,22 +43877,43 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) if out.Values[i] == graphql.Null { invalids++ } - case "core_createWorkspace": + case "core_createEnvironment": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_createEnvironment(ctx, field) + }) + + case "core_updateEnvironment": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_updateEnvironment(ctx, field) + }) + + case "core_deleteEnvironment": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_deleteEnvironment(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "core_cloneEnvironment": out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_createWorkspace(ctx, field) + return ec._Mutation_core_cloneEnvironment(ctx, field) }) - case "core_updateWorkspace": + case "core_createImagePullSecret": out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_updateWorkspace(ctx, field) + return ec._Mutation_core_createImagePullSecret(ctx, field) }) - case "core_deleteWorkspace": + case "core_deleteImagePullSecret": out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_deleteWorkspace(ctx, field) + return ec._Mutation_core_deleteImagePullSecret(ctx, field) }) if out.Values[i] == graphql.Null { @@ -25282,6 +43937,15 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) return ec._Mutation_core_deleteApp(ctx, field) }) + if out.Values[i] == graphql.Null { + invalids++ + } + case "core_interceptApp": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_interceptApp(ctx, field) + }) + if out.Values[i] == graphql.Null { invalids++ } @@ -25297,99 +43961,389 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) return ec._Mutation_core_updateConfig(ctx, field) }) - case "core_deleteConfig": + case "core_deleteConfig": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_deleteConfig(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "core_createSecret": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_createSecret(ctx, field) + }) + + case "core_updateSecret": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_updateSecret(ctx, field) + }) + + case "core_deleteSecret": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_deleteSecret(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "core_createRouter": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_createRouter(ctx, field) + }) + + case "core_updateRouter": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_updateRouter(ctx, field) + }) + + case "core_deleteRouter": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_deleteRouter(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "core_createManagedResource": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_createManagedResource(ctx, field) + }) + + case "core_updateManagedResource": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_updateManagedResource(ctx, field) + }) + + case "core_deleteManagedResource": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_deleteManagedResource(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "core_createProjectManagedService": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_createProjectManagedService(ctx, field) + }) + + case "core_updateProjectManagedService": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_updateProjectManagedService(ctx, field) + }) + + case "core_deleteProjectManagedService": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_deleteProjectManagedService(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "core_createVPNDevice": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_createVPNDevice(ctx, field) + }) + + case "core_updateVPNDevice": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_updateVPNDevice(ctx, field) + }) + + case "core_updateVPNDevicePorts": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_updateVPNDevicePorts(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "core_updateVPNDeviceEnv": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_updateVPNDeviceEnv(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "core_updateVpnDeviceNs": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_updateVpnDeviceNs(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "core_updateVpnClusterName": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_updateVpnClusterName(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "core_deleteVPNDevice": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_deleteVPNDevice(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var pageInfoImplementors = []string{"PageInfo"} + +func (ec *executionContext) _PageInfo(ctx context.Context, sel ast.SelectionSet, obj *model.PageInfo) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, pageInfoImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("PageInfo") + case "endCursor": + + out.Values[i] = ec._PageInfo_endCursor(ctx, field, obj) + + case "hasNextPage": + + out.Values[i] = ec._PageInfo_hasNextPage(ctx, field, obj) + + case "hasPreviousPage": + + out.Values[i] = ec._PageInfo_hasPreviousPage(ctx, field, obj) + + case "startCursor": + + out.Values[i] = ec._PageInfo_startCursor(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var portImplementors = []string{"Port"} + +func (ec *executionContext) _Port(ctx context.Context, sel ast.SelectionSet, obj *model.Port) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, portImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Port") + case "port": + + out.Values[i] = ec._Port_port(ctx, field, obj) + + case "targetPort": + + out.Values[i] = ec._Port_targetPort(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var projectImplementors = []string{"Project"} + +func (ec *executionContext) _Project(ctx context.Context, sel ast.SelectionSet, obj *entities.Project) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, projectImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Project") + case "accountName": + + out.Values[i] = ec._Project_accountName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "apiVersion": + + out.Values[i] = ec._Project_apiVersion(ctx, field, obj) + + case "clusterName": + + out.Values[i] = ec._Project_clusterName(ctx, field, obj) + + case "createdBy": + + out.Values[i] = ec._Project_createdBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "creationTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Project_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_deleteConfig(ctx, field) }) + case "displayName": + + out.Values[i] = ec._Project_displayName(ctx, field, obj) if out.Values[i] == graphql.Null { - invalids++ + atomic.AddUint32(&invalids, 1) } - case "core_createSecret": + case "id": + field := field - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_createSecret(ctx, field) - }) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Project_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } - case "core_updateSecret": + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_updateSecret(ctx, field) }) + case "kind": - case "core_deleteSecret": + out.Values[i] = ec._Project_kind(ctx, field, obj) - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_deleteSecret(ctx, field) - }) + case "lastUpdatedBy": + + out.Values[i] = ec._Project_lastUpdatedBy(ctx, field, obj) if out.Values[i] == graphql.Null { - invalids++ + atomic.AddUint32(&invalids, 1) } - case "core_createRouter": + case "markedForDeletion": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_createRouter(ctx, field) - }) + out.Values[i] = ec._Project_markedForDeletion(ctx, field, obj) - case "core_updateRouter": + case "metadata": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_updateRouter(ctx, field) - }) + out.Values[i] = ec._Project_metadata(ctx, field, obj) - case "core_deleteRouter": + case "recordVersion": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_deleteRouter(ctx, field) - }) + out.Values[i] = ec._Project_recordVersion(ctx, field, obj) if out.Values[i] == graphql.Null { - invalids++ + atomic.AddUint32(&invalids, 1) } - case "core_createManagedService": + case "spec": + field := field - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_createManagedService(ctx, field) - }) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Project_spec(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } - case "core_updateManagedService": + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_updateManagedService(ctx, field) }) + case "status": - case "core_deleteManagedService": + out.Values[i] = ec._Project_status(ctx, field, obj) - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_deleteManagedService(ctx, field) - }) + case "syncStatus": + + out.Values[i] = ec._Project_syncStatus(ctx, field, obj) if out.Values[i] == graphql.Null { - invalids++ + atomic.AddUint32(&invalids, 1) } - case "core_createManagedResource": - - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_createManagedResource(ctx, field) - }) - - case "core_updateManagedResource": + case "updateTime": + field := field - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_updateManagedResource(ctx, field) - }) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Project_updateTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } - case "core_deleteManagedResource": + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_deleteManagedResource(ctx, field) }) - - if out.Values[i] == graphql.Null { - invalids++ - } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -25401,24 +44355,30 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) return out } -var overridesImplementors = []string{"Overrides"} +var projectEdgeImplementors = []string{"ProjectEdge"} -func (ec *executionContext) _Overrides(ctx context.Context, sel ast.SelectionSet, obj *v11.JsonPatch) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, overridesImplementors) +func (ec *executionContext) _ProjectEdge(ctx context.Context, sel ast.SelectionSet, obj *model.ProjectEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, projectEdgeImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Overrides") - case "applied": + out.Values[i] = graphql.MarshalString("ProjectEdge") + case "cursor": - out.Values[i] = ec._Overrides_applied(ctx, field, obj) + out.Values[i] = ec._ProjectEdge_cursor(ctx, field, obj) - case "patches": + if out.Values[i] == graphql.Null { + invalids++ + } + case "node": - out.Values[i] = ec._Overrides_patches(ctx, field, obj) + out.Values[i] = ec._ProjectEdge_node(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -25430,31 +44390,35 @@ func (ec *executionContext) _Overrides(ctx context.Context, sel ast.SelectionSet return out } -var patchImplementors = []string{"Patch"} +var projectManagedServiceImplementors = []string{"ProjectManagedService"} -func (ec *executionContext) _Patch(ctx context.Context, sel ast.SelectionSet, obj *json_patch.PatchOperation) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, patchImplementors) +func (ec *executionContext) _ProjectManagedService(ctx context.Context, sel ast.SelectionSet, obj *entities.ProjectManagedService) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, projectManagedServiceImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Patch") - case "op": + out.Values[i] = graphql.MarshalString("ProjectManagedService") + case "accountName": - out.Values[i] = ec._Patch_op(ctx, field, obj) + out.Values[i] = ec._ProjectManagedService_accountName(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - case "path": + case "apiVersion": - out.Values[i] = ec._Patch_path(ctx, field, obj) + out.Values[i] = ec._ProjectManagedService_apiVersion(ctx, field, obj) + + case "createdBy": + + out.Values[i] = ec._ProjectManagedService_createdBy(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - case "value": + case "creationTime": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -25463,7 +44427,10 @@ func (ec *executionContext) _Patch(ctx context.Context, sel ast.SelectionSet, ob ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Patch_value(ctx, field, obj) + res = ec._ProjectManagedService_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res } @@ -25471,46 +44438,66 @@ func (ec *executionContext) _Patch(ctx context.Context, sel ast.SelectionSet, ob return innerFunc(ctx) }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} + case "displayName": -var projectImplementors = []string{"Project"} + out.Values[i] = ec._ProjectManagedService_displayName(ctx, field, obj) -func (ec *executionContext) _Project(ctx context.Context, sel ast.SelectionSet, obj *entities.Project) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, projectImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Project") - case "apiVersion": + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "id": + field := field - out.Values[i] = ec._Project_apiVersion(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ProjectManagedService_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + }) case "kind": - out.Values[i] = ec._Project_kind(ctx, field, obj) + out.Values[i] = ec._ProjectManagedService_kind(ctx, field, obj) + + case "lastUpdatedBy": + + out.Values[i] = ec._ProjectManagedService_lastUpdatedBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "markedForDeletion": + + out.Values[i] = ec._ProjectManagedService_markedForDeletion(ctx, field, obj) case "metadata": - out.Values[i] = ec._Project_metadata(ctx, field, obj) + out.Values[i] = ec._ProjectManagedService_metadata(ctx, field, obj) + + case "projectName": + + out.Values[i] = ec._ProjectManagedService_projectName(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - case "syncStatus": + case "recordVersion": - out.Values[i] = ec._Project_syncStatus(ctx, field, obj) + out.Values[i] = ec._ProjectManagedService_recordVersion(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } case "spec": field := field @@ -25520,7 +44507,7 @@ func (ec *executionContext) _Project(ctx context.Context, sel ast.SelectionSet, ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Project_spec(ctx, field, obj) + res = ec._ProjectManagedService_spec(ctx, field, obj) return res } @@ -25530,8 +44517,35 @@ func (ec *executionContext) _Project(ctx context.Context, sel ast.SelectionSet, }) case "status": - out.Values[i] = ec._Project_status(ctx, field, obj) + out.Values[i] = ec._ProjectManagedService_status(ctx, field, obj) + + case "syncStatus": + out.Values[i] = ec._ProjectManagedService_syncStatus(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "updateTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ProjectManagedService_updateTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -25543,41 +44557,110 @@ func (ec *executionContext) _Project(ctx context.Context, sel ast.SelectionSet, return out } -var projectSpecImplementors = []string{"ProjectSpec"} +var projectManagedServiceEdgeImplementors = []string{"ProjectManagedServiceEdge"} -func (ec *executionContext) _ProjectSpec(ctx context.Context, sel ast.SelectionSet, obj *model.ProjectSpec) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, projectSpecImplementors) +func (ec *executionContext) _ProjectManagedServiceEdge(ctx context.Context, sel ast.SelectionSet, obj *model.ProjectManagedServiceEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, projectManagedServiceEdgeImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("ProjectSpec") - case "displayName": + out.Values[i] = graphql.MarshalString("ProjectManagedServiceEdge") + case "cursor": - out.Values[i] = ec._ProjectSpec_displayName(ctx, field, obj) + out.Values[i] = ec._ProjectManagedServiceEdge_cursor(ctx, field, obj) - case "logo": + if out.Values[i] == graphql.Null { + invalids++ + } + case "node": - out.Values[i] = ec._ProjectSpec_logo(ctx, field, obj) + out.Values[i] = ec._ProjectManagedServiceEdge_node(ctx, field, obj) - case "targetNamespace": + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} - out.Values[i] = ec._ProjectSpec_targetNamespace(ctx, field, obj) +var projectManagedServicePaginatedRecordsImplementors = []string{"ProjectManagedServicePaginatedRecords"} + +func (ec *executionContext) _ProjectManagedServicePaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.ProjectManagedServicePaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, projectManagedServicePaginatedRecordsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ProjectManagedServicePaginatedRecords") + case "edges": + + out.Values[i] = ec._ProjectManagedServicePaginatedRecords_edges(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "accountName": + case "pageInfo": - out.Values[i] = ec._ProjectSpec_accountName(ctx, field, obj) + out.Values[i] = ec._ProjectManagedServicePaginatedRecords_pageInfo(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "clusterName": + case "totalCount": + + out.Values[i] = ec._ProjectManagedServicePaginatedRecords_totalCount(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} - out.Values[i] = ec._ProjectSpec_clusterName(ctx, field, obj) +var projectPaginatedRecordsImplementors = []string{"ProjectPaginatedRecords"} + +func (ec *executionContext) _ProjectPaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.ProjectPaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, projectPaginatedRecordsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ProjectPaginatedRecords") + case "edges": + + out.Values[i] = ec._ProjectPaginatedRecords_edges(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "pageInfo": + + out.Values[i] = ec._ProjectPaginatedRecords_pageInfo(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "totalCount": + + out.Values[i] = ec._ProjectPaginatedRecords_totalCount(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -25698,7 +44781,70 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr out.Concurrently(i, func() graphql.Marshaler { return rrm(innerCtx) }) - case "core_listWorkspaces": + case "core_listEnvironments": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_core_listEnvironments(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "core_getEnvironment": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_core_getEnvironment(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "core_resyncEnvironment": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_core_resyncEnvironment(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "core_listImagePullSecrets": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -25707,7 +44853,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_core_listWorkspaces(ctx, field) + res = ec._Query_core_listImagePullSecrets(ctx, field) return res } @@ -25718,7 +44864,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr out.Concurrently(i, func() graphql.Marshaler { return rrm(innerCtx) }) - case "core_getWorkspace": + case "core_getImagePullSecret": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -25727,7 +44873,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_core_getWorkspace(ctx, field) + res = ec._Query_core_getImagePullSecret(ctx, field) return res } @@ -25738,7 +44884,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr out.Concurrently(i, func() graphql.Marshaler { return rrm(innerCtx) }) - case "core_resyncWorkspace": + case "core_resyncImagePullSecret": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -25747,7 +44893,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_core_resyncWorkspace(ctx, field) + res = ec._Query_core_resyncImagePullSecret(ctx, field) if res == graphql.Null { atomic.AddUint32(&invalids, 1) } @@ -25801,7 +44947,196 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr out.Concurrently(i, func() graphql.Marshaler { return rrm(innerCtx) }) - case "core_resyncApp": + case "core_resyncApp": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_core_resyncApp(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "core_restartApp": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_core_restartApp(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "core_getConfigValues": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_core_getConfigValues(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "core_listConfigs": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_core_listConfigs(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "core_getConfig": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_core_getConfig(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "core_resyncConfig": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_core_resyncConfig(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "core_getSecretValues": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_core_getSecretValues(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "core_listSecrets": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_core_listSecrets(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "core_getSecret": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_core_getSecret(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "core_resyncSecret": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -25810,7 +45145,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_core_resyncApp(ctx, field) + res = ec._Query_core_resyncSecret(ctx, field) if res == graphql.Null { atomic.AddUint32(&invalids, 1) } @@ -25824,7 +45159,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr out.Concurrently(i, func() graphql.Marshaler { return rrm(innerCtx) }) - case "core_listConfigs": + case "core_listRouters": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -25833,7 +45168,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_core_listConfigs(ctx, field) + res = ec._Query_core_listRouters(ctx, field) return res } @@ -25844,7 +45179,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr out.Concurrently(i, func() graphql.Marshaler { return rrm(innerCtx) }) - case "core_getConfig": + case "core_getRouter": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -25853,7 +45188,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_core_getConfig(ctx, field) + res = ec._Query_core_getRouter(ctx, field) return res } @@ -25864,7 +45199,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr out.Concurrently(i, func() graphql.Marshaler { return rrm(innerCtx) }) - case "core_resyncConfig": + case "core_resyncRouter": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -25873,7 +45208,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_core_resyncConfig(ctx, field) + res = ec._Query_core_resyncRouter(ctx, field) if res == graphql.Null { atomic.AddUint32(&invalids, 1) } @@ -25887,7 +45222,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr out.Concurrently(i, func() graphql.Marshaler { return rrm(innerCtx) }) - case "core_listSecrets": + case "core_getManagedResouceOutputKeys": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -25896,7 +45231,10 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_core_listSecrets(ctx, field) + res = ec._Query_core_getManagedResouceOutputKeys(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res } @@ -25907,7 +45245,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr out.Concurrently(i, func() graphql.Marshaler { return rrm(innerCtx) }) - case "core_getSecret": + case "core_getManagedResouceOutputKeyValues": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -25916,7 +45254,10 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_core_getSecret(ctx, field) + res = ec._Query_core_getManagedResouceOutputKeyValues(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res } @@ -25927,7 +45268,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr out.Concurrently(i, func() graphql.Marshaler { return rrm(innerCtx) }) - case "core_resyncSecret": + case "core_listManagedResources": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -25936,10 +45277,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_core_resyncSecret(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } + res = ec._Query_core_listManagedResources(ctx, field) return res } @@ -25950,7 +45288,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr out.Concurrently(i, func() graphql.Marshaler { return rrm(innerCtx) }) - case "core_listRouters": + case "core_getManagedResource": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -25959,7 +45297,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_core_listRouters(ctx, field) + res = ec._Query_core_getManagedResource(ctx, field) return res } @@ -25970,7 +45308,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr out.Concurrently(i, func() graphql.Marshaler { return rrm(innerCtx) }) - case "core_getRouter": + case "core_resyncManagedResource": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -25979,7 +45317,10 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_core_getRouter(ctx, field) + res = ec._Query_core_resyncManagedResource(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res } @@ -25990,7 +45331,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr out.Concurrently(i, func() graphql.Marshaler { return rrm(innerCtx) }) - case "core_resyncRouter": + case "core_listProjectManagedServices": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -25999,10 +45340,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_core_resyncRouter(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } + res = ec._Query_core_listProjectManagedServices(ctx, field) return res } @@ -26013,7 +45351,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr out.Concurrently(i, func() graphql.Marshaler { return rrm(innerCtx) }) - case "core_listManagedServices": + case "core_getProjectManagedService": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -26022,7 +45360,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_core_listManagedServices(ctx, field) + res = ec._Query_core_getProjectManagedService(ctx, field) return res } @@ -26033,7 +45371,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr out.Concurrently(i, func() graphql.Marshaler { return rrm(innerCtx) }) - case "core_getManagedService": + case "core_resyncProjectManagedService": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -26042,7 +45380,10 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_core_getManagedService(ctx, field) + res = ec._Query_core_resyncProjectManagedService(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res } @@ -26053,7 +45394,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr out.Concurrently(i, func() graphql.Marshaler { return rrm(innerCtx) }) - case "core_resyncManagedService": + case "core_restartProjectManagedService": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -26062,7 +45403,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_core_resyncManagedService(ctx, field) + res = ec._Query_core_restartProjectManagedService(ctx, field) if res == graphql.Null { atomic.AddUint32(&invalids, 1) } @@ -26076,7 +45417,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr out.Concurrently(i, func() graphql.Marshaler { return rrm(innerCtx) }) - case "core_listManagedResources": + case "core_listVPNDevices": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -26085,7 +45426,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_core_listManagedResources(ctx, field) + res = ec._Query_core_listVPNDevices(ctx, field) return res } @@ -26096,7 +45437,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr out.Concurrently(i, func() graphql.Marshaler { return rrm(innerCtx) }) - case "core_getManagedResource": + case "core_listVPNDevicesForUser": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -26105,7 +45446,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_core_getManagedResource(ctx, field) + res = ec._Query_core_listVPNDevicesForUser(ctx, field) return res } @@ -26116,7 +45457,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr out.Concurrently(i, func() graphql.Marshaler { return rrm(innerCtx) }) - case "core_resyncManagedResource": + case "core_getVPNDevice": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -26125,10 +45466,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_core_resyncManagedResource(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } + res = ec._Query_core_getVPNDevice(ctx, field) return res } @@ -26195,29 +45533,115 @@ func (ec *executionContext) _Router(ctx context.Context, sel ast.SelectionSet, o switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Router") + case "accountName": + + out.Values[i] = ec._Router_accountName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } case "apiVersion": out.Values[i] = ec._Router_apiVersion(ctx, field, obj) + case "createdBy": + + out.Values[i] = ec._Router_createdBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "creationTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Router_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "displayName": + + out.Values[i] = ec._Router_displayName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "enabled": + + out.Values[i] = ec._Router_enabled(ctx, field, obj) + + case "environmentName": + + out.Values[i] = ec._Router_environmentName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "id": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Router_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) case "kind": out.Values[i] = ec._Router_kind(ctx, field, obj) - case "metadata": + case "lastUpdatedBy": - out.Values[i] = ec._Router_metadata(ctx, field, obj) + out.Values[i] = ec._Router_lastUpdatedBy(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - case "overrides": + case "markedForDeletion": - out.Values[i] = ec._Router_overrides(ctx, field, obj) + out.Values[i] = ec._Router_markedForDeletion(ctx, field, obj) - case "syncStatus": + case "metadata": - out.Values[i] = ec._Router_syncStatus(ctx, field, obj) + out.Values[i] = ec._Router_metadata(ctx, field, obj) + + case "projectName": + + out.Values[i] = ec._Router_projectName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "recordVersion": + out.Values[i] = ec._Router_recordVersion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } case "spec": field := field @@ -26228,6 +45652,9 @@ func (ec *executionContext) _Router(ctx context.Context, sel ast.SelectionSet, o } }() res = ec._Router_spec(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res } @@ -26239,6 +45666,33 @@ func (ec *executionContext) _Router(ctx context.Context, sel ast.SelectionSet, o out.Values[i] = ec._Router_status(ctx, field, obj) + case "syncStatus": + + out.Values[i] = ec._Router_syncStatus(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "updateTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Router_updateTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -26250,59 +45704,350 @@ func (ec *executionContext) _Router(ctx context.Context, sel ast.SelectionSet, o return out } -var routerSpecImplementors = []string{"RouterSpec"} +var routerEdgeImplementors = []string{"RouterEdge"} -func (ec *executionContext) _RouterSpec(ctx context.Context, sel ast.SelectionSet, obj *model.RouterSpec) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, routerSpecImplementors) +func (ec *executionContext) _RouterEdge(ctx context.Context, sel ast.SelectionSet, obj *model.RouterEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, routerEdgeImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("RouterSpec") - case "cors": + out.Values[i] = graphql.MarshalString("RouterEdge") + case "cursor": - out.Values[i] = ec._RouterSpec_cors(ctx, field, obj) + out.Values[i] = ec._RouterEdge_cursor(ctx, field, obj) - case "ingressClass": + if out.Values[i] == graphql.Null { + invalids++ + } + case "node": - out.Values[i] = ec._RouterSpec_ingressClass(ctx, field, obj) + out.Values[i] = ec._RouterEdge_node(ctx, field, obj) - case "maxBodySizeInMB": + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} - out.Values[i] = ec._RouterSpec_maxBodySizeInMB(ctx, field, obj) +var routerPaginatedRecordsImplementors = []string{"RouterPaginatedRecords"} - case "region": +func (ec *executionContext) _RouterPaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.RouterPaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, routerPaginatedRecordsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("RouterPaginatedRecords") + case "edges": - out.Values[i] = ec._RouterSpec_region(ctx, field, obj) + out.Values[i] = ec._RouterPaginatedRecords_edges(ctx, field, obj) - case "routes": + if out.Values[i] == graphql.Null { + invalids++ + } + case "pageInfo": - out.Values[i] = ec._RouterSpec_routes(ctx, field, obj) + out.Values[i] = ec._RouterPaginatedRecords_pageInfo(ctx, field, obj) - case "backendProtocol": + if out.Values[i] == graphql.Null { + invalids++ + } + case "totalCount": - out.Values[i] = ec._RouterSpec_backendProtocol(ctx, field, obj) + out.Values[i] = ec._RouterPaginatedRecords_totalCount(ctx, field, obj) - case "basicAuth": + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} - out.Values[i] = ec._RouterSpec_basicAuth(ctx, field, obj) +var secretImplementors = []string{"Secret"} - case "domains": +func (ec *executionContext) _Secret(ctx context.Context, sel ast.SelectionSet, obj *entities.Secret) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, secretImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Secret") + case "accountName": + + out.Values[i] = ec._Secret_accountName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "apiVersion": + + out.Values[i] = ec._Secret_apiVersion(ctx, field, obj) + + case "createdBy": + + out.Values[i] = ec._Secret_createdBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "creationTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Secret_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) - out.Values[i] = ec._RouterSpec_domains(ctx, field, obj) + }) + case "data": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Secret_data(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "displayName": + + out.Values[i] = ec._Secret_displayName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "environmentName": + + out.Values[i] = ec._Secret_environmentName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "id": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Secret_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "immutable": + + out.Values[i] = ec._Secret_immutable(ctx, field, obj) + + case "kind": + + out.Values[i] = ec._Secret_kind(ctx, field, obj) + + case "lastUpdatedBy": + + out.Values[i] = ec._Secret_lastUpdatedBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "markedForDeletion": + + out.Values[i] = ec._Secret_markedForDeletion(ctx, field, obj) + + case "metadata": + + out.Values[i] = ec._Secret_metadata(ctx, field, obj) + + case "projectName": + + out.Values[i] = ec._Secret_projectName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "recordVersion": + + out.Values[i] = ec._Secret_recordVersion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "stringData": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Secret_stringData(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "syncStatus": + + out.Values[i] = ec._Secret_syncStatus(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "type": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Secret_type(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "updateTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Secret_updateTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var secretEdgeImplementors = []string{"SecretEdge"} + +func (ec *executionContext) _SecretEdge(ctx context.Context, sel ast.SelectionSet, obj *model.SecretEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, secretEdgeImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("SecretEdge") + case "cursor": + + out.Values[i] = ec._SecretEdge_cursor(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "https": + case "node": - out.Values[i] = ec._RouterSpec_https(ctx, field, obj) + out.Values[i] = ec._SecretEdge_node(ctx, field, obj) - case "rateLimit": + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var secretKeyRefImplementors = []string{"SecretKeyRef"} + +func (ec *executionContext) _SecretKeyRef(ctx context.Context, sel ast.SelectionSet, obj *model.SecretKeyRef) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, secretKeyRefImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("SecretKeyRef") + case "key": - out.Values[i] = ec._RouterSpec_rateLimit(ctx, field, obj) + out.Values[i] = ec._SecretKeyRef_key(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "secretName": + + out.Values[i] = ec._SecretKeyRef_secretName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -26314,31 +46059,37 @@ func (ec *executionContext) _RouterSpec(ctx context.Context, sel ast.SelectionSe return out } -var routerSpecBasicAuthImplementors = []string{"RouterSpecBasicAuth"} +var secretKeyValueRefImplementors = []string{"SecretKeyValueRef"} -func (ec *executionContext) _RouterSpecBasicAuth(ctx context.Context, sel ast.SelectionSet, obj *model.RouterSpecBasicAuth) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, routerSpecBasicAuthImplementors) +func (ec *executionContext) _SecretKeyValueRef(ctx context.Context, sel ast.SelectionSet, obj *domain.SecretKeyValueRef) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, secretKeyValueRefImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("RouterSpecBasicAuth") - case "enabled": + out.Values[i] = graphql.MarshalString("SecretKeyValueRef") + case "key": - out.Values[i] = ec._RouterSpecBasicAuth_enabled(ctx, field, obj) + out.Values[i] = ec._SecretKeyValueRef_key(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "secretName": - out.Values[i] = ec._RouterSpecBasicAuth_secretName(ctx, field, obj) + out.Values[i] = ec._SecretKeyValueRef_secretName(ctx, field, obj) - case "username": + if out.Values[i] == graphql.Null { + invalids++ + } + case "value": - out.Values[i] = ec._RouterSpecBasicAuth_username(ctx, field, obj) + out.Values[i] = ec._SecretKeyValueRef_value(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -26350,28 +46101,37 @@ func (ec *executionContext) _RouterSpecBasicAuth(ctx context.Context, sel ast.Se return out } -var routerSpecCorsImplementors = []string{"RouterSpecCors"} +var secretPaginatedRecordsImplementors = []string{"SecretPaginatedRecords"} -func (ec *executionContext) _RouterSpecCors(ctx context.Context, sel ast.SelectionSet, obj *model.RouterSpecCors) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, routerSpecCorsImplementors) +func (ec *executionContext) _SecretPaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.SecretPaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, secretPaginatedRecordsImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("RouterSpecCors") - case "allowCredentials": + out.Values[i] = graphql.MarshalString("SecretPaginatedRecords") + case "edges": - out.Values[i] = ec._RouterSpecCors_allowCredentials(ctx, field, obj) + out.Values[i] = ec._SecretPaginatedRecords_edges(ctx, field, obj) - case "enabled": + if out.Values[i] == graphql.Null { + invalids++ + } + case "pageInfo": - out.Values[i] = ec._RouterSpecCors_enabled(ctx, field, obj) + out.Values[i] = ec._SecretPaginatedRecords_pageInfo(ctx, field, obj) - case "origins": + if out.Values[i] == graphql.Null { + invalids++ + } + case "totalCount": - out.Values[i] = ec._RouterSpecCors_origins(ctx, field, obj) + out.Values[i] = ec._SecretPaginatedRecords_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -26383,31 +46143,73 @@ func (ec *executionContext) _RouterSpecCors(ctx context.Context, sel ast.Selecti return out } -var routerSpecHttpsImplementors = []string{"RouterSpecHttps"} +var _ServiceImplementors = []string{"_Service"} -func (ec *executionContext) _RouterSpecHttps(ctx context.Context, sel ast.SelectionSet, obj *model.RouterSpecHTTPS) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, routerSpecHttpsImplementors) +func (ec *executionContext) __Service(ctx context.Context, sel ast.SelectionSet, obj *fedruntime.Service) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, _ServiceImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("RouterSpecHttps") - case "clusterIssuer": + out.Values[i] = graphql.MarshalString("_Service") + case "sdl": - out.Values[i] = ec._RouterSpecHttps_clusterIssuer(ctx, field, obj) + out.Values[i] = ec.__Service_sdl(ctx, field, obj) - case "enabled": + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + 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) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Directive") + case "name": + + out.Values[i] = ec.___Directive_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "description": + + out.Values[i] = ec.___Directive_description(ctx, field, obj) + + case "locations": - out.Values[i] = ec._RouterSpecHttps_enabled(ctx, field, obj) + out.Values[i] = ec.___Directive_locations(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "args": + + out.Values[i] = ec.___Directive_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "forceRedirect": + case "isRepeatable": - out.Values[i] = ec._RouterSpecHttps_forceRedirect(ctx, field, obj) + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -26419,31 +46221,37 @@ func (ec *executionContext) _RouterSpecHttps(ctx context.Context, sel ast.Select return out } -var routerSpecRateLimitImplementors = []string{"RouterSpecRateLimit"} +var __EnumValueImplementors = []string{"__EnumValue"} -func (ec *executionContext) _RouterSpecRateLimit(ctx context.Context, sel ast.SelectionSet, obj *model.RouterSpecRateLimit) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, routerSpecRateLimitImplementors) +func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("RouterSpecRateLimit") - case "connections": + out.Values[i] = graphql.MarshalString("__EnumValue") + case "name": - out.Values[i] = ec._RouterSpecRateLimit_connections(ctx, field, obj) + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) - case "enabled": + if out.Values[i] == graphql.Null { + invalids++ + } + case "description": - out.Values[i] = ec._RouterSpecRateLimit_enabled(ctx, field, obj) + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) - case "rpm": + case "isDeprecated": - out.Values[i] = ec._RouterSpecRateLimit_rpm(ctx, field, obj) + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) - case "rps": + if out.Values[i] == graphql.Null { + invalids++ + } + case "deprecationReason": - out.Values[i] = ec._RouterSpecRateLimit_rps(ctx, field, obj) + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -26456,41 +46264,51 @@ func (ec *executionContext) _RouterSpecRateLimit(ctx context.Context, sel ast.Se return out } -var routerSpecRoutesImplementors = []string{"RouterSpecRoutes"} +var __FieldImplementors = []string{"__Field"} -func (ec *executionContext) _RouterSpecRoutes(ctx context.Context, sel ast.SelectionSet, obj *model.RouterSpecRoutes) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, routerSpecRoutesImplementors) +func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("RouterSpecRoutes") - case "app": + out.Values[i] = graphql.MarshalString("__Field") + case "name": - out.Values[i] = ec._RouterSpecRoutes_app(ctx, field, obj) + out.Values[i] = ec.___Field_name(ctx, field, obj) - case "lambda": + if out.Values[i] == graphql.Null { + invalids++ + } + case "description": - out.Values[i] = ec._RouterSpecRoutes_lambda(ctx, field, obj) + out.Values[i] = ec.___Field_description(ctx, field, obj) - case "path": + case "args": - out.Values[i] = ec._RouterSpecRoutes_path(ctx, field, obj) + out.Values[i] = ec.___Field_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "port": + case "type": - out.Values[i] = ec._RouterSpecRoutes_port(ctx, field, obj) + out.Values[i] = ec.___Field_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "rewrite": + case "isDeprecated": + + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "deprecationReason": - out.Values[i] = ec._RouterSpecRoutes_rewrite(ctx, field, obj) + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -26503,102 +46321,38 @@ func (ec *executionContext) _RouterSpecRoutes(ctx context.Context, sel ast.Selec return out } -var secretImplementors = []string{"Secret"} +var __InputValueImplementors = []string{"__InputValue"} -func (ec *executionContext) _Secret(ctx context.Context, sel ast.SelectionSet, obj *entities.Secret) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, secretImplementors) +func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Secret") - case "syncStatus": - - out.Values[i] = ec._Secret_syncStatus(ctx, field, obj) - - case "data": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Secret_data(ctx, field, obj) - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "enabled": - - out.Values[i] = ec._Secret_enabled(ctx, field, obj) - - case "kind": - - out.Values[i] = ec._Secret_kind(ctx, field, obj) - - case "metadata": + out.Values[i] = graphql.MarshalString("__InputValue") + case "name": - out.Values[i] = ec._Secret_metadata(ctx, field, obj) + out.Values[i] = ec.___InputValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "projectName": - - out.Values[i] = ec._Secret_projectName(ctx, field, obj) - - case "status": - - out.Values[i] = ec._Secret_status(ctx, field, obj) - - case "apiVersion": - - out.Values[i] = ec._Secret_apiVersion(ctx, field, obj) - - case "overrides": - - out.Values[i] = ec._Secret_overrides(ctx, field, obj) - - case "stringData": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Secret_stringData(ctx, field, obj) - return res + invalids++ } + case "description": - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + out.Values[i] = ec.___InputValue_description(ctx, field, obj) - }) case "type": - field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Secret_type(ctx, field, obj) - return res + out.Values[i] = ec.___InputValue_type(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } + case "defaultValue": - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) - }) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -26610,57 +46364,49 @@ func (ec *executionContext) _Secret(ctx context.Context, sel ast.SelectionSet, o return out } -var statusImplementors = []string{"Status"} +var __SchemaImplementors = []string{"__Schema"} -func (ec *executionContext) _Status(ctx context.Context, sel ast.SelectionSet, obj *operator.Status) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, statusImplementors) +func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Status") - case "isReady": + out.Values[i] = graphql.MarshalString("__Schema") + case "description": + + out.Values[i] = ec.___Schema_description(ctx, field, obj) + + case "types": - out.Values[i] = ec._Status_isReady(ctx, field, obj) + out.Values[i] = ec.___Schema_types(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + invalids++ } - case "checks": - field := field + case "queryType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Status_checks(ctx, field, obj) - return res + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } + case "mutationType": - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) - }) - case "displayVars": - field := field + case "subscriptionType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Status_displayVars(ctx, field, obj) - return res - } + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + case "directives": - }) + out.Values[i] = ec.___Schema_directives(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -26672,77 +46418,58 @@ func (ec *executionContext) _Status(ctx context.Context, sel ast.SelectionSet, o return out } -var syncStatusImplementors = []string{"SyncStatus"} +var __TypeImplementors = []string{"__Type"} -func (ec *executionContext) _SyncStatus(ctx context.Context, sel ast.SelectionSet, obj *types.SyncStatus) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, syncStatusImplementors) +func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("SyncStatus") - case "syncScheduledAt": - field := field + out.Values[i] = graphql.MarshalString("__Type") + case "kind": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._SyncStatus_syncScheduledAt(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res + out.Values[i] = ec.___Type_kind(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } + case "name": - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + out.Values[i] = ec.___Type_name(ctx, field, obj) - }) - case "lastSyncedAt": - field := field + case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._SyncStatus_lastSyncedAt(ctx, field, obj) - return res - } + out.Values[i] = ec.___Type_description(ctx, field, obj) - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + case "fields": - }) - case "action": + out.Values[i] = ec.___Type_fields(ctx, field, obj) - out.Values[i] = ec._SyncStatus_action(ctx, field, obj) + case "interfaces": - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "generation": + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) - out.Values[i] = ec._SyncStatus_generation(ctx, field, obj) + case "possibleTypes": - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "state": + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) + + case "enumValues": - out.Values[i] = ec._SyncStatus_state(ctx, field, obj) + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "error": + 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._SyncStatus_error(ctx, field, obj) + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -26755,461 +46482,826 @@ func (ec *executionContext) _SyncStatus(ctx context.Context, sel ast.SelectionSe return out } -var workspaceImplementors = []string{"Workspace"} +// endregion **************************** object.gotpl **************************** -func (ec *executionContext) _Workspace(ctx context.Context, sel ast.SelectionSet, obj *entities.Workspace) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, workspaceImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Workspace") - case "metadata": +// region ***************************** type.gotpl ***************************** - out.Values[i] = ec._Workspace_metadata(ctx, field, obj) +func (ec *executionContext) unmarshalNAny2interface(ctx context.Context, v interface{}) (any, error) { + res, err := graphql.UnmarshalAny(v) + return res, graphql.ErrorOnPath(ctx, err) +} - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) +func (ec *executionContext) marshalNAny2interface(ctx context.Context, sel ast.SelectionSet, v any) 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 + } + res := graphql.MarshalAny(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) marshalNApp2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐApp(ctx context.Context, sel ast.SelectionSet, v *entities.App) 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._App(ctx, sel, v) +} + +func (ec *executionContext) marshalNAppEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.AppEdge) 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() } - case "syncStatus": + ret[i] = ec.marshalNAppEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - out.Values[i] = ec._Workspace_syncStatus(ctx, field, obj) + } + wg.Wait() - case "spec": - field := field + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Workspace_spec(ctx, field, obj) - return res - } + return ret +} - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) +func (ec *executionContext) marshalNAppEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppEdge(ctx context.Context, sel ast.SelectionSet, v *model.AppEdge) 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._AppEdge(ctx, sel, v) +} - }) - case "status": +func (ec *executionContext) unmarshalNAppIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐApp(ctx context.Context, v interface{}) (entities.App, error) { + res, err := ec.unmarshalInputAppIn(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec._Workspace_status(ctx, field, obj) +func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} - case "apiVersion": +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 +} - out.Values[i] = ec._Workspace_apiVersion(ctx, field, obj) +func (ec *executionContext) marshalNConfig2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConfig(ctx context.Context, sel ast.SelectionSet, v *entities.Config) 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._Config(ctx, sel, v) +} - case "kind": +func (ec *executionContext) marshalNConfigEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐConfigEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ConfigEdge) 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.marshalNConfigEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐConfigEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - out.Values[i] = ec._Workspace_kind(ctx, field, obj) + } + wg.Wait() - default: - panic("unknown field " + strconv.Quote(field.Name)) + for _, e := range ret { + if e == graphql.Null { + return graphql.Null } } - out.Dispatch() - if invalids > 0 { + + return ret +} + +func (ec *executionContext) marshalNConfigEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐConfigEdge(ctx context.Context, sel ast.SelectionSet, v *model.ConfigEdge) 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 out + return ec._ConfigEdge(ctx, sel, v) } -var workspaceSpecImplementors = []string{"WorkspaceSpec"} +func (ec *executionContext) unmarshalNConfigIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConfig(ctx context.Context, v interface{}) (entities.Config, error) { + res, err := ec.unmarshalInputConfigIn(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} -func (ec *executionContext) _WorkspaceSpec(ctx context.Context, sel ast.SelectionSet, obj *model.WorkspaceSpec) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, workspaceSpecImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("WorkspaceSpec") - case "projectName": +func (ec *executionContext) marshalNConfigKeyValueRef2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐConfigKeyValueRef(ctx context.Context, sel ast.SelectionSet, v *domain.ConfigKeyValueRef) 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._ConfigKeyValueRef(ctx, sel, v) +} - out.Values[i] = ec._WorkspaceSpec_projectName(ctx, field, obj) +func (ec *executionContext) marshalNConsoleCheckNameAvailabilityOutput2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐCheckNameAvailabilityOutput(ctx context.Context, sel ast.SelectionSet, v domain.CheckNameAvailabilityOutput) graphql.Marshaler { + return ec._ConsoleCheckNameAvailabilityOutput(ctx, sel, &v) +} - if out.Values[i] == graphql.Null { - invalids++ +func (ec *executionContext) marshalNConsoleCheckNameAvailabilityOutput2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐCheckNameAvailabilityOutput(ctx context.Context, sel ast.SelectionSet, v *domain.CheckNameAvailabilityOutput) 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._ConsoleCheckNameAvailabilityOutput(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNConsoleResType2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐResourceType(ctx context.Context, v interface{}) (entities.ResourceType, error) { + tmp, err := graphql.UnmarshalString(v) + res := entities.ResourceType(tmp) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNConsoleResType2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐResourceType(ctx context.Context, sel ast.SelectionSet, v entities.ResourceType) graphql.Marshaler { + res := graphql.MarshalString(string(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) marshalNConsoleVPNDevice2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConsoleVPNDevice(ctx context.Context, sel ast.SelectionSet, v *entities.ConsoleVPNDevice) 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._ConsoleVPNDevice(ctx, sel, v) +} + +func (ec *executionContext) marshalNConsoleVPNDeviceEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐConsoleVPNDeviceEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ConsoleVPNDeviceEdge) 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() } - case "targetNamespace": + ret[i] = ec.marshalNConsoleVPNDeviceEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐConsoleVPNDeviceEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - out.Values[i] = ec._WorkspaceSpec_targetNamespace(ctx, field, obj) + } + wg.Wait() - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) + for _, e := range ret { + if e == graphql.Null { + return graphql.Null } } - out.Dispatch() - if invalids > 0 { + + return ret +} + +func (ec *executionContext) marshalNConsoleVPNDeviceEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐConsoleVPNDeviceEdge(ctx context.Context, sel ast.SelectionSet, v *model.ConsoleVPNDeviceEdge) 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 out + return ec._ConsoleVPNDeviceEdge(ctx, sel, v) } -var _ServiceImplementors = []string{"_Service"} - -func (ec *executionContext) __Service(ctx context.Context, sel ast.SelectionSet, obj *fedruntime.Service) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, _ServiceImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("_Service") - case "sdl": +func (ec *executionContext) unmarshalNConsoleVPNDeviceIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConsoleVPNDevice(ctx context.Context, v interface{}) (entities.ConsoleVPNDevice, error) { + res, err := ec.unmarshalInputConsoleVPNDeviceIn(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.__Service_sdl(ctx, field, obj) +func (ec *executionContext) unmarshalNDate2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNDate2string(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") } } - out.Dispatch() - if invalids > 0 { + return res +} + +func (ec *executionContext) marshalNEnvironment2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐEnvironment(ctx context.Context, sel ast.SelectionSet, v *entities.Environment) 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 out + return ec._Environment(ctx, sel, v) } -var __DirectiveImplementors = []string{"__Directive"} - -func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Directive") - case "name": - - out.Values[i] = ec.___Directive_name(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "description": - - out.Values[i] = ec.___Directive_description(ctx, field, obj) - - case "locations": - - out.Values[i] = ec.___Directive_locations(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ +func (ec *executionContext) marshalNEnvironmentEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐEnvironmentEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.EnvironmentEdge) 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() } - case "args": + ret[i] = ec.marshalNEnvironmentEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐEnvironmentEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - out.Values[i] = ec.___Directive_args(ctx, field, obj) + } + wg.Wait() - if out.Values[i] == graphql.Null { - invalids++ - } - case "isRepeatable": + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } - out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) + return ret +} - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNEnvironmentEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐEnvironmentEdge(ctx context.Context, sel ast.SelectionSet, v *model.EnvironmentEdge) 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") } - } - out.Dispatch() - if invalids > 0 { return graphql.Null } - return out + return ec._EnvironmentEdge(ctx, sel, v) } -var __EnumValueImplementors = []string{"__EnumValue"} - -func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__EnumValue") - case "name": - - out.Values[i] = ec.___EnumValue_name(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "description": - - out.Values[i] = ec.___EnumValue_description(ctx, field, obj) +func (ec *executionContext) unmarshalNEnvironmentIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐEnvironment(ctx context.Context, v interface{}) (entities.Environment, error) { + res, err := ec.unmarshalInputEnvironmentIn(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} - case "isDeprecated": +func (ec *executionContext) unmarshalNGithub__com___kloudlite___api___apps___console___internal___entities__PullSecretFormat2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsConsoleInternalEntitiesPullSecretFormat(ctx context.Context, v interface{}) (model.GithubComKloudliteAPIAppsConsoleInternalEntitiesPullSecretFormat, error) { + var res model.GithubComKloudliteAPIAppsConsoleInternalEntitiesPullSecretFormat + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) +func (ec *executionContext) marshalNGithub__com___kloudlite___api___apps___console___internal___entities__PullSecretFormat2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsConsoleInternalEntitiesPullSecretFormat(ctx context.Context, sel ast.SelectionSet, v model.GithubComKloudliteAPIAppsConsoleInternalEntitiesPullSecretFormat) graphql.Marshaler { + return v +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "deprecationReason": +func (ec *executionContext) marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx context.Context, sel ast.SelectionSet, v common.CreatedOrUpdatedBy) graphql.Marshaler { + return ec._Github__com___kloudlite___api___common__CreatedOrUpdatedBy(ctx, sel, &v) +} - out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) +func (ec *executionContext) unmarshalNGithub__com___kloudlite___api___pkg___types__SyncAction2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncAction(ctx context.Context, v interface{}) (types.SyncAction, error) { + tmp, err := graphql.UnmarshalString(v) + res := types.SyncAction(tmp) + return res, graphql.ErrorOnPath(ctx, err) +} - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNGithub__com___kloudlite___api___pkg___types__SyncAction2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncAction(ctx context.Context, sel ast.SelectionSet, v types.SyncAction) graphql.Marshaler { + res := graphql.MarshalString(string(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") } } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out + return res } -var __FieldImplementors = []string{"__Field"} +func (ec *executionContext) unmarshalNGithub__com___kloudlite___api___pkg___types__SyncState2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncState(ctx context.Context, v interface{}) (types.SyncState, error) { + tmp, err := graphql.UnmarshalString(v) + res := types.SyncState(tmp) + return res, graphql.ErrorOnPath(ctx, err) +} -func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Field") - case "name": +func (ec *executionContext) marshalNGithub__com___kloudlite___api___pkg___types__SyncState2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncState(ctx context.Context, sel ast.SelectionSet, v types.SyncState) graphql.Marshaler { + res := graphql.MarshalString(string(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 +} - out.Values[i] = ec.___Field_name(ctx, field, obj) +func (ec *executionContext) marshalNGithub__com___kloudlite___api___pkg___types__SyncStatus2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncStatus(ctx context.Context, sel ast.SelectionSet, v types.SyncStatus) graphql.Marshaler { + return ec._Github__com___kloudlite___api___pkg___types__SyncStatus(ctx, sel, &v) +} - if out.Values[i] == graphql.Null { - invalids++ +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__AppContainer2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppContainerᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GithubComKloudliteOperatorApisCrdsV1AppContainer) 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() } - case "description": - - out.Values[i] = ec.___Field_description(ctx, field, obj) - - case "args": + ret[i] = ec.marshalNGithub__com___kloudlite___operator___apis___crds___v1__AppContainer2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppContainer(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - out.Values[i] = ec.___Field_args(ctx, field, obj) + } + wg.Wait() - if out.Values[i] == graphql.Null { - invalids++ - } - case "type": + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } - out.Values[i] = ec.___Field_type(ctx, field, obj) + return ret +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "isDeprecated": +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__AppContainer2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppContainer(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1AppContainer) 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._Github__com___kloudlite___operator___apis___crds___v1__AppContainer(ctx, sel, v) +} - out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__AppContainerIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppContainerInᚄ(ctx context.Context, v interface{}) ([]*model.GithubComKloudliteOperatorApisCrdsV1AppContainerIn, error) { + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.GithubComKloudliteOperatorApisCrdsV1AppContainerIn, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__AppContainerIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppContainerIn(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "deprecationReason": +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__AppContainerIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppContainerIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1AppContainerIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__AppContainerIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__AppSpec2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppSpec(ctx context.Context, sel ast.SelectionSet, v model.GithubComKloudliteOperatorApisCrdsV1AppSpec) graphql.Marshaler { + return ec._Github__com___kloudlite___operator___apis___crds___v1__AppSpec(ctx, sel, &v) +} - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__AppSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppSpec(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1AppSpec) 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") } - } - out.Dispatch() - if invalids > 0 { return graphql.Null } - return out + return ec._Github__com___kloudlite___operator___apis___crds___v1__AppSpec(ctx, sel, v) } -var __InputValueImplementors = []string{"__InputValue"} - -func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__InputValue") - case "name": - - out.Values[i] = ec.___InputValue_name(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "description": +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__AppSpecIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppSpecIn(ctx context.Context, v interface{}) (model.GithubComKloudliteOperatorApisCrdsV1AppSpecIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__AppSpecIn(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___InputValue_description(ctx, field, obj) +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__AppSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppSpecIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1AppSpecIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__AppSpecIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - case "type": +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__AppSvc2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppSvc(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1AppSvc) 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._Github__com___kloudlite___operator___apis___crds___v1__AppSvc(ctx, sel, v) +} - out.Values[i] = ec.___InputValue_type(ctx, field, obj) +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__AppSvcIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppSvcIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1AppSvcIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__AppSvcIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "defaultValue": +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ConfigOrSecret(ctx context.Context, v interface{}) (model.GithubComKloudliteOperatorApisCrdsV1ConfigOrSecret, error) { + var res model.GithubComKloudliteOperatorApisCrdsV1ConfigOrSecret + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ConfigOrSecret(ctx context.Context, sel ast.SelectionSet, v model.GithubComKloudliteOperatorApisCrdsV1ConfigOrSecret) graphql.Marshaler { + return v +} - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__ContainerEnv2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerEnv(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1ContainerEnv) 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") } - } - out.Dispatch() - if invalids > 0 { return graphql.Null } - return out + return ec._Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv(ctx, sel, v) } -var __SchemaImplementors = []string{"__Schema"} - -func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - 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": +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ContainerEnvIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerEnvIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1ContainerEnvIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ContainerEnvIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___Schema_types(ctx, field, obj) +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__ContainerVolume2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerVolume(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1ContainerVolume) 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._Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume(ctx, sel, v) +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "queryType": +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ContainerVolumeIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerVolumeIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1ContainerVolumeIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ContainerVolumeIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___Schema_queryType(ctx, field, obj) +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerVolumeItem(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1ContainerVolumeItem) 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._Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem(ctx, sel, v) +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "mutationType": +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItemIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerVolumeItemIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1ContainerVolumeItemIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItemIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__EnvFrom2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1EnvFrom(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1EnvFrom) 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._Github__com___kloudlite___operator___apis___crds___v1__EnvFrom(ctx, sel, v) +} - case "subscriptionType": +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__EnvFromIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1EnvFromIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1EnvFromIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__EnvFromIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingMode2githubᚗcomᚋkloudliteᚋoperatorᚋapisᚋcrdsᚋv1ᚐEnvironmentRoutingMode(ctx context.Context, v interface{}) (v1.EnvironmentRoutingMode, error) { + tmp, err := graphql.UnmarshalString(v) + res := v1.EnvironmentRoutingMode(tmp) + return res, graphql.ErrorOnPath(ctx, err) +} - case "directives": +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingMode2githubᚗcomᚋkloudliteᚋoperatorᚋapisᚋcrdsᚋv1ᚐEnvironmentRoutingMode(ctx context.Context, sel ast.SelectionSet, v v1.EnvironmentRoutingMode) graphql.Marshaler { + res := graphql.MarshalString(string(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 +} - out.Values[i] = ec.___Schema_directives(ctx, field, obj) +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ManagedResourceSpec(ctx context.Context, sel ast.SelectionSet, v model.GithubComKloudliteOperatorApisCrdsV1ManagedResourceSpec) graphql.Marshaler { + return ec._Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec(ctx, sel, &v) +} - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ManagedResourceSpec(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1ManagedResourceSpec) 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") } - } - out.Dispatch() - if invalids > 0 { return graphql.Null } - return out + return ec._Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec(ctx, sel, v) } -var __TypeImplementors = []string{"__Type"} - -func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Type") - case "kind": - - out.Values[i] = ec.___Type_kind(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "name": +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpecIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ManagedResourceSpecIn(ctx context.Context, v interface{}) (model.GithubComKloudliteOperatorApisCrdsV1ManagedResourceSpecIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpecIn(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___Type_name(ctx, field, obj) +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ManagedResourceSpecIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1ManagedResourceSpecIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpecIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - case "description": +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ManagedServiceSpec(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpec) 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._Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec(ctx, sel, v) +} - out.Values[i] = ec.___Type_description(ctx, field, obj) +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ManagedServiceSpecIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpecIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - case "fields": +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1MresResourceTemplate(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1MresResourceTemplate) 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._Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate(ctx, sel, v) +} - out.Values[i] = ec.___Type_fields(ctx, field, obj) +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__MresResourceTemplateIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1MresResourceTemplateIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1MresResourceTemplateIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__MresResourceTemplateIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - case "interfaces": +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1MsvcNamedRef(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1MsvcNamedRef) 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._Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef(ctx, sel, v) +} - out.Values[i] = ec.___Type_interfaces(ctx, field, obj) +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__MsvcNamedRefIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1MsvcNamedRefIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1MsvcNamedRefIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__MsvcNamedRefIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - case "possibleTypes": +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__ProjectSpec2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ProjectSpec(ctx context.Context, sel ast.SelectionSet, v model.GithubComKloudliteOperatorApisCrdsV1ProjectSpec) graphql.Marshaler { + return ec._Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec(ctx, sel, &v) +} - out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__ProjectSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ProjectSpec(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1ProjectSpec) 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._Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec(ctx, sel, v) +} - case "enumValues": +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ProjectSpecIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ProjectSpecIn(ctx context.Context, v interface{}) (model.GithubComKloudliteOperatorApisCrdsV1ProjectSpecIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ProjectSpecIn(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___Type_enumValues(ctx, field, obj) +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ProjectSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ProjectSpecIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1ProjectSpecIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ProjectSpecIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - case "inputFields": +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__Route2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1Route(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1Route) 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._Github__com___kloudlite___operator___apis___crds___v1__Route(ctx, sel, v) +} - out.Values[i] = ec.___Type_inputFields(ctx, field, obj) +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__RouteIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1RouteIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1RouteIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__RouteIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - case "ofType": +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__RouterSpec2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1RouterSpec(ctx context.Context, sel ast.SelectionSet, v model.GithubComKloudliteOperatorApisCrdsV1RouterSpec) graphql.Marshaler { + return ec._Github__com___kloudlite___operator___apis___crds___v1__RouterSpec(ctx, sel, &v) +} - out.Values[i] = ec.___Type_ofType(ctx, field, obj) +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__RouterSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1RouterSpec(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1RouterSpec) 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._Github__com___kloudlite___operator___apis___crds___v1__RouterSpec(ctx, sel, v) +} - case "specifiedByURL": +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__RouterSpecIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1RouterSpecIn(ctx context.Context, v interface{}) (model.GithubComKloudliteOperatorApisCrdsV1RouterSpecIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__RouterSpecIn(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__RouterSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1RouterSpecIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1RouterSpecIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__RouterSpecIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__ServiceTemplate2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ServiceTemplate(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1ServiceTemplate) 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 } - out.Dispatch() - if invalids > 0 { + return ec._Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ServiceTemplateIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1ServiceTemplateIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___wireguard___v1__CNameRecord2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisWireguardV1CNameRecord(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisWireguardV1CNameRecord) 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 out + return ec._Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord(ctx, sel, v) } -// endregion **************************** object.gotpl **************************** +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___wireguard___v1__CNameRecordIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisWireguardV1CNameRecordIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisWireguardV1CNameRecordIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___wireguard___v1__CNameRecordIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} -// region ***************************** type.gotpl ***************************** +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___wireguard___v1__Port2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisWireguardV1Port(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisWireguardV1Port) 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._Github__com___kloudlite___operator___apis___wireguard___v1__Port(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___wireguard___v1__PortIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisWireguardV1PortIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisWireguardV1PortIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___wireguard___v1__PortIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} -func (ec *executionContext) marshalNApp2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐApp(ctx context.Context, sel ast.SelectionSet, v *entities.App) graphql.Marshaler { +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___pkg___operator__ResourceRef2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorResourceRef(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorPkgOperatorResourceRef) 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._App(ctx, sel, v) + return ec._Github__com___kloudlite___operator___pkg___operator__ResourceRef(ctx, sel, v) } -func (ec *executionContext) unmarshalNAppIn2kloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐApp(ctx context.Context, v interface{}) (entities.App, error) { - res, err := ec.unmarshalInputAppIn(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) +func (ec *executionContext) marshalNImagePullSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐImagePullSecret(ctx context.Context, sel ast.SelectionSet, v *entities.ImagePullSecret) 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._ImagePullSecret(ctx, sel, v) } -func (ec *executionContext) marshalNAppSpecContainers2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainers(ctx context.Context, sel ast.SelectionSet, v []*model.AppSpecContainers) graphql.Marshaler { +func (ec *executionContext) marshalNImagePullSecretEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐImagePullSecretEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ImagePullSecretEdge) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -27233,7 +47325,7 @@ func (ec *executionContext) marshalNAppSpecContainers2ᚕᚖkloudliteᚗioᚋapp if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalOAppSpecContainers2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainers(ctx, sel, v[i]) + ret[i] = ec.marshalNImagePullSecretEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐImagePullSecretEdge(ctx, sel, v[i]) } if isLen1 { f(i) @@ -27244,33 +47336,52 @@ func (ec *executionContext) marshalNAppSpecContainers2ᚕᚖkloudliteᚗioᚋapp } wg.Wait() + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + return ret } -func (ec *executionContext) unmarshalNAppSpecContainersIn2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersIn(ctx context.Context, v interface{}) ([]*model.AppSpecContainersIn, error) { - var vSlice []interface{} - if v != nil { - vSlice = graphql.CoerceList(v) +func (ec *executionContext) marshalNImagePullSecretEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐImagePullSecretEdge(ctx context.Context, sel ast.SelectionSet, v *model.ImagePullSecretEdge) 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 } - var err error - res := make([]*model.AppSpecContainersIn, len(vSlice)) - for i := range vSlice { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalOAppSpecContainersIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersIn(ctx, vSlice[i]) - if err != nil { - return nil, err + return ec._ImagePullSecretEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNImagePullSecretIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐImagePullSecret(ctx context.Context, v interface{}) (entities.ImagePullSecret, error) { + res, err := ec.unmarshalInputImagePullSecretIn(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, nil + return res } -func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { - res, err := graphql.UnmarshalBoolean(v) +func (ec *executionContext) unmarshalNInt2int64(ctx context.Context, v interface{}) (int64, error) { + res, err := graphql.UnmarshalInt64(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) +func (ec *executionContext) marshalNInt2int64(ctx context.Context, sel ast.SelectionSet, v int64) graphql.Marshaler { + res := graphql.MarshalInt64(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") @@ -27279,58 +47390,157 @@ func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.Se return res } -func (ec *executionContext) marshalNConfig2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐConfig(ctx context.Context, sel ast.SelectionSet, v *entities.Config) graphql.Marshaler { +func (ec *executionContext) marshalNK8s__io___api___core___v1__Toleration2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1Toleration(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1Toleration) 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._Config(ctx, sel, v) + return ec._K8s__io___api___core___v1__Toleration(ctx, sel, v) } -func (ec *executionContext) unmarshalNConfigIn2kloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐConfig(ctx context.Context, v interface{}) (entities.Config, error) { - res, err := ec.unmarshalInputConfigIn(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) +func (ec *executionContext) unmarshalNK8s__io___api___core___v1__TolerationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TolerationIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1TolerationIn, error) { + res, err := ec.unmarshalInputK8s__io___api___core___v1__TolerationIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNConsoleCheckNameAvailabilityOutput2kloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚐCheckNameAvailabilityOutput(ctx context.Context, sel ast.SelectionSet, v domain.CheckNameAvailabilityOutput) graphql.Marshaler { - return ec._ConsoleCheckNameAvailabilityOutput(ctx, sel, &v) +func (ec *executionContext) marshalNManagedResource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐManagedResource(ctx context.Context, sel ast.SelectionSet, v *entities.ManagedResource) 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._ManagedResource(ctx, sel, v) +} + +func (ec *executionContext) marshalNManagedResourceEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedResourceEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ManagedResourceEdge) 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.marshalNManagedResourceEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedResourceEdge(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) marshalNConsoleCheckNameAvailabilityOutput2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚐCheckNameAvailabilityOutput(ctx context.Context, sel ast.SelectionSet, v *domain.CheckNameAvailabilityOutput) graphql.Marshaler { +func (ec *executionContext) marshalNManagedResourceEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedResourceEdge(ctx context.Context, sel ast.SelectionSet, v *model.ManagedResourceEdge) 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._ConsoleCheckNameAvailabilityOutput(ctx, sel, v) + return ec._ManagedResourceEdge(ctx, sel, v) } -func (ec *executionContext) unmarshalNConsoleResType2kloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚐResType(ctx context.Context, v interface{}) (domain.ResType, error) { - tmp, err := graphql.UnmarshalString(v) - res := domain.ResType(tmp) +func (ec *executionContext) unmarshalNManagedResourceIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐManagedResource(ctx context.Context, v interface{}) (entities.ManagedResource, error) { + res, err := ec.unmarshalInputManagedResourceIn(ctx, v) return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNConsoleResType2kloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚐResType(ctx context.Context, sel ast.SelectionSet, v domain.ResType) graphql.Marshaler { - res := graphql.MarshalString(string(v)) - if res == graphql.Null { +func (ec *executionContext) marshalNManagedResourceKeyValueRef2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐManagedResourceKeyValueRefᚄ(ctx context.Context, sel ast.SelectionSet, v []*domain.ManagedResourceKeyValueRef) 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.marshalNManagedResourceKeyValueRef2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐManagedResourceKeyValueRef(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) marshalNManagedResourceKeyValueRef2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐManagedResourceKeyValueRef(ctx context.Context, sel ast.SelectionSet, v *domain.ManagedResourceKeyValueRef) 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 res + return ec._ManagedResourceKeyValueRef(ctx, sel, v) } -func (ec *executionContext) unmarshalNDate2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(v) +func (ec *executionContext) unmarshalNMap2map(ctx context.Context, v interface{}) (map[string]interface{}, error) { + res, err := graphql.UnmarshalMap(v) return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNDate2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - res := graphql.MarshalString(v) +func (ec *executionContext) marshalNMap2map(ctx context.Context, sel ast.SelectionSet, v map[string]interface{}) 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 + } + res := graphql.MarshalMap(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") @@ -27339,13 +47549,14 @@ func (ec *executionContext) marshalNDate2string(ctx context.Context, sel ast.Sel return res } -func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v interface{}) (int, error) { - res, err := graphql.UnmarshalInt(v) +func (ec *executionContext) unmarshalNMatchFilterMatchType2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchType(ctx context.Context, v interface{}) (repos.MatchType, error) { + tmp, err := graphql.UnmarshalString(v) + res := repos.MatchType(tmp) return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { - res := graphql.MarshalInt(v) +func (ec *executionContext) marshalNMatchFilterMatchType2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchType(ctx context.Context, sel ast.SelectionSet, v repos.MatchType) graphql.Marshaler { + res := graphql.MarshalString(string(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") @@ -27354,159 +47565,343 @@ func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.Selecti return res } -func (ec *executionContext) unmarshalNInt2int64(ctx context.Context, v interface{}) (int64, error) { - res, err := graphql.UnmarshalInt64(v) +func (ec *executionContext) marshalNMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx context.Context, sel ast.SelectionSet, v v12.ObjectMeta) graphql.Marshaler { + return ec._Metadata(ctx, sel, &v) +} + +func (ec *executionContext) unmarshalNMetadataIn2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx context.Context, v interface{}) (v12.ObjectMeta, error) { + res, err := ec.unmarshalInputMetadataIn(ctx, v) return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNInt2int64(ctx context.Context, sel ast.SelectionSet, v int64) graphql.Marshaler { - res := graphql.MarshalInt64(v) - if res == graphql.Null { +func (ec *executionContext) unmarshalNMetadataIn2ᚖk8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx context.Context, v interface{}) (*v12.ObjectMeta, error) { + res, err := ec.unmarshalInputMetadataIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx context.Context, sel ast.SelectionSet, v *model.PageInfo) 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 res + return ec._PageInfo(ctx, sel, v) } -func (ec *executionContext) marshalNManagedResource2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐMRes(ctx context.Context, sel ast.SelectionSet, v *entities.MRes) graphql.Marshaler { +func (ec *executionContext) unmarshalNPortIn2ᚕᚖgithubᚗcomᚋkloudliteᚋoperatorᚋapisᚋwireguardᚋv1ᚐPortᚄ(ctx context.Context, v interface{}) ([]*v11.Port, error) { + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*v11.Port, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNPortIn2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋapisᚋwireguardᚋv1ᚐPort(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalNPortIn2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋapisᚋwireguardᚋv1ᚐPort(ctx context.Context, v interface{}) (*v11.Port, error) { + res, err := ec.unmarshalInputPortIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNProject2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProject(ctx context.Context, sel ast.SelectionSet, v *entities.Project) 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._ManagedResource(ctx, sel, v) + return ec._Project(ctx, sel, v) } -func (ec *executionContext) unmarshalNManagedResourceIn2kloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐMRes(ctx context.Context, v interface{}) (entities.MRes, error) { - res, err := ec.unmarshalInputManagedResourceIn(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) +func (ec *executionContext) marshalNProjectEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐProjectEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ProjectEdge) 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.marshalNProjectEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐProjectEdge(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) marshalNManagedResourceSpecMresKind2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedResourceSpecMresKind(ctx context.Context, sel ast.SelectionSet, v *model.ManagedResourceSpecMresKind) graphql.Marshaler { +func (ec *executionContext) marshalNProjectEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐProjectEdge(ctx context.Context, sel ast.SelectionSet, v *model.ProjectEdge) 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._ManagedResourceSpecMresKind(ctx, sel, v) + return ec._ProjectEdge(ctx, sel, v) } -func (ec *executionContext) unmarshalNManagedResourceSpecMresKindIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedResourceSpecMresKindIn(ctx context.Context, v interface{}) (*model.ManagedResourceSpecMresKindIn, error) { - res, err := ec.unmarshalInputManagedResourceSpecMresKindIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) +func (ec *executionContext) unmarshalNProjectIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProject(ctx context.Context, v interface{}) (entities.Project, error) { + res, err := ec.unmarshalInputProjectIn(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNManagedResourceSpecMsvcRef2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedResourceSpecMsvcRef(ctx context.Context, sel ast.SelectionSet, v *model.ManagedResourceSpecMsvcRef) graphql.Marshaler { +func (ec *executionContext) marshalNProjectManagedService2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProjectManagedService(ctx context.Context, sel ast.SelectionSet, v *entities.ProjectManagedService) 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._ManagedResourceSpecMsvcRef(ctx, sel, v) + return ec._ProjectManagedService(ctx, sel, v) } -func (ec *executionContext) unmarshalNManagedResourceSpecMsvcRefIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedResourceSpecMsvcRefIn(ctx context.Context, v interface{}) (*model.ManagedResourceSpecMsvcRefIn, error) { - res, err := ec.unmarshalInputManagedResourceSpecMsvcRefIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) +func (ec *executionContext) marshalNProjectManagedServiceEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐProjectManagedServiceEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ProjectManagedServiceEdge) 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.marshalNProjectManagedServiceEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐProjectManagedServiceEdge(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) marshalNManagedService2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐMSvc(ctx context.Context, sel ast.SelectionSet, v *entities.MSvc) graphql.Marshaler { +func (ec *executionContext) marshalNProjectManagedServiceEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐProjectManagedServiceEdge(ctx context.Context, sel ast.SelectionSet, v *model.ProjectManagedServiceEdge) 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._ManagedService(ctx, sel, v) + return ec._ProjectManagedServiceEdge(ctx, sel, v) } -func (ec *executionContext) unmarshalNManagedServiceIn2kloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐMSvc(ctx context.Context, v interface{}) (entities.MSvc, error) { - res, err := ec.unmarshalInputManagedServiceIn(ctx, v) +func (ec *executionContext) unmarshalNProjectManagedServiceIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProjectManagedService(ctx context.Context, v interface{}) (entities.ProjectManagedService, error) { + res, err := ec.unmarshalInputProjectManagedServiceIn(ctx, v) return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNManagedServiceSpecMsvcKind2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedServiceSpecMsvcKind(ctx context.Context, sel ast.SelectionSet, v *model.ManagedServiceSpecMsvcKind) graphql.Marshaler { +func (ec *executionContext) marshalNRouter2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐRouter(ctx context.Context, sel ast.SelectionSet, v *entities.Router) 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._ManagedServiceSpecMsvcKind(ctx, sel, v) -} - -func (ec *executionContext) unmarshalNManagedServiceSpecMsvcKindIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedServiceSpecMsvcKindIn(ctx context.Context, v interface{}) (*model.ManagedServiceSpecMsvcKindIn, error) { - res, err := ec.unmarshalInputManagedServiceSpecMsvcKindIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) + return ec._Router(ctx, sel, v) } -func (ec *executionContext) marshalNMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx context.Context, sel ast.SelectionSet, v v1.ObjectMeta) graphql.Marshaler { - return ec._Metadata(ctx, sel, &v) -} +func (ec *executionContext) marshalNRouterEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.RouterEdge) 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.marshalNRouterEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } -func (ec *executionContext) unmarshalNMetadataIn2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx context.Context, v interface{}) (v1.ObjectMeta, error) { - res, err := ec.unmarshalInputMetadataIn(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) -} + } + wg.Wait() -func (ec *executionContext) marshalNPatch2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋjsonᚑpatchᚐPatchOperation(ctx context.Context, sel ast.SelectionSet, v json_patch.PatchOperation) graphql.Marshaler { - return ec._Patch(ctx, sel, &v) -} + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } -func (ec *executionContext) unmarshalNPatchIn2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋjsonᚑpatchᚐPatchOperation(ctx context.Context, v interface{}) (json_patch.PatchOperation, error) { - res, err := ec.unmarshalInputPatchIn(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) + return ret } -func (ec *executionContext) marshalNProject2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐProject(ctx context.Context, sel ast.SelectionSet, v *entities.Project) graphql.Marshaler { +func (ec *executionContext) marshalNRouterEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterEdge(ctx context.Context, sel ast.SelectionSet, v *model.RouterEdge) 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._Project(ctx, sel, v) + return ec._RouterEdge(ctx, sel, v) } -func (ec *executionContext) unmarshalNProjectIn2kloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐProject(ctx context.Context, v interface{}) (entities.Project, error) { - res, err := ec.unmarshalInputProjectIn(ctx, v) +func (ec *executionContext) unmarshalNRouterIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐRouter(ctx context.Context, v interface{}) (entities.Router, error) { + res, err := ec.unmarshalInputRouterIn(ctx, v) return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNRouter2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐRouter(ctx context.Context, sel ast.SelectionSet, v *entities.Router) graphql.Marshaler { +func (ec *executionContext) marshalNSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐSecret(ctx context.Context, sel ast.SelectionSet, v *entities.Secret) 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._Router(ctx, sel, v) + return ec._Secret(ctx, sel, v) } -func (ec *executionContext) unmarshalNRouterIn2kloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐRouter(ctx context.Context, v interface{}) (entities.Router, error) { - res, err := ec.unmarshalInputRouterIn(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) +func (ec *executionContext) marshalNSecretEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSecretEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.SecretEdge) 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.marshalNSecretEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSecretEdge(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) marshalNSecret2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐSecret(ctx context.Context, sel ast.SelectionSet, v *entities.Secret) graphql.Marshaler { +func (ec *executionContext) marshalNSecretEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSecretEdge(ctx context.Context, sel ast.SelectionSet, v *model.SecretEdge) 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._Secret(ctx, sel, v) + return ec._SecretEdge(ctx, sel, v) } -func (ec *executionContext) unmarshalNSecretIn2kloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐSecret(ctx context.Context, v interface{}) (entities.Secret, error) { +func (ec *executionContext) unmarshalNSecretIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐSecret(ctx context.Context, v interface{}) (entities.Secret, error) { res, err := ec.unmarshalInputSecretIn(ctx, v) return res, graphql.ErrorOnPath(ctx, err) } +func (ec *executionContext) unmarshalNSecretKeyRefIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐSecretKeyRef(ctx context.Context, v interface{}) (*domain.SecretKeyRef, error) { + res, err := ec.unmarshalInputSecretKeyRefIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNSecretKeyValueRef2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐSecretKeyValueRef(ctx context.Context, sel ast.SelectionSet, v *domain.SecretKeyValueRef) 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._SecretKeyValueRef(ctx, sel, v) +} + func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) return res, graphql.ErrorOnPath(ctx, err) @@ -27522,16 +47917,16 @@ func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.S return res } -func (ec *executionContext) unmarshalNString2ᚕᚖstring(ctx context.Context, v interface{}) ([]*string, error) { +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)) + 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]) + res[i], err = ec.unmarshalNString2string(ctx, vSlice[i]) if err != nil { return nil, err } @@ -27539,60 +47934,19 @@ func (ec *executionContext) unmarshalNString2ᚕᚖstring(ctx context.Context, v return res, nil } -func (ec *executionContext) marshalNString2ᚕᚖstring(ctx context.Context, sel ast.SelectionSet, v []*string) graphql.Marshaler { +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) unmarshalNSyncAction2kloudliteᚗioᚋpkgᚋtypesᚐSyncAction(ctx context.Context, v interface{}) (types.SyncAction, error) { - tmp, err := graphql.UnmarshalString(v) - res := types.SyncAction(tmp) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNSyncAction2kloudliteᚗioᚋpkgᚋtypesᚐSyncAction(ctx context.Context, sel ast.SelectionSet, v types.SyncAction) graphql.Marshaler { - res := graphql.MarshalString(string(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) unmarshalNSyncState2kloudliteᚗioᚋpkgᚋtypesᚐSyncState(ctx context.Context, v interface{}) (types.SyncState, error) { - tmp, err := graphql.UnmarshalString(v) - res := types.SyncState(tmp) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNSyncState2kloudliteᚗioᚋpkgᚋtypesᚐSyncState(ctx context.Context, sel ast.SelectionSet, v types.SyncState) graphql.Marshaler { - res := graphql.MarshalString(string(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") - } + ret[i] = ec.marshalNString2string(ctx, sel, v[i]) } - return res -} -func (ec *executionContext) marshalNWorkspace2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐWorkspace(ctx context.Context, sel ast.SelectionSet, v *entities.Workspace) 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") + for _, e := range ret { + if e == graphql.Null { + return graphql.Null } - return graphql.Null } - return ec._Workspace(ctx, sel, v) -} -func (ec *executionContext) unmarshalNWorkspaceIn2kloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐWorkspace(ctx context.Context, v interface{}) (entities.Workspace, error) { - res, err := ec.unmarshalInputWorkspaceIn(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) + return ret } func (ec *executionContext) unmarshalN_FieldSet2string(ctx context.Context, v interface{}) (string, error) { @@ -27867,7 +48221,7 @@ func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel a return res } -func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v interface{}) (interface{}, error) { +func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v interface{}) (any, error) { if v == nil { return nil, nil } @@ -27875,7 +48229,7 @@ func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v inter return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOAny2interface(ctx context.Context, sel ast.SelectionSet, v interface{}) graphql.Marshaler { +func (ec *executionContext) marshalOAny2interface(ctx context.Context, sel ast.SelectionSet, v any) graphql.Marshaler { if v == nil { return graphql.Null } @@ -27883,43 +48237,34 @@ func (ec *executionContext) marshalOAny2interface(ctx context.Context, sel ast.S return res } -func (ec *executionContext) marshalOApp2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐAppᚄ(ctx context.Context, sel ast.SelectionSet, v []*entities.App) graphql.Marshaler { +func (ec *executionContext) unmarshalOAny2ᚕinterfaceᚄ(ctx context.Context, v interface{}) ([]any, error) { if v == nil { - return graphql.Null + return nil, nil } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(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.marshalNApp2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐApp(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) + var err error + res := make([]any, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNAny2interface(ctx, vSlice[i]) + if err != nil { + return nil, err } + } + return res, nil +} +func (ec *executionContext) marshalOAny2ᚕinterfaceᚄ(ctx context.Context, sel ast.SelectionSet, v []any) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNAny2interface(ctx, sel, v[i]) } - wg.Wait() for _, e := range ret { if e == graphql.Null { @@ -27930,28 +48275,82 @@ func (ec *executionContext) marshalOApp2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋ return ret } -func (ec *executionContext) marshalOApp2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐApp(ctx context.Context, sel ast.SelectionSet, v *entities.App) graphql.Marshaler { +func (ec *executionContext) marshalOApp2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐApp(ctx context.Context, sel ast.SelectionSet, v *entities.App) graphql.Marshaler { if v == nil { return graphql.Null } return ec._App(ctx, sel, v) } -func (ec *executionContext) marshalOAppSpec2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpec(ctx context.Context, sel ast.SelectionSet, v *model.AppSpec) graphql.Marshaler { +func (ec *executionContext) marshalOAppPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppPaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.AppPaginatedRecords) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._AppSpec(ctx, sel, v) + return ec._AppPaginatedRecords(ctx, sel, v) +} + +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) marshalOAppSpecContainers2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainers(ctx context.Context, sel ast.SelectionSet, v *model.AppSpecContainers) graphql.Marshaler { +func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._AppSpecContainers(ctx, sel, v) + res := graphql.MarshalBoolean(*v) + return res +} + +func (ec *executionContext) marshalOConfig2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConfig(ctx context.Context, sel ast.SelectionSet, v *entities.Config) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Config(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOConfigKeyRefIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐConfigKeyRef(ctx context.Context, v interface{}) ([]*domain.ConfigKeyRef, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*domain.ConfigKeyRef, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalOConfigKeyRefIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐConfigKeyRef(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil } -func (ec *executionContext) marshalOAppSpecContainersEnv2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersEnv(ctx context.Context, sel ast.SelectionSet, v []*model.AppSpecContainersEnv) graphql.Marshaler { +func (ec *executionContext) unmarshalOConfigKeyRefIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐConfigKeyRef(ctx context.Context, v interface{}) (*domain.ConfigKeyRef, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputConfigKeyRefIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOConfigKeyValueRef2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐConfigKeyValueRefᚄ(ctx context.Context, sel ast.SelectionSet, v []*domain.ConfigKeyValueRef) graphql.Marshaler { if v == nil { return graphql.Null } @@ -27978,7 +48377,7 @@ func (ec *executionContext) marshalOAppSpecContainersEnv2ᚕᚖkloudliteᚗioᚋ if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalOAppSpecContainersEnv2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersEnv(ctx, sel, v[i]) + ret[i] = ec.marshalNConfigKeyValueRef2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐConfigKeyValueRef(ctx, sel, v[i]) } if isLen1 { f(i) @@ -27989,17 +48388,23 @@ func (ec *executionContext) marshalOAppSpecContainersEnv2ᚕᚖkloudliteᚗioᚋ } wg.Wait() + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + return ret } -func (ec *executionContext) marshalOAppSpecContainersEnv2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersEnv(ctx context.Context, sel ast.SelectionSet, v *model.AppSpecContainersEnv) graphql.Marshaler { +func (ec *executionContext) marshalOConfigPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐConfigPaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.ConfigPaginatedRecords) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._AppSpecContainersEnv(ctx, sel, v) + return ec._ConfigPaginatedRecords(ctx, sel, v) } -func (ec *executionContext) marshalOAppSpecContainersEnvFrom2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersEnvFrom(ctx context.Context, sel ast.SelectionSet, v []*model.AppSpecContainersEnvFrom) graphql.Marshaler { +func (ec *executionContext) marshalOConsoleVPNDevice2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConsoleVPNDeviceᚄ(ctx context.Context, sel ast.SelectionSet, v []*entities.ConsoleVPNDevice) graphql.Marshaler { if v == nil { return graphql.Null } @@ -28026,7 +48431,7 @@ func (ec *executionContext) marshalOAppSpecContainersEnvFrom2ᚕᚖkloudliteᚗi if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalOAppSpecContainersEnvFrom2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersEnvFrom(ctx, sel, v[i]) + ret[i] = ec.marshalNConsoleVPNDevice2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConsoleVPNDevice(ctx, sel, v[i]) } if isLen1 { f(i) @@ -28037,231 +48442,94 @@ func (ec *executionContext) marshalOAppSpecContainersEnvFrom2ᚕᚖkloudliteᚗi } wg.Wait() - return ret -} - -func (ec *executionContext) marshalOAppSpecContainersEnvFrom2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersEnvFrom(ctx context.Context, sel ast.SelectionSet, v *model.AppSpecContainersEnvFrom) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._AppSpecContainersEnvFrom(ctx, sel, v) -} - -func (ec *executionContext) unmarshalOAppSpecContainersEnvFromIn2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersEnvFromIn(ctx context.Context, v interface{}) ([]*model.AppSpecContainersEnvFromIn, error) { - if v == nil { - return nil, nil - } - var vSlice []interface{} - if v != nil { - vSlice = graphql.CoerceList(v) - } - var err error - res := make([]*model.AppSpecContainersEnvFromIn, len(vSlice)) - for i := range vSlice { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalOAppSpecContainersEnvFromIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersEnvFromIn(ctx, vSlice[i]) - if err != nil { - return nil, err - } - } - return res, nil -} - -func (ec *executionContext) unmarshalOAppSpecContainersEnvFromIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersEnvFromIn(ctx context.Context, v interface{}) (*model.AppSpecContainersEnvFromIn, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputAppSpecContainersEnvFromIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) unmarshalOAppSpecContainersEnvIn2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersEnvIn(ctx context.Context, v interface{}) ([]*model.AppSpecContainersEnvIn, error) { - if v == nil { - return nil, nil - } - var vSlice []interface{} - if v != nil { - vSlice = graphql.CoerceList(v) - } - var err error - res := make([]*model.AppSpecContainersEnvIn, len(vSlice)) - for i := range vSlice { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalOAppSpecContainersEnvIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersEnvIn(ctx, vSlice[i]) - if err != nil { - return nil, err + for _, e := range ret { + if e == graphql.Null { + return graphql.Null } } - return res, nil -} -func (ec *executionContext) unmarshalOAppSpecContainersEnvIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersEnvIn(ctx context.Context, v interface{}) (*model.AppSpecContainersEnvIn, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputAppSpecContainersEnvIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) unmarshalOAppSpecContainersIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersIn(ctx context.Context, v interface{}) (*model.AppSpecContainersIn, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputAppSpecContainersIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOAppSpecContainersLivenessProbe2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersLivenessProbe(ctx context.Context, sel ast.SelectionSet, v *model.AppSpecContainersLivenessProbe) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._AppSpecContainersLivenessProbe(ctx, sel, v) + return ret } -func (ec *executionContext) marshalOAppSpecContainersLivenessProbeHttpGet2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersLivenessProbeHTTPGet(ctx context.Context, sel ast.SelectionSet, v *model.AppSpecContainersLivenessProbeHTTPGet) graphql.Marshaler { +func (ec *executionContext) marshalOConsoleVPNDevice2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConsoleVPNDevice(ctx context.Context, sel ast.SelectionSet, v *entities.ConsoleVPNDevice) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._AppSpecContainersLivenessProbeHttpGet(ctx, sel, v) -} - -func (ec *executionContext) unmarshalOAppSpecContainersLivenessProbeHttpGetIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersLivenessProbeHTTPGetIn(ctx context.Context, v interface{}) (*model.AppSpecContainersLivenessProbeHTTPGetIn, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputAppSpecContainersLivenessProbeHttpGetIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) unmarshalOAppSpecContainersLivenessProbeIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersLivenessProbeIn(ctx context.Context, v interface{}) (*model.AppSpecContainersLivenessProbeIn, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputAppSpecContainersLivenessProbeIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) + return ec._ConsoleVPNDevice(ctx, sel, v) } -func (ec *executionContext) marshalOAppSpecContainersLivenessProbeShell2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersLivenessProbeShell(ctx context.Context, sel ast.SelectionSet, v *model.AppSpecContainersLivenessProbeShell) graphql.Marshaler { +func (ec *executionContext) marshalOConsoleVPNDevicePaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐConsoleVPNDevicePaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.ConsoleVPNDevicePaginatedRecords) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._AppSpecContainersLivenessProbeShell(ctx, sel, v) + return ec._ConsoleVPNDevicePaginatedRecords(ctx, sel, v) } -func (ec *executionContext) unmarshalOAppSpecContainersLivenessProbeShellIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersLivenessProbeShellIn(ctx context.Context, v interface{}) (*model.AppSpecContainersLivenessProbeShellIn, error) { +func (ec *executionContext) unmarshalOCoreSearchVPNDevices2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐCoreSearchVPNDevices(ctx context.Context, v interface{}) (*model.CoreSearchVPNDevices, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalInputAppSpecContainersLivenessProbeShellIn(ctx, v) + res, err := ec.unmarshalInputCoreSearchVPNDevices(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOAppSpecContainersLivenessProbeTcp2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersLivenessProbeTCP(ctx context.Context, sel ast.SelectionSet, v *model.AppSpecContainersLivenessProbeTCP) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._AppSpecContainersLivenessProbeTcp(ctx, sel, v) -} - -func (ec *executionContext) unmarshalOAppSpecContainersLivenessProbeTcpIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersLivenessProbeTCPIn(ctx context.Context, v interface{}) (*model.AppSpecContainersLivenessProbeTCPIn, error) { +func (ec *executionContext) unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx context.Context, v interface{}) (*repos.CursorPagination, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalInputAppSpecContainersLivenessProbeTcpIn(ctx, v) + res, err := ec.unmarshalInputCursorPaginationIn(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOAppSpecContainersReadinessProbe2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersReadinessProbe(ctx context.Context, sel ast.SelectionSet, v *model.AppSpecContainersReadinessProbe) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._AppSpecContainersReadinessProbe(ctx, sel, v) -} - -func (ec *executionContext) marshalOAppSpecContainersReadinessProbeHttpGet2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersReadinessProbeHTTPGet(ctx context.Context, sel ast.SelectionSet, v *model.AppSpecContainersReadinessProbeHTTPGet) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._AppSpecContainersReadinessProbeHttpGet(ctx, sel, v) +func (ec *executionContext) unmarshalOCursorPaginationSortDirection2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐSortDirection(ctx context.Context, v interface{}) (repos.SortDirection, error) { + tmp, err := graphql.UnmarshalString(v) + res := repos.SortDirection(tmp) + return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalOAppSpecContainersReadinessProbeHttpGetIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersReadinessProbeHTTPGetIn(ctx context.Context, v interface{}) (*model.AppSpecContainersReadinessProbeHTTPGetIn, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputAppSpecContainersReadinessProbeHttpGetIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) +func (ec *executionContext) marshalOCursorPaginationSortDirection2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐSortDirection(ctx context.Context, sel ast.SelectionSet, v repos.SortDirection) graphql.Marshaler { + res := graphql.MarshalString(string(v)) + return res } -func (ec *executionContext) unmarshalOAppSpecContainersReadinessProbeIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersReadinessProbeIn(ctx context.Context, v interface{}) (*model.AppSpecContainersReadinessProbeIn, error) { +func (ec *executionContext) unmarshalODate2ᚖstring(ctx context.Context, v interface{}) (*string, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalInputAppSpecContainersReadinessProbeIn(ctx, v) + res, err := graphql.UnmarshalString(v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOAppSpecContainersReadinessProbeShell2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersReadinessProbeShell(ctx context.Context, sel ast.SelectionSet, v *model.AppSpecContainersReadinessProbeShell) graphql.Marshaler { +func (ec *executionContext) marshalODate2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._AppSpecContainersReadinessProbeShell(ctx, sel, v) -} - -func (ec *executionContext) unmarshalOAppSpecContainersReadinessProbeShellIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersReadinessProbeShellIn(ctx context.Context, v interface{}) (*model.AppSpecContainersReadinessProbeShellIn, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputAppSpecContainersReadinessProbeShellIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) + res := graphql.MarshalString(*v) + return res } -func (ec *executionContext) marshalOAppSpecContainersReadinessProbeTcp2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersReadinessProbeTCP(ctx context.Context, sel ast.SelectionSet, v *model.AppSpecContainersReadinessProbeTCP) graphql.Marshaler { +func (ec *executionContext) marshalOEnvironment2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐEnvironment(ctx context.Context, sel ast.SelectionSet, v *entities.Environment) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._AppSpecContainersReadinessProbeTcp(ctx, sel, v) -} - -func (ec *executionContext) unmarshalOAppSpecContainersReadinessProbeTcpIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersReadinessProbeTCPIn(ctx context.Context, v interface{}) (*model.AppSpecContainersReadinessProbeTCPIn, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputAppSpecContainersReadinessProbeTcpIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) + return ec._Environment(ctx, sel, v) } -func (ec *executionContext) marshalOAppSpecContainersResourceCpu2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersResourceCPU(ctx context.Context, sel ast.SelectionSet, v *model.AppSpecContainersResourceCPU) graphql.Marshaler { +func (ec *executionContext) marshalOEnvironmentPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐEnvironmentPaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.EnvironmentPaginatedRecords) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._AppSpecContainersResourceCpu(ctx, sel, v) + return ec._EnvironmentPaginatedRecords(ctx, sel, v) } -func (ec *executionContext) unmarshalOAppSpecContainersResourceCpuIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersResourceCPUIn(ctx context.Context, v interface{}) (*model.AppSpecContainersResourceCPUIn, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputAppSpecContainersResourceCpuIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOAppSpecContainersResourceMemory2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersResourceMemory(ctx context.Context, sel ast.SelectionSet, v *model.AppSpecContainersResourceMemory) graphql.Marshaler { +func (ec *executionContext) marshalOGithub__com___kloudlite___api___pkg___types__EncodedString2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIPkgTypesEncodedString(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteAPIPkgTypesEncodedString) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._AppSpecContainersResourceMemory(ctx, sel, v) -} - -func (ec *executionContext) unmarshalOAppSpecContainersResourceMemoryIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersResourceMemoryIn(ctx context.Context, v interface{}) (*model.AppSpecContainersResourceMemoryIn, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputAppSpecContainersResourceMemoryIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) + return ec._Github__com___kloudlite___api___pkg___types__EncodedString(ctx, sel, v) } -func (ec *executionContext) marshalOAppSpecContainersVolumes2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersVolumes(ctx context.Context, sel ast.SelectionSet, v []*model.AppSpecContainersVolumes) graphql.Marshaler { +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__AppSvc2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppSvcᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GithubComKloudliteOperatorApisCrdsV1AppSvc) graphql.Marshaler { if v == nil { return graphql.Null } @@ -28288,7 +48556,7 @@ func (ec *executionContext) marshalOAppSpecContainersVolumes2ᚕᚖkloudliteᚗi if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalOAppSpecContainersVolumes2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersVolumes(ctx, sel, v[i]) + ret[i] = ec.marshalNGithub__com___kloudlite___operator___apis___crds___v1__AppSvc2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppSvc(ctx, sel, v[i]) } if isLen1 { f(i) @@ -28299,17 +48567,16 @@ func (ec *executionContext) marshalOAppSpecContainersVolumes2ᚕᚖkloudliteᚗi } wg.Wait() - return ret -} - -func (ec *executionContext) marshalOAppSpecContainersVolumes2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersVolumes(ctx context.Context, sel ast.SelectionSet, v *model.AppSpecContainersVolumes) graphql.Marshaler { - if v == nil { - return graphql.Null + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } } - return ec._AppSpecContainersVolumes(ctx, sel, v) + + return ret } -func (ec *executionContext) unmarshalOAppSpecContainersVolumesIn2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersVolumesIn(ctx context.Context, v interface{}) ([]*model.AppSpecContainersVolumesIn, error) { +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__AppSvcIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppSvcInᚄ(ctx context.Context, v interface{}) ([]*model.GithubComKloudliteOperatorApisCrdsV1AppSvcIn, error) { if v == nil { return nil, nil } @@ -28318,10 +48585,10 @@ func (ec *executionContext) unmarshalOAppSpecContainersVolumesIn2ᚕᚖkloudlite vSlice = graphql.CoerceList(v) } var err error - res := make([]*model.AppSpecContainersVolumesIn, len(vSlice)) + res := make([]*model.GithubComKloudliteOperatorApisCrdsV1AppSvcIn, len(vSlice)) for i := range vSlice { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalOAppSpecContainersVolumesIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersVolumesIn(ctx, vSlice[i]) + res[i], err = ec.unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__AppSvcIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppSvcIn(ctx, vSlice[i]) if err != nil { return nil, err } @@ -28329,15 +48596,38 @@ func (ec *executionContext) unmarshalOAppSpecContainersVolumesIn2ᚕᚖkloudlite return res, nil } -func (ec *executionContext) unmarshalOAppSpecContainersVolumesIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersVolumesIn(ctx context.Context, v interface{}) (*model.AppSpecContainersVolumesIn, error) { +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__BasicAuth2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1BasicAuth(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1BasicAuth) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Github__com___kloudlite___operator___apis___crds___v1__BasicAuth(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__BasicAuthIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1BasicAuthIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1BasicAuthIn, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalInputAppSpecContainersVolumesIn(ctx, v) + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__BasicAuthIn(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOAppSpecContainersVolumesItems2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersVolumesItems(ctx context.Context, sel ast.SelectionSet, v []*model.AppSpecContainersVolumesItems) graphql.Marshaler { +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ConfigOrSecret(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1ConfigOrSecret, error) { + if v == nil { + return nil, nil + } + var res = new(model.GithubComKloudliteOperatorApisCrdsV1ConfigOrSecret) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ConfigOrSecret(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1ConfigOrSecret) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__ContainerEnv2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerEnvᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GithubComKloudliteOperatorApisCrdsV1ContainerEnv) graphql.Marshaler { if v == nil { return graphql.Null } @@ -28364,7 +48654,7 @@ func (ec *executionContext) marshalOAppSpecContainersVolumesItems2ᚕᚖkloudlit if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalOAppSpecContainersVolumesItems2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersVolumesItems(ctx, sel, v[i]) + ret[i] = ec.marshalNGithub__com___kloudlite___operator___apis___crds___v1__ContainerEnv2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerEnv(ctx, sel, v[i]) } if isLen1 { f(i) @@ -28375,17 +48665,16 @@ func (ec *executionContext) marshalOAppSpecContainersVolumesItems2ᚕᚖkloudlit } wg.Wait() - return ret -} - -func (ec *executionContext) marshalOAppSpecContainersVolumesItems2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersVolumesItems(ctx context.Context, sel ast.SelectionSet, v *model.AppSpecContainersVolumesItems) graphql.Marshaler { - if v == nil { - return graphql.Null + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } } - return ec._AppSpecContainersVolumesItems(ctx, sel, v) + + return ret } -func (ec *executionContext) unmarshalOAppSpecContainersVolumesItemsIn2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersVolumesItemsIn(ctx context.Context, v interface{}) ([]*model.AppSpecContainersVolumesItemsIn, error) { +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__ContainerEnvIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerEnvInᚄ(ctx context.Context, v interface{}) ([]*model.GithubComKloudliteOperatorApisCrdsV1ContainerEnvIn, error) { if v == nil { return nil, nil } @@ -28394,10 +48683,10 @@ func (ec *executionContext) unmarshalOAppSpecContainersVolumesItemsIn2ᚕᚖklou vSlice = graphql.CoerceList(v) } var err error - res := make([]*model.AppSpecContainersVolumesItemsIn, len(vSlice)) + res := make([]*model.GithubComKloudliteOperatorApisCrdsV1ContainerEnvIn, len(vSlice)) for i := range vSlice { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalOAppSpecContainersVolumesItemsIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersVolumesItemsIn(ctx, vSlice[i]) + res[i], err = ec.unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ContainerEnvIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerEnvIn(ctx, vSlice[i]) if err != nil { return nil, err } @@ -28405,53 +48694,22 @@ func (ec *executionContext) unmarshalOAppSpecContainersVolumesItemsIn2ᚕᚖklou return res, nil } -func (ec *executionContext) unmarshalOAppSpecContainersVolumesItemsIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecContainersVolumesItemsIn(ctx context.Context, v interface{}) (*model.AppSpecContainersVolumesItemsIn, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputAppSpecContainersVolumesItemsIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOAppSpecHpa2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecHpa(ctx context.Context, sel ast.SelectionSet, v *model.AppSpecHpa) graphql.Marshaler { +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__ContainerResource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerResource(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1ContainerResource) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._AppSpecHpa(ctx, sel, v) + return ec._Github__com___kloudlite___operator___apis___crds___v1__ContainerResource(ctx, sel, v) } -func (ec *executionContext) unmarshalOAppSpecHpaIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecHpaIn(ctx context.Context, v interface{}) (*model.AppSpecHpaIn, error) { +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__ContainerResourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerResourceIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1ContainerResourceIn, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalInputAppSpecHpaIn(ctx, v) + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ContainerResourceIn(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalOAppSpecIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecIn(ctx context.Context, v interface{}) (*model.AppSpecIn, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputAppSpecIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOAppSpecIntercept2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecIntercept(ctx context.Context, sel ast.SelectionSet, v *model.AppSpecIntercept) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._AppSpecIntercept(ctx, sel, v) -} - -func (ec *executionContext) unmarshalOAppSpecInterceptIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecInterceptIn(ctx context.Context, v interface{}) (*model.AppSpecInterceptIn, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputAppSpecInterceptIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOAppSpecServices2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecServices(ctx context.Context, sel ast.SelectionSet, v []*model.AppSpecServices) graphql.Marshaler { +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__ContainerVolume2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerVolumeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GithubComKloudliteOperatorApisCrdsV1ContainerVolume) graphql.Marshaler { if v == nil { return graphql.Null } @@ -28478,7 +48736,7 @@ func (ec *executionContext) marshalOAppSpecServices2ᚕᚖkloudliteᚗioᚋapps if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalOAppSpecServices2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecServices(ctx, sel, v[i]) + ret[i] = ec.marshalNGithub__com___kloudlite___operator___apis___crds___v1__ContainerVolume2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerVolume(ctx, sel, v[i]) } if isLen1 { f(i) @@ -28489,17 +48747,16 @@ func (ec *executionContext) marshalOAppSpecServices2ᚕᚖkloudliteᚗioᚋapps } wg.Wait() - return ret -} - -func (ec *executionContext) marshalOAppSpecServices2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecServices(ctx context.Context, sel ast.SelectionSet, v *model.AppSpecServices) graphql.Marshaler { - if v == nil { - return graphql.Null + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } } - return ec._AppSpecServices(ctx, sel, v) + + return ret } -func (ec *executionContext) unmarshalOAppSpecServicesIn2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecServicesIn(ctx context.Context, v interface{}) ([]*model.AppSpecServicesIn, error) { +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__ContainerVolumeIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerVolumeInᚄ(ctx context.Context, v interface{}) ([]*model.GithubComKloudliteOperatorApisCrdsV1ContainerVolumeIn, error) { if v == nil { return nil, nil } @@ -28508,10 +48765,10 @@ func (ec *executionContext) unmarshalOAppSpecServicesIn2ᚕᚖkloudliteᚗioᚋa vSlice = graphql.CoerceList(v) } var err error - res := make([]*model.AppSpecServicesIn, len(vSlice)) + res := make([]*model.GithubComKloudliteOperatorApisCrdsV1ContainerVolumeIn, len(vSlice)) for i := range vSlice { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalOAppSpecServicesIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecServicesIn(ctx, vSlice[i]) + res[i], err = ec.unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ContainerVolumeIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerVolumeIn(ctx, vSlice[i]) if err != nil { return nil, err } @@ -28519,15 +48776,7 @@ func (ec *executionContext) unmarshalOAppSpecServicesIn2ᚕᚖkloudliteᚗioᚋa return res, nil } -func (ec *executionContext) unmarshalOAppSpecServicesIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecServicesIn(ctx context.Context, v interface{}) (*model.AppSpecServicesIn, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputAppSpecServicesIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOAppSpecTolerations2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecTolerations(ctx context.Context, sel ast.SelectionSet, v []*model.AppSpecTolerations) graphql.Marshaler { +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerVolumeItemᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GithubComKloudliteOperatorApisCrdsV1ContainerVolumeItem) graphql.Marshaler { if v == nil { return graphql.Null } @@ -28554,7 +48803,7 @@ func (ec *executionContext) marshalOAppSpecTolerations2ᚕᚖkloudliteᚗioᚋap if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalOAppSpecTolerations2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecTolerations(ctx, sel, v[i]) + ret[i] = ec.marshalNGithub__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerVolumeItem(ctx, sel, v[i]) } if isLen1 { f(i) @@ -28565,71 +48814,51 @@ func (ec *executionContext) marshalOAppSpecTolerations2ᚕᚖkloudliteᚗioᚋap } wg.Wait() - return ret -} - -func (ec *executionContext) marshalOAppSpecTolerations2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecTolerations(ctx context.Context, sel ast.SelectionSet, v *model.AppSpecTolerations) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._AppSpecTolerations(ctx, sel, v) -} - -func (ec *executionContext) unmarshalOAppSpecTolerationsIn2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecTolerationsIn(ctx context.Context, v interface{}) ([]*model.AppSpecTolerationsIn, error) { - if v == nil { - return nil, nil - } - var vSlice []interface{} - if v != nil { - vSlice = graphql.CoerceList(v) - } - var err error - res := make([]*model.AppSpecTolerationsIn, len(vSlice)) - for i := range vSlice { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalOAppSpecTolerationsIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecTolerationsIn(ctx, vSlice[i]) - if err != nil { - return nil, err + for _, e := range ret { + if e == graphql.Null { + return graphql.Null } } - return res, nil + + return ret } -func (ec *executionContext) unmarshalOAppSpecTolerationsIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppSpecTolerationsIn(ctx context.Context, v interface{}) (*model.AppSpecTolerationsIn, error) { +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItemIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerVolumeItemInᚄ(ctx context.Context, v interface{}) ([]*model.GithubComKloudliteOperatorApisCrdsV1ContainerVolumeItemIn, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalInputAppSpecTolerationsIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { - res, err := graphql.UnmarshalBoolean(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { - res := graphql.MarshalBoolean(v) - return res + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.GithubComKloudliteOperatorApisCrdsV1ContainerVolumeItemIn, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItemIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ContainerVolumeItemIn(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil } -func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v interface{}) (*bool, error) { +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__Cors2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1Cors(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1Cors) graphql.Marshaler { if v == nil { - return nil, nil + return graphql.Null } - res, err := graphql.UnmarshalBoolean(v) - return &res, graphql.ErrorOnPath(ctx, err) + return ec._Github__com___kloudlite___operator___apis___crds___v1__Cors(ctx, sel, v) } -func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__CorsIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1CorsIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1CorsIn, error) { if v == nil { - return graphql.Null + return nil, nil } - res := graphql.MarshalBoolean(*v) - return res + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__CorsIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOConfig2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐConfigᚄ(ctx context.Context, sel ast.SelectionSet, v []*entities.Config) graphql.Marshaler { +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__EnvFrom2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1EnvFromᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GithubComKloudliteOperatorApisCrdsV1EnvFrom) graphql.Marshaler { if v == nil { return graphql.Null } @@ -28656,7 +48885,7 @@ func (ec *executionContext) marshalOConfig2ᚕᚖkloudliteᚗioᚋappsᚋconsole if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNConfig2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐConfig(ctx, sel, v[i]) + ret[i] = ec.marshalNGithub__com___kloudlite___operator___apis___crds___v1__EnvFrom2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1EnvFrom(ctx, sel, v[i]) } if isLen1 { f(i) @@ -28676,141 +48905,179 @@ func (ec *executionContext) marshalOConfig2ᚕᚖkloudliteᚗioᚋappsᚋconsole return ret } -func (ec *executionContext) marshalOConfig2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐConfig(ctx context.Context, sel ast.SelectionSet, v *entities.Config) graphql.Marshaler { +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__EnvFromIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1EnvFromInᚄ(ctx context.Context, v interface{}) ([]*model.GithubComKloudliteOperatorApisCrdsV1EnvFromIn, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.GithubComKloudliteOperatorApisCrdsV1EnvFromIn, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__EnvFromIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1EnvFromIn(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1EnvironmentRouting(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1EnvironmentRouting) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._Config(ctx, sel, v) + return ec._Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting(ctx, sel, v) } -func (ec *executionContext) unmarshalODate2ᚖstring(ctx context.Context, v interface{}) (*string, error) { +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1EnvironmentRoutingIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1EnvironmentRoutingIn, error) { if v == nil { return nil, nil } - res, err := graphql.UnmarshalString(v) + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingIn(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalODate2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingMode2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋapisᚋcrdsᚋv1ᚐEnvironmentRoutingMode(ctx context.Context, v interface{}) (*v1.EnvironmentRoutingMode, error) { + if v == nil { + return nil, nil + } + tmp, err := graphql.UnmarshalString(v) + res := v1.EnvironmentRoutingMode(tmp) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingMode2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋapisᚋcrdsᚋv1ᚐEnvironmentRoutingMode(ctx context.Context, sel ast.SelectionSet, v *v1.EnvironmentRoutingMode) graphql.Marshaler { if v == nil { return graphql.Null } - res := graphql.MarshalString(*v) + res := graphql.MarshalString(string(*v)) return res } -func (ec *executionContext) unmarshalOInt2int64(ctx context.Context, v interface{}) (int64, error) { - res, err := graphql.UnmarshalInt64(v) - return res, graphql.ErrorOnPath(ctx, err) +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1EnvironmentSpec(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1EnvironmentSpec) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec(ctx, sel, v) } -func (ec *executionContext) marshalOInt2int64(ctx context.Context, sel ast.SelectionSet, v int64) graphql.Marshaler { - res := graphql.MarshalInt64(v) - return res +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__EnvironmentSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1EnvironmentSpecIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1EnvironmentSpecIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__EnvironmentSpecIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalOInt2ᚖint(ctx context.Context, v interface{}) (*int, error) { +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__HPA2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1Hpa(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1Hpa) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Github__com___kloudlite___operator___apis___crds___v1__HPA(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__HPAIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1HPAIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1HPAIn, error) { if v == nil { return nil, nil } - res, err := graphql.UnmarshalInt(v) + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__HPAIn(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.SelectionSet, v *int) graphql.Marshaler { +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__HttpGetProbe2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1HTTPGetProbe(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1HTTPGetProbe) graphql.Marshaler { if v == nil { return graphql.Null } - res := graphql.MarshalInt(*v) - return res + return ec._Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe(ctx, sel, v) } -func (ec *executionContext) unmarshalOJson2map(ctx context.Context, v interface{}) (map[string]interface{}, error) { +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__HttpGetProbeIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1HTTPGetProbeIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1HTTPGetProbeIn, error) { if v == nil { return nil, nil } - res, err := graphql.UnmarshalMap(v) - return res, graphql.ErrorOnPath(ctx, err) + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__HttpGetProbeIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOJson2map(ctx context.Context, sel ast.SelectionSet, v map[string]interface{}) graphql.Marshaler { +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__Https2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1HTTPS(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1HTTPS) graphql.Marshaler { if v == nil { return graphql.Null } - res := graphql.MarshalMap(v) - return res + return ec._Github__com___kloudlite___operator___apis___crds___v1__Https(ctx, sel, v) } -func (ec *executionContext) marshalOManagedResource2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐMResᚄ(ctx context.Context, sel ast.SelectionSet, v []*entities.MRes) graphql.Marshaler { +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__HttpsIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1HTTPSIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1HTTPSIn, error) { if v == nil { - return graphql.Null + return nil, nil } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__HttpsIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__Intercept2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1Intercept(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1Intercept) graphql.Marshaler { + if v == nil { + return graphql.Null } - 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.marshalNManagedResource2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐMRes(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } + return ec._Github__com___kloudlite___operator___apis___crds___v1__Intercept(ctx, sel, v) +} +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__InterceptIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1InterceptIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1InterceptIn, error) { + if v == nil { + return nil, nil } - wg.Wait() + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__InterceptIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__Probe2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1Probe(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1Probe) graphql.Marshaler { + if v == nil { + return graphql.Null } + return ec._Github__com___kloudlite___operator___apis___crds___v1__Probe(ctx, sel, v) +} - return ret +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__ProbeIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ProbeIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1ProbeIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ProbeIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOManagedResource2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐMRes(ctx context.Context, sel ast.SelectionSet, v *entities.MRes) graphql.Marshaler { +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpec(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpec) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._ManagedResource(ctx, sel, v) + return ec._Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpecIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpecIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpecIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOManagedResourceSpec2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedResourceSpec(ctx context.Context, sel ast.SelectionSet, v *model.ManagedResourceSpec) graphql.Marshaler { +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__RateLimit2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1RateLimit(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1RateLimit) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._ManagedResourceSpec(ctx, sel, v) + return ec._Github__com___kloudlite___operator___apis___crds___v1__RateLimit(ctx, sel, v) } -func (ec *executionContext) unmarshalOManagedResourceSpecIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedResourceSpecIn(ctx context.Context, v interface{}) (*model.ManagedResourceSpecIn, error) { +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__RateLimitIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1RateLimitIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1RateLimitIn, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalInputManagedResourceSpecIn(ctx, v) + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__RateLimitIn(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOManagedService2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐMSvcᚄ(ctx context.Context, sel ast.SelectionSet, v []*entities.MSvc) graphql.Marshaler { +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__Route2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1Routeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GithubComKloudliteOperatorApisCrdsV1Route) graphql.Marshaler { if v == nil { return graphql.Null } @@ -28837,7 +49104,7 @@ func (ec *executionContext) marshalOManagedService2ᚕᚖkloudliteᚗioᚋapps if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNManagedService2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐMSvc(ctx, sel, v[i]) + ret[i] = ec.marshalNGithub__com___kloudlite___operator___apis___crds___v1__Route2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1Route(ctx, sel, v[i]) } if isLen1 { f(i) @@ -28857,29 +49124,57 @@ func (ec *executionContext) marshalOManagedService2ᚕᚖkloudliteᚗioᚋapps return ret } -func (ec *executionContext) marshalOManagedService2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐMSvc(ctx context.Context, sel ast.SelectionSet, v *entities.MSvc) graphql.Marshaler { +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__RouteIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1RouteInᚄ(ctx context.Context, v interface{}) ([]*model.GithubComKloudliteOperatorApisCrdsV1RouteIn, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.GithubComKloudliteOperatorApisCrdsV1RouteIn, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__RouteIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1RouteIn(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__ShellProbe2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ShellProbe(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1ShellProbe) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._ManagedService(ctx, sel, v) + return ec._Github__com___kloudlite___operator___apis___crds___v1__ShellProbe(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__ShellProbeIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ShellProbeIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1ShellProbeIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ShellProbeIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOManagedServiceSpec2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedServiceSpec(ctx context.Context, sel ast.SelectionSet, v *model.ManagedServiceSpec) graphql.Marshaler { +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__TcpProbe2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1TCPProbe(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1TCPProbe) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._ManagedServiceSpec(ctx, sel, v) + return ec._Github__com___kloudlite___operator___apis___crds___v1__TcpProbe(ctx, sel, v) } -func (ec *executionContext) unmarshalOManagedServiceSpecIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedServiceSpecIn(ctx context.Context, v interface{}) (*model.ManagedServiceSpecIn, error) { +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__TcpProbeIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1TCPProbeIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1TCPProbeIn, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalInputManagedServiceSpecIn(ctx, v) + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__TcpProbeIn(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOManagedServiceSpecTolerations2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedServiceSpecTolerations(ctx context.Context, sel ast.SelectionSet, v []*model.ManagedServiceSpecTolerations) graphql.Marshaler { +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___wireguard___v1__CNameRecord2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisWireguardV1CNameRecordᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GithubComKloudliteOperatorApisWireguardV1CNameRecord) graphql.Marshaler { if v == nil { return graphql.Null } @@ -28906,7 +49201,7 @@ func (ec *executionContext) marshalOManagedServiceSpecTolerations2ᚕᚖkloudlit if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalOManagedServiceSpecTolerations2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedServiceSpecTolerations(ctx, sel, v[i]) + ret[i] = ec.marshalNGithub__com___kloudlite___operator___apis___wireguard___v1__CNameRecord2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisWireguardV1CNameRecord(ctx, sel, v[i]) } if isLen1 { f(i) @@ -28917,17 +49212,16 @@ func (ec *executionContext) marshalOManagedServiceSpecTolerations2ᚕᚖkloudlit } wg.Wait() - return ret -} - -func (ec *executionContext) marshalOManagedServiceSpecTolerations2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedServiceSpecTolerations(ctx context.Context, sel ast.SelectionSet, v *model.ManagedServiceSpecTolerations) graphql.Marshaler { - if v == nil { - return graphql.Null + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } } - return ec._ManagedServiceSpecTolerations(ctx, sel, v) + + return ret } -func (ec *executionContext) unmarshalOManagedServiceSpecTolerationsIn2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedServiceSpecTolerationsIn(ctx context.Context, v interface{}) ([]*model.ManagedServiceSpecTolerationsIn, error) { +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___wireguard___v1__CNameRecordIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisWireguardV1CNameRecordInᚄ(ctx context.Context, v interface{}) ([]*model.GithubComKloudliteOperatorApisWireguardV1CNameRecordIn, error) { if v == nil { return nil, nil } @@ -28936,10 +49230,10 @@ func (ec *executionContext) unmarshalOManagedServiceSpecTolerationsIn2ᚕᚖklou vSlice = graphql.CoerceList(v) } var err error - res := make([]*model.ManagedServiceSpecTolerationsIn, len(vSlice)) + res := make([]*model.GithubComKloudliteOperatorApisWireguardV1CNameRecordIn, len(vSlice)) for i := range vSlice { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalOManagedServiceSpecTolerationsIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedServiceSpecTolerationsIn(ctx, vSlice[i]) + res[i], err = ec.unmarshalNGithub__com___kloudlite___operator___apis___wireguard___v1__CNameRecordIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisWireguardV1CNameRecordIn(ctx, vSlice[i]) if err != nil { return nil, err } @@ -28947,46 +49241,22 @@ func (ec *executionContext) unmarshalOManagedServiceSpecTolerationsIn2ᚕᚖklou return res, nil } -func (ec *executionContext) unmarshalOManagedServiceSpecTolerationsIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedServiceSpecTolerationsIn(ctx context.Context, v interface{}) (*model.ManagedServiceSpecTolerationsIn, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputManagedServiceSpecTolerationsIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) unmarshalOMap2map(ctx context.Context, v interface{}) (map[string]interface{}, error) { - if v == nil { - return nil, nil - } - res, err := graphql.UnmarshalMap(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOMap2map(ctx context.Context, sel ast.SelectionSet, v map[string]interface{}) graphql.Marshaler { - if v == nil { - return graphql.Null - } - res := graphql.MarshalMap(v) - return res -} - -func (ec *executionContext) marshalOOverrides2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋapisᚋcrdsᚋv1ᚐJsonPatch(ctx context.Context, sel ast.SelectionSet, v *v11.JsonPatch) graphql.Marshaler { +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisWireguardV1DeviceSpec(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisWireguardV1DeviceSpec) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._Overrides(ctx, sel, v) + return ec._Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec(ctx, sel, v) } -func (ec *executionContext) unmarshalOOverridesIn2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋapisᚋcrdsᚋv1ᚐJsonPatch(ctx context.Context, v interface{}) (*v11.JsonPatch, error) { +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___wireguard___v1__DeviceSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisWireguardV1DeviceSpecIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisWireguardV1DeviceSpecIn, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalInputOverridesIn(ctx, v) + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___wireguard___v1__DeviceSpecIn(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOPatch2ᚕgithubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋjsonᚑpatchᚐPatchOperationᚄ(ctx context.Context, sel ast.SelectionSet, v []json_patch.PatchOperation) graphql.Marshaler { +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___wireguard___v1__Port2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisWireguardV1Portᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GithubComKloudliteOperatorApisWireguardV1Port) graphql.Marshaler { if v == nil { return graphql.Null } @@ -29013,7 +49283,7 @@ func (ec *executionContext) marshalOPatch2ᚕgithubᚗcomᚋkloudliteᚋoperator if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNPatch2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋjsonᚑpatchᚐPatchOperation(ctx, sel, v[i]) + ret[i] = ec.marshalNGithub__com___kloudlite___operator___apis___wireguard___v1__Port2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisWireguardV1Port(ctx, sel, v[i]) } if isLen1 { f(i) @@ -29033,7 +49303,7 @@ func (ec *executionContext) marshalOPatch2ᚕgithubᚗcomᚋkloudliteᚋoperator return ret } -func (ec *executionContext) unmarshalOPatchIn2ᚕgithubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋjsonᚑpatchᚐPatchOperationᚄ(ctx context.Context, v interface{}) ([]json_patch.PatchOperation, error) { +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___wireguard___v1__PortIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisWireguardV1PortInᚄ(ctx context.Context, v interface{}) ([]*model.GithubComKloudliteOperatorApisWireguardV1PortIn, error) { if v == nil { return nil, nil } @@ -29042,10 +49312,10 @@ func (ec *executionContext) unmarshalOPatchIn2ᚕgithubᚗcomᚋkloudliteᚋoper vSlice = graphql.CoerceList(v) } var err error - res := make([]json_patch.PatchOperation, len(vSlice)) + res := make([]*model.GithubComKloudliteOperatorApisWireguardV1PortIn, len(vSlice)) for i := range vSlice { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalNPatchIn2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋjsonᚑpatchᚐPatchOperation(ctx, vSlice[i]) + res[i], err = ec.unmarshalNGithub__com___kloudlite___operator___apis___wireguard___v1__PortIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisWireguardV1PortIn(ctx, vSlice[i]) if err != nil { return nil, err } @@ -29053,7 +49323,7 @@ func (ec *executionContext) unmarshalOPatchIn2ᚕgithubᚗcomᚋkloudliteᚋoper return res, nil } -func (ec *executionContext) marshalOProject2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐProjectᚄ(ctx context.Context, sel ast.SelectionSet, v []*entities.Project) graphql.Marshaler { +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___pkg___operator__ResourceRef2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorResourceRefᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GithubComKloudliteOperatorPkgOperatorResourceRef) graphql.Marshaler { if v == nil { return graphql.Null } @@ -29080,7 +49350,7 @@ func (ec *executionContext) marshalOProject2ᚕᚖkloudliteᚗioᚋappsᚋconsol if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNProject2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐProject(ctx, sel, v[i]) + ret[i] = ec.marshalNGithub__com___kloudlite___operator___pkg___operator__ResourceRef2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorResourceRef(ctx, sel, v[i]) } if isLen1 { f(i) @@ -29100,29 +49370,116 @@ func (ec *executionContext) marshalOProject2ᚕᚖkloudliteᚗioᚋappsᚋconsol return ret } -func (ec *executionContext) marshalOProject2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐProject(ctx context.Context, sel ast.SelectionSet, v *entities.Project) graphql.Marshaler { +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___pkg___operator__Status2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx context.Context, sel ast.SelectionSet, v operator.Status) graphql.Marshaler { + return ec._Github__com___kloudlite___operator___pkg___operator__Status(ctx, sel, &v) +} + +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___pkg___raw____json__RawJson2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgRawJSONRawJSON(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorPkgRawJSONRawJSON) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._Project(ctx, sel, v) + return ec._Github__com___kloudlite___operator___pkg___raw____json__RawJson(ctx, sel, v) +} + +func (ec *executionContext) marshalOImagePullSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐImagePullSecret(ctx context.Context, sel ast.SelectionSet, v *entities.ImagePullSecret) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._ImagePullSecret(ctx, sel, v) +} + +func (ec *executionContext) marshalOImagePullSecretPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐImagePullSecretPaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.ImagePullSecretPaginatedRecords) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._ImagePullSecretPaginatedRecords(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOInt2int32(ctx context.Context, v interface{}) (int32, error) { + res, err := graphql.UnmarshalInt32(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOInt2int32(ctx context.Context, sel ast.SelectionSet, v int32) graphql.Marshaler { + res := graphql.MarshalInt32(v) + return res +} + +func (ec *executionContext) unmarshalOInt2int64(ctx context.Context, v interface{}) (int64, error) { + res, err := graphql.UnmarshalInt64(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOInt2int64(ctx context.Context, sel ast.SelectionSet, v int64) graphql.Marshaler { + res := graphql.MarshalInt64(v) + return res } -func (ec *executionContext) marshalOProjectSpec2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐProjectSpec(ctx context.Context, sel ast.SelectionSet, v *model.ProjectSpec) graphql.Marshaler { +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 } - return ec._ProjectSpec(ctx, sel, v) + res := graphql.MarshalInt(*v) + return res } -func (ec *executionContext) unmarshalOProjectSpecIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐProjectSpecIn(ctx context.Context, v interface{}) (*model.ProjectSpecIn, error) { +func (ec *executionContext) unmarshalOInt2ᚖint64(ctx context.Context, v interface{}) (*int64, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalInputProjectSpecIn(ctx, v) + res, err := graphql.UnmarshalInt64(v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalORouter2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐRouterᚄ(ctx context.Context, sel ast.SelectionSet, v []*entities.Router) graphql.Marshaler { +func (ec *executionContext) marshalOInt2ᚖint64(ctx context.Context, sel ast.SelectionSet, v *int64) graphql.Marshaler { + if v == nil { + return graphql.Null + } + res := graphql.MarshalInt64(*v) + return res +} + +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__SecretType2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1SecretType(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1SecretType, error) { + if v == nil { + return nil, nil + } + var res = new(model.K8sIoAPICoreV1SecretType) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOK8s__io___api___core___v1__SecretType2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1SecretType(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1SecretType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__TaintEffect2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TaintEffect(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1TaintEffect, error) { + if v == nil { + return nil, nil + } + var res = new(model.K8sIoAPICoreV1TaintEffect) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOK8s__io___api___core___v1__TaintEffect2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TaintEffect(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1TaintEffect) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) marshalOK8s__io___api___core___v1__Toleration2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1Tolerationᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.K8sIoAPICoreV1Toleration) graphql.Marshaler { if v == nil { return graphql.Null } @@ -29149,7 +49506,7 @@ func (ec *executionContext) marshalORouter2ᚕᚖkloudliteᚗioᚋappsᚋconsole if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNRouter2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐRouter(ctx, sel, v[i]) + ret[i] = ec.marshalNK8s__io___api___core___v1__Toleration2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1Toleration(ctx, sel, v[i]) } if isLen1 { f(i) @@ -29169,137 +49526,242 @@ func (ec *executionContext) marshalORouter2ᚕᚖkloudliteᚗioᚋappsᚋconsole return ret } -func (ec *executionContext) marshalORouter2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐRouter(ctx context.Context, sel ast.SelectionSet, v *entities.Router) graphql.Marshaler { +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__TolerationIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TolerationInᚄ(ctx context.Context, v interface{}) ([]*model.K8sIoAPICoreV1TolerationIn, error) { if v == nil { - return graphql.Null + return nil, nil } - return ec._Router(ctx, sel, v) + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.K8sIoAPICoreV1TolerationIn, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNK8s__io___api___core___v1__TolerationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TolerationIn(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__TolerationOperator2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TolerationOperator(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1TolerationOperator, error) { + if v == nil { + return nil, nil + } + var res = new(model.K8sIoAPICoreV1TolerationOperator) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalORouterSpec2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterSpec(ctx context.Context, sel ast.SelectionSet, v *model.RouterSpec) graphql.Marshaler { +func (ec *executionContext) marshalOK8s__io___api___core___v1__TolerationOperator2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TolerationOperator(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1TolerationOperator) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._RouterSpec(ctx, sel, v) + return v } -func (ec *executionContext) marshalORouterSpecBasicAuth2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterSpecBasicAuth(ctx context.Context, sel ast.SelectionSet, v *model.RouterSpecBasicAuth) graphql.Marshaler { +func (ec *executionContext) marshalOManagedResource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐManagedResource(ctx context.Context, sel ast.SelectionSet, v *entities.ManagedResource) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._RouterSpecBasicAuth(ctx, sel, v) + return ec._ManagedResource(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOManagedResourceKeyRefIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐManagedResourceKeyRef(ctx context.Context, v interface{}) ([]*domain.ManagedResourceKeyRef, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*domain.ManagedResourceKeyRef, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalOManagedResourceKeyRefIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐManagedResourceKeyRef(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil } -func (ec *executionContext) unmarshalORouterSpecBasicAuthIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterSpecBasicAuthIn(ctx context.Context, v interface{}) (*model.RouterSpecBasicAuthIn, error) { +func (ec *executionContext) unmarshalOManagedResourceKeyRefIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐManagedResourceKeyRef(ctx context.Context, v interface{}) (*domain.ManagedResourceKeyRef, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalInputRouterSpecBasicAuthIn(ctx, v) + res, err := ec.unmarshalInputManagedResourceKeyRefIn(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalORouterSpecCors2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterSpecCors(ctx context.Context, sel ast.SelectionSet, v *model.RouterSpecCors) graphql.Marshaler { +func (ec *executionContext) marshalOManagedResourcePaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedResourcePaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.ManagedResourcePaginatedRecords) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._RouterSpecCors(ctx, sel, v) + return ec._ManagedResourcePaginatedRecords(ctx, sel, v) } -func (ec *executionContext) unmarshalORouterSpecCorsIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterSpecCorsIn(ctx context.Context, v interface{}) (*model.RouterSpecCorsIn, error) { +func (ec *executionContext) unmarshalOMap2map(ctx context.Context, v interface{}) (map[string]interface{}, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalInputRouterSpecCorsIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) + res, err := graphql.UnmarshalMap(v) + return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalORouterSpecHttps2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterSpecHTTPS(ctx context.Context, sel ast.SelectionSet, v *model.RouterSpecHTTPS) graphql.Marshaler { +func (ec *executionContext) marshalOMap2map(ctx context.Context, sel ast.SelectionSet, v map[string]interface{}) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._RouterSpecHttps(ctx, sel, v) + res := graphql.MarshalMap(v) + return res } -func (ec *executionContext) unmarshalORouterSpecHttpsIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterSpecHTTPSIn(ctx context.Context, v interface{}) (*model.RouterSpecHTTPSIn, error) { +func (ec *executionContext) unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx context.Context, v interface{}) (*repos.MatchFilter, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalInputRouterSpecHttpsIn(ctx, v) + res, err := ec.unmarshalInputMatchFilterIn(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalORouterSpecIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterSpecIn(ctx context.Context, v interface{}) (*model.RouterSpecIn, error) { +func (ec *executionContext) marshalOMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx context.Context, sel ast.SelectionSet, v v12.ObjectMeta) graphql.Marshaler { + return ec._Metadata(ctx, sel, &v) +} + +func (ec *executionContext) unmarshalOMetadataIn2ᚖk8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx context.Context, v interface{}) (*v12.ObjectMeta, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalInputRouterSpecIn(ctx, v) + res, err := ec.unmarshalInputMetadataIn(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalORouterSpecRateLimit2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterSpecRateLimit(ctx context.Context, sel ast.SelectionSet, v *model.RouterSpecRateLimit) graphql.Marshaler { +func (ec *executionContext) marshalOProject2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProject(ctx context.Context, sel ast.SelectionSet, v *entities.Project) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Project(ctx, sel, v) +} + +func (ec *executionContext) marshalOProjectManagedService2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProjectManagedService(ctx context.Context, sel ast.SelectionSet, v *entities.ProjectManagedService) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._RouterSpecRateLimit(ctx, sel, v) + return ec._ProjectManagedService(ctx, sel, v) } -func (ec *executionContext) unmarshalORouterSpecRateLimitIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterSpecRateLimitIn(ctx context.Context, v interface{}) (*model.RouterSpecRateLimitIn, error) { +func (ec *executionContext) marshalOProjectManagedServicePaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐProjectManagedServicePaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.ProjectManagedServicePaginatedRecords) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._ProjectManagedServicePaginatedRecords(ctx, sel, v) +} + +func (ec *executionContext) marshalOProjectPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐProjectPaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.ProjectPaginatedRecords) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._ProjectPaginatedRecords(ctx, sel, v) +} + +func (ec *executionContext) marshalORouter2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐRouter(ctx context.Context, sel ast.SelectionSet, v *entities.Router) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Router(ctx, sel, v) +} + +func (ec *executionContext) marshalORouterPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterPaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.RouterPaginatedRecords) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._RouterPaginatedRecords(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOSearchApps2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchApps(ctx context.Context, v interface{}) (*model.SearchApps, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalInputRouterSpecRateLimitIn(ctx, v) + res, err := ec.unmarshalInputSearchApps(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalORouterSpecRoutes2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterSpecRoutes(ctx context.Context, sel ast.SelectionSet, v []*model.RouterSpecRoutes) graphql.Marshaler { +func (ec *executionContext) unmarshalOSearchConfigs2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchConfigs(ctx context.Context, v interface{}) (*model.SearchConfigs, error) { if v == nil { - return graphql.Null + return nil, nil } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) + res, err := ec.unmarshalInputSearchConfigs(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOSearchEnvironments2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchEnvironments(ctx context.Context, v interface{}) (*model.SearchEnvironments, error) { + if v == nil { + return nil, nil } - 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.marshalORouterSpecRoutes2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterSpecRoutes(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } + res, err := ec.unmarshalInputSearchEnvironments(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} +func (ec *executionContext) unmarshalOSearchImagePullSecrets2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchImagePullSecrets(ctx context.Context, v interface{}) (*model.SearchImagePullSecrets, error) { + if v == nil { + return nil, nil } - wg.Wait() + res, err := ec.unmarshalInputSearchImagePullSecrets(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - return ret +func (ec *executionContext) unmarshalOSearchManagedResources2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchManagedResources(ctx context.Context, v interface{}) (*model.SearchManagedResources, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputSearchManagedResources(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOSearchProjectManagedService2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchProjectManagedService(ctx context.Context, v interface{}) (*model.SearchProjectManagedService, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputSearchProjectManagedService(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOSearchProjects2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchProjects(ctx context.Context, v interface{}) (*model.SearchProjects, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputSearchProjects(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalORouterSpecRoutes2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterSpecRoutes(ctx context.Context, sel ast.SelectionSet, v *model.RouterSpecRoutes) graphql.Marshaler { +func (ec *executionContext) unmarshalOSearchRouters2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchRouters(ctx context.Context, v interface{}) (*model.SearchRouters, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputSearchRouters(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOSearchSecrets2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchSecrets(ctx context.Context, v interface{}) (*model.SearchSecrets, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputSearchSecrets(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐSecret(ctx context.Context, sel ast.SelectionSet, v *entities.Secret) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._RouterSpecRoutes(ctx, sel, v) + return ec._Secret(ctx, sel, v) } -func (ec *executionContext) unmarshalORouterSpecRoutesIn2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterSpecRoutesIn(ctx context.Context, v interface{}) ([]*model.RouterSpecRoutesIn, error) { +func (ec *executionContext) unmarshalOSecretKeyRefIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐSecretKeyRefᚄ(ctx context.Context, v interface{}) ([]*domain.SecretKeyRef, error) { if v == nil { return nil, nil } @@ -29308,10 +49770,10 @@ func (ec *executionContext) unmarshalORouterSpecRoutesIn2ᚕᚖkloudliteᚗioᚋ vSlice = graphql.CoerceList(v) } var err error - res := make([]*model.RouterSpecRoutesIn, len(vSlice)) + res := make([]*domain.SecretKeyRef, len(vSlice)) for i := range vSlice { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalORouterSpecRoutesIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterSpecRoutesIn(ctx, vSlice[i]) + res[i], err = ec.unmarshalNSecretKeyRefIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐSecretKeyRef(ctx, vSlice[i]) if err != nil { return nil, err } @@ -29319,15 +49781,7 @@ func (ec *executionContext) unmarshalORouterSpecRoutesIn2ᚕᚖkloudliteᚗioᚋ return res, nil } -func (ec *executionContext) unmarshalORouterSpecRoutesIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterSpecRoutesIn(ctx context.Context, v interface{}) (*model.RouterSpecRoutesIn, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputRouterSpecRoutesIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOSecret2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐSecretᚄ(ctx context.Context, sel ast.SelectionSet, v []*entities.Secret) graphql.Marshaler { +func (ec *executionContext) marshalOSecretKeyValueRef2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐSecretKeyValueRefᚄ(ctx context.Context, sel ast.SelectionSet, v []*domain.SecretKeyValueRef) graphql.Marshaler { if v == nil { return graphql.Null } @@ -29354,7 +49808,7 @@ func (ec *executionContext) marshalOSecret2ᚕᚖkloudliteᚗioᚋappsᚋconsole if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNSecret2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐSecret(ctx, sel, v[i]) + ret[i] = ec.marshalNSecretKeyValueRef2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐSecretKeyValueRef(ctx, sel, v[i]) } if isLen1 { f(i) @@ -29374,15 +49828,11 @@ func (ec *executionContext) marshalOSecret2ᚕᚖkloudliteᚗioᚋappsᚋconsole return ret } -func (ec *executionContext) marshalOSecret2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐSecret(ctx context.Context, sel ast.SelectionSet, v *entities.Secret) graphql.Marshaler { +func (ec *executionContext) marshalOSecretPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSecretPaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.SecretPaginatedRecords) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._Secret(ctx, sel, v) -} - -func (ec *executionContext) marshalOStatus2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx context.Context, sel ast.SelectionSet, v operator.Status) graphql.Marshaler { - return ec._Status(ctx, sel, &v) + return ec._SecretPaginatedRecords(ctx, sel, v) } func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { @@ -29433,38 +49883,6 @@ func (ec *executionContext) marshalOString2ᚕstringᚄ(ctx context.Context, sel 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 @@ -29481,79 +49899,6 @@ func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel as return res } -func (ec *executionContext) marshalOSyncStatus2kloudliteᚗioᚋpkgᚋtypesᚐSyncStatus(ctx context.Context, sel ast.SelectionSet, v types.SyncStatus) graphql.Marshaler { - return ec._SyncStatus(ctx, sel, &v) -} - -func (ec *executionContext) marshalOWorkspace2ᚕᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐWorkspaceᚄ(ctx context.Context, sel ast.SelectionSet, v []*entities.Workspace) 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.marshalNWorkspace2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐWorkspace(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) marshalOWorkspace2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋdomainᚋentitiesᚐWorkspace(ctx context.Context, sel ast.SelectionSet, v *entities.Workspace) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._Workspace(ctx, sel, v) -} - -func (ec *executionContext) marshalOWorkspaceSpec2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐWorkspaceSpec(ctx context.Context, sel ast.SelectionSet, v *model.WorkspaceSpec) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._WorkspaceSpec(ctx, sel, v) -} - -func (ec *executionContext) unmarshalOWorkspaceSpecIn2ᚖkloudliteᚗioᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐWorkspaceSpecIn(ctx context.Context, v interface{}) (*model.WorkspaceSpecIn, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputWorkspaceSpecIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler { if v == nil { return graphql.Null diff --git a/apps/console/internal/app/graph/imagepullsecret.resolvers.go b/apps/console/internal/app/graph/imagepullsecret.resolvers.go new file mode 100644 index 000000000..2aaf96504 --- /dev/null +++ b/apps/console/internal/app/graph/imagepullsecret.resolvers.go @@ -0,0 +1,83 @@ +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.28 + +import ( + "context" + "time" + + "github.com/kloudlite/api/apps/console/internal/app/graph/generated" + "github.com/kloudlite/api/apps/console/internal/app/graph/model" + "github.com/kloudlite/api/apps/console/internal/entities" + "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// CreationTime is the resolver for the creationTime field. +func (r *imagePullSecretResolver) CreationTime(ctx context.Context, obj *entities.ImagePullSecret) (string, error) { + if obj == nil { + return "", errNilImagePullSecret + } + return obj.CreationTime.Format(time.RFC3339), nil +} + +// Format is the resolver for the format field. +func (r *imagePullSecretResolver) Format(ctx context.Context, obj *entities.ImagePullSecret) (model.GithubComKloudliteAPIAppsConsoleInternalEntitiesPullSecretFormat, error) { + if obj == nil { + return "", errNilImagePullSecret + } + return model.GithubComKloudliteAPIAppsConsoleInternalEntitiesPullSecretFormat(obj.Format), nil +} + +// ID is the resolver for the id field. +func (r *imagePullSecretResolver) ID(ctx context.Context, obj *entities.ImagePullSecret) (string, error) { + if obj == nil { + return "", errNilImagePullSecret + } + return string(obj.Id), nil +} + +// UpdateTime is the resolver for the updateTime field. +func (r *imagePullSecretResolver) UpdateTime(ctx context.Context, obj *entities.ImagePullSecret) (string, error) { + if obj == nil { + return "", errNilImagePullSecret + } + return obj.UpdateTime.Format(time.RFC3339), nil +} + +// Format is the resolver for the format field. +func (r *imagePullSecretInResolver) Format(ctx context.Context, obj *entities.ImagePullSecret, data model.GithubComKloudliteAPIAppsConsoleInternalEntitiesPullSecretFormat) error { + if obj == nil { + return errNilImagePullSecret + } + + obj.Format = entities.PullSecretFormat(data) + return nil +} + +// Metadata is the resolver for the metadata field. +func (r *imagePullSecretInResolver) Metadata(ctx context.Context, obj *entities.ImagePullSecret, data *v1.ObjectMeta) error { + if obj == nil { + return errNilImagePullSecret + } + + if data != nil { + obj.ObjectMeta = *data + } + + return nil +} + +// ImagePullSecret returns generated.ImagePullSecretResolver implementation. +func (r *Resolver) ImagePullSecret() generated.ImagePullSecretResolver { + return &imagePullSecretResolver{r} +} + +// ImagePullSecretIn returns generated.ImagePullSecretInResolver implementation. +func (r *Resolver) ImagePullSecretIn() generated.ImagePullSecretInResolver { + return &imagePullSecretInResolver{r} +} + +type imagePullSecretResolver struct{ *Resolver } +type imagePullSecretInResolver struct{ *Resolver } diff --git a/apps/console/internal/app/graph/managedresource.resolvers.go b/apps/console/internal/app/graph/managedresource.resolvers.go index c1d4e1c77..4aa1cdad5 100644 --- a/apps/console/internal/app/graph/managedresource.resolvers.go +++ b/apps/console/internal/app/graph/managedresource.resolvers.go @@ -6,29 +6,64 @@ package graph import ( "context" + "github.com/kloudlite/api/pkg/errors" + "time" - "kloudlite.io/apps/console/internal/app/graph/generated" - "kloudlite.io/apps/console/internal/app/graph/model" - "kloudlite.io/apps/console/internal/domain/entities" - fn "kloudlite.io/pkg/functions" + "github.com/kloudlite/api/apps/console/internal/app/graph/generated" + "github.com/kloudlite/api/apps/console/internal/app/graph/model" + "github.com/kloudlite/api/apps/console/internal/entities" + fn "github.com/kloudlite/api/pkg/functions" + "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// Spec is the resolver for the spec field. -func (r *managedResourceResolver) Spec(ctx context.Context, obj *entities.MRes) (*model.ManagedResourceSpec, error) { +// CreationTime is the resolver for the creationTime field. +func (r *managedResourceResolver) CreationTime(ctx context.Context, obj *entities.ManagedResource) (string, error) { + if obj == nil { + return "", errNilManagedResource + } + return obj.BaseEntity.CreationTime.Format(time.RFC3339), nil +} + +// ID is the resolver for the id field. +func (r *managedResourceResolver) ID(ctx context.Context, obj *entities.ManagedResource) (string, error) { if obj == nil { - return nil, nil + return "", errNilManagedResource } - var m model.ManagedResourceSpec + return string(obj.Id), nil +} + +// Spec is the resolver for the spec field. +func (r *managedResourceResolver) Spec(ctx context.Context, obj *entities.ManagedResource) (*model.GithubComKloudliteOperatorApisCrdsV1ManagedResourceSpec, error) { + m := &model.GithubComKloudliteOperatorApisCrdsV1ManagedResourceSpec{} if err := fn.JsonConversion(obj.Spec, &m); err != nil { - return nil, err + return nil, errors.NewE(err) + } + return m, nil +} + +// UpdateTime is the resolver for the updateTime field. +func (r *managedResourceResolver) UpdateTime(ctx context.Context, obj *entities.ManagedResource) (string, error) { + if obj == nil { + return "", errNilManagedResource + } + return obj.BaseEntity.UpdateTime.Format(time.RFC3339), nil +} + +// Metadata is the resolver for the metadata field. +func (r *managedResourceInResolver) Metadata(ctx context.Context, obj *entities.ManagedResource, data *v1.ObjectMeta) error { + if obj == nil { + return errNilManagedResource + } + if data != nil { + obj.ObjectMeta = *data } - return &m, nil + return nil } // Spec is the resolver for the spec field. -func (r *managedResourceInResolver) Spec(ctx context.Context, obj *entities.MRes, data *model.ManagedResourceSpecIn) error { +func (r *managedResourceInResolver) Spec(ctx context.Context, obj *entities.ManagedResource, data *model.GithubComKloudliteOperatorApisCrdsV1ManagedResourceSpecIn) error { if obj == nil { - return nil + return errNilManagedResource } return fn.JsonConversion(data, &obj.Spec) } diff --git a/apps/console/internal/app/graph/managedservice.resolvers.go b/apps/console/internal/app/graph/managedservice.resolvers.go deleted file mode 100644 index 3a54603f9..000000000 --- a/apps/console/internal/app/graph/managedservice.resolvers.go +++ /dev/null @@ -1,44 +0,0 @@ -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.28 - -import ( - "context" - - "kloudlite.io/apps/console/internal/app/graph/generated" - "kloudlite.io/apps/console/internal/app/graph/model" - "kloudlite.io/apps/console/internal/domain/entities" - fn "kloudlite.io/pkg/functions" -) - -// Spec is the resolver for the spec field. -func (r *managedServiceResolver) Spec(ctx context.Context, obj *entities.MSvc) (*model.ManagedServiceSpec, error) { - var m model.ManagedServiceSpec - if err := fn.JsonConversion(obj.Spec, &m); err != nil { - return nil, err - } - return &m, nil -} - -// Spec is the resolver for the spec field. -func (r *managedServiceInResolver) Spec(ctx context.Context, obj *entities.MSvc, data *model.ManagedServiceSpecIn) error { - if err := fn.JsonConversion(data, &obj.Spec); err != nil { - return err - } - return nil -} - -// ManagedService returns generated.ManagedServiceResolver implementation. -func (r *Resolver) ManagedService() generated.ManagedServiceResolver { - return &managedServiceResolver{r} -} - -// ManagedServiceIn returns generated.ManagedServiceInResolver implementation. -func (r *Resolver) ManagedServiceIn() generated.ManagedServiceInResolver { - return &managedServiceInResolver{r} -} - -type managedServiceResolver struct{ *Resolver } -type managedServiceInResolver struct{ *Resolver } diff --git a/apps/console/internal/app/graph/model/models_gen.go b/apps/console/internal/app/graph/model/models_gen.go index b30d28e87..fe35fb7fc 100644 --- a/apps/console/internal/app/graph/model/models_gen.go +++ b/apps/console/internal/app/graph/model/models_gen.go @@ -2,455 +2,411 @@ package model -type AppSpec struct { - Containers []*AppSpecContainers `json:"containers"` - DisplayName *string `json:"displayName,omitempty"` - Intercept *AppSpecIntercept `json:"intercept,omitempty"` - Region *string `json:"region,omitempty"` - Replicas *int `json:"replicas,omitempty"` - Freeze *bool `json:"freeze,omitempty"` - Hpa *AppSpecHpa `json:"hpa,omitempty"` - NodeSelector map[string]interface{} `json:"nodeSelector,omitempty"` - ServiceAccount *string `json:"serviceAccount,omitempty"` - Services []*AppSpecServices `json:"services,omitempty"` - Tolerations []*AppSpecTolerations `json:"tolerations,omitempty"` -} - -type AppSpecContainers struct { - Name string `json:"name"` - Args []*string `json:"args,omitempty"` - Env []*AppSpecContainersEnv `json:"env,omitempty"` - EnvFrom []*AppSpecContainersEnvFrom `json:"envFrom,omitempty"` - Image string `json:"image"` - ImagePullPolicy *string `json:"imagePullPolicy,omitempty"` - Volumes []*AppSpecContainersVolumes `json:"volumes,omitempty"` - Command []*string `json:"command,omitempty"` - LivenessProbe *AppSpecContainersLivenessProbe `json:"livenessProbe,omitempty"` - ReadinessProbe *AppSpecContainersReadinessProbe `json:"readinessProbe,omitempty"` - ResourceCPU *AppSpecContainersResourceCPU `json:"resourceCpu,omitempty"` - ResourceMemory *AppSpecContainersResourceMemory `json:"resourceMemory,omitempty"` -} - -type AppSpecContainersEnv struct { - Key string `json:"key"` - Optional *bool `json:"optional,omitempty"` - RefKey *string `json:"refKey,omitempty"` - RefName *string `json:"refName,omitempty"` - Type *string `json:"type,omitempty"` - Value *string `json:"value,omitempty"` +import ( + "fmt" + "io" + "strconv" + + "github.com/kloudlite/api/apps/console/internal/entities" + "github.com/kloudlite/api/pkg/repos" + "github.com/kloudlite/operator/apis/crds/v1" +) + +type AppEdge struct { + Cursor string `json:"cursor"` + Node *entities.App `json:"node"` } -type AppSpecContainersEnvFrom struct { - Type string `json:"type"` - RefName string `json:"refName"` +type AppPaginatedRecords struct { + Edges []*AppEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` } -type AppSpecContainersEnvFromIn struct { - Type string `json:"type"` - RefName string `json:"refName"` +type ConfigEdge struct { + Cursor string `json:"cursor"` + Node *entities.Config `json:"node"` } -type AppSpecContainersEnvIn struct { - Key string `json:"key"` - Optional *bool `json:"optional,omitempty"` - RefKey *string `json:"refKey,omitempty"` - RefName *string `json:"refName,omitempty"` - Type *string `json:"type,omitempty"` - Value *string `json:"value,omitempty"` -} - -type AppSpecContainersIn struct { - Name string `json:"name"` - Args []*string `json:"args,omitempty"` - Env []*AppSpecContainersEnvIn `json:"env,omitempty"` - EnvFrom []*AppSpecContainersEnvFromIn `json:"envFrom,omitempty"` - Image string `json:"image"` - ImagePullPolicy *string `json:"imagePullPolicy,omitempty"` - Volumes []*AppSpecContainersVolumesIn `json:"volumes,omitempty"` - Command []*string `json:"command,omitempty"` - LivenessProbe *AppSpecContainersLivenessProbeIn `json:"livenessProbe,omitempty"` - ReadinessProbe *AppSpecContainersReadinessProbeIn `json:"readinessProbe,omitempty"` - ResourceCPU *AppSpecContainersResourceCPUIn `json:"resourceCpu,omitempty"` - ResourceMemory *AppSpecContainersResourceMemoryIn `json:"resourceMemory,omitempty"` -} - -type AppSpecContainersLivenessProbe struct { - FailureThreshold *int `json:"failureThreshold,omitempty"` - HTTPGet *AppSpecContainersLivenessProbeHTTPGet `json:"httpGet,omitempty"` - InitialDelay *int `json:"initialDelay,omitempty"` - Interval *int `json:"interval,omitempty"` - Shell *AppSpecContainersLivenessProbeShell `json:"shell,omitempty"` - TCP *AppSpecContainersLivenessProbeTCP `json:"tcp,omitempty"` - Type string `json:"type"` -} - -type AppSpecContainersLivenessProbeHTTPGet struct { - HTTPHeaders map[string]interface{} `json:"httpHeaders,omitempty"` - Path string `json:"path"` - Port int `json:"port"` +type ConfigKeyRef struct { + ConfigName string `json:"configName"` + Key string `json:"key"` } -type AppSpecContainersLivenessProbeHTTPGetIn struct { - HTTPHeaders map[string]interface{} `json:"httpHeaders,omitempty"` - Path string `json:"path"` - Port int `json:"port"` +type ConfigKeyValueRefIn struct { + ConfigName string `json:"configName"` + Key string `json:"key"` + Value string `json:"value"` } -type AppSpecContainersLivenessProbeIn struct { - FailureThreshold *int `json:"failureThreshold,omitempty"` - HTTPGet *AppSpecContainersLivenessProbeHTTPGetIn `json:"httpGet,omitempty"` - InitialDelay *int `json:"initialDelay,omitempty"` - Interval *int `json:"interval,omitempty"` - Shell *AppSpecContainersLivenessProbeShellIn `json:"shell,omitempty"` - TCP *AppSpecContainersLivenessProbeTCPIn `json:"tcp,omitempty"` - Type string `json:"type"` +type ConfigPaginatedRecords struct { + Edges []*ConfigEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` } -type AppSpecContainersLivenessProbeShell struct { - Command []*string `json:"command,omitempty"` +type ConsoleVPNDeviceEdge struct { + Cursor string `json:"cursor"` + Node *entities.ConsoleVPNDevice `json:"node"` } -type AppSpecContainersLivenessProbeShellIn struct { - Command []*string `json:"command,omitempty"` +type ConsoleVPNDevicePaginatedRecords struct { + Edges []*ConsoleVPNDeviceEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` } -type AppSpecContainersLivenessProbeTCP struct { - Port int `json:"port"` +type CoreSearchVPNDevices struct { + Text *repos.MatchFilter `json:"text,omitempty"` + IsReady *repos.MatchFilter `json:"isReady,omitempty"` + MarkedForDeletion *repos.MatchFilter `json:"markedForDeletion,omitempty"` } -type AppSpecContainersLivenessProbeTCPIn struct { - Port int `json:"port"` +type EnvironmentEdge struct { + Cursor string `json:"cursor"` + Node *entities.Environment `json:"node"` } -type AppSpecContainersReadinessProbe struct { - Interval *int `json:"interval,omitempty"` - Shell *AppSpecContainersReadinessProbeShell `json:"shell,omitempty"` - TCP *AppSpecContainersReadinessProbeTCP `json:"tcp,omitempty"` - Type string `json:"type"` - FailureThreshold *int `json:"failureThreshold,omitempty"` - HTTPGet *AppSpecContainersReadinessProbeHTTPGet `json:"httpGet,omitempty"` - InitialDelay *int `json:"initialDelay,omitempty"` +type EnvironmentPaginatedRecords struct { + Edges []*EnvironmentEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` } -type AppSpecContainersReadinessProbeHTTPGet struct { - HTTPHeaders map[string]interface{} `json:"httpHeaders,omitempty"` - Path string `json:"path"` - Port int `json:"port"` +type GithubComKloudliteAPIPkgTypesEncodedString struct { + Encoding string `json:"encoding"` + Value string `json:"value"` } -type AppSpecContainersReadinessProbeHTTPGetIn struct { - HTTPHeaders map[string]interface{} `json:"httpHeaders,omitempty"` - Path string `json:"path"` - Port int `json:"port"` +type GithubComKloudliteOperatorApisCrdsV1AppContainer struct { + Args []string `json:"args,omitempty"` + Command []string `json:"command,omitempty"` + Env []*GithubComKloudliteOperatorApisCrdsV1ContainerEnv `json:"env,omitempty"` + EnvFrom []*GithubComKloudliteOperatorApisCrdsV1EnvFrom `json:"envFrom,omitempty"` + Image string `json:"image"` + ImagePullPolicy *string `json:"imagePullPolicy,omitempty"` + LivenessProbe *GithubComKloudliteOperatorApisCrdsV1Probe `json:"livenessProbe,omitempty"` + Name string `json:"name"` + ReadinessProbe *GithubComKloudliteOperatorApisCrdsV1Probe `json:"readinessProbe,omitempty"` + ResourceCPU *GithubComKloudliteOperatorApisCrdsV1ContainerResource `json:"resourceCpu,omitempty"` + ResourceMemory *GithubComKloudliteOperatorApisCrdsV1ContainerResource `json:"resourceMemory,omitempty"` + Volumes []*GithubComKloudliteOperatorApisCrdsV1ContainerVolume `json:"volumes,omitempty"` } -type AppSpecContainersReadinessProbeIn struct { - Interval *int `json:"interval,omitempty"` - Shell *AppSpecContainersReadinessProbeShellIn `json:"shell,omitempty"` - TCP *AppSpecContainersReadinessProbeTCPIn `json:"tcp,omitempty"` - Type string `json:"type"` - FailureThreshold *int `json:"failureThreshold,omitempty"` - HTTPGet *AppSpecContainersReadinessProbeHTTPGetIn `json:"httpGet,omitempty"` - InitialDelay *int `json:"initialDelay,omitempty"` +type GithubComKloudliteOperatorApisCrdsV1AppContainerIn struct { + Args []string `json:"args,omitempty"` + Command []string `json:"command,omitempty"` + Env []*GithubComKloudliteOperatorApisCrdsV1ContainerEnvIn `json:"env,omitempty"` + EnvFrom []*GithubComKloudliteOperatorApisCrdsV1EnvFromIn `json:"envFrom,omitempty"` + Image string `json:"image"` + ImagePullPolicy *string `json:"imagePullPolicy,omitempty"` + LivenessProbe *GithubComKloudliteOperatorApisCrdsV1ProbeIn `json:"livenessProbe,omitempty"` + Name string `json:"name"` + ReadinessProbe *GithubComKloudliteOperatorApisCrdsV1ProbeIn `json:"readinessProbe,omitempty"` + ResourceCPU *GithubComKloudliteOperatorApisCrdsV1ContainerResourceIn `json:"resourceCpu,omitempty"` + ResourceMemory *GithubComKloudliteOperatorApisCrdsV1ContainerResourceIn `json:"resourceMemory,omitempty"` + Volumes []*GithubComKloudliteOperatorApisCrdsV1ContainerVolumeIn `json:"volumes,omitempty"` } -type AppSpecContainersReadinessProbeShell struct { - Command []*string `json:"command,omitempty"` +type GithubComKloudliteOperatorApisCrdsV1AppSpec struct { + Containers []*GithubComKloudliteOperatorApisCrdsV1AppContainer `json:"containers"` + DisplayName *string `json:"displayName,omitempty"` + Freeze *bool `json:"freeze,omitempty"` + Hpa *GithubComKloudliteOperatorApisCrdsV1Hpa `json:"hpa,omitempty"` + Intercept *GithubComKloudliteOperatorApisCrdsV1Intercept `json:"intercept,omitempty"` + NodeSelector map[string]interface{} `json:"nodeSelector,omitempty"` + Region *string `json:"region,omitempty"` + Replicas *int `json:"replicas,omitempty"` + ServiceAccount *string `json:"serviceAccount,omitempty"` + Services []*GithubComKloudliteOperatorApisCrdsV1AppSvc `json:"services,omitempty"` + Tolerations []*K8sIoAPICoreV1Toleration `json:"tolerations,omitempty"` } -type AppSpecContainersReadinessProbeShellIn struct { - Command []*string `json:"command,omitempty"` +type GithubComKloudliteOperatorApisCrdsV1AppSpecIn struct { + Containers []*GithubComKloudliteOperatorApisCrdsV1AppContainerIn `json:"containers"` + DisplayName *string `json:"displayName,omitempty"` + Freeze *bool `json:"freeze,omitempty"` + Hpa *GithubComKloudliteOperatorApisCrdsV1HPAIn `json:"hpa,omitempty"` + Intercept *GithubComKloudliteOperatorApisCrdsV1InterceptIn `json:"intercept,omitempty"` + NodeSelector map[string]interface{} `json:"nodeSelector,omitempty"` + Region *string `json:"region,omitempty"` + Replicas *int `json:"replicas,omitempty"` + ServiceAccount *string `json:"serviceAccount,omitempty"` + Services []*GithubComKloudliteOperatorApisCrdsV1AppSvcIn `json:"services,omitempty"` + Tolerations []*K8sIoAPICoreV1TolerationIn `json:"tolerations,omitempty"` +} + +type GithubComKloudliteOperatorApisCrdsV1AppSvc struct { + Name *string `json:"name,omitempty"` + Port int `json:"port"` + TargetPort *int `json:"targetPort,omitempty"` + Type *string `json:"type,omitempty"` } -type AppSpecContainersReadinessProbeTCP struct { - Port int `json:"port"` +type GithubComKloudliteOperatorApisCrdsV1AppSvcIn struct { + Name *string `json:"name,omitempty"` + Port int `json:"port"` + TargetPort *int `json:"targetPort,omitempty"` + Type *string `json:"type,omitempty"` } -type AppSpecContainersReadinessProbeTCPIn struct { - Port int `json:"port"` +type GithubComKloudliteOperatorApisCrdsV1BasicAuth struct { + Enabled bool `json:"enabled"` + SecretName *string `json:"secretName,omitempty"` + Username *string `json:"username,omitempty"` } -type AppSpecContainersResourceCPU struct { - Max *string `json:"max,omitempty"` - Min *string `json:"min,omitempty"` +type GithubComKloudliteOperatorApisCrdsV1BasicAuthIn struct { + Enabled bool `json:"enabled"` + SecretName *string `json:"secretName,omitempty"` + Username *string `json:"username,omitempty"` } -type AppSpecContainersResourceCPUIn struct { - Max *string `json:"max,omitempty"` - Min *string `json:"min,omitempty"` +type GithubComKloudliteOperatorApisCrdsV1ContainerEnv struct { + Key string `json:"key"` + Optional *bool `json:"optional,omitempty"` + RefKey *string `json:"refKey,omitempty"` + RefName *string `json:"refName,omitempty"` + Type *GithubComKloudliteOperatorApisCrdsV1ConfigOrSecret `json:"type,omitempty"` + Value *string `json:"value,omitempty"` } -type AppSpecContainersResourceMemory struct { +type GithubComKloudliteOperatorApisCrdsV1ContainerEnvIn struct { + Key string `json:"key"` + Optional *bool `json:"optional,omitempty"` + RefKey *string `json:"refKey,omitempty"` + RefName *string `json:"refName,omitempty"` + Type *GithubComKloudliteOperatorApisCrdsV1ConfigOrSecret `json:"type,omitempty"` + Value *string `json:"value,omitempty"` +} + +type GithubComKloudliteOperatorApisCrdsV1ContainerResource struct { Max *string `json:"max,omitempty"` Min *string `json:"min,omitempty"` } -type AppSpecContainersResourceMemoryIn struct { +type GithubComKloudliteOperatorApisCrdsV1ContainerResourceIn struct { Max *string `json:"max,omitempty"` Min *string `json:"min,omitempty"` } -type AppSpecContainersVolumes struct { - MountPath string `json:"mountPath"` - RefName string `json:"refName"` - Type string `json:"type"` - Items []*AppSpecContainersVolumesItems `json:"items,omitempty"` +type GithubComKloudliteOperatorApisCrdsV1ContainerVolume struct { + Items []*GithubComKloudliteOperatorApisCrdsV1ContainerVolumeItem `json:"items,omitempty"` + MountPath string `json:"mountPath"` + RefName string `json:"refName"` + Type GithubComKloudliteOperatorApisCrdsV1ConfigOrSecret `json:"type"` } -type AppSpecContainersVolumesIn struct { - MountPath string `json:"mountPath"` - RefName string `json:"refName"` - Type string `json:"type"` - Items []*AppSpecContainersVolumesItemsIn `json:"items,omitempty"` +type GithubComKloudliteOperatorApisCrdsV1ContainerVolumeIn struct { + Items []*GithubComKloudliteOperatorApisCrdsV1ContainerVolumeItemIn `json:"items,omitempty"` + MountPath string `json:"mountPath"` + RefName string `json:"refName"` + Type GithubComKloudliteOperatorApisCrdsV1ConfigOrSecret `json:"type"` } -type AppSpecContainersVolumesItems struct { - Key string `json:"key"` +type GithubComKloudliteOperatorApisCrdsV1ContainerVolumeItem struct { FileName *string `json:"fileName,omitempty"` + Key string `json:"key"` } -type AppSpecContainersVolumesItemsIn struct { - Key string `json:"key"` +type GithubComKloudliteOperatorApisCrdsV1ContainerVolumeItemIn struct { FileName *string `json:"fileName,omitempty"` + Key string `json:"key"` } -type AppSpecHpa struct { - Enabled *bool `json:"enabled,omitempty"` - MaxReplicas *int `json:"maxReplicas,omitempty"` - MinReplicas *int `json:"minReplicas,omitempty"` - ThresholdCPU *int `json:"thresholdCpu,omitempty"` - ThresholdMemory *int `json:"thresholdMemory,omitempty"` +type GithubComKloudliteOperatorApisCrdsV1Cors struct { + AllowCredentials *bool `json:"allowCredentials,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Origins []string `json:"origins,omitempty"` } -type AppSpecHpaIn struct { - Enabled *bool `json:"enabled,omitempty"` - MaxReplicas *int `json:"maxReplicas,omitempty"` - MinReplicas *int `json:"minReplicas,omitempty"` - ThresholdCPU *int `json:"thresholdCpu,omitempty"` - ThresholdMemory *int `json:"thresholdMemory,omitempty"` +type GithubComKloudliteOperatorApisCrdsV1CorsIn struct { + AllowCredentials *bool `json:"allowCredentials,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Origins []string `json:"origins,omitempty"` } -type AppSpecIn struct { - Containers []*AppSpecContainersIn `json:"containers"` - DisplayName *string `json:"displayName,omitempty"` - Intercept *AppSpecInterceptIn `json:"intercept,omitempty"` - Region *string `json:"region,omitempty"` - Replicas *int `json:"replicas,omitempty"` - Freeze *bool `json:"freeze,omitempty"` - Hpa *AppSpecHpaIn `json:"hpa,omitempty"` - NodeSelector map[string]interface{} `json:"nodeSelector,omitempty"` - ServiceAccount *string `json:"serviceAccount,omitempty"` - Services []*AppSpecServicesIn `json:"services,omitempty"` - Tolerations []*AppSpecTolerationsIn `json:"tolerations,omitempty"` +type GithubComKloudliteOperatorApisCrdsV1EnvFrom struct { + RefName string `json:"refName"` + Type GithubComKloudliteOperatorApisCrdsV1ConfigOrSecret `json:"type"` } -type AppSpecIntercept struct { - Enabled bool `json:"enabled"` - ToDevice string `json:"toDevice"` +type GithubComKloudliteOperatorApisCrdsV1EnvFromIn struct { + RefName string `json:"refName"` + Type GithubComKloudliteOperatorApisCrdsV1ConfigOrSecret `json:"type"` } -type AppSpecInterceptIn struct { - Enabled bool `json:"enabled"` - ToDevice string `json:"toDevice"` +type GithubComKloudliteOperatorApisCrdsV1EnvironmentRouting struct { + Mode *v1.EnvironmentRoutingMode `json:"mode,omitempty"` + PrivateIngressClass *string `json:"privateIngressClass,omitempty"` + PublicIngressClass *string `json:"publicIngressClass,omitempty"` } -type AppSpecServices struct { - Name *string `json:"name,omitempty"` - Port int `json:"port"` - TargetPort *int `json:"targetPort,omitempty"` - Type *string `json:"type,omitempty"` +type GithubComKloudliteOperatorApisCrdsV1EnvironmentRoutingIn struct { + Mode *v1.EnvironmentRoutingMode `json:"mode,omitempty"` } -type AppSpecServicesIn struct { - Name *string `json:"name,omitempty"` - Port int `json:"port"` - TargetPort *int `json:"targetPort,omitempty"` - Type *string `json:"type,omitempty"` +type GithubComKloudliteOperatorApisCrdsV1EnvironmentSpec struct { + ProjectName string `json:"projectName"` + Routing *GithubComKloudliteOperatorApisCrdsV1EnvironmentRouting `json:"routing,omitempty"` + TargetNamespace *string `json:"targetNamespace,omitempty"` } -type AppSpecTolerations struct { - Effect *string `json:"effect,omitempty"` - Key *string `json:"key,omitempty"` - Operator *string `json:"operator,omitempty"` - TolerationSeconds *int `json:"tolerationSeconds,omitempty"` - Value *string `json:"value,omitempty"` +type GithubComKloudliteOperatorApisCrdsV1EnvironmentSpecIn struct { + ProjectName string `json:"projectName"` + Routing *GithubComKloudliteOperatorApisCrdsV1EnvironmentRoutingIn `json:"routing,omitempty"` + TargetNamespace *string `json:"targetNamespace,omitempty"` } -type AppSpecTolerationsIn struct { - Effect *string `json:"effect,omitempty"` - Key *string `json:"key,omitempty"` - Operator *string `json:"operator,omitempty"` - TolerationSeconds *int `json:"tolerationSeconds,omitempty"` - Value *string `json:"value,omitempty"` -} - -type ManagedResourceSpec struct { - Inputs map[string]interface{} `json:"inputs,omitempty"` - MresKind *ManagedResourceSpecMresKind `json:"mresKind"` - MsvcRef *ManagedResourceSpecMsvcRef `json:"msvcRef"` +type GithubComKloudliteOperatorApisCrdsV1Hpa struct { + Enabled *bool `json:"enabled,omitempty"` + MaxReplicas *int `json:"maxReplicas,omitempty"` + MinReplicas *int `json:"minReplicas,omitempty"` + ThresholdCPU *int `json:"thresholdCpu,omitempty"` + ThresholdMemory *int `json:"thresholdMemory,omitempty"` } -type ManagedResourceSpecIn struct { - Inputs map[string]interface{} `json:"inputs,omitempty"` - MresKind *ManagedResourceSpecMresKindIn `json:"mresKind"` - MsvcRef *ManagedResourceSpecMsvcRefIn `json:"msvcRef"` +type GithubComKloudliteOperatorApisCrdsV1HPAIn struct { + Enabled *bool `json:"enabled,omitempty"` + MaxReplicas *int `json:"maxReplicas,omitempty"` + MinReplicas *int `json:"minReplicas,omitempty"` + ThresholdCPU *int `json:"thresholdCpu,omitempty"` + ThresholdMemory *int `json:"thresholdMemory,omitempty"` } -type ManagedResourceSpecMresKind struct { - Kind string `json:"kind"` +type GithubComKloudliteOperatorApisCrdsV1HTTPGetProbe struct { + HTTPHeaders map[string]interface{} `json:"httpHeaders,omitempty"` + Path string `json:"path"` + Port int `json:"port"` } -type ManagedResourceSpecMresKindIn struct { - Kind string `json:"kind"` +type GithubComKloudliteOperatorApisCrdsV1HTTPGetProbeIn struct { + HTTPHeaders map[string]interface{} `json:"httpHeaders,omitempty"` + Path string `json:"path"` + Port int `json:"port"` } -type ManagedResourceSpecMsvcRef struct { - APIVersion string `json:"apiVersion"` - Kind *string `json:"kind,omitempty"` - Name string `json:"name"` +type GithubComKloudliteOperatorApisCrdsV1HTTPS struct { + ClusterIssuer *string `json:"clusterIssuer,omitempty"` + Enabled bool `json:"enabled"` + ForceRedirect *bool `json:"forceRedirect,omitempty"` } -type ManagedResourceSpecMsvcRefIn struct { - APIVersion string `json:"apiVersion"` - Kind *string `json:"kind,omitempty"` - Name string `json:"name"` +type GithubComKloudliteOperatorApisCrdsV1HTTPSIn struct { + ClusterIssuer *string `json:"clusterIssuer,omitempty"` + Enabled bool `json:"enabled"` + ForceRedirect *bool `json:"forceRedirect,omitempty"` } -type ManagedServiceSpec struct { - Inputs map[string]interface{} `json:"inputs,omitempty"` - MsvcKind *ManagedServiceSpecMsvcKind `json:"msvcKind"` - NodeSelector map[string]interface{} `json:"nodeSelector,omitempty"` - Region *string `json:"region,omitempty"` - Tolerations []*ManagedServiceSpecTolerations `json:"tolerations,omitempty"` +type GithubComKloudliteOperatorApisCrdsV1Intercept struct { + Enabled bool `json:"enabled"` + ToDevice string `json:"toDevice"` } -type ManagedServiceSpecIn struct { - Inputs map[string]interface{} `json:"inputs,omitempty"` - MsvcKind *ManagedServiceSpecMsvcKindIn `json:"msvcKind"` - NodeSelector map[string]interface{} `json:"nodeSelector,omitempty"` - Region *string `json:"region,omitempty"` - Tolerations []*ManagedServiceSpecTolerationsIn `json:"tolerations,omitempty"` +type GithubComKloudliteOperatorApisCrdsV1InterceptIn struct { + Enabled bool `json:"enabled"` + ToDevice string `json:"toDevice"` } -type ManagedServiceSpecMsvcKind struct { - Kind *string `json:"kind,omitempty"` - APIVersion string `json:"apiVersion"` +type GithubComKloudliteOperatorApisCrdsV1ManagedResourceSpec struct { + ResourceName *string `json:"resourceName,omitempty"` + ResourceTemplate *GithubComKloudliteOperatorApisCrdsV1MresResourceTemplate `json:"resourceTemplate"` } -type ManagedServiceSpecMsvcKindIn struct { - Kind *string `json:"kind,omitempty"` - APIVersion string `json:"apiVersion"` +type GithubComKloudliteOperatorApisCrdsV1ManagedResourceSpecIn struct { + ResourceName *string `json:"resourceName,omitempty"` + ResourceTemplate *GithubComKloudliteOperatorApisCrdsV1MresResourceTemplateIn `json:"resourceTemplate"` } -type ManagedServiceSpecTolerations struct { - Effect *string `json:"effect,omitempty"` - Key *string `json:"key,omitempty"` - Operator *string `json:"operator,omitempty"` - TolerationSeconds *int `json:"tolerationSeconds,omitempty"` - Value *string `json:"value,omitempty"` +type GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpec struct { + ServiceTemplate *GithubComKloudliteOperatorApisCrdsV1ServiceTemplate `json:"serviceTemplate"` } -type ManagedServiceSpecTolerationsIn struct { - Effect *string `json:"effect,omitempty"` - Key *string `json:"key,omitempty"` - Operator *string `json:"operator,omitempty"` - TolerationSeconds *int `json:"tolerationSeconds,omitempty"` - Value *string `json:"value,omitempty"` +type GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpecIn struct { + ServiceTemplate *GithubComKloudliteOperatorApisCrdsV1ServiceTemplateIn `json:"serviceTemplate"` } -type ProjectSpec struct { - DisplayName *string `json:"displayName,omitempty"` - Logo *string `json:"logo,omitempty"` - TargetNamespace string `json:"targetNamespace"` - AccountName string `json:"accountName"` - ClusterName string `json:"clusterName"` +type GithubComKloudliteOperatorApisCrdsV1MresResourceTemplate struct { + APIVersion string `json:"apiVersion"` + Kind string `json:"kind"` + MsvcRef *GithubComKloudliteOperatorApisCrdsV1MsvcNamedRef `json:"msvcRef"` + Spec map[string]interface{} `json:"spec"` } -type ProjectSpecIn struct { - DisplayName *string `json:"displayName,omitempty"` - Logo *string `json:"logo,omitempty"` - TargetNamespace string `json:"targetNamespace"` - AccountName string `json:"accountName"` - ClusterName string `json:"clusterName"` +type GithubComKloudliteOperatorApisCrdsV1MresResourceTemplateIn struct { + APIVersion string `json:"apiVersion"` + Kind string `json:"kind"` + MsvcRef *GithubComKloudliteOperatorApisCrdsV1MsvcNamedRefIn `json:"msvcRef"` + Spec map[string]interface{} `json:"spec"` } -type RouterSpec struct { - Cors *RouterSpecCors `json:"cors,omitempty"` - IngressClass *string `json:"ingressClass,omitempty"` - MaxBodySizeInMb *int `json:"maxBodySizeInMB,omitempty"` - Region *string `json:"region,omitempty"` - Routes []*RouterSpecRoutes `json:"routes,omitempty"` - BackendProtocol *string `json:"backendProtocol,omitempty"` - BasicAuth *RouterSpecBasicAuth `json:"basicAuth,omitempty"` - Domains []*string `json:"domains"` - HTTPS *RouterSpecHTTPS `json:"https,omitempty"` - RateLimit *RouterSpecRateLimit `json:"rateLimit,omitempty"` +type GithubComKloudliteOperatorApisCrdsV1MsvcNamedRef struct { + APIVersion string `json:"apiVersion"` + Kind string `json:"kind"` + Name string `json:"name"` + Namespace string `json:"namespace"` } -type RouterSpecBasicAuth struct { - Enabled bool `json:"enabled"` - SecretName *string `json:"secretName,omitempty"` - Username *string `json:"username,omitempty"` +type GithubComKloudliteOperatorApisCrdsV1MsvcNamedRefIn struct { + APIVersion string `json:"apiVersion"` + Kind string `json:"kind"` + Name string `json:"name"` + Namespace string `json:"namespace"` } -type RouterSpecBasicAuthIn struct { - Enabled bool `json:"enabled"` - SecretName *string `json:"secretName,omitempty"` - Username *string `json:"username,omitempty"` +type GithubComKloudliteOperatorApisCrdsV1Probe struct { + FailureThreshold *int `json:"failureThreshold,omitempty"` + HTTPGet *GithubComKloudliteOperatorApisCrdsV1HTTPGetProbe `json:"httpGet,omitempty"` + InitialDelay *int `json:"initialDelay,omitempty"` + Interval *int `json:"interval,omitempty"` + Shell *GithubComKloudliteOperatorApisCrdsV1ShellProbe `json:"shell,omitempty"` + TCP *GithubComKloudliteOperatorApisCrdsV1TCPProbe `json:"tcp,omitempty"` + Type string `json:"type"` } -type RouterSpecCors struct { - AllowCredentials *bool `json:"allowCredentials,omitempty"` - Enabled *bool `json:"enabled,omitempty"` - Origins []*string `json:"origins,omitempty"` +type GithubComKloudliteOperatorApisCrdsV1ProbeIn struct { + FailureThreshold *int `json:"failureThreshold,omitempty"` + HTTPGet *GithubComKloudliteOperatorApisCrdsV1HTTPGetProbeIn `json:"httpGet,omitempty"` + InitialDelay *int `json:"initialDelay,omitempty"` + Interval *int `json:"interval,omitempty"` + Shell *GithubComKloudliteOperatorApisCrdsV1ShellProbeIn `json:"shell,omitempty"` + TCP *GithubComKloudliteOperatorApisCrdsV1TCPProbeIn `json:"tcp,omitempty"` + Type string `json:"type"` } -type RouterSpecCorsIn struct { - AllowCredentials *bool `json:"allowCredentials,omitempty"` - Enabled *bool `json:"enabled,omitempty"` - Origins []*string `json:"origins,omitempty"` +type GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpec struct { + MsvcSpec *GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpec `json:"msvcSpec"` + TargetNamespace string `json:"targetNamespace"` } -type RouterSpecHTTPS struct { - ClusterIssuer *string `json:"clusterIssuer,omitempty"` - Enabled bool `json:"enabled"` - ForceRedirect *bool `json:"forceRedirect,omitempty"` +type GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpecIn struct { + MsvcSpec *GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpecIn `json:"msvcSpec"` + TargetNamespace string `json:"targetNamespace"` } -type RouterSpecHTTPSIn struct { - ClusterIssuer *string `json:"clusterIssuer,omitempty"` - Enabled bool `json:"enabled"` - ForceRedirect *bool `json:"forceRedirect,omitempty"` +type GithubComKloudliteOperatorApisCrdsV1ProjectSpec struct { + TargetNamespace string `json:"targetNamespace"` } -type RouterSpecIn struct { - Cors *RouterSpecCorsIn `json:"cors,omitempty"` - IngressClass *string `json:"ingressClass,omitempty"` - MaxBodySizeInMb *int `json:"maxBodySizeInMB,omitempty"` - Region *string `json:"region,omitempty"` - Routes []*RouterSpecRoutesIn `json:"routes,omitempty"` - BackendProtocol *string `json:"backendProtocol,omitempty"` - BasicAuth *RouterSpecBasicAuthIn `json:"basicAuth,omitempty"` - Domains []*string `json:"domains"` - HTTPS *RouterSpecHTTPSIn `json:"https,omitempty"` - RateLimit *RouterSpecRateLimitIn `json:"rateLimit,omitempty"` +type GithubComKloudliteOperatorApisCrdsV1ProjectSpecIn struct { + TargetNamespace string `json:"targetNamespace"` } -type RouterSpecRateLimit struct { +type GithubComKloudliteOperatorApisCrdsV1RateLimit struct { Connections *int `json:"connections,omitempty"` Enabled *bool `json:"enabled,omitempty"` Rpm *int `json:"rpm,omitempty"` Rps *int `json:"rps,omitempty"` } -type RouterSpecRateLimitIn struct { +type GithubComKloudliteOperatorApisCrdsV1RateLimitIn struct { Connections *int `json:"connections,omitempty"` Enabled *bool `json:"enabled,omitempty"` Rpm *int `json:"rpm,omitempty"` Rps *int `json:"rps,omitempty"` } -type RouterSpecRoutes struct { +type GithubComKloudliteOperatorApisCrdsV1Route struct { App *string `json:"app,omitempty"` Lambda *string `json:"lambda,omitempty"` Path string `json:"path"` @@ -458,7 +414,7 @@ type RouterSpecRoutes struct { Rewrite *bool `json:"rewrite,omitempty"` } -type RouterSpecRoutesIn struct { +type GithubComKloudliteOperatorApisCrdsV1RouteIn struct { App *string `json:"app,omitempty"` Lambda *string `json:"lambda,omitempty"` Path string `json:"path"` @@ -466,12 +422,498 @@ type RouterSpecRoutesIn struct { Rewrite *bool `json:"rewrite,omitempty"` } -type WorkspaceSpec struct { - ProjectName string `json:"projectName"` - TargetNamespace string `json:"targetNamespace"` +type GithubComKloudliteOperatorApisCrdsV1RouterSpec struct { + BackendProtocol *string `json:"backendProtocol,omitempty"` + BasicAuth *GithubComKloudliteOperatorApisCrdsV1BasicAuth `json:"basicAuth,omitempty"` + Cors *GithubComKloudliteOperatorApisCrdsV1Cors `json:"cors,omitempty"` + Domains []string `json:"domains"` + HTTPS *GithubComKloudliteOperatorApisCrdsV1HTTPS `json:"https,omitempty"` + IngressClass *string `json:"ingressClass,omitempty"` + MaxBodySizeInMb *int `json:"maxBodySizeInMB,omitempty"` + RateLimit *GithubComKloudliteOperatorApisCrdsV1RateLimit `json:"rateLimit,omitempty"` + Routes []*GithubComKloudliteOperatorApisCrdsV1Route `json:"routes,omitempty"` } -type WorkspaceSpecIn struct { - ProjectName string `json:"projectName"` - TargetNamespace string `json:"targetNamespace"` +type GithubComKloudliteOperatorApisCrdsV1RouterSpecIn struct { + BackendProtocol *string `json:"backendProtocol,omitempty"` + BasicAuth *GithubComKloudliteOperatorApisCrdsV1BasicAuthIn `json:"basicAuth,omitempty"` + Cors *GithubComKloudliteOperatorApisCrdsV1CorsIn `json:"cors,omitempty"` + Domains []string `json:"domains"` + HTTPS *GithubComKloudliteOperatorApisCrdsV1HTTPSIn `json:"https,omitempty"` + IngressClass *string `json:"ingressClass,omitempty"` + MaxBodySizeInMb *int `json:"maxBodySizeInMB,omitempty"` + RateLimit *GithubComKloudliteOperatorApisCrdsV1RateLimitIn `json:"rateLimit,omitempty"` + Routes []*GithubComKloudliteOperatorApisCrdsV1RouteIn `json:"routes,omitempty"` +} + +type GithubComKloudliteOperatorApisCrdsV1ServiceTemplate struct { + APIVersion string `json:"apiVersion"` + Kind string `json:"kind"` + Spec map[string]interface{} `json:"spec"` +} + +type GithubComKloudliteOperatorApisCrdsV1ServiceTemplateIn struct { + APIVersion string `json:"apiVersion"` + Kind string `json:"kind"` + Spec map[string]interface{} `json:"spec"` +} + +type GithubComKloudliteOperatorApisCrdsV1ShellProbe struct { + Command []string `json:"command,omitempty"` +} + +type GithubComKloudliteOperatorApisCrdsV1ShellProbeIn struct { + Command []string `json:"command,omitempty"` +} + +type GithubComKloudliteOperatorApisCrdsV1TCPProbe struct { + Port int `json:"port"` +} + +type GithubComKloudliteOperatorApisCrdsV1TCPProbeIn struct { + Port int `json:"port"` +} + +type GithubComKloudliteOperatorApisWireguardV1CNameRecord struct { + Host *string `json:"host,omitempty"` + Target *string `json:"target,omitempty"` +} + +type GithubComKloudliteOperatorApisWireguardV1CNameRecordIn struct { + Host *string `json:"host,omitempty"` + Target *string `json:"target,omitempty"` +} + +type GithubComKloudliteOperatorApisWireguardV1DeviceSpec struct { + ActiveNamespace *string `json:"activeNamespace,omitempty"` + CnameRecords []*GithubComKloudliteOperatorApisWireguardV1CNameRecord `json:"cnameRecords,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + NodeSelector map[string]interface{} `json:"nodeSelector,omitempty"` + NoExternalService *bool `json:"noExternalService,omitempty"` + Ports []*GithubComKloudliteOperatorApisWireguardV1Port `json:"ports,omitempty"` +} + +type GithubComKloudliteOperatorApisWireguardV1DeviceSpecIn struct { + ActiveNamespace *string `json:"activeNamespace,omitempty"` + CnameRecords []*GithubComKloudliteOperatorApisWireguardV1CNameRecordIn `json:"cnameRecords,omitempty"` + Ports []*GithubComKloudliteOperatorApisWireguardV1PortIn `json:"ports,omitempty"` +} + +type GithubComKloudliteOperatorApisWireguardV1Port struct { + Port *int `json:"port,omitempty"` + TargetPort *int `json:"targetPort,omitempty"` +} + +type GithubComKloudliteOperatorApisWireguardV1PortIn struct { + Port *int `json:"port,omitempty"` + TargetPort *int `json:"targetPort,omitempty"` +} + +type GithubComKloudliteOperatorPkgOperatorCheck struct { + Generation *int `json:"generation,omitempty"` + Message *string `json:"message,omitempty"` + Status bool `json:"status"` +} + +type GithubComKloudliteOperatorPkgOperatorResourceRef struct { + APIVersion string `json:"apiVersion"` + Kind string `json:"kind"` + Name string `json:"name"` + Namespace string `json:"namespace"` +} + +type GithubComKloudliteOperatorPkgRawJSONRawJSON struct { + RawMessage interface{} `json:"RawMessage,omitempty"` +} + +type ImagePullSecretEdge struct { + Cursor string `json:"cursor"` + Node *entities.ImagePullSecret `json:"node"` +} + +type ImagePullSecretPaginatedRecords struct { + Edges []*ImagePullSecretEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +type K8sIoAPICoreV1Toleration struct { + Effect *K8sIoAPICoreV1TaintEffect `json:"effect,omitempty"` + Key *string `json:"key,omitempty"` + Operator *K8sIoAPICoreV1TolerationOperator `json:"operator,omitempty"` + TolerationSeconds *int `json:"tolerationSeconds,omitempty"` + Value *string `json:"value,omitempty"` +} + +type K8sIoAPICoreV1TolerationIn struct { + Effect *K8sIoAPICoreV1TaintEffect `json:"effect,omitempty"` + Key *string `json:"key,omitempty"` + Operator *K8sIoAPICoreV1TolerationOperator `json:"operator,omitempty"` + TolerationSeconds *int `json:"tolerationSeconds,omitempty"` + Value *string `json:"value,omitempty"` +} + +type ManagedResourceEdge struct { + Cursor string `json:"cursor"` + Node *entities.ManagedResource `json:"node"` +} + +type ManagedResourceKeyRef struct { + Key string `json:"key"` + MresName string `json:"mresName"` +} + +type ManagedResourceKeyValueRefIn struct { + Key string `json:"key"` + MresName string `json:"mresName"` + Value string `json:"value"` +} + +type ManagedResourcePaginatedRecords struct { + Edges []*ManagedResourceEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +type PageInfo struct { + EndCursor *string `json:"endCursor,omitempty"` + HasNextPage *bool `json:"hasNextPage,omitempty"` + HasPreviousPage *bool `json:"hasPreviousPage,omitempty"` + StartCursor *string `json:"startCursor,omitempty"` +} + +type Port struct { + Port *int `json:"port,omitempty"` + TargetPort *int `json:"targetPort,omitempty"` +} + +type ProjectEdge struct { + Cursor string `json:"cursor"` + Node *entities.Project `json:"node"` +} + +type ProjectManagedServiceEdge struct { + Cursor string `json:"cursor"` + Node *entities.ProjectManagedService `json:"node"` +} + +type ProjectManagedServicePaginatedRecords struct { + Edges []*ProjectManagedServiceEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +type ProjectPaginatedRecords struct { + Edges []*ProjectEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +type RouterEdge struct { + Cursor string `json:"cursor"` + Node *entities.Router `json:"node"` +} + +type RouterPaginatedRecords struct { + Edges []*RouterEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +type SearchApps struct { + Text *repos.MatchFilter `json:"text,omitempty"` + IsReady *repos.MatchFilter `json:"isReady,omitempty"` + MarkedForDeletion *repos.MatchFilter `json:"markedForDeletion,omitempty"` +} + +type SearchConfigs struct { + Text *repos.MatchFilter `json:"text,omitempty"` + IsReady *repos.MatchFilter `json:"isReady,omitempty"` + MarkedForDeletion *repos.MatchFilter `json:"markedForDeletion,omitempty"` +} + +type SearchEnvironments struct { + Text *repos.MatchFilter `json:"text,omitempty"` + ProjectName *repos.MatchFilter `json:"projectName,omitempty"` + IsReady *repos.MatchFilter `json:"isReady,omitempty"` + MarkedForDeletion *repos.MatchFilter `json:"markedForDeletion,omitempty"` +} + +type SearchImagePullSecrets struct { + Text *repos.MatchFilter `json:"text,omitempty"` + IsReady *repos.MatchFilter `json:"isReady,omitempty"` + MarkedForDeletion *repos.MatchFilter `json:"markedForDeletion,omitempty"` +} + +type SearchManagedResources struct { + Text *repos.MatchFilter `json:"text,omitempty"` + ManagedServiceName *repos.MatchFilter `json:"managedServiceName,omitempty"` + IsReady *repos.MatchFilter `json:"isReady,omitempty"` + MarkedForDeletion *repos.MatchFilter `json:"markedForDeletion,omitempty"` +} + +type SearchProjectManagedService struct { + Text *repos.MatchFilter `json:"text,omitempty"` + ManagedServiceName *repos.MatchFilter `json:"managedServiceName,omitempty"` + IsReady *repos.MatchFilter `json:"isReady,omitempty"` + MarkedForDeletion *repos.MatchFilter `json:"markedForDeletion,omitempty"` +} + +type SearchProjects struct { + Text *repos.MatchFilter `json:"text,omitempty"` + IsReady *repos.MatchFilter `json:"isReady,omitempty"` + MarkedForDeletion *repos.MatchFilter `json:"markedForDeletion,omitempty"` +} + +type SearchRouters struct { + Text *repos.MatchFilter `json:"text,omitempty"` + IsReady *repos.MatchFilter `json:"isReady,omitempty"` + MarkedForDeletion *repos.MatchFilter `json:"markedForDeletion,omitempty"` +} + +type SearchSecrets struct { + Text *repos.MatchFilter `json:"text,omitempty"` + IsReady *repos.MatchFilter `json:"isReady,omitempty"` + MarkedForDeletion *repos.MatchFilter `json:"markedForDeletion,omitempty"` +} + +type SecretEdge struct { + Cursor string `json:"cursor"` + Node *entities.Secret `json:"node"` +} + +type SecretKeyRef struct { + Key string `json:"key"` + SecretName string `json:"secretName"` +} + +type SecretKeyValueRefIn struct { + Key string `json:"key"` + SecretName string `json:"secretName"` + Value string `json:"value"` +} + +type SecretPaginatedRecords struct { + Edges []*SecretEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +type GithubComKloudliteAPIAppsConsoleInternalEntitiesPullSecretFormat string + +const ( + GithubComKloudliteAPIAppsConsoleInternalEntitiesPullSecretFormatDockerConfigJSON GithubComKloudliteAPIAppsConsoleInternalEntitiesPullSecretFormat = "dockerConfigJson" + GithubComKloudliteAPIAppsConsoleInternalEntitiesPullSecretFormatParams GithubComKloudliteAPIAppsConsoleInternalEntitiesPullSecretFormat = "params" +) + +var AllGithubComKloudliteAPIAppsConsoleInternalEntitiesPullSecretFormat = []GithubComKloudliteAPIAppsConsoleInternalEntitiesPullSecretFormat{ + GithubComKloudliteAPIAppsConsoleInternalEntitiesPullSecretFormatDockerConfigJSON, + GithubComKloudliteAPIAppsConsoleInternalEntitiesPullSecretFormatParams, +} + +func (e GithubComKloudliteAPIAppsConsoleInternalEntitiesPullSecretFormat) IsValid() bool { + switch e { + case GithubComKloudliteAPIAppsConsoleInternalEntitiesPullSecretFormatDockerConfigJSON, GithubComKloudliteAPIAppsConsoleInternalEntitiesPullSecretFormatParams: + return true + } + return false +} + +func (e GithubComKloudliteAPIAppsConsoleInternalEntitiesPullSecretFormat) String() string { + return string(e) +} + +func (e *GithubComKloudliteAPIAppsConsoleInternalEntitiesPullSecretFormat) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = GithubComKloudliteAPIAppsConsoleInternalEntitiesPullSecretFormat(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid Github__com___kloudlite___api___apps___console___internal___entities__PullSecretFormat", str) + } + return nil +} + +func (e GithubComKloudliteAPIAppsConsoleInternalEntitiesPullSecretFormat) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type GithubComKloudliteOperatorApisCrdsV1ConfigOrSecret string + +const ( + GithubComKloudliteOperatorApisCrdsV1ConfigOrSecretConfig GithubComKloudliteOperatorApisCrdsV1ConfigOrSecret = "config" + GithubComKloudliteOperatorApisCrdsV1ConfigOrSecretSecret GithubComKloudliteOperatorApisCrdsV1ConfigOrSecret = "secret" +) + +var AllGithubComKloudliteOperatorApisCrdsV1ConfigOrSecret = []GithubComKloudliteOperatorApisCrdsV1ConfigOrSecret{ + GithubComKloudliteOperatorApisCrdsV1ConfigOrSecretConfig, + GithubComKloudliteOperatorApisCrdsV1ConfigOrSecretSecret, +} + +func (e GithubComKloudliteOperatorApisCrdsV1ConfigOrSecret) IsValid() bool { + switch e { + case GithubComKloudliteOperatorApisCrdsV1ConfigOrSecretConfig, GithubComKloudliteOperatorApisCrdsV1ConfigOrSecretSecret: + return true + } + return false +} + +func (e GithubComKloudliteOperatorApisCrdsV1ConfigOrSecret) String() string { + return string(e) +} + +func (e *GithubComKloudliteOperatorApisCrdsV1ConfigOrSecret) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = GithubComKloudliteOperatorApisCrdsV1ConfigOrSecret(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid Github__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret", str) + } + return nil +} + +func (e GithubComKloudliteOperatorApisCrdsV1ConfigOrSecret) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type K8sIoAPICoreV1SecretType string + +const ( + K8sIoAPICoreV1SecretTypeBootstrapKubernetesIoToken K8sIoAPICoreV1SecretType = "bootstrap__kubernetes__io___token" + K8sIoAPICoreV1SecretTypeKubernetesIoBasicAuth K8sIoAPICoreV1SecretType = "kubernetes__io___basic____auth" + K8sIoAPICoreV1SecretTypeKubernetesIoDockercfg K8sIoAPICoreV1SecretType = "kubernetes__io___dockercfg" + K8sIoAPICoreV1SecretTypeKubernetesIoDockerconfigjson K8sIoAPICoreV1SecretType = "kubernetes__io___dockerconfigjson" + K8sIoAPICoreV1SecretTypeKubernetesIoServiceAccountToken K8sIoAPICoreV1SecretType = "kubernetes__io___service____account____token" + K8sIoAPICoreV1SecretTypeKubernetesIoSSHAuth K8sIoAPICoreV1SecretType = "kubernetes__io___ssh____auth" + K8sIoAPICoreV1SecretTypeKubernetesIoTLS K8sIoAPICoreV1SecretType = "kubernetes__io___tls" + K8sIoAPICoreV1SecretTypeOpaque K8sIoAPICoreV1SecretType = "Opaque" +) + +var AllK8sIoAPICoreV1SecretType = []K8sIoAPICoreV1SecretType{ + K8sIoAPICoreV1SecretTypeBootstrapKubernetesIoToken, + K8sIoAPICoreV1SecretTypeKubernetesIoBasicAuth, + K8sIoAPICoreV1SecretTypeKubernetesIoDockercfg, + K8sIoAPICoreV1SecretTypeKubernetesIoDockerconfigjson, + K8sIoAPICoreV1SecretTypeKubernetesIoServiceAccountToken, + K8sIoAPICoreV1SecretTypeKubernetesIoSSHAuth, + K8sIoAPICoreV1SecretTypeKubernetesIoTLS, + K8sIoAPICoreV1SecretTypeOpaque, +} + +func (e K8sIoAPICoreV1SecretType) IsValid() bool { + switch e { + case K8sIoAPICoreV1SecretTypeBootstrapKubernetesIoToken, K8sIoAPICoreV1SecretTypeKubernetesIoBasicAuth, K8sIoAPICoreV1SecretTypeKubernetesIoDockercfg, K8sIoAPICoreV1SecretTypeKubernetesIoDockerconfigjson, K8sIoAPICoreV1SecretTypeKubernetesIoServiceAccountToken, K8sIoAPICoreV1SecretTypeKubernetesIoSSHAuth, K8sIoAPICoreV1SecretTypeKubernetesIoTLS, K8sIoAPICoreV1SecretTypeOpaque: + return true + } + return false +} + +func (e K8sIoAPICoreV1SecretType) String() string { + return string(e) +} + +func (e *K8sIoAPICoreV1SecretType) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = K8sIoAPICoreV1SecretType(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid K8s__io___api___core___v1__SecretType", str) + } + return nil +} + +func (e K8sIoAPICoreV1SecretType) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type K8sIoAPICoreV1TaintEffect string + +const ( + K8sIoAPICoreV1TaintEffectNoExecute K8sIoAPICoreV1TaintEffect = "NoExecute" + K8sIoAPICoreV1TaintEffectNoSchedule K8sIoAPICoreV1TaintEffect = "NoSchedule" + K8sIoAPICoreV1TaintEffectPreferNoSchedule K8sIoAPICoreV1TaintEffect = "PreferNoSchedule" +) + +var AllK8sIoAPICoreV1TaintEffect = []K8sIoAPICoreV1TaintEffect{ + K8sIoAPICoreV1TaintEffectNoExecute, + K8sIoAPICoreV1TaintEffectNoSchedule, + K8sIoAPICoreV1TaintEffectPreferNoSchedule, +} + +func (e K8sIoAPICoreV1TaintEffect) IsValid() bool { + switch e { + case K8sIoAPICoreV1TaintEffectNoExecute, K8sIoAPICoreV1TaintEffectNoSchedule, K8sIoAPICoreV1TaintEffectPreferNoSchedule: + return true + } + return false +} + +func (e K8sIoAPICoreV1TaintEffect) String() string { + return string(e) +} + +func (e *K8sIoAPICoreV1TaintEffect) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = K8sIoAPICoreV1TaintEffect(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid K8s__io___api___core___v1__TaintEffect", str) + } + return nil +} + +func (e K8sIoAPICoreV1TaintEffect) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type K8sIoAPICoreV1TolerationOperator string + +const ( + K8sIoAPICoreV1TolerationOperatorEqual K8sIoAPICoreV1TolerationOperator = "Equal" + K8sIoAPICoreV1TolerationOperatorExists K8sIoAPICoreV1TolerationOperator = "Exists" +) + +var AllK8sIoAPICoreV1TolerationOperator = []K8sIoAPICoreV1TolerationOperator{ + K8sIoAPICoreV1TolerationOperatorEqual, + K8sIoAPICoreV1TolerationOperatorExists, +} + +func (e K8sIoAPICoreV1TolerationOperator) IsValid() bool { + switch e { + case K8sIoAPICoreV1TolerationOperatorEqual, K8sIoAPICoreV1TolerationOperatorExists: + return true + } + return false +} + +func (e K8sIoAPICoreV1TolerationOperator) String() string { + return string(e) +} + +func (e *K8sIoAPICoreV1TolerationOperator) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = K8sIoAPICoreV1TolerationOperator(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid K8s__io___api___core___v1__TolerationOperator", str) + } + return nil +} + +func (e K8sIoAPICoreV1TolerationOperator) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) } diff --git a/apps/console/internal/app/graph/project.resolvers.go b/apps/console/internal/app/graph/project.resolvers.go index 5c1e41be4..0443f97f4 100644 --- a/apps/console/internal/app/graph/project.resolvers.go +++ b/apps/console/internal/app/graph/project.resolvers.go @@ -6,29 +6,70 @@ package graph import ( "context" + "github.com/kloudlite/api/pkg/errors" + "time" - "kloudlite.io/apps/console/internal/app/graph/generated" - "kloudlite.io/apps/console/internal/app/graph/model" - "kloudlite.io/apps/console/internal/domain/entities" - fn "kloudlite.io/pkg/functions" + "github.com/kloudlite/api/apps/console/internal/app/graph/generated" + "github.com/kloudlite/api/apps/console/internal/app/graph/model" + "github.com/kloudlite/api/apps/console/internal/entities" + fn "github.com/kloudlite/api/pkg/functions" + "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// CreationTime is the resolver for the creationTime field. +func (r *projectResolver) CreationTime(ctx context.Context, obj *entities.Project) (string, error) { + if obj == nil { + return "", errNilProject + } + return obj.CreationTime.Format(time.RFC3339), nil +} + +// ID is the resolver for the id field. +func (r *projectResolver) ID(ctx context.Context, obj *entities.Project) (string, error) { + if obj == nil { + return "", errNilProject + } + return string(obj.Id), nil +} + // Spec is the resolver for the spec field. -func (r *projectResolver) Spec(ctx context.Context, obj *entities.Project) (*model.ProjectSpec, error) { +func (r *projectResolver) Spec(ctx context.Context, obj *entities.Project) (*model.GithubComKloudliteOperatorApisCrdsV1ProjectSpec, error) { if obj == nil { - return nil, nil + return nil, errNilProject } - var m model.ProjectSpec + + m := &model.GithubComKloudliteOperatorApisCrdsV1ProjectSpec{} if err := fn.JsonConversion(obj.Spec, &m); err != nil { - return nil, err + return nil, errors.NewE(err) + } + return m, nil +} + +// UpdateTime is the resolver for the updateTime field. +func (r *projectResolver) UpdateTime(ctx context.Context, obj *entities.Project) (string, error) { + if obj == nil { + return "", errNilProject + } + return obj.UpdateTime.Format(time.RFC3339), nil +} + +// Metadata is the resolver for the metadata field. +func (r *projectInResolver) Metadata(ctx context.Context, obj *entities.Project, data *v1.ObjectMeta) error { + if obj == nil { + return errNilProject } - return &m, nil + + if data != nil { + obj.ObjectMeta = *data + } + + return nil } // Spec is the resolver for the spec field. -func (r *projectInResolver) Spec(ctx context.Context, obj *entities.Project, data *model.ProjectSpecIn) error { +func (r *projectInResolver) Spec(ctx context.Context, obj *entities.Project, data *model.GithubComKloudliteOperatorApisCrdsV1ProjectSpecIn) error { if obj == nil { - return nil + return errNilProject } return fn.JsonConversion(data, &obj.Spec) } diff --git a/apps/console/internal/app/graph/projectmanagedservice.resolvers.go b/apps/console/internal/app/graph/projectmanagedservice.resolvers.go new file mode 100644 index 000000000..3b3c34dcc --- /dev/null +++ b/apps/console/internal/app/graph/projectmanagedservice.resolvers.go @@ -0,0 +1,88 @@ +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.28 + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + "time" + + "github.com/kloudlite/api/apps/console/internal/app/graph/generated" + "github.com/kloudlite/api/apps/console/internal/app/graph/model" + "github.com/kloudlite/api/apps/console/internal/entities" + fn "github.com/kloudlite/api/pkg/functions" + "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// CreationTime is the resolver for the creationTime field. +func (r *projectManagedServiceResolver) CreationTime(ctx context.Context, obj *entities.ProjectManagedService) (string, error) { + if obj == nil { + return "", errNilProjectManagedService + } + return obj.CreationTime.Format(time.RFC3339), nil +} + +// ID is the resolver for the id field. +func (r *projectManagedServiceResolver) ID(ctx context.Context, obj *entities.ProjectManagedService) (string, error) { + if obj == nil { + return "", errNilProjectManagedService + } + return string(obj.Id), nil +} + +// Spec is the resolver for the spec field. +func (r *projectManagedServiceResolver) Spec(ctx context.Context, obj *entities.ProjectManagedService) (*model.GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpec, error) { + if obj == nil { + return nil, errNilProjectManagedService + } + + m := &model.GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpec{} + if err := fn.JsonConversion(obj.Spec, &m); err != nil { + return nil, errors.NewE(err) + } + return m, nil +} + +// UpdateTime is the resolver for the updateTime field. +func (r *projectManagedServiceResolver) UpdateTime(ctx context.Context, obj *entities.ProjectManagedService) (string, error) { + if obj == nil { + return "", errNilProjectManagedService + } + return obj.UpdateTime.Format(time.RFC3339), nil +} + +// Metadata is the resolver for the metadata field. +func (r *projectManagedServiceInResolver) Metadata(ctx context.Context, obj *entities.ProjectManagedService, data *v1.ObjectMeta) error { + if obj == nil { + return errNilProjectManagedService + } + + if data != nil { + obj.ObjectMeta = *data + } + + return nil +} + +// Spec is the resolver for the spec field. +func (r *projectManagedServiceInResolver) Spec(ctx context.Context, obj *entities.ProjectManagedService, data *model.GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpecIn) error { + if obj == nil { + return errNilProjectManagedService + } + return fn.JsonConversion(data, &obj.Spec) +} + +// ProjectManagedService returns generated.ProjectManagedServiceResolver implementation. +func (r *Resolver) ProjectManagedService() generated.ProjectManagedServiceResolver { + return &projectManagedServiceResolver{r} +} + +// ProjectManagedServiceIn returns generated.ProjectManagedServiceInResolver implementation. +func (r *Resolver) ProjectManagedServiceIn() generated.ProjectManagedServiceInResolver { + return &projectManagedServiceInResolver{r} +} + +type projectManagedServiceResolver struct{ *Resolver } +type projectManagedServiceInResolver struct{ *Resolver } diff --git a/apps/console/internal/app/graph/resolver-utils.go b/apps/console/internal/app/graph/resolver-utils.go index 4a320a59d..6b798ce85 100644 --- a/apps/console/internal/app/graph/resolver-utils.go +++ b/apps/console/internal/app/graph/resolver-utils.go @@ -3,13 +3,105 @@ package graph import ( "context" "fmt" + "strings" - "kloudlite.io/apps/console/internal/domain" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/errors" + + "github.com/kloudlite/api/apps/console/internal/domain" +) + +func toConsoleContext(ctx context.Context) (domain.ConsoleContext, error) { + missingContextValue := "context value (%s) is missing" + + errMsgs := make([]string, 0, 3) + + session, ok := ctx.Value("user-session").(*common.AuthSession) + if !ok { + errMsgs = append(errMsgs, fmt.Sprintf(missingContextValue, "user-session")) + } + + accountName, ok := ctx.Value("account-name").(string) + if !ok { + errMsgs = append(errMsgs, fmt.Sprintf(missingContextValue, "account-name")) + } + + var err error + if len(errMsgs) != 0 { + err = errors.NewE(errors.Newf("%v", strings.Join(errMsgs, ","))) + } + + if err != nil { + return domain.ConsoleContext{}, errors.NewE(err) + } + + return domain.ConsoleContext{ + Context: ctx, + AccountName: accountName, + + UserId: session.UserId, + UserEmail: session.UserEmail, + UserName: session.UserName, + }, nil +} + +// func (r *queryResolver) getNamespaceFromProjectAndScope(ctx context.Context, project model.ProjectID, scope model.WorkspaceOrEnvID) (string, error) { +// pTargetNs, err := r.getNamespaceFromProjectID(ctx, project) +// if err != nil { +// return "", errors.NewE(err) +// } +// +// switch scope.Type { +// case model.WorkspaceOrEnvIDTypeEnvironmentName: +// { +// cc, err := toConsoleContext(ctx) +// if err != nil { +// return "", errors.NewE(err) +// } +// env, err := r.Domain.GetEnvironment(cc, pTargetNs, scope.Value) +// if err != nil { +// return "", errors.NewE(err) +// } +// return env.Spec.TargetNamespace, nil +// } +// case model.WorkspaceOrEnvIDTypeWorkspaceName: +// { +// cc, err := toConsoleContext(ctx) +// if err != nil { +// return "", errors.NewE(err) +// } +// ws, err := r.Domain.GetEnvironment(cc, pTargetNs, scope.Value) +// if err != nil { +// return "", errors.NewE(err) +// } +// return ws.Spec.TargetNamespace, nil +// } +// case model.WorkspaceOrEnvIDTypeEnvironmentTargetNamespace: +// return scope.Value, nil +// case model.WorkspaceOrEnvIDTypeWorkspaceTargetNamespace: +// return scope.Value, nil +// default: +// return "", errors.Newf("invalid scope type %q", scope.Type) +// } +// } + +var ( + errNilApp = errors.Newf("app obj is nil") + errNilConfig = errors.Newf("config obj is nil") + errNilSecret = errors.Newf("secret obj is nil") + errNilEnvironment = errors.Newf("environment obj is nil") + errNilVPNDevice = errors.Newf("vpn device obj is nil") + errNilImagePullSecret = errors.Newf("imagePullSecret obj is nil") + errNilManagedResource = errors.Newf("managed resource obj is nil") + errNilProject = errors.Newf("project obj is nil") + errNilProjectManagedService = errors.Newf("project manged svc obj is nil") + errNilRouter = errors.Newf("router obj is nil") ) -func toConsoleContext(ctx context.Context) domain.ConsoleContext { - if cc, ok := ctx.Value("kloudlite-ctx").(domain.ConsoleContext); ok { - return cc +func newResourceContext(ctx domain.ConsoleContext, projectName string, environmentName string) domain.ResourceContext { + return domain.ResourceContext{ + ConsoleContext: ctx, + ProjectName: projectName, + EnvironmentName: environmentName, } - panic(fmt.Errorf("context values %q is missing", "kloudlite-ctx")) } diff --git a/apps/console/internal/app/graph/resolver.go b/apps/console/internal/app/graph/resolver.go index c2af817d6..fe4a878cd 100644 --- a/apps/console/internal/app/graph/resolver.go +++ b/apps/console/internal/app/graph/resolver.go @@ -1,7 +1,7 @@ package graph import ( - "kloudlite.io/apps/console/internal/domain" + "github.com/kloudlite/api/apps/console/internal/domain" ) // This file will not be regenerated automatically. diff --git a/apps/console/internal/app/graph/router.resolvers.go b/apps/console/internal/app/graph/router.resolvers.go index 29f14af7b..bf2c2a300 100644 --- a/apps/console/internal/app/graph/router.resolvers.go +++ b/apps/console/internal/app/graph/router.resolvers.go @@ -6,24 +6,71 @@ package graph import ( "context" + "github.com/kloudlite/api/pkg/errors" + "time" - "kloudlite.io/apps/console/internal/app/graph/generated" - "kloudlite.io/apps/console/internal/app/graph/model" - "kloudlite.io/apps/console/internal/domain/entities" - fn "kloudlite.io/pkg/functions" + "github.com/kloudlite/api/apps/console/internal/app/graph/generated" + "github.com/kloudlite/api/apps/console/internal/app/graph/model" + "github.com/kloudlite/api/apps/console/internal/entities" + fn "github.com/kloudlite/api/pkg/functions" + "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// CreationTime is the resolver for the creationTime field. +func (r *routerResolver) CreationTime(ctx context.Context, obj *entities.Router) (string, error) { + if obj == nil { + return "", errNilRouter + } + return obj.BaseEntity.CreationTime.Format(time.RFC3339), nil +} + +// ID is the resolver for the id field. +func (r *routerResolver) ID(ctx context.Context, obj *entities.Router) (string, error) { + if obj == nil { + return "", errNilRouter + } + return string(obj.Id), nil +} + // Spec is the resolver for the spec field. -func (r *routerResolver) Spec(ctx context.Context, obj *entities.Router) (*model.RouterSpec, error) { - var m model.RouterSpec +func (r *routerResolver) Spec(ctx context.Context, obj *entities.Router) (*model.GithubComKloudliteOperatorApisCrdsV1RouterSpec, error) { + if obj == nil { + return nil, errNilRouter + } + + m := &model.GithubComKloudliteOperatorApisCrdsV1RouterSpec{} if err := fn.JsonConversion(obj.Spec, &m); err != nil { - return nil, err + return nil, errors.NewE(err) + } + return m, nil +} + +// UpdateTime is the resolver for the updateTime field. +func (r *routerResolver) UpdateTime(ctx context.Context, obj *entities.Router) (string, error) { + if obj == nil { + return "", errNilRouter } - return &m, nil + return obj.BaseEntity.UpdateTime.Format(time.RFC3339), nil +} + +// Metadata is the resolver for the metadata field. +func (r *routerInResolver) Metadata(ctx context.Context, obj *entities.Router, data *v1.ObjectMeta) error { + if obj == nil { + return errNilRouter + } + + if data != nil { + obj.ObjectMeta = *data + } + + return nil } // Spec is the resolver for the spec field. -func (r *routerInResolver) Spec(ctx context.Context, obj *entities.Router, data *model.RouterSpecIn) error { +func (r *routerInResolver) Spec(ctx context.Context, obj *entities.Router, data *model.GithubComKloudliteOperatorApisCrdsV1RouterSpecIn) error { + if obj == nil { + return errNilRouter + } return fn.JsonConversion(data, &obj.Spec) } diff --git a/apps/console/internal/app/graph/scalars-override.resolvers.go b/apps/console/internal/app/graph/scalars-override.resolvers.go deleted file mode 100644 index 21f0a507c..000000000 --- a/apps/console/internal/app/graph/scalars-override.resolvers.go +++ /dev/null @@ -1,18 +0,0 @@ -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.28 - -import ( - "kloudlite.io/common" - - "kloudlite.io/apps/console/internal/app/graph/generated" -) - -func (r *Resolver) Metadata() generated.MetadataResolver { return &common.MetadataResolver{} } -func (r *Resolver) Status() generated.StatusResolver { return &common.StatusResolver{} } -func (r *Resolver) SyncStatus() generated.SyncStatusResolver { return &common.SyncStatusResolver{} } -func (r *Resolver) MetadataIn() generated.MetadataInResolver { return &common.MetadataInResolver{} } -func (r *Resolver) Patch() generated.PatchResolver { return &common.PatchResolver{} } -func (r *Resolver) PatchIn() generated.PatchInResolver { return &common.PatchInResolver{} } diff --git a/apps/console/internal/app/graph/schema.graphqls b/apps/console/internal/app/graph/schema.graphqls index f3514da90..e5551319d 100644 --- a/apps/console/internal/app/graph/schema.graphqls +++ b/apps/console/internal/app/graph/schema.graphqls @@ -1,89 +1,186 @@ directive @isLoggedIn on FIELD_DEFINITION -directive @hasAccountAndCluster on FIELD_DEFINITION +directive @isLoggedInAndVerified on FIELD_DEFINITION directive @hasAccount on FIELD_DEFINITION -enum ConsoleResType { - project - app - config - secret - router - managedservice - managedresource - environment +enum ConsoleResType { + project + app + config + secret + router + managed_service + project_managed_service + managed_resource + environment + vpn_device } type ConsoleCheckNameAvailabilityOutput @shareable { - result: Boolean! - suggestedNames: [String!] + result: Boolean! + suggestedNames: [String!] } -type Query { - core_checkNameAvailability(resType: ConsoleResType!, name: String!): ConsoleCheckNameAvailabilityOutput! @isLoggedIn @hasAccount +input SearchProjects { + text: MatchFilterIn + isReady: MatchFilterIn + markedForDeletion: MatchFilterIn +} - core_listProjects(clusterName: String): [Project!] @isLoggedIn @hasAccount - core_getProject(name: String!): Project @isLoggedIn @hasAccountAndCluster - core_resyncProject(name: String!): Boolean! @isLoggedIn @hasAccountAndCluster +input SearchImagePullSecrets { + text: MatchFilterIn + isReady: MatchFilterIn + markedForDeletion: MatchFilterIn +} - core_listWorkspaces(namespace: String!): [Workspace!] @isLoggedIn @hasAccountAndCluster - core_getWorkspace(namespace: String!, name: String!): Workspace @isLoggedIn @hasAccountAndCluster - core_resyncWorkspace(namespace: String!, name: String!): Boolean! @isLoggedIn @hasAccountAndCluster +input SearchEnvironments { + text: MatchFilterIn + projectName: MatchFilterIn + isReady: MatchFilterIn + markedForDeletion: MatchFilterIn +} - core_listApps(namespace: String!): [App!] @isLoggedIn @hasAccountAndCluster - core_getApp(namespace: String!, name: String!): App @isLoggedIn @hasAccountAndCluster - core_resyncApp(namespace: String!, name: String!): Boolean! @isLoggedIn @hasAccountAndCluster +input SearchApps { + text: MatchFilterIn + isReady: MatchFilterIn + markedForDeletion: MatchFilterIn +} - core_listConfigs(namespace: String!): [Config!] @isLoggedIn @hasAccountAndCluster - core_getConfig(namespace: String!, name: String!): Config @isLoggedIn @hasAccountAndCluster - core_resyncConfig(namespace: String!, name: String!): Boolean! @isLoggedIn @hasAccountAndCluster +input SearchConfigs { + text: MatchFilterIn + isReady: MatchFilterIn + markedForDeletion: MatchFilterIn +} - core_listSecrets(namespace: String!): [Secret!] @isLoggedIn @hasAccountAndCluster - core_getSecret(namespace: String!, name: String!): Secret @isLoggedIn @hasAccountAndCluster - core_resyncSecret(namespace: String!, name: String!): Boolean! @isLoggedIn @hasAccountAndCluster +input SearchSecrets { + text: MatchFilterIn + isReady: MatchFilterIn + markedForDeletion: MatchFilterIn +} - core_listRouters(namespace: String!): [Router!] @isLoggedIn @hasAccountAndCluster - core_getRouter(namespace: String!, name: String!): Router @isLoggedIn @hasAccountAndCluster - core_resyncRouter(namespace: String!, name: String!): Boolean! @isLoggedIn @hasAccountAndCluster +input SearchRouters { + text: MatchFilterIn + isReady: MatchFilterIn + markedForDeletion: MatchFilterIn +} + +input SearchManagedResources { + text: MatchFilterIn + managedServiceName: MatchFilterIn + isReady: MatchFilterIn + markedForDeletion: MatchFilterIn +} - core_listManagedServices(namespace: String!): [ManagedService!] @isLoggedIn @hasAccountAndCluster - core_getManagedService(namespace: String!, name: String!): ManagedService @isLoggedIn @hasAccountAndCluster - core_resyncManagedService(namespace: String!, name: String!): Boolean! @isLoggedIn @hasAccountAndCluster +input SearchProjectManagedService { + text: MatchFilterIn + managedServiceName: MatchFilterIn + isReady: MatchFilterIn + markedForDeletion: MatchFilterIn +} + +input CoreSearchVPNDevices { + text: MatchFilterIn + isReady: MatchFilterIn + markedForDeletion: MatchFilterIn +} - core_listManagedResources(namespace: String!): [ManagedResource!] @isLoggedIn @hasAccountAndCluster - core_getManagedResource(namespace: String!, name: String!): ManagedResource @isLoggedIn @hasAccountAndCluster - core_resyncManagedResource(namespace: String!, name: String!): Boolean! @isLoggedIn @hasAccountAndCluster +type Query { + core_checkNameAvailability(projectName: String, envName: String, resType: ConsoleResType!, name: String!): ConsoleCheckNameAvailabilityOutput! @isLoggedIn @hasAccount + + core_listProjects(search: SearchProjects, pq: CursorPaginationIn): ProjectPaginatedRecords @isLoggedInAndVerified @hasAccount + core_getProject(name: String!): Project @isLoggedInAndVerified @hasAccount + core_resyncProject(name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_listEnvironments(projectName: String!, search: SearchEnvironments, pq: CursorPaginationIn): EnvironmentPaginatedRecords @isLoggedInAndVerified @hasAccount + core_getEnvironment(projectName: String!, name: String!): Environment @isLoggedInAndVerified @hasAccount + core_resyncEnvironment(projectName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + # get image pull secrets + core_listImagePullSecrets(projectName: String!, envName: String!, search: SearchImagePullSecrets, pq: CursorPaginationIn): ImagePullSecretPaginatedRecords @isLoggedInAndVerified @hasAccount + core_getImagePullSecret(projectName: String!, envName: String!, name: String!): ImagePullSecret @isLoggedInAndVerified @hasAccount + core_resyncImagePullSecret(projectName: String!, envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_listApps(projectName: String!, envName: String!, search: SearchApps, pq: CursorPaginationIn): AppPaginatedRecords @isLoggedInAndVerified @hasAccount + core_getApp(projectName: String!, envName: String!, name: String!): App @isLoggedInAndVerified @hasAccount + core_resyncApp(projectName: String!, envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_restartApp(projectName: String!, envName: String!, appName: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_getConfigValues(projectName: String!, envName: String!, queries: [ConfigKeyRefIn]): [ConfigKeyValueRef!] @isLoggedInAndVerified @hasAccount + core_listConfigs(projectName: String!, envName: String!, search: SearchConfigs, pq: CursorPaginationIn): ConfigPaginatedRecords @isLoggedInAndVerified @hasAccount + core_getConfig(projectName: String!, envName: String!, name: String!): Config @isLoggedInAndVerified @hasAccount + core_resyncConfig(projectName: String!, envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_getSecretValues(projectName: String!, envName: String!, queries: [SecretKeyRefIn!]): [SecretKeyValueRef!] @isLoggedInAndVerified @hasAccount + core_listSecrets(projectName: String!, envName: String!, search: SearchSecrets, pq: CursorPaginationIn): SecretPaginatedRecords @isLoggedInAndVerified @hasAccount + core_getSecret(projectName: String!, envName: String!, name: String!): Secret @isLoggedInAndVerified @hasAccount + core_resyncSecret(projectName: String!, envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_listRouters(projectName: String!, envName: String!, search: SearchRouters, pq: CursorPaginationIn): RouterPaginatedRecords @isLoggedInAndVerified @hasAccount + core_getRouter(projectName: String!, envName: String!, name: String!): Router @isLoggedInAndVerified @hasAccount + core_resyncRouter(projectName: String!, envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_getManagedResouceOutputKeys(projectName: String!, envName: String!, name: String!): [String!]! @isLoggedInAndVerified @hasAccount + core_getManagedResouceOutputKeyValues(projectName: String!, envName: String!, keyrefs: [ManagedResourceKeyRefIn]): [ManagedResourceKeyValueRef!]! @isLoggedInAndVerified @hasAccount + core_listManagedResources(projectName: String!, envName: String!, search: SearchManagedResources, pq: CursorPaginationIn): ManagedResourcePaginatedRecords @isLoggedInAndVerified @hasAccount + core_getManagedResource(projectName: String!, envName: String!, name: String!): ManagedResource @isLoggedInAndVerified @hasAccount + core_resyncManagedResource(projectName: String!, envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_listProjectManagedServices(projectName: String!, search: SearchProjectManagedService, pq: CursorPaginationIn): ProjectManagedServicePaginatedRecords @isLoggedInAndVerified @hasAccount + core_getProjectManagedService(projectName: String!, name: String!): ProjectManagedService @isLoggedInAndVerified @hasAccount + core_resyncProjectManagedService(projectName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_restartProjectManagedService(projectName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_listVPNDevices(search: CoreSearchVPNDevices, pq: CursorPaginationIn): ConsoleVPNDevicePaginatedRecords @isLoggedInAndVerified @hasAccount + core_listVPNDevicesForUser: [ConsoleVPNDevice!] @isLoggedInAndVerified @hasAccount + core_getVPNDevice(name: String!): ConsoleVPNDevice @isLoggedInAndVerified @hasAccount } type Mutation { - core_createProject(project: ProjectIn!): Project @isLoggedIn @hasAccountAndCluster - core_updateProject(project: ProjectIn!): Project @isLoggedIn @hasAccountAndCluster - core_deleteProject(name: String!): Boolean! @isLoggedIn @hasAccountAndCluster - - core_createWorkspace(env: WorkspaceIn!): Workspace @isLoggedIn @hasAccountAndCluster - core_updateWorkspace(env: WorkspaceIn!): Workspace @isLoggedIn @hasAccountAndCluster - core_deleteWorkspace(namespace: String!, name: String!): Boolean! @isLoggedIn @hasAccountAndCluster - - core_createApp(app: AppIn!): App @isLoggedIn @hasAccountAndCluster - core_updateApp(app: AppIn!): App @isLoggedIn @hasAccountAndCluster - core_deleteApp(namespace: String!, name: String!): Boolean! @isLoggedIn @hasAccountAndCluster - - core_createConfig(config: ConfigIn!): Config @isLoggedIn @hasAccountAndCluster - core_updateConfig(config: ConfigIn!): Config @isLoggedIn @hasAccountAndCluster - core_deleteConfig(namespace: String!, name: String!): Boolean! @isLoggedIn @hasAccountAndCluster - - core_createSecret(secret: SecretIn!): Secret @isLoggedIn @hasAccountAndCluster - core_updateSecret(secret: SecretIn!): Secret @isLoggedIn @hasAccountAndCluster - core_deleteSecret(namespace: String!, name: String!): Boolean! @isLoggedIn @hasAccountAndCluster - - core_createRouter(router: RouterIn!): Router @isLoggedIn @hasAccountAndCluster - core_updateRouter(router: RouterIn!): Router @isLoggedIn @hasAccountAndCluster - core_deleteRouter(namespace: String!, name: String!): Boolean! @isLoggedIn @hasAccountAndCluster - - core_createManagedService(msvc: ManagedServiceIn!): ManagedService @isLoggedIn @hasAccountAndCluster - core_updateManagedService(msvc: ManagedServiceIn!): ManagedService @isLoggedIn @hasAccountAndCluster - core_deleteManagedService(namespace: String!, name: String!): Boolean! @isLoggedIn @hasAccountAndCluster - - core_createManagedResource(mres: ManagedResourceIn!): ManagedResource @isLoggedIn @hasAccountAndCluster - core_updateManagedResource(mres: ManagedResourceIn!): ManagedResource @isLoggedIn @hasAccountAndCluster - core_deleteManagedResource(namespace: String!, name: String!): Boolean! @isLoggedIn @hasAccountAndCluster + core_createProject(project: ProjectIn!): Project @isLoggedInAndVerified @hasAccount + core_updateProject(project: ProjectIn!): Project @isLoggedInAndVerified @hasAccount + core_deleteProject(name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_createEnvironment(projectName: String!, env: EnvironmentIn!): Environment @isLoggedInAndVerified @hasAccount + core_updateEnvironment(projectName: String!, env: EnvironmentIn!): Environment @isLoggedInAndVerified @hasAccount + core_deleteEnvironment(projectName: String!, envName: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_cloneEnvironment(projectName: String!, sourceEnvName: String!, destinationEnvName: String!, displayName: String!, environmentRoutingMode: Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingMode!): Environment @isLoggedInAndVerified @hasAccount + + # image pull secrets + core_createImagePullSecret(projectName: String!, envName: String!, imagePullSecretIn: ImagePullSecretIn!): ImagePullSecret @isLoggedInAndVerified @hasAccount + core_deleteImagePullSecret(projectName: String!, envName: String!, secretName: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_createApp(projectName: String!, envName: String!, app: AppIn!): App @isLoggedInAndVerified @hasAccount + core_updateApp(projectName: String!, envName: String!, app: AppIn!): App @isLoggedInAndVerified @hasAccount + core_deleteApp(projectName: String!, envName: String!, appName: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_interceptApp(projectName: String!, envName: String!, appname: String!, deviceName: String!, intercept: Boolean!): Boolean! @isLoggedInAndVerified @hasAccount + + core_createConfig(projectName: String!, envName: String!, config: ConfigIn!): Config @isLoggedInAndVerified @hasAccount + core_updateConfig(projectName: String!, envName: String!, config: ConfigIn!): Config @isLoggedInAndVerified @hasAccount + core_deleteConfig(projectName: String!, envName: String!, configName: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_createSecret(projectName: String!, envName: String!, secret: SecretIn!): Secret @isLoggedInAndVerified @hasAccount + core_updateSecret(projectName: String!, envName: String!, secret: SecretIn!): Secret @isLoggedInAndVerified @hasAccount + core_deleteSecret(projectName: String!, envName: String!, secretName: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_createRouter(projectName: String!, envName: String!, router: RouterIn!): Router @isLoggedInAndVerified @hasAccount + core_updateRouter(projectName: String!, envName: String!, router: RouterIn!): Router @isLoggedInAndVerified @hasAccount + core_deleteRouter(projectName: String!, envName: String!, routerName: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_createManagedResource(projectName: String!, envName: String!, mres: ManagedResourceIn!): ManagedResource @isLoggedInAndVerified @hasAccount + core_updateManagedResource(projectName: String!, envName: String!, mres: ManagedResourceIn!): ManagedResource @isLoggedInAndVerified @hasAccount + core_deleteManagedResource(projectName: String!, envName: String!, mresName: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_createProjectManagedService(projectName: String!, pmsvc: ProjectManagedServiceIn!): ProjectManagedService @isLoggedInAndVerified @hasAccount + core_updateProjectManagedService(projectName: String!, pmsvc: ProjectManagedServiceIn!): ProjectManagedService @isLoggedInAndVerified @hasAccount + core_deleteProjectManagedService(projectName: String!, pmsvcName: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_createVPNDevice(vpnDevice: ConsoleVPNDeviceIn!): ConsoleVPNDevice @isLoggedInAndVerified @hasAccount + core_updateVPNDevice(vpnDevice: ConsoleVPNDeviceIn!): ConsoleVPNDevice @isLoggedInAndVerified @hasAccount + + core_updateVPNDevicePorts(deviceName: String!,ports: [PortIn!]!): Boolean! @isLoggedInAndVerified @hasAccount + core_updateVPNDeviceEnv(deviceName: String!,projectName: String!, envName: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_updateVpnDeviceNs(deviceName: String!,ns: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_updateVpnClusterName(deviceName: String!,clusterName: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_deleteVPNDevice(deviceName: String!): Boolean! @isLoggedInAndVerified @hasAccount } + diff --git a/apps/console/internal/app/graph/schema.resolvers.go b/apps/console/internal/app/graph/schema.resolvers.go index 697d34c77..41d08e163 100644 --- a/apps/console/internal/app/graph/schema.resolvers.go +++ b/apps/console/internal/app/graph/schema.resolvers.go @@ -6,364 +6,982 @@ package graph import ( "context" - - "kloudlite.io/apps/console/internal/app/graph/generated" - "kloudlite.io/apps/console/internal/domain" - "kloudlite.io/apps/console/internal/domain/entities" + "fmt" + "github.com/kloudlite/api/pkg/errors" + + "github.com/kloudlite/api/apps/console/internal/app/graph/generated" + "github.com/kloudlite/api/apps/console/internal/app/graph/model" + "github.com/kloudlite/api/apps/console/internal/domain" + "github.com/kloudlite/api/apps/console/internal/entities" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/repos" + v11 "github.com/kloudlite/operator/apis/crds/v1" + "github.com/kloudlite/operator/apis/wireguard/v1" ) // CoreCreateProject is the resolver for the core_createProject field. func (r *mutationResolver) CoreCreateProject(ctx context.Context, project entities.Project) (*entities.Project, error) { - return r.Domain.CreateProject(toConsoleContext(ctx), project) + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.CreateProject(cc, project) } // CoreUpdateProject is the resolver for the core_updateProject field. func (r *mutationResolver) CoreUpdateProject(ctx context.Context, project entities.Project) (*entities.Project, error) { - return r.Domain.UpdateProject(toConsoleContext(ctx), project) + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.UpdateProject(cc, project) } // CoreDeleteProject is the resolver for the core_deleteProject field. func (r *mutationResolver) CoreDeleteProject(ctx context.Context, name string) (bool, error) { - if err := r.Domain.DeleteProject(toConsoleContext(ctx), name); err != nil { + cc, err := toConsoleContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + if err := r.Domain.DeleteProject(cc, name); err != nil { return false, nil } return true, nil } -// CoreCreateWorkspace is the resolver for the core_createWorkspace field. -func (r *mutationResolver) CoreCreateWorkspace(ctx context.Context, env entities.Workspace) (*entities.Workspace, error) { - return r.Domain.CreateWorkspace(toConsoleContext(ctx), env) +// CoreCreateEnvironment is the resolver for the core_createEnvironment field. +func (r *mutationResolver) CoreCreateEnvironment(ctx context.Context, projectName string, env entities.Environment) (*entities.Environment, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.CreateEnvironment(cc, projectName, env) } -// CoreUpdateWorkspace is the resolver for the core_updateWorkspace field. -func (r *mutationResolver) CoreUpdateWorkspace(ctx context.Context, env entities.Workspace) (*entities.Workspace, error) { - return r.Domain.UpdateWorkspace(toConsoleContext(ctx), env) +// CoreUpdateEnvironment is the resolver for the core_updateEnvironment field. +func (r *mutationResolver) CoreUpdateEnvironment(ctx context.Context, projectName string, env entities.Environment) (*entities.Environment, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.UpdateEnvironment(cc, projectName, env) } -// CoreDeleteWorkspace is the resolver for the core_deleteWorkspace field. -func (r *mutationResolver) CoreDeleteWorkspace(ctx context.Context, namespace string, name string) (bool, error) { - if err := r.Domain.DeleteWorkspace(toConsoleContext(ctx), namespace, name); err != nil { - return false, err +// CoreDeleteEnvironment is the resolver for the core_deleteEnvironment field. +func (r *mutationResolver) CoreDeleteEnvironment(ctx context.Context, projectName string, envName string) (bool, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + if err := r.Domain.DeleteEnvironment(cc, projectName, envName); err != nil { + return false, nil + } + return true, nil +} + +// CoreCloneEnvironment is the resolver for the core_cloneEnvironment field. +func (r *mutationResolver) CoreCloneEnvironment(ctx context.Context, projectName string, sourceEnvName string, destinationEnvName string, displayName string, environmentRoutingMode v11.EnvironmentRoutingMode) (*entities.Environment, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.CloneEnvironment(cc, projectName, sourceEnvName, destinationEnvName, displayName, environmentRoutingMode) +} + +// CoreCreateImagePullSecret is the resolver for the core_createImagePullSecret field. +func (r *mutationResolver) CoreCreateImagePullSecret(ctx context.Context, projectName string, envName string, imagePullSecretIn entities.ImagePullSecret) (*entities.ImagePullSecret, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.Domain.CreateImagePullSecret(newResourceContext(cc, projectName, envName), imagePullSecretIn) +} + +// CoreDeleteImagePullSecret is the resolver for the core_deleteImagePullSecret field. +func (r *mutationResolver) CoreDeleteImagePullSecret(ctx context.Context, projectName string, envName string, secretName string) (bool, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + if err := r.Domain.DeleteImagePullSecret(newResourceContext(cc, projectName, envName), secretName); err != nil { + return false, nil } return true, nil } // CoreCreateApp is the resolver for the core_createApp field. -func (r *mutationResolver) CoreCreateApp(ctx context.Context, app entities.App) (*entities.App, error) { - return r.Domain.CreateApp(toConsoleContext(ctx), app) +func (r *mutationResolver) CoreCreateApp(ctx context.Context, projectName string, envName string, app entities.App) (*entities.App, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.CreateApp(newResourceContext(cc, projectName, envName), app) } // CoreUpdateApp is the resolver for the core_updateApp field. -func (r *mutationResolver) CoreUpdateApp(ctx context.Context, app entities.App) (*entities.App, error) { - return r.Domain.UpdateApp(toConsoleContext(ctx), app) +func (r *mutationResolver) CoreUpdateApp(ctx context.Context, projectName string, envName string, app entities.App) (*entities.App, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.UpdateApp(newResourceContext(cc, projectName, envName), app) } // CoreDeleteApp is the resolver for the core_deleteApp field. -func (r *mutationResolver) CoreDeleteApp(ctx context.Context, namespace string, name string) (bool, error) { - if err := r.Domain.DeleteApp(toConsoleContext(ctx), namespace, name); err != nil { - return false, err +func (r *mutationResolver) CoreDeleteApp(ctx context.Context, projectName string, envName string, appName string) (bool, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + if err := r.Domain.DeleteApp(newResourceContext(cc, projectName, envName), appName); err != nil { + return false, errors.NewE(err) } return true, nil } +// CoreInterceptApp is the resolver for the core_interceptApp field. +func (r *mutationResolver) CoreInterceptApp(ctx context.Context, projectName string, envName string, appname string, deviceName string, intercept bool) (bool, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + return r.Domain.InterceptApp(newResourceContext(cc, projectName, envName), appname, deviceName, intercept) +} + // CoreCreateConfig is the resolver for the core_createConfig field. -func (r *mutationResolver) CoreCreateConfig(ctx context.Context, config entities.Config) (*entities.Config, error) { - return r.Domain.CreateConfig(toConsoleContext(ctx), config) +func (r *mutationResolver) CoreCreateConfig(ctx context.Context, projectName string, envName string, config entities.Config) (*entities.Config, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.CreateConfig(newResourceContext(cc, projectName, envName), config) } // CoreUpdateConfig is the resolver for the core_updateConfig field. -func (r *mutationResolver) CoreUpdateConfig(ctx context.Context, config entities.Config) (*entities.Config, error) { - return r.Domain.UpdateConfig(toConsoleContext(ctx), config) +func (r *mutationResolver) CoreUpdateConfig(ctx context.Context, projectName string, envName string, config entities.Config) (*entities.Config, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.UpdateConfig(newResourceContext(cc, projectName, envName), config) } // CoreDeleteConfig is the resolver for the core_deleteConfig field. -func (r *mutationResolver) CoreDeleteConfig(ctx context.Context, namespace string, name string) (bool, error) { - if err := r.Domain.DeleteConfig(toConsoleContext(ctx), namespace, name); err != nil { - return false, err +func (r *mutationResolver) CoreDeleteConfig(ctx context.Context, projectName string, envName string, configName string) (bool, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + if err := r.Domain.DeleteConfig(newResourceContext(cc, projectName, envName), configName); err != nil { + return false, errors.NewE(err) } return true, nil } // CoreCreateSecret is the resolver for the core_createSecret field. -func (r *mutationResolver) CoreCreateSecret(ctx context.Context, secret entities.Secret) (*entities.Secret, error) { - return r.Domain.CreateSecret(toConsoleContext(ctx), secret) +func (r *mutationResolver) CoreCreateSecret(ctx context.Context, projectName string, envName string, secret entities.Secret) (*entities.Secret, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.CreateSecret(newResourceContext(cc, projectName, envName), secret) } // CoreUpdateSecret is the resolver for the core_updateSecret field. -func (r *mutationResolver) CoreUpdateSecret(ctx context.Context, secret entities.Secret) (*entities.Secret, error) { - return r.Domain.UpdateSecret(toConsoleContext(ctx), secret) +func (r *mutationResolver) CoreUpdateSecret(ctx context.Context, projectName string, envName string, secret entities.Secret) (*entities.Secret, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.UpdateSecret(newResourceContext(cc, projectName, envName), secret) } // CoreDeleteSecret is the resolver for the core_deleteSecret field. -func (r *mutationResolver) CoreDeleteSecret(ctx context.Context, namespace string, name string) (bool, error) { - if err := r.Domain.DeleteSecret(toConsoleContext(ctx), namespace, name); err != nil { - return false, err +func (r *mutationResolver) CoreDeleteSecret(ctx context.Context, projectName string, envName string, secretName string) (bool, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + if err := r.Domain.DeleteSecret(newResourceContext(cc, projectName, envName), secretName); err != nil { + return false, errors.NewE(err) } return true, nil } // CoreCreateRouter is the resolver for the core_createRouter field. -func (r *mutationResolver) CoreCreateRouter(ctx context.Context, router entities.Router) (*entities.Router, error) { - return r.Domain.CreateRouter(toConsoleContext(ctx), router) +func (r *mutationResolver) CoreCreateRouter(ctx context.Context, projectName string, envName string, router entities.Router) (*entities.Router, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.CreateRouter(newResourceContext(cc, projectName, envName), router) } // CoreUpdateRouter is the resolver for the core_updateRouter field. -func (r *mutationResolver) CoreUpdateRouter(ctx context.Context, router entities.Router) (*entities.Router, error) { - return r.Domain.UpdateRouter(toConsoleContext(ctx), router) +func (r *mutationResolver) CoreUpdateRouter(ctx context.Context, projectName string, envName string, router entities.Router) (*entities.Router, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.UpdateRouter(newResourceContext(cc, projectName, envName), router) } // CoreDeleteRouter is the resolver for the core_deleteRouter field. -func (r *mutationResolver) CoreDeleteRouter(ctx context.Context, namespace string, name string) (bool, error) { - if err := r.Domain.DeleteRouter(toConsoleContext(ctx), namespace, name); err != nil { - return false, err +func (r *mutationResolver) CoreDeleteRouter(ctx context.Context, projectName string, envName string, routerName string) (bool, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + if err := r.Domain.DeleteRouter(newResourceContext(cc, projectName, envName), routerName); err != nil { + return false, errors.NewE(err) } return true, nil } -// CoreCreateManagedService is the resolver for the core_createManagedService field. -func (r *mutationResolver) CoreCreateManagedService(ctx context.Context, msvc entities.MSvc) (*entities.MSvc, error) { - return r.Domain.CreateManagedService(toConsoleContext(ctx), msvc) +// CoreCreateManagedResource is the resolver for the core_createManagedResource field. +func (r *mutationResolver) CoreCreateManagedResource(ctx context.Context, projectName string, envName string, mres entities.ManagedResource) (*entities.ManagedResource, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.CreateManagedResource(newResourceContext(cc, projectName, envName), mres) } -// CoreUpdateManagedService is the resolver for the core_updateManagedService field. -func (r *mutationResolver) CoreUpdateManagedService(ctx context.Context, msvc entities.MSvc) (*entities.MSvc, error) { - return r.Domain.UpdateManagedService(toConsoleContext(ctx), msvc) +// CoreUpdateManagedResource is the resolver for the core_updateManagedResource field. +func (r *mutationResolver) CoreUpdateManagedResource(ctx context.Context, projectName string, envName string, mres entities.ManagedResource) (*entities.ManagedResource, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.UpdateManagedResource(newResourceContext(cc, projectName, envName), mres) } -// CoreDeleteManagedService is the resolver for the core_deleteManagedService field. -func (r *mutationResolver) CoreDeleteManagedService(ctx context.Context, namespace string, name string) (bool, error) { - if err := r.Domain.DeleteManagedService(toConsoleContext(ctx), namespace, name); err != nil { - return false, err +// CoreDeleteManagedResource is the resolver for the core_deleteManagedResource field. +func (r *mutationResolver) CoreDeleteManagedResource(ctx context.Context, projectName string, envName string, mresName string) (bool, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + if err := r.Domain.DeleteManagedResource(newResourceContext(cc, projectName, envName), mresName); err != nil { + return false, errors.NewE(err) } return true, nil } -// CoreCreateManagedResource is the resolver for the core_createManagedResource field. -func (r *mutationResolver) CoreCreateManagedResource(ctx context.Context, mres entities.MRes) (*entities.MRes, error) { - return r.Domain.CreateManagedResource(toConsoleContext(ctx), mres) +// CoreCreateProjectManagedService is the resolver for the core_createProjectManagedService field. +func (r *mutationResolver) CoreCreateProjectManagedService(ctx context.Context, projectName string, pmsvc entities.ProjectManagedService) (*entities.ProjectManagedService, error) { + ictx, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.CreateProjectManagedService(ictx, projectName, pmsvc) } -// CoreUpdateManagedResource is the resolver for the core_updateManagedResource field. -func (r *mutationResolver) CoreUpdateManagedResource(ctx context.Context, mres entities.MRes) (*entities.MRes, error) { - return r.Domain.UpdateManagedResource(toConsoleContext(ctx), mres) +// CoreUpdateProjectManagedService is the resolver for the core_updateProjectManagedService field. +func (r *mutationResolver) CoreUpdateProjectManagedService(ctx context.Context, projectName string, pmsvc entities.ProjectManagedService) (*entities.ProjectManagedService, error) { + ictx, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.UpdateProjectManagedService(ictx, projectName, pmsvc) } -// CoreDeleteManagedResource is the resolver for the core_deleteManagedResource field. -func (r *mutationResolver) CoreDeleteManagedResource(ctx context.Context, namespace string, name string) (bool, error) { - if err := r.Domain.DeleteManagedResource(toConsoleContext(ctx), namespace, name); err != nil { - return false, err +// CoreDeleteProjectManagedService is the resolver for the core_deleteProjectManagedService field. +func (r *mutationResolver) CoreDeleteProjectManagedService(ctx context.Context, projectName string, pmsvcName string) (bool, error) { + ictx, err := toConsoleContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + err = r.Domain.DeleteProjectManagedService(ictx, projectName, pmsvcName) + if err != nil { + return false, errors.NewE(err) + } + return true, nil +} + +// CoreCreateVPNDevice is the resolver for the core_createVPNDevice field. +func (r *mutationResolver) CoreCreateVPNDevice(ctx context.Context, vpnDevice entities.ConsoleVPNDevice) (*entities.ConsoleVPNDevice, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.Domain.CreateVPNDevice(cc, vpnDevice) +} + +// CoreUpdateVPNDevice is the resolver for the core_updateVPNDevice field. +func (r *mutationResolver) CoreUpdateVPNDevice(ctx context.Context, vpnDevice entities.ConsoleVPNDevice) (*entities.ConsoleVPNDevice, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.Domain.UpdateVPNDevice(cc, vpnDevice) +} + +// CoreUpdateVPNDevicePorts is the resolver for the core_updateVPNDevicePorts field. +func (r *mutationResolver) CoreUpdateVPNDevicePorts(ctx context.Context, deviceName string, ports []*v1.Port) (bool, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + + if err := r.Domain.UpdateVpnDevicePorts(cc, deviceName, ports); err != nil { + return false, errors.NewE(err) + } + + return true, nil +} + +// CoreUpdateVPNDeviceEnv is the resolver for the core_updateVPNDeviceEnv field. +func (r *mutationResolver) CoreUpdateVPNDeviceEnv(ctx context.Context, deviceName string, projectName string, envName string) (bool, error) { + if projectName == "" && envName == "" { + return false, fmt.Errorf("projectName and envName cannot be empty") + } + + cc, err := toConsoleContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + + if err := r.Domain.ActivateVpnDeviceOnEnvironment(cc, deviceName, projectName, envName); err != nil { + return false, errors.NewE(err) } + + return true, nil +} + +// CoreUpdateVpnDeviceNs is the resolver for the core_updateVpnDeviceNs field. +func (r *mutationResolver) CoreUpdateVpnDeviceNs(ctx context.Context, deviceName string, ns string) (bool, error) { + + cc, err := toConsoleContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + + if err := r.Domain.ActivateVPNDeviceOnNamespace(cc, deviceName, ns); err != nil { + return false, errors.NewE(err) + } + + return true, nil +} + +// CoreUpdateVpnClusterName is the resolver for the core_updateVpnClusterName field. +func (r *mutationResolver) CoreUpdateVpnClusterName(ctx context.Context, deviceName string, clusterName string) (bool, error) { + + cc, err := toConsoleContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + + if err := r.Domain.ActivateVpnDeviceOnCluster(cc, deviceName, clusterName); err != nil { + return false, errors.NewE(err) + } + + return true, nil +} + +// CoreDeleteVPNDevice is the resolver for the core_deleteVPNDevice field. +func (r *mutationResolver) CoreDeleteVPNDevice(ctx context.Context, deviceName string) (bool, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + + if err := r.Domain.DeleteVPNDevice(cc, deviceName); err != nil { + return false, errors.NewE(err) + } + return true, nil } // CoreCheckNameAvailability is the resolver for the core_checkNameAvailability field. -func (r *queryResolver) CoreCheckNameAvailability(ctx context.Context, resType domain.ResType, name string) (*domain.CheckNameAvailabilityOutput, error) { - return r.Domain.CheckNameAvailability(ctx, resType, toConsoleContext(ctx).GetAccountName(), name) +func (r *queryResolver) CoreCheckNameAvailability(ctx context.Context, projectName *string, envName *string, resType entities.ResourceType, name string) (*domain.CheckNameAvailabilityOutput, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, err + } + return r.Domain.CheckNameAvailability(ctx, cc.AccountName, projectName, envName, resType, name) } // CoreListProjects is the resolver for the core_listProjects field. -func (r *queryResolver) CoreListProjects(ctx context.Context, clusterName *string) ([]*entities.Project, error) { - cc := toConsoleContext(ctx) - p, err := r.Domain.ListProjects(ctx, cc.UserId, cc.AccountName, clusterName) +func (r *queryResolver) CoreListProjects(ctx context.Context, search *model.SearchProjects, pq *repos.CursorPagination) (*model.ProjectPaginatedRecords, error) { + filter := map[string]repos.MatchFilter{} + if search != nil { + if search.Text != nil { + filter["metadata.name"] = *search.Text + } + if search.IsReady != nil { + filter["status.isReady"] = *search.IsReady + } + if search.MarkedForDeletion != nil { + filter["markedForDeletion"] = *search.MarkedForDeletion + } + } + + cc, err := toConsoleContext(ctx) if err != nil { - return nil, err + // if cc.UserId == "" || cc.AccountName == "" { + // } + return nil, errors.NewE(err) } - if p == nil { - p = make([]*entities.Project, 0) + + p, err := r.Domain.ListProjects(ctx, cc.UserId, cc.AccountName, filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) + if err != nil { + return nil, errors.NewE(err) } - return p, nil + + return fn.JsonConvertP[model.ProjectPaginatedRecords](p) } // CoreGetProject is the resolver for the core_getProject field. func (r *queryResolver) CoreGetProject(ctx context.Context, name string) (*entities.Project, error) { - return r.Domain.GetProject(toConsoleContext(ctx), name) + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.GetProject(cc, name) } // CoreResyncProject is the resolver for the core_resyncProject field. func (r *queryResolver) CoreResyncProject(ctx context.Context, name string) (bool, error) { - if err := r.Domain.ResyncProject(toConsoleContext(ctx), name); err != nil { - return false, err + cc, err := toConsoleContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + if err := r.Domain.ResyncProject(cc, name); err != nil { + return false, errors.NewE(err) } return true, nil } -// CoreListWorkspaces is the resolver for the core_listWorkspaces field. -func (r *queryResolver) CoreListWorkspaces(ctx context.Context, namespace string) ([]*entities.Workspace, error) { - envs, err := r.Domain.ListWorkspaces(toConsoleContext(ctx), namespace) +// CoreListEnvironments is the resolver for the core_listEnvironments field. +func (r *queryResolver) CoreListEnvironments(ctx context.Context, projectName string, search *model.SearchEnvironments, pq *repos.CursorPagination) (*model.EnvironmentPaginatedRecords, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + filter := map[string]repos.MatchFilter{} + if search != nil { + if search.Text != nil { + filter["metadata.name"] = *search.Text + } + if search.ProjectName != nil { + filter["spec.projectName"] = *search.ProjectName + } + if search.IsReady != nil { + filter["status.isReady"] = *search.IsReady + } + if search.MarkedForDeletion != nil { + filter["markedForDeletion"] = *search.MarkedForDeletion + } + } + + envs, err := r.Domain.ListEnvironments(cc, projectName, filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) + if err != nil { + return nil, errors.NewE(err) + } + + return fn.JsonConvertP[model.EnvironmentPaginatedRecords](envs) +} +// CoreGetEnvironment is the resolver for the core_getEnvironment field. +func (r *queryResolver) CoreGetEnvironment(ctx context.Context, projectName string, name string) (*entities.Environment, error) { + cc, err := toConsoleContext(ctx) if err != nil { - return nil, err + return nil, errors.NewE(err) } - if envs == nil { - return make([]*entities.Workspace, 0), nil + return r.Domain.GetEnvironment(cc, projectName, name) +} + +// CoreResyncEnvironment is the resolver for the core_resyncEnvironment field. +func (r *queryResolver) CoreResyncEnvironment(ctx context.Context, projectName string, name string) (bool, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + if err := r.Domain.ResyncEnvironment(cc, projectName, name); err != nil { + return false, errors.NewE(err) } - return envs, nil + return true, nil } -// CoreGetWorkspace is the resolver for the core_getWorkspace field. -func (r *queryResolver) CoreGetWorkspace(ctx context.Context, namespace string, name string) (*entities.Workspace, error) { - return r.Domain.GetWorkspace(toConsoleContext(ctx), namespace, name) +// CoreListImagePullSecrets is the resolver for the infra_listImagePullSecrets field. +func (r *queryResolver) CoreListImagePullSecrets(ctx context.Context, projectName string, envName string, search *model.SearchImagePullSecrets, pq *repos.CursorPagination) (*model.ImagePullSecretPaginatedRecords, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + filter := map[string]repos.MatchFilter{} + if search != nil { + if search.Text != nil { + filter["metadata.name"] = *search.Text + } + if search.IsReady != nil { + filter["status.isReady"] = *search.IsReady + } + if search.MarkedForDeletion != nil { + filter["markedForDeletion"] = *search.MarkedForDeletion + } + } + + pullSecrets, err := r.Domain.ListImagePullSecrets(newResourceContext(cc, projectName, envName), filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) + if err != nil { + return nil, errors.NewE(err) + } + + return fn.JsonConvertP[model.ImagePullSecretPaginatedRecords](pullSecrets) } -// CoreResyncWorkspace is the resolver for the core_resyncWorkspace field. -func (r *queryResolver) CoreResyncWorkspace(ctx context.Context, namespace string, name string) (bool, error) { - if err := r.Domain.ResyncWorkspace(toConsoleContext(ctx), namespace, name); err != nil { - return false, err +// InfraGetImagePullSecret is the resolver for the infra_getImagePullSecret field. +func (r *queryResolver) CoreGetImagePullSecret(ctx context.Context, projectName string, envName string, name string) (*entities.ImagePullSecret, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.GetImagePullSecret(newResourceContext(cc, projectName, envName), name) +} + +// CoreResyncImagePullSecret is the resolver for the core_resyncImagePullSecret field. +func (r *queryResolver) CoreResyncImagePullSecret(ctx context.Context, projectName string, envName string, name string) (bool, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + + if err := r.Domain.ResyncImagePullSecret(newResourceContext(cc, projectName, envName), name); err != nil { + return false, errors.NewE(err) } return true, nil } // CoreListApps is the resolver for the core_listApps field. -func (r *queryResolver) CoreListApps(ctx context.Context, namespace string) ([]*entities.App, error) { - a, err := r.Domain.ListApps(toConsoleContext(ctx), namespace) +func (r *queryResolver) CoreListApps(ctx context.Context, projectName string, envName string, search *model.SearchApps, pq *repos.CursorPagination) (*model.AppPaginatedRecords, error) { + cc, err := toConsoleContext(ctx) if err != nil { - return nil, err - } - if a == nil { - return make([]*entities.App, 0), nil + return nil, errors.NewE(err) + } + filter := map[string]repos.MatchFilter{} + if search != nil { + if search.Text != nil { + filter["metadata.name"] = *search.Text + } + if search.IsReady != nil { + filter["status.isReady"] = *search.IsReady + } + if search.MarkedForDeletion != nil { + filter["markedForDeletion"] = *search.MarkedForDeletion + } + } + + pApps, err := r.Domain.ListApps(newResourceContext(cc, projectName, envName), filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) + if err != nil { + return nil, errors.NewE(err) } - return a, nil + + return fn.JsonConvertP[model.AppPaginatedRecords](pApps) } // CoreGetApp is the resolver for the core_getApp field. -func (r *queryResolver) CoreGetApp(ctx context.Context, namespace string, name string) (*entities.App, error) { - return r.Domain.GetApp(toConsoleContext(ctx), namespace, name) +func (r *queryResolver) CoreGetApp(ctx context.Context, projectName string, envName string, name string) (*entities.App, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.GetApp(newResourceContext(cc, projectName, envName), name) } // CoreResyncApp is the resolver for the core_resyncApp field. -func (r *queryResolver) CoreResyncApp(ctx context.Context, namespace string, name string) (bool, error) { - if err := r.Domain.ResyncApp(toConsoleContext(ctx), namespace, name); err != nil { +func (r *queryResolver) CoreResyncApp(ctx context.Context, projectName string, envName string, name string) (bool, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + if err := r.Domain.ResyncApp(newResourceContext(cc, projectName, envName), name); err != nil { + return false, errors.NewE(err) + } + return true, nil +} + +// CoreRestartApp is the resolver for the core_restartApp field. +func (r *queryResolver) CoreRestartApp(ctx context.Context, projectName string, envName string, appName string) (bool, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + if err := r.Domain.RestartApp(newResourceContext(cc, projectName, envName), appName); err != nil { return false, err } return true, nil } -// CoreListConfigs is the resolver for the core_listConfigs field. -func (r *queryResolver) CoreListConfigs(ctx context.Context, namespace string) ([]*entities.Config, error) { - c, err := r.Domain.ListConfigs(toConsoleContext(ctx), namespace) +// CoreGetConfigValues is the resolver for the core_getConfigValues field. +func (r *queryResolver) CoreGetConfigValues(ctx context.Context, projectName string, envName string, queries []*domain.ConfigKeyRef) ([]*domain.ConfigKeyValueRef, error) { + cc, err := toConsoleContext(ctx) if err != nil { - return nil, err + return nil, errors.NewE(err) } - if c == nil { - return make([]*entities.Config, 0), nil + + m := make([]domain.ConfigKeyRef, len(queries)) + for i := range queries { + m[i] = *queries[i] } - return c, nil + + return r.Domain.GetConfigEntries(newResourceContext(cc, projectName, envName), m) +} + +// CoreListConfigs is the resolver for the core_listConfigs field. +func (r *queryResolver) CoreListConfigs(ctx context.Context, projectName string, envName string, search *model.SearchConfigs, pq *repos.CursorPagination) (*model.ConfigPaginatedRecords, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + filter := map[string]repos.MatchFilter{} + if search != nil { + if search.Text != nil { + filter["metadata.name"] = *search.Text + } + if search.IsReady != nil { + filter["status.isReady"] = *search.IsReady + } + if search.MarkedForDeletion != nil { + filter["markedForDeletion"] = *search.MarkedForDeletion + } + } + + pConfigs, err := r.Domain.ListConfigs(newResourceContext(cc, projectName, envName), filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) + if err != nil { + return nil, errors.NewE(err) + } + + return fn.JsonConvertP[model.ConfigPaginatedRecords](pConfigs) } // CoreGetConfig is the resolver for the core_getConfig field. -func (r *queryResolver) CoreGetConfig(ctx context.Context, namespace string, name string) (*entities.Config, error) { - return r.Domain.GetConfig(toConsoleContext(ctx), namespace, name) +func (r *queryResolver) CoreGetConfig(ctx context.Context, projectName string, envName string, name string) (*entities.Config, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.Domain.GetConfig(newResourceContext(cc, projectName, envName), name) } // CoreResyncConfig is the resolver for the core_resyncConfig field. -func (r *queryResolver) CoreResyncConfig(ctx context.Context, namespace string, name string) (bool, error) { - if err := r.Domain.ResyncConfig(toConsoleContext(ctx), namespace, name); err != nil { - return false, err +func (r *queryResolver) CoreResyncConfig(ctx context.Context, projectName string, envName string, name string) (bool, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + if err := r.Domain.ResyncConfig(newResourceContext(cc, projectName, envName), name); err != nil { + return false, errors.NewE(err) } return true, nil } -// CoreListSecrets is the resolver for the core_listSecrets field. -func (r *queryResolver) CoreListSecrets(ctx context.Context, namespace string) ([]*entities.Secret, error) { - s, err := r.Domain.ListSecrets(toConsoleContext(ctx), namespace) +// CoreGetSecretValues is the resolver for the core_getSecretValues field. +func (r *queryResolver) CoreGetSecretValues(ctx context.Context, projectName string, envName string, queries []*domain.SecretKeyRef) ([]*domain.SecretKeyValueRef, error) { + cc, err := toConsoleContext(ctx) if err != nil { - return nil, err + return nil, errors.NewE(err) } - if s == nil { - return make([]*entities.Secret, 0), nil + + m := make([]domain.SecretKeyRef, len(queries)) + for i := range queries { + m[i] = *queries[i] + } + + return r.Domain.GetSecretEntries(newResourceContext(cc, projectName, envName), m) +} + +// CoreListSecrets is the resolver for the core_listSecrets field. +func (r *queryResolver) CoreListSecrets(ctx context.Context, projectName string, envName string, search *model.SearchSecrets, pq *repos.CursorPagination) (*model.SecretPaginatedRecords, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + filter := map[string]repos.MatchFilter{} + if search != nil { + if search.Text != nil { + filter["metadata.name"] = *search.Text + } + if search.IsReady != nil { + filter["status.isReady"] = *search.IsReady + } + if search.MarkedForDeletion != nil { + filter["markedForDeletion"] = *search.MarkedForDeletion + } + } + + pSecrets, err := r.Domain.ListSecrets(newResourceContext(cc, projectName, envName), filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) + if err != nil { + return nil, errors.NewE(err) } - return s, nil + + return fn.JsonConvertP[model.SecretPaginatedRecords](pSecrets) } // CoreGetSecret is the resolver for the core_getSecret field. -func (r *queryResolver) CoreGetSecret(ctx context.Context, namespace string, name string) (*entities.Secret, error) { - return r.Domain.GetSecret(toConsoleContext(ctx), namespace, name) +func (r *queryResolver) CoreGetSecret(ctx context.Context, projectName string, envName string, name string) (*entities.Secret, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.GetSecret(newResourceContext(cc, projectName, envName), name) } // CoreResyncSecret is the resolver for the core_resyncSecret field. -func (r *queryResolver) CoreResyncSecret(ctx context.Context, namespace string, name string) (bool, error) { - if err := r.Domain.ResyncSecret(toConsoleContext(ctx), namespace, name); err != nil { - return false, err +func (r *queryResolver) CoreResyncSecret(ctx context.Context, projectName string, envName string, name string) (bool, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + if err := r.Domain.ResyncSecret(newResourceContext(cc, projectName, envName), name); err != nil { + return false, errors.NewE(err) } return true, nil } // CoreListRouters is the resolver for the core_listRouters field. -func (r *queryResolver) CoreListRouters(ctx context.Context, namespace string) ([]*entities.Router, error) { - routers, err := r.Domain.ListRouters(toConsoleContext(ctx), namespace) +func (r *queryResolver) CoreListRouters(ctx context.Context, projectName string, envName string, search *model.SearchRouters, pq *repos.CursorPagination) (*model.RouterPaginatedRecords, error) { + cc, err := toConsoleContext(ctx) if err != nil { - return nil, err - } - if routers == nil { - return make([]*entities.Router, 0), nil + return nil, errors.NewE(err) + } + filter := map[string]repos.MatchFilter{} + if search != nil { + if search.Text != nil { + filter["metadata.name"] = *search.Text + } + if search.IsReady != nil { + filter["status.isReady"] = *search.IsReady + } + if search.MarkedForDeletion != nil { + filter["markedForDeletion"] = *search.MarkedForDeletion + } + } + + pRouters, err := r.Domain.ListRouters(newResourceContext(cc, projectName, envName), filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) + if err != nil { + return nil, errors.NewE(err) } - return routers, nil + + return fn.JsonConvertP[model.RouterPaginatedRecords](pRouters) } // CoreGetRouter is the resolver for the core_getRouter field. -func (r *queryResolver) CoreGetRouter(ctx context.Context, namespace string, name string) (*entities.Router, error) { - return r.Domain.GetRouter(toConsoleContext(ctx), namespace, name) +func (r *queryResolver) CoreGetRouter(ctx context.Context, projectName string, envName string, name string) (*entities.Router, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.GetRouter(newResourceContext(cc, projectName, envName), name) } // CoreResyncRouter is the resolver for the core_resyncRouter field. -func (r *queryResolver) CoreResyncRouter(ctx context.Context, namespace string, name string) (bool, error) { - if err := r.Domain.ResyncRouter(toConsoleContext(ctx), namespace, name); err != nil { - return false, err +func (r *queryResolver) CoreResyncRouter(ctx context.Context, projectName string, envName string, name string) (bool, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + if err := r.Domain.ResyncRouter(newResourceContext(cc, projectName, envName), name); err != nil { + return false, errors.NewE(err) } return true, nil } -// CoreListManagedServices is the resolver for the core_listManagedServices field. -func (r *queryResolver) CoreListManagedServices(ctx context.Context, namespace string) ([]*entities.MSvc, error) { - m, err := r.Domain.ListManagedServices(toConsoleContext(ctx), namespace) +// CoreGetManagedResouceOutputKeys is the resolver for the core_getManagedResouceOutputKeys field. +func (r *queryResolver) CoreGetManagedResouceOutputKeys(ctx context.Context, projectName string, envName string, name string) ([]string, error) { + cc, err := toConsoleContext(ctx) if err != nil { - return nil, err + return nil, errors.NewE(err) } - if m == nil { - return make([]*entities.MSvc, 0), nil + return r.Domain.GetManagedResourceOutputKeys(newResourceContext(cc, projectName, envName), name) +} + +// CoreGetManagedResouceOutputKeyValues is the resolver for the core_getManagedResouceOutputKeyValues field. +func (r *queryResolver) CoreGetManagedResouceOutputKeyValues(ctx context.Context, projectName string, envName string, keyrefs []*domain.ManagedResourceKeyRef) ([]*domain.ManagedResourceKeyValueRef, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + m := make([]domain.ManagedResourceKeyRef, len(keyrefs)) + for i := range keyrefs { + m[i] = *keyrefs[i] } - return m, nil + + return r.Domain.GetManagedResourceOutputKVs(newResourceContext(cc, projectName, envName), m) } -// CoreGetManagedService is the resolver for the core_getManagedService field. -func (r *queryResolver) CoreGetManagedService(ctx context.Context, namespace string, name string) (*entities.MSvc, error) { - return r.Domain.GetManagedService(toConsoleContext(ctx), namespace, name) +// CoreListManagedResources is the resolver for the core_listManagedResources field. +func (r *queryResolver) CoreListManagedResources(ctx context.Context, projectName string, envName string, search *model.SearchManagedResources, pq *repos.CursorPagination) (*model.ManagedResourcePaginatedRecords, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + filter := map[string]repos.MatchFilter{} + if search != nil { + if search.Text != nil { + filter["metadata.name"] = *search.Text + } + if search.IsReady != nil { + filter["status.isReady"] = *search.IsReady + } + if search.MarkedForDeletion != nil { + filter["markedForDeletion"] = *search.MarkedForDeletion + } + + if search.ManagedServiceName != nil { + filter["spec.msvcRef.name"] = *search.ManagedServiceName + } + } + + pmsvcs, err := r.Domain.ListManagedResources(newResourceContext(cc, projectName, envName), filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) + if err != nil { + return nil, errors.NewE(err) + } + + return fn.JsonConvertP[model.ManagedResourcePaginatedRecords](pmsvcs) } -// CoreResyncManagedService is the resolver for the core_resyncManagedService field. -func (r *queryResolver) CoreResyncManagedService(ctx context.Context, namespace string, name string) (bool, error) { - if err := r.Domain.ResyncManagedService(toConsoleContext(ctx), namespace, name); err != nil { - return false, err +// CoreGetManagedResource is the resolver for the core_getManagedResource field. +func (r *queryResolver) CoreGetManagedResource(ctx context.Context, projectName string, envName string, name string) (*entities.ManagedResource, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.GetManagedResource(newResourceContext(cc, projectName, envName), name) +} + +// CoreResyncManagedResource is the resolver for the core_resyncManagedResource field. +func (r *queryResolver) CoreResyncManagedResource(ctx context.Context, projectName string, envName string, name string) (bool, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + if err := r.Domain.ResyncManagedResource(newResourceContext(cc, projectName, envName), name); err != nil { + return false, errors.NewE(err) } return true, nil } -// CoreListManagedResources is the resolver for the core_listManagedResources field. -func (r *queryResolver) CoreListManagedResources(ctx context.Context, namespace string) ([]*entities.MRes, error) { - m, err := r.Domain.ListManagedResources(toConsoleContext(ctx), namespace) +// CoreListProjectManagedServices is the resolver for the core_listProjectManagedServices field. +func (r *queryResolver) CoreListProjectManagedServices(ctx context.Context, projectName string, search *model.SearchProjectManagedService, pq *repos.CursorPagination) (*model.ProjectManagedServicePaginatedRecords, error) { + ictx, err := toConsoleContext(ctx) if err != nil { - return nil, err + return nil, errors.NewE(err) + } + + if pq == nil { + pq = &repos.DefaultCursorPagination + } + + filter := map[string]repos.MatchFilter{} + + if search != nil { + if search.IsReady != nil { + filter["status.isReady"] = *search.IsReady + } + + if search.Text != nil { + filter["metadata.name"] = *search.Text + } + } + + pmsvcs, err := r.Domain.ListProjectManagedServices(ictx, projectName, filter, *pq) + if err != nil { + return nil, errors.NewE(err) } - if m == nil { - return make([]*entities.MRes, 0), nil + + return fn.JsonConvertP[model.ProjectManagedServicePaginatedRecords](pmsvcs) +} + +// CoreGetProjectManagedService is the resolver for the core_getProjectManagedService field. +func (r *queryResolver) CoreGetProjectManagedService(ctx context.Context, projectName string, name string) (*entities.ProjectManagedService, error) { + ictx, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) } - return m, nil + + return r.Domain.GetProjectManagedService(ictx, projectName, name) } -// CoreGetManagedResource is the resolver for the core_getManagedResource field. -func (r *queryResolver) CoreGetManagedResource(ctx context.Context, namespace string, name string) (*entities.MRes, error) { - return r.Domain.GetManagedResource(toConsoleContext(ctx), namespace, name) +// CoreResyncProjectManagedService is the resolver for the core_resyncProjectManagedService field. +func (r *queryResolver) CoreResyncProjectManagedService(ctx context.Context, projectName string, name string) (bool, error) { + ictx, err := toConsoleContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + + if err := r.Domain.ResyncProjectManagedService(ictx, projectName, name); err != nil { + return false, errors.NewE(err) + } + + return true, nil } -// CoreResyncManagedResource is the resolver for the core_resyncManagedResource field. -func (r *queryResolver) CoreResyncManagedResource(ctx context.Context, namespace string, name string) (bool, error) { - if err := r.Domain.ResyncManagedResource(toConsoleContext(ctx), namespace, name); err != nil { +// CoreRestartProjectManagedService is the resolver for the core_restartProjectManagedService field. +func (r *queryResolver) CoreRestartProjectManagedService(ctx context.Context, projectName string, name string) (bool, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + + if err := r.Domain.RestartProjectManagedService(cc, projectName, name); err != nil { return false, err } return true, nil } +// CoreListVPNDevices is the resolver for the core_listVPNDevices field. +func (r *queryResolver) CoreListVPNDevices(ctx context.Context, search *model.CoreSearchVPNDevices, pq *repos.CursorPagination) (*model.ConsoleVPNDevicePaginatedRecords, error) { + filter := map[string]repos.MatchFilter{} + if search != nil { + if search.Text != nil { + filter["metadata.name"] = *search.Text + } + if search.IsReady != nil { + filter["status.isReady"] = *search.IsReady + } + if search.MarkedForDeletion != nil { + filter["markedForDeletion"] = *search.MarkedForDeletion + } + } + + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + p, err := r.Domain.ListVPNDevices(cc, filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) + if err != nil { + return nil, errors.NewE(err) + } + + return fn.JsonConvertP[model.ConsoleVPNDevicePaginatedRecords](p) +} + +// CoreListVPNDevicesForUser is the resolver for the core_listVPNDevicesForUser field. +func (r *queryResolver) CoreListVPNDevicesForUser(ctx context.Context) ([]*entities.ConsoleVPNDevice, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, err + } + return r.Domain.ListVPNDevicesForUser(cc) +} + +// CoreGetVPNDevice is the resolver for the core_getVPNDevice field. +func (r *queryResolver) CoreGetVPNDevice(ctx context.Context, name string) (*entities.ConsoleVPNDevice, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.GetVPNDevice(cc, name) +} + // Mutation returns generated.MutationResolver implementation. func (r *Resolver) Mutation() generated.MutationResolver { return &mutationResolver{r} } diff --git a/apps/console/internal/app/graph/secret.resolvers.go b/apps/console/internal/app/graph/secret.resolvers.go index 5321de191..c45b97278 100644 --- a/apps/console/internal/app/graph/secret.resolvers.go +++ b/apps/console/internal/app/graph/secret.resolvers.go @@ -6,73 +6,101 @@ package graph import ( "context" + "github.com/kloudlite/api/pkg/errors" + "time" - corev1 "k8s.io/api/core/v1" - "kloudlite.io/apps/console/internal/app/graph/generated" - "kloudlite.io/apps/console/internal/domain/entities" - fn "kloudlite.io/pkg/functions" + "github.com/kloudlite/api/apps/console/internal/app/graph/generated" + "github.com/kloudlite/api/apps/console/internal/app/graph/model" + "github.com/kloudlite/api/apps/console/internal/entities" + fn "github.com/kloudlite/api/pkg/functions" + "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// CreationTime is the resolver for the creationTime field. +func (r *secretResolver) CreationTime(ctx context.Context, obj *entities.Secret) (string, error) { + if obj == nil { + return "", errNilSecret + } + return obj.BaseEntity.CreationTime.Format(time.RFC3339), nil +} + // Data is the resolver for the data field. func (r *secretResolver) Data(ctx context.Context, obj *entities.Secret) (map[string]interface{}, error) { - if obj == nil || obj.Data == nil { - return nil, nil + if obj == nil { + return nil, errNilSecret } - m := make(map[string]any, len(obj.Data)) + + var m map[string]any if err := fn.JsonConversion(obj.Data, &m); err != nil { - return nil, err + return m, errors.NewE(err) } return m, nil } +// ID is the resolver for the id field. +func (r *secretResolver) ID(ctx context.Context, obj *entities.Secret) (string, error) { + if obj == nil { + return "", errNilSecret + } + return string(obj.Id), nil +} + // StringData is the resolver for the stringData field. func (r *secretResolver) StringData(ctx context.Context, obj *entities.Secret) (map[string]interface{}, error) { - if obj == nil || obj.StringData == nil { - return nil, nil - } - m := make(map[string]any, len(obj.StringData)) + var m map[string]any if err := fn.JsonConversion(obj.StringData, &m); err != nil { - return nil, err + return m, errors.NewE(err) } return m, nil } // Type is the resolver for the type field. -func (r *secretResolver) Type(ctx context.Context, obj *entities.Secret) (*string, error) { - s := string(obj.Type) - return &s, nil +func (r *secretResolver) Type(ctx context.Context, obj *entities.Secret) (*model.K8sIoAPICoreV1SecretType, error) { + return fn.New(model.K8sIoAPICoreV1SecretType(obj.Type)), nil +} + +// UpdateTime is the resolver for the updateTime field. +func (r *secretResolver) UpdateTime(ctx context.Context, obj *entities.Secret) (string, error) { + if obj == nil { + return "", errNilSecret + } + return obj.BaseEntity.UpdateTime.Format(time.RFC3339), nil } // Data is the resolver for the data field. func (r *secretInResolver) Data(ctx context.Context, obj *entities.Secret, data map[string]interface{}) error { if obj == nil { - return nil + return errNilSecret } + return fn.JsonConversion(data, &obj.Data) +} - if obj.Data == nil { - obj.Data = make(map[string][]byte, len(data)) +// Metadata is the resolver for the metadata field. +func (r *secretInResolver) Metadata(ctx context.Context, obj *entities.Secret, data *v1.ObjectMeta) error { + if data == nil { + return errors.Newf("object meta is nil") } - return fn.JsonConversion(data, &obj.Data) + + if obj == nil { + return errNilSecret + } + + obj.ObjectMeta = *data + return nil } // StringData is the resolver for the stringData field. func (r *secretInResolver) StringData(ctx context.Context, obj *entities.Secret, data map[string]interface{}) error { - if obj == nil { - return nil - } - if obj.StringData == nil { - obj.StringData = make(map[string]string, len(data)) - } return fn.JsonConversion(data, &obj.StringData) } // Type is the resolver for the type field. -func (r *secretInResolver) Type(ctx context.Context, obj *entities.Secret, data *string) error { - if data == nil { - return nil +func (r *secretInResolver) Type(ctx context.Context, obj *entities.Secret, data *model.K8sIoAPICoreV1SecretType) error { + if obj == nil { + return errNilSecret } - obj.Type = corev1.SecretType(*data) - return nil + + return fn.JsonConversion(data, &obj.Type) } // Secret returns generated.SecretResolver implementation. diff --git a/apps/console/internal/app/graph/struct-to-graphql/app.graphqls b/apps/console/internal/app/graph/struct-to-graphql/app.graphqls new file mode 100644 index 000000000..2cec39a0f --- /dev/null +++ b/apps/console/internal/app/graph/struct-to-graphql/app.graphqls @@ -0,0 +1,41 @@ +type App @shareable { + accountName: String! + apiVersion: String + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + enabled: Boolean + environmentName: String! + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + projectName: String! + recordVersion: Int! + spec: Github__com___kloudlite___operator___apis___crds___v1__AppSpec! + status: Github__com___kloudlite___operator___pkg___operator__Status + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type AppEdge @shareable { + cursor: String! + node: App! +} + +type AppPaginatedRecords @shareable { + edges: [AppEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input AppIn { + apiVersion: String + displayName: String! + enabled: Boolean + kind: String + metadata: MetadataIn + spec: Github__com___kloudlite___operator___apis___crds___v1__AppSpecIn! +} + diff --git a/apps/console/internal/app/graph/struct-to-graphql/common-types.graphqls b/apps/console/internal/app/graph/struct-to-graphql/common-types.graphqls new file mode 100644 index 000000000..764a9bd10 --- /dev/null +++ b/apps/console/internal/app/graph/struct-to-graphql/common-types.graphqls @@ -0,0 +1,569 @@ +type Github__com___kloudlite___api___common__CreatedOrUpdatedBy @shareable { + userEmail: String! + userId: String! + userName: String! +} + +type Github__com___kloudlite___api___pkg___types__EncodedString @shareable { + encoding: String! + value: String! +} + +type Github__com___kloudlite___api___pkg___types__SyncStatus @shareable { + action: Github__com___kloudlite___api___pkg___types__SyncAction! + error: String + lastSyncedAt: Date + recordVersion: Int! + state: Github__com___kloudlite___api___pkg___types__SyncState! + syncScheduledAt: Date +} + +type Github__com___kloudlite___operator___apis___crds___v1__AppContainer @shareable { + args: [String!] + command: [String!] + env: [Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv!] + envFrom: [Github__com___kloudlite___operator___apis___crds___v1__EnvFrom!] + image: String! + imagePullPolicy: String + livenessProbe: Github__com___kloudlite___operator___apis___crds___v1__Probe + name: String! + readinessProbe: Github__com___kloudlite___operator___apis___crds___v1__Probe + resourceCpu: Github__com___kloudlite___operator___apis___crds___v1__ContainerResource + resourceMemory: Github__com___kloudlite___operator___apis___crds___v1__ContainerResource + volumes: [Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume!] +} + +type Github__com___kloudlite___operator___apis___crds___v1__AppSpec @shareable { + containers: [Github__com___kloudlite___operator___apis___crds___v1__AppContainer!]! + displayName: String + freeze: Boolean + hpa: Github__com___kloudlite___operator___apis___crds___v1__HPA + intercept: Github__com___kloudlite___operator___apis___crds___v1__Intercept + nodeSelector: Map + region: String + replicas: Int + serviceAccount: String + services: [Github__com___kloudlite___operator___apis___crds___v1__AppSvc!] + tolerations: [K8s__io___api___core___v1__Toleration!] +} + +type Github__com___kloudlite___operator___apis___crds___v1__AppSvc @shareable { + name: String + port: Int! + targetPort: Int + type: String +} + +type Github__com___kloudlite___operator___apis___crds___v1__BasicAuth @shareable { + enabled: Boolean! + secretName: String + username: String +} + +type Github__com___kloudlite___operator___apis___crds___v1__ContainerEnv @shareable { + key: String! + optional: Boolean + refKey: String + refName: String + type: Github__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret + value: String +} + +type Github__com___kloudlite___operator___apis___crds___v1__ContainerResource @shareable { + max: String + min: String +} + +type Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume @shareable { + items: [Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem!] + mountPath: String! + refName: String! + type: Github__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret! +} + +type Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItem @shareable { + fileName: String + key: String! +} + +type Github__com___kloudlite___operator___apis___crds___v1__Cors @shareable { + allowCredentials: Boolean + enabled: Boolean + origins: [String!] +} + +type Github__com___kloudlite___operator___apis___crds___v1__EnvFrom @shareable { + refName: String! + type: Github__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret! +} + +type Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting @shareable { + mode: Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingMode + privateIngressClass: String + publicIngressClass: String +} + +type Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec @shareable { + projectName: String! + routing: Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting + targetNamespace: String +} + +type Github__com___kloudlite___operator___apis___crds___v1__HPA @shareable { + enabled: Boolean + maxReplicas: Int + minReplicas: Int + thresholdCpu: Int + thresholdMemory: Int +} + +type Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe @shareable { + httpHeaders: Map + path: String! + port: Int! +} + +type Github__com___kloudlite___operator___apis___crds___v1__Https @shareable { + clusterIssuer: String + enabled: Boolean! + forceRedirect: Boolean +} + +type Github__com___kloudlite___operator___apis___crds___v1__Intercept @shareable { + enabled: Boolean! + toDevice: String! +} + +type Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec @shareable { + resourceName: String + resourceTemplate: Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate! +} + +type Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec @shareable { + serviceTemplate: Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate! +} + +type Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate @shareable { + apiVersion: String! + kind: String! + msvcRef: Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef! + spec: Map! +} + +type Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef @shareable { + apiVersion: String! + kind: String! + name: String! + namespace: String! +} + +type Github__com___kloudlite___operator___apis___crds___v1__Probe @shareable { + failureThreshold: Int + httpGet: Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe + initialDelay: Int + interval: Int + shell: Github__com___kloudlite___operator___apis___crds___v1__ShellProbe + tcp: Github__com___kloudlite___operator___apis___crds___v1__TcpProbe + type: String! +} + +type Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec @shareable { + msvcSpec: Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec! + targetNamespace: String! +} + +type Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec @shareable { + targetNamespace: String! +} + +type Github__com___kloudlite___operator___apis___crds___v1__RateLimit @shareable { + connections: Int + enabled: Boolean + rpm: Int + rps: Int +} + +type Github__com___kloudlite___operator___apis___crds___v1__Route @shareable { + app: String + lambda: String + path: String! + port: Int! + rewrite: Boolean +} + +type Github__com___kloudlite___operator___apis___crds___v1__RouterSpec @shareable { + backendProtocol: String + basicAuth: Github__com___kloudlite___operator___apis___crds___v1__BasicAuth + cors: Github__com___kloudlite___operator___apis___crds___v1__Cors + domains: [String!]! + https: Github__com___kloudlite___operator___apis___crds___v1__Https + ingressClass: String + maxBodySizeInMB: Int + rateLimit: Github__com___kloudlite___operator___apis___crds___v1__RateLimit + routes: [Github__com___kloudlite___operator___apis___crds___v1__Route!] +} + +type Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate @shareable { + apiVersion: String! + kind: String! + spec: Map! +} + +type Github__com___kloudlite___operator___apis___crds___v1__ShellProbe @shareable { + command: [String!] +} + +type Github__com___kloudlite___operator___apis___crds___v1__TcpProbe @shareable { + port: Int! +} + +type Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord @shareable { + host: String + target: String +} + +type Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec @shareable { + activeNamespace: String + cnameRecords: [Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecord!] + disabled: Boolean + nodeSelector: Map + noExternalService: Boolean + ports: [Github__com___kloudlite___operator___apis___wireguard___v1__Port!] +} + +type Github__com___kloudlite___operator___apis___wireguard___v1__Port @shareable { + port: Int + targetPort: Int +} + +type Github__com___kloudlite___operator___pkg___operator__Check @shareable { + generation: Int + message: String + status: Boolean! +} + +type Github__com___kloudlite___operator___pkg___operator__ResourceRef @shareable { + apiVersion: String! + kind: String! + name: String! + namespace: String! +} + +type Github__com___kloudlite___operator___pkg___operator__Status @shareable { + checks: Map + isReady: Boolean! + lastReadyGeneration: Int + lastReconcileTime: Date + message: Github__com___kloudlite___operator___pkg___raw____json__RawJson + resources: [Github__com___kloudlite___operator___pkg___operator__ResourceRef!] +} + +type Github__com___kloudlite___operator___pkg___raw____json__RawJson @shareable { + RawMessage: Any +} + +type K8s__io___api___core___v1__Toleration @shareable { + effect: K8s__io___api___core___v1__TaintEffect + key: String + operator: K8s__io___api___core___v1__TolerationOperator + tolerationSeconds: Int + value: String +} + +type Metadata @shareable { + annotations: Map + creationTimestamp: Date! + deletionTimestamp: Date + generation: Int! + labels: Map + name: String! + namespace: String +} + +type PageInfo @shareable { + endCursor: String + hasNextPage: Boolean + hasPreviousPage: Boolean + startCursor: String +} + +input Github__com___kloudlite___operator___apis___crds___v1__AppContainerIn { + args: [String!] + command: [String!] + env: [Github__com___kloudlite___operator___apis___crds___v1__ContainerEnvIn!] + envFrom: [Github__com___kloudlite___operator___apis___crds___v1__EnvFromIn!] + image: String! + imagePullPolicy: String + livenessProbe: Github__com___kloudlite___operator___apis___crds___v1__ProbeIn + name: String! + readinessProbe: Github__com___kloudlite___operator___apis___crds___v1__ProbeIn + resourceCpu: Github__com___kloudlite___operator___apis___crds___v1__ContainerResourceIn + resourceMemory: Github__com___kloudlite___operator___apis___crds___v1__ContainerResourceIn + volumes: [Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeIn!] +} + +input Github__com___kloudlite___operator___apis___crds___v1__AppSpecIn { + containers: [Github__com___kloudlite___operator___apis___crds___v1__AppContainerIn!]! + displayName: String + freeze: Boolean + hpa: Github__com___kloudlite___operator___apis___crds___v1__HPAIn + intercept: Github__com___kloudlite___operator___apis___crds___v1__InterceptIn + nodeSelector: Map + region: String + replicas: Int + serviceAccount: String + services: [Github__com___kloudlite___operator___apis___crds___v1__AppSvcIn!] + tolerations: [K8s__io___api___core___v1__TolerationIn!] +} + +input Github__com___kloudlite___operator___apis___crds___v1__AppSvcIn { + name: String + port: Int! + targetPort: Int + type: String +} + +input Github__com___kloudlite___operator___apis___crds___v1__BasicAuthIn { + enabled: Boolean! + secretName: String + username: String +} + +input Github__com___kloudlite___operator___apis___crds___v1__ContainerEnvIn { + key: String! + optional: Boolean + refKey: String + refName: String + type: Github__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret + value: String +} + +input Github__com___kloudlite___operator___apis___crds___v1__ContainerResourceIn { + max: String + min: String +} + +input Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeIn { + items: [Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItemIn!] + mountPath: String! + refName: String! + type: Github__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret! +} + +input Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeItemIn { + fileName: String + key: String! +} + +input Github__com___kloudlite___operator___apis___crds___v1__CorsIn { + allowCredentials: Boolean + enabled: Boolean + origins: [String!] +} + +input Github__com___kloudlite___operator___apis___crds___v1__EnvFromIn { + refName: String! + type: Github__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret! +} + +input Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingIn { + mode: Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingMode +} + +input Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpecIn { + projectName: String! + routing: Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingIn + targetNamespace: String +} + +input Github__com___kloudlite___operator___apis___crds___v1__HPAIn { + enabled: Boolean + maxReplicas: Int + minReplicas: Int + thresholdCpu: Int + thresholdMemory: Int +} + +input Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbeIn { + httpHeaders: Map + path: String! + port: Int! +} + +input Github__com___kloudlite___operator___apis___crds___v1__HttpsIn { + clusterIssuer: String + enabled: Boolean! + forceRedirect: Boolean +} + +input Github__com___kloudlite___operator___apis___crds___v1__InterceptIn { + enabled: Boolean! + toDevice: String! +} + +input Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpecIn { + resourceName: String + resourceTemplate: Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplateIn! +} + +input Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn { + serviceTemplate: Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn! +} + +input Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplateIn { + apiVersion: String! + kind: String! + msvcRef: Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRefIn! + spec: Map! +} + +input Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRefIn { + apiVersion: String! + kind: String! + name: String! + namespace: String! +} + +input Github__com___kloudlite___operator___apis___crds___v1__ProbeIn { + failureThreshold: Int + httpGet: Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbeIn + initialDelay: Int + interval: Int + shell: Github__com___kloudlite___operator___apis___crds___v1__ShellProbeIn + tcp: Github__com___kloudlite___operator___apis___crds___v1__TcpProbeIn + type: String! +} + +input Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpecIn { + msvcSpec: Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn! + targetNamespace: String! +} + +input Github__com___kloudlite___operator___apis___crds___v1__ProjectSpecIn { + targetNamespace: String! +} + +input Github__com___kloudlite___operator___apis___crds___v1__RateLimitIn { + connections: Int + enabled: Boolean + rpm: Int + rps: Int +} + +input Github__com___kloudlite___operator___apis___crds___v1__RouteIn { + app: String + lambda: String + path: String! + port: Int! + rewrite: Boolean +} + +input Github__com___kloudlite___operator___apis___crds___v1__RouterSpecIn { + backendProtocol: String + basicAuth: Github__com___kloudlite___operator___apis___crds___v1__BasicAuthIn + cors: Github__com___kloudlite___operator___apis___crds___v1__CorsIn + domains: [String!]! + https: Github__com___kloudlite___operator___apis___crds___v1__HttpsIn + ingressClass: String + maxBodySizeInMB: Int + rateLimit: Github__com___kloudlite___operator___apis___crds___v1__RateLimitIn + routes: [Github__com___kloudlite___operator___apis___crds___v1__RouteIn!] +} + +input Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn { + apiVersion: String! + kind: String! + spec: Map! +} + +input Github__com___kloudlite___operator___apis___crds___v1__ShellProbeIn { + command: [String!] +} + +input Github__com___kloudlite___operator___apis___crds___v1__TcpProbeIn { + port: Int! +} + +input Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecordIn { + host: String + target: String +} + +input Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpecIn { + activeNamespace: String + cnameRecords: [Github__com___kloudlite___operator___apis___wireguard___v1__CNameRecordIn!] + ports: [Github__com___kloudlite___operator___apis___wireguard___v1__PortIn!] +} + +input Github__com___kloudlite___operator___apis___wireguard___v1__PortIn { + port: Int + targetPort: Int +} + +input K8s__io___api___core___v1__TolerationIn { + effect: K8s__io___api___core___v1__TaintEffect + key: String + operator: K8s__io___api___core___v1__TolerationOperator + tolerationSeconds: Int + value: String +} + +input MetadataIn { + annotations: Map + labels: Map + name: String! + namespace: String +} + +enum Github__com___kloudlite___api___apps___console___internal___entities__PullSecretFormat { + dockerConfigJson + params +} + +enum Github__com___kloudlite___api___pkg___types__SyncAction { + APPLY + DELETE +} + +enum Github__com___kloudlite___api___pkg___types__SyncState { + APPLIED_AT_AGENT + DELETED_AT_AGENT + DELETING_AT_AGENT + ERRORED_AT_AGENT + IDLE + IN_QUEUE + UPDATED_AT_AGENT +} + +enum Github__com___kloudlite___operator___apis___crds___v1__ConfigOrSecret { + config + secret +} + +enum Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingMode { + private + public +} + +enum K8s__io___api___core___v1__SecretType { + bootstrap__kubernetes__io___token + kubernetes__io___basic____auth + kubernetes__io___dockercfg + kubernetes__io___dockerconfigjson + kubernetes__io___service____account____token + kubernetes__io___ssh____auth + kubernetes__io___tls + Opaque +} + +enum K8s__io___api___core___v1__TaintEffect { + NoExecute + NoSchedule + PreferNoSchedule +} + +enum K8s__io___api___core___v1__TolerationOperator { + Equal + Exists +} + diff --git a/apps/console/internal/app/graph/struct-to-graphql/config.graphqls b/apps/console/internal/app/graph/struct-to-graphql/config.graphqls new file mode 100644 index 000000000..8c6aa355c --- /dev/null +++ b/apps/console/internal/app/graph/struct-to-graphql/config.graphqls @@ -0,0 +1,42 @@ +type Config @shareable { + accountName: String! + apiVersion: String + binaryData: Map + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + data: Map + displayName: String! + environmentName: String! + id: String! + immutable: Boolean + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + projectName: String! + recordVersion: Int! + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type ConfigEdge @shareable { + cursor: String! + node: Config! +} + +type ConfigPaginatedRecords @shareable { + edges: [ConfigEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input ConfigIn { + apiVersion: String + binaryData: Map + data: Map + displayName: String! + immutable: Boolean + kind: String + metadata: MetadataIn +} + diff --git a/apps/console/internal/app/graph/struct-to-graphql/configkeyref.graphqls b/apps/console/internal/app/graph/struct-to-graphql/configkeyref.graphqls new file mode 100644 index 000000000..1fede293b --- /dev/null +++ b/apps/console/internal/app/graph/struct-to-graphql/configkeyref.graphqls @@ -0,0 +1,10 @@ +type ConfigKeyRef @shareable { + configName: String! + key: String! +} + +input ConfigKeyRefIn { + configName: String! + key: String! +} + diff --git a/apps/console/internal/app/graph/struct-to-graphql/configkeyvalueref.graphqls b/apps/console/internal/app/graph/struct-to-graphql/configkeyvalueref.graphqls new file mode 100644 index 000000000..3fec4dd0b --- /dev/null +++ b/apps/console/internal/app/graph/struct-to-graphql/configkeyvalueref.graphqls @@ -0,0 +1,12 @@ +type ConfigKeyValueRef @shareable { + configName: String! + key: String! + value: String! +} + +input ConfigKeyValueRefIn { + configName: String! + key: String! + value: String! +} + diff --git a/apps/console/internal/app/graph/struct-to-graphql/consolevpndevice.graphqls b/apps/console/internal/app/graph/struct-to-graphql/consolevpndevice.graphqls new file mode 100644 index 000000000..b60f4aabb --- /dev/null +++ b/apps/console/internal/app/graph/struct-to-graphql/consolevpndevice.graphqls @@ -0,0 +1,45 @@ +type ConsoleVPNDevice @shareable { + accountName: String! + apiVersion: String + clusterName: String + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + environmentName: String + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + linkedClusters: [String!] + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + projectName: String + recordVersion: Int! + spec: Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec + status: Github__com___kloudlite___operator___pkg___operator__Status + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! + wireguardConfig: Github__com___kloudlite___api___pkg___types__EncodedString +} + +type ConsoleVPNDeviceEdge @shareable { + cursor: String! + node: ConsoleVPNDevice! +} + +type ConsoleVPNDevicePaginatedRecords @shareable { + edges: [ConsoleVPNDeviceEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input ConsoleVPNDeviceIn { + apiVersion: String + clusterName: String + displayName: String! + environmentName: String + kind: String + metadata: MetadataIn + projectName: String + spec: Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpecIn +} + diff --git a/apps/console/internal/app/graph/struct-to-graphql/cursorpagination.graphqls b/apps/console/internal/app/graph/struct-to-graphql/cursorpagination.graphqls new file mode 100644 index 000000000..58815e858 --- /dev/null +++ b/apps/console/internal/app/graph/struct-to-graphql/cursorpagination.graphqls @@ -0,0 +1,23 @@ +type CursorPagination @shareable { + after: String + before: String + first: Int + last: Int + orderBy: String + sortDirection: CursorPaginationSortDirection +} + +input CursorPaginationIn { + after: String + before: String + first: Int + last: Int + orderBy: String = "_id" + sortDirection: CursorPaginationSortDirection = "ASC" +} + +enum CursorPaginationSortDirection { + ASC + DESC +} + diff --git a/apps/container-registry/internal/app/graph/crd-to-gql/directives.graphqls b/apps/console/internal/app/graph/struct-to-graphql/directives.graphqls similarity index 77% rename from apps/container-registry/internal/app/graph/crd-to-gql/directives.graphqls rename to apps/console/internal/app/graph/struct-to-graphql/directives.graphqls index 7f717fc28..59d6b45c6 100644 --- a/apps/container-registry/internal/app/graph/crd-to-gql/directives.graphqls +++ b/apps/console/internal/app/graph/struct-to-graphql/directives.graphqls @@ -1,5 +1,4 @@ - -extend schema @link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@key", "@shareable"]) +extend schema @link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@key", "@shareable", "@external"]) directive @goField( forceResolver: Boolean diff --git a/apps/console/internal/app/graph/struct-to-graphql/environment.graphqls b/apps/console/internal/app/graph/struct-to-graphql/environment.graphqls new file mode 100644 index 000000000..495ea63b8 --- /dev/null +++ b/apps/console/internal/app/graph/struct-to-graphql/environment.graphqls @@ -0,0 +1,38 @@ +type Environment @shareable { + accountName: String! + apiVersion: String + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + projectName: String! + recordVersion: Int! + spec: Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec + status: Github__com___kloudlite___operator___pkg___operator__Status + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type EnvironmentEdge @shareable { + cursor: String! + node: Environment! +} + +type EnvironmentPaginatedRecords @shareable { + edges: [EnvironmentEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input EnvironmentIn { + apiVersion: String + displayName: String! + kind: String + metadata: MetadataIn + spec: Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpecIn +} + diff --git a/apps/console/internal/app/graph/struct-to-graphql/imagepullsecret.graphqls b/apps/console/internal/app/graph/struct-to-graphql/imagepullsecret.graphqls new file mode 100644 index 000000000..54e700aaf --- /dev/null +++ b/apps/console/internal/app/graph/struct-to-graphql/imagepullsecret.graphqls @@ -0,0 +1,42 @@ +type ImagePullSecret @shareable { + accountName: String! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + dockerConfigJson: String + environmentName: String! + format: Github__com___kloudlite___api___apps___console___internal___entities__PullSecretFormat! + id: String! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata! @goField(name: "objectMeta") + projectName: String! + recordVersion: Int! + registryPassword: String + registryURL: String + registryUsername: String + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type ImagePullSecretEdge @shareable { + cursor: String! + node: ImagePullSecret! +} + +type ImagePullSecretPaginatedRecords @shareable { + edges: [ImagePullSecretEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input ImagePullSecretIn { + displayName: String! + dockerConfigJson: String + format: Github__com___kloudlite___api___apps___console___internal___entities__PullSecretFormat! + metadata: MetadataIn! + registryPassword: String + registryURL: String + registryUsername: String +} + diff --git a/apps/console/internal/app/graph/struct-to-graphql/managedresource.graphqls b/apps/console/internal/app/graph/struct-to-graphql/managedresource.graphqls new file mode 100644 index 000000000..5e5a8bcc3 --- /dev/null +++ b/apps/console/internal/app/graph/struct-to-graphql/managedresource.graphqls @@ -0,0 +1,41 @@ +type ManagedResource @shareable { + accountName: String! + apiVersion: String + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + enabled: Boolean + environmentName: String! + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + projectName: String! + recordVersion: Int! + spec: Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec! + status: Github__com___kloudlite___operator___pkg___operator__Status + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type ManagedResourceEdge @shareable { + cursor: String! + node: ManagedResource! +} + +type ManagedResourcePaginatedRecords @shareable { + edges: [ManagedResourceEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input ManagedResourceIn { + apiVersion: String + displayName: String! + enabled: Boolean + kind: String + metadata: MetadataIn + spec: Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpecIn! +} + diff --git a/apps/console/internal/app/graph/struct-to-graphql/managedresourcekeyref.graphqls b/apps/console/internal/app/graph/struct-to-graphql/managedresourcekeyref.graphqls new file mode 100644 index 000000000..5957a1c81 --- /dev/null +++ b/apps/console/internal/app/graph/struct-to-graphql/managedresourcekeyref.graphqls @@ -0,0 +1,10 @@ +type ManagedResourceKeyRef @shareable { + key: String! + mresName: String! +} + +input ManagedResourceKeyRefIn { + key: String! + mresName: String! +} + diff --git a/apps/console/internal/app/graph/struct-to-graphql/managedresourcekeyvalueref.graphqls b/apps/console/internal/app/graph/struct-to-graphql/managedresourcekeyvalueref.graphqls new file mode 100644 index 000000000..cd5a1112e --- /dev/null +++ b/apps/console/internal/app/graph/struct-to-graphql/managedresourcekeyvalueref.graphqls @@ -0,0 +1,12 @@ +type ManagedResourceKeyValueRef @shareable { + key: String! + mresName: String! + value: String! +} + +input ManagedResourceKeyValueRefIn { + key: String! + mresName: String! + value: String! +} + diff --git a/apps/console/internal/app/graph/struct-to-graphql/matchfilter.graphqls b/apps/console/internal/app/graph/struct-to-graphql/matchfilter.graphqls new file mode 100644 index 000000000..ef1a0cb45 --- /dev/null +++ b/apps/console/internal/app/graph/struct-to-graphql/matchfilter.graphqls @@ -0,0 +1,20 @@ +type MatchFilter @shareable { + array: [Any!] + exact: Any + matchType: MatchFilterMatchType! + regex: String +} + +input MatchFilterIn { + array: [Any!] + exact: Any + matchType: MatchFilterMatchType! + regex: String +} + +enum MatchFilterMatchType { + array + exact + regex +} + diff --git a/apps/console/internal/app/graph/struct-to-graphql/port.graphqls b/apps/console/internal/app/graph/struct-to-graphql/port.graphqls new file mode 100644 index 000000000..c1739cb90 --- /dev/null +++ b/apps/console/internal/app/graph/struct-to-graphql/port.graphqls @@ -0,0 +1,10 @@ +type Port @shareable { + port: Int + targetPort: Int +} + +input PortIn { + port: Int + targetPort: Int +} + diff --git a/apps/console/internal/app/graph/struct-to-graphql/project.graphqls b/apps/console/internal/app/graph/struct-to-graphql/project.graphqls new file mode 100644 index 000000000..b31a92832 --- /dev/null +++ b/apps/console/internal/app/graph/struct-to-graphql/project.graphqls @@ -0,0 +1,39 @@ +type Project @shareable { + accountName: String! + apiVersion: String + clusterName: String + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + recordVersion: Int! + spec: Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec! + status: Github__com___kloudlite___operator___pkg___operator__Status + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type ProjectEdge @shareable { + cursor: String! + node: Project! +} + +type ProjectPaginatedRecords @shareable { + edges: [ProjectEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input ProjectIn { + apiVersion: String + clusterName: String + displayName: String! + kind: String + metadata: MetadataIn + spec: Github__com___kloudlite___operator___apis___crds___v1__ProjectSpecIn! +} + diff --git a/apps/console/internal/app/graph/struct-to-graphql/projectmanagedservice.graphqls b/apps/console/internal/app/graph/struct-to-graphql/projectmanagedservice.graphqls new file mode 100644 index 000000000..e0418a5d2 --- /dev/null +++ b/apps/console/internal/app/graph/struct-to-graphql/projectmanagedservice.graphqls @@ -0,0 +1,38 @@ +type ProjectManagedService @shareable { + accountName: String! + apiVersion: String + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + projectName: String! + recordVersion: Int! + spec: Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec + status: Github__com___kloudlite___operator___pkg___operator__Status + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type ProjectManagedServiceEdge @shareable { + cursor: String! + node: ProjectManagedService! +} + +type ProjectManagedServicePaginatedRecords @shareable { + edges: [ProjectManagedServiceEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input ProjectManagedServiceIn { + apiVersion: String + displayName: String! + kind: String + metadata: MetadataIn + spec: Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpecIn +} + diff --git a/apps/console/internal/app/graph/struct-to-graphql/router.graphqls b/apps/console/internal/app/graph/struct-to-graphql/router.graphqls new file mode 100644 index 000000000..59e6c8cf2 --- /dev/null +++ b/apps/console/internal/app/graph/struct-to-graphql/router.graphqls @@ -0,0 +1,41 @@ +type Router @shareable { + accountName: String! + apiVersion: String + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + enabled: Boolean + environmentName: String! + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + projectName: String! + recordVersion: Int! + spec: Github__com___kloudlite___operator___apis___crds___v1__RouterSpec! + status: Github__com___kloudlite___operator___pkg___operator__Status + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type RouterEdge @shareable { + cursor: String! + node: Router! +} + +type RouterPaginatedRecords @shareable { + edges: [RouterEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input RouterIn { + apiVersion: String + displayName: String! + enabled: Boolean + kind: String + metadata: MetadataIn + spec: Github__com___kloudlite___operator___apis___crds___v1__RouterSpecIn! +} + diff --git a/apps/console/internal/app/graph/struct-to-graphql/scalars.graphqls b/apps/console/internal/app/graph/struct-to-graphql/scalars.graphqls new file mode 100644 index 000000000..1f83443a9 --- /dev/null +++ b/apps/console/internal/app/graph/struct-to-graphql/scalars.graphqls @@ -0,0 +1,4 @@ +scalar Any +scalar Json +scalar Map +scalar Date diff --git a/apps/console/internal/app/graph/struct-to-graphql/secret.graphqls b/apps/console/internal/app/graph/struct-to-graphql/secret.graphqls new file mode 100644 index 000000000..644c32df7 --- /dev/null +++ b/apps/console/internal/app/graph/struct-to-graphql/secret.graphqls @@ -0,0 +1,44 @@ +type Secret @shareable { + accountName: String! + apiVersion: String + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + data: Map + displayName: String! + environmentName: String! + id: String! + immutable: Boolean + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + projectName: String! + recordVersion: Int! + stringData: Map + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + type: K8s__io___api___core___v1__SecretType + updateTime: Date! +} + +type SecretEdge @shareable { + cursor: String! + node: Secret! +} + +type SecretPaginatedRecords @shareable { + edges: [SecretEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input SecretIn { + apiVersion: String + data: Map + displayName: String! + immutable: Boolean + kind: String + metadata: MetadataIn + stringData: Map + type: K8s__io___api___core___v1__SecretType +} + diff --git a/apps/console/internal/app/graph/struct-to-graphql/secretkeyref.graphqls b/apps/console/internal/app/graph/struct-to-graphql/secretkeyref.graphqls new file mode 100644 index 000000000..7769fa1d4 --- /dev/null +++ b/apps/console/internal/app/graph/struct-to-graphql/secretkeyref.graphqls @@ -0,0 +1,10 @@ +type SecretKeyRef @shareable { + key: String! + secretName: String! +} + +input SecretKeyRefIn { + key: String! + secretName: String! +} + diff --git a/apps/console/internal/app/graph/struct-to-graphql/secretkeyvalueref.graphqls b/apps/console/internal/app/graph/struct-to-graphql/secretkeyvalueref.graphqls new file mode 100644 index 000000000..e1e0784a2 --- /dev/null +++ b/apps/console/internal/app/graph/struct-to-graphql/secretkeyvalueref.graphqls @@ -0,0 +1,12 @@ +type SecretKeyValueRef @shareable { + key: String! + secretName: String! + value: String! +} + +input SecretKeyValueRefIn { + key: String! + secretName: String! + value: String! +} + diff --git a/apps/console/internal/app/graph/workspace.resolvers.go b/apps/console/internal/app/graph/workspace.resolvers.go deleted file mode 100644 index 099b66193..000000000 --- a/apps/console/internal/app/graph/workspace.resolvers.go +++ /dev/null @@ -1,44 +0,0 @@ -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.28 - -import ( - "context" - - "kloudlite.io/apps/console/internal/app/graph/generated" - "kloudlite.io/apps/console/internal/app/graph/model" - "kloudlite.io/apps/console/internal/domain/entities" - fn "kloudlite.io/pkg/functions" -) - -// Spec is the resolver for the spec field. -func (r *workspaceResolver) Spec(ctx context.Context, obj *entities.Workspace) (*model.WorkspaceSpec, error) { - if obj == nil { - return nil, nil - } - - var m model.WorkspaceSpec - if err := fn.JsonConversion(obj.Spec, &m); err != nil { - return nil, err - } - return &m, nil -} - -// Spec is the resolver for the spec field. -func (r *workspaceInResolver) Spec(ctx context.Context, obj *entities.Workspace, data *model.WorkspaceSpecIn) error { - if obj == nil { - return nil - } - return fn.JsonConversion(data, &obj.Spec) -} - -// Workspace returns generated.WorkspaceResolver implementation. -func (r *Resolver) Workspace() generated.WorkspaceResolver { return &workspaceResolver{r} } - -// WorkspaceIn returns generated.WorkspaceInResolver implementation. -func (r *Resolver) WorkspaceIn() generated.WorkspaceInResolver { return &workspaceInResolver{r} } - -type workspaceResolver struct{ *Resolver } -type workspaceInResolver struct{ *Resolver } diff --git a/apps/console/internal/app/observability-handler.go b/apps/console/internal/app/observability-handler.go new file mode 100644 index 000000000..46d82a48c --- /dev/null +++ b/apps/console/internal/app/observability-handler.go @@ -0,0 +1,169 @@ +package app + +import ( + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + "strings" + "time" + + "github.com/kloudlite/api/pkg/errors" + fn "github.com/kloudlite/api/pkg/functions" +) + +type ObservabilityArgs struct { + AccountName string `json:"account_name"` + ClusterName string `json:"cluster_name"` + + ResourceName string `json:"resource_name"` + ResourceNamespace string `json:"resource_namespace"` + ResourceType string `json:"resource_type"` + WorkspaceName string `json:"workspace_name"` + ProjectName string `json:"project_name"` + + JobName string `json:"job_name"` + JobNamespace string `json:"job_namespace"` + + StartTime *time.Time `json:"start_time,omitempty"` + EndTime *time.Time `json:"end_time,omitempty"` +} + +func (args *ObservabilityArgs) Validate() (bool, error) { + errorMsgs := make([]string, 0, 5) + if args.AccountName == "" { + errorMsgs = append(errorMsgs, "account_name is required") + } + + if args.ClusterName == "" { + errorMsgs = append(errorMsgs, "cluster_name is required") + } + + hasResource := true + if (args.ResourceName != "" && args.ResourceNamespace == "") || (args.ResourceName == "" && args.ResourceNamespace != "") { + hasResource = false + errorMsgs = append(errorMsgs, "resource_name and resource_namespace must be provided in pair") + } + + if !hasResource && (args.WorkspaceName == "" && args.ProjectName == "") { + errorMsgs = append(errorMsgs, "workspace_name/project_name is required") + } + + if len(errorMsgs) > 0 { + b, err := json.Marshal(map[string]any{"error": errorMsgs}) + if err != nil { + return false, errors.NewE(err) + } + return false, errors.Newf(string(b)) + } + return true, nil +} + +type PromMetricsType string + +const ( + Cpu PromMetricsType = "cpu" + Memory PromMetricsType = "memory" + DiskIO PromMetricsType = "disk-io" + NetworkReceived PromMetricsType = "network-received" + NetworkTransmitted PromMetricsType = "network-transmitted" +) + +type ObservabilityLabel string + +const ( + AccountName ObservabilityLabel = "kl_account_name" + ClusterName ObservabilityLabel = "kl_cluster_name" + + ResourceName ObservabilityLabel = "kl_resource_name" + ResourceType ObservabilityLabel = "kl_resource_type" + ResourceNamespace ObservabilityLabel = "kl_resource_namespace" + ResourceComponent ObservabilityLabel = "kl_resource_component" + + ProjectName ObservabilityLabel = "kl_project_name" + ProjectTargetNamespace ObservabilityLabel = "kl_project_target_ns" + + WorkspaceName ObservabilityLabel = "kl_workspace_name" + WorkspaceTargetNs ObservabilityLabel = "kl_workspace_target_ns" +) + +func buildPromQuery(resType PromMetricsType, filters map[string]string) (string, error) { + tags := make([]string, 0, len(filters)) + + for k, v := range filters { + if v != "" { + tags = append(tags, fmt.Sprintf(`%s=%q`, k, v)) + } + } + + switch resType { + case Memory: + // return fmt.Sprintf(`sum(avg_over_time(container_memory_working_set_bytes{namespace="%s",pod=~"%s.*",container!="POD",image!=""}[30s]))/1024/1024`, namespace, name), nil + return fmt.Sprintf(`sum(avg_over_time(pod_memory_working_set_bytes{%s}[1m]))/1024/1024`, strings.Join(tags, ",")), nil + case Cpu: + // return fmt.Sprintf(`sum(rate(container_cpu_usage_seconds_total{namespace="%s", pod=~"%s.*", image!="", container!="POD"}[1m])) * 1000`, namespace, name), nil + return fmt.Sprintf(`sum(rate(pod_cpu_usage_seconds_total{%s}[2m])) * 1000`, strings.Join(tags, ",")), nil + case NetworkTransmitted: + return "", errors.New("not implemented") + default: + return "", errors.New("unknown prom metrics type provided") + } + +} + +func queryProm(promAddr string, resType PromMetricsType, filters map[string]string, startTime *time.Time, endTime *time.Time, writer io.Writer) error { + promQuery, err := buildPromQuery(resType, filters) + if err != nil { + return errors.NewE(err) + } + + pu, err := url.Parse(promAddr) + if err != nil { + return errors.NewEf(err, "failed to parser promAddr into *url.URL") + } + + u := pu.JoinPath("/api/v1/query_range") + + qp := u.Query() + qp.Add("query", promQuery) + + t := time.Now() + if startTime == nil { + startTime = fn.New(t.Add(-2 * 24 * time.Hour)) + } + if endTime == nil { + endTime = &t + } + + qp.Add("start", fmt.Sprintf("%d", startTime.Unix())) + qp.Add("end", fmt.Sprintf("%d", endTime.Unix())) + // qp.Add("step", "700") // 15 minute + qp.Add("step", "345") // 15 minute + + u.RawQuery = qp.Encode() + + req, err := http.NewRequest(http.MethodGet, u.String(), nil) + if err != nil { + return errors.NewE(err) + } + + // fmt.Printf("[DEBUG]: prometheus actual request: %s\n", req.URL.String()) + + resp, err := http.DefaultClient.Do(req) + if err != nil { + return errors.NewE(err) + } + + if resp.StatusCode != http.StatusOK { + return errors.Newf("incorrect status code, expected %d, got %d", http.StatusOK, resp.StatusCode) + } + + b, err := io.ReadAll(resp.Body) + if err != nil { + return errors.NewE(err) + } + + _, err = writer.Write(b) + return errors.NewE(err) +} diff --git a/apps/console/internal/app/process-error-on-apply.go b/apps/console/internal/app/process-error-on-apply.go index 4b2bb172c..3f766e9ec 100644 --- a/apps/console/internal/app/process-error-on-apply.go +++ b/apps/console/internal/app/process-error-on-apply.go @@ -4,35 +4,49 @@ import ( "context" "encoding/json" "fmt" - "time" - t "github.com/kloudlite/operator/agent/types" + t "github.com/kloudlite/api/apps/tenant-agent/types" + "github.com/kloudlite/api/pkg/errors" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "kloudlite.io/apps/console/internal/domain" - "kloudlite.io/pkg/logging" - "kloudlite.io/pkg/redpanda" + "github.com/kloudlite/api/apps/console/internal/domain" + "github.com/kloudlite/api/apps/console/internal/entities" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/api/pkg/messaging" + msgTypes "github.com/kloudlite/api/pkg/messaging/types" ) -type ErrorOnApplyConsumer redpanda.Consumer +type ErrorOnApplyConsumer messaging.Consumer -func ProcessErrorOnApply(consumer ErrorOnApplyConsumer, d domain.Domain, logr logging.Logger) { +func ProcessErrorOnApply(consumer ErrorOnApplyConsumer, d domain.Domain, logger logging.Logger) { counter := 0 - logger := logr.WithName("apply-on-error") - consumer.StartConsuming(func(m []byte, timeStamp time.Time, offset int64) error { + + getEnvironmentResourceContext := func(ctx domain.ConsoleContext, resType entities.ResourceType, clusterName string, obj unstructured.Unstructured) (domain.ResourceContext, error) { + mapping, err := d.GetEnvironmentResourceMapping(ctx, resType, clusterName, obj.GetNamespace(), obj.GetName()) + if err != nil { + return domain.ResourceContext{}, err + } + if mapping == nil { + return domain.ResourceContext{}, fmt.Errorf("resource mapping could not be found") + } + return newResourceContext(ctx, mapping.ProjectName, mapping.EnvironmentName), nil + } + + msgReader := func(msg *msgTypes.ConsumeMsg) error { counter += 1 logger.Debugf("received message [%d]", counter) - var msg t.AgentErrMessage - if err := json.Unmarshal(m, &msg); err != nil { - return err + var errObj t.AgentErrMessage + if err := json.Unmarshal(msg.Payload, &errObj); err != nil { + return errors.NewE(err) } - obj := unstructured.Unstructured{Object: msg.Object} + obj := unstructured.Unstructured{Object: errObj.Object} mLogger := logger.WithKV( "gvk", obj.GroupVersionKind(), - "accountName", msg.AccountName, - "clusterName", msg.ClusterName, + "accountName", errObj.AccountName, + "clusterName", errObj.ClusterName, ) mLogger.Infof("received message") @@ -40,46 +54,174 @@ func ProcessErrorOnApply(consumer ErrorOnApplyConsumer, d domain.Domain, logr lo mLogger.Infof("processed message") }() - kind := obj.GroupVersionKind().Kind - ctx := domain.NewConsoleContext(context.TODO(), "sys-user:apply-on-error-worker", msg.AccountName, msg.ClusterName) + dctx := domain.NewConsoleContext(context.TODO(), "sys-user:apply-on-error-worker", errObj.AccountName) - switch kind { - case "Project": + opts := domain.UpdateAndDeleteOpts{MessageTimestamp: msg.Timestamp} + + gvkStr := obj.GroupVersionKind().String() + + switch gvkStr { + case deviceGVK.String(): { - return d.OnApplyProjectError(ctx, msg.Error, obj.GetName()) + if errObj.Action == t.ActionApply { + return d.OnVPNDeviceApplyError(dctx, errObj.Error, obj.GetName(), opts) + } + + p, err := fn.JsonConvert[entities.ConsoleVPNDevice](obj.Object) + if err != nil { + return err + } + + return d.OnVPNDeviceDeleteMessage(dctx, p) } - case "Env": + case projectGVK.String(): { - return d.OnApplyWorkspaceError(ctx, msg.Error, obj.GetNamespace(), obj.GetName()) + if errObj.Action == t.ActionApply { + return d.OnProjectApplyError(dctx, errObj.Error, obj.GetName(), opts) + } + + p, err := fn.JsonConvert[entities.Project](obj.Object) + if err != nil { + return err + } + + return d.OnProjectDeleteMessage(dctx, p) } - case "App": + case environmentGVK.String(): { - return d.OnApplyAppError(ctx, msg.Error, obj.GetNamespace(), obj.GetName()) + if errObj.Action == t.ActionApply { + return d.OnEnvironmentApplyError(dctx, errObj.Error, obj.GetNamespace(), obj.GetName(), opts) + } + + p, err := fn.JsonConvert[entities.Environment](obj.Object) + if err != nil { + return err + } + + return d.OnEnvironmentDeleteMessage(dctx, p) } - case "Config": + case projectManagedServiceGVK.String(): { - return d.OnApplyConfigError(ctx, msg.Error, obj.GetNamespace(), obj.GetName()) + mapping, err := d.GetProjectResourceMapping(dctx, entities.ResourceTypeProjectManagedService, errObj.ClusterName, obj.GetName()) + if err != nil { + return err + } + if mapping == nil { + return err + } + + if errObj.Action == t.ActionApply { + return d.OnProjectManagedServiceApplyError(dctx, mapping.ProjectName, obj.GetName(), errObj.Error, opts) + } + + pmsvc, err := fn.JsonConvert[entities.ProjectManagedService](obj.Object) + if err != nil { + return err + } + + return d.OnProjectManagedServiceDeleteMessage(dctx, mapping.ProjectName, pmsvc) } - case "Secret": + + case appsGVK.String(): { - return d.OnApplySecretError(ctx, msg.Error, obj.GetNamespace(), obj.GetName()) + rctx, err := getEnvironmentResourceContext(dctx, entities.ResourceTypeApp, errObj.ClusterName, obj) + if err != nil { + return errors.NewE(err) + } + + app, err := fn.JsonConvert[entities.App](obj.Object) + if err != nil { + return err + } + + if errObj.Action == t.ActionApply { + return d.OnAppApplyError(rctx, errObj.Error, obj.GetName(), opts) + } + + return d.OnAppDeleteMessage(rctx, app) } - case "Router": + case configGVK.String(): { - return d.OnApplyRouterError(ctx, msg.Error, obj.GetNamespace(), obj.GetName()) + rctx, err := getEnvironmentResourceContext(dctx, entities.ResourceTypeConfig, errObj.ClusterName, obj) + if err != nil { + return errors.NewE(err) + } + + config, err := fn.JsonConvert[entities.Config](obj.Object) + if err != nil { + return err + } + + if errObj.Action == t.ActionApply { + return d.OnConfigApplyError(rctx, errObj.Error, obj.GetName(), opts) + } + return d.OnConfigDeleteMessage(rctx, config) } - case "ManagedService": + case secretGVK.String(): { - return d.OnApplyManagedServiceError(ctx, msg.Error, obj.GetNamespace(), obj.GetName()) + rctx, err := getEnvironmentResourceContext(dctx, entities.ResourceTypeSecret, errObj.ClusterName, obj) + if err != nil { + return errors.NewE(err) + } + + secret, err := fn.JsonConvert[entities.Secret](obj.Object) + if err != nil { + return err + } + + if errObj.Action == t.ActionApply { + return d.OnSecretApplyError(rctx, errObj.Error, obj.GetName(), opts) + } + return d.OnSecretDeleteMessage(rctx, secret) } - case "ManagedResource": + case routerGVK.String(): { - return d.OnApplyManagedResourceError(ctx, msg.Error, obj.GetNamespace(), obj.GetName()) + rctx, err := getEnvironmentResourceContext(dctx, entities.ResourceTypeRouter, errObj.ClusterName, obj) + if err != nil { + return errors.NewE(err) + } + + router, err := fn.JsonConvert[entities.Router](obj.Object) + if err != nil { + return err + } + + if errObj.Action == t.ActionApply { + return d.OnRouterApplyError(rctx, errObj.Error, obj.GetName(), opts) + } + return d.OnRouterDeleteMessage(rctx, router) } + case managedResourceGVK.String(): + { + rctx, err := getEnvironmentResourceContext(dctx, entities.ResourceTypeManagedResource, errObj.ClusterName, obj) + if err != nil { + return errors.NewE(err) + } + + mres, err := fn.JsonConvert[entities.ManagedResource](obj.Object) + if err != nil { + return err + } + + if errObj.Action == t.ActionApply { + return d.OnManagedResourceApplyError(rctx, errObj.Error, obj.GetName(), opts) + } + return d.OnManagedResourceDeleteMessage(rctx, mres) + } + default: { - return fmt.Errorf("console apply error reader does not acknowledge resource with kind (%s)", kind) + return errors.Newf("console apply error reader does not acknowledge resource with GVK (%s)", gvkStr) } } - }) + } + + if err := consumer.Consume(msgReader, msgTypes.ConsumeOpts{ + OnError: func(err error) error { + logger.Errorf(err, "received while reading messages, ignoring it") + return nil + }, + }); err != nil { + logger.Errorf(err, "error while consuming messages") + } } diff --git a/apps/console/internal/app/process-resource-updates.go b/apps/console/internal/app/process-resource-updates.go new file mode 100644 index 000000000..8c13a6d10 --- /dev/null +++ b/apps/console/internal/app/process-resource-updates.go @@ -0,0 +1,325 @@ +package app + +import ( + "context" + "encoding/json" + "fmt" + "strings" + + "github.com/kloudlite/api/apps/console/internal/domain" + "github.com/kloudlite/api/apps/console/internal/entities" + "github.com/kloudlite/api/pkg/errors" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/api/pkg/messaging" + msgTypes "github.com/kloudlite/api/pkg/messaging/types" + t "github.com/kloudlite/api/pkg/types" + "github.com/kloudlite/operator/operators/resource-watcher/types" + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" +) + +type ResourceUpdateConsumer messaging.Consumer + +func newResourceContext(ctx domain.ConsoleContext, projectName string, environmentName string) domain.ResourceContext { + return domain.ResourceContext{ + ConsoleContext: ctx, + ProjectName: projectName, + EnvironmentName: environmentName, + } +} + +var ( + projectGVK = fn.GVK("crds.kloudlite.io/v1", "Project") + appsGVK = fn.GVK("crds.kloudlite.io/v1", "App") + environmentGVK = fn.GVK("crds.kloudlite.io/v1", "Environment") + deviceGVK = fn.GVK("wireguard.kloudlite.io/v1", "Device") + configGVK = fn.GVK("v1", "ConfigMap") + secretGVK = fn.GVK("v1", "Secret") + routerGVK = fn.GVK("crds.kloudlite.io/v1", "Router") + managedResourceGVK = fn.GVK("crds.kloudlite.io/v1", "ManagedResource") + projectManagedServiceGVK = fn.GVK("crds.kloudlite.io/v1", "ProjectManagedService") +) + +func ProcessResourceUpdates(consumer ResourceUpdateConsumer, d domain.Domain, logger logging.Logger) { + counter := 0 + + getResourceContext := func(ctx domain.ConsoleContext, rt entities.ResourceType, clusterName string, obj unstructured.Unstructured) (domain.ResourceContext, error) { + mapping, err := d.GetEnvironmentResourceMapping(ctx, rt, clusterName, obj.GetNamespace(), obj.GetName()) + if err != nil { + return domain.ResourceContext{}, err + } + if mapping == nil { + return domain.ResourceContext{}, errors.Newf("mapping not found for %s %s/%s", rt, obj.GetNamespace(), obj.GetName()) + } + + return newResourceContext(ctx, mapping.ProjectName, mapping.EnvironmentName), nil + } + + msgReader := func(msg *msgTypes.ConsumeMsg) error { + logger := logger.WithKV("subject", msg.Subject) + + counter += 1 + logger.Debugf("[%d] received message", counter) + + var ru types.ResourceUpdate + if err := json.Unmarshal(msg.Payload, &ru); err != nil { + logger.Errorf(err, "parsing into status update") + return nil + } + + if ru.Object == nil { + logger.Infof("msg.Object is nil, so could not extract any info from message, ignoring ...") + return nil + } + + obj := unstructured.Unstructured{Object: ru.Object} + + mLogger := logger.WithKV( + "gvk", obj.GetObjectKind().GroupVersionKind(), + "resource", fmt.Sprintf("%s/%s", obj.GetNamespace(), obj.GetName()), + "accountName", ru.AccountName, + "clusterName", ru.ClusterName, + ) + + mLogger.Infof("received message") + defer func() { + mLogger.Infof("processed message") + }() + + if len(strings.TrimSpace(ru.AccountName)) == 0 { + logger.Infof("message does not contain 'accountName', so won't be able to find a resource uniquely, thus ignoring ...") + return nil + } + + if len(strings.TrimSpace(ru.ClusterName)) == 0 { + logger.Infof("message does not contain 'clusterName', so won't be able to find a resource uniquely, thus ignoring ...") + return nil + } + + dctx := domain.NewConsoleContext(context.TODO(), "sys-user:console-resource-updater", ru.AccountName) + + gvkStr := obj.GetObjectKind().GroupVersionKind().String() + + resStatus, err := func() (types.ResourceStatus, error) { + v, ok := ru.Object[types.ResourceStatusKey] + if !ok { + return "", errors.NewE(fmt.Errorf("field %s not found in object", types.ResourceStatusKey)) + } + s, ok := v.(string) + if !ok { + return "", errors.NewE(fmt.Errorf("field value %v is not a string", v)) + } + + return types.ResourceStatus(s), nil + }() + if err != nil { + return err + } + + opts := domain.UpdateAndDeleteOpts{MessageTimestamp: msg.Timestamp} + + switch gvkStr { + case deviceGVK.String(): + { + + dev, err := fn.JsonConvert[entities.ConsoleVPNDevice](ru.Object) + if err != nil { + return errors.NewE(err) + } + + if v, ok := ru.Object[types.KeyVPNDeviceConfig]; ok { + b, err := json.Marshal(v) + if err != nil { + return errors.NewE(err) + } + var encodedStr t.EncodedString + if err := json.Unmarshal(b, &encodedStr); err != nil { + return errors.NewE(err) + } + dev.WireguardConfig = encodedStr + } + + if resStatus == types.ResourceStatusDeleted { + return d.OnVPNDeviceDeleteMessage(dctx, dev) + } + + return d.OnVPNDeviceUpdateMessage(dctx, dev, resStatus, opts, ru.ClusterName) + } + case projectGVK.String(): + { + var p entities.Project + if err := fn.JsonConversion(ru.Object, &p); err != nil { + return errors.NewE(err) + } + + if resStatus == types.ResourceStatusDeleted { + return d.OnProjectDeleteMessage(dctx, p) + } + return d.OnProjectUpdateMessage(dctx, p, resStatus, opts) + } + + case projectManagedServiceGVK.String(): + { + var pmsvc entities.ProjectManagedService + if err := fn.JsonConversion(ru.Object, &pmsvc); err != nil { + return errors.NewE(err) + } + + mapping, err := d.GetProjectResourceMapping(dctx, entities.ResourceTypeProjectManagedService, ru.ClusterName, obj.GetName()) + if err != nil { + return err + } + if mapping == nil { + return err + } + + if v, ok := ru.Object[types.KeyProjectManagedSvcSecret]; ok { + s, err := fn.JsonConvertP[corev1.Secret](v) + s.SetManagedFields(nil) + if err != nil { + return err + } + pmsvc.SyncedOutputSecretRef = s + } + + if resStatus == types.ResourceStatusDeleted { + return d.OnProjectManagedServiceDeleteMessage(dctx, mapping.ProjectName, pmsvc) + } + return d.OnProjectManagedServiceUpdateMessage(dctx, mapping.ProjectName, pmsvc, resStatus, opts) + } + + case environmentGVK.String(): + { + var ws entities.Environment + if err := fn.JsonConversion(ru.Object, &ws); err != nil { + return errors.NewE(err) + } + + if resStatus == types.ResourceStatusDeleted { + return d.OnEnvironmentDeleteMessage(dctx, ws) + } + return d.OnEnvironmentUpdateMessage(dctx, ws, resStatus, opts) + } + case appsGVK.String(): + { + var app entities.App + if err := fn.JsonConversion(ru.Object, &app); err != nil { + return errors.NewE(err) + } + + rctx, err := getResourceContext(dctx, entities.ResourceTypeApp, ru.ClusterName, obj) + if err != nil { + return errors.NewE(err) + } + + if resStatus == types.ResourceStatusDeleted { + return d.OnAppDeleteMessage(rctx, app) + } + return d.OnAppUpdateMessage(rctx, app, resStatus, opts) + } + case configGVK.String(): + { + var config entities.Config + if err := fn.JsonConversion(ru.Object, &config); err != nil { + return errors.NewE(err) + } + + rctx, err := getResourceContext(dctx, entities.ResourceTypeConfig, ru.ClusterName, obj) + if err != nil { + return errors.NewE(err) + } + + if resStatus == types.ResourceStatusDeleted { + return d.OnConfigDeleteMessage(rctx, config) + } + return d.OnConfigUpdateMessage(rctx, config, resStatus, opts) + } + case secretGVK.String(): + { + var secret entities.Secret + if err := fn.JsonConversion(ru.Object, &secret); err != nil { + return errors.NewE(err) + } + + rctx, err := getResourceContext(dctx, entities.ResourceTypeSecret, ru.ClusterName, obj) + if err != nil { + return errors.NewE(err) + } + + if secret.Type == corev1.SecretTypeDockerConfigJson { + // secret is an image pull secret + ips := entities.ImagePullSecret{ + ObjectMeta: secret.ObjectMeta, + } + if resStatus == types.ResourceStatusDeleted { + return d.OnImagePullSecretDeleteMessage(rctx, ips) + } + return d.OnImagePullSecretUpdateMessage(rctx, ips, resStatus, opts) + } + + if resStatus == types.ResourceStatusDeleted { + return d.OnSecretDeleteMessage(rctx, secret) + } + return d.OnSecretUpdateMessage(rctx, secret, resStatus, opts) + } + + case routerGVK.String(): + { + var router entities.Router + if err := fn.JsonConversion(ru.Object, &router); err != nil { + return errors.NewE(err) + } + + rctx, err := getResourceContext(dctx, entities.ResourceTypeRouter, ru.ClusterName, obj) + if err != nil { + return errors.NewE(err) + } + + if resStatus == types.ResourceStatusDeleted { + return d.OnRouterDeleteMessage(rctx, router) + } + return d.OnRouterUpdateMessage(rctx, router, resStatus, opts) + } + case managedResourceGVK.String(): + { + var mres entities.ManagedResource + if err := fn.JsonConversion(ru.Object, &mres); err != nil { + return errors.NewE(err) + } + + rctx, err := getResourceContext(dctx, entities.ResourceTypeManagedResource, ru.ClusterName, obj) + if err != nil { + return errors.NewE(err) + } + + if v, ok := ru.Object[types.KeyManagedResSecret]; ok { + s, err := fn.JsonConvertP[corev1.Secret](v) + if err != nil { + mLogger.Infof("managed resource, invalid output secret received") + return errors.NewE(err) + } + s.SetManagedFields(nil) + mLogger.Infof("seting managed resource output secret") + mres.SyncedOutputSecretRef = s + } + + if resStatus == types.ResourceStatusDeleted { + return d.OnManagedResourceDeleteMessage(rctx, mres) + } + return d.OnManagedResourceUpdateMessage(rctx, mres, resStatus, opts) + } + + } + return nil + } + + if err := consumer.Consume(msgReader, msgTypes.ConsumeOpts{ + OnError: func(err error) error { + logger.Errorf(err, "received while reading messages, ignoring it") + return nil + }, + }); err != nil { + logger.Errorf(err, "error while consuming messages") + } +} diff --git a/apps/console/internal/app/process-status-updates.go b/apps/console/internal/app/process-status-updates.go deleted file mode 100644 index 0075afa50..000000000 --- a/apps/console/internal/app/process-status-updates.go +++ /dev/null @@ -1,148 +0,0 @@ -package app - -import ( - "context" - "encoding/json" - "strings" - "time" - - "github.com/kloudlite/operator/operators/resource-watcher/types" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "kloudlite.io/apps/console/internal/domain" - "kloudlite.io/apps/console/internal/domain/entities" - fn "kloudlite.io/pkg/functions" - "kloudlite.io/pkg/logging" - "kloudlite.io/pkg/redpanda" -) - -type ResourceUpdateConsumer redpanda.Consumer - -func ProcessResourceUpdates(consumer ResourceUpdateConsumer, d domain.Domain, logr logging.Logger) { - counter := 0 - logger := logr.WithName("resource-updates") - consumer.StartConsuming(func(msg []byte, timeStamp time.Time, offset int64) error { - counter += 1 - logger.Debugf("[%d] received message", counter) - - var ru types.ResourceUpdate - if err := json.Unmarshal(msg, &ru); err != nil { - logger.Errorf(err, "parsing into status update") - return nil - } - - if ru.Object == nil { - logger.Infof("msg.Object is nil, so could not extract any info from message, ignoring ...") - return nil - } - - obj := unstructured.Unstructured{Object: ru.Object} - - mLogger := logger.WithKV( - "gvk", obj.GetObjectKind().GroupVersionKind(), - "accountName", ru.AccountName, - "clusterName", ru.ClusterName, - ) - - mLogger.Infof("received message") - defer func() { - mLogger.Infof("processed message") - }() - - if len(strings.TrimSpace(ru.AccountName)) == 0 { - logger.Infof("message does not contain 'accountName', so won't be able to find a resource uniquely, thus ignoring ...") - return nil - } - - if len(strings.TrimSpace(ru.ClusterName)) == 0 { - logger.Infof("message does not contain 'clusterName', so won't be able to find a resource uniquely, thus ignoring ...") - return nil - } - - kind := obj.GetObjectKind().GroupVersionKind().Kind - ctx := domain.NewConsoleContext(context.TODO(), "sys-user:status-updater", ru.AccountName, ru.ClusterName) - - switch kind { - case "Project": - { - var p entities.Project - if err := fn.JsonConversion(ru.Object, &p); err != nil { - return err - } - - if obj.GetDeletionTimestamp() != nil { - return d.OnDeleteProjectMessage(ctx, p) - } - return d.OnUpdateProjectMessage(ctx, p) - } - case "App": - { - var a entities.App - if err := fn.JsonConversion(ru.Object, &a); err != nil { - return err - } - - if obj.GetDeletionTimestamp() != nil { - return d.OnDeleteAppMessage(ctx, a) - } - return d.OnUpdateAppMessage(ctx, a) - } - case "Config": - { - var c entities.Config - if err := fn.JsonConversion(ru.Object, &c); err != nil { - return err - } - if obj.GetDeletionTimestamp() != nil { - return d.OnDeleteConfigMessage(ctx, c) - } - return d.OnUpdateConfigMessage(ctx, c) - } - case "Secret": - { - var s entities.Secret - if err := fn.JsonConversion(ru.Object, &s); err != nil { - return err - } - if obj.GetDeletionTimestamp() != nil { - return d.OnDeleteSecretMessage(ctx, s) - } - return d.OnUpdateSecretMessage(ctx, s) - } - case "Router": - { - var r entities.Router - if err := fn.JsonConversion(ru.Object, &r); err != nil { - return err - } - if obj.GetDeletionTimestamp() != nil { - return d.OnDeleteRouterMessage(ctx, r) - } - return d.OnUpdateRouterMessage(ctx, r) - } - case "ManagedService": - { - var msvc entities.MSvc - if err := fn.JsonConversion(ru.Object, &msvc); err != nil { - return err - } - if obj.GetDeletionTimestamp() != nil { - return d.OnDeleteManagedServiceMessage(ctx, msvc) - } - return d.OnUpdateManagedServiceMessage(ctx, msvc) - } - case "ManagedResource": - { - var mres entities.MRes - if err := fn.JsonConversion(ru.Object, &mres); err != nil { - return err - } - if obj.GetDeletionTimestamp() != nil { - return d.OnDeleteManagedResourceMessage(ctx, mres) - } - return d.OnUpdateManagedResourceMessage(ctx, mres) - } - } - - return nil - }) -} diff --git a/apps/console/internal/domain/api.go b/apps/console/internal/domain/api.go index 4a6b27226..797ddb540 100644 --- a/apps/console/internal/domain/api.go +++ b/apps/console/internal/domain/api.go @@ -2,27 +2,69 @@ package domain import ( "context" + "time" - "kloudlite.io/apps/console/internal/domain/entities" - "kloudlite.io/pkg/repos" + "github.com/kloudlite/api/common/fields" + + crdsv1 "github.com/kloudlite/operator/apis/crds/v1" + wgv1 "github.com/kloudlite/operator/apis/wireguard/v1" + + "github.com/kloudlite/operator/operators/resource-watcher/types" + + "github.com/kloudlite/api/apps/console/internal/entities" + "github.com/kloudlite/api/pkg/repos" ) type ConsoleContext struct { context.Context - ClusterName string AccountName string - UserId repos.ID + + UserId repos.ID + UserEmail string + UserName string +} + +func (c ConsoleContext) GetUserId() repos.ID { + return c.UserId +} + +func (c ConsoleContext) GetUserEmail() string { + return c.UserEmail +} + +func (c ConsoleContext) GetUserName() string { + return c.UserName } func (c ConsoleContext) GetAccountName() string { return c.AccountName } -func NewConsoleContext(parent context.Context, userId repos.ID, accountName, clusterName string) ConsoleContext { +type ResourceContext struct { + ConsoleContext + ProjectName string + EnvironmentName string +} + +func (r ResourceContext) DBFilters() repos.Filter { + return repos.Filter{ + fields.AccountName: r.AccountName, + fields.ProjectName: r.ProjectName, + fields.EnvironmentName: r.EnvironmentName, + } +} + +type UserAndAccountsContext struct { + context.Context + AccountName string + UserId repos.ID +} + +func NewConsoleContext(parent context.Context, userId repos.ID, accountName string) ConsoleContext { return ConsoleContext{ - Context: parent, - UserId: userId, - ClusterName: clusterName, + Context: parent, + UserId: userId, + AccountName: accountName, } } @@ -32,123 +74,202 @@ type CheckNameAvailabilityOutput struct { SuggestedNames []string `json:"suggestedNames,omitempty"` } +type ConfigKeyRef struct { + ConfigName string `json:"configName"` + Key string `json:"key"` +} + +type ConfigKeyValueRef struct { + ConfigName string `json:"configName"` + Key string `json:"key"` + Value string `json:"value"` +} + +type SecretKeyRef struct { + SecretName string `json:"secretName"` + Key string `json:"key"` +} + +type SecretKeyValueRef struct { + SecretName string `json:"secretName"` + Key string `json:"key"` + Value string `json:"value"` +} + +type ManagedResourceKeyRef struct { + MresName string `json:"mresName"` + Key string `json:"key"` +} + +type ManagedResourceKeyValueRef struct { + MresName string `json:"mresName"` + Key string `json:"key"` + Value string `json:"value"` +} + type ResType string -const ( - ResTypeProject ResType = "project" - ResTypeEnvironment ResType = "environment" - ResTypeApp ResType = "app" - ResTypeConfig ResType = "config" - ResTypeSecret ResType = "secret" - ResTypeRouter ResType = "router" - ResTypeManagedService ResType = "managedservice" - ResTypeManagedResource ResType = "managedresource" -) +type UpdateAndDeleteOpts struct { + MessageTimestamp time.Time +} type Domain interface { - CheckNameAvailability(ctx context.Context, resType ResType, accountName string, name string) (*CheckNameAvailabilityOutput, error) + CheckNameAvailability(ctx context.Context, accountName string, projectName *string, environmentName *string, resType entities.ResourceType, name string) (*CheckNameAvailabilityOutput, error) - ListProjects(ctx context.Context, userId repos.ID, accountName string, clusterName *string) ([]*entities.Project, error) + ListProjects(ctx context.Context, userId repos.ID, accountName string, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.Project], error) GetProject(ctx ConsoleContext, name string) (*entities.Project, error) CreateProject(ctx ConsoleContext, project entities.Project) (*entities.Project, error) UpdateProject(ctx ConsoleContext, project entities.Project) (*entities.Project, error) DeleteProject(ctx ConsoleContext, name string) error - OnApplyProjectError(ctx ConsoleContext, errMsg string, name string) error - OnDeleteProjectMessage(ctx ConsoleContext, cluster entities.Project) error - OnUpdateProjectMessage(ctx ConsoleContext, cluster entities.Project) error + OnProjectApplyError(ctx ConsoleContext, errMsg string, name string, opts UpdateAndDeleteOpts) error + OnProjectDeleteMessage(ctx ConsoleContext, project entities.Project) error + OnProjectUpdateMessage(ctx ConsoleContext, cluster entities.Project, status types.ResourceStatus, opts UpdateAndDeleteOpts) error ResyncProject(ctx ConsoleContext, name string) error - ListWorkspaces(ctx ConsoleContext, namespace string) ([]*entities.Workspace, error) - GetWorkspace(ctx ConsoleContext, namespace, name string) (*entities.Workspace, error) + ListEnvironments(ctx ConsoleContext, projectName string, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.Environment], error) + GetEnvironment(ctx ConsoleContext, projectName string, name string) (*entities.Environment, error) + + CreateEnvironment(ctx ConsoleContext, projectName string, env entities.Environment) (*entities.Environment, error) + CloneEnvironment(ctx ConsoleContext, projectName string, sourceEnvName string, destinationEnvName string, displayName string, environmentRoutingMode crdsv1.EnvironmentRoutingMode) (*entities.Environment, error) + UpdateEnvironment(ctx ConsoleContext, projectName string, env entities.Environment) (*entities.Environment, error) + DeleteEnvironment(ctx ConsoleContext, projectName string, name string) error + + OnEnvironmentApplyError(ctx ConsoleContext, errMsg, namespace, name string, opts UpdateAndDeleteOpts) error + OnEnvironmentDeleteMessage(ctx ConsoleContext, env entities.Environment) error + OnEnvironmentUpdateMessage(ctx ConsoleContext, env entities.Environment, status types.ResourceStatus, opts UpdateAndDeleteOpts) error - CreateWorkspace(ctx ConsoleContext, env entities.Workspace) (*entities.Workspace, error) - UpdateWorkspace(ctx ConsoleContext, env entities.Workspace) (*entities.Workspace, error) - DeleteWorkspace(ctx ConsoleContext, namespace, name string) error + ResyncEnvironment(ctx ConsoleContext, projectName string, name string) error - OnApplyWorkspaceError(ctx ConsoleContext, errMsg, namespace, name string) error - OnDeleteEnvironmentMessage(ctx ConsoleContext, cluster entities.Workspace) error - OnUpdateEnvironmentMessage(ctx ConsoleContext, cluster entities.Workspace) error + ListApps(ctx ResourceContext, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.App], error) + GetApp(ctx ResourceContext, name string) (*entities.App, error) - ResyncWorkspace(ctx ConsoleContext, namespace, name string) error + CreateApp(ctx ResourceContext, app entities.App) (*entities.App, error) + UpdateApp(ctx ResourceContext, app entities.App) (*entities.App, error) + DeleteApp(ctx ResourceContext, name string) error - ListApps(ctx ConsoleContext, namespace string) ([]*entities.App, error) - GetApp(ctx ConsoleContext, namespace, name string) (*entities.App, error) + InterceptApp(ctx ResourceContext, appName string, deviceName string, intercept bool) (bool, error) + RestartApp(ctx ResourceContext, appName string) error - CreateApp(ctx ConsoleContext, app entities.App) (*entities.App, error) - UpdateApp(ctx ConsoleContext, app entities.App) (*entities.App, error) - DeleteApp(ctx ConsoleContext, namespace, name string) error + OnAppApplyError(ctx ResourceContext, errMsg string, name string, opts UpdateAndDeleteOpts) error + OnAppDeleteMessage(ctx ResourceContext, app entities.App) error + OnAppUpdateMessage(ctx ResourceContext, app entities.App, status types.ResourceStatus, opts UpdateAndDeleteOpts) error - OnApplyAppError(ctx ConsoleContext, errMsg string, namespace string, name string) error - OnDeleteAppMessage(ctx ConsoleContext, app entities.App) error - OnUpdateAppMessage(ctx ConsoleContext, app entities.App) error + ResyncApp(ctx ResourceContext, name string) error - ResyncApp(ctx ConsoleContext, namespace, name string) error + ListConfigs(ctx ResourceContext, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.Config], error) + GetConfig(ctx ResourceContext, name string) (*entities.Config, error) + GetConfigEntries(ctx ResourceContext, keyrefs []ConfigKeyRef) ([]*ConfigKeyValueRef, error) - ListConfigs(ctx ConsoleContext, namespace string) ([]*entities.Config, error) - GetConfig(ctx ConsoleContext, namespace, name string) (*entities.Config, error) + CreateConfig(ctx ResourceContext, config entities.Config) (*entities.Config, error) + UpdateConfig(ctx ResourceContext, config entities.Config) (*entities.Config, error) + DeleteConfig(ctx ResourceContext, name string) error - CreateConfig(ctx ConsoleContext, config entities.Config) (*entities.Config, error) - UpdateConfig(ctx ConsoleContext, config entities.Config) (*entities.Config, error) - DeleteConfig(ctx ConsoleContext, namespace, name string) error + OnConfigApplyError(ctx ResourceContext, errMsg, name string, opts UpdateAndDeleteOpts) error + OnConfigDeleteMessage(ctx ResourceContext, config entities.Config) error + OnConfigUpdateMessage(ctx ResourceContext, config entities.Config, status types.ResourceStatus, opts UpdateAndDeleteOpts) error - OnApplyConfigError(ctx ConsoleContext, errMsg, namespace, name string) error - OnDeleteConfigMessage(ctx ConsoleContext, config entities.Config) error - OnUpdateConfigMessage(ctx ConsoleContext, config entities.Config) error + ResyncConfig(ctx ResourceContext, name string) error - ResyncConfig(ctx ConsoleContext, namespace, name string) error + ListSecrets(ctx ResourceContext, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.Secret], error) + GetSecret(ctx ResourceContext, name string) (*entities.Secret, error) + GetSecretEntries(ctx ResourceContext, keyrefs []SecretKeyRef) ([]*SecretKeyValueRef, error) - ListSecrets(ctx ConsoleContext, namespace string) ([]*entities.Secret, error) - GetSecret(ctx ConsoleContext, namespace, name string) (*entities.Secret, error) + CreateSecret(ctx ResourceContext, secret entities.Secret) (*entities.Secret, error) + UpdateSecret(ctx ResourceContext, secret entities.Secret) (*entities.Secret, error) + DeleteSecret(ctx ResourceContext, name string) error - CreateSecret(ctx ConsoleContext, secret entities.Secret) (*entities.Secret, error) - UpdateSecret(ctx ConsoleContext, secret entities.Secret) (*entities.Secret, error) - DeleteSecret(ctx ConsoleContext, namespace, name string) error + OnSecretApplyError(ctx ResourceContext, errMsg, name string, opts UpdateAndDeleteOpts) error + OnSecretDeleteMessage(ctx ResourceContext, secret entities.Secret) error + OnSecretUpdateMessage(ctx ResourceContext, secret entities.Secret, status types.ResourceStatus, opts UpdateAndDeleteOpts) error - OnApplySecretError(ctx ConsoleContext, errMsg, namespace, name string) error - OnDeleteSecretMessage(ctx ConsoleContext, secret entities.Secret) error - OnUpdateSecretMessage(ctx ConsoleContext, secret entities.Secret) error + ResyncSecret(ctx ResourceContext, name string) error - ResyncSecret(ctx ConsoleContext, namespace, name string) error + ListRouters(ctx ResourceContext, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.Router], error) + GetRouter(ctx ResourceContext, name string) (*entities.Router, error) - ListRouters(ctx ConsoleContext, namespace string) ([]*entities.Router, error) - GetRouter(ctx ConsoleContext, namespace, name string) (*entities.Router, error) + CreateRouter(ctx ResourceContext, router entities.Router) (*entities.Router, error) + UpdateRouter(ctx ResourceContext, router entities.Router) (*entities.Router, error) + DeleteRouter(ctx ResourceContext, name string) error - CreateRouter(ctx ConsoleContext, router entities.Router) (*entities.Router, error) - UpdateRouter(ctx ConsoleContext, router entities.Router) (*entities.Router, error) - DeleteRouter(ctx ConsoleContext, namespace, name string) error + OnRouterApplyError(ctx ResourceContext, errMsg string, name string, opts UpdateAndDeleteOpts) error + OnRouterDeleteMessage(ctx ResourceContext, router entities.Router) error + OnRouterUpdateMessage(ctx ResourceContext, router entities.Router, status types.ResourceStatus, opts UpdateAndDeleteOpts) error - OnApplyRouterError(ctx ConsoleContext, errMsg string, namespace string, name string) error - OnDeleteRouterMessage(ctx ConsoleContext, router entities.Router) error - OnUpdateRouterMessage(ctx ConsoleContext, router entities.Router) error + ResyncRouter(ctx ResourceContext, name string) error - ResyncRouter(ctx ConsoleContext, namespace, name string) error + ListManagedResources(ctx ResourceContext, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.ManagedResource], error) + GetManagedResource(ctx ResourceContext, name string) (*entities.ManagedResource, error) - ListManagedServices(ctx ConsoleContext, namespace string) ([]*entities.MSvc, error) - GetManagedService(ctx ConsoleContext, namespace, name string) (*entities.MSvc, error) + GetManagedResourceOutputKeys(ctx ResourceContext, name string) ([]string, error) + GetManagedResourceOutputKVs(ctx ResourceContext, keyrefs []ManagedResourceKeyRef) ([]*ManagedResourceKeyValueRef, error) - CreateManagedService(ctx ConsoleContext, msvc entities.MSvc) (*entities.MSvc, error) - UpdateManagedService(ctx ConsoleContext, msvc entities.MSvc) (*entities.MSvc, error) - DeleteManagedService(ctx ConsoleContext, namespace, name string) error + CreateManagedResource(ctx ResourceContext, mres entities.ManagedResource) (*entities.ManagedResource, error) + UpdateManagedResource(ctx ResourceContext, mres entities.ManagedResource) (*entities.ManagedResource, error) + DeleteManagedResource(ctx ResourceContext, name string) error - OnApplyManagedServiceError(ctx ConsoleContext, errMsg string, namespace string, name string) error - OnDeleteManagedServiceMessage(ctx ConsoleContext, msvc entities.MSvc) error - OnUpdateManagedServiceMessage(ctx ConsoleContext, msvc entities.MSvc) error + OnManagedResourceApplyError(ctx ResourceContext, errMsg string, name string, opts UpdateAndDeleteOpts) error + OnManagedResourceDeleteMessage(ctx ResourceContext, mres entities.ManagedResource) error + OnManagedResourceUpdateMessage(ctx ResourceContext, mres entities.ManagedResource, status types.ResourceStatus, opts UpdateAndDeleteOpts) error - ResyncManagedService(ctx ConsoleContext, namespace, name string) error + ResyncManagedResource(ctx ResourceContext, name string) error - ListManagedResources(ctx ConsoleContext, namespace string) ([]*entities.MRes, error) - GetManagedResource(ctx ConsoleContext, namespace, name string) (*entities.MRes, error) + // image pull secrets + ListImagePullSecrets(ctx ResourceContext, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.ImagePullSecret], error) + GetImagePullSecret(ctx ResourceContext, name string) (*entities.ImagePullSecret, error) + CreateImagePullSecret(ctx ResourceContext, secret entities.ImagePullSecret) (*entities.ImagePullSecret, error) + DeleteImagePullSecret(ctx ResourceContext, name string) error - CreateManagedResource(ctx ConsoleContext, mres entities.MRes) (*entities.MRes, error) - UpdateManagedResource(ctx ConsoleContext, mres entities.MRes) (*entities.MRes, error) - DeleteManagedResource(ctx ConsoleContext, namespace, name string) error + OnImagePullSecretApplyError(ctx ResourceContext, errMsg string, name string, opts UpdateAndDeleteOpts) error + OnImagePullSecretDeleteMessage(ctx ResourceContext, ips entities.ImagePullSecret) error + OnImagePullSecretUpdateMessage(ctx ResourceContext, ips entities.ImagePullSecret, status types.ResourceStatus, opts UpdateAndDeleteOpts) error - OnApplyManagedResourceError(ctx ConsoleContext, errMsg string, namespace string, name string) error - OnDeleteManagedResourceMessage(ctx ConsoleContext, mres entities.MRes) error - OnUpdateManagedResourceMessage(ctx ConsoleContext, mres entities.MRes) error + ResyncImagePullSecret(ctx ResourceContext, name string) error + + GetEnvironmentResourceMapping(ctx ConsoleContext, resType entities.ResourceType, clusterName string, namespace string, name string) (*entities.ResourceMapping, error) + GetProjectResourceMapping(ctx ConsoleContext, resType entities.ResourceType, clusterName string, name string) (*entities.ResourceMapping, error) + + ListProjectManagedServices(ctx ConsoleContext, projectName string, mf map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.ProjectManagedService], error) + GetProjectManagedService(ctx ConsoleContext, projectName string, serviceName string) (*entities.ProjectManagedService, error) + CreateProjectManagedService(ctx ConsoleContext, projectName string, service entities.ProjectManagedService) (*entities.ProjectManagedService, error) + UpdateProjectManagedService(ctx ConsoleContext, projectName string, service entities.ProjectManagedService) (*entities.ProjectManagedService, error) + DeleteProjectManagedService(ctx ConsoleContext, projectName string, name string) error + + RestartProjectManagedService(ctx ConsoleContext, projectName string, name string) error + + OnProjectManagedServiceApplyError(ctx ConsoleContext, projectName, name, errMsg string, opts UpdateAndDeleteOpts) error + OnProjectManagedServiceDeleteMessage(ctx ConsoleContext, projectName string, service entities.ProjectManagedService) error + OnProjectManagedServiceUpdateMessage(ctx ConsoleContext, projectName string, service entities.ProjectManagedService, status types.ResourceStatus, opts UpdateAndDeleteOpts) error + ResyncProjectManagedService(ctx ConsoleContext, projectName, name string) error + + ListVPNDevices(ctx ConsoleContext, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.ConsoleVPNDevice], error) + ListVPNDevicesForUser(ctx ConsoleContext) ([]*entities.ConsoleVPNDevice, error) + GetVPNDevice(ctx ConsoleContext, name string) (*entities.ConsoleVPNDevice, error) + CreateVPNDevice(ctx ConsoleContext, device entities.ConsoleVPNDevice) (*entities.ConsoleVPNDevice, error) + UpdateVPNDevice(ctx ConsoleContext, device entities.ConsoleVPNDevice) (*entities.ConsoleVPNDevice, error) + DeleteVPNDevice(ctx ConsoleContext, name string) error + UpdateVpnDevicePorts(ctx ConsoleContext, devName string, ports []*wgv1.Port) error + ActivateVpnDeviceOnEnvironment(ctx ConsoleContext, devName string, projectName string, envName string) error + + OnVPNDeviceApplyError(ctx ConsoleContext, errMsg string, name string, opts UpdateAndDeleteOpts) error + OnVPNDeviceDeleteMessage(ctx ConsoleContext, device entities.ConsoleVPNDevice) error + OnVPNDeviceUpdateMessage(ctx ConsoleContext, device entities.ConsoleVPNDevice, status types.ResourceStatus, opts UpdateAndDeleteOpts, clusterName string) error + + ActivateVpnDeviceOnCluster(ctx ConsoleContext, devName string, clusterName string) error + ActivateVPNDeviceOnNamespace(ctx ConsoleContext, devName string, namespace string) error +} + +type PublishMsg string + +const ( + PublishAdd PublishMsg = "added" + PublishDelete PublishMsg = "deleted" + PublishUpdate PublishMsg = "updated" +) - ResyncManagedResource(ctx ConsoleContext, namespace, name string) error +type ResourceEventPublisher interface { + PublishConsoleEvent(ctx ConsoleContext, resourceType entities.ResourceType, name string, update PublishMsg) + PublishResourceEvent(ctx ResourceContext, resourceType entities.ResourceType, name string, update PublishMsg) } diff --git a/apps/console/internal/domain/app.go b/apps/console/internal/domain/app.go index ccd61fe8c..4b8ea6f7a 100644 --- a/apps/console/internal/domain/app.go +++ b/apps/console/internal/domain/app.go @@ -1,180 +1,265 @@ package domain import ( - "fmt" - "time" - - "kloudlite.io/apps/console/internal/domain/entities" - "kloudlite.io/pkg/repos" - t "kloudlite.io/pkg/types" + "github.com/kloudlite/api/apps/console/internal/entities" + fc "github.com/kloudlite/api/apps/console/internal/entities/field-constants" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + crdsv1 "github.com/kloudlite/operator/apis/crds/v1" + "github.com/kloudlite/operator/operators/resource-watcher/types" ) -// query - -func (d *domain) ListApps(ctx ConsoleContext, namespace string) ([]*entities.App, error) { - if err := d.canReadResourcesInWorkspace(ctx, namespace); err != nil { - return nil, err +func (d *domain) ListApps(ctx ResourceContext, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.App], error) { + if err := d.canReadResourcesInEnvironment(ctx); err != nil { + return nil, errors.NewE(err) } - return d.appRepo.Find(ctx, repos.Query{Filter: repos.Filter{ - "accountName": ctx.AccountName, - "clusterName": ctx.ClusterName, - "metadata.namespace": namespace, - }}) + filters := ctx.DBFilters() + + return d.appRepo.FindPaginated(ctx, d.appRepo.MergeMatchFilters(filters, search), pq) } -func (d *domain) findApp(ctx ConsoleContext, namespace string, name string) (*entities.App, error) { - app, err := d.appRepo.FindOne(ctx, repos.Filter{ - "accountName": ctx.AccountName, - "clusterName": ctx.ClusterName, - "metadata.namespace": namespace, - "metadata.name": name, - }) +func (d *domain) findApp(ctx ResourceContext, name string) (*entities.App, error) { + app, err := d.appRepo.FindOne( + ctx, + ctx.DBFilters().Add(fields.MetadataName, name), + ) if err != nil { - return nil, err + return nil, errors.NewE(err) } if app == nil { - return nil, fmt.Errorf("no app with name=%q,namespace=%q found", name, namespace) + return nil, errors.Newf("no app with name (%s), found in resource context (%s)", name, ctx) } return app, nil } -func (d *domain) GetApp(ctx ConsoleContext, namespace string, name string) (*entities.App, error) { - if err := d.canReadResourcesInWorkspace(ctx, namespace); err != nil { - return nil, err +func (d *domain) GetApp(ctx ResourceContext, name string) (*entities.App, error) { + if err := d.canReadResourcesInEnvironment(ctx); err != nil { + return nil, errors.NewE(err) } + return d.findApp(ctx, name) +} - return d.findApp(ctx, namespace, name) +func (d *domain) applyApp(ctx ResourceContext, app *entities.App) error { + addTrackingId(&app.App, app.Id) + return d.applyK8sResource(ctx, app.ProjectName, &app.App, app.RecordVersion) } -// mutations +func (d *domain) CreateApp(ctx ResourceContext, app entities.App) (*entities.App, error) { + if err := d.canMutateResourcesInEnvironment(ctx); err != nil { + return nil, errors.NewE(err) + } -func (d *domain) CreateApp(ctx ConsoleContext, app entities.App) (*entities.App, error) { - if err := d.canMutateResourcesInWorkspace(ctx, app.Namespace); err != nil { - return nil, err + env, err := d.findEnvironment(ctx.ConsoleContext, ctx.ProjectName, ctx.EnvironmentName) + if err != nil { + return nil, errors.NewE(err) } + app.Namespace = env.Spec.TargetNamespace app.EnsureGVK() - if err := d.k8sExtendedClient.ValidateStruct(ctx, &app.App); err != nil { - return nil, err + if err := d.k8sClient.ValidateObject(ctx, &app.App); err != nil { + return nil, errors.NewE(err) } + app.IncrementRecordVersion() + + app.CreatedBy = common.CreatedOrUpdatedBy{ + UserId: ctx.UserId, + UserName: ctx.UserName, + UserEmail: ctx.UserEmail, + } + app.LastUpdatedBy = app.CreatedBy + app.AccountName = ctx.AccountName - app.ClusterName = ctx.ClusterName - app.Generation = 1 - app.SyncStatus = t.GenSyncStatus(t.SyncActionApply, app.Generation) + app.ProjectName = ctx.ProjectName + app.EnvironmentName = ctx.EnvironmentName + app.SyncStatus = t.GenSyncStatus(t.SyncActionApply, app.RecordVersion) - nApp, err := d.appRepo.Create(ctx, &app) + return d.createAndApplyApp(ctx, &app) +} + +func (d *domain) createAndApplyApp(ctx ResourceContext, app *entities.App) (*entities.App, error) { + if _, err := d.upsertEnvironmentResourceMapping(ctx, app); err != nil { + return nil, errors.NewE(err) + } + + napp, err := d.appRepo.Create(ctx, app) if err != nil { if d.appRepo.ErrAlreadyExists(err) { - return nil, fmt.Errorf("app with name=%q, namespace=%q already exists", app.Name, app.Namespace) + // TODO: better insights into error, when it is being caused by duplicated indexes + return nil, errors.NewE(err) } return nil, err } - if err := d.applyK8sResource(ctx, &nApp.App); err != nil { - return nil, err - } + d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeApp, napp.Name, PublishAdd) - return nApp, nil + if err := d.applyApp(ctx, napp); err != nil { + return nil, errors.NewE(err) + } + return napp, nil } -func (d *domain) DeleteApp(ctx ConsoleContext, namespace string, name string) error { - if err := d.canMutateResourcesInWorkspace(ctx, namespace); err != nil { - return err +func (d *domain) DeleteApp(ctx ResourceContext, name string) error { + if err := d.canMutateResourcesInEnvironment(ctx); err != nil { + return errors.NewE(err) } - - app, err := d.findApp(ctx, namespace, name) + uapp, err := d.appRepo.Patch( + ctx, + ctx.DBFilters().Add(fields.MetadataName, name), + common.PatchForMarkDeletion(), + ) if err != nil { - return err + return errors.NewE(err) } - - app.SyncStatus = t.GenSyncStatus(t.SyncActionDelete, app.Generation) - - if _, err := d.appRepo.UpdateById(ctx, app.Id, app); err != nil { - return err + d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeApp, uapp.Name, PublishUpdate) + if err := d.deleteK8sResource(ctx, uapp.ProjectName, &uapp.App); err != nil { + if errors.Is(err, ErrNoClusterAttached) { + return d.appRepo.DeleteById(ctx, uapp.Id) + } + return errors.NewE(err) } - - return d.deleteK8sResource(ctx, &app.App) + return nil } -func (d *domain) UpdateApp(ctx ConsoleContext, app entities.App) (*entities.App, error) { - if err := d.canMutateResourcesInWorkspace(ctx, app.Namespace); err != nil { - return nil, err +func (d *domain) UpdateApp(ctx ResourceContext, appIn entities.App) (*entities.App, error) { + if err := d.canMutateResourcesInEnvironment(ctx); err != nil { + return nil, errors.NewE(err) } - app.EnsureGVK() - if err := d.k8sExtendedClient.ValidateStruct(ctx, &app.App); err != nil { - return nil, err + appIn.Namespace = "trest" + appIn.EnsureGVK() + if err := d.k8sClient.ValidateObject(ctx, &appIn.App); err != nil { + return nil, errors.NewE(err) } - exApp, err := d.findApp(ctx, app.Namespace, app.Name) + patchForUpdate := common.PatchForUpdate( + ctx, + &appIn, + common.PatchOpts{ + XPatch: repos.Document{ + fc.AppSpec: appIn.Spec, + }, + }) + + upApp, err := d.appRepo.Patch( + ctx, + ctx.DBFilters().Add(fields.MetadataName, appIn.Name), + patchForUpdate, + ) if err != nil { - return nil, err + return nil, errors.NewE(err) + } + d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeApp, upApp.Name, PublishUpdate) + + if err := d.applyApp(ctx, upApp); err != nil { + return nil, errors.NewE(err) } - exApp.Labels = app.Labels - exApp.Annotations = app.Annotations - exApp.Spec = app.Spec - exApp.Generation += 1 - exApp.SyncStatus = t.GenSyncStatus(t.SyncActionApply, exApp.Generation) + return upApp, nil +} - upApp, err := d.appRepo.UpdateById(ctx, exApp.Id, exApp) +// InterceptApp implements Domain. +func (d *domain) InterceptApp(ctx ResourceContext, appName string, deviceName string, intercept bool) (bool, error) { + if err := d.canMutateResourcesInEnvironment(ctx); err != nil { + return false, errors.NewE(err) + } + uApp, err := d.appRepo.Patch(ctx, ctx.DBFilters().Add(fields.MetadataName, appName), repos.Document{ + fc.AppSpecIntercept: crdsv1.Intercept{ + Enabled: intercept, + ToDevice: deviceName, + }, + }) if err != nil { - return nil, err + return false, errors.NewE(err) } - - if err := d.applyK8sResource(ctx, &upApp.App); err != nil { - return nil, err + if err := d.applyApp(ctx, uApp); err != nil { + return false, errors.NewE(err) } - - return upApp, nil + return true, nil } -func (d *domain) OnUpdateAppMessage(ctx ConsoleContext, app entities.App) error { - a, err := d.findApp(ctx, app.Namespace, app.Name) +func (d *domain) RestartApp(ctx ResourceContext, appName string) error { + if err := d.canMutateResourcesInEnvironment(ctx); err != nil { + return errors.NewE(err) + } + + app, err := d.findApp(ctx, appName) if err != nil { return err } - a.Status = app.Status - a.SyncStatus.Error = nil - a.SyncStatus.LastSyncedAt = time.Now() - a.SyncStatus.Generation = app.Generation - a.SyncStatus.State = t.ParseSyncState(app.Status.IsReady) + if err := d.restartK8sResource(ctx, ctx.ProjectName, app.Namespace, app.GetEnsuredLabels()); err != nil { + return err + } - _, err = d.appRepo.UpdateById(ctx, a.Id, a) - return err + return nil } -func (d *domain) OnDeleteAppMessage(ctx ConsoleContext, app entities.App) error { - a, err := d.findApp(ctx, app.Namespace, app.Name) +func (d *domain) OnAppUpdateMessage(ctx ResourceContext, app entities.App, status types.ResourceStatus, opts UpdateAndDeleteOpts) error { + xApp, err := d.findApp(ctx, app.Name) if err != nil { - return err + return errors.NewE(err) + } + + if xApp == nil { + return errors.Newf("no apps found") + } + recordVersion, err := d.MatchRecordVersion(app.Annotations, xApp.RecordVersion) + if err != nil { + return errors.NewE(err) } - return d.appRepo.DeleteById(ctx, a.Id) + uapp, err := d.appRepo.PatchById( + ctx, + xApp.Id, + common.PatchForSyncFromAgent(&app, recordVersion, status, common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + })) + d.resourceEventPublisher.PublishResourceEvent(ctx, uapp.GetResourceType(), uapp.GetName(), PublishUpdate) + return errors.NewE(err) } -func (d *domain) OnApplyAppError(ctx ConsoleContext, errMsg string, namespace string, name string) error { - a, err2 := d.findApp(ctx, namespace, name) - if err2 != nil { - return err2 +func (d *domain) OnAppDeleteMessage(ctx ResourceContext, app entities.App) error { + err := d.appRepo.DeleteOne( + ctx, + ctx.DBFilters().Add(fields.MetadataName, app.Name), + ) + if err != nil { + return errors.NewE(err) } - - a.SyncStatus.Error = &errMsg - _, err := d.appRepo.UpdateById(ctx, a.Id, a) - return err + d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeApp, app.Name, PublishDelete) + return nil } -func (d *domain) ResyncApp(ctx ConsoleContext, namespace, name string) error { - if err := d.canMutateResourcesInWorkspace(ctx, namespace); err != nil { - return err +func (d *domain) OnAppApplyError(ctx ResourceContext, errMsg string, name string, opts UpdateAndDeleteOpts) error { + uapp, err := d.appRepo.Patch( + ctx, + ctx.DBFilters().Add(fields.MetadataName, name), + common.PatchForErrorFromAgent( + errMsg, + common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + }, + ), + ) + if err != nil { + return errors.NewE(err) } + d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeApp, uapp.Name, PublishDelete) + return errors.NewE(err) +} - a, err := d.findApp(ctx, namespace, name) +func (d *domain) ResyncApp(ctx ResourceContext, name string) error { + if err := d.canMutateResourcesInEnvironment(ctx); err != nil { + return errors.NewE(err) + } + a, err := d.findApp(ctx, name) if err != nil { - return err + return errors.NewE(err) } - return d.resyncK8sResource(ctx, a.SyncStatus.Action, &a.App) + return d.resyncK8sResource(ctx, a.ProjectName, a.SyncStatus.Action, &a.App, a.RecordVersion) } diff --git a/apps/console/internal/domain/config.go b/apps/console/internal/domain/config.go index ec873c120..0375a6b4e 100644 --- a/apps/console/internal/domain/config.go +++ b/apps/console/internal/domain/config.go @@ -1,174 +1,254 @@ package domain import ( - "fmt" - "time" - - "kloudlite.io/apps/console/internal/domain/entities" - "kloudlite.io/pkg/repos" - t "kloudlite.io/pkg/types" + "maps" + + "github.com/kloudlite/api/apps/console/internal/entities" + fc "github.com/kloudlite/api/apps/console/internal/entities/field-constants" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/errors" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + "github.com/kloudlite/operator/operators/resource-watcher/types" ) -func (d *domain) ListConfigs(ctx ConsoleContext, namespace string) ([]*entities.Config, error) { - if err := d.canReadResourcesInWorkspace(ctx, namespace); err != nil { - return nil, err +func (d *domain) ListConfigs(ctx ResourceContext, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.Config], error) { + if err := d.canReadResourcesInEnvironment(ctx); err != nil { + return nil, errors.NewE(err) } - return d.configRepo.Find(ctx, repos.Query{Filter: repos.Filter{ - "accountName": ctx.AccountName, - "clusterName": ctx.ClusterName, - "metadata.namespace": namespace, - }}) + filter := ctx.DBFilters() + return d.configRepo.FindPaginated(ctx, d.configRepo.MergeMatchFilters(filter, search), pq) } -func (d *domain) findConfig(ctx ConsoleContext, namespace string, name string) (*entities.Config, error) { - cfg, err := d.configRepo.FindOne(ctx, repos.Filter{ - "clusterName": ctx.ClusterName, - "accountName": ctx.AccountName, - "metadata.namespace": namespace, - "metadata.name": name, - }) +func (d *domain) findConfig(ctx ResourceContext, name string) (*entities.Config, error) { + cfg, err := d.configRepo.FindOne(ctx, ctx.DBFilters().Add(fields.MetadataName, name)) if err != nil { - return nil, err + return nil, errors.NewE(err) } if cfg == nil { - return nil, fmt.Errorf("no config with name=%q,namespace=%q found", name, namespace) + return nil, errors.Newf("no config with name (%q)", name) } return cfg, nil } -func (d *domain) GetConfig(ctx ConsoleContext, namespace string, name string) (*entities.Config, error) { - if err := d.canReadResourcesInWorkspace(ctx, namespace); err != nil { - return nil, err +func (d *domain) GetConfig(ctx ResourceContext, name string) (*entities.Config, error) { + if err := d.canReadResourcesInEnvironment(ctx); err != nil { + return nil, errors.NewE(err) } - return d.findConfig(ctx, namespace, name) + return d.findConfig(ctx, name) } -// mutations +// GetConfigEntries implements Domain. +func (d *domain) GetConfigEntries(ctx ResourceContext, keyrefs []ConfigKeyRef) ([]*ConfigKeyValueRef, error) { + filters := ctx.DBFilters() + names := make([]any, 0, len(keyrefs)) + for i := range keyrefs { + names = append(names, keyrefs[i].ConfigName) + } + filters = d.configRepo.MergeMatchFilters(filters, map[string]repos.MatchFilter{ + fields.MetadataName: { + MatchType: repos.MatchTypeArray, + Array: names, + }, + }) + configs, err := d.configRepo.Find(ctx, repos.Query{Filter: filters}) + if err != nil { + return nil, errors.NewE(err) + } + + results := make([]*ConfigKeyValueRef, 0, len(configs)) -func (d *domain) CreateConfig(ctx ConsoleContext, config entities.Config) (*entities.Config, error) { - if err := d.canMutateResourcesInWorkspace(ctx, config.Namespace); err != nil { - return nil, err + data := make(map[string]map[string]string) + + for i := range configs { + data[configs[i].Name] = configs[i].Data } - config.EnsureGVK() - if err := d.k8sExtendedClient.ValidateStruct(ctx, &config.Config); err != nil { - return nil, err + for i := range keyrefs { + results = append(results, &ConfigKeyValueRef{ + ConfigName: keyrefs[i].ConfigName, + Key: keyrefs[i].Key, + Value: data[keyrefs[i].ConfigName][keyrefs[i].Key], + }) } - config.AccountName = ctx.AccountName - config.ClusterName = ctx.ClusterName - config.SetGeneration(1) - config.SyncStatus = t.GetSyncStatusForCreation() + return results, nil +} + +func (d *domain) CreateConfig(ctx ResourceContext, config entities.Config) (*entities.Config, error) { + if err := d.canMutateResourcesInEnvironment(ctx); err != nil { + return nil, errors.NewE(err) + } + + config.SetGroupVersionKind(fn.GVK("v1", "ConfigMap")) - c, err := d.configRepo.Create(ctx, &config) + var err error + config.Namespace, err = d.envTargetNamespace(ctx.ConsoleContext, ctx.ProjectName, ctx.EnvironmentName) if err != nil { - if d.configRepo.ErrAlreadyExists(err) { - return nil, fmt.Errorf("config with name %q already exists", config.Name) - } return nil, err } - if err := d.applyK8sResource(ctx, &c.Config); err != nil { - return c, err + config.IncrementRecordVersion() + config.CreatedBy = common.CreatedOrUpdatedBy{ + UserId: ctx.UserId, + UserName: ctx.UserName, + UserEmail: ctx.UserEmail, } + config.LastUpdatedBy = config.CreatedBy - return c, nil + config.AccountName = ctx.AccountName + config.ProjectName = ctx.ProjectName + config.EnvironmentName = ctx.EnvironmentName + if config.Annotations == nil { + config.Annotations = types.ConfigWatchingAnnotation + } else { + maps.Copy(config.Annotations, types.ConfigWatchingAnnotation) + } + + return d.createAndApplyConfig(ctx, &config) } -func (d *domain) UpdateConfig(ctx ConsoleContext, config entities.Config) (*entities.Config, error) { - if err := d.canMutateResourcesInWorkspace(ctx, config.Namespace); err != nil { - return nil, err - } +func (d *domain) createAndApplyConfig(ctx ResourceContext, config *entities.Config) (*entities.Config, error) { + config.SyncStatus = t.GenSyncStatus(t.SyncActionApply, 0) - config.EnsureGVK() - if err := d.k8sExtendedClient.ValidateStruct(ctx, &config.Config); err != nil { - return nil, err + if _, err := d.upsertEnvironmentResourceMapping(ctx, config); err != nil { + return nil, errors.NewE(err) } - c, err := d.findConfig(ctx, config.Namespace, config.Name) + cfg, err := d.configRepo.Create(ctx, config) if err != nil { - return nil, err + if d.configRepo.ErrAlreadyExists(err) { + // TODO: better insights into error, when it is being caused by duplicated indexes + return nil, errors.NewE(err) + } + return nil, errors.NewE(err) + } + + if err := d.applyK8sResource(ctx, config.ProjectName, &cfg.ConfigMap, cfg.RecordVersion); err != nil { + return cfg, errors.NewE(err) + } + + return cfg, nil +} + +func (d *domain) UpdateConfig(ctx ResourceContext, config entities.Config) (*entities.Config, error) { + if err := d.canMutateResourcesInEnvironment(ctx); err != nil { + return nil, errors.NewE(err) } - c.Config = config.Config - c.Generation += 1 - c.SyncStatus = t.GetSyncStatusForUpdation(c.Generation) + config.SetGroupVersionKind(fn.GVK("v1", "ConfigMap")) + + patchForUpdate := common.PatchForUpdate( + ctx, + &config, + common.PatchOpts{ + XPatch: repos.Document{ + fc.ConfigData: config.Data, + }, + }) - upConfig, err := d.configRepo.UpdateById(ctx, c.Id, c) + upConfig, err := d.configRepo.Patch( + ctx, + ctx.DBFilters().Add(fields.MetadataName, config.Name), + patchForUpdate, + ) if err != nil { - return nil, err + return nil, errors.NewE(err) } + d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeConfig, upConfig.Name, PublishUpdate) - if err := d.applyK8sResource(ctx, &upConfig.Config); err != nil { - return upConfig, err + if err := d.applyK8sResource(ctx, ctx.ProjectName, &upConfig.ConfigMap, upConfig.RecordVersion); err != nil { + return upConfig, errors.NewE(err) } return upConfig, nil } -func (d *domain) DeleteConfig(ctx ConsoleContext, namespace string, name string) error { - if err := d.canMutateResourcesInWorkspace(ctx, namespace); err != nil { - return err +func (d *domain) DeleteConfig(ctx ResourceContext, name string) error { + if err := d.canMutateResourcesInEnvironment(ctx); err != nil { + return errors.NewE(err) } - c, err := d.findConfig(ctx, namespace, name) + uc, err := d.configRepo.Patch( + ctx, + ctx.DBFilters().Add(fields.MetadataName, name), + common.PatchForMarkDeletion(), + ) if err != nil { - return err + return errors.NewE(err) } + d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeConfig, uc.Name, PublishUpdate) - c.SyncStatus = t.GetSyncStatusForDeletion(c.Generation) - if _, err := d.configRepo.UpdateById(ctx, c.Id, c); err != nil { - return err + if err := d.deleteK8sResource(ctx, uc.ProjectName, &uc.ConfigMap); err != nil { + if errors.Is(err, ErrNoClusterAttached) { + return d.configRepo.DeleteById(ctx, uc.Id) + } + return errors.NewE(err) } - - return d.deleteK8sResource(ctx, &c.Config) + return nil } -func (d *domain) OnApplyConfigError(ctx ConsoleContext, errMsg, namespace, name string) error { - c, err2 := d.findConfig(ctx, namespace, name) - if err2 != nil { - return err2 +func (d *domain) OnConfigApplyError(ctx ResourceContext, errMsg, name string, opts UpdateAndDeleteOpts) error { + uc, err := d.configRepo.Patch( + ctx, + ctx.DBFilters().Add(fields.MetadataName, name), + common.PatchForErrorFromAgent( + errMsg, + common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + }, + ), + ) + if err != nil { + return errors.NewE(err) } - c.SyncStatus.Error = &errMsg - _, err := d.configRepo.UpdateById(ctx, c.Id, c) - return err + d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeConfig, uc.Name, PublishDelete) + return nil } -func (d *domain) OnDeleteConfigMessage(ctx ConsoleContext, config entities.Config) error { - a, err := d.findConfig(ctx, config.Namespace, config.Name) +func (d *domain) OnConfigDeleteMessage(ctx ResourceContext, config entities.Config) error { + err := d.configRepo.DeleteOne(ctx, ctx.DBFilters().Add(fields.MetadataName, config.Name)) if err != nil { - return err + return errors.NewE(err) } - - return d.configRepo.DeleteById(ctx, a.Id) + d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeConfig, config.Name, PublishDelete) + return nil } -func (d *domain) OnUpdateConfigMessage(ctx ConsoleContext, config entities.Config) error { - c, err := d.findConfig(ctx, config.Namespace, config.Name) +func (d *domain) OnConfigUpdateMessage(ctx ResourceContext, configIn entities.Config, status types.ResourceStatus, opts UpdateAndDeleteOpts) error { + xconfig, err := d.findConfig(ctx, configIn.Name) if err != nil { - return err + return errors.NewE(err) + } + + if xconfig == nil { + return errors.Newf("no config found") } - c.Status = config.Status - c.SyncStatus.Error = nil - c.SyncStatus.LastSyncedAt = time.Now() - c.SyncStatus.Generation = config.Generation - c.SyncStatus.State = t.ParseSyncState(config.Status.IsReady) + recordVersion, err := d.MatchRecordVersion(configIn.Annotations, xconfig.RecordVersion) + if err != nil { + return d.resyncK8sResource(ctx, xconfig.ProjectName, xconfig.SyncStatus.Action, &xconfig.ConfigMap, xconfig.RecordVersion) + } - _, err = d.configRepo.UpdateById(ctx, c.Id, c) - return err + uc, err := d.configRepo.PatchById(ctx, xconfig.Id, common.PatchForSyncFromAgent(&configIn, recordVersion, status, common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + })) + d.resourceEventPublisher.PublishResourceEvent(ctx, uc.GetResourceType(), uc.GetName(), PublishUpdate) + return errors.NewE(err) } -func (d *domain) ResyncConfig(ctx ConsoleContext, namespace, name string) error { - if err := d.canMutateResourcesInWorkspace(ctx, namespace); err != nil { - return err +func (d *domain) ResyncConfig(ctx ResourceContext, name string) error { + if err := d.canMutateResourcesInEnvironment(ctx); err != nil { + return errors.NewE(err) } - c, err := d.findConfig(ctx, namespace, name) + cfg, err := d.findConfig(ctx, name) if err != nil { - return err + return errors.NewE(err) } - return d.resyncK8sResource(ctx, c.SyncStatus.Action, &c.Config) + return d.resyncK8sResource(ctx, cfg.ProjectName, cfg.SyncStatus.Action, &cfg.ConfigMap, cfg.RecordVersion) } diff --git a/apps/console/internal/domain/domain.go b/apps/console/internal/domain/domain.go index 14e2ebfae..4aa0fa9d4 100644 --- a/apps/console/internal/domain/domain.go +++ b/apps/console/internal/domain/domain.go @@ -1,48 +1,72 @@ package domain import ( + "context" "encoding/json" "fmt" + "strconv" - t "github.com/kloudlite/operator/agent/types" - "github.com/kloudlite/operator/pkg/kubectl" + "github.com/kloudlite/api/pkg/kv" + + "github.com/kloudlite/api/pkg/logging" + + "github.com/kloudlite/api/pkg/errors" + + "github.com/kloudlite/api/common" + + "github.com/kloudlite/api/pkg/messaging" + msgTypes "github.com/kloudlite/api/pkg/messaging/types" + "github.com/kloudlite/api/pkg/types" + + "github.com/kloudlite/api/constants" + + t "github.com/kloudlite/api/apps/tenant-agent/types" "go.uber.org/fx" "sigs.k8s.io/controller-runtime/pkg/client" - "kloudlite.io/apps/console/internal/domain/entities" - "kloudlite.io/apps/console/internal/env" - iamT "kloudlite.io/apps/iam/types" - "kloudlite.io/common" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/iam" - fn "kloudlite.io/pkg/functions" - "kloudlite.io/pkg/k8s" - "kloudlite.io/pkg/redpanda" - "kloudlite.io/pkg/repos" - types "kloudlite.io/pkg/types" + "github.com/kloudlite/api/apps/console/internal/entities" + "github.com/kloudlite/api/apps/console/internal/env" + iamT "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/infra" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/k8s" + "github.com/kloudlite/api/pkg/repos" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" ) +type MessageDispatcher messaging.Producer + type domain struct { - k8sExtendedClient k8s.ExtendedK8sClient - k8sYamlClient *kubectl.YAMLClient + k8sClient k8s.Client + logger logging.Logger + + producer MessageDispatcher - producer redpanda.Producer + iamClient iam.IAMClient + infraClient infra.InfraClient - iamClient iam.IAMClient + projectRepo repos.DbRepo[*entities.Project] + environmentRepo repos.DbRepo[*entities.Environment] + vpnDeviceRepo repos.DbRepo[*entities.ConsoleVPNDevice] - projectRepo repos.DbRepo[*entities.Project] - workspaceRepo repos.DbRepo[*entities.Workspace] - appRepo repos.DbRepo[*entities.App] - configRepo repos.DbRepo[*entities.Config] - secretRepo repos.DbRepo[*entities.Secret] - routerRepo repos.DbRepo[*entities.Router] - msvcRepo repos.DbRepo[*entities.MSvc] - mresRepo repos.DbRepo[*entities.MRes] + appRepo repos.DbRepo[*entities.App] + configRepo repos.DbRepo[*entities.Config] + secretRepo repos.DbRepo[*entities.Secret] + routerRepo repos.DbRepo[*entities.Router] + mresRepo repos.DbRepo[*entities.ManagedResource] + pullSecretsRepo repos.DbRepo[*entities.ImagePullSecret] envVars *env.Env + + resourceEventPublisher ResourceEventPublisher + consoleCacheStore kv.BinaryDataRepo + resourceMappingRepo repos.DbRepo[*entities.ResourceMapping] + pmsRepo repos.DbRepo[*entities.ProjectManagedService] } func errAlreadyMarkedForDeletion(label, namespace, name string) error { - return fmt.Errorf( + return errors.Newf( "%s (namespace=%s, name=%s) already marked for deletion", label, namespace, @@ -50,205 +74,474 @@ func errAlreadyMarkedForDeletion(label, namespace, name string) error { ) } -func (d *domain) applyK8sResource(ctx ConsoleContext, obj client.Object) error { +var ErrNoClusterAttached = errors.New("cluster not attached") + +func addTrackingId(obj client.Object, id repos.ID) { + ann := obj.GetAnnotations() + if ann == nil { + ann = make(map[string]string, 1) + } + ann[constants.ObservabilityTrackingKey] = string(id) + obj.SetAnnotations(ann) +} + +type K8sContext interface { + context.Context + GetAccountName() string +} + +func (d *domain) applyK8sResourceOnCluster(ctx K8sContext, clusterName string, obj client.Object, recordVersion int) error { + + if clusterName == "" { + d.logger.Infof("skipping apply of k8s resource %s/%s, cluster name not provided", obj.GetNamespace(), obj.GetName()) + return nil + } + + if obj.GetObjectKind().GroupVersionKind().Empty() { + return errors.Newf("object GVK is not set, can not apply") + } + + ann := obj.GetAnnotations() + if ann == nil { + ann = make(map[string]string, 1) + } + ann[constants.RecordVersionKey] = fmt.Sprintf("%d", recordVersion) + obj.SetAnnotations(ann) + m, err := fn.K8sObjToMap(obj) if err != nil { - return err + return errors.NewE(err) } b, err := json.Marshal(t.AgentMessage{ - AccountName: ctx.AccountName, - ClusterName: ctx.ClusterName, + AccountName: ctx.GetAccountName(), + ClusterName: clusterName, Action: t.ActionApply, Object: m, }) if err != nil { - return err + return errors.NewE(err) } - _, err = d.producer.Produce( - ctx, - common.GetKafkaTopicName(ctx.AccountName, ctx.ClusterName), - obj.GetNamespace(), - b, - ) - return err + subject := common.GetTenantClusterMessagingTopic(ctx.GetAccountName(), clusterName) + + err = d.producer.Produce(ctx, msgTypes.ProduceMsg{ + Subject: subject, + Payload: b, + }) + return errors.NewE(err) } -func (d *domain) deleteK8sResource(ctx ConsoleContext, obj client.Object) error { +func (d *domain) applyK8sResource(ctx K8sContext, projectName string, obj client.Object, recordVersion int) error { + clusterName, err := d.getClusterAttachedToProject(ctx, projectName) + if err != nil { + return errors.NewE(err) + } + + if clusterName == nil || *clusterName == "" { + d.logger.Infof("skipping apply of k8s resource %s/%s, cluster name not provided", obj.GetNamespace(), obj.GetName()) + return nil + } + + if obj.GetObjectKind().GroupVersionKind().Empty() { + return errors.Newf("object GVK is not set, can not apply") + } + + ann := obj.GetAnnotations() + if ann == nil { + ann = make(map[string]string, 1) + } + ann[constants.RecordVersionKey] = fmt.Sprintf("%d", recordVersion) + obj.SetAnnotations(ann) + m, err := fn.K8sObjToMap(obj) if err != nil { - return err + return errors.NewE(err) } b, err := json.Marshal(t.AgentMessage{ - AccountName: ctx.AccountName, - ClusterName: ctx.ClusterName, + AccountName: ctx.GetAccountName(), + ClusterName: *clusterName, + Action: t.ActionApply, + Object: m, + }) + if err != nil { + return errors.NewE(err) + } + + subject := common.GetTenantClusterMessagingTopic(ctx.GetAccountName(), *clusterName) + + err = d.producer.Produce(ctx, msgTypes.ProduceMsg{ + Subject: subject, + Payload: b, + }) + return errors.NewE(err) +} + +func (d *domain) restartK8sResource(ctx K8sContext, projectName string, namespace string, labels map[string]string) error { + clusterName, err := d.getClusterAttachedToProject(ctx, projectName) + if err != nil { + return errors.NewE(err) + } + + if clusterName == nil || *clusterName == "" { + return nil + } + + obj := unstructured.Unstructured{ + Object: map[string]any{ + "metadata": map[string]any{ + "namespace": namespace, + "labels": labels, + }, + }, + } + + b, err := json.Marshal(t.AgentMessage{ + AccountName: ctx.GetAccountName(), + ClusterName: *clusterName, + Action: t.ActionRestart, + Object: obj.Object, + }) + if err != nil { + return errors.NewE(err) + } + + subject := common.GetTenantClusterMessagingTopic(ctx.GetAccountName(), *clusterName) + + err = d.producer.Produce(ctx, msgTypes.ProduceMsg{ + Subject: subject, + Payload: b, + }) + return errors.NewE(err) +} + +func (d *domain) deleteK8sResourceOfCluster(ctx K8sContext, clusterName string, obj client.Object) error { + if obj.GetObjectKind().GroupVersionKind().Empty() { + return errors.Newf("object GVK is not set, can not apply") + } + + m, err := fn.K8sObjToMap(obj) + if err != nil { + return errors.NewE(err) + } + b, err := json.Marshal(t.AgentMessage{ + AccountName: ctx.GetAccountName(), + ClusterName: clusterName, Action: t.ActionDelete, Object: m, }) if err != nil { - return err + return errors.NewE(err) } - _, err = d.producer.Produce( - ctx, - common.GetKafkaTopicName(ctx.AccountName, ctx.ClusterName), - obj.GetNamespace(), - b, - ) - return err + + err = d.producer.Produce(ctx, msgTypes.ProduceMsg{ + Subject: common.GetTenantClusterMessagingTopic(ctx.GetAccountName(), clusterName), + Payload: b, + }) + + return errors.NewE(err) +} + +func (d *domain) deleteK8sResource(ctx K8sContext, projectName string, obj client.Object) error { + clusterName, err := d.getClusterAttachedToProject(ctx, projectName) + if err != nil { + return errors.NewE(err) + } + + if clusterName == nil || *clusterName == "" { + d.logger.Infof("skipping delete of k8s resource %s/%s, cluster name not provided", obj.GetNamespace(), obj.GetName()) + return ErrNoClusterAttached + } + + if obj.GetObjectKind().GroupVersionKind().Empty() { + return errors.Newf("object GVK is not set, can not apply") + } + + m, err := fn.K8sObjToMap(obj) + if err != nil { + return errors.NewE(err) + } + b, err := json.Marshal(t.AgentMessage{ + AccountName: ctx.GetAccountName(), + ClusterName: *clusterName, + Action: t.ActionDelete, + Object: m, + }) + if err != nil { + return errors.NewE(err) + } + + err = d.producer.Produce(ctx, msgTypes.ProduceMsg{ + Subject: common.GetTenantClusterMessagingTopic(ctx.GetAccountName(), *clusterName), + Payload: b, + }) + + return errors.NewE(err) } -func (d *domain) resyncK8sResource(ctx ConsoleContext, action types.SyncAction, obj client.Object) error { +func (d *domain) resyncK8sResource(ctx K8sContext, projectName string, action types.SyncAction, obj client.Object, rv int) error { switch action { case types.SyncActionApply: { - return d.applyK8sResource(ctx, obj) + return d.applyK8sResource(ctx, projectName, obj, rv) } case types.SyncActionDelete: { - return d.deleteK8sResource(ctx, obj) + return d.deleteK8sResource(ctx, projectName, obj) } default: { - return fmt.Errorf("unknown sync action %q", action) + return errors.Newf("unknown sync action %q", action) } } } -func (d *domain) canMutateResourcesInProject(ctx ConsoleContext, targetNamespace string) error { - prj, err := d.findProjectByTargetNs(ctx, targetNamespace) +func (d *domain) parseRecordVersionFromAnnotations(annotations map[string]string) (int, error) { + annotatedVersion, ok := annotations[constants.RecordVersionKey] + if !ok { + return 0, errors.Newf("no annotation with record version key (%s), found on the resource", constants.RecordVersionKey) + } + + annVersion, err := strconv.ParseInt(annotatedVersion, 10, 32) if err != nil { - return err + return 0, errors.NewE(err) } + return int(annVersion), nil +} + +func (d *domain) MatchRecordVersion(annotations map[string]string, rv int) (int, error) { + annVersion, err := d.parseRecordVersionFromAnnotations(annotations) + if err != nil { + return -1, errors.NewE(err) + } + + if annVersion != rv { + return -1, errors.Newf("record version mismatch, expected %d, got %d", rv, annVersion) + } + + return annVersion, nil +} + +func (d *domain) canMutateResourcesInProject(ctx ConsoleContext, projectName string) error { co, err := d.iamClient.Can(ctx, &iam.CanIn{ UserId: string(ctx.UserId), ResourceRefs: []string{ iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), - iamT.NewResourceRef(ctx.AccountName, iamT.ResourceProject, prj.Name), + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceProject, projectName), }, Action: string(iamT.MutateResourcesInProject), }) if err != nil { - return err + return errors.NewE(err) } if !co.Status { - return fmt.Errorf("unauthorized to mutate resources in project %q", prj.Name) + return errors.Newf("unauthorized to mutate resources in project (%s)", projectName) } return nil } -func (d *domain) canMutateResourcesInWorkspace(ctx ConsoleContext, targetNamespace string) error { - ws, err := d.findWorkspaceByTargetNs(ctx, targetNamespace) +func (d *domain) canReadResourcesInProject(ctx ConsoleContext, projectName string) error { + co, err := d.iamClient.Can(ctx, &iam.CanIn{ + UserId: string(ctx.UserId), + ResourceRefs: []string{ + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceProject, projectName), + }, + Action: string(iamT.GetProject), + }) if err != nil { - return err + return errors.NewE(err) } + if !co.Status { + return errors.Newf("unauthorized to read resources in project (%s)", projectName) + } + return nil +} - wsp, err := d.findWorkspace(ctx, ws.Namespace, ws.Name) +func (d *domain) canMutateSecretsInAccount(ctx context.Context, userId string, accountName string) error { + co, err := d.iamClient.Can(ctx, &iam.CanIn{ + UserId: userId, + ResourceRefs: []string{ + iamT.NewResourceRef(accountName, iamT.ResourceAccount, accountName), + }, + Action: string(iamT.CreateSecretsInAccount), + }) if err != nil { - return err + return errors.NewE(err) + } + if !co.Status { + return errors.Newf("unauthorized to mutate secrets in account %q", accountName) } + return nil +} +func (d *domain) canReadSecretsFromAccount(ctx context.Context, userId string, accountName string) error { co, err := d.iamClient.Can(ctx, &iam.CanIn{ - UserId: string(ctx.UserId), + UserId: userId, ResourceRefs: []string{ - iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), - iamT.NewResourceRef(ctx.AccountName, iamT.ResourceProject, wsp.Spec.ProjectName), + iamT.NewResourceRef(accountName, iamT.ResourceAccount, accountName), }, - Action: string(iamT.MutateResourcesInProject), + Action: string(iamT.ReadSecretsFromAccount), }) if err != nil { - return err + return errors.NewE(err) } if !co.Status { - return fmt.Errorf("unauthorized to mutate resources in workspace %q", wsp.Name) + return errors.Newf("unauthorized to read secrets from account %q", accountName) } return nil } -func (d *domain) canReadResourcesInWorkspace(ctx ConsoleContext, targetNamespace string) error { - ws, err := d.findWorkspaceByTargetNs(ctx, targetNamespace) +func (d *domain) checkProjectAccess(ctx ConsoleContext, projectName string, action iamT.Action) error { + co, err := d.iamClient.Can(ctx, &iam.CanIn{ + UserId: string(ctx.UserId), + ResourceRefs: []string{ + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceProject, projectName), + }, + Action: string(action), + }) if err != nil { - return err + return errors.NewE(err) } + if !co.Status { + return errors.Newf("unauthorized to access project %q", projectName) + } + return nil +} + +func (d *domain) checkEnvironmentAccess(ctx ResourceContext, action iamT.Action) error { co, err := d.iamClient.Can(ctx, &iam.CanIn{ UserId: string(ctx.UserId), ResourceRefs: []string{ iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), - iamT.NewResourceRef(ctx.AccountName, iamT.ResourceProject, ws.Spec.ProjectName), + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceProject, ctx.ProjectName), + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceEnvironment, ctx.EnvironmentName), }, - Action: string(iamT.GetProject), + Action: string(action), }) if err != nil { - return err + return errors.NewE(err) } + if !co.Status { - return fmt.Errorf("unauthorized to read resources in project %q", ws.Spec.ProjectName) + return errors.Newf("unauthorized to access environment %q", ctx.EnvironmentName) } return nil } -func (d *domain) canReadResourcesInProject(ctx ConsoleContext, targetNamespace string) error { - prj, err := d.findProjectByTargetNs(ctx, targetNamespace) +func (d *domain) canMutateResourcesInEnvironment(ctx ResourceContext) error { + return d.checkEnvironmentAccess(ctx, iamT.MutateResourcesInEnvironment) +} + +func (d *domain) canReadResourcesInEnvironment(ctx ResourceContext) error { + return d.checkEnvironmentAccess(ctx, iamT.ReadResourcesInEnvironment) +} + +func (d *domain) canPerformActionInAccount(ctx ConsoleContext, action iamT.Action) error { + co, err := d.iamClient.Can(ctx, &iam.CanIn{ + UserId: string(ctx.UserId), + ResourceRefs: []string{ + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), + }, + Action: string(action), + }) if err != nil { - return err + return errors.NewE(err) } + if !co.Status { + return errors.Newf("unauthorized to perform action %q in account %q", action, ctx.AccountName) + } + return nil +} +func (d *domain) canPerformActionInDevice(ctx ConsoleContext, action iamT.Action, devName string) error { co, err := d.iamClient.Can(ctx, &iam.CanIn{ UserId: string(ctx.UserId), ResourceRefs: []string{ - iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), - iamT.NewResourceRef(ctx.AccountName, iamT.ResourceProject, prj.Name), + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceConsoleVPNDevice, devName), }, - Action: string(iamT.GetProject), + Action: string(action), }) if err != nil { - return err + return errors.NewE(err) } if !co.Status { - return fmt.Errorf("unauthorized to read resources in project %q", prj.Name) + return errors.Newf("unauthorized to perform action %q in device %q", action, devName) + } + return nil +} + +func cloneResource[T repos.Entity](ctx ResourceContext, d *domain, repoName repos.DbRepo[T], resource T, obj client.Object) error { + _, err := repoName.Create(ctx, resource) + if err != nil { + if !repoName.ErrAlreadyExists(err) { + return errors.NewE(err) + } + } + + if err := d.applyK8sResource(ctx, ctx.ProjectName, obj, 0); err != nil { + return errors.NewE(err) } return nil } +type ConsoleCacheStore kv.BinaryDataRepo + var Module = fx.Module("domain", fx.Provide(func( - k8sYamlClient *kubectl.YAMLClient, - k8sExtendedClient k8s.ExtendedK8sClient, + k8sClient k8s.Client, - producer redpanda.Producer, + producer MessageDispatcher, iamClient iam.IAMClient, + infraClient infra.InfraClient, projectRepo repos.DbRepo[*entities.Project], - environmentRepo repos.DbRepo[*entities.Workspace], + environmentRepo repos.DbRepo[*entities.Environment], appRepo repos.DbRepo[*entities.App], configRepo repos.DbRepo[*entities.Config], secretRepo repos.DbRepo[*entities.Secret], routerRepo repos.DbRepo[*entities.Router], - msvcRepo repos.DbRepo[*entities.MSvc], - mresRepo repos.DbRepo[*entities.MRes], + mresRepo repos.DbRepo[*entities.ManagedResource], + ipsRepo repos.DbRepo[*entities.ImagePullSecret], + pmsRepo repos.DbRepo[*entities.ProjectManagedService], + resourceMappingRepo repos.DbRepo[*entities.ResourceMapping], + vpnDeviceRepo repos.DbRepo[*entities.ConsoleVPNDevice], + + logger logging.Logger, + resourceEventPublisher ResourceEventPublisher, ev *env.Env, + + consoleCacheStore ConsoleCacheStore, ) Domain { return &domain{ - k8sExtendedClient: k8sExtendedClient, - k8sYamlClient: k8sYamlClient, + k8sClient: k8sClient, producer: producer, - iamClient: iamClient, + iamClient: iamClient, + infraClient: infraClient, + logger: logger, - projectRepo: projectRepo, - workspaceRepo: environmentRepo, - appRepo: appRepo, - configRepo: configRepo, - routerRepo: routerRepo, - secretRepo: secretRepo, - msvcRepo: msvcRepo, - mresRepo: mresRepo, + projectRepo: projectRepo, + environmentRepo: environmentRepo, + appRepo: appRepo, + configRepo: configRepo, + routerRepo: routerRepo, + secretRepo: secretRepo, + mresRepo: mresRepo, + pullSecretsRepo: ipsRepo, + resourceMappingRepo: resourceMappingRepo, + vpnDeviceRepo: vpnDeviceRepo, envVars: ev, + + resourceEventPublisher: resourceEventPublisher, + consoleCacheStore: consoleCacheStore, + pmsRepo: pmsRepo, } }), ) diff --git a/apps/console/internal/domain/entities/app.go b/apps/console/internal/domain/entities/app.go deleted file mode 100644 index dfd9349ee..000000000 --- a/apps/console/internal/domain/entities/app.go +++ /dev/null @@ -1,33 +0,0 @@ -package entities - -import ( - crdsv1 "github.com/kloudlite/operator/apis/crds/v1" - "kloudlite.io/pkg/repos" - t "kloudlite.io/pkg/types" -) - -type App struct { - repos.BaseEntity `json:",inline"` - crdsv1.App `json:",inline"` - AccountName string `json:"accountName"` - ClusterName string `json:"clusterName"` - SyncStatus t.SyncStatus `json:"syncStatus"` -} - -var AppIndexes = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: "id", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "metadata.name", Value: repos.IndexAsc}, - {Key: "metadata.namespace", Value: repos.IndexAsc}, - {Key: "clusterName", Value: repos.IndexAsc}, - {Key: "accountName", Value: repos.IndexAsc}, - }, - Unique: true, - }, -} diff --git a/apps/console/internal/domain/entities/config.go b/apps/console/internal/domain/entities/config.go deleted file mode 100644 index 584494e0c..000000000 --- a/apps/console/internal/domain/entities/config.go +++ /dev/null @@ -1,33 +0,0 @@ -package entities - -import ( - crdsv1 "github.com/kloudlite/operator/apis/crds/v1" - "kloudlite.io/pkg/repos" - t "kloudlite.io/pkg/types" -) - -type Config struct { - repos.BaseEntity `json:",inline"` - crdsv1.Config `json:",inline"` - AccountName string `json:"accountName"` - ClusterName string `json:"clusterName"` - SyncStatus t.SyncStatus `json:"syncStatus"` -} - -var ConfigIndexes = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: "id", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "metadata.name", Value: repos.IndexAsc}, - {Key: "metadata.namespace", Value: repos.IndexAsc}, - {Key: "clusterName", Value: repos.IndexAsc}, - {Key: "accountName", Value: repos.IndexAsc}, - }, - Unique: true, - }, -} diff --git a/apps/console/internal/domain/entities/mres.go b/apps/console/internal/domain/entities/mres.go deleted file mode 100644 index e9e6632c5..000000000 --- a/apps/console/internal/domain/entities/mres.go +++ /dev/null @@ -1,37 +0,0 @@ -package entities - -import ( - crdsv1 "github.com/kloudlite/operator/apis/crds/v1" - "kloudlite.io/pkg/repos" - t "kloudlite.io/pkg/types" -) - -type MRes struct { - repos.BaseEntity `json:",inline"` - crdsv1.ManagedResource `json:",inline"` - AccountName string `json:"accountName"` - ClusterName string `json:"clusterName"` - SyncStatus t.SyncStatus `json:"syncStatus"` -} - -var MresIndexes = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: "id", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "metadata.name", Value: repos.IndexAsc}, - {Key: "metadata.namespace", Value: repos.IndexAsc}, - {Key: "clusterName", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "accountName", Value: repos.IndexAsc}, - }, - }, -} diff --git a/apps/console/internal/domain/entities/msvc.go b/apps/console/internal/domain/entities/msvc.go deleted file mode 100644 index 439fc41f0..000000000 --- a/apps/console/internal/domain/entities/msvc.go +++ /dev/null @@ -1,37 +0,0 @@ -package entities - -import ( - crdsv1 "github.com/kloudlite/operator/apis/crds/v1" - "kloudlite.io/pkg/repos" - t "kloudlite.io/pkg/types" -) - -type MSvc struct { - repos.BaseEntity `json:",inline"` - crdsv1.ManagedService `json:",inline"` - AccountName string `json:"accountName"` - ClusterName string `json:"clusterName"` - SyncStatus t.SyncStatus `json:"syncStatus"` -} - -var MsvcIndexes = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: "id", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "metadata.name", Value: repos.IndexAsc}, - {Key: "metadata.namespace", Value: repos.IndexAsc}, - {Key: "clusterName", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "accountName", Value: repos.IndexAsc}, - }, - }, -} diff --git a/apps/console/internal/domain/entities/project.go b/apps/console/internal/domain/entities/project.go deleted file mode 100644 index e72bfbabb..000000000 --- a/apps/console/internal/domain/entities/project.go +++ /dev/null @@ -1,72 +0,0 @@ -package entities - -import ( - crdsv1 "github.com/kloudlite/operator/apis/crds/v1" - "kloudlite.io/pkg/repos" - t "kloudlite.io/pkg/types" -) - -type Project struct { - repos.BaseEntity `json:",inline"` - crdsv1.Project `json:",inline"` - AccountName string `json:"accountName"` - ClusterName string `json:"clusterName"` - SyncStatus t.SyncStatus `json:"syncStatus"` -} - -var ProjectIndexes = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: "id", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "metadata.name", Value: repos.IndexAsc}, - {Key: "clusterName", Value: repos.IndexAsc}, - {Key: "accountName", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "clusterName", Value: repos.IndexAsc}, - {Key: "accountName", Value: repos.IndexAsc}, - {Key: "spec.targetNamespace", Value: repos.IndexAsc}, - }, - Unique: true, - }, -} - -type Workspace struct { - repos.BaseEntity `json:",inline"` - crdsv1.Env `json:",inline"` - AccountName string `json:"accountName"` - ClusterName string `json:"clusterName"` - SyncStatus t.SyncStatus `json:"syncStatus"` -} - -var WorkspaceIndexes = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: "id", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "metadata.name", Value: repos.IndexAsc}, - {Key: "metadata.namespace", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "clusterName", Value: repos.IndexAsc}, - {Key: "accountName", Value: repos.IndexAsc}, - {Key: "spec.targetNamespace", Value: repos.IndexAsc}, - }, - Unique: true, - }, -} diff --git a/apps/console/internal/domain/entities/router.go b/apps/console/internal/domain/entities/router.go deleted file mode 100644 index 5a9b0c968..000000000 --- a/apps/console/internal/domain/entities/router.go +++ /dev/null @@ -1,33 +0,0 @@ -package entities - -import ( - crdsv1 "github.com/kloudlite/operator/apis/crds/v1" - "kloudlite.io/pkg/repos" - t "kloudlite.io/pkg/types" -) - -type Router struct { - repos.BaseEntity `json:",inline"` - crdsv1.Router `json:",inline"` - AccountName string `json:"accountName"` - ClusterName string `json:"clusterName"` - SyncStatus t.SyncStatus `json:"syncStatus"` -} - -var RouterIndexes = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: "id", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "metadata.name", Value: repos.IndexAsc}, - {Key: "metadata.namespace", Value: repos.IndexAsc}, - {Key: "accountName", Value: repos.IndexAsc}, - {Key: "clusterName", Value: repos.IndexAsc}, - }, - Unique: true, - }, -} diff --git a/apps/console/internal/domain/entities/secret.go b/apps/console/internal/domain/entities/secret.go deleted file mode 100644 index 526f0d079..000000000 --- a/apps/console/internal/domain/entities/secret.go +++ /dev/null @@ -1,33 +0,0 @@ -package entities - -import ( - crdsv1 "github.com/kloudlite/operator/apis/crds/v1" - "kloudlite.io/pkg/repos" - t "kloudlite.io/pkg/types" -) - -type Secret struct { - repos.BaseEntity `json:",inline"` - crdsv1.Secret `json:",inline"` - AccountName string `json:"accountName"` - ClusterName string `json:"clusterName"` - SyncStatus t.SyncStatus `json:"syncStatus"` -} - -var SecretIndexes = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: "id", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "metadata.name", Value: repos.IndexAsc}, - {Key: "metadata.namespace", Value: repos.IndexAsc}, - {Key: "accountName", Value: repos.IndexAsc}, - {Key: "clusterName", Value: repos.IndexAsc}, - }, - Unique: true, - }, -} diff --git a/apps/console/internal/domain/environment.go b/apps/console/internal/domain/environment.go new file mode 100644 index 000000000..669b8d098 --- /dev/null +++ b/apps/console/internal/domain/environment.go @@ -0,0 +1,579 @@ +package domain + +import ( + "crypto/md5" + "encoding/hex" + "fmt" + + "github.com/kloudlite/api/common/fields" + crdsv1 "github.com/kloudlite/operator/apis/crds/v1" + + iamT "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/operator/operators/resource-watcher/types" + + "github.com/kloudlite/api/constants" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/kloudlite/api/apps/console/internal/entities" + fc "github.com/kloudlite/api/apps/console/internal/entities/field-constants" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" +) + +func (d *domain) findEnvironment(ctx ConsoleContext, projectName string, name string) (*entities.Environment, error) { + env, err := d.environmentRepo.FindOne(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.ProjectName: projectName, + fields.MetadataName: name, + }) + if err != nil { + return nil, errors.NewE(err) + } + if env == nil { + return nil, errors.Newf("no environment with name (%s) and project (%s)", name, projectName) + } + return env, nil +} + +func (d *domain) envTargetNamespace(ctx ConsoleContext, projectName string, envName string) (string, error) { + key := fmt.Sprintf("environment-namespace.%s/%s/%s", ctx.AccountName, projectName, envName) + b, err := d.consoleCacheStore.Get(ctx, key) + if err != nil { + if d.consoleCacheStore.ErrKeyNotFound(err) { + env, err := d.findEnvironment(ctx, projectName, envName) + if err != nil { + return "", err + } + defer func() { + if err := d.consoleCacheStore.Set(ctx, key, []byte(env.Spec.TargetNamespace)); err != nil { + d.logger.Errorf(err, "while caching environment target namespace") + } + }() + return env.Spec.TargetNamespace, nil + } + } + + return string(b), nil +} + +func (d *domain) GetEnvironment(ctx ConsoleContext, projectName string, name string) (*entities.Environment, error) { + if err := d.canReadResourcesInProject(ctx, projectName); err != nil { + return nil, errors.NewE(err) + } + + return d.findEnvironment(ctx, projectName, name) +} + +func (d *domain) ListEnvironments(ctx ConsoleContext, projectName string, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.Environment], error) { + if err := d.canReadResourcesInProject(ctx, projectName); err != nil { + return nil, errors.NewE(err) + } + + filter := repos.Filter{ + fields.AccountName: ctx.AccountName, + fc.EnvironmentSpecProjectName: projectName, + } + + return d.environmentRepo.FindPaginated(ctx, d.environmentRepo.MergeMatchFilters(filter, search), pq) +} + +func (d *domain) findEnvironmentByTargetNs(ctx ConsoleContext, targetNs string) (*entities.Environment, error) { + w, err := d.environmentRepo.FindOne(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fc.EnvironmentSpecTargetNamespace: targetNs, + }) + if err != nil { + return nil, errors.NewE(err) + } + + if w == nil { + return nil, errors.Newf("no workspace found for target namespace %q", targetNs) + } + + return w, nil +} + +func (d *domain) CreateEnvironment(ctx ConsoleContext, projectName string, env entities.Environment) (*entities.Environment, error) { + project, err := d.findProject(ctx, projectName) + if err != nil { + return nil, errors.NewE(err) + } + + if err := d.canMutateResourcesInProject(ctx, project.Name); err != nil { + return nil, errors.NewE(err) + } + + env.ProjectName = project.Name + env.Namespace = project.Spec.TargetNamespace + + env.EnsureGVK() + if err := d.k8sClient.ValidateObject(ctx, &env.Environment); err != nil { + return nil, errors.NewE(err) + } + + env.IncrementRecordVersion() + + if env.Spec.TargetNamespace == "" { + env.Spec.TargetNamespace = d.getEnvironmentTargetNamespace(projectName, env.Name) + } + + if env.Spec.Routing == nil { + env.Spec.Routing = &crdsv1.EnvironmentRouting{ + Mode: crdsv1.EnvironmentRoutingModePrivate, + } + } + + env.CreatedBy = common.CreatedOrUpdatedBy{ + UserId: ctx.UserId, + UserName: ctx.UserName, + UserEmail: ctx.UserEmail, + } + env.LastUpdatedBy = env.CreatedBy + + env.AccountName = ctx.AccountName + env.SyncStatus = t.GenSyncStatus(t.SyncActionApply, env.RecordVersion) + + if _, err := d.upsertEnvironmentResourceMapping(ResourceContext{ConsoleContext: ctx, ProjectName: env.ProjectName, EnvironmentName: env.Name}, &env); err != nil { + return nil, errors.NewE(err) + } + + nenv, err := d.environmentRepo.Create(ctx, &env) + if err != nil { + if d.environmentRepo.ErrAlreadyExists(err) { + // TODO: better insights into error, when it is being caused by duplicated indexes + return nil, errors.NewE(err) + } + return nil, errors.NewE(err) + } + + d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeEnvironment, nenv.Name, PublishAdd) + + if _, err := d.iamClient.AddMembership(ctx, &iam.AddMembershipIn{ + UserId: string(ctx.UserId), + ResourceType: string(iamT.ResourceEnvironment), + ResourceRef: iamT.NewResourceRef(ctx.AccountName, iamT.ResourceEnvironment, nenv.Name), + Role: string(iamT.RoleResourceOwner), + }); err != nil { + d.logger.Errorf(err, "error while adding membership") + } + + if err := d.applyK8sResource(ctx, nenv.ProjectName, &nenv.Environment, nenv.RecordVersion); err != nil { + return nil, errors.NewE(err) + } + + return nenv, nil +} + +func (d *domain) CloneEnvironment(ctx ConsoleContext, projectName string, sourceEnvName string, destinationEnvName string, displayName string, envRoutingMode crdsv1.EnvironmentRoutingMode) (*entities.Environment, error) { + if err := d.canMutateResourcesInProject(ctx, projectName); err != nil { + return nil, errors.NewE(err) + } + + sourceEnv, err := d.findEnvironment(ctx, projectName, sourceEnvName) + if err != nil { + return nil, errors.NewE(err) + } + + destEnv := &entities.Environment{ + Environment: crdsv1.Environment{ + TypeMeta: sourceEnv.TypeMeta, + ObjectMeta: metav1.ObjectMeta{ + Name: destinationEnvName, + Namespace: sourceEnv.Namespace, + }, + Spec: crdsv1.EnvironmentSpec{ + ProjectName: projectName, + TargetNamespace: fmt.Sprintf("env-%s", destinationEnvName), + Routing: &crdsv1.EnvironmentRouting{ + Mode: envRoutingMode, + }, + }, + }, + AccountName: ctx.AccountName, + ProjectName: projectName, + ResourceMetadata: common.ResourceMetadata{ + DisplayName: displayName, + CreatedBy: common.CreatedOrUpdatedBy{ + UserId: ctx.UserId, + UserName: ctx.UserName, + UserEmail: ctx.UserEmail, + }, + LastUpdatedBy: common.CreatedOrUpdatedBy{ + UserId: ctx.UserId, + UserName: ctx.UserName, + UserEmail: ctx.UserEmail, + }, + }, + SyncStatus: t.GenSyncStatus(t.SyncActionApply, 0), + } + + if err := d.k8sClient.ValidateObject(ctx, &destEnv.Environment); err != nil { + return nil, errors.NewE(err) + } + + destEnv, err = d.environmentRepo.Create(ctx, destEnv) + if err != nil { + return nil, errors.NewE(err) + } + + if _, err := d.upsertEnvironmentResourceMapping(ResourceContext{ConsoleContext: ctx, ProjectName: sourceEnv.ProjectName, EnvironmentName: sourceEnv.Name}, sourceEnv); err != nil { + return nil, errors.NewE(err) + } + + if err := d.applyK8sResource(ctx, sourceEnv.ProjectName, &destEnv.Environment, destEnv.RecordVersion); err != nil { + return nil, errors.NewE(err) + } + + resCtx := ResourceContext{ + ConsoleContext: ctx, + ProjectName: sourceEnv.ProjectName, + EnvironmentName: destEnv.Name, + } + + filters := repos.Filter{ + fields.AccountName: resCtx.AccountName, + fields.ProjectName: resCtx.ProjectName, + fields.EnvironmentName: sourceEnvName, + } + + apps, err := d.appRepo.Find(ctx, repos.Query{ + Filter: filters, + Sort: nil, + }) + if err != nil { + return nil, errors.NewE(err) + } + + secrets, err := d.secretRepo.Find(ctx, repos.Query{ + Filter: filters, + Sort: nil, + }) + if err != nil { + return nil, errors.NewE(err) + } + configs, err := d.configRepo.Find(ctx, repos.Query{ + Filter: filters, + Sort: nil, + }) + if err != nil { + return nil, errors.NewE(err) + } + routers, err := d.routerRepo.Find(ctx, repos.Query{ + Filter: filters, + Sort: nil, + }) + if err != nil { + return nil, errors.NewE(err) + } + managedResources, err := d.mresRepo.Find(ctx, repos.Query{ + Filter: filters, + Sort: nil, + }) + if err != nil { + return nil, errors.NewE(err) + } + + resourceMetadata := func(dn string) common.ResourceMetadata { + return common.ResourceMetadata{ + DisplayName: fmt.Sprintf("clone of %s", dn), + CreatedBy: common.CreatedOrUpdatedBy{ + UserId: ctx.UserId, + UserName: ctx.UserName, + UserEmail: ctx.UserEmail, + }, + LastUpdatedBy: common.CreatedOrUpdatedBy{ + UserId: ctx.UserId, + UserName: ctx.UserName, + UserEmail: ctx.UserEmail, + }, + } + } + + objectMeta := func(sourceMeta metav1.ObjectMeta, namespace string) metav1.ObjectMeta { + sourceMeta.Namespace = namespace + return sourceMeta + } + + for i := range apps { + if _, err := d.createAndApplyApp(resCtx, &entities.App{ + App: crdsv1.App{ + TypeMeta: apps[i].TypeMeta, + ObjectMeta: objectMeta(apps[i].ObjectMeta, destEnv.Spec.TargetNamespace), + Spec: apps[i].Spec, + }, + AccountName: ctx.AccountName, + ProjectName: projectName, + EnvironmentName: destEnv.Name, + ResourceMetadata: resourceMetadata(apps[i].DisplayName), + SyncStatus: t.GenSyncStatus(t.SyncActionApply, 0), + }); err != nil { + return nil, err + } + } + + for i := range secrets { + if _, err := d.createAndApplySecret(resCtx, &entities.Secret{ + Secret: corev1.Secret{ + TypeMeta: secrets[i].TypeMeta, + ObjectMeta: objectMeta(secrets[i].ObjectMeta, destEnv.Spec.TargetNamespace), + Immutable: secrets[i].Immutable, + Data: secrets[i].Data, + StringData: secrets[i].StringData, + Type: secrets[i].Type, + }, + AccountName: ctx.AccountName, + ProjectName: projectName, + EnvironmentName: destEnv.Name, + ResourceMetadata: resourceMetadata(secrets[i].DisplayName), + }); err != nil { + return nil, err + } + } + + for i := range configs { + if _, err := d.createAndApplyConfig(resCtx, &entities.Config{ + ConfigMap: corev1.ConfigMap{ + TypeMeta: configs[i].TypeMeta, + ObjectMeta: objectMeta(configs[i].ObjectMeta, destEnv.Spec.TargetNamespace), + Immutable: configs[i].Immutable, + Data: configs[i].Data, + BinaryData: configs[i].BinaryData, + }, + AccountName: ctx.AccountName, + ProjectName: projectName, + EnvironmentName: destEnv.Name, + ResourceMetadata: resourceMetadata(configs[i].DisplayName), + }); err != nil { + return nil, err + } + } + + for i := range routers { + if _, err := d.createAndApplyRouter(resCtx, &entities.Router{ + Router: crdsv1.Router{ + TypeMeta: routers[i].TypeMeta, + ObjectMeta: objectMeta(routers[i].ObjectMeta, destEnv.Spec.TargetNamespace), + Spec: routers[i].Spec, + Enabled: routers[i].Enabled, + }, + AccountName: ctx.AccountName, + ProjectName: projectName, + EnvironmentName: destEnv.Name, + ResourceMetadata: resourceMetadata(routers[i].DisplayName), + }); err != nil { + return nil, err + } + } + + for i := range managedResources { + if _, err := d.createAndApplyManagedResource(resCtx, &entities.ManagedResource{ + ManagedResource: crdsv1.ManagedResource{ + TypeMeta: managedResources[i].TypeMeta, + ObjectMeta: objectMeta(managedResources[i].ObjectMeta, destEnv.Spec.TargetNamespace), + Spec: managedResources[i].Spec, + Enabled: managedResources[i].Enabled, + }, + AccountName: ctx.AccountName, + ProjectName: projectName, + EnvironmentName: destEnv.Name, + ResourceMetadata: resourceMetadata(managedResources[i].DisplayName), + }); err != nil { + return nil, err + } + } + + if _, err := d.iamClient.AddMembership(ctx, &iam.AddMembershipIn{ + UserId: string(ctx.UserId), + ResourceType: string(iamT.ResourceEnvironment), + ResourceRef: iamT.NewResourceRef(ctx.AccountName, iamT.ResourceEnvironment, destEnv.Spec.TargetNamespace), + Role: string(iamT.RoleResourceOwner), + }); err != nil { + d.logger.Errorf(err, "error while adding membership") + } + + return destEnv, nil +} + +func (d *domain) getEnvironmentTargetNamespace(projectName string, envName string) string { + envNamespace := fmt.Sprintf("env-%s-%s", projectName, envName) + hash := md5.Sum([]byte(envNamespace)) + return fmt.Sprintf("env-%s", hex.EncodeToString(hash[:])) +} + +func (d *domain) UpdateEnvironment(ctx ConsoleContext, projectName string, env entities.Environment) (*entities.Environment, error) { + if err := d.canMutateResourcesInProject(ctx, projectName); err != nil { + return nil, errors.NewE(err) + } + + env.Namespace = "trest" + + env.EnsureGVK() + if err := d.k8sClient.ValidateObject(ctx, &env.Environment); err != nil { + return nil, errors.NewE(err) + } + + patchForUpdate := common.PatchForUpdate( + ctx, + &env, + common.PatchOpts{ + XPatch: repos.Document{ + fc.EnvironmentSpec: env.Spec, + }, + }, + ) + + upEnv, err := d.environmentRepo.Patch( + ctx, + repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataName: env.Name, + }, + patchForUpdate, + ) + if err != nil { + return nil, errors.NewE(err) + } + d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeEnvironment, upEnv.Name, PublishUpdate) + + if err := d.applyK8sResource(ctx, upEnv.ProjectName, &upEnv.Environment, upEnv.RecordVersion); err != nil { + return nil, errors.NewE(err) + } + + return upEnv, nil +} + +func (d *domain) DeleteEnvironment(ctx ConsoleContext, projectName string, name string) error { + if err := d.canMutateResourcesInProject(ctx, projectName); err != nil { + return errors.NewE(err) + } + + uenv, err := d.environmentRepo.Patch( + ctx, + repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataName: name, + }, + common.PatchForMarkDeletion(), + ) + if err != nil { + return errors.NewE(err) + } + + d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeEnvironment, uenv.Name, PublishUpdate) + + if err := d.deleteK8sResource(ctx, uenv.ProjectName, &uenv.Environment); err != nil { + if errors.Is(err, ErrNoClusterAttached) { + return d.appRepo.DeleteById(ctx, uenv.Id) + } + return errors.NewE(err) + } + + return nil +} + +func (d *domain) OnEnvironmentApplyError(ctx ConsoleContext, errMsg, namespace, name string, opts UpdateAndDeleteOpts) error { + uenv, err := d.environmentRepo.Patch( + ctx, + repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataName: name, + }, + common.PatchForErrorFromAgent( + errMsg, + common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + }, + ), + ) + if err != nil { + return errors.NewE(err) + } + + d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeEnvironment, uenv.Name, PublishDelete) + + return errors.NewE(err) +} + +func (d *domain) OnEnvironmentDeleteMessage(ctx ConsoleContext, env entities.Environment) error { + err := d.environmentRepo.DeleteOne( + ctx, + repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataName: env.Name, + }, + ) + if err != nil { + return errors.NewE(err) + } + + if _, err = d.iamClient.RemoveResource(ctx, &iam.RemoveResourceIn{ + ResourceRef: iamT.NewResourceRef(ctx.AccountName, iamT.ResourceEnvironment, env.Name), + }); err != nil { + return errors.NewE(err) + } + + d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeEnvironment, env.Name, PublishDelete) + return nil +} + +func (d *domain) OnEnvironmentUpdateMessage(ctx ConsoleContext, env entities.Environment, status types.ResourceStatus, opts UpdateAndDeleteOpts) error { + xenv, err := d.findEnvironment(ctx, env.Spec.ProjectName, env.Name) + if err != nil { + return errors.NewE(err) + } + + if xenv == nil { + return errors.Newf("no environment found") + } + + recordVersion, err := d.MatchRecordVersion(env.Annotations, xenv.RecordVersion) + if err != nil { + return d.resyncK8sResource(ctx, xenv.ProjectName, xenv.SyncStatus.Action, &xenv.Environment, xenv.RecordVersion) + } + + uenv, err := d.environmentRepo.PatchById( + ctx, + xenv.Id, + common.PatchForSyncFromAgent( + &env, + recordVersion, + status, + common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + })) + if err != nil { + return err + } + + d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeEnvironment, uenv.Name, PublishUpdate) + return nil +} + +func (d *domain) ResyncEnvironment(ctx ConsoleContext, projectName string, name string) error { + if err := d.canMutateResourcesInProject(ctx, projectName); err != nil { + return errors.NewE(err) + } + + e, err := d.findEnvironment(ctx, projectName, name) + if err != nil { + return errors.NewE(err) + } + + if err := d.resyncK8sResource(ctx, e.ProjectName, t.SyncActionApply, &corev1.Namespace{ + TypeMeta: metav1.TypeMeta{APIVersion: "v1", Kind: "Namespace"}, + ObjectMeta: metav1.ObjectMeta{ + Name: e.Spec.TargetNamespace, + Labels: map[string]string{ + constants.EnvNameKey: e.Name, + }, + }, + }, e.RecordVersion); err != nil { + return errors.NewE(err) + } + + return d.resyncK8sResource(ctx, e.ProjectName, e.SyncStatus.Action, &e.Environment, e.RecordVersion) +} diff --git a/apps/console/internal/domain/image-pull-secret.go b/apps/console/internal/domain/image-pull-secret.go new file mode 100644 index 000000000..ba1f25ba4 --- /dev/null +++ b/apps/console/internal/domain/image-pull-secret.go @@ -0,0 +1,306 @@ +package domain + +import ( + "encoding/base64" + "encoding/json" + "github.com/kloudlite/api/apps/console/internal/entities" + fc "github.com/kloudlite/api/apps/console/internal/entities/field-constants" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + "github.com/kloudlite/operator/operators/resource-watcher/types" + "github.com/kloudlite/operator/pkg/constants" + corev1 "k8s.io/api/core/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +func (d *domain) ListImagePullSecrets(ctx ResourceContext, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.ImagePullSecret], error) { + if err := d.canReadResourcesInEnvironment(ctx); err != nil { + return nil, errors.NewE(err) + } + + filters := ctx.DBFilters() + + return d.pullSecretsRepo.FindPaginated(ctx, d.pullSecretsRepo.MergeMatchFilters(filters, search), pagination) +} + +func (d *domain) findImagePullSecret(ctx ResourceContext, name string) (*entities.ImagePullSecret, error) { + + ips, err := d.pullSecretsRepo.FindOne( + ctx, + ctx.DBFilters().Add(fields.MetadataName, name), + ) + if err != nil { + return nil, errors.NewE(err) + } + + if ips == nil { + return nil, errors.Newf("no image-pull-secret with name (%s) found", name) + } + return ips, nil +} + +func (d *domain) GetImagePullSecret(ctx ResourceContext, name string) (*entities.ImagePullSecret, error) { + if err := d.canReadResourcesInEnvironment(ctx); err != nil { + return nil, errors.NewE(err) + } + + return d.findImagePullSecret(ctx, name) +} + +func generateImagePullSecret(ips entities.ImagePullSecret) (corev1.Secret, error) { + if err := ips.Validate(); err != nil { + return corev1.Secret{}, errors.NewE(err) + } + + data := map[string][]byte{} + switch ips.Format { + case entities.DockerConfigJsonFormat: + data[corev1.DockerConfigJsonKey] = []byte(*ips.DockerConfigJson) + case entities.ParamsFormat: + m := map[string]any{ + "auths": map[string]any{ + *ips.RegistryURL: map[string]any{ + "username": *ips.RegistryUsername, + "password": *ips.RegistryPassword, + }, + }, + } + b, err := json.Marshal(m) + if err != nil { + return corev1.Secret{}, err + } + + data[corev1.DockerConfigJsonKey] = []byte(base64.StdEncoding.EncodeToString(b)) + } + + secret := corev1.Secret{ + TypeMeta: v1.TypeMeta{APIVersion: "v1", Kind: "Secret"}, + ObjectMeta: v1.ObjectMeta{ + Name: ips.Name, + Namespace: ips.Namespace, + Labels: map[string]string{}, + Annotations: map[string]string{ + constants.DescriptionKey: "This resource is managed by kloudlite.io control plane. This secret is created as part of image-pull-secret resource.", + }, + }, + Data: data, + Type: corev1.SecretTypeDockerConfigJson, + } + + return secret, nil +} + +func (d *domain) CreateImagePullSecret(ctx ResourceContext, ips entities.ImagePullSecret) (*entities.ImagePullSecret, error) { + if err := d.canMutateResourcesInEnvironment(ctx); err != nil { + return nil, errors.NewE(err) + } + + if err := ips.Validate(); err != nil { + return nil, errors.NewE(err) + } + + env, err := d.findEnvironment(ctx.ConsoleContext, ctx.ProjectName, ctx.EnvironmentName) + if err != nil { + return nil, errors.NewE(err) + } + + ips.Namespace = env.Spec.TargetNamespace + + ips.IncrementRecordVersion() + + ips.CreatedBy = common.CreatedOrUpdatedBy{ + UserId: ctx.UserId, + UserName: ctx.UserName, + UserEmail: ctx.UserEmail, + } + ips.LastUpdatedBy = ips.CreatedBy + + ips.AccountName = ctx.AccountName + ips.ProjectName = ctx.ProjectName + ips.EnvironmentName = ctx.EnvironmentName + ips.SyncStatus = t.GenSyncStatus(t.SyncActionApply, ips.RecordVersion) + + pullSecret, err := generateImagePullSecret(ips) + if err != nil { + return nil, errors.NewEf(err, "failed to create a valid kubernetes secret") + } + ips.GeneratedK8sSecret = pullSecret + + if _, err := d.upsertEnvironmentResourceMapping(ctx, &ips); err != nil { + return nil, errors.NewE(err) + } + + nips, err := d.pullSecretsRepo.Create(ctx, &ips) + if err != nil { + if d.pullSecretsRepo.ErrAlreadyExists(err) { + // TODO: better insights into error, when it is being caused by duplicated indexes + return nil, errors.NewE(err) + } + return nil, errors.NewE(err) + } + + d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeImagePullSecret, nips.Name, PublishAdd) + + if err := d.applyK8sResource(ctx, nips.ProjectName, &pullSecret, nips.RecordVersion); err != nil { + return nil, errors.NewE(err) + } + + return nips, nil +} + +func (d *domain) UpdateImagePullSecret(ctx ResourceContext, ips entities.ImagePullSecret) (*entities.ImagePullSecret, error) { + if err := d.canMutateResourcesInEnvironment(ctx); err != nil { + return nil, errors.NewE(err) + } + + if err := ips.Validate(); err != nil { + return nil, errors.NewE(err) + } + + xips, err := d.findImagePullSecret(ctx, ips.Name) + if err != nil { + return nil, errors.NewE(err) + } + + if xips == nil { + return nil, errors.Newf("no image pull secret found") + } + + pullSecret, err := generateImagePullSecret(*xips) + if err != nil { + return nil, errors.NewE(err) + } + + patchForUpdate := common.PatchForUpdate( + ctx, + &ips, + common.PatchOpts{ + XPatch: repos.Document{ + fc.ImagePullSecretFormat: ips.Format, + fc.ImagePullSecretDockerConfigJson: ips.DockerConfigJson, + fc.ImagePullSecretRegistryURL: ips.RegistryURL, + fc.ImagePullSecretRegistryUsername: ips.RegistryUsername, + fc.ImagePullSecretRegistryPassword: ips.RegistryPassword, + fc.ImagePullSecretGeneratedK8sSecret: pullSecret, + }, + }, + ) + upIps, err := d.pullSecretsRepo.Patch( + ctx, + ctx.DBFilters().Add(fields.MetadataName, ips.Name), + patchForUpdate, + ) + if err != nil { + return nil, errors.NewE(err) + } + d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeImagePullSecret, upIps.Name, PublishUpdate) + + if err := d.applyK8sResource(ctx, upIps.ProjectName, &pullSecret, upIps.RecordVersion); err != nil { + return nil, errors.NewE(err) + } + + return upIps, errors.NewE(err) +} + +func (d *domain) DeleteImagePullSecret(ctx ResourceContext, name string) error { + if err := d.canMutateResourcesInEnvironment(ctx); err != nil { + return errors.NewE(err) + } + + uips, err := d.pullSecretsRepo.Patch( + ctx, + ctx.DBFilters().Add(fields.MetadataName, name), + common.PatchForMarkDeletion(), + ) + if err != nil { + return errors.NewE(err) + } + + d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeApp, uips.Name, PublishUpdate) + + if err := d.deleteK8sResource(ctx, uips.ProjectName, &corev1.Secret{ + TypeMeta: v1.TypeMeta{APIVersion: "v1", Kind: "Secret"}, + ObjectMeta: v1.ObjectMeta{Name: uips.Name, Namespace: uips.Namespace}, + }); err != nil { + if errors.Is(err, ErrNoClusterAttached) { + return d.pullSecretsRepo.DeleteById(ctx, uips.Id) + } + return err + } + return nil +} + +func (d *domain) OnImagePullSecretUpdateMessage(ctx ResourceContext, ips entities.ImagePullSecret, status types.ResourceStatus, opts UpdateAndDeleteOpts) error { + xips, err := d.findImagePullSecret(ctx, ips.Name) + if err != nil { + return errors.NewE(err) + } + + if xips == nil { + return errors.Newf("no image pull secret found") + } + + recordVersion, err := d.MatchRecordVersion(ips.Annotations, xips.RecordVersion) + if err != nil { + return d.resyncK8sResource(ctx, xips.ProjectName, xips.SyncStatus.Action, &xips.GeneratedK8sSecret, xips.RecordVersion) + } + + uips, err := d.pullSecretsRepo.PatchById( + ctx, + xips.Id, + common.PatchForSyncFromAgent(&ips, recordVersion, status, common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + })) + + if err != nil { + return err + } + + d.resourceEventPublisher.PublishResourceEvent(ctx, uips.GetResourceType(), uips.GetName(), PublishUpdate) + return errors.NewE(err) +} + +func (d *domain) OnImagePullSecretDeleteMessage(ctx ResourceContext, ips entities.ImagePullSecret) error { + err := d.pullSecretsRepo.DeleteOne( + ctx, + ctx.DBFilters().Add(fields.MetadataName, ips.Name), + ) + if err != nil { + return errors.NewE(err) + } + d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeImagePullSecret, ips.Name, PublishDelete) + return nil +} + +func (d *domain) OnImagePullSecretApplyError(ctx ResourceContext, errMsg string, name string, opts UpdateAndDeleteOpts) error { + uips, err := d.pullSecretsRepo.Patch( + ctx, + ctx.DBFilters().Add(fields.MetadataName, name), + common.PatchForErrorFromAgent( + errMsg, + common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + }, + ), + ) + if err != nil { + return err + } + d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeImagePullSecret, uips.Name, PublishDelete) + return nil +} + +func (d *domain) ResyncImagePullSecret(ctx ResourceContext, name string) error { + if err := d.canMutateResourcesInEnvironment(ctx); err != nil { + return errors.NewE(err) + } + + xips, err := d.findImagePullSecret(ctx, name) + if err != nil { + return errors.NewE(err) + } + return d.resyncK8sResource(ctx, xips.ProjectName, xips.SyncStatus.Action, &xips.GeneratedK8sSecret, xips.RecordVersion) +} diff --git a/apps/console/internal/domain/mres.go b/apps/console/internal/domain/mres.go index 2a0e0759a..5fa339439 100644 --- a/apps/console/internal/domain/mres.go +++ b/apps/console/internal/domain/mres.go @@ -2,179 +2,316 @@ package domain import ( "fmt" - "time" - "kloudlite.io/apps/console/internal/domain/entities" - "kloudlite.io/pkg/repos" - t "kloudlite.io/pkg/types" + "github.com/kloudlite/api/apps/console/internal/entities" + fc "github.com/kloudlite/api/apps/console/internal/entities/field-constants" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + "github.com/kloudlite/operator/operators/resource-watcher/types" ) // query -func (d *domain) ListManagedResources(ctx ConsoleContext, namespace string) ([]*entities.MRes, error) { - if err := d.canReadResourcesInWorkspace(ctx, namespace); err != nil { - return nil, err +func (d *domain) ListManagedResources(ctx ResourceContext, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.ManagedResource], error) { + if err := d.canReadResourcesInEnvironment(ctx); err != nil { + return nil, errors.NewE(err) } - return d.mresRepo.Find(ctx, repos.Query{Filter: repos.Filter{ - "accountName": ctx.AccountName, - "clusterName": ctx.ClusterName, - "metadata.namespace": namespace, - }}) + + filters := ctx.DBFilters() + return d.mresRepo.FindPaginated(ctx, d.mresRepo.MergeMatchFilters(filters, search), pq) } -func (d *domain) findMRes(ctx ConsoleContext, namespace string, name string) (*entities.MRes, error) { - mres, err := d.mresRepo.FindOne(ctx, repos.Filter{ - "accountName": ctx.AccountName, - "clusterName": ctx.ClusterName, - "metadata.namespace": namespace, - "metadata.name": name, - }) +func (d *domain) findMRes(ctx ResourceContext, name string) (*entities.ManagedResource, error) { + mres, err := d.mresRepo.FindOne( + ctx, + ctx.DBFilters().Add(fields.MetadataName, name), + ) if err != nil { - return nil, err + return nil, errors.NewE(err) } if mres == nil { - return nil, fmt.Errorf( - "no managed resource with name=%q,namespace=%q found", - name, - namespace, - ) + return nil, errors.Newf("no managed resource with name (%s) found", name) } return mres, nil } -func (d *domain) GetManagedResource(ctx ConsoleContext, namespace string, name string) (*entities.MRes, error) { - if err := d.canReadResourcesInWorkspace(ctx, namespace); err != nil { - return nil, err +func (d *domain) GetManagedResource(ctx ResourceContext, name string) (*entities.ManagedResource, error) { + if err := d.canReadResourcesInEnvironment(ctx); err != nil { + return nil, errors.NewE(err) + } + + return d.findMRes(ctx, name) +} + +// GetManagedResourceOutputKVs implements Domain. +func (d *domain) GetManagedResourceOutputKVs(ctx ResourceContext, keyrefs []ManagedResourceKeyRef) ([]*ManagedResourceKeyValueRef, error) { + filters := ctx.DBFilters() + + names := make([]any, 0, len(keyrefs)) + for i := range keyrefs { + names = append(names, keyrefs[i].MresName) + } + + filters = d.mresRepo.MergeMatchFilters(filters, map[string]repos.MatchFilter{ + fields.MetadataName: { + MatchType: repos.MatchTypeArray, + Array: names, + }, + }) + + mresSecrets, err := d.mresRepo.Find(ctx, repos.Query{Filter: filters}) + if err != nil { + return nil, errors.NewE(err) + } + + results := make([]*ManagedResourceKeyValueRef, 0, len(mresSecrets)) + + data := make(map[string]map[string]string) + + for i := range mresSecrets { + m := make(map[string]string, len(mresSecrets[i].SyncedOutputSecretRef.Data)) + for k, v := range mresSecrets[i].SyncedOutputSecretRef.Data { + m[k] = string(v) + } + + for k, v := range mresSecrets[i].SyncedOutputSecretRef.StringData { + m[k] = v + } + + data[mresSecrets[i].Name] = m + } + + for i := range keyrefs { + results = append(results, &ManagedResourceKeyValueRef{ + MresName: keyrefs[i].MresName, + Key: keyrefs[i].Key, + Value: data[keyrefs[i].MresName][keyrefs[i].Key], + }) + } + + return results, nil +} + +// GetManagedResourceOutputKeys implements Domain. +func (d *domain) GetManagedResourceOutputKeys(ctx ResourceContext, name string) ([]string, error) { + filters := ctx.DBFilters() + filters.Add(fields.MetadataName, name) + + mresSecret, err := d.findMRes(ctx, name) + if err != nil { + return nil, errors.NewE(err) + } + + if mresSecret.SyncedOutputSecretRef == nil { + return nil, errors.Newf("waiting for managed resource output to sync") } - return d.findMRes(ctx, namespace, name) + results := make([]string, 0, len(mresSecret.SyncedOutputSecretRef.Data)) + + for k := range mresSecret.SyncedOutputSecretRef.Data { + results = append(results, k) + } + + return results, nil } // mutations -func (d *domain) CreateManagedResource(ctx ConsoleContext, mres entities.MRes) (*entities.MRes, error) { - if err := d.canMutateResourcesInWorkspace(ctx, mres.Namespace); err != nil { - return nil, err +func (d *domain) CreateManagedResource(ctx ResourceContext, mres entities.ManagedResource) (*entities.ManagedResource, error) { + if err := d.canMutateResourcesInEnvironment(ctx); err != nil { + return nil, errors.NewE(err) + } + + if mres.Spec.ResourceTemplate.TypeMeta.GroupVersionKind().GroupKind().Empty() { + return nil, errors.New(".spec.resourceTemplate.apiVersion, and .spec.resourceTemplate.kind must be set") } + env, err := d.findEnvironment(ctx.ConsoleContext, ctx.ProjectName, ctx.EnvironmentName) + if err != nil { + return nil, errors.NewE(err) + } + + mres.Namespace = env.Spec.TargetNamespace + mres.EnsureGVK() - if err := d.k8sExtendedClient.ValidateStruct(ctx, &mres.ManagedResource); err != nil { - return nil, err + if err := d.k8sClient.ValidateObject(ctx, &mres.ManagedResource); err != nil { + return nil, errors.NewE(err) } + mres.IncrementRecordVersion() + + mres.CreatedBy = common.CreatedOrUpdatedBy{ + UserId: ctx.UserId, + UserName: ctx.UserName, + UserEmail: ctx.UserEmail, + } + mres.LastUpdatedBy = mres.CreatedBy + mres.AccountName = ctx.AccountName - mres.ClusterName = ctx.ClusterName - mres.Generation = 1 - mres.SyncStatus = t.GenSyncStatus(t.SyncActionApply, mres.Generation) + mres.ProjectName = ctx.ProjectName + mres.EnvironmentName = ctx.EnvironmentName + + mres.Spec.ResourceName = fmt.Sprintf("env-%s-%s", ctx.EnvironmentName, mres.Name) + + return d.createAndApplyManagedResource(ctx, &mres) +} - m, err := d.mresRepo.Create(ctx, &mres) +func (d *domain) createAndApplyManagedResource(ctx ResourceContext, mres *entities.ManagedResource) (*entities.ManagedResource, error) { + mres.SyncStatus = t.GenSyncStatus(t.SyncActionApply, 0) + + if _, err := d.upsertEnvironmentResourceMapping(ctx, mres); err != nil { + return nil, errors.NewE(err) + } + + m, err := d.mresRepo.Create(ctx, mres) if err != nil { if d.mresRepo.ErrAlreadyExists(err) { - return nil, fmt.Errorf("mres with name %q already exists", mres.Name) + // TODO: better insights into error, when it is being caused by duplicated indexes + return nil, errors.NewE(err) } - return nil, err + return nil, errors.NewE(err) } + d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeManagedResource, m.Name, PublishAdd) - if err := d.applyK8sResource(ctx, &m.ManagedResource); err != nil { - return m, err + if err := d.applyK8sResource(ctx, ctx.ProjectName, &m.ManagedResource, m.RecordVersion); err != nil { + return m, errors.NewE(err) } return m, nil } -func (d *domain) UpdateManagedResource(ctx ConsoleContext, mres entities.MRes) (*entities.MRes, error) { - if err := d.canReadResourcesInWorkspace(ctx, mres.Namespace); err != nil { - return nil, err +func (d *domain) UpdateManagedResource(ctx ResourceContext, mres entities.ManagedResource) (*entities.ManagedResource, error) { + if err := d.canReadResourcesInEnvironment(ctx); err != nil { + return nil, errors.NewE(err) } mres.EnsureGVK() - if err := d.k8sExtendedClient.ValidateStruct(ctx, &mres.ManagedResource); err != nil { - return nil, err + if err := d.k8sClient.ValidateObject(ctx, &mres.ManagedResource); err != nil { + return nil, errors.NewE(err) } - m, err := d.findMRes(ctx, mres.Namespace, mres.Name) + patchForUpdate := common.PatchForUpdate( + ctx, + &mres, + common.PatchOpts{ + XPatch: repos.Document{ + fc.ManagedResourceSpec: mres.Spec, + }, + }) + + upMres, err := d.mresRepo.Patch( + ctx, + ctx.DBFilters().Add(fields.MetadataName, mres.Name), + patchForUpdate, + ) if err != nil { - return nil, err + return nil, errors.NewE(err) } - m.Spec = mres.Spec - m.Generation += 1 - m.SyncStatus = t.GenSyncStatus(t.SyncActionApply, m.Generation) + d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeManagedResource, upMres.Name, PublishUpdate) - upMRes, err := d.mresRepo.UpdateById(ctx, m.Id, m) - if err != nil { - return nil, err + if err := d.applyK8sResource(ctx, ctx.ProjectName, &upMres.ManagedResource, upMres.RecordVersion); err != nil { + return upMres, errors.NewE(err) } - if err := d.applyK8sResource(ctx, &upMRes.ManagedResource); err != nil { - return upMRes, err - } - - return upMRes, nil + return upMres, nil } -func (d *domain) DeleteManagedResource(ctx ConsoleContext, namespace string, name string) error { - if err := d.canMutateResourcesInWorkspace(ctx, namespace); err != nil { - return err +func (d *domain) DeleteManagedResource(ctx ResourceContext, name string) error { + if err := d.canMutateResourcesInEnvironment(ctx); err != nil { + return errors.NewE(err) } - m, err := d.findMRes(ctx, namespace, name) + umres, err := d.mresRepo.Patch( + ctx, + ctx.DBFilters().Add(fields.MetadataName, name), + common.PatchForMarkDeletion(), + ) if err != nil { - return err + return errors.NewE(err) } - - m.SyncStatus = t.GenSyncStatus(t.SyncActionDelete, m.Generation) - if _, err := d.mresRepo.UpdateById(ctx, m.Id, m); err != nil { - return err + d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeManagedResource, umres.Name, PublishUpdate) + if err := d.deleteK8sResource(ctx, umres.ProjectName, &umres.ManagedResource); err != nil { + if errors.Is(err, ErrNoClusterAttached) { + return d.mresRepo.DeleteById(ctx, umres.Id) + } + return errors.NewE(err) } - - return d.deleteK8sResource(ctx, &m.ManagedResource) + return nil } -func (d *domain) OnDeleteManagedResourceMessage(ctx ConsoleContext, mres entities.MRes) error { - a, err := d.findMRes(ctx, mres.Namespace, mres.Name) +func (d *domain) OnManagedResourceDeleteMessage(ctx ResourceContext, mres entities.ManagedResource) error { + err := d.mresRepo.DeleteOne( + ctx, + ctx.DBFilters().Add(fields.MetadataName, mres.Name), + ) if err != nil { - return err + return errors.NewE(err) } - - return d.mresRepo.DeleteById(ctx, a.Id) + d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeManagedResource, mres.Name, PublishDelete) + return nil } -func (d *domain) OnUpdateManagedResourceMessage(ctx ConsoleContext, mres entities.MRes) error { - m, err := d.findMRes(ctx, mres.Namespace, mres.Name) +func (d *domain) OnManagedResourceUpdateMessage(ctx ResourceContext, mres entities.ManagedResource, status types.ResourceStatus, opts UpdateAndDeleteOpts) error { + xmres, err := d.findMRes(ctx, mres.Name) if err != nil { - return err + return errors.NewE(err) } - m.Status = mres.Status - m.SyncStatus.Error = nil - m.SyncStatus.LastSyncedAt = time.Now() - m.SyncStatus.Generation = mres.Generation - m.SyncStatus.State = t.ParseSyncState(mres.Status.IsReady) + if xmres == nil { + return errors.Newf("no manage resource found") + } - _, err = d.mresRepo.UpdateById(ctx, m.Id, m) - return err -} + recordVersion, err := d.MatchRecordVersion(mres.Annotations, xmres.RecordVersion) + if err != nil { + return d.resyncK8sResource(ctx, xmres.ProjectName, mres.SyncStatus.Action, &mres.ManagedResource, mres.RecordVersion) + } -func (d *domain) OnApplyManagedResourceError(ctx ConsoleContext, errMsg string, namespace string, name string) error { - m, err2 := d.findMRes(ctx, namespace, name) - if err2 != nil { - return err2 + umres, err := d.mresRepo.PatchById( + ctx, + xmres.Id, + common.PatchForSyncFromAgent(&mres, recordVersion, status, common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + XPatch: repos.Document{ + fc.ManagedResourceSyncedOutputSecretRef: mres.SyncedOutputSecretRef, + }, + })) + if err != nil { + return err } + d.resourceEventPublisher.PublishResourceEvent(ctx, umres.GetResourceType(), umres.GetName(), PublishUpdate) + return errors.NewE(err) +} - m.SyncStatus.Error = &errMsg - _, err := d.mresRepo.UpdateById(ctx, m.Id, m) - return err +func (d *domain) OnManagedResourceApplyError(ctx ResourceContext, errMsg string, name string, opts UpdateAndDeleteOpts) error { + umres, err := d.mresRepo.Patch( + ctx, + ctx.DBFilters().Add(fields.MetadataName, name), + common.PatchForErrorFromAgent( + errMsg, + common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + }, + ), + ) + if err != nil { + return errors.NewE(err) + } + d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeManagedResource, umres.Name, PublishDelete) + return errors.NewE(err) } -func (d *domain) ResyncManagedResource(ctx ConsoleContext, namespace, name string) error { - if err := d.canMutateResourcesInWorkspace(ctx, namespace); err != nil { - return err +func (d *domain) ResyncManagedResource(ctx ResourceContext, name string) error { + if err := d.canMutateResourcesInEnvironment(ctx); err != nil { + return errors.NewE(err) } - m, err := d.findMRes(ctx, namespace, name) + mres, err := d.findMRes(ctx, name) if err != nil { - return err + return errors.NewE(err) } - return d.resyncK8sResource(ctx, m.SyncStatus.Action, &m.ManagedResource) + return d.resyncK8sResource(ctx, mres.ProjectName, mres.SyncStatus.Action, &mres.ManagedResource, mres.RecordVersion) } diff --git a/apps/console/internal/domain/msvc.go b/apps/console/internal/domain/msvc.go deleted file mode 100644 index 17376d1b4..000000000 --- a/apps/console/internal/domain/msvc.go +++ /dev/null @@ -1,173 +0,0 @@ -package domain - -import ( - "fmt" - "time" - - "kloudlite.io/apps/console/internal/domain/entities" - "kloudlite.io/pkg/repos" - t "kloudlite.io/pkg/types" -) - -func (d *domain) ListManagedServices(ctx ConsoleContext, namespace string) ([]*entities.MSvc, error) { - if err := d.canReadResourcesInWorkspace(ctx, namespace); err != nil { - return nil, err - } - return d.msvcRepo.Find(ctx, repos.Query{Filter: repos.Filter{ - "accountName": ctx.AccountName, - "clusterName": ctx.ClusterName, - "metadata.namespace": namespace, - }}) -} - -func (d *domain) findMSvc(ctx ConsoleContext, namespace string, name string) (*entities.MSvc, error) { - mres, err := d.msvcRepo.FindOne(ctx, repos.Filter{ - "accountName": ctx.AccountName, - "clusterName": ctx.ClusterName, - "metadata.namespace": namespace, - "metadata.name": name, - }) - if err != nil { - return nil, err - } - if mres == nil { - return nil, fmt.Errorf("no secret with name=%q,namespace=%q found", name, namespace) - } - return mres, nil -} - -func (d *domain) GetManagedService(ctx ConsoleContext, namespace string, name string) (*entities.MSvc, error) { - if err := d.canReadResourcesInWorkspace(ctx, namespace); err != nil { - return nil, err - } - return d.findMSvc(ctx, namespace, name) -} - -// mutations - -func (d *domain) CreateManagedService(ctx ConsoleContext, msvc entities.MSvc) (*entities.MSvc, error) { - if err := d.canMutateResourcesInWorkspace(ctx, msvc.Namespace); err != nil { - return nil, err - } - - msvc.EnsureGVK() - if err := d.k8sExtendedClient.ValidateStruct(ctx, &msvc.ManagedService); err != nil { - return nil, err - } - - msvc.AccountName = ctx.AccountName - msvc.ClusterName = ctx.ClusterName - msvc.Generation = 1 - msvc.SyncStatus = t.GenSyncStatus(t.SyncActionApply, msvc.Generation) - - m, err := d.msvcRepo.Create(ctx, &msvc) - if err != nil { - if d.msvcRepo.ErrAlreadyExists(err) { - return nil, fmt.Errorf("msvc with name=%q, namespace=%q already exists", msvc.Name, msvc.Namespace) - } - return nil, err - } - - if err := d.applyK8sResource(ctx, &m.ManagedService); err != nil { - return m, err - } - - return m, nil -} - -func (d *domain) UpdateManagedService(ctx ConsoleContext, msvc entities.MSvc) (*entities.MSvc, error) { - if err := d.canMutateResourcesInWorkspace(ctx, msvc.Namespace); err != nil { - return nil, err - } - - msvc.EnsureGVK() - if err := d.k8sExtendedClient.ValidateStruct(ctx, &msvc.ManagedService); err != nil { - return nil, err - } - - m, err := d.findMSvc(ctx, msvc.Namespace, msvc.Name) - if err != nil { - return nil, err - } - - m.Spec = msvc.Spec - m.Generation += 1 - m.SyncStatus = t.GenSyncStatus(t.SyncActionApply, m.Generation) - - upMSvc, err := d.msvcRepo.UpdateById(ctx, m.Id, m) - if err != nil { - return nil, err - } - - if err := d.applyK8sResource(ctx, &upMSvc.ManagedService); err != nil { - return upMSvc, err - } - - return upMSvc, nil -} - -func (d *domain) DeleteManagedService(ctx ConsoleContext, namespace string, name string) error { - if err := d.canMutateResourcesInWorkspace(ctx, namespace); err != nil { - return err - } - m, err := d.findMSvc(ctx, namespace, name) - if err != nil { - return err - } - - m.SyncStatus = t.GenSyncStatus(t.SyncActionDelete, m.Generation) - if _, err := d.msvcRepo.UpdateById(ctx, m.Id, m); err != nil { - return err - } - - return d.deleteK8sResource(ctx, &m.ManagedService) -} - -func (d *domain) OnDeleteManagedServiceMessage(ctx ConsoleContext, msvc entities.MSvc) error { - m, err := d.findMSvc(ctx, msvc.Namespace, msvc.Name) - if err != nil { - return err - } - - return d.msvcRepo.DeleteById(ctx, m.Id) -} - -func (d *domain) OnUpdateManagedServiceMessage(ctx ConsoleContext, msvc entities.MSvc) error { - m, err := d.findMSvc(ctx, msvc.Namespace, msvc.Name) - if err != nil { - return err - } - - m.Status = msvc.Status - m.SyncStatus.Error = nil - m.SyncStatus.LastSyncedAt = time.Now() - m.SyncStatus.Generation = msvc.Generation - m.SyncStatus.State = t.ParseSyncState(msvc.Status.IsReady) - - _, err = d.msvcRepo.UpdateById(ctx, m.Id, m) - return err -} - -func (d *domain) OnApplyManagedServiceError(ctx ConsoleContext, errMsg string, namespace string, name string) error { - m, err2 := d.findMSvc(ctx, namespace, name) - if err2 != nil { - return err2 - } - - m.SyncStatus.Error = &errMsg - _, err := d.msvcRepo.UpdateById(ctx, m.Id, m) - return err -} - -func (d *domain) ResyncManagedService(ctx ConsoleContext, namespace, name string) error { - if err := d.canMutateResourcesInWorkspace(ctx, namespace); err != nil { - return err - } - - c, err := d.findMSvc(ctx, namespace, name) - if err != nil { - return err - } - - return d.resyncK8sResource(ctx, c.SyncStatus.Action, &c.ManagedService) -} diff --git a/apps/console/internal/domain/names.go b/apps/console/internal/domain/names.go index eb941ef39..1a4c136dd 100644 --- a/apps/console/internal/domain/names.go +++ b/apps/console/internal/domain/names.go @@ -2,153 +2,109 @@ package domain import ( "context" - "fmt" - fn "kloudlite.io/pkg/functions" - "kloudlite.io/pkg/repos" + "github.com/kloudlite/api/common/fields" + + "github.com/kloudlite/api/apps/console/internal/entities" + "github.com/kloudlite/api/pkg/errors" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/repos" ) -func (d *domain) CheckNameAvailability(ctx context.Context, resType ResType, accountName string, name string) (*CheckNameAvailabilityOutput, error) { +func checkResourceName[T repos.Entity](ctx context.Context, filters repos.Filter, repo repos.DbRepo[T]) (*CheckNameAvailabilityOutput, error) { + res, err := repo.FindOne(ctx, filters) + if err != nil { + return &CheckNameAvailabilityOutput{Result: false}, errors.NewE(err) + } + + if fn.IsNil(res) { + return &CheckNameAvailabilityOutput{Result: true}, nil + } + + return &CheckNameAvailabilityOutput{ + Result: false, + SuggestedNames: fn.GenValidK8sResourceNames(filters[fields.MetadataName].(string), 3), + }, nil +} + +func (d *domain) CheckNameAvailability(ctx context.Context, accountName string, projectName *string, environmentName *string, resType entities.ResourceType, name string) (*CheckNameAvailabilityOutput, error) { + errEnvironmentRequired := func() error { + return errors.Newf("param environmentName is required for resource type %q", resType) + } + + errProjectRequired := func() error { + return errors.Newf("param projectName is required for resource type %q", resType) + } + + if !fn.IsValidK8sResourceName(name) { + return &CheckNameAvailabilityOutput{ + Result: false, + SuggestedNames: []string{fn.GenReadableName(name), fn.GenReadableName(name), fn.GenReadableName(name)}, + }, nil + } + switch resType { - case ResTypeProject: - { - p, err := d.projectRepo.FindOne(ctx, repos.Filter{ - "accountName": accountName, - "metadata.name": name, - }) - if err != nil { - return &CheckNameAvailabilityOutput{Result: false}, err - } - if p == nil { - return &CheckNameAvailabilityOutput{Result: true}, nil - } - return &CheckNameAvailabilityOutput{ - Result: false, - SuggestedNames: []string{fn.GenReadableName(name), fn.GenReadableName(name), fn.GenReadableName(name)}, - }, nil - } - case ResTypeEnvironment: - { - p, err := d.workspaceRepo.FindOne(ctx, repos.Filter{ - "accountName": accountName, - "metadata.name": name, - }) - if err != nil { - return &CheckNameAvailabilityOutput{Result: false}, err - } - if p == nil { - return &CheckNameAvailabilityOutput{Result: true}, nil - } - return &CheckNameAvailabilityOutput{ - Result: false, - SuggestedNames: []string{fn.GenReadableName(name), fn.GenReadableName(name), fn.GenReadableName(name)}, - }, nil - } - case ResTypeApp: + + case entities.ResourceTypeVPNDevice: { - a, err := d.appRepo.FindOne(ctx, repos.Filter{ - "accountName": accountName, - "metadata.name": name, - }) - if err != nil { - return &CheckNameAvailabilityOutput{Result: false}, err - } - if a == nil { - return &CheckNameAvailabilityOutput{Result: true}, nil - } - return &CheckNameAvailabilityOutput{ - Result: false, - SuggestedNames: []string{fn.GenReadableName(name), fn.GenReadableName(name), fn.GenReadableName(name)}, - }, nil + return checkResourceName(ctx, repos.Filter{fields.AccountName: accountName, fields.MetadataName: name}, d.vpnDeviceRepo) } - case ResTypeConfig: + + case entities.ResourceTypeProject: { - c, err := d.configRepo.FindOne(ctx, repos.Filter{ - "accountName": accountName, - "metadata.name": name, - }) - if err != nil { - return &CheckNameAvailabilityOutput{Result: false}, err - } - if c == nil { - return &CheckNameAvailabilityOutput{Result: true}, nil - } - return &CheckNameAvailabilityOutput{ - Result: false, - SuggestedNames: []string{fn.GenReadableName(name), fn.GenReadableName(name), fn.GenReadableName(name)}, - }, nil + return checkResourceName(ctx, repos.Filter{fields.AccountName: accountName, fields.MetadataName: name}, d.projectRepo) } - case ResTypeSecret: + + case entities.ResourceTypeProjectManagedService: { - s, err := d.secretRepo.FindOne(ctx, repos.Filter{ - "accountName": accountName, - "metadata.name": name, - }) - if err != nil { - return &CheckNameAvailabilityOutput{Result: false}, err + if projectName == nil { + return nil, errProjectRequired() } - if s == nil { - return &CheckNameAvailabilityOutput{Result: true}, nil - } - return &CheckNameAvailabilityOutput{ - Result: false, - SuggestedNames: []string{fn.GenReadableName(name), fn.GenReadableName(name), fn.GenReadableName(name)}, - }, nil + return checkResourceName(ctx, repos.Filter{fields.AccountName: accountName, fields.ProjectName: projectName, fields.MetadataName: name}, d.pmsRepo) } - case ResTypeRouter: + + case entities.ResourceTypeEnvironment: { - r, err := d.routerRepo.FindOne(ctx, repos.Filter{ - "accountName": accountName, - "metadata.name": name, - }) - if err != nil { - return &CheckNameAvailabilityOutput{Result: false}, err + if projectName == nil { + return nil, errProjectRequired() } - if r == nil { - return &CheckNameAvailabilityOutput{Result: true}, nil - } - return &CheckNameAvailabilityOutput{ - Result: false, - SuggestedNames: []string{fn.GenReadableName(name), fn.GenReadableName(name), fn.GenReadableName(name)}, - }, nil + return checkResourceName(ctx, repos.Filter{fields.AccountName: accountName, fields.ProjectName: projectName, fields.MetadataName: name}, d.environmentRepo) } - case ResTypeManagedService: + default: { - r, err := d.msvcRepo.FindOne(ctx, repos.Filter{ - "accountName": accountName, - "metadata.name": name, - }) - if err != nil { - return &CheckNameAvailabilityOutput{Result: false}, err + if projectName == nil { + return nil, errProjectRequired() } - if r == nil { - return &CheckNameAvailabilityOutput{Result: true}, nil + + if environmentName == nil { + return nil, errEnvironmentRequired() } - return &CheckNameAvailabilityOutput{ - Result: false, - SuggestedNames: []string{fn.GenReadableName(name), fn.GenReadableName(name), fn.GenReadableName(name)}, - }, nil - } - case ResTypeManagedResource: - { - r, err := d.mresRepo.FindOne(ctx, repos.Filter{ - "accountName": accountName, - "metadata.name": name, - }) - if err != nil { - return &CheckNameAvailabilityOutput{Result: false}, err + + filter := repos.Filter{ + fields.AccountName: accountName, + fields.ProjectName: projectName, + fields.EnvironmentName: environmentName, + fields.MetadataName: name, } - if r == nil { - return &CheckNameAvailabilityOutput{Result: true}, nil + + switch resType { + case entities.ResourceTypeApp: + return checkResourceName(ctx, filter, d.appRepo) + case entities.ResourceTypeConfig: + return checkResourceName(ctx, filter, d.configRepo) + case entities.ResourceTypeSecret: + return checkResourceName(ctx, filter, d.secretRepo) + case entities.ResourceTypeRouter: + return checkResourceName(ctx, filter, d.routerRepo) + case entities.ResourceTypeManagedResource: + return checkResourceName(ctx, filter, d.mresRepo) + case entities.ResourceTypeImagePullSecret: + return checkResourceName(ctx, filter, d.pullSecretsRepo) + default: + { + return nil, errors.Newf("resource type %q is not acknowledged", resType) + } } - return &CheckNameAvailabilityOutput{ - Result: false, - SuggestedNames: []string{fn.GenReadableName(name), fn.GenReadableName(name), fn.GenReadableName(name)}, - }, nil - } - default: - { - return nil, fmt.Errorf("resource type %q is not acknowledged", resType) } } } diff --git a/apps/console/internal/domain/project-managed-service.go b/apps/console/internal/domain/project-managed-service.go new file mode 100644 index 000000000..0aa1ee58e --- /dev/null +++ b/apps/console/internal/domain/project-managed-service.go @@ -0,0 +1,318 @@ +package domain + +import ( + "crypto/md5" + "encoding/hex" + "fmt" + + "github.com/kloudlite/api/apps/console/internal/entities" + "github.com/kloudlite/api/common/fields" + + fc "github.com/kloudlite/api/apps/console/internal/entities/field-constants" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + "github.com/kloudlite/operator/operators/resource-watcher/types" +) + +func (d *domain) ListProjectManagedServices(ctx ConsoleContext, projectName string, mf map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.ProjectManagedService], error) { + if err := d.canReadResourcesInProject(ctx, projectName); err != nil { + return nil, errors.NewE(err) + } + + f := repos.Filter{ + fields.ProjectName: projectName, + fields.AccountName: ctx.AccountName, + } + + pr, err := d.pmsRepo.FindPaginated(ctx, d.secretRepo.MergeMatchFilters(f, mf), pagination) + if err != nil { + return nil, errors.NewE(err) + } + + return pr, nil +} + +func (d *domain) findProjectManagedService(ctx ConsoleContext, projectName string, svcName string) (*entities.ProjectManagedService, error) { + pmsvc, err := d.pmsRepo.FindOne(ctx, repos.Filter{ + fields.ProjectName: projectName, + fields.AccountName: ctx.AccountName, + fields.MetadataName: svcName, + }) + if err != nil { + return nil, errors.NewE(err) + } + + if pmsvc == nil { + return nil, errors.Newf("cmsvc with name %q not found", projectName) + } + return pmsvc, nil +} + +func (d *domain) GetProjectManagedService(ctx ConsoleContext, projectName string, serviceName string) (*entities.ProjectManagedService, error) { + if err := d.canReadResourcesInProject(ctx, projectName); err != nil { + return nil, errors.NewE(err) + } + + c, err := d.findProjectManagedService(ctx, projectName, serviceName) + if err != nil { + return nil, errors.NewE(err) + } + + return c, nil +} + +func (d *domain) applyProjectManagedService(ctx ConsoleContext, pmsvc *entities.ProjectManagedService) error { + addTrackingId(&pmsvc.ProjectManagedService, pmsvc.Id) + return d.applyK8sResource(ctx, pmsvc.ProjectName, &pmsvc.ProjectManagedService, pmsvc.RecordVersion) +} + +func (d *domain) CreateProjectManagedService(ctx ConsoleContext, projectName string, service entities.ProjectManagedService) (*entities.ProjectManagedService, error) { + if err := d.canMutateResourcesInProject(ctx, projectName); err != nil { + return nil, errors.NewE(err) + } + + service.Namespace = d.getProjectTargetNamespace(projectName) + service.IncrementRecordVersion() + + if service.Spec.TargetNamespace == "" { + service.Spec.TargetNamespace = d.getPMSTargetNamespace(projectName, service.Name, entities.ResourceTypeProjectManagedService) + } + + service.CreatedBy = common.CreatedOrUpdatedBy{ + UserId: ctx.UserId, + UserName: ctx.UserName, + UserEmail: ctx.UserEmail, + } + + service.LastUpdatedBy = service.CreatedBy + + existing, err := d.pmsRepo.FindOne(ctx, repos.Filter{ + fields.ProjectName: projectName, + fields.AccountName: ctx.AccountName, + fields.MetadataName: service.Name, + }) + if err != nil { + return nil, errors.NewE(err) + } + + if existing != nil { + return nil, errors.Newf("project managed service with name %q already exists", projectName) + } + + service.AccountName = ctx.AccountName + service.ProjectName = projectName + service.SyncStatus = t.GenSyncStatus(t.SyncActionApply, service.RecordVersion) + + service.EnsureGVK() + + if err := d.k8sClient.ValidateObject(ctx, &service.ProjectManagedService); err != nil { + return nil, errors.NewE(err) + } + + pms, err := d.pmsRepo.Create(ctx, &service) + if err != nil { + return nil, errors.NewE(err) + } + + if _, err := d.upsertProjectResourceMapping(ctx, projectName, pms); err != nil { + return nil, errors.NewE(err) + } + + if err := d.applyProjectManagedService(ctx, pms); err != nil { + return nil, errors.NewE(err) + } + + d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeProjectManagedService, pms.Name, PublishAdd) + + return pms, nil +} + +func (d *domain) getPMSTargetNamespace(projectName string, msvcName string, msvcType entities.ResourceType) string { + msvcNamespace := fmt.Sprintf("pmsvc-%s-%s-%s", projectName, msvcName, msvcType) + hash := md5.Sum([]byte(msvcNamespace)) + return fmt.Sprintf("pmsvc-%s", hex.EncodeToString(hash[:])) +} + +func (d *domain) UpdateProjectManagedService(ctx ConsoleContext, projectName string, service entities.ProjectManagedService) (*entities.ProjectManagedService, error) { + if err := d.canMutateResourcesInProject(ctx, projectName); err != nil { + return nil, errors.NewE(err) + } + + pmsvc, err := d.findProjectManagedService(ctx, projectName, service.Name) + if err != nil { + return nil, errors.NewE(err) + } + + if pmsvc == nil { + return nil, errors.Newf("no project manage service found") + } + + service.Namespace = "trest" + service.EnsureGVK() + if err := d.k8sClient.ValidateObject(ctx, &service.ProjectManagedService); err != nil { + return nil, errors.NewE(err) + } + + if pmsvc.IsMarkedForDeletion() { + return nil, errors.Newf("cluster managed service %q (projectName=%q) is marked for deletion", service.Name, projectName) + } + + patchForUpdate := common.PatchForUpdate( + ctx, + &service, + common.PatchOpts{ + XPatch: repos.Document{ + fc.ProjectManagedServiceSpecMsvcSpecServiceTemplateSpec: service.Spec.MSVCSpec.ServiceTemplate.Spec, + }, + }) + + upmsvc, err := d.pmsRepo.Patch( + ctx, + repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataName: service.Name, + }, + patchForUpdate, + ) + if err != nil { + return nil, errors.NewE(err) + } + + d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeProjectManagedService, service.Name, PublishUpdate) + + if err := d.applyProjectManagedService(ctx, upmsvc); err != nil { + return nil, errors.NewE(err) + } + + return upmsvc, nil +} + +func (d *domain) DeleteProjectManagedService(ctx ConsoleContext, projectName string, name string) error { + if err := d.canMutateResourcesInProject(ctx, projectName); err != nil { + return errors.NewE(err) + } + + upmsvc, err := d.pmsRepo.Patch( + ctx, + repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataName: name, + }, + common.PatchForMarkDeletion(), + ) + if err != nil { + return errors.NewE(err) + } + + d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeProjectManagedService, name, PublishUpdate) + + return d.deleteK8sResource(ctx, projectName, &upmsvc.ProjectManagedService) +} + +// RestartProjectManagedService implements Domain. +func (d *domain) RestartProjectManagedService(ctx ConsoleContext, projectName string, name string) error { + if err := d.canMutateResourcesInProject(ctx, projectName); err != nil { + return errors.NewE(err) + } + + pms, err := d.findProjectManagedService(ctx, projectName, name) + if err != nil { + return errors.NewE(err) + } + + if err := d.restartK8sResource(ctx, projectName, pms.Spec.TargetNamespace, pms.GetEnsuredLabels()); err != nil { + return err + } + + return nil +} + +func (d *domain) OnProjectManagedServiceApplyError(ctx ConsoleContext, projectName, name, errMsg string, opts UpdateAndDeleteOpts) error { + upmsvc, err := d.pmsRepo.Patch( + ctx, + repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataName: name, + }, + common.PatchForErrorFromAgent( + errMsg, + common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + }, + ), + ) + if err != nil { + return errors.NewE(err) + } + + d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeProjectManagedService, upmsvc.Name, PublishDelete) + + return errors.NewE(err) +} + +func (d *domain) OnProjectManagedServiceDeleteMessage(ctx ConsoleContext, projectName string, service entities.ProjectManagedService) error { + err := d.pmsRepo.DeleteOne( + ctx, + repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataName: service.Name, + }, + ) + if err != nil { + return errors.NewE(err) + } + d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeProjectManagedService, service.Name, PublishDelete) + return nil +} + +func (d *domain) OnProjectManagedServiceUpdateMessage(ctx ConsoleContext, projectName string, service entities.ProjectManagedService, status types.ResourceStatus, opts UpdateAndDeleteOpts) error { + svc, err := d.findProjectManagedService(ctx, projectName, service.Name) + if err != nil { + return errors.NewE(err) + } + + if svc == nil { + return errors.Newf("no project manage service found") + } + + recordVersion, err := d.MatchRecordVersion(service.Annotations, svc.RecordVersion) + if err != nil { + return d.ResyncProjectManagedService(ctx, service.ProjectName, service.Name) + } + + upmsvc, err := d.pmsRepo.PatchById( + ctx, + svc.Id, + common.PatchForSyncFromAgent( + &service, + recordVersion, + status, + common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + XPatch: repos.Document{ + fc.ProjectManagedServiceSyncedOutputSecretRef: service.SyncedOutputSecretRef, + }, + })) + if err != nil { + return errors.NewE(err) + } + + d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeProjectManagedService, upmsvc.Name, PublishUpdate) + + return nil +} + +func (d *domain) ResyncProjectManagedService(ctx ConsoleContext, projectName, name string) error { + if err := d.canMutateResourcesInProject(ctx, projectName); err != nil { + return errors.NewE(err) + } + + a, err := d.findProjectManagedService(ctx, projectName, name) + if err != nil { + return errors.NewE(err) + } + + return d.resyncK8sResource(ctx, a.ProjectName, a.SyncStatus.Action, &a.ProjectManagedService, a.RecordVersion) +} diff --git a/apps/console/internal/domain/project.go b/apps/console/internal/domain/project.go index 75978e7ab..f20e86b61 100644 --- a/apps/console/internal/domain/project.go +++ b/apps/console/internal/domain/project.go @@ -2,24 +2,64 @@ package domain import ( "context" + "crypto/md5" + "encoding/hex" "fmt" - "time" - crdsv1 "github.com/kloudlite/operator/apis/crds/v1" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/errors" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/operator/operators/resource-watcher/types" "github.com/kloudlite/operator/pkg/constants" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "kloudlite.io/apps/console/internal/domain/entities" - iamT "kloudlite.io/apps/iam/types" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/iam" - "kloudlite.io/pkg/repos" - t "kloudlite.io/pkg/types" + "github.com/kloudlite/api/apps/console/internal/entities" + fc "github.com/kloudlite/api/apps/console/internal/entities/field-constants" + iamT "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" ) -// query +func (d *domain) getClusterAttachedToProject(ctx K8sContext, projectName string) (*string, error) { + cacheKey := fmt.Sprintf("account_name_%s-project_name_%s", ctx.GetAccountName(), projectName) -func (d *domain) ListProjects(ctx context.Context, userId repos.ID, accountName string, clusterName *string) ([]*entities.Project, error) { + clusterName, err := d.consoleCacheStore.Get(ctx, cacheKey) + if err != nil && !d.consoleCacheStore.ErrKeyNotFound(err) { + return nil, err + } + + if len(clusterName) == 0 { + proj, err := d.projectRepo.FindOne(ctx, repos.Filter{ + fields.AccountName: ctx.GetAccountName(), + fields.MetadataName: projectName, + }) + if err != nil { + return nil, errors.NewE(err) + } + if proj == nil { + return nil, errors.Newf("no cluster attached to project") + } + + defer func() { + if err := d.consoleCacheStore.Set(ctx, cacheKey, []byte(fn.DefaultIfNil(proj.ClusterName))); err != nil { + d.logger.Infof("failed to set project cluster map: %v", err) + } + }() + + return proj.ClusterName, nil + } + + if clusterName == nil { + return nil, nil + } + + return fn.New(string(clusterName)), nil +} + +func (d *domain) ListProjects(ctx context.Context, userId repos.ID, accountName string, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.Project], error) { co, err := d.iamClient.Can(ctx, &iam.CanIn{ UserId: string(userId), ResourceRefs: []string{ @@ -28,47 +68,43 @@ func (d *domain) ListProjects(ctx context.Context, userId repos.ID, accountName Action: string(iamT.ListProjects), }) if err != nil { - return nil, err + return nil, errors.NewE(err) } if !co.Status { - return nil, fmt.Errorf("unauthorized to get project") + return nil, errors.Newf("unauthorized to get project") } - filter := repos.Filter{"accountName": accountName} - if clusterName != nil { - filter["clusterName"] = clusterName - } - return d.projectRepo.Find(ctx, repos.Query{Filter: filter}) + filter := repos.Filter{fields.AccountName: accountName} + + // return d.projectRepo.Find(ctx, repos.Query{Filter: filter}) + return d.projectRepo.FindPaginated(ctx, d.projectRepo.MergeMatchFilters(filter, search), pagination) } func (d *domain) findProject(ctx ConsoleContext, name string) (*entities.Project, error) { prj, err := d.projectRepo.FindOne(ctx, repos.Filter{ - "accountName": ctx.AccountName, - "clusterName": ctx.ClusterName, - "metadata.name": name, + fields.AccountName: ctx.AccountName, + fields.MetadataName: name, }) if err != nil { - return nil, err + return nil, errors.NewE(err) } if prj == nil { - return nil, fmt.Errorf("no project with name=%q found", name) + return nil, errors.Newf("no project with name=%q found", name) } return prj, nil } func (d *domain) findProjectByTargetNs(ctx ConsoleContext, targetNamespace string) (*entities.Project, error) { prj, err := d.projectRepo.FindOne(ctx, repos.Filter{ - "accountName": ctx.AccountName, - "clusterName": ctx.ClusterName, - "spec.targetNamespace": targetNamespace, + fields.AccountName: ctx.AccountName, + fc.ProjectSpecTargetNamespace: targetNamespace, }) - if err != nil { - return nil, err + return nil, errors.NewE(err) } if prj == nil { - return nil, fmt.Errorf("no project with targetNamespace=%q found", targetNamespace) + return nil, errors.Newf("no project with targetNamespace=%q found", targetNamespace) } return prj, nil } @@ -83,11 +119,11 @@ func (d *domain) GetProject(ctx ConsoleContext, name string) (*entities.Project, Action: string(iamT.GetProject), }) if err != nil { - return nil, err + return nil, errors.NewE(err) } if !co.Status { - return nil, fmt.Errorf("unauthorized to get project") + return nil, errors.Newf("unauthorized to get project") } return d.findProject(ctx, name) @@ -104,70 +140,73 @@ func (d *domain) CreateProject(ctx ConsoleContext, project entities.Project) (*e Action: string(iamT.CreateProject), }) if err != nil { - return nil, err + return nil, errors.NewE(err) } if !co.Status { - return nil, fmt.Errorf("unauthorized to create Project") + return nil, errors.Newf("unauthorized to create Project") } project.EnsureGVK() - if err := d.k8sExtendedClient.ValidateStruct(ctx, &project.Project); err != nil { - return nil, err + if err := d.k8sClient.ValidateObject(ctx, &project.Project); err != nil { + return nil, errors.NewE(err) + } + + project.IncrementRecordVersion() + + // TODO: check if provided cluster is exists in account + + project.CreatedBy = common.CreatedOrUpdatedBy{ + UserId: ctx.UserId, + UserName: ctx.UserName, + UserEmail: ctx.UserEmail, } + project.LastUpdatedBy = project.CreatedBy project.AccountName = ctx.AccountName - project.ClusterName = ctx.ClusterName - project.Generation = 1 - project.SyncStatus = t.GenSyncStatus(t.SyncActionApply, project.Generation) + project.SyncStatus = t.GenSyncStatus(t.SyncActionApply, project.RecordVersion) + if project.Spec.TargetNamespace == "" { + project.Spec.TargetNamespace = d.getProjectTargetNamespace(project.Name) + } prj, err := d.projectRepo.Create(ctx, &project) if err != nil { if d.projectRepo.ErrAlreadyExists(err) { - return nil, fmt.Errorf("project with name %q, already exists", project.Name) + // TODO: better insights into error, when it is being caused by duplicated indexes + return nil, errors.NewE(err) } - return nil, err + return nil, errors.NewE(err) } - defaultWs := entities.Workspace{ - Env: crdsv1.Env{ - ObjectMeta: metav1.ObjectMeta{ - Name: d.envVars.DefaultProjectEnvName, - Namespace: project.Spec.TargetNamespace, - Generation: 1, - }, - Spec: crdsv1.EnvSpec{ - ProjectName: project.Name, - TargetNamespace: fmt.Sprintf("%s-%s", project.Name, d.envVars.DefaultProjectEnvName), - }, - }, - AccountName: ctx.AccountName, - ClusterName: ctx.ClusterName, - } + d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeProject, prj.Name, PublishAdd) - if _, err := d.CreateWorkspace(ctx, defaultWs); err != nil { - return nil, err - } - - if err := d.applyK8sResource(ctx, &corev1.Namespace{ + if err := d.applyK8sResource(ctx, prj.Name, &corev1.Namespace{ TypeMeta: metav1.TypeMeta{APIVersion: "v1", Kind: "Namespace"}, ObjectMeta: metav1.ObjectMeta{ Name: prj.Spec.TargetNamespace, + Annotations: map[string]string{ + constants.DescriptionKey: "This namespace is managed (created/updated/deleted) by kloudlite.io control plane. This namespace belongs to a project", + }, Labels: map[string]string{ constants.ProjectNameKey: prj.Name, }, }, - }); err != nil { - return nil, err + }, prj.RecordVersion); err != nil { + return nil, errors.NewE(err) } - if err := d.applyK8sResource(ctx, &prj.Project); err != nil { - return nil, err + if err := d.applyK8sResource(ctx, prj.Name, &prj.Project, prj.RecordVersion); err != nil { + return nil, errors.NewE(err) } return prj, nil } +func (d *domain) getProjectTargetNamespace(projectName string) string { + hash := md5.Sum([]byte(projectName)) + return fmt.Sprintf("prj-%s", hex.EncodeToString(hash[:])) +} + func (d *domain) DeleteProject(ctx ConsoleContext, name string) error { co, err := d.iamClient.Can(ctx, &iam.CanIn{ UserId: string(ctx.UserId), @@ -177,24 +216,28 @@ func (d *domain) DeleteProject(ctx ConsoleContext, name string) error { Action: string(iamT.DeleteProject), }) if err != nil { - return err + return errors.NewE(err) } if !co.Status { - return fmt.Errorf("unauthorized to delete project") + return errors.Newf("unauthorized to delete project") } - prj, err := d.findProject(ctx, name) + uproj, err := d.projectRepo.Patch( + ctx, + repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataName: name, + }, + common.PatchForMarkDeletion(), + ) if err != nil { - return err + return errors.NewE(err) } - prj.SyncStatus = t.GetSyncStatusForDeletion(prj.Generation) - if _, err := d.projectRepo.UpdateById(ctx, prj.Id, prj); err != nil { - return err - } + d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeProject, name, PublishUpdate) - return d.deleteK8sResource(ctx, &prj.Project) + return d.deleteK8sResource(ctx, uproj.Name, &uproj.Project) } func (d *domain) UpdateProject(ctx ConsoleContext, project entities.Project) (*entities.Project, error) { @@ -207,76 +250,117 @@ func (d *domain) UpdateProject(ctx ConsoleContext, project entities.Project) (*e Action: string(iamT.UpdateProject), }) if err != nil { - return nil, err + return nil, errors.NewE(err) } if !co.Status { - return nil, fmt.Errorf("unauthorized to update project %q", project.Name) + return nil, errors.Newf("unauthorized to update project %q", project.Name) } project.EnsureGVK() - if err := d.k8sExtendedClient.ValidateStruct(ctx, &project.Project); err != nil { - return nil, err + if err := d.k8sClient.ValidateObject(ctx, &project.Project); err != nil { + return nil, errors.NewE(err) } - exProject, err := d.findProject(ctx, project.Name) + patchForUpdate := common.PatchForUpdate( + ctx, + &project, + common.PatchOpts{ + XPatch: repos.Document{ + fc.ProjectSpec: project.Spec, + }, + }) + + upProject, err := d.projectRepo.Patch( + ctx, + repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataName: project.Name, + }, + patchForUpdate, + ) if err != nil { - return nil, err + return nil, errors.NewE(err) } + d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeProject, project.Name, PublishUpdate) - if exProject.GetDeletionTimestamp() != nil { - return nil, errAlreadyMarkedForDeletion("project", "", project.Name) + if err := d.applyK8sResource(ctx, upProject.Name, &upProject.Project, upProject.RecordVersion); err != nil { + return nil, errors.NewE(err) } - exProject.Spec = project.Spec - exProject.SyncStatus = t.GetSyncStatusForUpdation(exProject.Generation + 1) + return upProject, nil +} - upProject, err := d.projectRepo.UpdateById(ctx, exProject.Id, exProject) +func (d *domain) OnProjectDeleteMessage(ctx ConsoleContext, project entities.Project) error { + err := d.projectRepo.DeleteOne( + ctx, + repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataName: project.Name, + }, + ) if err != nil { - return nil, err - } - - if err := d.applyK8sResource(ctx, &upProject.Project); err != nil { - return nil, err + return errors.NewE(err) } - - return upProject, nil + d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeApp, project.Name, PublishDelete) + return nil } -func (d *domain) OnDeleteProjectMessage(ctx ConsoleContext, project entities.Project) error { - p, err := d.findProject(ctx, project.Name) +func (d *domain) OnProjectUpdateMessage(ctx ConsoleContext, project entities.Project, status types.ResourceStatus, opts UpdateAndDeleteOpts) error { + proj, err := d.findProject(ctx, project.Name) if err != nil { - return err + return errors.NewE(err) } - return d.projectRepo.DeleteById(ctx, p.Id) -} + if proj == nil { + return errors.Newf("no project found") + } -func (d *domain) OnUpdateProjectMessage(ctx ConsoleContext, project entities.Project) error { - p, err := d.findProject(ctx, project.Name) + recordVersion, err := d.MatchRecordVersion(project.Annotations, proj.RecordVersion) if err != nil { - return err + return nil + } + + uproject, err := d.projectRepo.PatchById( + ctx, + proj.Id, + common.PatchForSyncFromAgent( + &project, + recordVersion, + status, + common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + })) + if err != nil { + return errors.NewE(err) } - p.Status = project.Status - p.SyncStatus.Error = nil - p.SyncStatus.LastSyncedAt = time.Now() - p.SyncStatus.Generation = project.Generation - p.SyncStatus.State = t.ParseSyncState(project.Status.IsReady) + d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeProject, uproject.Name, PublishUpdate) - _, err = d.projectRepo.UpdateById(ctx, p.Id, p) - return err + return nil } -func (d *domain) OnApplyProjectError(ctx ConsoleContext, errMsg string, name string) error { - p, err2 := d.findProject(ctx, name) - if err2 != nil { - return err2 +func (d *domain) OnProjectApplyError(ctx ConsoleContext, errMsg string, name string, opts UpdateAndDeleteOpts) error { + uproject, err := d.projectRepo.Patch( + ctx, + repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataName: name, + }, + common.PatchForErrorFromAgent( + errMsg, + common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + }, + ), + ) + if err != nil { + return errors.NewE(err) } - p.SyncStatus.Error = &errMsg - _, err := d.projectRepo.UpdateById(ctx, p.Id, p) - return err + d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeApp, uproject.Name, PublishDelete) + + return errors.NewE(err) } func (d *domain) ResyncProject(ctx ConsoleContext, name string) error { @@ -289,29 +373,32 @@ func (d *domain) ResyncProject(ctx ConsoleContext, name string) error { Action: string(iamT.UpdateProject), }) if err != nil { - return err + return errors.NewE(err) } if !co.Status { - return fmt.Errorf("unauthorized to update project %q", name) + return errors.Newf("unauthorized to update project %q", name) } - p, err := d.findProject(ctx, name) + project, err := d.findProject(ctx, name) if err != nil { - return err + return errors.NewE(err) } - if err := d.resyncK8sResource(ctx, t.SyncActionApply, &corev1.Namespace{ + if err := d.resyncK8sResource(ctx, project.Name, project.SyncStatus.Action, &corev1.Namespace{ TypeMeta: metav1.TypeMeta{APIVersion: "v1", Kind: "Namespace"}, ObjectMeta: metav1.ObjectMeta{ - Name: p.Spec.TargetNamespace, + Name: project.Spec.TargetNamespace, + Annotations: map[string]string{ + constants.DescriptionKey: "This namespace is managed (created/updated/deleted) by kloudlite.io control plane. This namespace belongs to a project", + }, Labels: map[string]string{ - constants.ProjectNameKey: p.Name, + constants.ProjectNameKey: project.Name, }, }, - }); err != nil { - return err + }, 0); err != nil { + return errors.NewE(err) } - return d.resyncK8sResource(ctx, p.SyncStatus.Action, &p.Project) + return d.resyncK8sResource(ctx, project.Name, project.SyncStatus.Action, &project.Project, project.RecordVersion) } diff --git a/apps/console/internal/domain/resource-mapping.go b/apps/console/internal/domain/resource-mapping.go new file mode 100644 index 000000000..4bed39ba8 --- /dev/null +++ b/apps/console/internal/domain/resource-mapping.go @@ -0,0 +1,116 @@ +package domain + +import ( + "github.com/kloudlite/api/apps/console/internal/entities" + fc "github.com/kloudlite/api/apps/console/internal/entities/field-constants" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" +) + +type resource interface { + common.ResourceForSync + GetResourceType() entities.ResourceType +} + +var ( + _ resource = (*entities.App)(nil) + _ resource = (*entities.Config)(nil) + _ resource = (*entities.Secret)(nil) + _ resource = (*entities.Router)(nil) + _ resource = (*entities.ManagedResource)(nil) + _ resource = (*entities.ImagePullSecret)(nil) + _ resource = (*entities.Project)(nil) + _ resource = (*entities.Environment)(nil) + _ resource = (*entities.ProjectManagedService)(nil) +) + +func (d *domain) upsertEnvironmentResourceMapping(ctx ResourceContext, res resource) (*entities.ResourceMapping, error) { + clusterName, err := d.getClusterAttachedToProject(ctx, ctx.ProjectName) + if err != nil { + return nil, errors.NewE(err) + } + if clusterName == nil { + // silent exit + return nil, nil + } + + return d.resourceMappingRepo.Upsert(ctx, repos.Filter{ + fields.ClusterName: clusterName, + fields.AccountName: ctx.AccountName, + fields.ProjectName: ctx.ProjectName, + fields.EnvironmentName: ctx.EnvironmentName, + + fc.ResourceMappingResourceHeirarchy: entities.ResourceHeirarchyEnvironment, + fc.ResourceMappingResourceType: res.GetResourceType(), + fc.ResourceMappingResourceName: res.GetName(), + fc.ResourceMappingResourceNamespace: res.GetNamespace(), + + }, &entities.ResourceMapping{ + ResourceHeirarchy: entities.ResourceHeirarchyEnvironment, + + ResourceType: res.GetResourceType(), + ResourceName: res.GetName(), + ResourceNamespace: res.GetNamespace(), + + AccountName: ctx.AccountName, + ClusterName: *clusterName, + + ProjectName: ctx.ProjectName, + EnvironmentName: ctx.EnvironmentName, + }) +} + +func (d *domain) upsertProjectResourceMapping(ctx ConsoleContext, projectName string, res resource) (*entities.ResourceMapping, error) { + clusterName, err := d.getClusterAttachedToProject(ctx, projectName) + if err != nil { + return nil, errors.NewE(err) + } + if clusterName == nil { + // silent exit + return nil, nil + } + + return d.resourceMappingRepo.Upsert(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.ClusterName: *clusterName, + fields.ProjectName: projectName, + fc.ResourceMappingResourceHeirarchy: entities.ResourceHeirarchyProject, + fc.ResourceMappingResourceType: res.GetResourceType(), + fc.ResourceMappingResourceName: res.GetName(), + fc.ResourceMappingResourceNamespace: res.GetNamespace(), + }, &entities.ResourceMapping{ + ResourceHeirarchy: entities.ResourceHeirarchyProject, + + ResourceType: res.GetResourceType(), + ResourceName: res.GetName(), + ResourceNamespace: res.GetNamespace(), + + AccountName: ctx.AccountName, + ClusterName: *clusterName, + + ProjectName: projectName, + }) +} + +func (d *domain) GetEnvironmentResourceMapping(ctx ConsoleContext, resType entities.ResourceType, clusterName string, namespace string, name string) (*entities.ResourceMapping, error) { + return d.resourceMappingRepo.FindOne(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + fc.ResourceMappingResourceHeirarchy: entities.ResourceHeirarchyEnvironment, + fc.ResourceMappingResourceType: resType, + fc.ResourceMappingResourceName: name, + fc.ResourceMappingResourceNamespace: namespace, + }) +} + +func (d *domain) GetProjectResourceMapping(ctx ConsoleContext, resType entities.ResourceType, clusterName string, name string) (*entities.ResourceMapping, error) { + return d.resourceMappingRepo.FindOne(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + fc.ResourceMappingResourceHeirarchy: entities.ResourceHeirarchyProject, + fc.ResourceMappingResourceType: resType, + fc.ResourceMappingResourceName: name, + }) +} diff --git a/apps/console/internal/domain/router.go b/apps/console/internal/domain/router.go index c1500ea02..d9d818a1d 100644 --- a/apps/console/internal/domain/router.go +++ b/apps/console/internal/domain/router.go @@ -1,172 +1,248 @@ package domain import ( - "fmt" - "time" - - "kloudlite.io/apps/console/internal/domain/entities" - "kloudlite.io/pkg/repos" - t "kloudlite.io/pkg/types" + "github.com/kloudlite/api/apps/console/internal/entities" + fc "github.com/kloudlite/api/apps/console/internal/entities/field-constants" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + crdsv1 "github.com/kloudlite/operator/apis/crds/v1" + "github.com/kloudlite/operator/operators/resource-watcher/types" ) -// query - -func (d *domain) ListRouters(ctx ConsoleContext, namespace string) ([]*entities.Router, error) { - if err := d.canReadResourcesInProject(ctx, namespace); err != nil { - return nil, err +func (d *domain) ListRouters(ctx ResourceContext, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.Router], error) { + if err := d.canReadResourcesInEnvironment(ctx); err != nil { + return nil, errors.NewE(err) } - return d.routerRepo.Find(ctx, repos.Query{Filter: repos.Filter{ - "clusterName": ctx.ClusterName, - "accountName": ctx.AccountName, - "metadata.namespace": namespace, - }}) + + filter := ctx.DBFilters() + return d.routerRepo.FindPaginated(ctx, d.routerRepo.MergeMatchFilters(filter, search), pq) } -func (d *domain) findRouter(ctx ConsoleContext, namespace string, name string) (*entities.Router, error) { - router, err := d.routerRepo.FindOne(ctx, repos.Filter{ - "accountName": ctx.AccountName, - "clusterName": ctx.ClusterName, - "metadata.namespace": namespace, - "metadata.name": name, - }) +func (d *domain) findRouter(ctx ResourceContext, name string) (*entities.Router, error) { + filter := ctx.DBFilters() + filter.Add("metadata.name", name) + + router, err := d.routerRepo.FindOne( + ctx, + ctx.DBFilters().Add(fields.MetadataName, name), + ) if err != nil { - return nil, err + return nil, errors.NewE(err) } if router == nil { - return nil, fmt.Errorf("no router with name=%q,namespace=%q found", name, namespace) + return nil, errors.Newf("no router with name (%s) found", name) } return router, nil } -func (d *domain) GetRouter(ctx ConsoleContext, namespace string, name string) (*entities.Router, error) { - if err := d.canReadResourcesInProject(ctx, namespace); err != nil { - return nil, err +func (d *domain) GetRouter(ctx ResourceContext, name string) (*entities.Router, error) { + if err := d.canReadResourcesInEnvironment(ctx); err != nil { + return nil, errors.NewE(err) } - return d.findRouter(ctx, namespace, name) + return d.findRouter(ctx, name) } // mutations -func (d *domain) CreateRouter(ctx ConsoleContext, router entities.Router) (*entities.Router, error) { - if err := d.canMutateResourcesInProject(ctx, router.Namespace); err != nil { +func (d *domain) CreateRouter(ctx ResourceContext, router entities.Router) (*entities.Router, error) { + if err := d.canMutateResourcesInEnvironment(ctx); err != nil { + return nil, errors.NewE(err) + } + + namespace, err := d.envTargetNamespace(ctx.ConsoleContext, ctx.ProjectName, ctx.EnvironmentName) + if err != nil { return nil, err } + router.Namespace = namespace + router.EnsureGVK() - if err := d.k8sExtendedClient.ValidateStruct(ctx, &router.Router); err != nil { - return nil, err + if err := d.k8sClient.ValidateObject(ctx, &router.Router); err != nil { + return nil, errors.NewE(err) } + router.IncrementRecordVersion() + router.CreatedBy = common.CreatedOrUpdatedBy{ + UserId: ctx.UserId, + UserName: ctx.UserName, + UserEmail: ctx.UserEmail, + } + router.LastUpdatedBy = router.CreatedBy + router.AccountName = ctx.AccountName - router.ClusterName = ctx.ClusterName - router.Generation = 1 - router.SyncStatus = t.GenSyncStatus(t.SyncActionApply, router.Generation) + router.ProjectName = ctx.ProjectName + router.EnvironmentName = ctx.EnvironmentName + router.SyncStatus = t.GenSyncStatus(t.SyncActionApply, router.RecordVersion) + + router.Spec.Https = &crdsv1.Https{ + Enabled: true, + ForceRedirect: true, + } + + return d.createAndApplyRouter(ctx, &router) +} - r, err := d.routerRepo.Create(ctx, &router) +func (d *domain) createAndApplyRouter(ctx ResourceContext, router *entities.Router) (*entities.Router, error) { + router.SyncStatus = t.GenSyncStatus(t.SyncActionApply, 0) + if _, err := d.upsertEnvironmentResourceMapping(ctx, router); err != nil { + return nil, errors.NewE(err) + } + + nrouter, err := d.routerRepo.Create(ctx, router) if err != nil { if d.routerRepo.ErrAlreadyExists(err) { - return nil, fmt.Errorf("router with name=%q,namespace=%q already exists", router.Name, router.Namespace) + // TODO: better insights into error, when it is being caused by duplicated indexes + return nil, errors.NewE(err) } - return nil, err + return nil, errors.NewE(err) } + d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeRouter, nrouter.Name, PublishAdd) - if err := d.applyK8sResource(ctx, &r.Router); err != nil { - return r, err + if err := d.applyK8sResource(ctx, nrouter.ProjectName, &nrouter.Router, nrouter.RecordVersion); err != nil { + return nrouter, errors.NewE(err) } - return r, nil + return nrouter, nil } -func (d *domain) UpdateRouter(ctx ConsoleContext, router entities.Router) (*entities.Router, error) { - if err := d.canMutateResourcesInProject(ctx, router.Namespace); err != nil { - return nil, err +func (d *domain) UpdateRouter(ctx ResourceContext, router entities.Router) (*entities.Router, error) { + if err := d.canMutateResourcesInEnvironment(ctx); err != nil { + return nil, errors.NewE(err) } - router.EnsureGVK() - if err := d.k8sExtendedClient.ValidateStruct(ctx, &router.Router); err != nil { - return nil, err + router.Namespace = "trest" + if err := d.k8sClient.ValidateObject(ctx, &router.Router); err != nil { + return nil, errors.NewE(err) } - r, err := d.findRouter(ctx, router.Namespace, router.Name) - if err != nil { - return nil, err + if router.Spec.Https == nil { + router.Spec.Https = &crdsv1.Https{ + Enabled: true, + ForceRedirect: true, + } } - r.Spec = router.Spec - r.Generation += 1 - r.SyncStatus = t.GenSyncStatus(t.SyncActionApply, r.Generation) - - upRouter, err := d.routerRepo.UpdateById(ctx, r.Id, r) + patchForUpdate := common.PatchForUpdate( + ctx, + &router, + common.PatchOpts{ + XPatch: repos.Document{ + fc.AppSpec: router.Spec, + }, + }) + + upRouter, err := d.routerRepo.Patch( + ctx, + ctx.DBFilters().Add(fields.MetadataName, router.Name), + patchForUpdate, + ) if err != nil { - return nil, err + return nil, errors.NewE(err) } + d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeRouter, upRouter.Name, PublishUpdate) - if err := d.applyK8sResource(ctx, &upRouter.Router); err != nil { - return upRouter, err + if err := d.applyK8sResource(ctx, upRouter.ProjectName, &upRouter.Router, upRouter.RecordVersion); err != nil { + return upRouter, errors.NewE(err) } return upRouter, nil } -func (d *domain) DeleteRouter(ctx ConsoleContext, namespace string, name string) error { - if err := d.canMutateResourcesInProject(ctx, namespace); err != nil { - return err +func (d *domain) DeleteRouter(ctx ResourceContext, name string) error { + if err := d.canMutateResourcesInEnvironment(ctx); err != nil { + return errors.NewE(err) } - r, err := d.findRouter(ctx, namespace, name) + urouter, err := d.routerRepo.Patch( + ctx, + ctx.DBFilters().Add(fields.MetadataName, name), + common.PatchForMarkDeletion(), + ) if err != nil { - return err + return errors.NewE(err) } - r.SyncStatus = t.GenSyncStatus(t.SyncActionDelete, r.Generation) - if _, err := d.routerRepo.UpdateById(ctx, r.Id, r); err != nil { - return err - } + d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeRouter, urouter.Name, PublishUpdate) - return d.deleteK8sResource(ctx, &r.Router) + if err := d.deleteK8sResource(ctx, urouter.ProjectName, &urouter.Router); err != nil { + if errors.Is(err, ErrNoClusterAttached) { + return d.routerRepo.DeleteById(ctx, urouter.Id) + } + return errors.NewE(err) + } + return nil } -func (d *domain) OnDeleteRouterMessage(ctx ConsoleContext, app entities.Router) error { - a, err := d.findRouter(ctx, app.Namespace, app.Name) +func (d *domain) OnRouterDeleteMessage(ctx ResourceContext, router entities.Router) error { + err := d.routerRepo.DeleteOne( + ctx, + ctx.DBFilters().Add(fields.MetadataName, router.Name), + ) if err != nil { - return err + return errors.NewE(err) } - return d.routerRepo.DeleteById(ctx, a.Id) + d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeRouter, router.Name, PublishDelete) + return nil } -func (d *domain) OnUpdateRouterMessage(ctx ConsoleContext, router entities.Router) error { - r, err := d.findRouter(ctx, router.Namespace, router.Name) +func (d *domain) OnRouterUpdateMessage(ctx ResourceContext, router entities.Router, status types.ResourceStatus, opts UpdateAndDeleteOpts) error { + xRouter, err := d.findRouter(ctx, router.Name) if err != nil { - return err + return errors.NewE(err) } - r.Status = router.Status - r.SyncStatus.Error = nil - r.SyncStatus.LastSyncedAt = time.Now() - r.SyncStatus.Generation = router.Generation - r.SyncStatus.State = t.ParseSyncState(router.Status.IsReady) + if xRouter == nil { + return errors.Newf("no router found") + } - _, err = d.routerRepo.UpdateById(ctx, r.Id, r) - return err -} + recordVersion, err := d.MatchRecordVersion(router.Annotations, xRouter.RecordVersion) + if err != nil { + return d.resyncK8sResource(ctx, xRouter.ProjectName, xRouter.SyncStatus.Action, &xRouter.Router, xRouter.RecordVersion) + } -func (d *domain) OnApplyRouterError(ctx ConsoleContext, errMsg string, namespace string, name string) error { - m, err2 := d.findRouter(ctx, namespace, name) - if err2 != nil { - return err2 + urouter, err := d.routerRepo.PatchById( + ctx, + xRouter.Id, + common.PatchForSyncFromAgent(&router, recordVersion, status, common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + })) + if err != nil { + return errors.NewE(err) } - m.SyncStatus.Error = &errMsg - _, err := d.routerRepo.UpdateById(ctx, m.Id, m) - return err + d.resourceEventPublisher.PublishResourceEvent(ctx, urouter.GetResourceType(), urouter.GetName(), PublishUpdate) + return nil } -func (d *domain) ResyncRouter(ctx ConsoleContext, namespace, name string) error { - r, err := d.findRouter(ctx, namespace, name) +func (d *domain) OnRouterApplyError(ctx ResourceContext, errMsg string, name string, opts UpdateAndDeleteOpts) error { + urouter, err := d.routerRepo.Patch( + ctx, + ctx.DBFilters().Add(fields.MetadataName, name), + common.PatchForErrorFromAgent( + errMsg, + common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + }, + ), + ) if err != nil { return err } - return d.resyncK8sResource(ctx, r.SyncStatus.Action, &r.Router) + d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeRouter, urouter.Name, PublishDelete) + + return nil +} + +func (d *domain) ResyncRouter(ctx ResourceContext, name string) error { + router, err := d.findRouter(ctx, name) + if err != nil { + return errors.NewE(err) + } + + return d.resyncK8sResource(ctx, router.ProjectName, router.SyncStatus.Action, &router.Router, router.RecordVersion) } diff --git a/apps/console/internal/domain/secret.go b/apps/console/internal/domain/secret.go index 7dadec53b..867d9e01f 100644 --- a/apps/console/internal/domain/secret.go +++ b/apps/console/internal/domain/secret.go @@ -1,177 +1,287 @@ package domain import ( - "fmt" - "time" - - "kloudlite.io/apps/console/internal/domain/entities" - "kloudlite.io/pkg/repos" - t "kloudlite.io/pkg/types" + "github.com/kloudlite/api/apps/console/internal/entities" + fc "github.com/kloudlite/api/apps/console/internal/entities/field-constants" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/errors" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + "github.com/kloudlite/operator/operators/resource-watcher/types" ) -// query +func (d *domain) ListSecrets(ctx ResourceContext, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.Secret], error) { + if err := d.canReadResourcesInEnvironment(ctx); err != nil { + return nil, errors.NewE(err) + } + + filters := ctx.DBFilters() + return d.secretRepo.FindPaginated(ctx, d.secretRepo.MergeMatchFilters(filters, search), pq) +} -func (d *domain) ListSecrets(ctx ConsoleContext, namespace string) ([]*entities.Secret, error) { - if err := d.canReadResourcesInWorkspace(ctx, namespace); err != nil { - return nil, err +func (d *domain) findSecret(ctx ResourceContext, name string) (*entities.Secret, error) { + xSecret, err := d.secretRepo.FindOne( + ctx, + ctx.DBFilters().Add(fields.MetadataName, name), + ) + if err != nil { + return nil, errors.NewE(err) + } + if xSecret == nil { + return nil, errors.Newf("no secret with name (%s) found", name) } + return xSecret, nil +} - return d.secretRepo.Find(ctx, repos.Query{Filter: repos.Filter{ - "accountName": ctx.AccountName, - "clusterName": ctx.ClusterName, - "metadata.namespace": namespace, - }}) +func (d *domain) GetSecret(ctx ResourceContext, name string) (*entities.Secret, error) { + if err := d.canReadResourcesInEnvironment(ctx); err != nil { + return nil, errors.NewE(err) + } + return d.findSecret(ctx, name) } -func (d *domain) findSecret(ctx ConsoleContext, namespace string, name string) (*entities.Secret, error) { - scrt, err := d.secretRepo.FindOne(ctx, repos.Filter{ - "accountName": ctx.AccountName, - "clusterName": ctx.ClusterName, - "metadata.namespace": namespace, - "metadata.name": name, +// GetSecretEntries implements Domain. +func (d *domain) GetSecretEntries(ctx ResourceContext, keyrefs []SecretKeyRef) ([]*SecretKeyValueRef, error) { + filters := ctx.DBFilters() + + names := make([]any, 0, len(keyrefs)) + for i := range keyrefs { + names = append(names, keyrefs[i].SecretName) + } + + filters = d.secretRepo.MergeMatchFilters(filters, map[string]repos.MatchFilter{ + fields.MetadataName: { + MatchType: repos.MatchTypeArray, + Array: names, + }, }) + + secrets, err := d.secretRepo.Find(ctx, repos.Query{Filter: filters}) if err != nil { - return nil, err + return nil, errors.NewE(err) } - if scrt == nil { - return nil, fmt.Errorf("no secret with name=%s,namespace=%s found", name, namespace) + + results := make([]*SecretKeyValueRef, 0, len(secrets)) + + data := make(map[string]map[string]string) + + for i := range secrets { + m := make(map[string]string, len(secrets[i].Data)) + for k, v := range secrets[i].Data { + m[k] = string(v) + } + + for k, v := range secrets[i].StringData { + m[k] = string(v) + } + + data[secrets[i].Name] = m } - return scrt, nil -} -func (d *domain) GetSecret(ctx ConsoleContext, namespace string, name string) (*entities.Secret, error) { - if err := d.canReadResourcesInWorkspace(ctx, namespace); err != nil { - return nil, err + for i := range keyrefs { + results = append(results, &SecretKeyValueRef{ + SecretName: keyrefs[i].SecretName, + Key: keyrefs[i].Key, + Value: data[keyrefs[i].SecretName][keyrefs[i].Key], + }) } - return d.findSecret(ctx, namespace, name) + + return results, nil } -// mutations +func (d *domain) CreateSecret(ctx ResourceContext, secret entities.Secret) (*entities.Secret, error) { + if err := d.canMutateResourcesInEnvironment(ctx); err != nil { + return nil, errors.NewE(err) + } -func (d *domain) CreateSecret(ctx ConsoleContext, secret entities.Secret) (*entities.Secret, error) { - if err := d.canMutateResourcesInWorkspace(ctx, secret.Namespace); err != nil { - return nil, err + targetNamespace, err := d.envTargetNamespace(ctx.ConsoleContext, ctx.ProjectName, ctx.EnvironmentName) + if err != nil { + return nil, errors.NewE(err) } - secret.EnsureGVK() - if err := d.k8sExtendedClient.ValidateStruct(ctx, &secret.Secret); err != nil { - return nil, err + secret.SetGroupVersionKind(fn.GVK("v1", "Secret")) + + secret.Namespace = targetNamespace + + secret.IncrementRecordVersion() + secret.CreatedBy = common.CreatedOrUpdatedBy{ + UserId: ctx.UserId, + UserName: ctx.UserName, + UserEmail: ctx.UserEmail, } + secret.LastUpdatedBy = secret.CreatedBy secret.AccountName = ctx.AccountName - secret.ClusterName = ctx.ClusterName - secret.Generation = 1 - secret.SyncStatus = t.GenSyncStatus(t.SyncActionApply, secret.Generation) + secret.ProjectName = ctx.ProjectName + secret.EnvironmentName = ctx.EnvironmentName + secret.SyncStatus = t.GenSyncStatus(t.SyncActionApply, secret.RecordVersion) + + return d.createAndApplySecret(ctx, &secret) +} - s, err := d.secretRepo.Create(ctx, &secret) +func (d *domain) createAndApplySecret(ctx ResourceContext, secret *entities.Secret) (*entities.Secret, error) { + if _, err := d.upsertEnvironmentResourceMapping(ctx, secret); err != nil { + return nil, errors.NewE(err) + } + + nsecret, err := d.secretRepo.Create(ctx, secret) if err != nil { if d.secretRepo.ErrAlreadyExists(err) { - return nil, fmt.Errorf("secret with name %q, already exists", secret.Name) + // TODO: better insights into error, when it is being caused by duplicated indexes + return nil, errors.NewE(err) } - return nil, err + return nil, errors.NewE(err) } - if err := d.applyK8sResource(ctx, &s.Secret); err != nil { - return s, err + if nsecret.Annotations == nil { + nsecret.Annotations = make(map[string]string) } - return s, nil -} + for k, v := range types.SecretWatchingAnnotation { + nsecret.Annotations[k] = v + } -func (d *domain) UpdateSecret(ctx ConsoleContext, secret entities.Secret) (*entities.Secret, error) { - if err := d.canMutateResourcesInWorkspace(ctx, secret.Namespace); err != nil { - return nil, err + if err := d.applyK8sResource(ctx, nsecret.ProjectName, &nsecret.Secret, nsecret.RecordVersion); err != nil { + return nsecret, errors.NewE(err) } - secret.EnsureGVK() - if err := d.k8sExtendedClient.ValidateStruct(ctx, &secret.Secret); err != nil { - return nil, err + return nsecret, nil +} + +func (d *domain) UpdateSecret(ctx ResourceContext, secret entities.Secret) (*entities.Secret, error) { + if err := d.canMutateResourcesInEnvironment(ctx); err != nil { + return nil, errors.NewE(err) } - s, err := d.findSecret(ctx, secret.Namespace, secret.Name) + patchForUpdate := common.PatchForUpdate( + ctx, + &secret, + common.PatchOpts{ + XPatch: repos.Document{ + fc.SecretData: secret.Data, + fc.SecretStringData: secret.StringData, + }, + }) + + upSecret, err := d.secretRepo.Patch( + ctx, + ctx.DBFilters().Add(fields.MetadataName, secret.Name), + patchForUpdate, + ) if err != nil { - return nil, err + return nil, errors.NewE(err) } - s.Data = secret.Data - s.StringData = secret.StringData - s.Generation += 1 - s.SyncStatus = t.GenSyncStatus(t.SyncActionApply, s.Generation) + if upSecret.Annotations == nil { + upSecret.Annotations = make(map[string]string) + } - upSecret, err := d.secretRepo.UpdateById(ctx, s.Id, s) - if err != nil { - return nil, err + for k, v := range types.SecretWatchingAnnotation { + upSecret.Annotations[k] = v } - if err := d.applyK8sResource(ctx, &upSecret.Secret); err != nil { - return upSecret, err + d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeSecret, upSecret.Name, PublishUpdate) + + if err := d.applyK8sResource(ctx, upSecret.ProjectName, &upSecret.Secret, upSecret.RecordVersion); err != nil { + return upSecret, errors.NewE(err) } return upSecret, nil } -func (d *domain) DeleteSecret(ctx ConsoleContext, namespace string, name string) error { - if err := d.canMutateResourcesInWorkspace(ctx, namespace); err != nil { - return err +func (d *domain) DeleteSecret(ctx ResourceContext, name string) error { + if err := d.canMutateResourcesInEnvironment(ctx); err != nil { + return errors.NewE(err) } - s, err := d.findSecret(ctx, namespace, name) + usecret, err := d.secretRepo.Patch( + ctx, + ctx.DBFilters().Add(fields.MetadataName, name), + common.PatchForMarkDeletion(), + ) if err != nil { - return err - } - s.SyncStatus = t.GetSyncStatusForDeletion(s.Generation) - if _, err := d.secretRepo.UpdateById(ctx, s.Id, s); err != nil { - return err + return errors.NewE(err) } - return d.deleteK8sResource(ctx, &s.Secret) + d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeSecret, usecret.Name, PublishUpdate) + + if err := d.deleteK8sResource(ctx, usecret.ProjectName, &usecret.Secret); err != nil { + if errors.Is(err, ErrNoClusterAttached) { + return d.secretRepo.DeleteById(ctx, usecret.Id) + } + return errors.NewE(err) + } + return nil } -func (d *domain) OnDeleteSecretMessage(ctx ConsoleContext, secret entities.Secret) error { - s, err := d.findSecret(ctx, secret.Namespace, secret.Name) +func (d *domain) OnSecretDeleteMessage(ctx ResourceContext, secret entities.Secret) error { + err := d.secretRepo.DeleteOne( + ctx, + ctx.DBFilters().Add(fields.MetadataName, secret.Name), + ) if err != nil { - return err + return errors.NewE(err) } - return d.secretRepo.DeleteById(ctx, s.Id) + d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeSecret, secret.Name, PublishDelete) + + return nil } -func (d *domain) OnUpdateSecretMessage(ctx ConsoleContext, secret entities.Secret) error { - s, err := d.findSecret(ctx, secret.Namespace, secret.Name) +func (d *domain) OnSecretUpdateMessage(ctx ResourceContext, secretIn entities.Secret, status types.ResourceStatus, opts UpdateAndDeleteOpts) error { + xSecret, err := d.findSecret(ctx, secretIn.Name) if err != nil { - return err + return errors.NewE(err) } - s.Status = secret.Status - s.SyncStatus.Error = nil - s.SyncStatus.LastSyncedAt = time.Now() - s.SyncStatus.Generation = secret.Generation - s.SyncStatus.State = t.ParseSyncState(secret.Status.IsReady) + recordVersion, err := d.MatchRecordVersion(secretIn.Annotations, xSecret.RecordVersion) + if err != nil { + return d.resyncK8sResource(ctx, xSecret.ProjectName, xSecret.SyncStatus.Action, &xSecret.Secret, xSecret.RecordVersion) + } + + usecret, err := d.secretRepo.PatchById( + ctx, + xSecret.Id, + common.PatchForSyncFromAgent(&secretIn, recordVersion, status, common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + })) + + d.resourceEventPublisher.PublishResourceEvent(ctx, usecret.GetResourceType(), usecret.GetName(), PublishUpdate) - _, err = d.secretRepo.UpdateById(ctx, s.Id, s) - return err + return errors.NewE(err) } -func (d *domain) OnApplySecretError(ctx ConsoleContext, errMsg, namespace, name string) error { - s, err2 := d.findSecret(ctx, namespace, name) - if err2 != nil { - return err2 +func (d *domain) OnSecretApplyError(ctx ResourceContext, errMsg, name string, opts UpdateAndDeleteOpts) error { + usecret, err := d.secretRepo.Patch( + ctx, + ctx.DBFilters().Add(fields.MetadataName, name), + common.PatchForErrorFromAgent( + errMsg, + common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + }, + ), + ) + if err != nil { + return errors.NewE(err) } - s.SyncStatus.Error = &errMsg - _, err := d.secretRepo.UpdateById(ctx, s.Id, s) - return err + d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeSecret, usecret.Name, PublishDelete) + + return errors.NewE(err) } -func (d *domain) ResyncSecret(ctx ConsoleContext, namespace, name string) error { - if err := d.canMutateResourcesInWorkspace(ctx, namespace); err != nil { - return err +func (d *domain) ResyncSecret(ctx ResourceContext, name string) error { + if err := d.canMutateResourcesInEnvironment(ctx); err != nil { + return errors.NewE(err) } - s, err := d.findSecret(ctx, namespace, name) + secret, err := d.findSecret(ctx, name) if err != nil { - return err + return errors.NewE(err) } - return d.resyncK8sResource(ctx, s.SyncStatus.Action, &s.Secret) + return d.resyncK8sResource(ctx, secret.ProjectName, secret.SyncStatus.Action, &secret.Secret, secret.RecordVersion) } diff --git a/apps/console/internal/domain/vpn-device.go b/apps/console/internal/domain/vpn-device.go new file mode 100644 index 000000000..7d944b170 --- /dev/null +++ b/apps/console/internal/domain/vpn-device.go @@ -0,0 +1,541 @@ +package domain + +import ( + "fmt" + + "github.com/kloudlite/api/apps/console/internal/entities" + fc "github.com/kloudlite/api/apps/console/internal/entities/field-constants" + iamT "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + wgv1 "github.com/kloudlite/operator/apis/wireguard/v1" + "github.com/kloudlite/operator/operators/resource-watcher/types" + "k8s.io/utils/strings/slices" +) + +func (d *domain) findVPNDevice(ctx ConsoleContext, name string) (*entities.ConsoleVPNDevice, error) { + device, err := d.vpnDeviceRepo.FindOne(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataName: name, + }) + if err != nil { + return nil, errors.NewE(err) + } + + if device == nil { + return nil, errors.Newf("no vpn device with name=%q found", name) + } + + return device, nil +} + +func (d *domain) getClusterFromDevice(ctx ConsoleContext, device *entities.ConsoleVPNDevice) (string, error) { + if device == nil { + return "", errors.Newf("device is nil") + } + + if device.ProjectName == nil && device.ClusterName != nil { + return *device.ClusterName, nil + } + + if device.ProjectName == nil { + return "", errors.NewE(errors.Newf("project name is nil")) + } + + cluster, err := d.getClusterAttachedToProject(ctx, *device.ProjectName) + if err != nil { + return "", errors.NewE(err) + } + if cluster == nil { + return "", errors.NewE(errors.Newf("no cluster attached to project %s", *device.ProjectName)) + } + return *cluster, nil +} + +func (d *domain) updateVpnOnCluster(ctx ConsoleContext, ndev, xdev *entities.ConsoleVPNDevice) error { + ndev.Namespace = d.envVars.DeviceNamespace + ndev.EnsureGVK() + if err := d.k8sClient.ValidateObject(ctx, &ndev.Device); err != nil { + return errors.NewE(err) + } + + if (ndev.ProjectName != nil && ndev.EnvironmentName != nil) || ndev.ClusterName != nil { + if err := d.applyVPNDevice(ctx, ndev); err != nil { + return errors.NewE(err) + } + } + + if (xdev.ProjectName != nil && (ndev.ProjectName == nil || *xdev.ProjectName != *ndev.ProjectName)) || + (xdev.ClusterName != nil && (ndev.ClusterName == nil || *xdev.ClusterName != *ndev.ClusterName)) { + xdev.Spec.Disabled = true + if err := d.applyVPNDevice(ctx, xdev); err != nil { + return errors.NewE(err) + } + } + + return nil +} + +func (d *domain) ListVPNDevices(ctx ConsoleContext, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.ConsoleVPNDevice], error) { + if err := d.canPerformActionInAccount(ctx, iamT.ListVPNDevices); err != nil { + return nil, errors.NewE(err) + } + + filter := repos.Filter{"accountName": ctx.AccountName} + return d.vpnDeviceRepo.FindPaginated(ctx, d.vpnDeviceRepo.MergeMatchFilters(filter, search), pagination) +} + +func (d *domain) ListVPNDevicesForUser(ctx ConsoleContext) ([]*entities.ConsoleVPNDevice, error) { + if err := d.canPerformActionInAccount(ctx, iamT.ListVPNDevices); err != nil { + return nil, errors.NewE(err) + } + + return d.vpnDeviceRepo.Find(ctx, repos.Query{ + Filter: repos.Filter{ + "createdBy.userId": ctx.UserId, + }, + }) +} + +func (d *domain) GetVPNDevice(ctx ConsoleContext, name string) (*entities.ConsoleVPNDevice, error) { + if err := d.canPerformActionInAccount(ctx, iamT.GetVPNDevice); err != nil { + return nil, errors.NewE(err) + } + + device, err := d.findVPNDevice(ctx, name) + if err != nil { + return nil, errors.NewE(err) + } + + clusterName, err := d.getClusterFromDevice(ctx, device) + if err != nil { + return nil, errors.NewE(err) + } + + if device.WireguardConfigs == nil || device.WireguardConfigs[clusterName].Value == "" { + return nil, errors.Newf("no wireguard configs found") + } + + device.WireguardConfig = device.WireguardConfigs[clusterName] + + return device, nil +} + +func (d *domain) applyVPNDevice(ctx ConsoleContext, device *entities.ConsoleVPNDevice) error { + if device.ProjectName != nil { + if err := d.applyK8sResource(ctx, *device.ProjectName, &device.Device, device.RecordVersion); err != nil { + return errors.NewE(err) + } + + return nil + } + + if device.ClusterName != nil { + if err := d.applyK8sResourceOnCluster(ctx, *device.ClusterName, &device.Device, device.RecordVersion); err != nil { + return errors.NewE(err) + } + } + + return nil +} + +func (d *domain) CreateVPNDevice(ctx ConsoleContext, device entities.ConsoleVPNDevice) (*entities.ConsoleVPNDevice, error) { + if err := d.canPerformActionInAccount(ctx, iamT.CreateVPNDevice); err != nil { + return nil, errors.NewE(err) + } + + device.Namespace = d.envVars.DeviceNamespace + + device.EnsureGVK() + if err := d.k8sClient.ValidateObject(ctx, &device.Device); err != nil { + return nil, errors.NewE(err) + } + + device.IncrementRecordVersion() + device.CreatedBy = common.CreatedOrUpdatedBy{ + UserId: ctx.UserId, + UserName: ctx.UserName, + UserEmail: ctx.UserEmail, + } + device.LastUpdatedBy = device.CreatedBy + + device.AccountName = ctx.AccountName + device.LinkedClusters = []string{} + + device.SyncStatus = t.GenSyncStatus(t.SyncActionApply, device.RecordVersion) + + if device.ProjectName != nil && device.EnvironmentName != nil { + s, err := d.envTargetNamespace(ctx, *device.ProjectName, *device.EnvironmentName) + if err != nil { + return nil, errors.NewE(err) + } + + device.Spec.ActiveNamespace = &s + + clusterName, err := d.getClusterFromDevice(ctx, &device) + if err != nil { + return nil, errors.NewE(err) + } + + device.LinkedClusters = append(device.LinkedClusters, clusterName) + } + + if _, err := d.iamClient.AddMembership(ctx, &iam.AddMembershipIn{ + UserId: string(ctx.UserId), + ResourceType: string(iamT.ResourceConsoleVPNDevice), + ResourceRef: iamT.NewResourceRef(ctx.AccountName, iamT.ResourceConsoleVPNDevice, device.Name), + Role: string(iamT.RoleResourceOwner), + }); err != nil { + return nil, errors.NewE(err) + } + + nDevice, err := d.vpnDeviceRepo.Create(ctx, &device) + if err != nil { + if d.vpnDeviceRepo.ErrAlreadyExists(err) { + // TODO: better insights into error, when it is being caused by duplicated indexes + return nil, errors.NewE(err) + } + return nil, errors.NewE(err) + } + + d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeVPNDevice, nDevice.Name, PublishAdd) + + if device.ProjectName == nil || device.EnvironmentName == nil { + return nDevice, nil + } + + if err := d.applyVPNDevice(ctx, nDevice); err != nil { + return nDevice, err + } + return nDevice, nil +} + +func (d *domain) ActivateVPNDeviceOnNamespace(ctx ConsoleContext, devName string, namespace string) (device error) { + if err := d.canPerformActionInDevice(ctx, iamT.UpdateVPNDevice, devName); err != nil { + return errors.NewE(err) + } + + xDevice, err := d.findVPNDevice(ctx, devName) + if err != nil { + return errors.NewE(err) + } + + patchForUpdate := common.PatchForUpdate( + ctx, + xDevice, + common.PatchOpts{ + XPatch: repos.Document{ + fc.ConsoleVPNDeviceSpecActiveNamespace: namespace, + }, + }) + + upDevice, err := d.vpnDeviceRepo.PatchById(ctx, xDevice.Id, patchForUpdate) + if err != nil { + return errors.NewE(err) + } + d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeVPNDevice, devName, PublishUpdate) + + if err := d.applyVPNDevice(ctx, upDevice); err != nil { + return errors.NewE(err) + } + + return nil +} + +func (d *domain) updateVpnDevice(ctx ConsoleContext, device entities.ConsoleVPNDevice, projectName, envName, clusterName *string) (*entities.ConsoleVPNDevice, error) { + if err := d.canPerformActionInDevice(ctx, iamT.UpdateVPNDevice, device.Name); err != nil { + return nil, errors.NewE(err) + } + + xdevice, err := d.findVPNDevice(ctx, device.Name) + if err != nil { + return nil, errors.NewE(err) + } + + linkedClusters := xdevice.LinkedClusters + + device.Spec.ActiveNamespace = nil + + if clusterName != nil && !slices.Contains(linkedClusters, *clusterName) { + linkedClusters = append(linkedClusters, *clusterName) + } + + if projectName != nil && envName != nil { + activeNamespace, err := d.envTargetNamespace(ctx, *projectName, *envName) + if err != nil { + return nil, errors.NewE(err) + } + device.Spec.ActiveNamespace = &activeNamespace + + cName, err := d.getClusterAttachedToProject(ctx, *projectName) + if err != nil { + return nil, errors.NewE(err) + } + + if cName != nil && !slices.Contains(linkedClusters, *cName) { + linkedClusters = append(linkedClusters, *cName) + } + } + + device.ClusterName = nil + if clusterName != nil { + device.ClusterName = clusterName + + device.ProjectName = nil + device.EnvironmentName = nil + } + + patchForUpdate := common.PatchForUpdate( + ctx, + &device, + common.PatchOpts{ + XPatch: repos.Document{ + fc.ConsoleVPNDeviceSpec: device.Spec, + fields.ProjectName: device.ProjectName, + fields.EnvironmentName: device.EnvironmentName, + fields.ClusterName: device.ClusterName, + fc.ConsoleVPNDeviceLinkedClusters: linkedClusters, + }, + }) + + upDevice, err := d.vpnDeviceRepo.Patch(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataName: device.Name, + }, patchForUpdate) + if err != nil { + return nil, errors.NewE(err) + } + + d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeVPNDevice, device.Name, PublishUpdate) + + if err := d.updateVpnOnCluster(ctx, upDevice, xdevice); err != nil { + return nil, errors.NewE(err) + } + + return upDevice, nil +} + +func (d *domain) UpdateVPNDevice(ctx ConsoleContext, device entities.ConsoleVPNDevice) (*entities.ConsoleVPNDevice, error) { + return d.updateVpnDevice(ctx, device, device.ProjectName, device.EnvironmentName, nil) +} + +func (d *domain) DeleteVPNDevice(ctx ConsoleContext, name string) error { + if err := d.canPerformActionInDevice(ctx, iamT.DeleteVPNDevice, name); err != nil { + return errors.NewE(err) + } + + upDevice, err := d.vpnDeviceRepo.Patch( + ctx, + repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataName: name, + }, + common.PatchForMarkDeletion(), + ) + if err != nil { + return errors.NewE(err) + } + + d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeVPNDevice, name, PublishUpdate) + + for _, v := range upDevice.LinkedClusters { + if err := d.deleteK8sResourceOfCluster(ctx, v, &upDevice.Device); err != nil { + return errors.NewE(err) + } + } + + return nil +} + +func (d *domain) UpdateVpnDevicePorts(ctx ConsoleContext, devName string, ports []*wgv1.Port) error { + if err := d.canPerformActionInDevice(ctx, iamT.UpdateVPNDevice, devName); err != nil { + return errors.NewE(err) + } + + xdevice, err := d.findVPNDevice(ctx, devName) + if err != nil { + return errors.NewE(err) + } + + var p []wgv1.Port + for _, port := range ports { + p = append(p, *port) + } + + patchForUpdate := common.PatchForUpdate( + ctx, + xdevice, + common.PatchOpts{ + XPatch: repos.Document{ + fc.ConsoleVPNDeviceSpecPorts: p, + }, + }) + + upDevice, err := d.vpnDeviceRepo.Patch(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataName: devName, + }, patchForUpdate) + if err != nil { + return errors.NewE(err) + } + + if err := d.applyVPNDevice(ctx, upDevice); err != nil { + return errors.NewE(err) + } + + d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeVPNDevice, devName, PublishUpdate) + return nil +} + +func (d *domain) ActivateVpnDeviceOnEnvironment(ctx ConsoleContext, devName string, projectName string, envName string) error { + xdevice, err := d.findVPNDevice(ctx, devName) + if err != nil { + return errors.NewE(err) + } + + xdevice.ProjectName = &projectName + xdevice.EnvironmentName = &envName + + _, err = d.updateVpnDevice(ctx, *xdevice, xdevice.ProjectName, xdevice.EnvironmentName, nil) + if err != nil { + return errors.NewE(err) + } + return nil +} + +func (d *domain) ActivateVpnDeviceOnCluster(ctx ConsoleContext, devName string, clusterName string) error { + if err := d.canPerformActionInAccount(ctx, iamT.GetCluster); err != nil { + return errors.NewE(err) + } + + xdevice, err := d.findVPNDevice(ctx, devName) + if err != nil { + return errors.NewE(err) + } + + // TODO: check if cluster exists in account + + xdevice.ClusterName = &clusterName + _, err = d.updateVpnDevice(ctx, *xdevice, nil, nil, &clusterName) + if err != nil { + return errors.NewE(err) + } + + return nil +} + +func (d *domain) OnVPNDeviceUpdateMessage(ctx ConsoleContext, device entities.ConsoleVPNDevice, status types.ResourceStatus, opts UpdateAndDeleteOpts, clusterName string) error { + xdevice, err := d.findVPNDevice(ctx, device.Name) + if err != nil { + return errors.NewE(err) + } + + recordVersion, err := d.MatchRecordVersion(device.Annotations, xdevice.RecordVersion) + if err != nil { + if xdevice.ProjectName != nil { + return d.resyncK8sResource(ctx, *xdevice.ProjectName, xdevice.SyncStatus.Action, &xdevice.Device, xdevice.RecordVersion) + } + } + + upDevice, err := d.vpnDeviceRepo.PatchById( + ctx, + xdevice.Id, + common.PatchForSyncFromAgent( + &device, + recordVersion, + status, + common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + XPatch: repos.Document{ + fmt.Sprintf("%s.%s", fc.ConsoleVPNDeviceWireguardConfigs, clusterName): device.WireguardConfig, + }, + })) + if err != nil { + return errors.NewE(err) + } + + d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeVPNDevice, upDevice.Name, PublishUpdate) + + return nil +} + +func (d *domain) OnVPNDeviceDeleteMessage(ctx ConsoleContext, device entities.ConsoleVPNDevice) error { + xdevice, err := d.findVPNDevice(ctx, device.Name) + if err != nil { + return errors.NewE(err) + } + + var linkedClusters []string + if device.ProjectName != nil { + clusterName, err := d.getClusterAttachedToProject(ctx, *device.ProjectName) + if err != nil { + return errors.NewE(err) + } + if clusterName == nil { + return errors.Newf("No Cluster found") + } + var linkedClusters []string + slices.Filter(linkedClusters, xdevice.LinkedClusters, func(item string) bool { + return item != *clusterName + }) + } + + if len(linkedClusters) == 0 { + err := d.vpnDeviceRepo.DeleteOne( + ctx, + repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataName: device.Name, + }, + ) + if err != nil { + return errors.NewE(err) + } + + if _, err = d.iamClient.RemoveResource(ctx, &iam.RemoveResourceIn{ + ResourceRef: iamT.NewResourceRef(ctx.AccountName, iamT.ResourceConsoleVPNDevice, device.Name), + }); err != nil { + return errors.NewE(err) + } + + d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeVPNDevice, device.Name, PublishDelete) + return nil + } + + patchForUpdate := common.PatchForUpdate( + ctx, + xdevice, + common.PatchOpts{ + XPatch: repos.Document{ + fc.ConsoleVPNDeviceLinkedClusters: linkedClusters, + }, + }) + _, err = d.vpnDeviceRepo.PatchById(ctx, xdevice.Id, patchForUpdate) + + return errors.NewE(err) +} + +func (d *domain) OnVPNDeviceApplyError(ctx ConsoleContext, errMsg string, name string, opts UpdateAndDeleteOpts) error { + udevice, err := d.vpnDeviceRepo.Patch( + ctx, + repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataName: name, + }, + common.PatchForErrorFromAgent( + errMsg, + common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + }, + ), + ) + if err != nil { + return errors.NewE(err) + } + d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeVPNDevice, udevice.Name, PublishDelete) + return errors.NewE(err) +} diff --git a/apps/console/internal/domain/workspace.go b/apps/console/internal/domain/workspace.go deleted file mode 100644 index 7de9fae04..000000000 --- a/apps/console/internal/domain/workspace.go +++ /dev/null @@ -1,232 +0,0 @@ -package domain - -import ( - "fmt" - "time" - - "github.com/kloudlite/operator/pkg/constants" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "kloudlite.io/apps/console/internal/domain/entities" - "kloudlite.io/pkg/repos" - t "kloudlite.io/pkg/types" -) - -// environment:query - -func (d *domain) findWorkspace(ctx ConsoleContext, namespace, name string) (*entities.Workspace, error) { - env, err := d.workspaceRepo.FindOne(ctx, repos.Filter{ - "accountName": ctx.AccountName, - "clusterName": ctx.ClusterName, - "metadata.namespace": namespace, - "metadata.name": name, - }) - - if err != nil { - return nil, err - } - if env == nil { - return nil, fmt.Errorf("no environment with name=%q found", name) - } - return env, nil -} - -func (d *domain) GetWorkspace(ctx ConsoleContext, namespace, name string) (*entities.Workspace, error) { - if err := d.canReadResourcesInProject(ctx, namespace); err != nil { - return nil, err - } - return d.findWorkspace(ctx, namespace, name) -} - -func (d *domain) ListWorkspaces(ctx ConsoleContext, namespace string) ([]*entities.Workspace, error) { - if err := d.canReadResourcesInProject(ctx, namespace); err != nil { - return nil, err - } - - filter := repos.Filter{ - "accountName": ctx.AccountName, - "clusterName": ctx.ClusterName, - "metadata.namespace": namespace, - } - return d.workspaceRepo.Find(ctx, repos.Query{Filter: filter}) -} - -func (d *domain) findWorkspaceByTargetNs(ctx ConsoleContext, targetNs string) (*entities.Workspace, error) { - w, err := d.workspaceRepo.FindOne(ctx, repos.Filter{ - "accountName": ctx.AccountName, - "clusterName": ctx.ClusterName, - "spec.targetNamespace": targetNs, - }) - if err != nil { - return nil, err - } - - if w == nil { - return nil, fmt.Errorf("no workspace found for target namespace %q", targetNs) - } - - return w, nil -} - -// mutations - -func (d *domain) CreateWorkspace(ctx ConsoleContext, env entities.Workspace) (*entities.Workspace, error) { - env.EnsureGVK() - if err := d.k8sExtendedClient.ValidateStruct(ctx, &env.Env); err != nil { - return nil, err - } - - if err := d.canMutateResourcesInProject(ctx, env.Namespace); err != nil { - return nil, err - } - - env.AccountName = ctx.AccountName - env.ClusterName = ctx.ClusterName - env.Generation = 1 - env.SyncStatus = t.GenSyncStatus(t.SyncActionApply, env.Generation) - - nEnv, err := d.workspaceRepo.Create(ctx, &env) - if err != nil { - if d.workspaceRepo.ErrAlreadyExists(err) { - return nil, fmt.Errorf( - "environment with name %q, namespace=%q already exists", - env.Name, - env.Namespace, - ) - } - return nil, err - } - - if err := d.applyK8sResource(ctx, &corev1.Namespace{ - TypeMeta: metav1.TypeMeta{APIVersion: "v1", Kind: "Namespace"}, - ObjectMeta: metav1.ObjectMeta{ - Name: env.Spec.TargetNamespace, - Labels: map[string]string{ - constants.EnvNameKey: env.Name, - }, - }, - }); err != nil { - return nil, err - } - - if err := d.applyK8sResource(ctx, &env.Env); err != nil { - return nil, err - } - - return nEnv, nil -} - -func (d *domain) UpdateWorkspace(ctx ConsoleContext, env entities.Workspace) (*entities.Workspace, error) { - env.EnsureGVK() - if err := d.k8sExtendedClient.ValidateStruct(ctx, &env.Env); err != nil { - return nil, err - } - - if err := d.canMutateResourcesInProject(ctx, env.Namespace); err != nil { - return nil, err - } - - exEnv, err := d.findWorkspace(ctx, env.Namespace, env.Name) - if err != nil { - return nil, err - } - - if exEnv.GetDeletionTimestamp() != nil { - return nil, errAlreadyMarkedForDeletion("environment", "", env.Name) - } - - exEnv.Spec = env.Spec - exEnv.Generation += 1 - exEnv.SyncStatus = t.GenSyncStatus(t.SyncActionApply, exEnv.Generation) - - upEnv, err := d.workspaceRepo.UpdateById(ctx, exEnv.Id, exEnv) - if err != nil { - return nil, err - } - - if err := d.applyK8sResource(ctx, &upEnv.Env); err != nil { - return nil, err - } - - return upEnv, nil -} - -func (d *domain) DeleteWorkspace(ctx ConsoleContext, namespace, name string) error { - ws, err := d.findWorkspace(ctx, namespace, name) - if err != nil { - return err - } - - if err := d.canMutateResourcesInProject(ctx, ws.Namespace); err != nil { - return err - } - - ws.SyncStatus = t.GenSyncStatus(t.SyncActionDelete, ws.Generation) - if _, err := d.workspaceRepo.UpdateById(ctx, ws.Id, ws); err != nil { - return err - } - - return d.deleteK8sResource(ctx, &ws.Env) -} - -func (d *domain) OnApplyWorkspaceError(ctx ConsoleContext, errMsg, namespace, name string) error { - ws, err2 := d.findWorkspace(ctx, namespace, name) - if err2 != nil { - return err2 - } - - ws.SyncStatus.Error = &errMsg - _, err := d.workspaceRepo.UpdateById(ctx, ws.Id, ws) - return err -} - -func (d *domain) OnDeleteEnvironmentMessage(ctx ConsoleContext, env entities.Workspace) error { - p, err := d.findWorkspace(ctx, env.Namespace, env.Name) - if err != nil { - return err - } - - return d.workspaceRepo.DeleteById(ctx, p.Id) -} - -func (d *domain) OnUpdateEnvironmentMessage(ctx ConsoleContext, env entities.Workspace) error { - ws, err := d.findWorkspace(ctx, env.Namespace, env.Name) - if err != nil { - return err - } - - ws.Status = env.Status - ws.SyncStatus.Error = nil - ws.SyncStatus.LastSyncedAt = time.Now() - ws.SyncStatus.Generation = env.Generation - ws.SyncStatus.State = t.ParseSyncState(env.Status.IsReady) - - _, err = d.workspaceRepo.UpdateById(ctx, ws.Id, ws) - return err -} - -func (d *domain) ResyncWorkspace(ctx ConsoleContext, namespace, name string) error { - if err := d.canMutateResourcesInProject(ctx, namespace); err != nil { - return err - } - - e, err := d.findWorkspace(ctx, namespace, name) - if err != nil { - return err - } - - if err := d.resyncK8sResource(ctx, t.SyncActionApply, &corev1.Namespace{ - TypeMeta: metav1.TypeMeta{APIVersion: "v1", Kind: "Namespace"}, - ObjectMeta: metav1.ObjectMeta{ - Name: e.Spec.TargetNamespace, - Labels: map[string]string{ - constants.EnvNameKey: e.Name, - }, - }, - }); err != nil { - return err - } - - return d.resyncK8sResource(ctx, e.SyncStatus.Action, &e.Env) -} diff --git a/apps/console/internal/entities/app.go b/apps/console/internal/entities/app.go new file mode 100644 index 000000000..c8162df72 --- /dev/null +++ b/apps/console/internal/entities/app.go @@ -0,0 +1,58 @@ +package entities + +import ( + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + crdsv1 "github.com/kloudlite/operator/apis/crds/v1" + "github.com/kloudlite/operator/pkg/operator" +) + +type App struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + + crdsv1.App `json:",inline"` + + AccountName string `json:"accountName" graphql:"noinput"` + ProjectName string `json:"projectName" graphql:"noinput"` + EnvironmentName string `json:"environmentName" graphql:"noinput"` + + common.ResourceMetadata `json:",inline"` + SyncStatus t.SyncStatus `json:"syncStatus" graphql:"noinput"` +} + +func (a *App) GetDisplayName() string { + return a.ResourceMetadata.DisplayName +} + +func (a *App) GetGeneration() int64 { + return a.ObjectMeta.Generation +} + +func (a *App) GetStatus() operator.Status { + return a.App.Status +} + +func (a *App) GetResourceType() ResourceType { + return ResourceTypeApp +} + +var AppIndexes = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: fields.Id, Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: fields.MetadataName, Value: repos.IndexAsc}, + {Key: fields.MetadataNamespace, Value: repos.IndexAsc}, + {Key: fields.AccountName, Value: repos.IndexAsc}, + {Key: fields.ProjectName, Value: repos.IndexAsc}, + {Key: fields.EnvironmentName, Value: repos.IndexAsc}, + }, + Unique: true, + }, +} diff --git a/apps/console/internal/entities/config.go b/apps/console/internal/entities/config.go new file mode 100644 index 000000000..ff001a5ea --- /dev/null +++ b/apps/console/internal/entities/config.go @@ -0,0 +1,54 @@ +package entities + +import ( + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + "github.com/kloudlite/operator/pkg/operator" + corev1 "k8s.io/api/core/v1" +) + +type Config struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + + corev1.ConfigMap `json:",inline"` + + AccountName string `json:"accountName" graphql:"noinput"` + ProjectName string `json:"projectName" graphql:"noinput"` + EnvironmentName string `json:"environmentName" graphql:"noinput"` + + common.ResourceMetadata `json:",inline"` + SyncStatus t.SyncStatus `json:"syncStatus" graphql:"noinput"` +} + +func (c *Config) GetDisplayName() string { + return c.ResourceMetadata.DisplayName +} + +func (c *Config) GetStatus() operator.Status { + return operator.Status{} +} + +func (c *Config) GetResourceType() ResourceType { + return ResourceTypeConfig +} + +var ConfigIndexes = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: fields.Id, Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: fields.MetadataName, Value: repos.IndexAsc}, + {Key: fields.MetadataNamespace, Value: repos.IndexAsc}, + {Key: fields.ProjectName, Value: repos.IndexAsc}, + {Key: fields.AccountName, Value: repos.IndexAsc}, + {Key: fields.EnvironmentName, Value: repos.IndexAsc}, + }, + Unique: true, + }, +} diff --git a/apps/console/internal/entities/environment.go b/apps/console/internal/entities/environment.go new file mode 100644 index 000000000..6e537880e --- /dev/null +++ b/apps/console/internal/entities/environment.go @@ -0,0 +1,66 @@ +package entities + +import ( + fc "github.com/kloudlite/api/apps/console/internal/entities/field-constants" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + crdsv1 "github.com/kloudlite/operator/apis/crds/v1" + "github.com/kloudlite/operator/pkg/operator" +) + +type Environment struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + + crdsv1.Environment `json:",inline"` + + AccountName string `json:"accountName" graphql:"noinput"` + ProjectName string `json:"projectName" graphql:"noinput"` + + common.ResourceMetadata `json:",inline"` + SyncStatus t.SyncStatus `json:"syncStatus" graphql:"noinput"` +} + +func (e *Environment) GetDisplayName() string { + return e.ResourceMetadata.DisplayName +} + +func (e *Environment) GetStatus() operator.Status { + return e.Environment.Status +} + +func (e *Environment) GetResourceType() ResourceType { + return ResourceTypeEnvironment +} + +var EnvironmentIndexes = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: fields.Id, Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: fields.MetadataName, Value: repos.IndexAsc}, + {Key: fields.MetadataNamespace, Value: repos.IndexAsc}, + {Key: fields.AccountName, Value: repos.IndexAsc}, + {Key: fields.ProjectName, Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: fields.AccountName, Value: repos.IndexAsc}, + {Key: fc.EnvironmentSpecProjectName, Value: repos.IndexAsc}, + {Key: fc.EnvironmentSpecTargetNamespace, Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: fc.EnvironmentSpecProjectName, Value: repos.IndexAsc}, + }, + }, +} diff --git a/apps/console/internal/entities/field-constants/gen.go b/apps/console/internal/entities/field-constants/gen.go new file mode 100644 index 000000000..9e383b54f --- /dev/null +++ b/apps/console/internal/entities/field-constants/gen.go @@ -0,0 +1,3 @@ +package field_constants + +//go:generate go run github.com/kloudlite/api/cmd/struct-json-path --pkg github.com/kloudlite/api/apps/console/internal/entities --common-path "metadata" --common-path "apiVersion" --common-path "kind" --common-path "status" --common-path "syncStatus" --common-path "lastUpdatedBy" --common-path "createdBy" --common-path "displayName" --common-path "creationTime" --common-path "updateTime" --common-path "id" --common-path "recordVersion" --common-path "accountName" --common-path "projectName" --common-path "environmentName" --common-path "clusterName" --common-path "markedForDeletion" --out-file ./generated_constants.go --banner "package field_constants" --ignore-nesting "time.Time" --ignore-nesting "k8s.io/apimachinery/pkg/apis/meta/v1.Time" diff --git a/apps/console/internal/entities/field-constants/generated_constants.go b/apps/console/internal/entities/field-constants/generated_constants.go new file mode 100644 index 000000000..a8737832b --- /dev/null +++ b/apps/console/internal/entities/field-constants/generated_constants.go @@ -0,0 +1,209 @@ +// DO NOT EDIT. generated by "github.com/kloudlite/api/cmd/struct-json-path" + +package field_constants + +// constant vars generated for struct App +const ( + AppEnabled = "enabled" + AppSpec = "spec" + AppSpecContainers = "spec.containers" + AppSpecDisplayName = "spec.displayName" + AppSpecFreeze = "spec.freeze" + AppSpecHpa = "spec.hpa" + AppSpecHpaEnabled = "spec.hpa.enabled" + AppSpecHpaMaxReplicas = "spec.hpa.maxReplicas" + AppSpecHpaMinReplicas = "spec.hpa.minReplicas" + AppSpecHpaThresholdCpu = "spec.hpa.thresholdCpu" + AppSpecHpaThresholdMemory = "spec.hpa.thresholdMemory" + AppSpecIntercept = "spec.intercept" + AppSpecInterceptEnabled = "spec.intercept.enabled" + AppSpecInterceptToDevice = "spec.intercept.toDevice" + AppSpecNodeSelector = "spec.nodeSelector" + AppSpecRegion = "spec.region" + AppSpecReplicas = "spec.replicas" + AppSpecServiceAccount = "spec.serviceAccount" + AppSpecServices = "spec.services" + AppSpecTolerations = "spec.tolerations" +) + +// constant vars generated for struct Config +const ( + ConfigBinaryData = "binaryData" + ConfigData = "data" + ConfigImmutable = "immutable" +) + +// constant vars generated for struct ConsoleVPNDevice +const ( + ConsoleVPNDeviceLinkedClusters = "linkedClusters" + ConsoleVPNDeviceSpec = "spec" + ConsoleVPNDeviceSpecActiveNamespace = "spec.activeNamespace" + ConsoleVPNDeviceSpecCnameRecords = "spec.cnameRecords" + ConsoleVPNDeviceSpecDisabled = "spec.disabled" + ConsoleVPNDeviceSpecNoExternalService = "spec.noExternalService" + ConsoleVPNDeviceSpecNodeSelector = "spec.nodeSelector" + ConsoleVPNDeviceSpecPorts = "spec.ports" + ConsoleVPNDeviceWireguardConfig = "wireguardConfig" + ConsoleVPNDeviceWireguardConfigs = "wireguardConfigs" +) + +// constant vars generated for struct Environment +const ( + EnvironmentSpec = "spec" + EnvironmentSpecProjectName = "spec.projectName" + EnvironmentSpecRouting = "spec.routing" + EnvironmentSpecRoutingMode = "spec.routing.mode" + EnvironmentSpecRoutingPrivateIngressClass = "spec.routing.privateIngressClass" + EnvironmentSpecRoutingPublicIngressClass = "spec.routing.publicIngressClass" + EnvironmentSpecTargetNamespace = "spec.targetNamespace" +) + +// constant vars generated for struct ImagePullSecret +const ( + ImagePullSecretDockerConfigJson = "dockerConfigJson" + ImagePullSecretFormat = "format" + ImagePullSecretGeneratedK8sSecret = "generatedK8sSecret" + ImagePullSecretRegistryPassword = "registryPassword" + ImagePullSecretRegistryURL = "registryURL" + ImagePullSecretRegistryUsername = "registryUsername" +) + +// constant vars generated for struct ManagedResource +const ( + ManagedResourceEnabled = "enabled" + ManagedResourceSpec = "spec" + ManagedResourceSpecResourceName = "spec.resourceName" + ManagedResourceSpecResourceTemplate = "spec.resourceTemplate" + ManagedResourceSpecResourceTemplateApiVersion = "spec.resourceTemplate.apiVersion" + ManagedResourceSpecResourceTemplateKind = "spec.resourceTemplate.kind" + ManagedResourceSpecResourceTemplateMsvcRef = "spec.resourceTemplate.msvcRef" + ManagedResourceSpecResourceTemplateMsvcRefApiVersion = "spec.resourceTemplate.msvcRef.apiVersion" + ManagedResourceSpecResourceTemplateMsvcRefKind = "spec.resourceTemplate.msvcRef.kind" + ManagedResourceSpecResourceTemplateMsvcRefName = "spec.resourceTemplate.msvcRef.name" + ManagedResourceSpecResourceTemplateMsvcRefNamespace = "spec.resourceTemplate.msvcRef.namespace" + ManagedResourceSpecResourceTemplateSpec = "spec.resourceTemplate.spec" + ManagedResourceSyncedOutputSecretRef = "syncedOutputSecretRef" +) + +// constant vars generated for struct Project +const ( + ProjectSpec = "spec" + ProjectSpecTargetNamespace = "spec.targetNamespace" +) + +// constant vars generated for struct ProjectManagedService +const ( + ProjectManagedServiceSpec = "spec" + ProjectManagedServiceSpecMsvcSpec = "spec.msvcSpec" + ProjectManagedServiceSpecMsvcSpecServiceTemplate = "spec.msvcSpec.serviceTemplate" + ProjectManagedServiceSpecMsvcSpecServiceTemplateApiVersion = "spec.msvcSpec.serviceTemplate.apiVersion" + ProjectManagedServiceSpecMsvcSpecServiceTemplateKind = "spec.msvcSpec.serviceTemplate.kind" + ProjectManagedServiceSpecMsvcSpecServiceTemplateSpec = "spec.msvcSpec.serviceTemplate.spec" + ProjectManagedServiceSpecTargetNamespace = "spec.targetNamespace" + ProjectManagedServiceSyncedOutputSecretRef = "syncedOutputSecretRef" +) + +// constant vars generated for struct ResourceMapping +const ( + ResourceMappingBaseEntity = "BaseEntity" + ResourceMappingBaseEntityCreationTime = "BaseEntity.creationTime" + ResourceMappingBaseEntityId = "BaseEntity.id" + ResourceMappingBaseEntityMarkedForDeletion = "BaseEntity.markedForDeletion" + ResourceMappingBaseEntityRecordVersion = "BaseEntity.recordVersion" + ResourceMappingBaseEntityUpdateTime = "BaseEntity.updateTime" + ResourceMappingResourceHeirarchy = "resourceHeirarchy" + ResourceMappingResourceName = "resourceName" + ResourceMappingResourceNamespace = "resourceNamespace" + ResourceMappingResourceType = "resourceType" +) + +// constant vars generated for struct Router +const ( + RouterEnabled = "enabled" + RouterSpec = "spec" + RouterSpecBackendProtocol = "spec.backendProtocol" + RouterSpecBasicAuth = "spec.basicAuth" + RouterSpecBasicAuthEnabled = "spec.basicAuth.enabled" + RouterSpecBasicAuthSecretName = "spec.basicAuth.secretName" + RouterSpecBasicAuthUsername = "spec.basicAuth.username" + RouterSpecCors = "spec.cors" + RouterSpecCorsAllowCredentials = "spec.cors.allowCredentials" + RouterSpecCorsEnabled = "spec.cors.enabled" + RouterSpecCorsOrigins = "spec.cors.origins" + RouterSpecDomains = "spec.domains" + RouterSpecHttps = "spec.https" + RouterSpecHttpsClusterIssuer = "spec.https.clusterIssuer" + RouterSpecHttpsEnabled = "spec.https.enabled" + RouterSpecHttpsForceRedirect = "spec.https.forceRedirect" + RouterSpecIngressClass = "spec.ingressClass" + RouterSpecMaxBodySizeInMB = "spec.maxBodySizeInMB" + RouterSpecRateLimit = "spec.rateLimit" + RouterSpecRateLimitConnections = "spec.rateLimit.connections" + RouterSpecRateLimitEnabled = "spec.rateLimit.enabled" + RouterSpecRateLimitRpm = "spec.rateLimit.rpm" + RouterSpecRateLimitRps = "spec.rateLimit.rps" + RouterSpecRoutes = "spec.routes" +) + +// constant vars generated for struct Secret +const ( + SecretData = "data" + SecretImmutable = "immutable" + SecretStringData = "stringData" + SecretType = "type" +) + +// constant vars generated for struct +const ( + AccountName = "accountName" + ApiVersion = "apiVersion" + ClusterName = "clusterName" + CreatedBy = "createdBy" + CreatedByUserEmail = "createdBy.userEmail" + CreatedByUserId = "createdBy.userId" + CreatedByUserName = "createdBy.userName" + CreationTime = "creationTime" + DisplayName = "displayName" + EnvironmentName = "environmentName" + Id = "id" + Kind = "kind" + LastUpdatedBy = "lastUpdatedBy" + LastUpdatedByUserEmail = "lastUpdatedBy.userEmail" + LastUpdatedByUserId = "lastUpdatedBy.userId" + LastUpdatedByUserName = "lastUpdatedBy.userName" + MarkedForDeletion = "markedForDeletion" + Metadata = "metadata" + MetadataAnnotations = "metadata.annotations" + MetadataCreationTimestamp = "metadata.creationTimestamp" + MetadataDeletionGracePeriodSeconds = "metadata.deletionGracePeriodSeconds" + MetadataDeletionTimestamp = "metadata.deletionTimestamp" + MetadataFinalizers = "metadata.finalizers" + MetadataGenerateName = "metadata.generateName" + MetadataGeneration = "metadata.generation" + MetadataLabels = "metadata.labels" + MetadataManagedFields = "metadata.managedFields" + MetadataName = "metadata.name" + MetadataNamespace = "metadata.namespace" + MetadataOwnerReferences = "metadata.ownerReferences" + MetadataResourceVersion = "metadata.resourceVersion" + MetadataSelfLink = "metadata.selfLink" + MetadataUid = "metadata.uid" + ProjectName = "projectName" + RecordVersion = "recordVersion" + Status = "status" + StatusChecks = "status.checks" + StatusIsReady = "status.isReady" + StatusLastReadyGeneration = "status.lastReadyGeneration" + StatusLastReconcileTime = "status.lastReconcileTime" + StatusMessage = "status.message" + StatusMessageItems = "status.message.items" + StatusResources = "status.resources" + SyncStatus = "syncStatus" + SyncStatusAction = "syncStatus.action" + SyncStatusError = "syncStatus.error" + SyncStatusLastSyncedAt = "syncStatus.lastSyncedAt" + SyncStatusRecordVersion = "syncStatus.recordVersion" + SyncStatusState = "syncStatus.state" + SyncStatusSyncScheduledAt = "syncStatus.syncScheduledAt" + UpdateTime = "updateTime" +) diff --git a/apps/console/internal/entities/image-pull-secret.go b/apps/console/internal/entities/image-pull-secret.go new file mode 100644 index 000000000..8ba6d3c17 --- /dev/null +++ b/apps/console/internal/entities/image-pull-secret.go @@ -0,0 +1,89 @@ +package entities + +import ( + "fmt" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + "github.com/kloudlite/operator/pkg/operator" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type PullSecretFormat string + +const ( + DockerConfigJsonFormat PullSecretFormat = "dockerConfigJson" + ParamsFormat PullSecretFormat = "params" +) + +type ImagePullSecret struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + metav1.ObjectMeta `json:"metadata"` + + Format PullSecretFormat `json:"format"` + DockerConfigJson *string `json:"dockerConfigJson,omitempty"` + + RegistryUsername *string `json:"registryUsername,omitempty"` + RegistryPassword *string `json:"registryPassword,omitempty"` + RegistryURL *string `json:"registryURL,omitempty"` + + GeneratedK8sSecret corev1.Secret `json:"generatedK8sSecret,omitempty" graphql:"ignore" struct-json-path:",ignore-nesting"` + + AccountName string `json:"accountName" graphql:"noinput"` + ProjectName string `json:"projectName" graphql:"noinput"` + EnvironmentName string `json:"environmentName" graphql:"noinput"` + + common.ResourceMetadata `json:",inline"` + SyncStatus t.SyncStatus `json:"syncStatus" graphql:"noinput"` +} + +func (ips *ImagePullSecret) GetDisplayName() string { + return ips.ResourceMetadata.DisplayName +} + +func (ips *ImagePullSecret) GetStatus() operator.Status { + return operator.Status{} +} + +func (ips *ImagePullSecret) GetResourceType() ResourceType { + return ResourceTypeImagePullSecret +} + +func (ips *ImagePullSecret) Validate() error { + if ips == nil { + return fmt.Errorf("image pull secret is nil") + } + switch ips.Format { + case DockerConfigJsonFormat: + if ips.DockerConfigJson == nil { + return fmt.Errorf("when format is %s, field: dockerConfigJson must be set", DockerConfigJsonFormat) + } + case ParamsFormat: + if ips.RegistryUsername == nil || ips.RegistryPassword == nil || ips.RegistryURL == nil { + return fmt.Errorf("when format is %s, fields: registryUsername, registryPassword, registryURL must be set", ParamsFormat) + } + } + + return nil +} + +var ImagePullSecretIndexes = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: fields.Id, Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: fields.MetadataName, Value: repos.IndexAsc}, + {Key: fields.MetadataNamespace, Value: repos.IndexAsc}, + {Key: fields.AccountName, Value: repos.IndexAsc}, + {Key: fields.ProjectName, Value: repos.IndexAsc}, + {Key: fields.EnvironmentName, Value: repos.IndexAsc}, + }, + Unique: true, + }, +} diff --git a/apps/console/internal/entities/mres.go b/apps/console/internal/entities/mres.go new file mode 100644 index 000000000..95d7191d8 --- /dev/null +++ b/apps/console/internal/entities/mres.go @@ -0,0 +1,56 @@ +package entities + +import ( + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + crdsv1 "github.com/kloudlite/operator/apis/crds/v1" + "github.com/kloudlite/operator/pkg/operator" + corev1 "k8s.io/api/core/v1" +) + +type ManagedResource struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + crdsv1.ManagedResource `json:",inline"` + + AccountName string `json:"accountName" graphql:"noinput"` + ProjectName string `json:"projectName" graphql:"noinput"` + EnvironmentName string `json:"environmentName" graphql:"noinput"` + + SyncedOutputSecretRef *corev1.Secret `json:"syncedOutputSecretRef" graphql:"ignore" struct-json-path:",ignore-nesting"` + + common.ResourceMetadata `json:",inline"` + SyncStatus t.SyncStatus `json:"syncStatus" graphql:"noinput"` +} + +func (m *ManagedResource) GetDisplayName() string { + return m.ResourceMetadata.DisplayName +} + +func (m *ManagedResource) GetStatus() operator.Status { + return m.ManagedResource.Status +} + +func (m *ManagedResource) GetResourceType() ResourceType { + return ResourceTypeManagedResource +} + +var MresIndexes = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: fields.Id, Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: fields.MetadataName, Value: repos.IndexAsc}, + {Key: fields.MetadataNamespace, Value: repos.IndexAsc}, + {Key: fields.AccountName, Value: repos.IndexAsc}, + {Key: fields.ProjectName, Value: repos.IndexAsc}, + {Key: fields.EnvironmentName, Value: repos.IndexAsc}, + }, + Unique: true, + }, +} diff --git a/apps/console/internal/entities/project-managed-service.go b/apps/console/internal/entities/project-managed-service.go new file mode 100644 index 000000000..dd5a3a9a0 --- /dev/null +++ b/apps/console/internal/entities/project-managed-service.go @@ -0,0 +1,54 @@ +package entities + +import ( + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + crdsv1 "github.com/kloudlite/operator/apis/crds/v1" + "github.com/kloudlite/operator/pkg/operator" + corev1 "k8s.io/api/core/v1" +) + +type ProjectManagedService struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + crdsv1.ProjectManagedService `json:",inline"` + + AccountName string `json:"accountName" graphql:"noinput"` + ProjectName string `json:"projectName" graphql:"noinput"` + + SyncedOutputSecretRef *corev1.Secret `json:"syncedOutputSecretRef" graphql:"ignore" struct-json-path:",ignore-nesting"` + + common.ResourceMetadata `json:",inline"` + SyncStatus t.SyncStatus `json:"syncStatus" graphql:"noinput"` +} + +func (s *ProjectManagedService) GetDisplayName() string { + return s.ResourceMetadata.DisplayName +} + +func (s *ProjectManagedService) GetStatus() operator.Status { + return s.ProjectManagedService.Status +} + +// GetResourceType implements domain.resource. +func (*ProjectManagedService) GetResourceType() ResourceType { + return ResourceTypeProjectManagedService +} + +var ProjectManagedServiceIndices = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: fields.Id, Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: fields.MetadataName, Value: repos.IndexAsc}, + {Key: fields.AccountName, Value: repos.IndexAsc}, + {Key: fields.ProjectName, Value: repos.IndexAsc}, + }, + Unique: true, + }, +} diff --git a/apps/console/internal/entities/project.go b/apps/console/internal/entities/project.go new file mode 100644 index 000000000..e848f84ab --- /dev/null +++ b/apps/console/internal/entities/project.go @@ -0,0 +1,65 @@ +package entities + +import ( + fc "github.com/kloudlite/api/apps/console/internal/entities/field-constants" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + crdsv1 "github.com/kloudlite/operator/apis/crds/v1" + "github.com/kloudlite/operator/pkg/operator" +) + +type Project struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + + crdsv1.Project `json:",inline"` + + common.ResourceMetadata `json:",inline"` + + AccountName string `json:"accountName" graphql:"noinput"` + ClusterName *string `json:"clusterName"` + + SyncStatus t.SyncStatus `json:"syncStatus" graphql:"noinput"` +} + +func (p *Project) GetDisplayName() string { + return p.ResourceMetadata.DisplayName +} + +func (p *Project) GetStatus() operator.Status { + return p.Project.Status +} + +func (p *Project) GetResourceType() ResourceType { + return ResourceTypeProject +} + +var ProjectIndexes = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: fields.Id, Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: fields.MetadataName, Value: repos.IndexAsc}, + {Key: fields.AccountName, Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: fields.AccountName, Value: repos.IndexAsc}, + {Key: fc.ProjectSpecTargetNamespace, Value: repos.IndexAsc}, + }, + Unique: true, + }, + + { + Field: []repos.IndexKey{ + {Key: fields.ClusterName, Value: repos.IndexAsc}, + }, + }, +} diff --git a/apps/console/internal/entities/resource-mapping.go b/apps/console/internal/entities/resource-mapping.go new file mode 100644 index 000000000..37f88c189 --- /dev/null +++ b/apps/console/internal/entities/resource-mapping.go @@ -0,0 +1,73 @@ +package entities + +import ( + fc "github.com/kloudlite/api/apps/console/internal/entities/field-constants" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/repos" +) + +type ResourceType string + +const ( + ResourceTypeProject ResourceType = "project" + ResourceTypeEnvironment ResourceType = "environment" + ResourceTypeApp ResourceType = "app" + ResourceTypeConfig ResourceType = "config" + ResourceTypeSecret ResourceType = "secret" + ResourceTypeImagePullSecret ResourceType = "image_pull_secret" + ResourceTypeRouter ResourceType = "router" + ResourceTypeManagedResource ResourceType = "managed_resource" + ResourceTypeProjectManagedService ResourceType = "project_managed_service" + ResourceTypeVPNDevice ResourceType = "vpn_device" +) + +type ResourceHeirarchy string + +const ( + ResourceHeirarchyProject ResourceHeirarchy = "project" + ResourceHeirarchyEnvironment ResourceHeirarchy = "environment" +) + +type ResourceMapping struct { + repos.BaseEntity `bson:",inline"` + + ResourceHeirarchy ResourceHeirarchy `json:"resourceHeirarchy"` + + ResourceType ResourceType `json:"resourceType"` + ResourceName string `json:"resourceName"` + ResourceNamespace string `json:"resourceNamespace"` + + AccountName string `json:"accountName"` + ClusterName string `json:"clusterName"` + + ProjectName string `json:"projectName"` + EnvironmentName string `json:"environmentName"` +} + +var ResourceMappingIndices = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: fields.Id, Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: fields.AccountName, Value: repos.IndexAsc}, + {Key: fields.ProjectName, Value: repos.IndexAsc}, + {Key: fields.EnvironmentName, Value: repos.IndexAsc}, + {Key: fc.ResourceMappingResourceType, Value: repos.IndexAsc}, + {Key: fc.ResourceMappingResourceName, Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: fields.ClusterName, Value: repos.IndexAsc}, + {Key: fc.ResourceMappingResourceType, Value: repos.IndexAsc}, + {Key: fc.ResourceMappingResourceName, Value: repos.IndexAsc}, + {Key: fc.ResourceMappingResourceNamespace, Value: repos.IndexAsc}, + }, + Unique: true, + }, +} diff --git a/apps/console/internal/entities/router.go b/apps/console/internal/entities/router.go new file mode 100644 index 000000000..3632b1c85 --- /dev/null +++ b/apps/console/internal/entities/router.go @@ -0,0 +1,53 @@ +package entities + +import ( + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + crdsv1 "github.com/kloudlite/operator/apis/crds/v1" + "github.com/kloudlite/operator/pkg/operator" +) + +type Router struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + crdsv1.Router `json:",inline"` + + AccountName string `json:"accountName" graphql:"noinput"` + ProjectName string `json:"projectName" graphql:"noinput"` + EnvironmentName string `json:"environmentName" graphql:"noinput"` + + common.ResourceMetadata `json:",inline"` + SyncStatus t.SyncStatus `json:"syncStatus" graphql:"noinput"` +} + +func (r *Router) GetDisplayName() string { + return r.ResourceMetadata.DisplayName +} + +func (r *Router) GetStatus() operator.Status { + return r.Router.Status +} + +func (r *Router) GetResourceType() ResourceType { + return ResourceTypeRouter +} + +var RouterIndexes = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: fields.Id, Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: fields.MetadataName, Value: repos.IndexAsc}, + {Key: fields.MetadataNamespace, Value: repos.IndexAsc}, + {Key: fields.AccountName, Value: repos.IndexAsc}, + {Key: fields.ProjectName, Value: repos.IndexAsc}, + {Key: fields.EnvironmentName, Value: repos.IndexAsc}, + }, + Unique: true, + }, +} diff --git a/apps/console/internal/entities/secret.go b/apps/console/internal/entities/secret.go new file mode 100644 index 000000000..7008025be --- /dev/null +++ b/apps/console/internal/entities/secret.go @@ -0,0 +1,53 @@ +package entities + +import ( + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + "github.com/kloudlite/operator/pkg/operator" + corev1 "k8s.io/api/core/v1" +) + +type Secret struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + corev1.Secret `json:",inline"` + + AccountName string `json:"accountName" graphql:"noinput"` + ProjectName string `json:"projectName" graphql:"noinput"` + EnvironmentName string `json:"environmentName" graphql:"noinput"` + + common.ResourceMetadata `json:",inline"` + SyncStatus t.SyncStatus `json:"syncStatus" graphql:"noinput"` +} + +func (s *Secret) GetDisplayName() string { + return s.ResourceMetadata.DisplayName +} + +func (s *Secret) GetStatus() operator.Status { + return operator.Status{} +} + +func (s *Secret) GetResourceType() ResourceType { + return ResourceTypeSecret +} + +var SecretIndexes = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: fields.Id, Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: fields.MetadataName, Value: repos.IndexAsc}, + {Key: fields.MetadataNamespace, Value: repos.IndexAsc}, + {Key: fields.AccountName, Value: repos.IndexAsc}, + {Key: fields.ProjectName, Value: repos.IndexAsc}, + {Key: fields.EnvironmentName, Value: repos.IndexAsc}, + }, + Unique: true, + }, +} diff --git a/apps/console/internal/entities/vpn-device.go b/apps/console/internal/entities/vpn-device.go new file mode 100644 index 000000000..3ffe27b91 --- /dev/null +++ b/apps/console/internal/entities/vpn-device.go @@ -0,0 +1,68 @@ +package entities + +import ( + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + wireguardV1 "github.com/kloudlite/operator/apis/wireguard/v1" + "github.com/kloudlite/operator/pkg/operator" +) + +type ConsoleVPNDevice struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + + wireguardV1.Device `json:",inline"` + + common.ResourceMetadata `json:",inline"` + + AccountName string `json:"accountName" graphql:"noinput"` + ProjectName *string `json:"projectName,omitempty"` + EnvironmentName *string `json:"environmentName,omitempty"` + ClusterName *string `json:"clusterName,omitempty"` + + WireguardConfig t.EncodedString `json:"wireguardConfig,omitempty" graphql:"noinput" struct-json-path:",ignore-nesting"` + + WireguardConfigs map[string]t.EncodedString `json:"wireguardConfigs,omitempty" graphql:"ignore" struct-json-path:",ignore-nesting"` + + LinkedClusters []string `json:"linkedClusters,omitempty" graphql:"noinput"` + SyncStatus t.SyncStatus `json:"syncStatus" graphql:"noinput"` +} + +func (c *ConsoleVPNDevice) GetDisplayName() string { + return c.ResourceMetadata.DisplayName +} + +func (c *ConsoleVPNDevice) GetStatus() operator.Status { + return c.Device.Status +} + +var VPNDeviceIndexes = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: fields.Id, Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: fields.MetadataName, Value: repos.IndexAsc}, + {Key: fields.AccountName, Value: repos.IndexAsc}, + }, + Unique: true, + }, +} + +func ValidateVPNDevice(d *ConsoleVPNDevice) error { + errMsgs := []string{} + + if d.DisplayName == "" { + errMsgs = append(errMsgs, "displayName is required") + } + + if len(errMsgs) > 0 { + return errors.Newf("%v", errMsgs) + } + return nil +} diff --git a/apps/console/internal/env/env.go b/apps/console/internal/env/env.go index 8dd553895..92fe1e18d 100644 --- a/apps/console/internal/env/env.go +++ b/apps/console/internal/env/env.go @@ -1,38 +1,45 @@ package env -import "github.com/codingconcepts/env" +import ( + "github.com/codingconcepts/env" + "github.com/kloudlite/api/pkg/errors" +) type Env struct { - Port uint16 `env:"PORT" required:"true"` - CookieDomain string `env:"COOKIE_DOMAIN" required:"true"` + Port uint16 `env:"HTTP_PORT" required:"true"` + LogsAndMetricsHttpPort uint16 `env:"LOGS_AND_METRICS_HTTP_PORT" required:"true"` - ConsoleDBUri string `env:"CONSOLE_DB_URI" required:"true"` - ConsoleDBName string `env:"CONSOLE_DB_NAME" required:"true"` + CookieDomain string `env:"COOKIE_DOMAIN" required:"true"` - AuthRedisHosts string `env:"AUTH_REDIS_HOSTS" required:"true"` - AuthRedisUserName string `env:"AUTH_REDIS_USERNAME" required:"true"` - AuthRedisPassword string `env:"AUTH_REDIS_PASSWORD" required:"true"` - AuthRedisPrefix string `env:"AUTH_REDIS_PREFIX" required:"true"` + ConsoleDBUri string `env:"MONGO_URI" required:"true"` + ConsoleDBName string `env:"MONGO_DB_NAME" required:"true"` AccountCookieName string `env:"ACCOUNT_COOKIE_NAME" required:"true"` + ClusterCookieName string `env:"CLUSTER_COOKIE_NAME" required:"true"` + + // NATS:start + NatsURL string `env:"NATS_URL" required:"true"` + NatsResourceSyncStream string `env:"NATS_RESOURCE_STREAM" required:"true"` + // NATS:end - KafkaBrokers string `env:"KAFKA_BROKERS" required:"true"` - KafkaUsername string `env:"KAFKA_USERNAME" required:"true"` - KafkaPassword string `env:"KAFKA_PASSWORD" required:"true"` + IAMGrpcAddr string `env:"IAM_GRPC_ADDR" required:"true"` + InfraGrpcAddr string `env:"INFRA_GRPC_ADDR" required:"true"` - KafkaStatusUpdatesTopic string `env:"KAFKA_STATUS_UPDATES_TOPIC" required:"true"` - KafkaErrorOnApplyTopic string `env:"KAFKA_ERROR_ON_APPLY_TOPIC" required:"true"` - KafkaConsumerGroupId string `env:"KAFKA_CONSUMER_GROUP_ID" required:"true"` + DefaultProjectWorkspaceName string `env:"DEFAULT_PROJECT_WORKSPACE_NAME" required:"true"` - IAMGrpcAddr string `env:"IAM_GRPC_ADDR" required:"true"` + PromHttpAddr string `env:"PROM_HTTP_ADDR" required:"true"` + SessionKVBucket string `env:"SESSION_KV_BUCKET" required:"true"` + ConsoleCacheKVBucket string `env:"CONSOLE_CACHE_KV_BUCKET" required:"true"` + IsDev bool + KubernetesApiProxy string `env:"KUBERNETES_API_PROXY"` - DefaultProjectEnvName string `env:"DEFAULT_PROJECT_ENV_NAME" required:"true"` + DeviceNamespace string `env:"DEVICE_NAMESPACE" required:"true"` } func LoadEnv() (*Env, error) { var e Env if err := env.Set(&e); err != nil { - return nil, err + return nil, errors.NewE(err) } return &e, nil } diff --git a/apps/console/internal/framework/framework.go b/apps/console/internal/framework/framework.go index 1f8447f12..1c907aa74 100644 --- a/apps/console/internal/framework/framework.go +++ b/apps/console/internal/framework/framework.go @@ -1,52 +1,34 @@ package framework import ( - "github.com/kloudlite/operator/pkg/kubectl" + "context" + "fmt" + + "github.com/kloudlite/api/apps/console/internal/domain" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/errors" + + app "github.com/kloudlite/api/apps/console/internal/app" + "github.com/kloudlite/api/apps/console/internal/env" + rpc "github.com/kloudlite/api/pkg/grpc" + httpServer "github.com/kloudlite/api/pkg/http-server" + "github.com/kloudlite/api/pkg/k8s" + "github.com/kloudlite/api/pkg/kv" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/api/pkg/nats" + mongoDb "github.com/kloudlite/api/pkg/repos" "go.uber.org/fx" "k8s.io/client-go/rest" - app "kloudlite.io/apps/console/internal/app" - "kloudlite.io/apps/console/internal/env" - "kloudlite.io/pkg/cache" - rpc "kloudlite.io/pkg/grpc" - httpServer "kloudlite.io/pkg/http-server" - "kloudlite.io/pkg/k8s" - "kloudlite.io/pkg/redpanda" - mongoDb "kloudlite.io/pkg/repos" ) type fm struct { ev *env.Env } -func (fm *fm) GetBrokers() (brokers string) { - return fm.ev.KafkaBrokers -} - -func (fm *fm) GetKafkaSASLAuth() *redpanda.KafkaSASLAuth { - return nil - // return &redpanda.KafkaSASLAuth{ - // SASLMechanism: redpanda.ScramSHA256, - // User: fm.ev.KafkaUsername, - // Password: fm.ev.KafkaPassword, - // } -} - func (fm *fm) GetMongoConfig() (url string, dbName string) { return fm.ev.ConsoleDBUri, fm.ev.ConsoleDBName } -func (fm *fm) RedisOptions() (hosts, username, password, basePrefix string) { - return fm.ev.AuthRedisHosts, fm.ev.AuthRedisUserName, fm.ev.AuthRedisPassword, fm.ev.AuthRedisPrefix -} - -func (fm *fm) GetHttpPort() uint16 { - return fm.ev.Port -} - -func (fm *fm) GetHttpCors() string { - return "*" -} - var Module = fx.Module("framework", fx.Provide(func(ev *env.Env) *fm { return &fm{ev} @@ -54,26 +36,86 @@ var Module = fx.Module("framework", mongoDb.NewMongoClientFx[*fm](), - fx.Provide(func(ev *env.Env) app.AuthCacheClient { - return cache.NewRedisClient(ev.AuthRedisHosts, ev.AuthRedisUserName, ev.AuthRedisPassword, ev.AuthRedisPrefix) + fx.Provide(func(ev *env.Env, logger logging.Logger) (*nats.Client, error) { + return nats.NewClient(ev.NatsURL, nats.ClientOpts{ + Name: "console", + Logger: logger, + }) }), - cache.FxLifeCycle[app.AuthCacheClient](), - - fx.Provide(func(restCfg *rest.Config) (*kubectl.YAMLClient, error) { - return kubectl.NewYAMLClient(restCfg) + fx.Provide(func(c *nats.Client) (*nats.JetstreamClient, error) { + return nats.NewJetstreamClient(c) }), - fx.Provide(func(restCfg *rest.Config) (k8s.ExtendedK8sClient, error) { - return k8s.NewExtendedK8sClient(restCfg) + fx.Provide( + func(ev *env.Env, jc *nats.JetstreamClient) (kv.Repo[*common.AuthSession], error) { + cxt := context.TODO() + return kv.NewNatsKVRepo[*common.AuthSession](cxt, ev.SessionKVBucket, jc) + }, + ), + + fx.Provide( + func(ev *env.Env, jc *nats.JetstreamClient) (domain.ConsoleCacheStore, error) { + return kv.NewNatsKVBinaryRepo(context.TODO(), ev.ConsoleCacheKVBucket, jc) + }, + ), + + fx.Provide(func(restCfg *rest.Config) (k8s.Client, error) { + return k8s.NewClient(restCfg, nil) }), fx.Provide(func(ev *env.Env) (app.IAMGrpcClient, error) { - return rpc.NewGrpcClient[app.IAMGrpcClient](ev.IAMGrpcAddr) + return rpc.NewGrpcClient(ev.IAMGrpcAddr) }), - redpanda.NewClientFx[*fm](), + fx.Provide(func(ev *env.Env) (app.InfraClient, error) { + return rpc.NewGrpcClient(ev.InfraGrpcAddr) + }), + + fx.Invoke(func(lf fx.Lifecycle, c1 app.IAMGrpcClient, c2 app.InfraClient) { + lf.Append(fx.Hook{ + OnStop: func(context.Context) error { + if err := c1.Close(); err != nil { + return errors.NewE(err) + } + if err := c2.Close(); err != nil { + return errors.NewE(err) + } + return nil + }, + }) + }), app.Module, - httpServer.NewHttpServerFx[*fm](), + + fx.Provide(func(logger logging.Logger, e *env.Env) httpServer.Server { + corsOrigins := "https://studio.apollographql.com" + return httpServer.NewServer(httpServer.ServerArgs{Logger: logger, CorsAllowOrigins: &corsOrigins, IsDev: e.IsDev}) + }), + + fx.Invoke(func(lf fx.Lifecycle, server httpServer.Server, ev *env.Env) { + lf.Append(fx.Hook{ + OnStart: func(context.Context) error { + return server.Listen(fmt.Sprintf(":%d", ev.Port)) + }, + OnStop: func(context.Context) error { + return server.Close() + }, + }) + }), + + fx.Provide(func(logger logging.Logger) app.LogsAndMetricsHttpServer { + return httpServer.NewServer(httpServer.ServerArgs{Logger: logger}) + }), + + fx.Invoke(func(lf fx.Lifecycle, ev *env.Env, server app.LogsAndMetricsHttpServer) { + lf.Append(fx.Hook{ + OnStart: func(ctx context.Context) error { + return server.Listen(fmt.Sprintf(":%d", ev.LogsAndMetricsHttpPort)) + }, + OnStop: func(context.Context) error { + return server.Close() + }, + }) + }), ) diff --git a/apps/console/main.go b/apps/console/main.go index 145da1b8a..454a54d48 100644 --- a/apps/console/main.go +++ b/apps/console/main.go @@ -3,16 +3,19 @@ package main import ( "context" "flag" - "fmt" + "os" "time" + "github.com/kloudlite/api/pkg/errors" + "go.uber.org/fx" "k8s.io/client-go/rest" - "kloudlite.io/apps/console/internal/env" - "kloudlite.io/apps/console/internal/framework" - fn "kloudlite.io/pkg/functions" - "kloudlite.io/pkg/k8s" - "kloudlite.io/pkg/logging" + + "github.com/kloudlite/api/apps/console/internal/env" + "github.com/kloudlite/api/apps/console/internal/framework" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/k8s" + "github.com/kloudlite/api/pkg/logging" ) func main() { @@ -20,23 +23,35 @@ func main() { flag.BoolVar(&isDev, "dev", false, "--dev") flag.Parse() + logger, err := logging.New(&logging.Options{Name: "console", Dev: isDev}) + if err != nil { + panic(err) + } + app := fx.New( - fx.Provide(env.LoadEnv), fx.NopLogger, - fx.Provide( - func() (logging.Logger, error) { - return logging.New(&logging.Options{Name: "console", Dev: isDev}) - }, - ), - fx.Provide(func() (*rest.Config, error) { - if isDev { + + fx.Provide(func() logging.Logger { + return logger + }), + + fx.Provide(func() (*env.Env, error) { + if e, err := env.LoadEnv(); err != nil { + return nil, errors.NewE(err) + } else { + e.IsDev = isDev + return e, nil + } + }), + + fx.Provide(func(e *env.Env) (*rest.Config, error) { + if e.KubernetesApiProxy != "" { return &rest.Config{ - Host: "localhost:8080", + Host: e.KubernetesApiProxy, }, nil } return k8s.RestInclusterConfig() }), - fn.FxErrorHandler(), framework.Module, ) @@ -49,18 +64,11 @@ func main() { defer cancelFunc() if err := app.Start(ctx); err != nil { - panic(err) + logger.Errorf(err, "console startup errors") + logger.Infof("EXITING as errors encountered during startup") + os.Exit(1) } - fmt.Println( - ` -██████ ███████ █████ ██████ ██ ██ -██ ██ ██ ██ ██ ██ ██ ██ ██ -██████ █████ ███████ ██ ██ ████ -██ ██ ██ ██ ██ ██ ██ ██ -██ ██ ███████ ██ ██ ██████ ██ - `, - ) - + common.PrintReadyBanner() <-app.Done() } diff --git a/apps/container-registry/.dockerignore b/apps/container-registry/.dockerignore index b30fec26f..c33b5ad2b 100644 --- a/apps/container-registry/.dockerignore +++ b/apps/container-registry/.dockerignore @@ -1,3 +1,4 @@ ** !main.go !internal +!templates diff --git a/apps/container-registry/Containerfile.local b/apps/container-registry/Containerfile.local new file mode 100644 index 000000000..95e620786 --- /dev/null +++ b/apps/container-registry/Containerfile.local @@ -0,0 +1,5 @@ +FROM gcr.io/distroless/static-debian12:nonroot +ARG binpath +COPY --from=local-builder ${binpath} /container-registry +COPY templates /templates +CMD ["/container-registry"] diff --git a/apps/container-registry/Dockerfile b/apps/container-registry/Dockerfile index d6c3af15f..90ecb5ac7 100644 --- a/apps/container-registry/Dockerfile +++ b/apps/container-registry/Dockerfile @@ -19,4 +19,5 @@ RUN chmod +x /tmp/bin/$APP FROM gcr.io/distroless/static-debian11 ARG APP COPY --from=base --chown=1001 /tmp/bin/$APP /container-registry +COPY templates /templates CMD ["/container-registry"] diff --git a/apps/container-registry/Taskfile.yml b/apps/container-registry/Taskfile.yml index 667efe15c..5e97bdea2 100644 --- a/apps/container-registry/Taskfile.yml +++ b/apps/container-registry/Taskfile.yml @@ -3,37 +3,56 @@ version: "3" dotenv: - .secrets/env +vars: + ImagePrefix: "ghcr.io/kloudlite/platform/apis" + tasks: gql: dir: ./internal/app cmds: - go run -tags dynamic github.com/99designs/gqlgen generate - - rm "./graph/scalars.resolvers.go" + - gofmt -w -d -r '"errors" -> "github.com/kloudlite/api/pkg/errors"' graph/*.resolvers.go build: env: CGO_ENABLED: 0 + GOOS: linux + GOARCH: amd64 + vars: + BuiltAt: + sh: date | sed 's/\s/_/g' preconditions: - sh: '[ -n "{{.Out}}" ]' msg: var Out must have a value cmds: - - go build -ldflags="-s -w" -o {{.Out}} + - go build -v -ldflags="-s -w -X github.com/kloudlite/api/common.BuiltAt=\"{{.BuiltAt}}\"" -o {{.Out}} - upx {{.Out}} k8s-schema: cmds: - - mkdir -p "./internal/app/graph/crd-to-gql" - - go run ../../cmd/crd-to-gql --dev - --output "./internal/app/graph/crd-to-gql" - --crd HarborRobotUser=harboruseraccounts.artifacts.kloudlite.io - # --crd Project=projects.crds.kloudlite.io - # --crd App=apps.crds.kloudlite.io - # --crd Secret=secrets.crds.kloudlite.io - # --crd Config=configs.crds.kloudlite.io - # --crd Secret=secrets.crds.kloudlite.io - # --crd Router=routers.crds.kloudlite.io - # --crd ManagedService=managedservices.crds.kloudlite.io - # --crd ManagedResource=managedresources.crds.kloudlite.io + - mkdir -p "./internal/app/_struct-to-graphql" + - go run ../../cmd/struct-to-graphql + --struct github.com/kloudlite/api/apps/container-registry/internal/domain/entities.GithubInstallation + --struct github.com/kloudlite/api/apps/container-registry/internal/domain/entities.GitlabProject + --struct github.com/kloudlite/api/apps/container-registry/internal/domain/entities.GitlabGroup + --struct github.com/kloudlite/api/apps/container-registry/internal/domain/entities.GithubListRepository + --struct github.com/kloudlite/api/apps/container-registry/internal/domain/entities.GithubSearchRepository + --struct github.com/kloudlite/api/apps/container-registry/internal/domain/entities.GitBranch + --struct github.com/kloudlite/api/apps/container-registry/internal/domain/entities.BuildRun + --struct github.com/kloudlite/api/pkg/types.Pagination + --struct github.com/kloudlite/api/apps/container-registry/internal/domain/entities.Credential + --struct github.com/kloudlite/api/apps/container-registry/internal/domain/entities.Repository + --struct github.com/kloudlite/api/apps/container-registry/internal/domain/entities.Digest + --struct github.com/kloudlite/api/apps/container-registry/internal/domain/entities.Build + --struct github.com/kloudlite/api/apps/container-registry/internal/domain/entities.BuildCacheKey + --struct github.com/kloudlite/api/pkg/repos.MatchFilter + --struct github.com/kloudlite/api/pkg/repos.CursorPagination + > ./internal/app/_struct-to-graphql/main.go + - |+ + pushd ./internal/app/_struct-to-graphql + go run main.go --dev --out-dir ../graph/struct-to-graphql --with-pagination Credential,BuildRun,Repository,Digest,Build,BuildCacheKey + popd + - rm -rf ./internal/app/_struct-to-graphql docker-build: vars: @@ -52,39 +71,22 @@ tasks: local-build: preconditions: - - sh: '[ -n "{{.EnvName}}" ]' - msg: 'var EnvName must have a value' - sh: '[ -n "{{.Tag}}" ]' msg: 'var Tag must have a value' vars: APP: container-registry - IMAGE: registry.kloudlite.io/kloudlite/{{.EnvName}}/{{.APP}}-api:{{.Tag}} - env: - CGO_ENABLED: 0 - GOOS: linux - GOARCH: amd64 + IMAGE: "{{.ImagePrefix}}/{{.APP}}:{{.Tag}}" + BUILDER: podman silent: true cmds: - |+ - lineNumbers=$(cat Dockerfile | grep -i '^FROM' -n | tail +2 | awk -F: '{print $1}') - - startLineNo=$(echo "$lineNumbers" | head -n+1) - finalLineNo=$(echo "$lineNumbers" | tail -1) - tDir=$(mktemp -d) - nDockerfile=$(cat Dockerfile | tail --lines=+$startLineNo | grep -i --invert-match 'from=base') - echo "$nDockerfile" | sed "1 i # syntax=docker/dockerfile:1.4" > $tDir/Dockerfile.base - - cat $tDir/Dockerfile.base | sed "4 i COPY --from=local-builder ./{{.APP}} /{{.APP}}" > $tDir/Dockerfile - cat $tDir/Dockerfile echo "building application ..." - - # CGO_ENABLED=0 go build -o $tDir/{{.APP}} . task build Out=$tDir/{{.APP}} - docker buildx build -f $tDir/Dockerfile -t {{.IMAGE}} . --build-context local-builder=${tDir} - docker push {{.IMAGE}} + {{.BUILDER}} buildx build -f Containerfile.local -t {{.IMAGE}} . --build-context local-builder=${tDir} --build-arg binpath={{.APP}} + {{.BUILDER}} push {{.IMAGE}} rm -rf $tDir run: @@ -95,6 +97,4 @@ tasks: env: CGO_ENABLED: 0 cmds: - - go build -o /tmp/{{.Name}} ./main.go - # - dlv exec -l 127.0.0.1:31117 --headless /tmp/console -- --dev - - /tmp/{{.Name}} --dev + - go run ./main.go --dev diff --git a/apps/container-registry/internal/app/adapter-resource-apply.go b/apps/container-registry/internal/app/adapter-resource-apply.go new file mode 100644 index 000000000..a60e765c3 --- /dev/null +++ b/apps/container-registry/internal/app/adapter-resource-apply.go @@ -0,0 +1,83 @@ +package app + +import ( + "encoding/json" + "fmt" + "github.com/kloudlite/api/apps/container-registry/internal/domain" + + t "github.com/kloudlite/api/apps/tenant-agent/types" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/errors" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/messaging" + msgTypes "github.com/kloudlite/api/pkg/messaging/types" + "github.com/kloudlite/operator/pkg/constants" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +type SendTargetClusterMessagesProducer messaging.Producer + +type resourceDispatcherImpl struct { + producer messaging.Producer +} + +func NewResourceDispatcher(producer SendTargetClusterMessagesProducer) domain.ResourceDispatcher { + return &resourceDispatcherImpl{ + producer, + } +} + +func (a *resourceDispatcherImpl) ApplyToTargetCluster(ctx domain.RegistryContext, clusterName string, obj client.Object, recordVersion int) error { + ann := obj.GetAnnotations() + if ann == nil { + ann = make(map[string]string, 1) + } + ann[constants.RecordVersionKey] = fmt.Sprintf("%d", recordVersion) + obj.SetAnnotations(ann) + + m, err := fn.K8sObjToMap(obj) + if err != nil { + return errors.NewE(err) + } + + b, err := json.Marshal(t.AgentMessage{ + AccountName: ctx.AccountName, + ClusterName: clusterName, + Action: t.ActionApply, + Object: m, + }) + if err != nil { + return errors.NewE(err) + } + + err = a.producer.Produce(ctx, msgTypes.ProduceMsg{ + Subject: common.GetTenantClusterMessagingTopic(ctx.AccountName, clusterName), + Payload: b, + }) + + return errors.NewE(err) +} + +func (d *resourceDispatcherImpl) DeleteFromTargetCluster(ctx domain.RegistryContext, clusterName string, obj client.Object) error { + m, err := fn.K8sObjToMap(obj) + if err != nil { + return errors.NewE(err) + } + + b, err := json.Marshal(t.AgentMessage{ + AccountName: ctx.AccountName, + ClusterName: clusterName, + Action: t.ActionDelete, + Object: m, + }) + if err != nil { + return errors.NewE(err) + } + + err = d.producer.Produce(ctx, msgTypes.ProduceMsg{ + Subject: common.GetTenantClusterMessagingTopic(ctx.AccountName, clusterName), + Payload: b, + }) + + return errors.NewE(err) +} diff --git a/apps/container-registry/internal/app/adapter-resource-update-publish.go b/apps/container-registry/internal/app/adapter-resource-update-publish.go new file mode 100644 index 000000000..74c8e2751 --- /dev/null +++ b/apps/container-registry/internal/app/adapter-resource-update-publish.go @@ -0,0 +1,51 @@ +package app + +import ( + "fmt" + "github.com/kloudlite/api/apps/container-registry/internal/domain" + "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/api/pkg/nats" +) + +type ResourceEventPublisherImpl struct { + cli *nats.Client + logger logging.Logger +} + +func (r *ResourceEventPublisherImpl) PublishBuildRunEvent(buildrun *entities.BuildRun, msg domain.PublishMsg) { + subject := clusterBuildRunUpdateSubject(buildrun) + if err := r.cli.Conn.Publish(subject, []byte(msg)); err != nil { + r.logger.Errorf(err, "failed to publish message to subject %q", subject) + } +} + +func (r *ResourceEventPublisherImpl) PublishBuildCacheEvent(buildCache *entities.BuildCacheKey, msg domain.PublishMsg) { + subject := clusterBuildCacheUpdateSubject(buildCache) + if err := r.cli.Conn.Publish(subject, []byte(msg)); err != nil { + r.logger.Errorf(err, "failed to publish message to subject %q", subject) + } +} + +func NewResourceEventPublisher(cli *nats.Client, logger logging.Logger) domain.ResourceEventPublisher { + return &ResourceEventPublisherImpl{ + cli, + logger, + } +} + +func clusterBuildRunUpdateSubject(buildRun *entities.BuildRun) string { + return fmt.Sprintf("res-updates.account.%s.cluster.%s.repo.%s.build-config.%s.build-run.%s", + buildRun.AccountName, + buildRun.ClusterName, + buildRun.Spec.Registry.Repo.Name, + buildRun.Spec.BuildOptions) +} + +func clusterBuildCacheUpdateSubject(buildCache *entities.BuildCacheKey) string { + return fmt.Sprintf("res-updates.account.%s.displayName.%s.name.%s", + buildCache.AccountName, + buildCache.DisplayName, + buildCache.Name, + ) +} diff --git a/apps/container-registry/internal/app/git-webhook-consumer.go b/apps/container-registry/internal/app/git-webhook-consumer.go new file mode 100644 index 000000000..cf93c7d10 --- /dev/null +++ b/apps/container-registry/internal/app/git-webhook-consumer.go @@ -0,0 +1,146 @@ +package app + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/kloudlite/api/pkg/messaging" + msgTypes "github.com/kloudlite/api/pkg/messaging/types" + + "github.com/kloudlite/api/apps/container-registry/internal/domain" + "github.com/kloudlite/api/constants" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/api/pkg/types" +) + +const ( + GithubEventHeader string = "X-Github-Event" + GitlabEventHeader string = "X-Gitlab-Event" +) + +type ( + GitWebhookConsumer messaging.Consumer + BuildRunProducer messaging.Producer +) + +func processGitWebhooks(ctx context.Context, d domain.Domain, consumer GitWebhookConsumer, logr logging.Logger) error { + err := consumer.Consume(func(msg *msgTypes.ConsumeMsg) error { + logger := logr.WithName("ci-webhook") + logger.Infof("started processing") + defer func() { + logger.Infof("finished processing") + }() + var gitHook types.GitHttpHook + if err := json.Unmarshal(msg.Payload, &gitHook); err != nil { + logger.Errorf(err, "could not unmarshal into *GitWebhookPayload") + return errors.NewE(err) + } + hook, err := func() (*domain.GitWebhookPayload, error) { + if gitHook.GitProvider == constants.ProviderGithub { + return d.ParseGithubHook(gitHook.Headers[GithubEventHeader][0], gitHook.Body) + } + if gitHook.GitProvider == constants.ProviderGitlab { + return d.ParseGitlabHook(gitHook.Headers[GitlabEventHeader][0], gitHook.Body) + } + return nil, errors.New("unknown git provider") + }() + if err != nil { + if _, ok := err.(*domain.ErrEventNotSupported); ok { + fmt.Println(gitHook.GitProvider) + logger.Infof(err.Error()) + return nil + } + logger.Errorf(err, "could not extract gitHook") + return errors.NewE(err) + } + logger = logger.WithKV("repo", hook.RepoUrl, "provider", hook.GitProvider, "branch", hook.GitBranch) + logger.Infof("repo: %s, branch: %s, gitprovider: %s", hook.RepoUrl, hook.GitBranch, hook.GitProvider) + builds, err := d.ListBuildsByGit(ctx, hook.RepoUrl, hook.GitBranch, hook.GitProvider) + if err != nil { + return errors.NewE(err) + } + + var pullToken string + + switch hook.GitProvider { + + case constants.ProviderGithub: + pullToken, err = d.GithubInstallationToken(ctx, hook.RepoUrl) + if err != nil { + fmt.Println(err) + return errors.NewE(err) + } + + case constants.ProviderGitlab: + pullToken = "" + + default: + fmt.Println("provider not supported", hook.GitProvider) + return errors.Newf("provider %s not supported", hook.GitProvider) + } + + for _, build := range builds { + if hook.GitProvider == constants.ProviderGitlab { + pullToken, err = d.GitlabPullToken(ctx, build.CredUser.UserId) + if err != nil { + errorMessage := fmt.Sprintf("could not get pull token for build, Error: %s", err.Error()) + if build.ErrorMessages == nil { + build.ErrorMessages = make(map[string]string) + } + if build.ErrorMessages["access-error"] != errorMessage { + build.ErrorMessages["access-error"] = errorMessage + _, err := d.UpdateBuildInternal(ctx, build) + if err != nil { + return errors.NewE(err) + } + } + + continue + } else { + if build.ErrorMessages["access-error"] != "" { + delete(build.ErrorMessages, "access-error") + _, err := d.UpdateBuildInternal(ctx, build) + if err != nil { + return errors.NewE(err) + } + } + } + } + + if pullToken == "" { + logger.Warnf("pull token is empty") + continue + } + + if err != nil { + logger.Errorf(err, "could not generate pull-token") + continue + } + + dctx := domain.RegistryContext{ + Context: context.TODO(), + UserId: "sys-user:error-on-apply-worker", + UserEmail: "", + UserName: "", + AccountName: build.Spec.AccountName, + } + + err := d.CreateBuildRun(dctx, build, hook, pullToken) + if err != nil { + logger.Errorf(err, "could not create build run") + } + } + return nil + }, msgTypes.ConsumeOpts{ + OnError: func(err error) error { + logr.Errorf(err, "error while consuming message") + return nil + }, + }) + if err != nil { + return errors.NewE(err) + } + return nil +} diff --git a/apps/container-registry/internal/app/github.go b/apps/container-registry/internal/app/github.go new file mode 100644 index 000000000..920e58951 --- /dev/null +++ b/apps/container-registry/internal/app/github.go @@ -0,0 +1,313 @@ +package app + +import ( + "context" + "fmt" + // "io/ioutil" + "net/http" + "os" + "regexp" + "strconv" + "strings" + "time" + + "github.com/bradleyfalzon/ghinstallation/v2" + "github.com/google/go-github/v45/github" + "github.com/kloudlite/api/apps/container-registry/internal/domain" + "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" + "go.uber.org/fx" + "golang.org/x/oauth2" + oauthGithub "golang.org/x/oauth2/github" + + "github.com/kloudlite/api/pkg/errors" + // fn "kloudlite.io/pkg/functions" + "github.com/kloudlite/api/pkg/types" +) + +type githubOptions interface { + GithubConfig() (clientId, clientSecret, callbackUrl, ghAppId, ghAppPKFile string) + GithubScopes() string +} + +type githubI struct { + cfg *oauth2.Config + ghCli *github.Client + ghCliForUser func(ctx context.Context, token *oauth2.Token) *github.Client + env githubOptions +} + +type GithubOAuth interface { + GithubConfig() (clientId, clientSecret, callbackUrl, githubAppId, githubAppPKFile string) +} + +func (gh *githubI) getOwnerAndRepo(repoUrl string) (owner, repo string, err error) { + re := regexp.MustCompile("https://(.+)/(.+)/(.+)") + + if !re.MatchString(repoUrl) { + return "", "", errors.Newf("invalid repository url") + } + + matches := re.FindStringSubmatch(repoUrl) + return matches[2], strings.Split(matches[3], ".git")[0], nil +} + +func (gh *githubI) buildListOptions(p *types.Pagination) github.ListOptions { + if p == nil { + return github.ListOptions{ + PerPage: 200, + } + } + return github.ListOptions{ + Page: p.Page, + PerPage: p.PerPage, + } +} + +// maybe not needed +func (gh *githubI) AddRepoWebhook(ctx context.Context, accToken *entities.AccessToken, repoUrl, webhookUrl string) (*entities.GithubWebhookId, error) { + // owner, repo := gh.getOwnerAndRepo(repoUrl) + // hookName := "kloudlite-pipeline" + // + // hook, res, err := gh.ghCliForUser(ctx, accToken.Token).Repositories.CreateHook( + // ctx, owner, repo, &github.Hook{ + // Config: map[string]any{ + // "url": webhookUrl, + // "content_type": "json", + // "secret": gh.env.GithubWebhookAuthzSecret, + // }, + // Events: []string{"push"}, + // Active: fn.NewBool(true), + // Name: &hookName, + // }, + // ) + // if err != nil { + // // ASSERT: GitHub returns 422 only if hook already exists on the repository + // if res.StatusCode == 422 { + // return nil, nil + // } + // return nil, errors.NewEf(err, "could not create github webhook") + // } + // + // return fn.New(entities.GithubWebhookId(*hook.ID)), nil + + return nil, errors.Newf("not implemented") +} + +func (gh *githubI) AddWebhook(ctx context.Context, accToken *entities.AccessToken, repoUrl string, webhookUrl string) (*entities.GithubWebhookId, error) { + // TODO:: we migrated to GitHub app webhook, which allows us to skip creating github repository webhooks, now + return nil, errors.Newf("not implemented") +} + +// Callback implements domain.Github. +func (gh *githubI) Callback(ctx context.Context, code string, state string) (*github.User, *oauth2.Token, error) { + token, err := gh.cfg.Exchange(ctx, code) + if err != nil { + return nil, nil, errors.NewEf(err, "could not exchange the token") + } + c := gh.cfg.Client(ctx, token) + c2 := github.NewClient(c) + u, _, err := c2.Users.Get(ctx, "") + if err != nil { + return nil, nil, errors.NewEf(err, "could nog get authenticated user from github") + } + return u, token, nil + +} + +// CheckWebhookExists implements domain.Github. +func (gh *githubI) CheckWebhookExists(ctx context.Context, token *entities.AccessToken, repoUrl string, webhookId *entities.GithubWebhookId) (bool, error) { + if webhookId == nil { + return false, nil + } + + owner, repo, err := gh.getOwnerAndRepo(repoUrl) + if err != nil { + return false, errors.NewE(err) + } + + hook, _, err := gh.ghCliForUser(ctx, token.Token).Repositories.GetHook(ctx, owner, repo, int64(*webhookId)) + if err != nil { + return false, errors.NewE(err) + } + + return hook != nil, nil +} + +// DeleteWebhook implements domain.Github. +func (gh *githubI) DeleteWebhook(ctx context.Context, accToken *entities.AccessToken, repoUrl string, hookId entities.GithubWebhookId) error { + + owner, repo, err := gh.getOwnerAndRepo(repoUrl) + + if err != nil { + return errors.NewE(err) + } + + resp, err := gh.ghCliForUser(ctx, accToken.Token).Repositories.DeleteHook(ctx, owner, repo, int64(hookId)) + if err != nil && resp.StatusCode == http.StatusNotFound { + return nil + } + return errors.NewE(err) + +} + +// GetInstallationToken implements domain.Github. +func (gh *githubI) GetInstallationToken(ctx context.Context, repoUrl string) (string, error) { + owner, repo, err := gh.getOwnerAndRepo(repoUrl) + + if err != nil { + return "", errors.NewE(err) + } + + inst, _, err := gh.ghCli.Apps.FindRepositoryInstallation(ctx, owner, repo) + if err != nil { + return "", errors.NewEf(err, "could not fetch repository installation") + } + installationId := *inst.ID + it, _, err := gh.ghCli.Apps.CreateInstallationToken(ctx, installationId, &github.InstallationTokenOptions{}) + if err != nil { + return "", errors.NewEf(err, "failed to get installation token") + } + return it.GetToken(), errors.NewE(err) + +} + +// GetLatestCommit implements domain.Github. +func (gh *githubI) GetLatestCommit(ctx context.Context, accToken *entities.AccessToken, repoUrl string, branchName string) (string, error) { + owner, repo, err := gh.getOwnerAndRepo(repoUrl) + if err != nil { + return "", errors.NewE(err) + } + + inst, _, err := gh.ghCli.Apps.FindRepositoryInstallation(ctx, owner, repo) + if err != nil { + return "", errors.NewEf(err, "could not fetch repository installation") + } + installationId := *inst.ID + it, _, err := gh.ghCli.Apps.CreateInstallationToken(ctx, installationId, &github.InstallationTokenOptions{}) + if err != nil { + return "", errors.NewEf(err, "failed to get installation token") + } + return it.GetToken(), errors.NewE(err) +} + +// GetToken implements domain.Github. +func (gh *githubI) GetToken(ctx context.Context, token *oauth2.Token) (*oauth2.Token, error) { + return gh.cfg.TokenSource(ctx, token).Token() +} + +// ListBranches implements domain.Github. +func (gh *githubI) ListBranches(ctx context.Context, accToken *entities.AccessToken, repoUrl string, pagination *types.Pagination) ([]*github.Branch, error) { + owner, repo, err := gh.getOwnerAndRepo(repoUrl) + if err != nil { + return nil, errors.NewE(err) + } + + var branches []*github.Branch + hasFetchedAll := false + pageNo := 1 + for !hasFetchedAll { + if pageNo > 5 { + break + } + brcs, _, err := gh.ghCliForUser(ctx, accToken.Token).Repositories.ListBranches( + ctx, owner, repo, &github.BranchListOptions{ + ListOptions: func() github.ListOptions { + return github.ListOptions{Page: pageNo, PerPage: 100} + }(), + }, + ) + if err != nil { + return nil, errors.NewEf(err, "could not list branches") + } + branches = append(branches, brcs...) + if len(brcs) != 100 { + hasFetchedAll = true + } + pageNo++ + } + return branches, nil +} + +// ListInstallations implements domain.Github. +func (gh *githubI) ListInstallations(ctx context.Context, accToken *entities.AccessToken, pagination *types.Pagination) ([]*github.Installation, error) { + opts := gh.buildListOptions(pagination) + i, _, err := gh.ghCliForUser(ctx, accToken.Token).Apps.ListUserInstallations(ctx, &opts) + if err != nil { + return nil, errors.NewEf(err, "could not list user installations") + } + return i, nil +} + +// ListRepos implements domain.Github. +func (gh *githubI) ListRepos(ctx context.Context, accToken *entities.AccessToken, instId int64, pagination *types.Pagination) (*github.ListRepositories, error) { + opts := gh.buildListOptions(pagination) + repos, _, err := gh.ghCliForUser(ctx, accToken.Token).Apps.ListUserRepos(ctx, instId, &opts) + if err != nil { + return nil, errors.NewEf(err, "could not list user repositories") + } + return repos, nil + +} + +// SearchRepos implements domain.Github. +func (gh *githubI) SearchRepos(ctx context.Context, accToken *entities.AccessToken, q string, org string, pagination *types.Pagination) (*github.RepositoriesSearchResult, error) { + // TODO: search repos not working at all from the API + searchQ := fmt.Sprintf("%s org:%s", q, org) + rsr, resp, err := gh.ghCliForUser(ctx, accToken.Token).Search.Repositories( + context.TODO(), searchQ, &github.SearchOptions{ + ListOptions: gh.buildListOptions(pagination), + }, + ) + fmt.Println(resp) + if err != nil { + return nil, errors.NewEf(err, "could not search repositories") + } + return rsr, nil +} + +func fxGithub[T githubOptions]() fx.Option { + + return fx.Module("github-fx", + fx.Provide( + func(env T) (domain.Github, error) { + clientId, clientSecret, callbackUrl, ghAppId, ghAppPKFile := env.GithubConfig() + cfg := oauth2.Config{ + ClientID: clientId, + ClientSecret: clientSecret, + Endpoint: oauthGithub.Endpoint, + RedirectURL: callbackUrl, + Scopes: strings.Split(env.GithubScopes(), ","), + // Scopes: []string{"user:email", "admin:org"}, + } + + if _, err := os.Stat(ghAppPKFile); err != nil { + return nil, errors.Newf("github privaate key file (path='%s') does not exist", ghAppPKFile) + } + + // ioutil.ReadFile(name string) + privatePem, err := os.ReadFile(ghAppPKFile) + if err != nil { + return nil, errors.NewEf(err, "reading github app PK file") + } + + appId, _ := strconv.ParseInt(ghAppId, 10, 64) + itr, err := ghinstallation.NewAppsTransport(http.DefaultTransport, appId, privatePem) + if err != nil { + panic(errors.NewEf(err, "creating app transport")) + } + + ghCliForUser := func(ctx context.Context, token *oauth2.Token) *github.Client { + ts := oauth2.StaticTokenSource(token) + return github.NewClient(oauth2.NewClient(ctx, ts)) + } + + ghCli := github.NewClient(&http.Client{Transport: itr, Timeout: 30 * time.Second}) + + return &githubI{ + cfg: &cfg, + ghCli: ghCli, + ghCliForUser: ghCliForUser, + env: env, + }, nil + })) +} diff --git a/apps/container-registry/internal/app/gitlab.go b/apps/container-registry/internal/app/gitlab.go new file mode 100644 index 000000000..2abdb4596 --- /dev/null +++ b/apps/container-registry/internal/app/gitlab.go @@ -0,0 +1,244 @@ +package app + +import ( + "context" + "fmt" + "regexp" + "strings" + + "github.com/kloudlite/api/apps/container-registry/internal/domain" + "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" + "github.com/kloudlite/api/pkg/errors" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/types" + gitlab "github.com/xanzy/go-gitlab" + "go.uber.org/fx" + "golang.org/x/oauth2" + oauthGitlab "golang.org/x/oauth2/gitlab" +) + +type gitlabOptions interface { + GitlabConfig() (clientId, clientSecret, callbackUrl string) + GitlabScopes() string + GitlabWebhookAuthzSecret() *string + GitlabWebhookUrl() *string +} + +type gitlabI struct { + cfg *oauth2.Config + // webhookUrl string + env gitlabOptions +} + +// AddWebhook implements domain.Gitlab. +func (gl *gitlabI) AddWebhook(ctx context.Context, token *entities.AccessToken, repoId string) (*int, error) { + client, err := gl.getClient(ctx, token) + if err != nil { + return nil, errors.NewE(err) + } + // webhookUrl := fmt.Sprintf("%s?pipelineId=%s", gl.webhookUrl, pipelineId) + + hook, _, err := client.Projects.AddProjectHook( + repoId, &gitlab.AddProjectHookOptions{ + PushEvents: fn.New(true), + TagPushEvents: fn.New(true), + Token: gl.env.GitlabWebhookAuthzSecret(), + URL: gl.env.GitlabWebhookUrl(), + }, + ) + if err != nil { + return nil, errors.NewEf(err, "could not add gitlab webhook") + } + return &hook.ID, nil +} + +// Callback implements domain.Gitlab. +func (*gitlabI) Callback(ctx context.Context, code string, state string) (*gitlab.User, *oauth2.Token, error) { + panic("unimplemented") +} + +// CheckWebhookExists implements domain.Gitlab. +func (*gitlabI) CheckWebhookExists(ctx context.Context, token *entities.AccessToken, repoId string, webhookId *entities.GitlabWebhookId) (bool, error) { + panic("unimplemented") +} + +func (gl *gitlabI) getRepoId(repoUrl string) string { + re := regexp.MustCompile("https://(.*?)/(.*)") + // re := regexp.MustCompile("https://(.*?)/(.*)(.git)?") + matches := re.FindStringSubmatch(repoUrl) + return strings.Split(matches[2], ".git")[0] +} + +// DeleteWebhook implements domain.Gitlab. +func (gl *gitlabI) DeleteWebhook(ctx context.Context, token *entities.AccessToken, repoUrl string, hookId entities.GitlabWebhookId) error { + client, err := gl.getClient(ctx, token) + if err != nil { + return errors.NewE(err) + } + _, err = client.Projects.DeleteProjectHook(gl.getRepoId(repoUrl), int(hookId)) + return errors.NewE(err) +} + +// GetLatestCommit implements domain.Gitlab. +func (*gitlabI) GetLatestCommit(ctx context.Context, token *entities.AccessToken, repoUrl string, branchName string) (string, error) { + panic("unimplemented") +} + +// GetRepoId implements domain.Gitlab. +func (*gitlabI) GetRepoId(repoUrl string) string { + re := regexp.MustCompile("https://(.*?)/(.*)") + // re := regexp.MustCompile("https://(.*?)/(.*)(.git)?") + matches := re.FindStringSubmatch(repoUrl) + return strings.Split(matches[2], ".git")[0] +} + +// GetTriggerWebhookUrl implements domain.Gitlab. +func (*gitlabI) GetTriggerWebhookUrl() string { + panic("unimplemented") +} + +// ListBranches implements domain.Gitlab. +func (gl *gitlabI) ListBranches(ctx context.Context, token *entities.AccessToken, repoId string, query *string, pagination *types.Pagination) ([]*gitlab.Branch, error) { + client, err := gl.getClient(ctx, token) + if err != nil { + return nil, errors.NewE(err) + } + branches, _, err := client.Branches.ListBranches( + repoId, &gitlab.ListBranchesOptions{ + ListOptions: buildListOptions(pagination), + Search: query, + }, + ) + + return branches, errors.NewE(err) +} + +func (gl *gitlabI) getToken(_ context.Context, token *entities.AccessToken) (*oauth2.Token, error) { + if token == nil { + return nil, errors.New("token is nil") + } + return token.Token, nil +} + +func (gl *gitlabI) getClient(ctx context.Context, token *entities.AccessToken) (*gitlab.Client, error) { + t, err := gl.getToken(ctx, token) + if err != nil { + return nil, errors.NewE(err) + } + client, err := gitlab.NewOAuthClient(t.AccessToken) + if err != nil { + return nil, errors.NewEf(err, "could not build gitlab oauth client") + } + return client, nil +} + +func buildListOptions(p *types.Pagination) gitlab.ListOptions { + if p == nil { + return gitlab.ListOptions{} + } + return gitlab.ListOptions{ + Page: p.Page, + PerPage: p.PerPage, + } +} + +// ListGroups implements domain.Gitlab. +func (gl *gitlabI) ListGroups(ctx context.Context, token *entities.AccessToken, query *string, pagination *types.Pagination) ([]*entities.GitlabGroup, error) { + client, err := gl.getClient(ctx, token) + if err != nil { + return nil, errors.NewE(err) + } + + groups, _, err := client.Groups.ListGroups( + &gitlab.ListGroupsOptions{ + ListOptions: buildListOptions(pagination), + Search: query, + TopLevelOnly: fn.New(true), + WithCustomAttributes: nil, + }, + ) + if err != nil { + return nil, errors.NewE(err) + } + + grs := make([]*entities.GitlabGroup, 0, len(groups)+1) + + user, _, err := client.Users.CurrentUser() + if err != nil { + return nil, errors.NewE(err) + } + + grs = append(grs, &entities.GitlabGroup{Id: fmt.Sprintf("%d", user.ID), FullName: user.Name, AvatarUrl: user.AvatarURL}) + for i := range groups { + grs = append( + grs, &entities.GitlabGroup{ + Id: fmt.Sprintf("%d", groups[i].ID), + FullName: groups[i].FullName, + AvatarUrl: groups[i].AvatarURL, + }, + ) + } + + return grs, nil +} + +// ListRepos implements domain.Gitlab. +func (gl *gitlabI) ListRepos(ctx context.Context, token *entities.AccessToken, gid string, query *string, pagination *types.Pagination) ([]*gitlab.Project, error) { + client, err := gl.getClient(ctx, token) + if err != nil { + return nil, errors.NewE(err) + } + + user, _, err := client.Users.CurrentUser() + if err != nil { + return nil, errors.NewEf(err, "could not get current gitlab user") + } + + if fmt.Sprintf("%d", user.ID) == gid { + projects, _, err := client.Projects.ListUserProjects( + user.ID, &gitlab.ListProjectsOptions{ + ListOptions: buildListOptions(pagination), + Search: query, + Simple: fn.New(true), + }, + ) + + return projects, errors.NewE(err) + } + + projects, _, err := client.Groups.ListGroupProjects( + gid, &gitlab.ListGroupProjectsOptions{ + IncludeSubGroups: fn.New(true), + ListOptions: buildListOptions(pagination), + Search: query, + Simple: fn.New(true), + }, + ) + + return projects, errors.NewE(err) +} + +// RepoToken implements domain.Gitlab. +func (*gitlabI) RepoToken(ctx context.Context, token *entities.AccessToken) (*oauth2.Token, error) { + panic("unimplemented") +} + +func fxGitlab[T gitlabOptions]() fx.Option { + return fx.Module("gitlab-fx", fx.Provide( + func(env T) (domain.Gitlab, error) { + clientId, clientSecret, callbackUrl := env.GitlabConfig() + cfg := oauth2.Config{ + ClientID: clientId, + ClientSecret: clientSecret, + Endpoint: oauthGitlab.Endpoint, + RedirectURL: callbackUrl, + Scopes: strings.Split(env.GitlabScopes(), ","), + } + + return &gitlabI{ + env: env, + cfg: &cfg, + }, nil + }, + )) +} diff --git a/apps/container-registry/internal/app/gqlgen.yml b/apps/container-registry/internal/app/gqlgen.yml index 6d675c3e5..550aba72b 100644 --- a/apps/container-registry/internal/app/gqlgen.yml +++ b/apps/container-registry/internal/app/gqlgen.yml @@ -1,7 +1,8 @@ # Where are all the schema files located? globs are supported eg src/**/*.graphqls schema: - graph/*.graphqls - - graph/crd-to-gql/*.graphqls + # - graph/crd-to-gql/*.graphqls + - graph/struct-to-graphql/*.graphqls # Where should the generated server code go? exec: @@ -36,8 +37,8 @@ resolver: # 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: - - "kloudlite.io/pkg/errors" - # - "kloudlite.io/apps/wireguard/internal/domain/entities" + - "github.com/kloudlite/api/pkg/errors" + # - "github.com/kloudlite/api/apps/wireguard/internal/domain/entities" # This section declares type mapping between the GraphQL and go type systems # @@ -46,73 +47,95 @@ autobind: # your liking skip_validation: true models: + Metadata: &metadata-model + model: k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta + MetadataIn: *metadata-model + ID: model: - - kloudlite.io/pkg/repos.ID + - github.com/kloudlite/api/pkg/repos.ID Int: model: - github.com/99designs/gqlgen/graphql.Int - github.com/99designs/gqlgen/graphql.Int64 - github.com/99designs/gqlgen/graphql.Int32 - PaginationIn: - model: - - kloudlite.io/pkg/types.Pagination Json: model: - github.com/99designs/gqlgen/graphql.Map - Repo: + CRCheckNameAvailabilityOutput: + model: github.com/kloudlite/api/apps/container-registry/internal/domain.CheckNameAvailabilityOutput + + Build: &build model: - - kloudlite.io/pkg/harbor.Repository - Artifact: + - github.com/kloudlite/api/apps/container-registry/internal/domain/entities.Build + BuildIn: *build + + BuildCacheKey: &buildcachekey model: - - kloudlite.io/pkg/harbor.Artifact - ImageTag: + - github.com/kloudlite/api/apps/container-registry/internal/domain/entities.BuildCacheKey + BuildCacheKeyIn: *buildcachekey + + GithubInstallation: model: - - kloudlite.io/pkg/harbor.ImageTag + - github.com/kloudlite/api/apps/container-registry/internal/domain/entities.GithubInstallation - HarborRobotUser: - model: kloudlite.io/apps/container-registry/internal/domain/entities.HarborRobotUser + GithubListRepository: + model: + - github.com/kloudlite/api/apps/container-registry/internal/domain/entities.GithubListRepository - HarborRobotUserSpec: - model: github.com/kloudlite/operator/apis/artifacts/v1.HarborUserAccountSpec + GithubSearchRepository: + model: + - github.com/kloudlite/api/apps/container-registry/internal/domain/entities.GithubSearchRepository - HarborRobotUserIn: - model: kloudlite.io/apps/container-registry/internal/domain/entities.HarborRobotUser + GitlabGroup: + model: + - github.com/kloudlite/api/apps/container-registry/internal/domain/entities.GitlabGroup - HarborRobotUserSpecIn: - model: github.com/kloudlite/operator/apis/artifacts/v1.HarborUserAccountSpec + GitlabProject: + model: + - github.com/kloudlite/api/apps/container-registry/internal/domain/entities.GitlabProject - Metadata: - model: k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta + GitBranch: + model: + - github.com/kloudlite/api/apps/container-registry/internal/domain/entities.GitBranch - MetadataIn: - model: k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta + Pagination: &pagination + model: + - github.com/kloudlite/api/pkg/types.Pagination + PaginationIn: *pagination - Status: - model: github.com/kloudlite/operator/pkg/operator.Status + Credential: &credential + model: + - github.com/kloudlite/api/apps/container-registry/internal/domain/entities.Credential + CredentialIn: *credential - SyncStatus: - model: kloudlite.io/pkg/types.SyncStatus + Repository: &repository + model: + - github.com/kloudlite/api/apps/container-registry/internal/domain/entities.Repository + RepositoryIn: *repository - SyncAction: - model: kloudlite.io/pkg/types.SyncAction + Digest: &digest + model: + - github.com/kloudlite/api/apps/container-registry/internal/domain/entities.Digest - SyncState: - model: kloudlite.io/pkg/types.SyncState + MatchFilter: &match-filter-model + model: github.com/kloudlite/api/pkg/repos.MatchFilter + MatchFilterIn: *match-filter-model - Patch: - model: - - github.com/kloudlite/operator/pkg/json-patch.PatchOperation - PatchIn: - model: - - github.com/kloudlite/operator/pkg/json-patch.PatchOperation - Check: - model: - - github.com/kloudlite/operator/pkg/operator.Check + MatchFilterMatchType: + model: github.com/kloudlite/api/pkg/repos.MatchType + + CursorPagination: &cursor-pagination-model + model: github.com/kloudlite/api/pkg/repos.CursorPagination + CursorPaginationIn: *cursor-pagination-model - HarborPermission: - model: github.com/kloudlite/operator/pkg/harbor.Permission + BuildRun: &build-run-model + model: github.com/kloudlite/api/apps/container-registry/internal/domain/entities.BuildRun + BuildRunIn: *build-run-model + + CursorPaginationSortDirection: &cursor-pagination-sort-direction + model: github.com/kloudlite/api/pkg/repos.SortDirection Overrides: model: @@ -121,3 +144,6 @@ models: model: - github.com/kloudlite/operator/apis/crds/v1.JsonPatch + Github__com___kloudlite___api___common__CreatedOrUpdatedBy: + model: github.com/kloudlite/api/common.CreatedOrUpdatedBy + diff --git a/apps/container-registry/internal/app/graph/build.resolvers.go b/apps/container-registry/internal/app/graph/build.resolvers.go new file mode 100644 index 000000000..78492ec8f --- /dev/null +++ b/apps/container-registry/internal/app/graph/build.resolvers.go @@ -0,0 +1,129 @@ +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.28 + +import ( + "context" + "fmt" + "github.com/kloudlite/api/pkg/errors" + "time" + + "github.com/kloudlite/api/apps/container-registry/internal/app/graph/generated" + "github.com/kloudlite/api/apps/container-registry/internal/app/graph/model" + "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" + fn "github.com/kloudlite/api/pkg/functions" +) + +// CreationTime is the resolver for the creationTime field. +func (r *buildResolver) CreationTime(ctx context.Context, obj *entities.Build) (string, error) { + if obj == nil { + return "", errors.Newf("build is nil") + } + + return obj.CreationTime.Format(time.RFC3339), nil +} + +// ErrorMessages is the resolver for the errorMessages field. +func (r *buildResolver) ErrorMessages(ctx context.Context, obj *entities.Build) (map[string]interface{}, error) { + if obj == nil { + return nil, errors.Newf("build is nil") + } + + var m map[string]any + if err := fn.JsonConversion(obj.ErrorMessages, &m); err != nil { + return nil, errors.NewE(err) + } + + return m, nil +} + +// ID is the resolver for the id field. +func (r *buildResolver) ID(ctx context.Context, obj *entities.Build) (string, error) { + if obj == nil { + return "", errors.Newf("build is nil") + } + + return string(obj.Id), nil +} + +// Source is the resolver for the source field. +func (r *buildResolver) Source(ctx context.Context, obj *entities.Build) (*model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitSource, error) { + if obj == nil { + return nil, errors.Newf("build is nil") + } + var m model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitSource + if err := fn.JsonConversion(obj.Source, &m); err != nil { + return nil, err + } + + return &m, nil +} + +// Spec is the resolver for the spec field. +func (r *buildResolver) Spec(ctx context.Context, obj *entities.Build) (*model.GithubComKloudliteOperatorApisDistributionV1BuildRunSpec, error) { + if obj == nil { + return nil, errors.Newf("build is nil") + } + var m model.GithubComKloudliteOperatorApisDistributionV1BuildRunSpec + if err := fn.JsonConversion(obj.Spec, &m); err != nil { + return nil, err + } + return &m, nil +} + +// Status is the resolver for the status field. +func (r *buildResolver) Status(ctx context.Context, obj *entities.Build) (model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatus, error) { + if obj == nil { + return "", errors.Newf("build is nil") + } + + return model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatus(obj.Status), nil +} + +// UpdateTime is the resolver for the updateTime field. +func (r *buildResolver) UpdateTime(ctx context.Context, obj *entities.Build) (string, error) { + if obj == nil { + return "", errors.Newf("build is nil") + } + + return obj.UpdateTime.Format(time.RFC3339), nil +} + +// Source is the resolver for the source field. +func (r *buildInResolver) Source(ctx context.Context, obj *entities.Build, data *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitSourceIn) error { + if obj == nil { + return errors.Newf("build is nil") + } + + return fn.JsonConversion(data, &obj.Source) +} + +// Spec is the resolver for the spec field. +func (r *buildInResolver) Spec(ctx context.Context, obj *entities.Build, data *model.GithubComKloudliteOperatorApisDistributionV1BuildRunSpecIn) error { + if obj == nil { + return errors.Newf("build is nil") + } + + return fn.JsonConversion(data, &obj.Spec) +} + +// Build returns generated.BuildResolver implementation. +func (r *Resolver) Build() generated.BuildResolver { return &buildResolver{r} } + +// BuildIn returns generated.BuildInResolver implementation. +func (r *Resolver) BuildIn() generated.BuildInResolver { return &buildInResolver{r} } + +type buildResolver struct{ *Resolver } +type buildInResolver struct{ *Resolver } + +// !!! WARNING !!! +// The code below was going to be deleted when updating resolvers. It has been copied here so you have +// one last chance to move it out of harms way if you want. There are two reasons this happens: +// - When renaming or deleting a resolver the old code will be put in here. You can safely delete +// it when you're done. +// - You have helper methods in this file. Move them out to keep these resolver files clean. +func (r *buildResolver) AccountName(ctx context.Context, obj *entities.Build) (string, error) { + panic(fmt.Errorf("not implemented: AccountName - accountName")) +} diff --git a/apps/container-registry/internal/app/graph/buildcachekey.resolvers.go b/apps/container-registry/internal/app/graph/buildcachekey.resolvers.go new file mode 100644 index 000000000..b87646272 --- /dev/null +++ b/apps/container-registry/internal/app/graph/buildcachekey.resolvers.go @@ -0,0 +1,71 @@ +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.28 + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + "time" + + "github.com/kloudlite/api/apps/container-registry/internal/app/graph/generated" + "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" +) + +// CreationTime is the resolver for the creationTime field. +func (r *buildCacheKeyResolver) CreationTime(ctx context.Context, obj *entities.BuildCacheKey) (string, error) { + if obj == nil { + return "", errors.Newf("buildCacheKey is nil") + } + + return obj.CreationTime.Format(time.RFC3339), nil +} + +// ID is the resolver for the id field. +func (r *buildCacheKeyResolver) ID(ctx context.Context, obj *entities.BuildCacheKey) (string, error) { + if obj == nil { + return "", errors.Newf("buildCacheKey is nil") + } + + return string(obj.Id), nil +} + +// UpdateTime is the resolver for the updateTime field. +func (r *buildCacheKeyResolver) UpdateTime(ctx context.Context, obj *entities.BuildCacheKey) (string, error) { + if obj == nil { + return "", errors.Newf("buildCacheKey is nil") + } + + return obj.UpdateTime.Format(time.RFC3339), nil +} + +// VolumeSizeInGb is the resolver for the volumeSizeInGB field. +func (r *buildCacheKeyResolver) VolumeSizeInGb(ctx context.Context, obj *entities.BuildCacheKey) (float64, error) { + if obj == nil { + return 0, errors.Newf("buildCacheKey is nil") + } + + return float64(obj.VolumeSize), nil +} + +// VolumeSizeInGb is the resolver for the volumeSizeInGB field. +func (r *buildCacheKeyInResolver) VolumeSizeInGb(ctx context.Context, obj *entities.BuildCacheKey, data float64) error { + if obj == nil { + return errors.Newf("buildCacheKey is nil") + } + + obj.VolumeSize = float32(data) + return nil +} + +// BuildCacheKey returns generated.BuildCacheKeyResolver implementation. +func (r *Resolver) BuildCacheKey() generated.BuildCacheKeyResolver { return &buildCacheKeyResolver{r} } + +// BuildCacheKeyIn returns generated.BuildCacheKeyInResolver implementation. +func (r *Resolver) BuildCacheKeyIn() generated.BuildCacheKeyInResolver { + return &buildCacheKeyInResolver{r} +} + +type buildCacheKeyResolver struct{ *Resolver } +type buildCacheKeyInResolver struct{ *Resolver } diff --git a/apps/container-registry/internal/app/graph/buildrun.resolvers.go b/apps/container-registry/internal/app/graph/buildrun.resolvers.go new file mode 100644 index 000000000..76efd3377 --- /dev/null +++ b/apps/container-registry/internal/app/graph/buildrun.resolvers.go @@ -0,0 +1,72 @@ +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.28 + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + "time" + + "github.com/kloudlite/api/apps/container-registry/internal/app/graph/generated" + "github.com/kloudlite/api/apps/container-registry/internal/app/graph/model" + "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" + fn "github.com/kloudlite/api/pkg/functions" +) + +// CreationTime is the resolver for the creationTime field. +func (r *buildRunResolver) CreationTime(ctx context.Context, obj *entities.BuildRun) (string, error) { + if obj == nil { + return "", errors.Newf("build-run/creation-time is nil") + } + return obj.CreationTime.Format(time.RFC3339), nil +} + +// ID is the resolver for the id field. +func (r *buildRunResolver) ID(ctx context.Context, obj *entities.BuildRun) (string, error) { + if obj == nil { + return "", errors.Newf("build run is nil") + } + return string(obj.Id), nil +} + +// Spec is the resolver for the spec field. +func (r *buildRunResolver) Spec(ctx context.Context, obj *entities.BuildRun) (*model.GithubComKloudliteOperatorApisDistributionV1BuildRunSpec, error) { + var m model.GithubComKloudliteOperatorApisDistributionV1BuildRunSpec + if err := fn.JsonConversion(obj.Spec, &m); err != nil { + return nil, errors.NewE(err) + } + return &m, nil +} + +// Status is the resolver for the status field. +func (r *buildRunResolver) Status(ctx context.Context, obj *entities.BuildRun) (*model.GithubComKloudliteOperatorPkgOperatorStatus, error) { + var m model.GithubComKloudliteOperatorPkgOperatorStatus + if err := fn.JsonConversion(obj.Spec, &m); err != nil { + return nil, errors.NewE(err) + } + return &m, nil +} + +// SyncStatus is the resolver for the syncStatus field. +func (r *buildRunResolver) SyncStatus(ctx context.Context, obj *entities.BuildRun) (*model.GithubComKloudliteAPIPkgTypesSyncStatus, error) { + var m model.GithubComKloudliteAPIPkgTypesSyncStatus + if err := fn.JsonConversion(obj.Spec, &m); err != nil { + return nil, errors.NewE(err) + } + return &m, nil +} + +// UpdateTime is the resolver for the updateTime field. +func (r *buildRunResolver) UpdateTime(ctx context.Context, obj *entities.BuildRun) (string, error) { + if obj == nil || obj.UpdateTime.IsZero() { + return "", errors.Newf("build-run-resolver/update-time is nil") + } + return obj.UpdateTime.Format(time.RFC3339), nil +} + +// BuildRun returns generated.BuildRunResolver implementation. +func (r *Resolver) BuildRun() generated.BuildRunResolver { return &buildRunResolver{r} } + +type buildRunResolver struct{ *Resolver } diff --git a/apps/container-registry/internal/app/graph/common-types.resolvers.go b/apps/container-registry/internal/app/graph/common-types.resolvers.go new file mode 100644 index 000000000..4914bfb52 --- /dev/null +++ b/apps/container-registry/internal/app/graph/common-types.resolvers.go @@ -0,0 +1,111 @@ +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.28 + +import ( + "context" + "fmt" + "github.com/kloudlite/api/pkg/errors" + "time" + + "github.com/kloudlite/api/apps/container-registry/internal/app/graph/generated" + "github.com/kloudlite/api/common" + fn "github.com/kloudlite/api/pkg/functions" + "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// UserID is the resolver for the userId field. +func (r *github__com___kloudlite___api___common__CreatedOrUpdatedByResolver) UserID(ctx context.Context, obj *common.CreatedOrUpdatedBy) (string, error) { + if obj == nil { + return "", fmt.Errorf("obj is nil") + } + + return string(obj.UserId), nil +} + +// Annotations is the resolver for the annotations field. +func (r *metadataResolver) Annotations(ctx context.Context, obj *v1.ObjectMeta) (map[string]interface{}, error) { + if obj == nil { + return nil, fmt.Errorf("obj is nil") + } + var m map[string]interface{} + if err := fn.JsonConversion(obj.Annotations, &m); err != nil { + return nil, errors.NewE(err) + } + return m, nil +} + +// CreationTimestamp is the resolver for the creationTimestamp field. +func (r *metadataResolver) CreationTimestamp(ctx context.Context, obj *v1.ObjectMeta) (string, error) { + if obj == nil { + return "", errors.Newf("build-run/creation-time is nil") + } + return obj.CreationTimestamp.Format(time.RFC3339), nil +} + +// DeletionTimestamp is the resolver for the deletionTimestamp field. +func (r *metadataResolver) DeletionTimestamp(ctx context.Context, obj *v1.ObjectMeta) (*string, error) { + if obj == nil { + return nil, errors.Newf("build-run/deletion-time is nil") + } + if obj.DeletionTimestamp == nil { + return nil, nil + } + format := obj.DeletionTimestamp.Time.Format(time.RFC3339) + return &format, nil +} + +// Labels is the resolver for the labels field. +func (r *metadataResolver) Labels(ctx context.Context, obj *v1.ObjectMeta) (map[string]interface{}, error) { + if obj == nil { + return nil, fmt.Errorf("obj is nil") + } + var m map[string]interface{} + if err := fn.JsonConversion(obj.Labels, &m); err != nil { + return nil, errors.NewE(err) + } + return m, nil +} + +// Annotations is the resolver for the annotations field. +func (r *metadataInResolver) Annotations(ctx context.Context, obj *v1.ObjectMeta, data map[string]interface{}) error { + if obj == nil { + return fmt.Errorf("obj is nil") + } + var m map[string]string + if err := fn.JsonConversion(data, &m); err != nil { + return errors.NewE(err) + } + obj.Annotations = m + return nil +} + +// Labels is the resolver for the labels field. +func (r *metadataInResolver) Labels(ctx context.Context, obj *v1.ObjectMeta, data map[string]interface{}) error { + if obj == nil { + return fmt.Errorf("obj is nil") + } + var m map[string]string + if err := fn.JsonConversion(data, &m); err != nil { + return errors.NewE(err) + } + obj.Labels = m + return nil +} + +// Github__com___kloudlite___api___common__CreatedOrUpdatedBy returns generated.Github__com___kloudlite___api___common__CreatedOrUpdatedByResolver implementation. +func (r *Resolver) Github__com___kloudlite___api___common__CreatedOrUpdatedBy() generated.Github__com___kloudlite___api___common__CreatedOrUpdatedByResolver { + return &github__com___kloudlite___api___common__CreatedOrUpdatedByResolver{r} +} + +// Metadata returns generated.MetadataResolver implementation. +func (r *Resolver) Metadata() generated.MetadataResolver { return &metadataResolver{r} } + +// MetadataIn returns generated.MetadataInResolver implementation. +func (r *Resolver) MetadataIn() generated.MetadataInResolver { return &metadataInResolver{r} } + +type github__com___kloudlite___api___common__CreatedOrUpdatedByResolver struct{ *Resolver } +type metadataResolver struct{ *Resolver } +type metadataInResolver struct{ *Resolver } diff --git a/apps/container-registry/internal/app/graph/crd-to-gql/harborrobotuser.graphqls b/apps/container-registry/internal/app/graph/crd-to-gql/harborrobotuser.graphqls deleted file mode 100644 index 54820504b..000000000 --- a/apps/container-registry/internal/app/graph/crd-to-gql/harborrobotuser.graphqls +++ /dev/null @@ -1,32 +0,0 @@ -type HarborRobotUserSpec @shareable { - accountName: String! - enabled: Boolean - harborProjectName: String! - permissions: [String] - targetSecret: String -} - -input HarborRobotUserSpecIn { - accountName: String! - enabled: Boolean - harborProjectName: String! - permissions: [String] - targetSecret: String -} - -type HarborRobotUser @shareable { - syncStatus: SyncStatus - spec: HarborRobotUserSpec - status: Status - apiVersion: String - kind: String - metadata: Metadata! @goField(name: "objectMeta") -} - -input HarborRobotUserIn { - spec: HarborRobotUserSpecIn - apiVersion: String - kind: String - metadata: MetadataIn! @goField(name: "objectMeta") -} - diff --git a/apps/container-registry/internal/app/graph/crd-to-gql/scalars.graphqls b/apps/container-registry/internal/app/graph/crd-to-gql/scalars.graphqls deleted file mode 100644 index 5a803012e..000000000 --- a/apps/container-registry/internal/app/graph/crd-to-gql/scalars.graphqls +++ /dev/null @@ -1,76 +0,0 @@ - -scalar Any -scalar Json -scalar Map -scalar Date - -type Metadata @shareable { - name: String! - namespace: String - labels: Json - annotations: Json - creationTimestamp: Date! - deletionTimestamp: Date - generation: Int! -} - -input MetadataIn { - name: String! - namespace: String - labels: Json - annotations: Json -} - -type Status @shareable { - isReady: Boolean! - checks: Map - displayVars: Json -} - -type Check @shareable { - status: Boolean - message: String - generation: Int -} - -type Patch @shareable { - op: String! - path: String! - value: Any -} - -type Overrides @shareable{ - applied: Boolean - patches: [Patch!] -} - -input PatchIn { - op: String! - path: String! - value: Any -} - -input OverridesIn{ - patches: [PatchIn!] -} - -enum SyncAction { - APPLY - DELETE -} - -enum SyncState { - IDLE - IN_PROGRESS - READY - NOT_READY -} - -type SyncStatus @shareable{ - syncScheduledAt: Date! - lastSyncedAt: Date - action: SyncAction! - generation: Int! - state: SyncState! - error: String -} diff --git a/apps/container-registry/internal/app/graph/credential.resolvers.go b/apps/container-registry/internal/app/graph/credential.resolvers.go new file mode 100644 index 000000000..804688db6 --- /dev/null +++ b/apps/container-registry/internal/app/graph/credential.resolvers.go @@ -0,0 +1,91 @@ +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.28 + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + "time" + + "github.com/kloudlite/api/apps/container-registry/internal/app/graph/generated" + "github.com/kloudlite/api/apps/container-registry/internal/app/graph/model" + "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" +) + +// Access is the resolver for the access field. +func (r *credentialResolver) Access(ctx context.Context, obj *entities.Credential) (model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesRepoAccess, error) { + return model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesRepoAccess(obj.Access), nil +} + +// CreationTime is the resolver for the creationTime field. +func (r *credentialResolver) CreationTime(ctx context.Context, obj *entities.Credential) (string, error) { + if obj == nil { + return "", errors.Newf("resource is nil") + } + + return obj.CreationTime.Format(time.RFC3339), nil +} + +// Expiration is the resolver for the expiration field. +func (r *credentialResolver) Expiration(ctx context.Context, obj *entities.Credential) (*model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpiration, error) { + if obj == nil { + return nil, errors.Newf("resource is nil") + } + + return &model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpiration{ + Value: obj.Expiration.Value, + Unit: model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnit(obj.Expiration.Unit), + }, nil +} + +// ID is the resolver for the id field. +func (r *credentialResolver) ID(ctx context.Context, obj *entities.Credential) (string, error) { + if obj == nil { + return "", errors.Newf("resource is nil") + } + + return string(obj.Id), nil +} + +// UpdateTime is the resolver for the updateTime field. +func (r *credentialResolver) UpdateTime(ctx context.Context, obj *entities.Credential) (string, error) { + if obj == nil { + return "", errors.Newf("resource is nil") + } + + return obj.UpdateTime.Format(time.RFC3339), nil +} + +// Access is the resolver for the access field. +func (r *credentialInResolver) Access(ctx context.Context, obj *entities.Credential, data model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesRepoAccess) error { + if obj == nil { + return errors.Newf("resource is nil") + } + + obj.Access = entities.RepoAccess(data) + return nil +} + +// Expiration is the resolver for the expiration field. +func (r *credentialInResolver) Expiration(ctx context.Context, obj *entities.Credential, data *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationIn) error { + if obj == nil { + return errors.Newf("resource is nil") + } + + obj.Expiration = entities.Expiration{ + Value: data.Value, + Unit: entities.ExpirationUnit(data.Unit), + } + return nil +} + +// Credential returns generated.CredentialResolver implementation. +func (r *Resolver) Credential() generated.CredentialResolver { return &credentialResolver{r} } + +// CredentialIn returns generated.CredentialInResolver implementation. +func (r *Resolver) CredentialIn() generated.CredentialInResolver { return &credentialInResolver{r} } + +type credentialResolver struct{ *Resolver } +type credentialInResolver struct{ *Resolver } diff --git a/apps/container-registry/internal/app/graph/digest.resolvers.go b/apps/container-registry/internal/app/graph/digest.resolvers.go new file mode 100644 index 000000000..e8d6d9d85 --- /dev/null +++ b/apps/container-registry/internal/app/graph/digest.resolvers.go @@ -0,0 +1,46 @@ +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.28 + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + "time" + + "github.com/kloudlite/api/apps/container-registry/internal/app/graph/generated" + "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" +) + +// CreationTime is the resolver for the creationTime field. +func (r *digestResolver) CreationTime(ctx context.Context, obj *entities.Digest) (string, error) { + if obj == nil { + return "", errors.Newf("build is nil") + } + + return obj.CreationTime.Format(time.RFC3339), nil +} + +// ID is the resolver for the id field. +func (r *digestResolver) ID(ctx context.Context, obj *entities.Digest) (string, error) { + if obj == nil { + return "", errors.Newf("build is nil") + } + + return string(obj.Id), nil +} + +// UpdateTime is the resolver for the updateTime field. +func (r *digestResolver) UpdateTime(ctx context.Context, obj *entities.Digest) (string, error) { + if obj == nil { + return "", errors.Newf("build is nil") + } + + return obj.UpdateTime.Format(time.RFC3339), nil +} + +// Digest returns generated.DigestResolver implementation. +func (r *Resolver) Digest() generated.DigestResolver { return &digestResolver{r} } + +type digestResolver struct{ *Resolver } diff --git a/apps/container-registry/internal/app/graph/generated/generated.go b/apps/container-registry/internal/app/graph/generated/generated.go index 68217ef1d..a31944964 100644 --- a/apps/container-registry/internal/app/graph/generated/generated.go +++ b/apps/container-registry/internal/app/graph/generated/generated.go @@ -14,17 +14,15 @@ import ( "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/introspection" "github.com/99designs/gqlgen/plugin/federation/fedruntime" - "github.com/kloudlite/operator/apis/artifacts/v1" - v12 "github.com/kloudlite/operator/apis/crds/v1" - "github.com/kloudlite/operator/pkg/harbor" - json_patch "github.com/kloudlite/operator/pkg/json-patch" - "github.com/kloudlite/operator/pkg/operator" + "github.com/kloudlite/api/apps/container-registry/internal/app/graph/model" + "github.com/kloudlite/api/apps/container-registry/internal/domain" + "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/repos" + "github.com/kloudlite/api/pkg/types" gqlparser "github.com/vektah/gqlparser/v2" "github.com/vektah/gqlparser/v2/ast" - v11 "k8s.io/apimachinery/pkg/apis/meta/v1" - "kloudlite.io/apps/container-registry/internal/domain/entities" - harbor1 "kloudlite.io/pkg/harbor" - "kloudlite.io/pkg/types" + "k8s.io/apimachinery/pkg/apis/meta/v1" ) // region ************************** generated!.gotpl ************************** @@ -45,59 +43,376 @@ type Config struct { } type ResolverRoot interface { - HarborRobotUserSpec() HarborRobotUserSpecResolver - ImageTag() ImageTagResolver + Build() BuildResolver + BuildCacheKey() BuildCacheKeyResolver + BuildRun() BuildRunResolver + Credential() CredentialResolver + Digest() DigestResolver + GithubInstallation() GithubInstallationResolver + GithubListRepository() GithubListRepositoryResolver + GithubSearchRepository() GithubSearchRepositoryResolver + Github__com___kloudlite___api___common__CreatedOrUpdatedBy() Github__com___kloudlite___api___common__CreatedOrUpdatedByResolver + GitlabProject() GitlabProjectResolver Metadata() MetadataResolver Mutation() MutationResolver - Patch() PatchResolver Query() QueryResolver - Status() StatusResolver - SyncStatus() SyncStatusResolver - HarborRobotUserSpecIn() HarborRobotUserSpecInResolver + Repository() RepositoryResolver + BuildCacheKeyIn() BuildCacheKeyInResolver + BuildIn() BuildInResolver + CredentialIn() CredentialInResolver MetadataIn() MetadataInResolver - PatchIn() PatchInResolver } type DirectiveRoot struct { - CanActOnAccount func(ctx context.Context, obj interface{}, next graphql.Resolver, action *string) (res interface{}, err error) - HasAccount func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) - IsLoggedIn func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) + HasAccount func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) + IsLoggedInAndVerified func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) } type ComplexityRoot struct { - Artifact struct { - Size func(childComplexity int) int + Build struct { + BuildClusterName func(childComplexity int) int + CreatedBy func(childComplexity int) int + CreationTime func(childComplexity int) int + CredUser func(childComplexity int) int + ErrorMessages func(childComplexity int) int + ID func(childComplexity int) int + LastUpdatedBy func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + Name func(childComplexity int) int + RecordVersion func(childComplexity int) int + Source func(childComplexity int) int + Spec func(childComplexity int) int + Status func(childComplexity int) int + UpdateTime func(childComplexity int) int + } + + BuildCacheKey struct { + AccountName func(childComplexity int) int + CreatedBy func(childComplexity int) int + CreationTime func(childComplexity int) int + DisplayName func(childComplexity int) int + ID func(childComplexity int) int + LastUpdatedBy func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + Name func(childComplexity int) int + RecordVersion func(childComplexity int) int + UpdateTime func(childComplexity int) int + VolumeSizeInGb func(childComplexity int) int + } + + BuildCacheKeyEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + BuildCacheKeyPaginatedRecords struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + BuildEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + BuildPaginatedRecords struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + BuildRun struct { + APIVersion func(childComplexity int) int + AccountName func(childComplexity int) int + BuildName func(childComplexity int) int + ClusterName func(childComplexity int) int + CreationTime func(childComplexity int) int + ID func(childComplexity int) int + Kind func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + ObjectMeta func(childComplexity int) int + RecordVersion func(childComplexity int) int + Spec func(childComplexity int) int + Status func(childComplexity int) int + SyncStatus func(childComplexity int) int + UpdateTime func(childComplexity int) int + } + + BuildRunEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + BuildRunPaginatedRecords struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + CRCheckNameAvailabilityOutput struct { + Result func(childComplexity int) int + SuggestedNames func(childComplexity int) int + } + + Credential struct { + Access func(childComplexity int) int + AccountName func(childComplexity int) int + CreatedBy func(childComplexity int) int + CreationTime func(childComplexity int) int + Expiration func(childComplexity int) int + ID func(childComplexity int) int + LastUpdatedBy func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + Name func(childComplexity int) int + RecordVersion func(childComplexity int) int + UpdateTime func(childComplexity int) int + UserName func(childComplexity int) int + } + + CredentialEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + CredentialPaginatedRecords struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + CursorPagination struct { + After func(childComplexity int) int + Before func(childComplexity int) int + First func(childComplexity int) int + Last func(childComplexity int) int + OrderBy func(childComplexity int) int + SortDirection func(childComplexity int) int + } + + Digest struct { + AccountName func(childComplexity int) int + Actor func(childComplexity int) int + CreationTime func(childComplexity int) int + Deleting func(childComplexity int) int + Digest func(childComplexity int) int + ID func(childComplexity int) int + Length func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + MediaType func(childComplexity int) int + RecordVersion func(childComplexity int) int + Repository func(childComplexity int) int + Size func(childComplexity int) int + Tags func(childComplexity int) int + URL func(childComplexity int) int + UpdateTime func(childComplexity int) int + } + + DigestEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + DigestPaginatedRecords struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + GitBranch struct { + Name func(childComplexity int) int + Protected func(childComplexity int) int + } + + GithubBranch struct { + Name func(childComplexity int) int + Protected func(childComplexity int) int + } + + GithubInstallation struct { + Account func(childComplexity int) int + AppID func(childComplexity int) int + ID func(childComplexity int) int + NodeID func(childComplexity int) int + RepositoriesURL func(childComplexity int) int + TargetID func(childComplexity int) int + TargetType func(childComplexity int) int + } + + GithubListRepository struct { + Repositories func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + GithubSearchRepository struct { + IncompleteResults func(childComplexity int) int + Repositories func(childComplexity int) int + Total func(childComplexity int) int + } + + Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration struct { + Unit func(childComplexity int) int + Value func(childComplexity int) int + } + + Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource struct { + Branch func(childComplexity int) int + Provider func(childComplexity int) int + Repository func(childComplexity int) int + WebhookID func(childComplexity int) int + } + + Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository struct { + Archived func(childComplexity int) int + CloneURL func(childComplexity int) int + CreatedAt func(childComplexity int) int + DefaultBranch func(childComplexity int) int + Description func(childComplexity int) int + Disabled func(childComplexity int) int + FullName func(childComplexity int) int + GitURL func(childComplexity int) int + GitignoreTemplate func(childComplexity int) int + HTMLURL func(childComplexity int) int + ID func(childComplexity int) int + Language func(childComplexity int) int + MasterBranch func(childComplexity int) int + MirrorURL func(childComplexity int) int + Name func(childComplexity int) int + NodeID func(childComplexity int) int + Permissions func(childComplexity int) int + Private func(childComplexity int) int + PushedAt func(childComplexity int) int + Size func(childComplexity int) int + TeamID func(childComplexity int) int + URL func(childComplexity int) int + UpdatedAt func(childComplexity int) int + Visibility func(childComplexity int) int + } + + Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount struct { + AvatarURL func(childComplexity int) int + ID func(childComplexity int) int + Login func(childComplexity int) int + NodeID func(childComplexity int) int + Type func(childComplexity int) int + } + + Github__com___kloudlite___api___common__CreatedOrUpdatedBy struct { + UserEmail func(childComplexity int) int + UserID func(childComplexity int) int + UserName func(childComplexity int) int + } + + Github__com___kloudlite___api___pkg___types__SyncStatus struct { + Action func(childComplexity int) int + Error func(childComplexity int) int + LastSyncedAt func(childComplexity int) int + RecordVersion func(childComplexity int) int + State func(childComplexity int) int + SyncScheduledAt func(childComplexity int) int + } + + Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions struct { + BuildArgs func(childComplexity int) int + BuildContexts func(childComplexity int) int + ContextDir func(childComplexity int) int + DockerfileContent func(childComplexity int) int + DockerfilePath func(childComplexity int) int + TargetPlatforms func(childComplexity int) int + } + + Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec struct { + AccountName func(childComplexity int) int + BuildOptions func(childComplexity int) int + CacheKeyName func(childComplexity int) int + Registry func(childComplexity int) int + Resource func(childComplexity int) int + } + + Github__com___kloudlite___operator___apis___distribution___v1__Registry struct { + Repo func(childComplexity int) int + } + + Github__com___kloudlite___operator___apis___distribution___v1__Repo struct { + Name func(childComplexity int) int Tags func(childComplexity int) int } - Check struct { + Github__com___kloudlite___operator___apis___distribution___v1__Resource struct { + CPU func(childComplexity int) int + MemoryInMb func(childComplexity int) int + } + + Github__com___kloudlite___operator___pkg___operator__Check struct { Generation func(childComplexity int) int Message func(childComplexity int) int Status func(childComplexity int) int } - HarborRobotUser struct { + Github__com___kloudlite___operator___pkg___operator__ResourceRef struct { APIVersion func(childComplexity int) int Kind func(childComplexity int) int - ObjectMeta func(childComplexity int) int - Spec func(childComplexity int) int - Status func(childComplexity int) int - SyncStatus func(childComplexity int) int - } - - HarborRobotUserSpec struct { - AccountName func(childComplexity int) int - Enabled func(childComplexity int) int - HarborProjectName func(childComplexity int) int - Permissions func(childComplexity int) int - TargetSecret func(childComplexity int) int + Name func(childComplexity int) int + Namespace func(childComplexity int) int + } + + Github__com___kloudlite___operator___pkg___operator__Status struct { + Checks func(childComplexity int) int + IsReady func(childComplexity int) int + LastReadyGeneration func(childComplexity int) int + LastReconcileTime func(childComplexity int) int + Message func(childComplexity int) int + Resources func(childComplexity int) int + } + + Github__com___kloudlite___operator___pkg___raw____json__RawJson struct { + RawMessage func(childComplexity int) int + } + + GitlabBranch struct { + CanPush func(childComplexity int) int + Default func(childComplexity int) int + DevelopersCanMerge func(childComplexity int) int + DevelopersCanPush func(childComplexity int) int + Merged func(childComplexity int) int + Name func(childComplexity int) int + Protected func(childComplexity int) int + WebURL func(childComplexity int) int + } + + GitlabGroup struct { + AvatarUrl func(childComplexity int) int + FullName func(childComplexity int) int + Id func(childComplexity int) int + } + + GitlabProject struct { + Archived func(childComplexity int) int + AvatarURL func(childComplexity int) int + CreatedAt func(childComplexity int) int + CreatorID func(childComplexity int) int + DefaultBranch func(childComplexity int) int + Description func(childComplexity int) int + EmptyRepo func(childComplexity int) int + HTTPURLToRepo func(childComplexity int) int + ID func(childComplexity int) int + LastActivityAt func(childComplexity int) int + Name func(childComplexity int) int + NameWithNamespace func(childComplexity int) int + Path func(childComplexity int) int + PathWithNamespace func(childComplexity int) int + Public func(childComplexity int) int + SSHURLToRepo func(childComplexity int) int + TagList func(childComplexity int) int + Topics func(childComplexity int) int + WebURL func(childComplexity int) int } - ImageTag struct { - Immutable func(childComplexity int) int - Name func(childComplexity int) int - PushedAt func(childComplexity int) int - Signed func(childComplexity int) int + MatchFilter struct { + Array func(childComplexity int) int + Exact func(childComplexity int) int + MatchType func(childComplexity int) int + Regex func(childComplexity int) int } Metadata struct { @@ -111,51 +426,75 @@ type ComplexityRoot struct { } Mutation struct { - CrCreateRobot func(childComplexity int, robotUser entities.HarborRobotUser) int - CrDeleteRepo func(childComplexity int, repoID int) int - CrDeleteRobot func(childComplexity int, robotID int) int - CrResyncRobot func(childComplexity int, name string) int - CrUpdateRobot func(childComplexity int, name string, permissions []harbor.Permission) int + CrAddBuild func(childComplexity int, build entities.Build) int + CrAddBuildCacheKey func(childComplexity int, buildCacheKey entities.BuildCacheKey) int + CrCreateCred func(childComplexity int, credential entities.Credential) int + CrCreateRepo func(childComplexity int, repository entities.Repository) int + CrDeleteBuild func(childComplexity int, id repos.ID) int + CrDeleteBuildCacheKey func(childComplexity int, id repos.ID) int + CrDeleteCred func(childComplexity int, username string) int + CrDeleteDigest func(childComplexity int, repoName string, digest string) int + CrDeleteRepo func(childComplexity int, name string) int + CrListBuildsByBuildCacheID func(childComplexity int, buildCacheKeyID repos.ID, pagination *repos.CursorPagination) int + CrTriggerBuild func(childComplexity int, id repos.ID) int + CrUpdateBuild func(childComplexity int, id repos.ID, build entities.Build) int + CrUpdateBuildCacheKey func(childComplexity int, id repos.ID, buildCacheKey entities.BuildCacheKey) int } - Overrides struct { - Applied func(childComplexity int) int - Patches func(childComplexity int) int + PageInfo struct { + EndCursor func(childComplexity int) int + HasNextPage func(childComplexity int) int + HasPreviousPage func(childComplexity int) int + StartCursor func(childComplexity int) int } - Patch struct { - Op func(childComplexity int) int - Path func(childComplexity int) int - Value func(childComplexity int) int + Pagination struct { + Page func(childComplexity int) int + PerPage func(childComplexity int) int } Query struct { - CrListArtifacts func(childComplexity int, repoName string) int - CrListRepos func(childComplexity int) int - CrListRobots func(childComplexity int) int - __resolve__service func(childComplexity int) int - } - - Repo struct { - ArtifactCount func(childComplexity int) int - Id func(childComplexity int) int - Name func(childComplexity int) int - PullCount func(childComplexity int) int + CrCheckUserNameAvailability func(childComplexity int, name string) int + CrGetBuild func(childComplexity int, id repos.ID) int + CrGetBuildRun func(childComplexity int, repoName string, buildRunName string) int + CrGetCredToken func(childComplexity int, username string) int + CrListBuildCacheKeys func(childComplexity int, pq *repos.CursorPagination, search *model.SearchBuildCacheKeys) int + CrListBuildRuns func(childComplexity int, repoName string, search *model.SearchBuildRuns, pq *repos.CursorPagination) int + CrListBuilds func(childComplexity int, repoName string, search *model.SearchBuilds, pagination *repos.CursorPagination) int + CrListCreds func(childComplexity int, search *model.SearchCreds, pagination *repos.CursorPagination) int + CrListDigests func(childComplexity int, repoName string, search *model.SearchRepos, pagination *repos.CursorPagination) int + CrListGithubBranches func(childComplexity int, repoURL string, pagination *types.Pagination) int + CrListGithubInstallations func(childComplexity int, pagination *types.Pagination) int + CrListGithubRepos func(childComplexity int, installationID int, pagination *types.Pagination) int + CrListGitlabBranches func(childComplexity int, repoID string, query *string, pagination *types.Pagination) int + CrListGitlabGroups func(childComplexity int, query *string, pagination *types.Pagination) int + CrListGitlabRepositories func(childComplexity int, groupID string, query *string, pagination *types.Pagination) int + CrListRepos func(childComplexity int, search *model.SearchRepos, pagination *repos.CursorPagination) int + CrSearchGithubRepos func(childComplexity int, organization string, search string, pagination *types.Pagination) int + __resolve__service func(childComplexity int) int + } + + Repository struct { + AccountName func(childComplexity int) int + CreatedBy func(childComplexity int) int + CreationTime func(childComplexity int) int + ID func(childComplexity int) int + LastUpdatedBy func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + Name func(childComplexity int) int + RecordVersion func(childComplexity int) int + UpdateTime func(childComplexity int) int } - Status struct { - Checks func(childComplexity int) int - DisplayVars func(childComplexity int) int - IsReady func(childComplexity int) int + RepositoryEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int } - SyncStatus struct { - Action func(childComplexity int) int - Error func(childComplexity int) int - Generation func(childComplexity int) int - LastSyncedAt func(childComplexity int) int - State func(childComplexity int) int - SyncScheduledAt func(childComplexity int) int + RepositoryPaginatedRecords struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int } _Service struct { @@ -163,51 +502,129 @@ type ComplexityRoot struct { } } -type HarborRobotUserSpecResolver interface { - Permissions(ctx context.Context, obj *v1.HarborUserAccountSpec) ([]*string, error) +type BuildResolver interface { + CreationTime(ctx context.Context, obj *entities.Build) (string, error) + + ErrorMessages(ctx context.Context, obj *entities.Build) (map[string]interface{}, error) + ID(ctx context.Context, obj *entities.Build) (string, error) + + Source(ctx context.Context, obj *entities.Build) (*model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitSource, error) + Spec(ctx context.Context, obj *entities.Build) (*model.GithubComKloudliteOperatorApisDistributionV1BuildRunSpec, error) + Status(ctx context.Context, obj *entities.Build) (model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatus, error) + UpdateTime(ctx context.Context, obj *entities.Build) (string, error) } -type ImageTagResolver interface { - PushedAt(ctx context.Context, obj *harbor1.ImageTag) (string, error) +type BuildCacheKeyResolver interface { + CreationTime(ctx context.Context, obj *entities.BuildCacheKey) (string, error) + + ID(ctx context.Context, obj *entities.BuildCacheKey) (string, error) + + UpdateTime(ctx context.Context, obj *entities.BuildCacheKey) (string, error) + VolumeSizeInGb(ctx context.Context, obj *entities.BuildCacheKey) (float64, error) } -type MetadataResolver interface { - Labels(ctx context.Context, obj *v11.ObjectMeta) (map[string]interface{}, error) - Annotations(ctx context.Context, obj *v11.ObjectMeta) (map[string]interface{}, error) - CreationTimestamp(ctx context.Context, obj *v11.ObjectMeta) (string, error) - DeletionTimestamp(ctx context.Context, obj *v11.ObjectMeta) (*string, error) +type BuildRunResolver interface { + CreationTime(ctx context.Context, obj *entities.BuildRun) (string, error) + ID(ctx context.Context, obj *entities.BuildRun) (string, error) + + Spec(ctx context.Context, obj *entities.BuildRun) (*model.GithubComKloudliteOperatorApisDistributionV1BuildRunSpec, error) + Status(ctx context.Context, obj *entities.BuildRun) (*model.GithubComKloudliteOperatorPkgOperatorStatus, error) + SyncStatus(ctx context.Context, obj *entities.BuildRun) (*model.GithubComKloudliteAPIPkgTypesSyncStatus, error) + UpdateTime(ctx context.Context, obj *entities.BuildRun) (string, error) } -type MutationResolver interface { - CrCreateRobot(ctx context.Context, robotUser entities.HarborRobotUser) (*entities.HarborRobotUser, error) - CrUpdateRobot(ctx context.Context, name string, permissions []harbor.Permission) (*entities.HarborRobotUser, error) - CrDeleteRobot(ctx context.Context, robotID int) (bool, error) - CrResyncRobot(ctx context.Context, name string) (bool, error) - CrDeleteRepo(ctx context.Context, repoID int) (bool, error) +type CredentialResolver interface { + Access(ctx context.Context, obj *entities.Credential) (model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesRepoAccess, error) + + CreationTime(ctx context.Context, obj *entities.Credential) (string, error) + Expiration(ctx context.Context, obj *entities.Credential) (*model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpiration, error) + ID(ctx context.Context, obj *entities.Credential) (string, error) + + UpdateTime(ctx context.Context, obj *entities.Credential) (string, error) +} +type DigestResolver interface { + CreationTime(ctx context.Context, obj *entities.Digest) (string, error) + + ID(ctx context.Context, obj *entities.Digest) (string, error) + + UpdateTime(ctx context.Context, obj *entities.Digest) (string, error) } -type PatchResolver interface { - Value(ctx context.Context, obj *json_patch.PatchOperation) (interface{}, error) +type GithubInstallationResolver interface { + Account(ctx context.Context, obj *entities.GithubInstallation) (*model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubUserAccount, error) } -type QueryResolver interface { - CrListRepos(ctx context.Context) ([]*harbor1.Repository, error) - CrListArtifacts(ctx context.Context, repoName string) ([]*harbor1.Artifact, error) - CrListRobots(ctx context.Context) ([]*entities.HarborRobotUser, error) +type GithubListRepositoryResolver interface { + Repositories(ctx context.Context, obj *entities.GithubListRepository) ([]*model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository, error) } -type StatusResolver interface { - Checks(ctx context.Context, obj *operator.Status) (map[string]interface{}, error) - DisplayVars(ctx context.Context, obj *operator.Status) (map[string]interface{}, error) +type GithubSearchRepositoryResolver interface { + Repositories(ctx context.Context, obj *entities.GithubSearchRepository) ([]*model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository, error) } -type SyncStatusResolver interface { - SyncScheduledAt(ctx context.Context, obj *types.SyncStatus) (string, error) - LastSyncedAt(ctx context.Context, obj *types.SyncStatus) (*string, error) +type Github__com___kloudlite___api___common__CreatedOrUpdatedByResolver interface { + UserID(ctx context.Context, obj *common.CreatedOrUpdatedBy) (string, error) } +type GitlabProjectResolver interface { + CreatedAt(ctx context.Context, obj *entities.GitlabProject) (*string, error) -type HarborRobotUserSpecInResolver interface { - Permissions(ctx context.Context, obj *v1.HarborUserAccountSpec, data []*string) error + LastActivityAt(ctx context.Context, obj *entities.GitlabProject) (*string, error) } -type MetadataInResolver interface { - Labels(ctx context.Context, obj *v11.ObjectMeta, data map[string]interface{}) error - Annotations(ctx context.Context, obj *v11.ObjectMeta, data map[string]interface{}) error +type MetadataResolver interface { + Annotations(ctx context.Context, obj *v1.ObjectMeta) (map[string]interface{}, error) + CreationTimestamp(ctx context.Context, obj *v1.ObjectMeta) (string, error) + DeletionTimestamp(ctx context.Context, obj *v1.ObjectMeta) (*string, error) + + Labels(ctx context.Context, obj *v1.ObjectMeta) (map[string]interface{}, error) +} +type MutationResolver interface { + CrCreateRepo(ctx context.Context, repository entities.Repository) (*entities.Repository, error) + CrCreateCred(ctx context.Context, credential entities.Credential) (*entities.Credential, error) + CrDeleteRepo(ctx context.Context, name string) (bool, error) + CrDeleteCred(ctx context.Context, username string) (bool, error) + CrDeleteDigest(ctx context.Context, repoName string, digest string) (bool, error) + CrAddBuild(ctx context.Context, build entities.Build) (*entities.Build, error) + CrUpdateBuild(ctx context.Context, id repos.ID, build entities.Build) (*entities.Build, error) + CrDeleteBuild(ctx context.Context, id repos.ID) (bool, error) + CrTriggerBuild(ctx context.Context, id repos.ID) (bool, error) + CrAddBuildCacheKey(ctx context.Context, buildCacheKey entities.BuildCacheKey) (*entities.BuildCacheKey, error) + CrDeleteBuildCacheKey(ctx context.Context, id repos.ID) (bool, error) + CrUpdateBuildCacheKey(ctx context.Context, id repos.ID, buildCacheKey entities.BuildCacheKey) (*entities.BuildCacheKey, error) + CrListBuildsByBuildCacheID(ctx context.Context, buildCacheKeyID repos.ID, pagination *repos.CursorPagination) (*model.BuildPaginatedRecords, error) } -type PatchInResolver interface { - Value(ctx context.Context, obj *json_patch.PatchOperation, data interface{}) error +type QueryResolver interface { + CrListRepos(ctx context.Context, search *model.SearchRepos, pagination *repos.CursorPagination) (*model.RepositoryPaginatedRecords, error) + CrListCreds(ctx context.Context, search *model.SearchCreds, pagination *repos.CursorPagination) (*model.CredentialPaginatedRecords, error) + CrListDigests(ctx context.Context, repoName string, search *model.SearchRepos, pagination *repos.CursorPagination) (*model.DigestPaginatedRecords, error) + CrGetCredToken(ctx context.Context, username string) (string, error) + CrCheckUserNameAvailability(ctx context.Context, name string) (*domain.CheckNameAvailabilityOutput, error) + CrGetBuild(ctx context.Context, id repos.ID) (*entities.Build, error) + CrListBuilds(ctx context.Context, repoName string, search *model.SearchBuilds, pagination *repos.CursorPagination) (*model.BuildPaginatedRecords, error) + CrListGithubInstallations(ctx context.Context, pagination *types.Pagination) ([]*entities.GithubInstallation, error) + CrListGithubRepos(ctx context.Context, installationID int, pagination *types.Pagination) (*entities.GithubListRepository, error) + CrSearchGithubRepos(ctx context.Context, organization string, search string, pagination *types.Pagination) (*entities.GithubSearchRepository, error) + CrListGithubBranches(ctx context.Context, repoURL string, pagination *types.Pagination) ([]*entities.GitBranch, error) + CrListGitlabGroups(ctx context.Context, query *string, pagination *types.Pagination) ([]*entities.GitlabGroup, error) + CrListGitlabRepositories(ctx context.Context, groupID string, query *string, pagination *types.Pagination) ([]*entities.GitlabProject, error) + CrListGitlabBranches(ctx context.Context, repoID string, query *string, pagination *types.Pagination) ([]*entities.GitBranch, error) + CrListBuildCacheKeys(ctx context.Context, pq *repos.CursorPagination, search *model.SearchBuildCacheKeys) (*model.BuildCacheKeyPaginatedRecords, error) + CrListBuildRuns(ctx context.Context, repoName string, search *model.SearchBuildRuns, pq *repos.CursorPagination) (*model.BuildRunPaginatedRecords, error) + CrGetBuildRun(ctx context.Context, repoName string, buildRunName string) (*entities.BuildRun, error) +} +type RepositoryResolver interface { + CreationTime(ctx context.Context, obj *entities.Repository) (string, error) + ID(ctx context.Context, obj *entities.Repository) (string, error) + + UpdateTime(ctx context.Context, obj *entities.Repository) (string, error) +} + +type BuildCacheKeyInResolver interface { + VolumeSizeInGb(ctx context.Context, obj *entities.BuildCacheKey, data float64) error +} +type BuildInResolver interface { + Source(ctx context.Context, obj *entities.Build, data *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitSourceIn) error + Spec(ctx context.Context, obj *entities.Build, data *model.GithubComKloudliteOperatorApisDistributionV1BuildRunSpecIn) error +} +type CredentialInResolver interface { + Access(ctx context.Context, obj *entities.Credential, data model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesRepoAccess) error + Expiration(ctx context.Context, obj *entities.Credential, data *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationIn) error +} +type MetadataInResolver interface { + Annotations(ctx context.Context, obj *v1.ObjectMeta, data map[string]interface{}) error + Labels(ctx context.Context, obj *v1.ObjectMeta, data map[string]interface{}) error } type executableSchema struct { @@ -225,4787 +642,19544 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in _ = ec switch typeName + "." + field { - case "Artifact.size": - if e.complexity.Artifact.Size == nil { + case "Build.buildClusterName": + if e.complexity.Build.BuildClusterName == nil { break } - return e.complexity.Artifact.Size(childComplexity), true + return e.complexity.Build.BuildClusterName(childComplexity), true - case "Artifact.tags": - if e.complexity.Artifact.Tags == nil { + case "Build.createdBy": + if e.complexity.Build.CreatedBy == nil { break } - return e.complexity.Artifact.Tags(childComplexity), true + return e.complexity.Build.CreatedBy(childComplexity), true - case "Check.generation": - if e.complexity.Check.Generation == nil { + case "Build.creationTime": + if e.complexity.Build.CreationTime == nil { break } - return e.complexity.Check.Generation(childComplexity), true + return e.complexity.Build.CreationTime(childComplexity), true - case "Check.message": - if e.complexity.Check.Message == nil { + case "Build.credUser": + if e.complexity.Build.CredUser == nil { break } - return e.complexity.Check.Message(childComplexity), true + return e.complexity.Build.CredUser(childComplexity), true - case "Check.status": - if e.complexity.Check.Status == nil { + case "Build.errorMessages": + if e.complexity.Build.ErrorMessages == nil { break } - return e.complexity.Check.Status(childComplexity), true + return e.complexity.Build.ErrorMessages(childComplexity), true - case "HarborRobotUser.apiVersion": - if e.complexity.HarborRobotUser.APIVersion == nil { + case "Build.id": + if e.complexity.Build.ID == nil { break } - return e.complexity.HarborRobotUser.APIVersion(childComplexity), true + return e.complexity.Build.ID(childComplexity), true - case "HarborRobotUser.kind": - if e.complexity.HarborRobotUser.Kind == nil { + case "Build.lastUpdatedBy": + if e.complexity.Build.LastUpdatedBy == nil { break } - return e.complexity.HarborRobotUser.Kind(childComplexity), true + return e.complexity.Build.LastUpdatedBy(childComplexity), true - case "HarborRobotUser.metadata": - if e.complexity.HarborRobotUser.ObjectMeta == nil { + case "Build.markedForDeletion": + if e.complexity.Build.MarkedForDeletion == nil { break } - return e.complexity.HarborRobotUser.ObjectMeta(childComplexity), true + return e.complexity.Build.MarkedForDeletion(childComplexity), true - case "HarborRobotUser.spec": - if e.complexity.HarborRobotUser.Spec == nil { + case "Build.name": + if e.complexity.Build.Name == nil { break } - return e.complexity.HarborRobotUser.Spec(childComplexity), true + return e.complexity.Build.Name(childComplexity), true - case "HarborRobotUser.status": - if e.complexity.HarborRobotUser.Status == nil { + case "Build.recordVersion": + if e.complexity.Build.RecordVersion == nil { break } - return e.complexity.HarborRobotUser.Status(childComplexity), true + return e.complexity.Build.RecordVersion(childComplexity), true - case "HarborRobotUser.syncStatus": - if e.complexity.HarborRobotUser.SyncStatus == nil { + case "Build.source": + if e.complexity.Build.Source == nil { break } - return e.complexity.HarborRobotUser.SyncStatus(childComplexity), true + return e.complexity.Build.Source(childComplexity), true - case "HarborRobotUserSpec.accountName": - if e.complexity.HarborRobotUserSpec.AccountName == nil { + case "Build.spec": + if e.complexity.Build.Spec == nil { break } - return e.complexity.HarborRobotUserSpec.AccountName(childComplexity), true + return e.complexity.Build.Spec(childComplexity), true - case "HarborRobotUserSpec.enabled": - if e.complexity.HarborRobotUserSpec.Enabled == nil { + case "Build.status": + if e.complexity.Build.Status == nil { break } - return e.complexity.HarborRobotUserSpec.Enabled(childComplexity), true + return e.complexity.Build.Status(childComplexity), true - case "HarborRobotUserSpec.harborProjectName": - if e.complexity.HarborRobotUserSpec.HarborProjectName == nil { + case "Build.updateTime": + if e.complexity.Build.UpdateTime == nil { break } - return e.complexity.HarborRobotUserSpec.HarborProjectName(childComplexity), true + return e.complexity.Build.UpdateTime(childComplexity), true - case "HarborRobotUserSpec.permissions": - if e.complexity.HarborRobotUserSpec.Permissions == nil { + case "BuildCacheKey.accountName": + if e.complexity.BuildCacheKey.AccountName == nil { break } - return e.complexity.HarborRobotUserSpec.Permissions(childComplexity), true + return e.complexity.BuildCacheKey.AccountName(childComplexity), true - case "HarborRobotUserSpec.targetSecret": - if e.complexity.HarborRobotUserSpec.TargetSecret == nil { + case "BuildCacheKey.createdBy": + if e.complexity.BuildCacheKey.CreatedBy == nil { break } - return e.complexity.HarborRobotUserSpec.TargetSecret(childComplexity), true + return e.complexity.BuildCacheKey.CreatedBy(childComplexity), true - case "ImageTag.immutable": - if e.complexity.ImageTag.Immutable == nil { + case "BuildCacheKey.creationTime": + if e.complexity.BuildCacheKey.CreationTime == nil { break } - return e.complexity.ImageTag.Immutable(childComplexity), true + return e.complexity.BuildCacheKey.CreationTime(childComplexity), true - case "ImageTag.name": - if e.complexity.ImageTag.Name == nil { + case "BuildCacheKey.displayName": + if e.complexity.BuildCacheKey.DisplayName == nil { break } - return e.complexity.ImageTag.Name(childComplexity), true + return e.complexity.BuildCacheKey.DisplayName(childComplexity), true - case "ImageTag.pushedAt": - if e.complexity.ImageTag.PushedAt == nil { + case "BuildCacheKey.id": + if e.complexity.BuildCacheKey.ID == nil { break } - return e.complexity.ImageTag.PushedAt(childComplexity), true + return e.complexity.BuildCacheKey.ID(childComplexity), true - case "ImageTag.signed": - if e.complexity.ImageTag.Signed == nil { + case "BuildCacheKey.lastUpdatedBy": + if e.complexity.BuildCacheKey.LastUpdatedBy == nil { break } - return e.complexity.ImageTag.Signed(childComplexity), true + return e.complexity.BuildCacheKey.LastUpdatedBy(childComplexity), true - case "Metadata.annotations": - if e.complexity.Metadata.Annotations == nil { + case "BuildCacheKey.markedForDeletion": + if e.complexity.BuildCacheKey.MarkedForDeletion == nil { break } - return e.complexity.Metadata.Annotations(childComplexity), true + return e.complexity.BuildCacheKey.MarkedForDeletion(childComplexity), true - case "Metadata.creationTimestamp": - if e.complexity.Metadata.CreationTimestamp == nil { + case "BuildCacheKey.name": + if e.complexity.BuildCacheKey.Name == nil { break } - return e.complexity.Metadata.CreationTimestamp(childComplexity), true + return e.complexity.BuildCacheKey.Name(childComplexity), true - case "Metadata.deletionTimestamp": - if e.complexity.Metadata.DeletionTimestamp == nil { + case "BuildCacheKey.recordVersion": + if e.complexity.BuildCacheKey.RecordVersion == nil { break } - return e.complexity.Metadata.DeletionTimestamp(childComplexity), true + return e.complexity.BuildCacheKey.RecordVersion(childComplexity), true - case "Metadata.generation": - if e.complexity.Metadata.Generation == nil { + case "BuildCacheKey.updateTime": + if e.complexity.BuildCacheKey.UpdateTime == nil { break } - return e.complexity.Metadata.Generation(childComplexity), true + return e.complexity.BuildCacheKey.UpdateTime(childComplexity), true - case "Metadata.labels": - if e.complexity.Metadata.Labels == nil { + case "BuildCacheKey.volumeSizeInGB": + if e.complexity.BuildCacheKey.VolumeSizeInGb == nil { break } - return e.complexity.Metadata.Labels(childComplexity), true + return e.complexity.BuildCacheKey.VolumeSizeInGb(childComplexity), true - case "Metadata.name": - if e.complexity.Metadata.Name == nil { + case "BuildCacheKeyEdge.cursor": + if e.complexity.BuildCacheKeyEdge.Cursor == nil { break } - return e.complexity.Metadata.Name(childComplexity), true + return e.complexity.BuildCacheKeyEdge.Cursor(childComplexity), true - case "Metadata.namespace": - if e.complexity.Metadata.Namespace == nil { + case "BuildCacheKeyEdge.node": + if e.complexity.BuildCacheKeyEdge.Node == nil { break } - return e.complexity.Metadata.Namespace(childComplexity), true + return e.complexity.BuildCacheKeyEdge.Node(childComplexity), true - case "Mutation.cr_createRobot": - if e.complexity.Mutation.CrCreateRobot == nil { + case "BuildCacheKeyPaginatedRecords.edges": + if e.complexity.BuildCacheKeyPaginatedRecords.Edges == nil { break } - args, err := ec.field_Mutation_cr_createRobot_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.BuildCacheKeyPaginatedRecords.Edges(childComplexity), true + + case "BuildCacheKeyPaginatedRecords.pageInfo": + if e.complexity.BuildCacheKeyPaginatedRecords.PageInfo == nil { + break } - return e.complexity.Mutation.CrCreateRobot(childComplexity, args["robotUser"].(entities.HarborRobotUser)), true + return e.complexity.BuildCacheKeyPaginatedRecords.PageInfo(childComplexity), true - case "Mutation.cr_deleteRepo": - if e.complexity.Mutation.CrDeleteRepo == nil { + case "BuildCacheKeyPaginatedRecords.totalCount": + if e.complexity.BuildCacheKeyPaginatedRecords.TotalCount == nil { break } - args, err := ec.field_Mutation_cr_deleteRepo_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.BuildCacheKeyPaginatedRecords.TotalCount(childComplexity), true + + case "BuildEdge.cursor": + if e.complexity.BuildEdge.Cursor == nil { + break } - return e.complexity.Mutation.CrDeleteRepo(childComplexity, args["repoId"].(int)), true + return e.complexity.BuildEdge.Cursor(childComplexity), true - case "Mutation.cr_deleteRobot": - if e.complexity.Mutation.CrDeleteRobot == nil { + case "BuildEdge.node": + if e.complexity.BuildEdge.Node == nil { break } - args, err := ec.field_Mutation_cr_deleteRobot_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.BuildEdge.Node(childComplexity), true + + case "BuildPaginatedRecords.edges": + if e.complexity.BuildPaginatedRecords.Edges == nil { + break } - return e.complexity.Mutation.CrDeleteRobot(childComplexity, args["robotId"].(int)), true + return e.complexity.BuildPaginatedRecords.Edges(childComplexity), true - case "Mutation.cr_resyncRobot": - if e.complexity.Mutation.CrResyncRobot == nil { + case "BuildPaginatedRecords.pageInfo": + if e.complexity.BuildPaginatedRecords.PageInfo == nil { break } - args, err := ec.field_Mutation_cr_resyncRobot_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.BuildPaginatedRecords.PageInfo(childComplexity), true + + case "BuildPaginatedRecords.totalCount": + if e.complexity.BuildPaginatedRecords.TotalCount == nil { + break } - return e.complexity.Mutation.CrResyncRobot(childComplexity, args["name"].(string)), true + return e.complexity.BuildPaginatedRecords.TotalCount(childComplexity), true - case "Mutation.cr_updateRobot": - if e.complexity.Mutation.CrUpdateRobot == nil { + case "BuildRun.apiVersion": + if e.complexity.BuildRun.APIVersion == nil { break } - args, err := ec.field_Mutation_cr_updateRobot_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.BuildRun.APIVersion(childComplexity), true + + case "BuildRun.accountName": + if e.complexity.BuildRun.AccountName == nil { + break } - return e.complexity.Mutation.CrUpdateRobot(childComplexity, args["name"].(string), args["permissions"].([]harbor.Permission)), true + return e.complexity.BuildRun.AccountName(childComplexity), true - case "Overrides.applied": - if e.complexity.Overrides.Applied == nil { + case "BuildRun.buildName": + if e.complexity.BuildRun.BuildName == nil { break } - return e.complexity.Overrides.Applied(childComplexity), true + return e.complexity.BuildRun.BuildName(childComplexity), true - case "Overrides.patches": - if e.complexity.Overrides.Patches == nil { + case "BuildRun.clusterName": + if e.complexity.BuildRun.ClusterName == nil { break } - return e.complexity.Overrides.Patches(childComplexity), true + return e.complexity.BuildRun.ClusterName(childComplexity), true - case "Patch.op": - if e.complexity.Patch.Op == nil { + case "BuildRun.creationTime": + if e.complexity.BuildRun.CreationTime == nil { break } - return e.complexity.Patch.Op(childComplexity), true + return e.complexity.BuildRun.CreationTime(childComplexity), true - case "Patch.path": - if e.complexity.Patch.Path == nil { + case "BuildRun.id": + if e.complexity.BuildRun.ID == nil { break } - return e.complexity.Patch.Path(childComplexity), true + return e.complexity.BuildRun.ID(childComplexity), true - case "Patch.value": - if e.complexity.Patch.Value == nil { + case "BuildRun.kind": + if e.complexity.BuildRun.Kind == nil { break } - return e.complexity.Patch.Value(childComplexity), true + return e.complexity.BuildRun.Kind(childComplexity), true - case "Query.cr_listArtifacts": - if e.complexity.Query.CrListArtifacts == nil { + case "BuildRun.markedForDeletion": + if e.complexity.BuildRun.MarkedForDeletion == nil { break } - args, err := ec.field_Query_cr_listArtifacts_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.BuildRun.MarkedForDeletion(childComplexity), true + + case "BuildRun.metadata": + if e.complexity.BuildRun.ObjectMeta == nil { + break } - return e.complexity.Query.CrListArtifacts(childComplexity, args["repoName"].(string)), true + return e.complexity.BuildRun.ObjectMeta(childComplexity), true - case "Query.cr_listRepos": - if e.complexity.Query.CrListRepos == nil { + case "BuildRun.recordVersion": + if e.complexity.BuildRun.RecordVersion == nil { break } - return e.complexity.Query.CrListRepos(childComplexity), true + return e.complexity.BuildRun.RecordVersion(childComplexity), true - case "Query.cr_listRobots": - if e.complexity.Query.CrListRobots == nil { + case "BuildRun.spec": + if e.complexity.BuildRun.Spec == nil { break } - return e.complexity.Query.CrListRobots(childComplexity), true + return e.complexity.BuildRun.Spec(childComplexity), true - case "Query._service": - if e.complexity.Query.__resolve__service == nil { + case "BuildRun.status": + if e.complexity.BuildRun.Status == nil { break } - return e.complexity.Query.__resolve__service(childComplexity), true + return e.complexity.BuildRun.Status(childComplexity), true - case "Repo.artifactCount": - if e.complexity.Repo.ArtifactCount == nil { + case "BuildRun.syncStatus": + if e.complexity.BuildRun.SyncStatus == nil { break } - return e.complexity.Repo.ArtifactCount(childComplexity), true + return e.complexity.BuildRun.SyncStatus(childComplexity), true - case "Repo.id": - if e.complexity.Repo.Id == nil { + case "BuildRun.updateTime": + if e.complexity.BuildRun.UpdateTime == nil { break } - return e.complexity.Repo.Id(childComplexity), true + return e.complexity.BuildRun.UpdateTime(childComplexity), true - case "Repo.name": - if e.complexity.Repo.Name == nil { + case "BuildRunEdge.cursor": + if e.complexity.BuildRunEdge.Cursor == nil { break } - return e.complexity.Repo.Name(childComplexity), true + return e.complexity.BuildRunEdge.Cursor(childComplexity), true - case "Repo.pullCount": - if e.complexity.Repo.PullCount == nil { + case "BuildRunEdge.node": + if e.complexity.BuildRunEdge.Node == nil { break } - return e.complexity.Repo.PullCount(childComplexity), true + return e.complexity.BuildRunEdge.Node(childComplexity), true - case "Status.checks": - if e.complexity.Status.Checks == nil { + case "BuildRunPaginatedRecords.edges": + if e.complexity.BuildRunPaginatedRecords.Edges == nil { break } - return e.complexity.Status.Checks(childComplexity), true + return e.complexity.BuildRunPaginatedRecords.Edges(childComplexity), true - case "Status.displayVars": - if e.complexity.Status.DisplayVars == nil { + case "BuildRunPaginatedRecords.pageInfo": + if e.complexity.BuildRunPaginatedRecords.PageInfo == nil { break } - return e.complexity.Status.DisplayVars(childComplexity), true + return e.complexity.BuildRunPaginatedRecords.PageInfo(childComplexity), true - case "Status.isReady": - if e.complexity.Status.IsReady == nil { + case "BuildRunPaginatedRecords.totalCount": + if e.complexity.BuildRunPaginatedRecords.TotalCount == nil { break } - return e.complexity.Status.IsReady(childComplexity), true + return e.complexity.BuildRunPaginatedRecords.TotalCount(childComplexity), true - case "SyncStatus.action": - if e.complexity.SyncStatus.Action == nil { + case "CRCheckNameAvailabilityOutput.result": + if e.complexity.CRCheckNameAvailabilityOutput.Result == nil { break } - return e.complexity.SyncStatus.Action(childComplexity), true + return e.complexity.CRCheckNameAvailabilityOutput.Result(childComplexity), true - case "SyncStatus.error": - if e.complexity.SyncStatus.Error == nil { + case "CRCheckNameAvailabilityOutput.suggestedNames": + if e.complexity.CRCheckNameAvailabilityOutput.SuggestedNames == nil { break } - return e.complexity.SyncStatus.Error(childComplexity), true + return e.complexity.CRCheckNameAvailabilityOutput.SuggestedNames(childComplexity), true - case "SyncStatus.generation": - if e.complexity.SyncStatus.Generation == nil { + case "Credential.access": + if e.complexity.Credential.Access == nil { break } - return e.complexity.SyncStatus.Generation(childComplexity), true + return e.complexity.Credential.Access(childComplexity), true - case "SyncStatus.lastSyncedAt": - if e.complexity.SyncStatus.LastSyncedAt == nil { + case "Credential.accountName": + if e.complexity.Credential.AccountName == nil { break } - return e.complexity.SyncStatus.LastSyncedAt(childComplexity), true + return e.complexity.Credential.AccountName(childComplexity), true - case "SyncStatus.state": - if e.complexity.SyncStatus.State == nil { + case "Credential.createdBy": + if e.complexity.Credential.CreatedBy == nil { break } - return e.complexity.SyncStatus.State(childComplexity), true + return e.complexity.Credential.CreatedBy(childComplexity), true - case "SyncStatus.syncScheduledAt": - if e.complexity.SyncStatus.SyncScheduledAt == nil { + case "Credential.creationTime": + if e.complexity.Credential.CreationTime == nil { break } - return e.complexity.SyncStatus.SyncScheduledAt(childComplexity), true + return e.complexity.Credential.CreationTime(childComplexity), true - case "_Service.sdl": - if e.complexity._Service.SDL == nil { + case "Credential.expiration": + if e.complexity.Credential.Expiration == nil { break } - return e.complexity._Service.SDL(childComplexity), true - - } - return 0, false -} + return e.complexity.Credential.Expiration(childComplexity), true -func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { - rc := graphql.GetOperationContext(ctx) - ec := executionContext{rc, e} - inputUnmarshalMap := graphql.BuildUnmarshalerMap( - ec.unmarshalInputHarborRobotUserIn, - ec.unmarshalInputHarborRobotUserSpecIn, - ec.unmarshalInputMetadataIn, - ec.unmarshalInputOverridesIn, - ec.unmarshalInputPatchIn, - ) - first := true + case "Credential.id": + if e.complexity.Credential.ID == nil { + break + } - switch rc.Operation.Operation { - case ast.Query: - return func(ctx context.Context) *graphql.Response { - if !first { - return nil - } - first = false - ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) - data := ec._Query(ctx, rc.Operation.SelectionSet) - var buf bytes.Buffer - data.MarshalGQL(&buf) + return e.complexity.Credential.ID(childComplexity), true - return &graphql.Response{ - Data: buf.Bytes(), - } + case "Credential.lastUpdatedBy": + if e.complexity.Credential.LastUpdatedBy == nil { + break } - 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(), - } + return e.complexity.Credential.LastUpdatedBy(childComplexity), true + + case "Credential.markedForDeletion": + if e.complexity.Credential.MarkedForDeletion == nil { + break } - default: - return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation")) - } -} + return e.complexity.Credential.MarkedForDeletion(childComplexity), true -type executionContext struct { - *graphql.OperationContext - *executableSchema -} + case "Credential.name": + if e.complexity.Credential.Name == nil { + break + } -func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { - if ec.DisableIntrospection { - return nil, errors.New("introspection disabled") - } - return introspection.WrapSchema(parsedSchema), nil -} + return e.complexity.Credential.Name(childComplexity), true -func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { - if ec.DisableIntrospection { - return nil, errors.New("introspection disabled") - } - return introspection.WrapTypeFromDef(parsedSchema, parsedSchema.Types[name]), nil -} + case "Credential.recordVersion": + if e.complexity.Credential.RecordVersion == nil { + break + } -var sources = []*ast.Source{ - {Name: "../schema.graphqls", Input: `directive @isLoggedIn on FIELD_DEFINITION -directive @hasAccount on FIELD_DEFINITION -directive @canActOnAccount(action: String) on FIELD_DEFINITION + return e.complexity.Credential.RecordVersion(childComplexity), true -# scalar Json -# scalar Any + case "Credential.updateTime": + if e.complexity.Credential.UpdateTime == nil { + break + } -type Repo { - id: Int! - name: String! - artifactCount: Int! - pullCount: Int! -} + return e.complexity.Credential.UpdateTime(childComplexity), true -enum HarborPermission { - PushRepository - PullRepository -} + case "Credential.username": + if e.complexity.Credential.UserName == nil { + break + } -type Artifact { - size: Int! - tags: [ImageTag!]! -} + return e.complexity.Credential.UserName(childComplexity), true -type ImageTag { - name: String! - signed: Boolean! - immutable: Boolean! - pushedAt: String! -} + case "CredentialEdge.cursor": + if e.complexity.CredentialEdge.Cursor == nil { + break + } -type Query { - cr_listRepos :[Repo!]! @hasAccount @isLoggedIn @canActOnAccount(action: "read-container-registry") - cr_listArtifacts(repoName:String!) :[Artifact!]! @hasAccount @isLoggedIn @canActOnAccount(action: "read-container-registry") - cr_listRobots :[HarborRobotUser!]! @hasAccount @isLoggedIn @canActOnAccount(action: "read-container-registry") -} + return e.complexity.CredentialEdge.Cursor(childComplexity), true -type Mutation { - # cr_createRobot(name: String!, description: String, readOnly: Boolean!) :Robot! @hasAccount @isLoggedIn @canActOnAccount(action: "write-container-registry") - cr_createRobot(robotUser: HarborRobotUserIn!): HarborRobotUser @hasAccount @isLoggedIn @canActOnAccount(action: "write-container-registry") - cr_updateRobot(name: String!, permissions: [HarborPermission!]): HarborRobotUser @hasAccount @isLoggedIn @canActOnAccount(action: "write-container-registry") - cr_deleteRobot(robotId: Int!) :Boolean! @hasAccount @isLoggedIn @canActOnAccount(action: "write-container-registry") - cr_resyncRobot(name: String!): Boolean! @hasAccount @isLoggedIn @canActOnAccount(action: "write-container-registry") + case "CredentialEdge.node": + if e.complexity.CredentialEdge.Node == nil { + break + } - cr_deleteRepo(repoId:Int!) :Boolean! @hasAccount @isLoggedIn @canActOnAccount(action: "write-container-registry") -} -`, BuiltIn: false}, - {Name: "../crd-to-gql/directives.graphqls", Input: ` -extend schema @link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@key", "@shareable"]) + return e.complexity.CredentialEdge.Node(childComplexity), true -directive @goField( - forceResolver: Boolean - name: String -) on INPUT_FIELD_DEFINITION | FIELD_DEFINITION -`, BuiltIn: false}, - {Name: "../crd-to-gql/harborrobotuser.graphqls", Input: `type HarborRobotUserSpec @shareable { - accountName: String! - enabled: Boolean - harborProjectName: String! - permissions: [String] - targetSecret: String -} + case "CredentialPaginatedRecords.edges": + if e.complexity.CredentialPaginatedRecords.Edges == nil { + break + } -input HarborRobotUserSpecIn { - accountName: String! - enabled: Boolean - harborProjectName: String! - permissions: [String] - targetSecret: String -} + return e.complexity.CredentialPaginatedRecords.Edges(childComplexity), true -type HarborRobotUser @shareable { - syncStatus: SyncStatus - spec: HarborRobotUserSpec - status: Status - apiVersion: String - kind: String - metadata: Metadata! @goField(name: "objectMeta") -} + case "CredentialPaginatedRecords.pageInfo": + if e.complexity.CredentialPaginatedRecords.PageInfo == nil { + break + } -input HarborRobotUserIn { - spec: HarborRobotUserSpecIn - apiVersion: String - kind: String - metadata: MetadataIn! @goField(name: "objectMeta") -} + return e.complexity.CredentialPaginatedRecords.PageInfo(childComplexity), true -`, BuiltIn: false}, - {Name: "../crd-to-gql/scalars.graphqls", Input: ` -scalar Any -scalar Json -scalar Map -scalar Date + case "CredentialPaginatedRecords.totalCount": + if e.complexity.CredentialPaginatedRecords.TotalCount == nil { + break + } -type Metadata @shareable { - name: String! - namespace: String - labels: Json - annotations: Json - creationTimestamp: Date! - deletionTimestamp: Date - generation: Int! -} + return e.complexity.CredentialPaginatedRecords.TotalCount(childComplexity), true -input MetadataIn { - name: String! - namespace: String - labels: Json - annotations: Json -} + case "CursorPagination.after": + if e.complexity.CursorPagination.After == nil { + break + } -type Status @shareable { - isReady: Boolean! - checks: Map - displayVars: Json -} + return e.complexity.CursorPagination.After(childComplexity), true -type Check @shareable { - status: Boolean - message: String - generation: Int -} + case "CursorPagination.before": + if e.complexity.CursorPagination.Before == nil { + break + } -type Patch @shareable { - op: String! - path: String! - value: Any -} + return e.complexity.CursorPagination.Before(childComplexity), true -type Overrides @shareable{ - applied: Boolean - patches: [Patch!] -} + case "CursorPagination.first": + if e.complexity.CursorPagination.First == nil { + break + } -input PatchIn { - op: String! - path: String! - value: Any -} + return e.complexity.CursorPagination.First(childComplexity), true -input OverridesIn{ - patches: [PatchIn!] -} + case "CursorPagination.last": + if e.complexity.CursorPagination.Last == nil { + break + } -enum SyncAction { - APPLY - DELETE -} + return e.complexity.CursorPagination.Last(childComplexity), true -enum SyncState { - IDLE - IN_PROGRESS - READY - NOT_READY -} + case "CursorPagination.orderBy": + if e.complexity.CursorPagination.OrderBy == nil { + break + } -type SyncStatus @shareable{ - syncScheduledAt: Date! - lastSyncedAt: Date - action: SyncAction! - generation: Int! - state: SyncState! - error: String -} -`, BuiltIn: false}, - {Name: "../../federation/directives.graphql", Input: ` - scalar _Any - scalar _FieldSet - directive @requires(fields: _FieldSet!) on FIELD_DEFINITION - directive @provides(fields: _FieldSet!) on FIELD_DEFINITION - directive @extends on OBJECT | INTERFACE + return e.complexity.CursorPagination.OrderBy(childComplexity), true - directive @key(fields: _FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE - directive @external on FIELD_DEFINITION | OBJECT - directive @link(import: [String!], url: String!) repeatable on SCHEMA - directive @shareable on OBJECT | FIELD_DEFINITION - directive @tag(name: String!) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION - directive @override(from: String!) on FIELD_DEFINITION - directive @inaccessible on SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION -`, BuiltIn: true}, - {Name: "../../federation/entity.graphql", Input: ` -type _Service { - sdl: String -} + case "CursorPagination.sortDirection": + if e.complexity.CursorPagination.SortDirection == nil { + break + } -extend type Query { - _service: _Service! -} -`, BuiltIn: true}, -} -var parsedSchema = gqlparser.MustLoadSchema(sources...) + return e.complexity.CursorPagination.SortDirection(childComplexity), true -// endregion ************************** generated!.gotpl ************************** + case "Digest.accountName": + if e.complexity.Digest.AccountName == nil { + break + } -// region ***************************** args.gotpl ***************************** + return e.complexity.Digest.AccountName(childComplexity), true -func (ec *executionContext) dir_canActOnAccount_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["action"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("action")) - arg0, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err + case "Digest.actor": + if e.complexity.Digest.Actor == nil { + break } - } - args["action"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_cr_createRobot_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 entities.HarborRobotUser - if tmp, ok := rawArgs["robotUser"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("robotUser")) - arg0, err = ec.unmarshalNHarborRobotUserIn2kloudliteᚗioᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐHarborRobotUser(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.Digest.Actor(childComplexity), true + + case "Digest.creationTime": + if e.complexity.Digest.CreationTime == nil { + break } - } - args["robotUser"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_cr_deleteRepo_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 int - if tmp, ok := rawArgs["repoId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("repoId")) - arg0, err = ec.unmarshalNInt2int(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.Digest.CreationTime(childComplexity), true + + case "Digest.deleting": + if e.complexity.Digest.Deleting == nil { + break } - } - args["repoId"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_cr_deleteRobot_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 int - if tmp, ok := rawArgs["robotId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("robotId")) - arg0, err = ec.unmarshalNInt2int(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.Digest.Deleting(childComplexity), true + + case "Digest.digest": + if e.complexity.Digest.Digest == nil { + break } - } - args["robotId"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_cr_resyncRobot_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 + return e.complexity.Digest.Digest(childComplexity), true + + case "Digest.id": + if e.complexity.Digest.ID == nil { + break } - } - args["name"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_cr_updateRobot_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 + return e.complexity.Digest.ID(childComplexity), true + + case "Digest.length": + if e.complexity.Digest.Length == nil { + break } - } - args["name"] = arg0 - var arg1 []harbor.Permission - if tmp, ok := rawArgs["permissions"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("permissions")) - arg1, err = ec.unmarshalOHarborPermission2ᚕgithubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋharborᚐPermissionᚄ(ctx, tmp) - if err != nil { - return nil, err + + return e.complexity.Digest.Length(childComplexity), true + + case "Digest.markedForDeletion": + if e.complexity.Digest.MarkedForDeletion == nil { + break } - } - args["permissions"] = 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 + return e.complexity.Digest.MarkedForDeletion(childComplexity), true + + case "Digest.mediaType": + if e.complexity.Digest.MediaType == nil { + break } - } - args["name"] = arg0 - return args, nil -} -func (ec *executionContext) field_Query_cr_listArtifacts_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["repoName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("repoName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.Digest.MediaType(childComplexity), true + + case "Digest.recordVersion": + if e.complexity.Digest.RecordVersion == nil { + break } - } - args["repoName"] = 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 + return e.complexity.Digest.RecordVersion(childComplexity), true + + case "Digest.repository": + if e.complexity.Digest.Repository == nil { + break } - } - 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 + return e.complexity.Digest.Repository(childComplexity), true + + case "Digest.size": + if e.complexity.Digest.Size == nil { + break } - } - args["includeDeprecated"] = arg0 - return args, nil -} -// endregion ***************************** args.gotpl ***************************** + return e.complexity.Digest.Size(childComplexity), true -// region ************************** directives.gotpl ************************** + case "Digest.tags": + if e.complexity.Digest.Tags == nil { + break + } -// endregion ************************** directives.gotpl ************************** + return e.complexity.Digest.Tags(childComplexity), true -// region **************************** field.gotpl ***************************** + case "Digest.url": + if e.complexity.Digest.URL == nil { + break + } -func (ec *executionContext) _Artifact_size(ctx context.Context, field graphql.CollectedField, obj *harbor1.Artifact) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Artifact_size(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.Digest.URL(childComplexity), true + + case "Digest.updateTime": + if e.complexity.Digest.UpdateTime == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Size, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.Digest.UpdateTime(childComplexity), true + + case "DigestEdge.cursor": + if e.complexity.DigestEdge.Cursor == nil { + break } - return graphql.Null - } - res := resTmp.(int) - fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Artifact_size(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Artifact", - 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 -} + return e.complexity.DigestEdge.Cursor(childComplexity), true -func (ec *executionContext) _Artifact_tags(ctx context.Context, field graphql.CollectedField, obj *harbor1.Artifact) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Artifact_tags(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "DigestEdge.node": + if e.complexity.DigestEdge.Node == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Tags, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.DigestEdge.Node(childComplexity), true + + case "DigestPaginatedRecords.edges": + if e.complexity.DigestPaginatedRecords.Edges == nil { + break } - return graphql.Null - } - res := resTmp.([]harbor1.ImageTag) - fc.Result = res - return ec.marshalNImageTag2ᚕkloudliteᚗioᚋpkgᚋharborᚐImageTagᚄ(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Artifact_tags(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Artifact", - 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_ImageTag_name(ctx, field) - case "signed": - return ec.fieldContext_ImageTag_signed(ctx, field) - case "immutable": - return ec.fieldContext_ImageTag_immutable(ctx, field) - case "pushedAt": - return ec.fieldContext_ImageTag_pushedAt(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ImageTag", field.Name) - }, - } - return fc, nil -} + return e.complexity.DigestPaginatedRecords.Edges(childComplexity), true -func (ec *executionContext) _Check_status(ctx context.Context, field graphql.CollectedField, obj *operator.Check) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Check_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 + case "DigestPaginatedRecords.pageInfo": + if e.complexity.DigestPaginatedRecords.PageInfo == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Status, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalOBoolean2bool(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Check_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Check", - 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 -} + return e.complexity.DigestPaginatedRecords.PageInfo(childComplexity), true -func (ec *executionContext) _Check_message(ctx context.Context, field graphql.CollectedField, obj *operator.Check) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Check_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 + case "DigestPaginatedRecords.totalCount": + if e.complexity.DigestPaginatedRecords.TotalCount == nil { + break } - }() - 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.marshalOString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Check_message(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Check", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.DigestPaginatedRecords.TotalCount(childComplexity), true -func (ec *executionContext) _Check_generation(ctx context.Context, field graphql.CollectedField, obj *operator.Check) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Check_generation(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "GitBranch.name": + if e.complexity.GitBranch.Name == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Generation, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(int64) - fc.Result = res - return ec.marshalOInt2int64(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Check_generation(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Check", - 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 -} + return e.complexity.GitBranch.Name(childComplexity), true -func (ec *executionContext) _HarborRobotUser_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.HarborRobotUser) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_HarborRobotUser_syncStatus(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "GitBranch.protected": + if e.complexity.GitBranch.Protected == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SyncStatus, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(types.SyncStatus) - fc.Result = res - return ec.marshalOSyncStatus2kloudliteᚗioᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_HarborRobotUser_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "HarborRobotUser", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "syncScheduledAt": - return ec.fieldContext_SyncStatus_syncScheduledAt(ctx, field) - case "lastSyncedAt": - return ec.fieldContext_SyncStatus_lastSyncedAt(ctx, field) - case "action": - return ec.fieldContext_SyncStatus_action(ctx, field) - case "generation": - return ec.fieldContext_SyncStatus_generation(ctx, field) - case "state": - return ec.fieldContext_SyncStatus_state(ctx, field) - case "error": - return ec.fieldContext_SyncStatus_error(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type SyncStatus", field.Name) - }, - } - return fc, nil -} + return e.complexity.GitBranch.Protected(childComplexity), true -func (ec *executionContext) _HarborRobotUser_spec(ctx context.Context, field graphql.CollectedField, obj *entities.HarborRobotUser) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_HarborRobotUser_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 + case "GithubBranch.name": + if e.complexity.GithubBranch.Name == nil { + break } - }() - 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 { - return graphql.Null - } - res := resTmp.(v1.HarborUserAccountSpec) - fc.Result = res - return ec.marshalOHarborRobotUserSpec2githubᚗcomᚋkloudliteᚋoperatorᚋapisᚋartifactsᚋv1ᚐHarborUserAccountSpec(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_HarborRobotUser_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "HarborRobotUser", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "accountName": - return ec.fieldContext_HarborRobotUserSpec_accountName(ctx, field) - case "enabled": - return ec.fieldContext_HarborRobotUserSpec_enabled(ctx, field) - case "harborProjectName": - return ec.fieldContext_HarborRobotUserSpec_harborProjectName(ctx, field) - case "permissions": - return ec.fieldContext_HarborRobotUserSpec_permissions(ctx, field) - case "targetSecret": - return ec.fieldContext_HarborRobotUserSpec_targetSecret(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type HarborRobotUserSpec", field.Name) - }, - } - return fc, nil -} + return e.complexity.GithubBranch.Name(childComplexity), true -func (ec *executionContext) _HarborRobotUser_status(ctx context.Context, field graphql.CollectedField, obj *entities.HarborRobotUser) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_HarborRobotUser_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 + case "GithubBranch.protected": + if e.complexity.GithubBranch.Protected == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Status, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(operator.Status) - fc.Result = res - return ec.marshalOStatus2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_HarborRobotUser_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "HarborRobotUser", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "isReady": - return ec.fieldContext_Status_isReady(ctx, field) - case "checks": - return ec.fieldContext_Status_checks(ctx, field) - case "displayVars": - return ec.fieldContext_Status_displayVars(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Status", field.Name) - }, - } - return fc, nil -} + return e.complexity.GithubBranch.Protected(childComplexity), true -func (ec *executionContext) _HarborRobotUser_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.HarborRobotUser) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_HarborRobotUser_apiVersion(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "GithubInstallation.account": + if e.complexity.GithubInstallation.Account == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.APIVersion, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_HarborRobotUser_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "HarborRobotUser", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.GithubInstallation.Account(childComplexity), true -func (ec *executionContext) _HarborRobotUser_kind(ctx context.Context, field graphql.CollectedField, obj *entities.HarborRobotUser) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_HarborRobotUser_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 + case "GithubInstallation.appId": + if e.complexity.GithubInstallation.AppID == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_HarborRobotUser_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "HarborRobotUser", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.GithubInstallation.AppID(childComplexity), true -func (ec *executionContext) _HarborRobotUser_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.HarborRobotUser) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_HarborRobotUser_metadata(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "GithubInstallation.id": + if e.complexity.GithubInstallation.ID == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ObjectMeta, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.GithubInstallation.ID(childComplexity), true + + case "GithubInstallation.nodeId": + if e.complexity.GithubInstallation.NodeID == nil { + break } - return graphql.Null - } - res := resTmp.(v11.ObjectMeta) - fc.Result = res - return ec.marshalNMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_HarborRobotUser_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "HarborRobotUser", - 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_Metadata_name(ctx, field) - case "namespace": - return ec.fieldContext_Metadata_namespace(ctx, field) - case "labels": - return ec.fieldContext_Metadata_labels(ctx, field) - case "annotations": - return ec.fieldContext_Metadata_annotations(ctx, field) - case "creationTimestamp": - return ec.fieldContext_Metadata_creationTimestamp(ctx, field) - case "deletionTimestamp": - return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) - case "generation": - return ec.fieldContext_Metadata_generation(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) - }, - } - return fc, nil -} + return e.complexity.GithubInstallation.NodeID(childComplexity), true -func (ec *executionContext) _HarborRobotUserSpec_accountName(ctx context.Context, field graphql.CollectedField, obj *v1.HarborUserAccountSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_HarborRobotUserSpec_accountName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "GithubInstallation.repositoriesUrl": + if e.complexity.GithubInstallation.RepositoriesURL == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.AccountName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.GithubInstallation.RepositoriesURL(childComplexity), true + + case "GithubInstallation.targetId": + if e.complexity.GithubInstallation.TargetID == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_HarborRobotUserSpec_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "HarborRobotUserSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.GithubInstallation.TargetID(childComplexity), true -func (ec *executionContext) _HarborRobotUserSpec_enabled(ctx context.Context, field graphql.CollectedField, obj *v1.HarborUserAccountSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_HarborRobotUserSpec_enabled(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "GithubInstallation.targetType": + if e.complexity.GithubInstallation.TargetType == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Enabled, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalOBoolean2bool(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_HarborRobotUserSpec_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "HarborRobotUserSpec", - 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 -} + return e.complexity.GithubInstallation.TargetType(childComplexity), true -func (ec *executionContext) _HarborRobotUserSpec_harborProjectName(ctx context.Context, field graphql.CollectedField, obj *v1.HarborUserAccountSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_HarborRobotUserSpec_harborProjectName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "GithubListRepository.repositories": + if e.complexity.GithubListRepository.Repositories == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.HarborProjectName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.GithubListRepository.Repositories(childComplexity), true + + case "GithubListRepository.totalCount": + if e.complexity.GithubListRepository.TotalCount == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_HarborRobotUserSpec_harborProjectName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "HarborRobotUserSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.GithubListRepository.TotalCount(childComplexity), true -func (ec *executionContext) _HarborRobotUserSpec_permissions(ctx context.Context, field graphql.CollectedField, obj *v1.HarborUserAccountSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_HarborRobotUserSpec_permissions(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "GithubSearchRepository.incompleteResults": + if e.complexity.GithubSearchRepository.IncompleteResults == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.HarborRobotUserSpec().Permissions(rctx, obj) - }) - 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_HarborRobotUserSpec_permissions(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "HarborRobotUserSpec", - 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 -} + return e.complexity.GithubSearchRepository.IncompleteResults(childComplexity), true -func (ec *executionContext) _HarborRobotUserSpec_targetSecret(ctx context.Context, field graphql.CollectedField, obj *v1.HarborUserAccountSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_HarborRobotUserSpec_targetSecret(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "GithubSearchRepository.repositories": + if e.complexity.GithubSearchRepository.Repositories == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.TargetSecret, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_HarborRobotUserSpec_targetSecret(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "HarborRobotUserSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.GithubSearchRepository.Repositories(childComplexity), true -func (ec *executionContext) _ImageTag_name(ctx context.Context, field graphql.CollectedField, obj *harbor1.ImageTag) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ImageTag_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 + case "GithubSearchRepository.total": + if e.complexity.GithubSearchRepository.Total == nil { + break } - }() - 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 e.complexity.GithubSearchRepository.Total(childComplexity), true + + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration.unit": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration.Unit == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_ImageTag_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ImageTag", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration.Unit(childComplexity), true -func (ec *executionContext) _ImageTag_signed(ctx context.Context, field graphql.CollectedField, obj *harbor1.ImageTag) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ImageTag_signed(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration.value": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration.Value == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Signed, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration.Value(childComplexity), true + + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource.branch": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource.Branch == nil { + break } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_ImageTag_signed(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ImageTag", - 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 -} + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource.Branch(childComplexity), true -func (ec *executionContext) _ImageTag_immutable(ctx context.Context, field graphql.CollectedField, obj *harbor1.ImageTag) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ImageTag_immutable(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource.provider": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource.Provider == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Immutable, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource.Provider(childComplexity), true + + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource.repository": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource.Repository == nil { + break } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_ImageTag_immutable(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ImageTag", - 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 -} + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource.Repository(childComplexity), true -func (ec *executionContext) _ImageTag_pushedAt(ctx context.Context, field graphql.CollectedField, obj *harbor1.ImageTag) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ImageTag_pushedAt(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource.webhookId": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource.WebhookID == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.ImageTag().PushedAt(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 e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource.WebhookID(childComplexity), true + + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.archived": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.Archived == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_ImageTag_pushedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ImageTag", - 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 -} + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.Archived(childComplexity), true -func (ec *executionContext) _Metadata_name(ctx context.Context, field graphql.CollectedField, obj *v11.ObjectMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Metadata_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 + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.cloneUrl": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.CloneURL == nil { + break } - }() - 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 e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.CloneURL(childComplexity), true + + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.createdAt": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.CreatedAt == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Metadata_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Metadata", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.CreatedAt(childComplexity), true -func (ec *executionContext) _Metadata_namespace(ctx context.Context, field graphql.CollectedField, obj *v11.ObjectMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Metadata_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 + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.defaultBranch": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.DefaultBranch == nil { + break } - }() - 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 { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Metadata_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Metadata", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.DefaultBranch(childComplexity), true -func (ec *executionContext) _Metadata_labels(ctx context.Context, field graphql.CollectedField, obj *v11.ObjectMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Metadata_labels(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.description": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.Description == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Metadata().Labels(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOJson2map(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Metadata_labels(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Metadata", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Json does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.Description(childComplexity), true -func (ec *executionContext) _Metadata_annotations(ctx context.Context, field graphql.CollectedField, obj *v11.ObjectMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Metadata_annotations(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.disabled": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.Disabled == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Metadata().Annotations(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOJson2map(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Metadata_annotations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Metadata", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Json does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.Disabled(childComplexity), true -func (ec *executionContext) _Metadata_creationTimestamp(ctx context.Context, field graphql.CollectedField, obj *v11.ObjectMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Metadata_creationTimestamp(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Metadata().CreationTimestamp(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") + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.fullName": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.FullName == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNDate2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Metadata_creationTimestamp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Metadata", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Date does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.FullName(childComplexity), true -func (ec *executionContext) _Metadata_deletionTimestamp(ctx context.Context, field graphql.CollectedField, obj *v11.ObjectMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Metadata_deletionTimestamp(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.gitUrl": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.GitURL == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Metadata().DeletionTimestamp(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalODate2ᚖstring(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Metadata_deletionTimestamp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Metadata", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Date does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.GitURL(childComplexity), true -func (ec *executionContext) _Metadata_generation(ctx context.Context, field graphql.CollectedField, obj *v11.ObjectMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Metadata_generation(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.gitignoreTemplate": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.GitignoreTemplate == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Generation, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.GitignoreTemplate(childComplexity), true + + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.htmlUrl": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.HTMLURL == nil { + break } - return graphql.Null - } - res := resTmp.(int64) - fc.Result = res - return ec.marshalNInt2int64(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Metadata_generation(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Metadata", - 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 -} + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.HTMLURL(childComplexity), true -func (ec *executionContext) _Mutation_cr_createRobot(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_cr_createRobot(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.id": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.ID == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CrCreateRobot(rctx, fc.Args["robotUser"].(entities.HarborRobotUser)) + + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.ID(childComplexity), true + + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.language": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.Language == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive0) + + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.Language(childComplexity), true + + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.masterBranch": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.MasterBranch == nil { + break } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive1) - } - directive3 := func(ctx context.Context) (interface{}, error) { - action, err := ec.unmarshalOString2ᚖstring(ctx, "write-container-registry") - if err != nil { - return nil, err - } - if ec.directives.CanActOnAccount == nil { - return nil, errors.New("directive canActOnAccount is not implemented") - } - return ec.directives.CanActOnAccount(ctx, nil, directive2, action) + + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.MasterBranch(childComplexity), true + + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.mirrorUrl": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.MirrorURL == nil { + break } - tmp, err := directive3(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.MirrorURL(childComplexity), true + + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.name": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.Name == nil { + break } - if tmp == nil { - return nil, nil + + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.Name(childComplexity), true + + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.node_id": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.NodeID == nil { + break } - if data, ok := tmp.(*entities.HarborRobotUser); ok { - return data, nil + + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.NodeID(childComplexity), true + + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.permissions": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.Permissions == nil { + break } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/container-registry/internal/domain/entities.HarborRobotUser`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*entities.HarborRobotUser) - fc.Result = res - return ec.marshalOHarborRobotUser2ᚖkloudliteᚗioᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐHarborRobotUser(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Mutation_cr_createRobot(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 "syncStatus": - return ec.fieldContext_HarborRobotUser_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_HarborRobotUser_spec(ctx, field) - case "status": - return ec.fieldContext_HarborRobotUser_status(ctx, field) - case "apiVersion": - return ec.fieldContext_HarborRobotUser_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_HarborRobotUser_kind(ctx, field) - case "metadata": - return ec.fieldContext_HarborRobotUser_metadata(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type HarborRobotUser", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.Permissions(childComplexity), true + + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.private": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.Private == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_cr_createRobot_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _Mutation_cr_updateRobot(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_cr_updateRobot(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.Private(childComplexity), true + + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.pushedAt": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.PushedAt == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CrUpdateRobot(rctx, fc.Args["name"].(string), fc.Args["permissions"].([]harbor.Permission)) + + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.PushedAt(childComplexity), true + + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.size": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.Size == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive0) + + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.Size(childComplexity), true + + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.team_id": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.TeamID == nil { + break } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive1) + + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.TeamID(childComplexity), true + + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.url": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.URL == nil { + break } - directive3 := func(ctx context.Context) (interface{}, error) { - action, err := ec.unmarshalOString2ᚖstring(ctx, "write-container-registry") - if err != nil { - return nil, err - } - if ec.directives.CanActOnAccount == nil { - return nil, errors.New("directive canActOnAccount is not implemented") - } - return ec.directives.CanActOnAccount(ctx, nil, directive2, action) + + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.URL(childComplexity), true + + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.updatedAt": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.UpdatedAt == nil { + break } - tmp, err := directive3(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.UpdatedAt(childComplexity), true + + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.visibility": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.Visibility == nil { + break } - if tmp == nil { - return nil, nil + + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository.Visibility(childComplexity), true + + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount.avatarUrl": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount.AvatarURL == nil { + break } - if data, ok := tmp.(*entities.HarborRobotUser); ok { - return data, nil + + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount.AvatarURL(childComplexity), true + + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount.id": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount.ID == nil { + break } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/container-registry/internal/domain/entities.HarborRobotUser`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*entities.HarborRobotUser) - fc.Result = res - return ec.marshalOHarborRobotUser2ᚖkloudliteᚗioᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐHarborRobotUser(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Mutation_cr_updateRobot(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 "syncStatus": - return ec.fieldContext_HarborRobotUser_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_HarborRobotUser_spec(ctx, field) - case "status": - return ec.fieldContext_HarborRobotUser_status(ctx, field) - case "apiVersion": - return ec.fieldContext_HarborRobotUser_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_HarborRobotUser_kind(ctx, field) - case "metadata": - return ec.fieldContext_HarborRobotUser_metadata(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type HarborRobotUser", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount.ID(childComplexity), true + + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount.login": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount.Login == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_cr_updateRobot_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _Mutation_cr_deleteRobot(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_cr_deleteRobot(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount.Login(childComplexity), true + + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount.nodeId": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount.NodeID == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CrDeleteRobot(rctx, fc.Args["robotId"].(int)) + + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount.NodeID(childComplexity), true + + case "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount.type": + if e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount.Type == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive0) + + return e.complexity.Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount.Type(childComplexity), true + + case "Github__com___kloudlite___api___common__CreatedOrUpdatedBy.userEmail": + if e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserEmail == nil { + break } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive1) + + return e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserEmail(childComplexity), true + + case "Github__com___kloudlite___api___common__CreatedOrUpdatedBy.userId": + if e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserID == nil { + break } - directive3 := func(ctx context.Context) (interface{}, error) { - action, err := ec.unmarshalOString2ᚖstring(ctx, "write-container-registry") - if err != nil { - return nil, err - } - if ec.directives.CanActOnAccount == nil { - return nil, errors.New("directive canActOnAccount is not implemented") - } - return ec.directives.CanActOnAccount(ctx, nil, directive2, action) + + return e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserID(childComplexity), true + + case "Github__com___kloudlite___api___common__CreatedOrUpdatedBy.userName": + if e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserName == nil { + break } - tmp, err := directive3(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserName(childComplexity), true + + case "Github__com___kloudlite___api___pkg___types__SyncStatus.action": + if e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.Action == nil { + break } - if tmp == nil { - return nil, nil + + return e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.Action(childComplexity), true + + case "Github__com___kloudlite___api___pkg___types__SyncStatus.error": + if e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.Error == nil { + break } - if data, ok := tmp.(bool); ok { - return data, nil + + return e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.Error(childComplexity), true + + case "Github__com___kloudlite___api___pkg___types__SyncStatus.lastSyncedAt": + if e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.LastSyncedAt == nil { + break } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.LastSyncedAt(childComplexity), true + + case "Github__com___kloudlite___api___pkg___types__SyncStatus.recordVersion": + if e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.RecordVersion == nil { + break } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Mutation_cr_deleteRobot(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) + return e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.RecordVersion(childComplexity), true + + case "Github__com___kloudlite___api___pkg___types__SyncStatus.state": + if e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.State == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_cr_deleteRobot_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _Mutation_cr_resyncRobot(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_cr_resyncRobot(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.State(childComplexity), true + + case "Github__com___kloudlite___api___pkg___types__SyncStatus.syncScheduledAt": + if e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.SyncScheduledAt == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CrResyncRobot(rctx, fc.Args["name"].(string)) + + return e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.SyncScheduledAt(childComplexity), true + + case "Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions.buildArgs": + if e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions.BuildArgs == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive0) + + return e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions.BuildArgs(childComplexity), true + + case "Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions.buildContexts": + if e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions.BuildContexts == nil { + break } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive1) + + return e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions.BuildContexts(childComplexity), true + + case "Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions.contextDir": + if e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions.ContextDir == nil { + break } - directive3 := func(ctx context.Context) (interface{}, error) { - action, err := ec.unmarshalOString2ᚖstring(ctx, "write-container-registry") - if err != nil { - return nil, err - } - if ec.directives.CanActOnAccount == nil { - return nil, errors.New("directive canActOnAccount is not implemented") - } - return ec.directives.CanActOnAccount(ctx, nil, directive2, action) + + return e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions.ContextDir(childComplexity), true + + case "Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions.dockerfileContent": + if e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions.DockerfileContent == nil { + break } - tmp, err := directive3(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions.DockerfileContent(childComplexity), true + + case "Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions.dockerfilePath": + if e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions.DockerfilePath == nil { + break } - if tmp == nil { - return nil, nil + + return e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions.DockerfilePath(childComplexity), true + + case "Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions.targetPlatforms": + if e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions.TargetPlatforms == nil { + break } - if data, ok := tmp.(bool); ok { - return data, nil + + return e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions.TargetPlatforms(childComplexity), true + + case "Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec.accountName": + if e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec.AccountName == nil { + break } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec.AccountName(childComplexity), true + + case "Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec.buildOptions": + if e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec.BuildOptions == nil { + break } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Mutation_cr_resyncRobot(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) + return e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec.BuildOptions(childComplexity), true + + case "Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec.cacheKeyName": + if e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec.CacheKeyName == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_cr_resyncRobot_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _Mutation_cr_deleteRepo(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_cr_deleteRepo(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec.CacheKeyName(childComplexity), true + + case "Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec.registry": + if e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec.Registry == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CrDeleteRepo(rctx, fc.Args["repoId"].(int)) + + return e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec.Registry(childComplexity), true + + case "Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec.resource": + if e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec.Resource == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive0) + + return e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec.Resource(childComplexity), true + + case "Github__com___kloudlite___operator___apis___distribution___v1__Registry.repo": + if e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__Registry.Repo == nil { + break } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive1) + + return e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__Registry.Repo(childComplexity), true + + case "Github__com___kloudlite___operator___apis___distribution___v1__Repo.name": + if e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__Repo.Name == nil { + break } - directive3 := func(ctx context.Context) (interface{}, error) { - action, err := ec.unmarshalOString2ᚖstring(ctx, "write-container-registry") - if err != nil { - return nil, err - } - if ec.directives.CanActOnAccount == nil { - return nil, errors.New("directive canActOnAccount is not implemented") - } - return ec.directives.CanActOnAccount(ctx, nil, directive2, action) + + return e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__Repo.Name(childComplexity), true + + case "Github__com___kloudlite___operator___apis___distribution___v1__Repo.tags": + if e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__Repo.Tags == nil { + break } - tmp, err := directive3(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__Repo.Tags(childComplexity), true + + case "Github__com___kloudlite___operator___apis___distribution___v1__Resource.cpu": + if e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__Resource.CPU == nil { + break } - if tmp == nil { - return nil, nil + + return e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__Resource.CPU(childComplexity), true + + case "Github__com___kloudlite___operator___apis___distribution___v1__Resource.memoryInMb": + if e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__Resource.MemoryInMb == nil { + break } - if data, ok := tmp.(bool); ok { - return data, nil + + return e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__Resource.MemoryInMb(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__Check.generation": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Generation == nil { + break } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Generation(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__Check.message": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Message == nil { + break } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Mutation_cr_deleteRepo(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) + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Message(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__Check.status": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Status == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_cr_deleteRepo_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _Overrides_applied(ctx context.Context, field graphql.CollectedField, obj *v12.JsonPatch) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Overrides_applied(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Status(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__ResourceRef.apiVersion": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.APIVersion == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Applied, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalOBoolean2bool(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Overrides_applied(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Overrides", - 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 -} + return e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.APIVersion(childComplexity), true -func (ec *executionContext) _Overrides_patches(ctx context.Context, field graphql.CollectedField, obj *v12.JsonPatch) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Overrides_patches(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Github__com___kloudlite___operator___pkg___operator__ResourceRef.kind": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.Kind == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Patches, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]json_patch.PatchOperation) - fc.Result = res - return ec.marshalOPatch2ᚕgithubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋjsonᚑpatchᚐPatchOperationᚄ(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Overrides_patches(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Overrides", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "op": - return ec.fieldContext_Patch_op(ctx, field) - case "path": - return ec.fieldContext_Patch_path(ctx, field) - case "value": - return ec.fieldContext_Patch_value(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Patch", field.Name) - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.Kind(childComplexity), true -func (ec *executionContext) _Patch_op(ctx context.Context, field graphql.CollectedField, obj *json_patch.PatchOperation) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Patch_op(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Github__com___kloudlite___operator___pkg___operator__ResourceRef.name": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.Name == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Op, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.Name(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__ResourceRef.namespace": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.Namespace == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Patch_op(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Patch", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.Namespace(childComplexity), true -func (ec *executionContext) _Patch_path(ctx context.Context, field graphql.CollectedField, obj *json_patch.PatchOperation) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Patch_path(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Github__com___kloudlite___operator___pkg___operator__Status.checks": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.Checks == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Path, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.Checks(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__Status.isReady": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.IsReady == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Patch_path(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Patch", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.IsReady(childComplexity), true -func (ec *executionContext) _Patch_value(ctx context.Context, field graphql.CollectedField, obj *json_patch.PatchOperation) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Patch_value(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Github__com___kloudlite___operator___pkg___operator__Status.lastReadyGeneration": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.LastReadyGeneration == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Patch().Value(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(interface{}) - fc.Result = res - return ec.marshalOAny2interface(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Patch_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Patch", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Any does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.LastReadyGeneration(childComplexity), true -func (ec *executionContext) _Query_cr_listRepos(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_cr_listRepos(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Github__com___kloudlite___operator___pkg___operator__Status.lastReconcileTime": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.LastReconcileTime == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CrListRepos(rctx) + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.LastReconcileTime(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__Status.message": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.Message == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive0) + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.Message(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__Status.resources": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.Resources == nil { + break } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive1) + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.Resources(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___raw____json__RawJson.RawMessage": + if e.complexity.Github__com___kloudlite___operator___pkg___raw____json__RawJson.RawMessage == nil { + break } - directive3 := func(ctx context.Context) (interface{}, error) { - action, err := ec.unmarshalOString2ᚖstring(ctx, "read-container-registry") - if err != nil { - return nil, err - } - if ec.directives.CanActOnAccount == nil { - return nil, errors.New("directive canActOnAccount is not implemented") - } - return ec.directives.CanActOnAccount(ctx, nil, directive2, action) + + return e.complexity.Github__com___kloudlite___operator___pkg___raw____json__RawJson.RawMessage(childComplexity), true + + case "GitlabBranch.canPush": + if e.complexity.GitlabBranch.CanPush == nil { + break } - tmp, err := directive3(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return e.complexity.GitlabBranch.CanPush(childComplexity), true + + case "GitlabBranch.default": + if e.complexity.GitlabBranch.Default == nil { + break } - if tmp == nil { - return nil, nil + + return e.complexity.GitlabBranch.Default(childComplexity), true + + case "GitlabBranch.developersCanMerge": + if e.complexity.GitlabBranch.DevelopersCanMerge == nil { + break } - if data, ok := tmp.([]*harbor1.Repository); ok { - return data, nil + + return e.complexity.GitlabBranch.DevelopersCanMerge(childComplexity), true + + case "GitlabBranch.developersCanPush": + if e.complexity.GitlabBranch.DevelopersCanPush == nil { + break } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*kloudlite.io/pkg/harbor.Repository`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.GitlabBranch.DevelopersCanPush(childComplexity), true + + case "GitlabBranch.merged": + if e.complexity.GitlabBranch.Merged == nil { + break } - return graphql.Null - } - res := resTmp.([]*harbor1.Repository) - fc.Result = res - return ec.marshalNRepo2ᚕᚖkloudliteᚗioᚋpkgᚋharborᚐRepositoryᚄ(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Query_cr_listRepos(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_Repo_id(ctx, field) - case "name": - return ec.fieldContext_Repo_name(ctx, field) - case "artifactCount": - return ec.fieldContext_Repo_artifactCount(ctx, field) - case "pullCount": - return ec.fieldContext_Repo_pullCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Repo", field.Name) - }, - } - return fc, nil -} + return e.complexity.GitlabBranch.Merged(childComplexity), true -func (ec *executionContext) _Query_cr_listArtifacts(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_cr_listArtifacts(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "GitlabBranch.name": + if e.complexity.GitlabBranch.Name == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CrListArtifacts(rctx, fc.Args["repoName"].(string)) + + return e.complexity.GitlabBranch.Name(childComplexity), true + + case "GitlabBranch.protected": + if e.complexity.GitlabBranch.Protected == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive0) + + return e.complexity.GitlabBranch.Protected(childComplexity), true + + case "GitlabBranch.webUrl": + if e.complexity.GitlabBranch.WebURL == nil { + break } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive1) + + return e.complexity.GitlabBranch.WebURL(childComplexity), true + + case "GitlabGroup.avatarUrl": + if e.complexity.GitlabGroup.AvatarUrl == nil { + break } - directive3 := func(ctx context.Context) (interface{}, error) { - action, err := ec.unmarshalOString2ᚖstring(ctx, "read-container-registry") - if err != nil { - return nil, err - } - if ec.directives.CanActOnAccount == nil { - return nil, errors.New("directive canActOnAccount is not implemented") - } - return ec.directives.CanActOnAccount(ctx, nil, directive2, action) + + return e.complexity.GitlabGroup.AvatarUrl(childComplexity), true + + case "GitlabGroup.fullName": + if e.complexity.GitlabGroup.FullName == nil { + break } - tmp, err := directive3(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return e.complexity.GitlabGroup.FullName(childComplexity), true + + case "GitlabGroup.id": + if e.complexity.GitlabGroup.Id == nil { + break } - if tmp == nil { - return nil, nil + + return e.complexity.GitlabGroup.Id(childComplexity), true + + case "GitlabProject.archived": + if e.complexity.GitlabProject.Archived == nil { + break } - if data, ok := tmp.([]*harbor1.Artifact); ok { - return data, nil + + return e.complexity.GitlabProject.Archived(childComplexity), true + + case "GitlabProject.avatarUrl": + if e.complexity.GitlabProject.AvatarURL == nil { + break } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*kloudlite.io/pkg/harbor.Artifact`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.GitlabProject.AvatarURL(childComplexity), true + + case "GitlabProject.createdAt": + if e.complexity.GitlabProject.CreatedAt == nil { + break } - return graphql.Null - } - res := resTmp.([]*harbor1.Artifact) - fc.Result = res - return ec.marshalNArtifact2ᚕᚖkloudliteᚗioᚋpkgᚋharborᚐArtifactᚄ(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Query_cr_listArtifacts(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 "size": - return ec.fieldContext_Artifact_size(ctx, field) - case "tags": - return ec.fieldContext_Artifact_tags(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Artifact", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + return e.complexity.GitlabProject.CreatedAt(childComplexity), true + + case "GitlabProject.creatorId": + if e.complexity.GitlabProject.CreatorID == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_cr_listArtifacts_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _Query_cr_listRobots(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_cr_listRobots(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.GitlabProject.CreatorID(childComplexity), true + + case "GitlabProject.defaultBranch": + if e.complexity.GitlabProject.DefaultBranch == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CrListRobots(rctx) + + return e.complexity.GitlabProject.DefaultBranch(childComplexity), true + + case "GitlabProject.description": + if e.complexity.GitlabProject.Description == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive0) + + return e.complexity.GitlabProject.Description(childComplexity), true + + case "GitlabProject.emptyRepo": + if e.complexity.GitlabProject.EmptyRepo == nil { + break } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive1) + + return e.complexity.GitlabProject.EmptyRepo(childComplexity), true + + case "GitlabProject.httpUrlToRepo": + if e.complexity.GitlabProject.HTTPURLToRepo == nil { + break } - directive3 := func(ctx context.Context) (interface{}, error) { - action, err := ec.unmarshalOString2ᚖstring(ctx, "read-container-registry") - if err != nil { - return nil, err - } - if ec.directives.CanActOnAccount == nil { - return nil, errors.New("directive canActOnAccount is not implemented") - } - return ec.directives.CanActOnAccount(ctx, nil, directive2, action) + + return e.complexity.GitlabProject.HTTPURLToRepo(childComplexity), true + + case "GitlabProject.id": + if e.complexity.GitlabProject.ID == nil { + break } - tmp, err := directive3(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return e.complexity.GitlabProject.ID(childComplexity), true + + case "GitlabProject.lastActivityAt": + if e.complexity.GitlabProject.LastActivityAt == nil { + break } - if tmp == nil { - return nil, nil + + return e.complexity.GitlabProject.LastActivityAt(childComplexity), true + + case "GitlabProject.name": + if e.complexity.GitlabProject.Name == nil { + break } - if data, ok := tmp.([]*entities.HarborRobotUser); ok { - return data, nil + + return e.complexity.GitlabProject.Name(childComplexity), true + + case "GitlabProject.nameWithNamespace": + if e.complexity.GitlabProject.NameWithNamespace == nil { + break } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*kloudlite.io/apps/container-registry/internal/domain/entities.HarborRobotUser`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.GitlabProject.NameWithNamespace(childComplexity), true + + case "GitlabProject.path": + if e.complexity.GitlabProject.Path == nil { + break } - return graphql.Null - } - res := resTmp.([]*entities.HarborRobotUser) - fc.Result = res - return ec.marshalNHarborRobotUser2ᚕᚖkloudliteᚗioᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐHarborRobotUserᚄ(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Query_cr_listRobots(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 "syncStatus": - return ec.fieldContext_HarborRobotUser_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_HarborRobotUser_spec(ctx, field) - case "status": - return ec.fieldContext_HarborRobotUser_status(ctx, field) - case "apiVersion": - return ec.fieldContext_HarborRobotUser_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_HarborRobotUser_kind(ctx, field) - case "metadata": - return ec.fieldContext_HarborRobotUser_metadata(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type HarborRobotUser", field.Name) - }, - } - return fc, nil -} + return e.complexity.GitlabProject.Path(childComplexity), true -func (ec *executionContext) _Query__service(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query__service(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "GitlabProject.pathWithNamespace": + if e.complexity.GitlabProject.PathWithNamespace == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.__resolve__service(ctx) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.GitlabProject.PathWithNamespace(childComplexity), true + + case "GitlabProject.public": + if e.complexity.GitlabProject.Public == nil { + break } - return graphql.Null - } - res := resTmp.(fedruntime.Service) - fc.Result = res - return ec.marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Query__service(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 "sdl": - return ec.fieldContext__Service_sdl(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type _Service", field.Name) - }, - } - return fc, nil -} + return e.complexity.GitlabProject.Public(childComplexity), true -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 + case "GitlabProject.sshUrlToRepo": + if e.complexity.GitlabProject.SSHURLToRepo == nil { + break } - }() - 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) + return e.complexity.GitlabProject.SSHURLToRepo(childComplexity), true + + case "GitlabProject.tagList": + if e.complexity.GitlabProject.TagList == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query___schema(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.GitlabProject.TagList(childComplexity), true + + case "GitlabProject.topics": + if e.complexity.GitlabProject.Topics == nil { + break } - }() - 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(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 "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 -} + return e.complexity.GitlabProject.Topics(childComplexity), true -func (ec *executionContext) _Repo_id(ctx context.Context, field graphql.CollectedField, obj *harbor1.Repository) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Repo_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 + case "GitlabProject.webUrl": + if e.complexity.GitlabProject.WebURL == nil { + break } - }() - 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 e.complexity.GitlabProject.WebURL(childComplexity), true + + case "MatchFilter.array": + if e.complexity.MatchFilter.Array == nil { + break } - return graphql.Null - } - res := resTmp.(int) - fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Repo_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Repo", - 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 -} + return e.complexity.MatchFilter.Array(childComplexity), true -func (ec *executionContext) _Repo_name(ctx context.Context, field graphql.CollectedField, obj *harbor1.Repository) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Repo_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 + case "MatchFilter.exact": + if e.complexity.MatchFilter.Exact == nil { + break } - }() - 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 e.complexity.MatchFilter.Exact(childComplexity), true + + case "MatchFilter.matchType": + if e.complexity.MatchFilter.MatchType == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Repo_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Repo", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.MatchFilter.MatchType(childComplexity), true -func (ec *executionContext) _Repo_artifactCount(ctx context.Context, field graphql.CollectedField, obj *harbor1.Repository) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Repo_artifactCount(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "MatchFilter.regex": + if e.complexity.MatchFilter.Regex == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ArtifactCount, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.MatchFilter.Regex(childComplexity), true + + case "Metadata.annotations": + if e.complexity.Metadata.Annotations == nil { + break } - return graphql.Null - } - res := resTmp.(int) - fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Repo_artifactCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Repo", - 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 -} + return e.complexity.Metadata.Annotations(childComplexity), true -func (ec *executionContext) _Repo_pullCount(ctx context.Context, field graphql.CollectedField, obj *harbor1.Repository) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Repo_pullCount(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Metadata.creationTimestamp": + if e.complexity.Metadata.CreationTimestamp == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.PullCount, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.Metadata.CreationTimestamp(childComplexity), true + + case "Metadata.deletionTimestamp": + if e.complexity.Metadata.DeletionTimestamp == nil { + break } - return graphql.Null - } - res := resTmp.(int) - fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Repo_pullCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Repo", - 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 -} + return e.complexity.Metadata.DeletionTimestamp(childComplexity), true -func (ec *executionContext) _Status_isReady(ctx context.Context, field graphql.CollectedField, obj *operator.Status) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Status_isReady(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Metadata.generation": + if e.complexity.Metadata.Generation == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.IsReady, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.Metadata.Generation(childComplexity), true + + case "Metadata.labels": + if e.complexity.Metadata.Labels == nil { + break } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Status_isReady(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Status", - 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 -} + return e.complexity.Metadata.Labels(childComplexity), true -func (ec *executionContext) _Status_checks(ctx context.Context, field graphql.CollectedField, obj *operator.Status) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Status_checks(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Metadata.name": + if e.complexity.Metadata.Name == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Status().Checks(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Status_checks(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Status", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Metadata.Name(childComplexity), true -func (ec *executionContext) _Status_displayVars(ctx context.Context, field graphql.CollectedField, obj *operator.Status) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Status_displayVars(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Metadata.namespace": + if e.complexity.Metadata.Namespace == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Status().DisplayVars(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOJson2map(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Status_displayVars(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Status", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Json does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Metadata.Namespace(childComplexity), true -func (ec *executionContext) _SyncStatus_syncScheduledAt(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SyncStatus_syncScheduledAt(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Mutation.cr_addBuild": + if e.complexity.Mutation.CrAddBuild == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.SyncStatus().SyncScheduledAt(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") + + args, err := ec.field_Mutation_cr_addBuild_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNDate2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_SyncStatus_syncScheduledAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "SyncStatus", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Date does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Mutation.CrAddBuild(childComplexity, args["build"].(entities.Build)), true -func (ec *executionContext) _SyncStatus_lastSyncedAt(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SyncStatus_lastSyncedAt(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Mutation.cr_addBuildCacheKey": + if e.complexity.Mutation.CrAddBuildCacheKey == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.SyncStatus().LastSyncedAt(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalODate2ᚖstring(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_SyncStatus_lastSyncedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "SyncStatus", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Date does not have child fields") - }, - } - return fc, nil -} + args, err := ec.field_Mutation_cr_addBuildCacheKey_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -func (ec *executionContext) _SyncStatus_action(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SyncStatus_action(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.Mutation.CrAddBuildCacheKey(childComplexity, args["buildCacheKey"].(entities.BuildCacheKey)), true + + case "Mutation.cr_createCred": + if e.complexity.Mutation.CrCreateCred == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Action, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + args, err := ec.field_Mutation_cr_createCred_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - return graphql.Null - } - res := resTmp.(types.SyncAction) - fc.Result = res - return ec.marshalNSyncAction2kloudliteᚗioᚋpkgᚋtypesᚐSyncAction(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_SyncStatus_action(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "SyncStatus", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type SyncAction does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Mutation.CrCreateCred(childComplexity, args["credential"].(entities.Credential)), true -func (ec *executionContext) _SyncStatus_generation(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SyncStatus_generation(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Mutation.cr_createRepo": + if e.complexity.Mutation.CrCreateRepo == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Generation, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + args, err := ec.field_Mutation_cr_createRepo_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - return graphql.Null - } - res := resTmp.(int64) - fc.Result = res - return ec.marshalNInt2int64(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_SyncStatus_generation(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "SyncStatus", - 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 -} + return e.complexity.Mutation.CrCreateRepo(childComplexity, args["repository"].(entities.Repository)), true -func (ec *executionContext) _SyncStatus_state(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SyncStatus_state(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Mutation.cr_deleteBuild": + if e.complexity.Mutation.CrDeleteBuild == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.State, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + args, err := ec.field_Mutation_cr_deleteBuild_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - return graphql.Null - } - res := resTmp.(types.SyncState) - fc.Result = res - return ec.marshalNSyncState2kloudliteᚗioᚋpkgᚋtypesᚐSyncState(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_SyncStatus_state(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "SyncStatus", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type SyncState does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Mutation.CrDeleteBuild(childComplexity, args["id"].(repos.ID)), true -func (ec *executionContext) _SyncStatus_error(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SyncStatus_error(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Mutation.cr_deleteBuildCacheKey": + if e.complexity.Mutation.CrDeleteBuildCacheKey == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Error, nil - }) - 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_SyncStatus_error(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "SyncStatus", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + args, err := ec.field_Mutation_cr_deleteBuildCacheKey_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -func (ec *executionContext) __Service_sdl(ctx context.Context, field graphql.CollectedField, obj *fedruntime.Service) (ret graphql.Marshaler) { - fc, err := ec.fieldContext__Service_sdl(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.Mutation.CrDeleteBuildCacheKey(childComplexity, args["id"].(repos.ID)), true + + case "Mutation.cr_deleteCred": + if e.complexity.Mutation.CrDeleteCred == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SDL, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext__Service_sdl(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "_Service", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + args, err := ec.field_Mutation_cr_deleteCred_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -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 + return e.complexity.Mutation.CrDeleteCred(childComplexity, args["username"].(string)), true + + case "Mutation.cr_deleteDigest": + if e.complexity.Mutation.CrDeleteDigest == nil { + break } - }() - 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") + + args, err := ec.field_Mutation_cr_deleteDigest_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___Directive_name(ctx 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 -} + return e.complexity.Mutation.CrDeleteDigest(childComplexity, args["repoName"].(string), args["digest"].(string)), true -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 + case "Mutation.cr_deleteRepo": + if e.complexity.Mutation.CrDeleteRepo == nil { + break } - }() - 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(ctx 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 -} + args, err := ec.field_Mutation_cr_deleteRepo_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -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 + return e.complexity.Mutation.CrDeleteRepo(childComplexity, args["name"].(string)), true + + case "Mutation.cr_listBuildsByBuildCacheId": + if e.complexity.Mutation.CrListBuildsByBuildCacheID == nil { + break } - }() - 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") + + args, err := ec.field_Mutation_cr_listBuildsByBuildCacheId_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - return graphql.Null - } - res := resTmp.([]string) - fc.Result = res - return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___Directive_locations(ctx 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 -} + return e.complexity.Mutation.CrListBuildsByBuildCacheID(childComplexity, args["buildCacheKeyId"].(repos.ID), args["pagination"].(*repos.CursorPagination)), true -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 + case "Mutation.cr_triggerBuild": + if e.complexity.Mutation.CrTriggerBuild == nil { + break } - }() - 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") + + args, err := ec.field_Mutation_cr_triggerBuild_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - 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(ctx 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 -} + return e.complexity.Mutation.CrTriggerBuild(childComplexity, args["id"].(repos.ID)), true -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 + case "Mutation.cr_updateBuild": + if e.complexity.Mutation.CrUpdateBuild == nil { + break } - }() - 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") + + args, err := ec.field_Mutation_cr_updateBuild_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___Directive_isRepeatable(ctx 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 -} + return e.complexity.Mutation.CrUpdateBuild(childComplexity, args["id"].(repos.ID), args["build"].(entities.Build)), true -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 + case "Mutation.cr_updateBuildCacheKey": + if e.complexity.Mutation.CrUpdateBuildCacheKey == nil { + break } - }() - 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") + + args, err := ec.field_Mutation_cr_updateBuildCacheKey_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___EnumValue_name(ctx 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 -} + return e.complexity.Mutation.CrUpdateBuildCacheKey(childComplexity, args["id"].(repos.ID), args["buildCacheKey"].(entities.BuildCacheKey)), true -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 + case "PageInfo.endCursor": + if e.complexity.PageInfo.EndCursor == nil { + break } - }() - 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(ctx 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 -} + return e.complexity.PageInfo.EndCursor(childComplexity), true -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 + case "PageInfo.hasNextPage": + if e.complexity.PageInfo.HasNextPage == nil { + break } - }() - 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 e.complexity.PageInfo.HasNextPage(childComplexity), true + + case "PageInfo.hasPreviousPage": + if e.complexity.PageInfo.HasPreviousPage == nil { + break } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___EnumValue_isDeprecated(ctx 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 -} + return e.complexity.PageInfo.HasPreviousPage(childComplexity), true -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 + case "PageInfo.startCursor": + if e.complexity.PageInfo.StartCursor == nil { + break } - }() - 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(ctx 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 -} + return e.complexity.PageInfo.StartCursor(childComplexity), true -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 + case "Pagination.page": + if e.complexity.Pagination.Page == nil { + break } - }() - 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 e.complexity.Pagination.Page(childComplexity), true + + case "Pagination.per_page": + if e.complexity.Pagination.PerPage == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___Field_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Pagination.PerPage(childComplexity), true -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 + case "Query.cr_checkUserNameAvailability": + if e.complexity.Query.CrCheckUserNameAvailability == nil { + break } - }() - 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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + args, err := ec.field_Query_cr_checkUserNameAvailability_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -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 + return e.complexity.Query.CrCheckUserNameAvailability(childComplexity, args["name"].(string)), true + + case "Query.cr_getBuild": + if e.complexity.Query.CrGetBuild == nil { + break } - }() - 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") + + args, err := ec.field_Query_cr_getBuild_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - 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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "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 -} + return e.complexity.Query.CrGetBuild(childComplexity, args["id"].(repos.ID)), true -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 + case "Query.cr_getBuildRun": + if e.complexity.Query.CrGetBuildRun == nil { + break } - }() - 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") + + args, err := ec.field_Query_cr_getBuildRun_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___Field_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} + return e.complexity.Query.CrGetBuildRun(childComplexity, args["repoName"].(string), args["buildRunName"].(string)), true -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 + case "Query.cr_getCredToken": + if e.complexity.Query.CrGetCredToken == nil { + break } - }() - 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") + + args, err := ec.field_Query_cr_getCredToken_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___Field_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Query.CrGetCredToken(childComplexity, args["username"].(string)), true -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 + case "Query.cr_listBuildCacheKeys": + if e.complexity.Query.CrListBuildCacheKeys == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DeprecationReason(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___Field_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + args, err := ec.field_Query_cr_listBuildCacheKeys_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -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 + return e.complexity.Query.CrListBuildCacheKeys(childComplexity, args["pq"].(*repos.CursorPagination), args["search"].(*model.SearchBuildCacheKeys)), true + + case "Query.cr_listBuildRuns": + if e.complexity.Query.CrListBuildRuns == nil { + break } - }() - 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") + + args, err := ec.field_Query_cr_listBuildRuns_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___InputValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Query.CrListBuildRuns(childComplexity, args["repoName"].(string), args["search"].(*model.SearchBuildRuns), args["pq"].(*repos.CursorPagination)), true -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 + case "Query.cr_listBuilds": + if e.complexity.Query.CrListBuilds == nil { + break } - }() - 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(ctx 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 -} + args, err := ec.field_Query_cr_listBuilds_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -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 + return e.complexity.Query.CrListBuilds(childComplexity, args["repoName"].(string), args["search"].(*model.SearchBuilds), args["pagination"].(*repos.CursorPagination)), true + + case "Query.cr_listCreds": + if e.complexity.Query.CrListCreds == nil { + break } - }() - 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") + + args, err := ec.field_Query_cr_listCreds_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - 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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - 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 -} + return e.complexity.Query.CrListCreds(childComplexity, args["search"].(*model.SearchCreds), args["pagination"].(*repos.CursorPagination)), true -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 + case "Query.cr_listDigests": + if e.complexity.Query.CrListDigests == nil { + break } - }() - 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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + args, err := ec.field_Query_cr_listDigests_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -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 + return e.complexity.Query.CrListDigests(childComplexity, args["repoName"].(string), args["search"].(*model.SearchRepos), args["pagination"].(*repos.CursorPagination)), true + + case "Query.cr_listGithubBranches": + if e.complexity.Query.CrListGithubBranches == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___Schema_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + args, err := ec.field_Query_cr_listGithubBranches_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -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 + return e.complexity.Query.CrListGithubBranches(childComplexity, args["repoUrl"].(string), args["pagination"].(*types.Pagination)), true + + case "Query.cr_listGithubInstallations": + if e.complexity.Query.CrListGithubInstallations == nil { + break } - }() - 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") + + args, err := ec.field_Query_cr_listGithubInstallations_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - return graphql.Null - } - res := resTmp.([]introspection.Type) - fc.Result = res - return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___Schema_types(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": + return e.complexity.Query.CrListGithubInstallations(childComplexity, args["pagination"].(*types.Pagination)), true + + case "Query.cr_listGithubRepos": + if e.complexity.Query.CrListGithubRepos == nil { + break + } + + args, err := ec.field_Query_cr_listGithubRepos_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.CrListGithubRepos(childComplexity, args["installationId"].(int), args["pagination"].(*types.Pagination)), true + + case "Query.cr_listGitlabBranches": + if e.complexity.Query.CrListGitlabBranches == nil { + break + } + + args, err := ec.field_Query_cr_listGitlabBranches_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.CrListGitlabBranches(childComplexity, args["repoId"].(string), args["query"].(*string), args["pagination"].(*types.Pagination)), true + + case "Query.cr_listGitlabGroups": + if e.complexity.Query.CrListGitlabGroups == nil { + break + } + + args, err := ec.field_Query_cr_listGitlabGroups_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.CrListGitlabGroups(childComplexity, args["query"].(*string), args["pagination"].(*types.Pagination)), true + + case "Query.cr_listGitlabRepositories": + if e.complexity.Query.CrListGitlabRepositories == nil { + break + } + + args, err := ec.field_Query_cr_listGitlabRepositories_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.CrListGitlabRepositories(childComplexity, args["groupId"].(string), args["query"].(*string), args["pagination"].(*types.Pagination)), true + + case "Query.cr_listRepos": + if e.complexity.Query.CrListRepos == nil { + break + } + + args, err := ec.field_Query_cr_listRepos_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.CrListRepos(childComplexity, args["search"].(*model.SearchRepos), args["pagination"].(*repos.CursorPagination)), true + + case "Query.cr_searchGithubRepos": + if e.complexity.Query.CrSearchGithubRepos == nil { + break + } + + args, err := ec.field_Query_cr_searchGithubRepos_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.CrSearchGithubRepos(childComplexity, args["organization"].(string), args["search"].(string), args["pagination"].(*types.Pagination)), true + + case "Query._service": + if e.complexity.Query.__resolve__service == nil { + break + } + + return e.complexity.Query.__resolve__service(childComplexity), true + + case "Repository.accountName": + if e.complexity.Repository.AccountName == nil { + break + } + + return e.complexity.Repository.AccountName(childComplexity), true + + case "Repository.createdBy": + if e.complexity.Repository.CreatedBy == nil { + break + } + + return e.complexity.Repository.CreatedBy(childComplexity), true + + case "Repository.creationTime": + if e.complexity.Repository.CreationTime == nil { + break + } + + return e.complexity.Repository.CreationTime(childComplexity), true + + case "Repository.id": + if e.complexity.Repository.ID == nil { + break + } + + return e.complexity.Repository.ID(childComplexity), true + + case "Repository.lastUpdatedBy": + if e.complexity.Repository.LastUpdatedBy == nil { + break + } + + return e.complexity.Repository.LastUpdatedBy(childComplexity), true + + case "Repository.markedForDeletion": + if e.complexity.Repository.MarkedForDeletion == nil { + break + } + + return e.complexity.Repository.MarkedForDeletion(childComplexity), true + + case "Repository.name": + if e.complexity.Repository.Name == nil { + break + } + + return e.complexity.Repository.Name(childComplexity), true + + case "Repository.recordVersion": + if e.complexity.Repository.RecordVersion == nil { + break + } + + return e.complexity.Repository.RecordVersion(childComplexity), true + + case "Repository.updateTime": + if e.complexity.Repository.UpdateTime == nil { + break + } + + return e.complexity.Repository.UpdateTime(childComplexity), true + + case "RepositoryEdge.cursor": + if e.complexity.RepositoryEdge.Cursor == nil { + break + } + + return e.complexity.RepositoryEdge.Cursor(childComplexity), true + + case "RepositoryEdge.node": + if e.complexity.RepositoryEdge.Node == nil { + break + } + + return e.complexity.RepositoryEdge.Node(childComplexity), true + + case "RepositoryPaginatedRecords.edges": + if e.complexity.RepositoryPaginatedRecords.Edges == nil { + break + } + + return e.complexity.RepositoryPaginatedRecords.Edges(childComplexity), true + + case "RepositoryPaginatedRecords.pageInfo": + if e.complexity.RepositoryPaginatedRecords.PageInfo == nil { + break + } + + return e.complexity.RepositoryPaginatedRecords.PageInfo(childComplexity), true + + case "RepositoryPaginatedRecords.totalCount": + if e.complexity.RepositoryPaginatedRecords.TotalCount == nil { + break + } + + return e.complexity.RepositoryPaginatedRecords.TotalCount(childComplexity), true + + case "_Service.sdl": + if e.complexity._Service.SDL == nil { + break + } + + return e.complexity._Service.SDL(childComplexity), true + + } + return 0, false +} + +func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { + rc := graphql.GetOperationContext(ctx) + ec := executionContext{rc, e} + inputUnmarshalMap := graphql.BuildUnmarshalerMap( + ec.unmarshalInputBuildCacheKeyIn, + ec.unmarshalInputBuildIn, + ec.unmarshalInputCredentialIn, + ec.unmarshalInputCursorPaginationIn, + ec.unmarshalInputGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationIn, + ec.unmarshalInputGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSourceIn, + ec.unmarshalInputGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccountIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___distribution___v1__BuildOptionsIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___distribution___v1__BuildRunSpecIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___distribution___v1__RegistryIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___distribution___v1__RepoIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___distribution___v1__ResourceIn, + ec.unmarshalInputGithub__com___kloudlite___operator___pkg___operator__CheckIn, + ec.unmarshalInputGithub__com___kloudlite___operator___pkg___operator__ResourceRefIn, + ec.unmarshalInputGithub__com___kloudlite___operator___pkg___operator__StatusIn, + ec.unmarshalInputGithub__com___kloudlite___operator___pkg___raw____json__RawJsonIn, + ec.unmarshalInputMatchFilterIn, + ec.unmarshalInputMetadataIn, + ec.unmarshalInputPaginationIn, + ec.unmarshalInputRepositoryIn, + ec.unmarshalInputSearchBuildCacheKeys, + ec.unmarshalInputSearchBuildRuns, + ec.unmarshalInputSearchBuilds, + ec.unmarshalInputSearchCreds, + ec.unmarshalInputSearchRepos, + ) + first := true + + switch rc.Operation.Operation { + case ast.Query: + return func(ctx context.Context) *graphql.Response { + if !first { + return nil + } + first = false + ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) + data := ec._Query(ctx, rc.Operation.SelectionSet) + var buf bytes.Buffer + data.MarshalGQL(&buf) + + return &graphql.Response{ + Data: buf.Bytes(), + } + } + 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 +} + +func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapSchema(parsedSchema), nil +} + +func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapTypeFromDef(parsedSchema, parsedSchema.Types[name]), nil +} + +var sources = []*ast.Source{ + {Name: "../schema.graphqls", Input: `directive @isLoggedInAndVerified on FIELD_DEFINITION +directive @hasAccount on FIELD_DEFINITION + +input SearchRepos { + text: MatchFilterIn +} + +input SearchCreds { + text: MatchFilterIn +} + +input SearchBuilds { + text: MatchFilterIn +} + +input SearchBuildRuns { + text: MatchFilterIn +} + +input SearchBuildCacheKeys { + text: MatchFilterIn +} + +type CRCheckNameAvailabilityOutput @shareable { + result: Boolean! + suggestedNames: [String!] +} + +type Query { + cr_listRepos(search:SearchRepos, pagination:CursorPaginationIn) : RepositoryPaginatedRecords @isLoggedInAndVerified @hasAccount + cr_listCreds(search:SearchCreds, pagination:CursorPaginationIn) : CredentialPaginatedRecords @isLoggedInAndVerified @hasAccount + cr_listDigests(repoName:String!, search: SearchRepos, pagination:CursorPaginationIn) : DigestPaginatedRecords @isLoggedInAndVerified @hasAccount + + cr_getCredToken(username:String!) : String! @isLoggedInAndVerified @hasAccount + + cr_checkUserNameAvailability(name:String!) :CRCheckNameAvailabilityOutput! @isLoggedInAndVerified @hasAccount + + cr_getBuild(id:ID!) : Build @isLoggedInAndVerified @hasAccount + cr_listBuilds(repoName:String!, search:SearchBuilds, pagination:CursorPaginationIn) : BuildPaginatedRecords @isLoggedInAndVerified @hasAccount + + cr_listGithubInstallations(pagination:PaginationIn) : [GithubInstallation!] @isLoggedInAndVerified + cr_listGithubRepos(installationId:Int!, pagination:PaginationIn) : GithubListRepository @isLoggedInAndVerified + cr_searchGithubRepos(organization:String!, search:String!, pagination:PaginationIn) : GithubSearchRepository @isLoggedInAndVerified + cr_listGithubBranches(repoUrl:String!, pagination:PaginationIn) : [GitBranch!] @isLoggedInAndVerified + + cr_listGitlabGroups(query:String, pagination:PaginationIn) : [GitlabGroup!] @isLoggedInAndVerified + cr_listGitlabRepositories(groupId:String!, query:String, pagination:PaginationIn) : [GitlabProject!] @isLoggedInAndVerified + cr_listGitlabBranches(repoId:String!, query:String, pagination:PaginationIn) : [GitBranch!] @isLoggedInAndVerified + cr_listBuildCacheKeys(pq:CursorPaginationIn, search: SearchBuildCacheKeys) : BuildCacheKeyPaginatedRecords @isLoggedInAndVerified @hasAccount + + + cr_listBuildRuns(repoName: String!, search: SearchBuildRuns, pq: CursorPaginationIn): BuildRunPaginatedRecords @isLoggedInAndVerified @hasAccount + cr_getBuildRun(repoName: String!, buildRunName: String!): BuildRun @isLoggedInAndVerified @hasAccount +} + +type Mutation { + cr_createRepo(repository:RepositoryIn!) : Repository @isLoggedInAndVerified @hasAccount + cr_createCred(credential: CredentialIn!) : Credential @isLoggedInAndVerified @hasAccount + + cr_deleteRepo(name:String!) :Boolean! @isLoggedInAndVerified @hasAccount + cr_deleteCred(username:String!) :Boolean! @isLoggedInAndVerified @hasAccount + cr_deleteDigest(repoName:String!, digest:String!) :Boolean! @isLoggedInAndVerified @hasAccount + + + cr_addBuild(build:BuildIn!) : Build @isLoggedInAndVerified @hasAccount + cr_updateBuild(id:ID!, build:BuildIn!) : Build @isLoggedInAndVerified @hasAccount + cr_deleteBuild(id:ID!) : Boolean! @isLoggedInAndVerified @hasAccount + cr_triggerBuild(id:ID!) : Boolean! @isLoggedInAndVerified @hasAccount + + cr_addBuildCacheKey(buildCacheKey:BuildCacheKeyIn!) : BuildCacheKey @isLoggedInAndVerified @hasAccount + cr_deleteBuildCacheKey(id:ID!) : Boolean! @isLoggedInAndVerified @hasAccount + cr_updateBuildCacheKey(id:ID!, buildCacheKey:BuildCacheKeyIn!) : BuildCacheKey @isLoggedInAndVerified @hasAccount + + cr_listBuildsByBuildCacheId(buildCacheKeyId:ID!, pagination:CursorPaginationIn) : BuildPaginatedRecords @isLoggedInAndVerified @hasAccount +} +`, BuiltIn: false}, + {Name: "../struct-to-graphql/build.graphqls", Input: `type Build @shareable { + buildClusterName: String! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + credUser: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + errorMessages: Map! + id: String! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + name: String! + recordVersion: Int! + source: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource! + spec: Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec! + status: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__BuildStatus! + updateTime: Date! +} + +type BuildEdge @shareable { + cursor: String! + node: Build! +} + +type BuildPaginatedRecords @shareable { + edges: [BuildEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input BuildIn { + buildClusterName: String! + name: String! + source: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSourceIn! + spec: Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpecIn! +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/buildcachekey.graphqls", Input: `type BuildCacheKey @shareable { + accountName: String! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + id: String! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + name: String! + recordVersion: Int! + updateTime: Date! + volumeSizeInGB: Float! +} + +type BuildCacheKeyEdge @shareable { + cursor: String! + node: BuildCacheKey! +} + +type BuildCacheKeyPaginatedRecords @shareable { + edges: [BuildCacheKeyEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input BuildCacheKeyIn { + displayName: String! + name: String! + volumeSizeInGB: Float! +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/buildrun.graphqls", Input: `type BuildRun @shareable { + accountName: String! + apiVersion: String! + buildName: String! + clusterName: String! + creationTime: Date! + id: String! + kind: String! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + recordVersion: Int! + spec: Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec + status: Github__com___kloudlite___operator___pkg___operator__Status + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type BuildRunEdge @shareable { + cursor: String! + node: BuildRun! +} + +type BuildRunPaginatedRecords @shareable { + edges: [BuildRunEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/common-types.graphqls", Input: `type Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration @shareable { + unit: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationUnit! + value: Int! +} + +type Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource @shareable { + branch: String! + provider: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitProvider! + repository: String! + webhookId: Int +} + +type Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository @shareable { + archived: Boolean + cloneUrl: String + createdAt: Date + defaultBranch: String + description: String + disabled: Boolean + fullName: String + gitignoreTemplate: String + gitUrl: String + htmlUrl: String + id: Int + language: String + masterBranch: String + mirrorUrl: String + name: String + node_id: String + permissions: Map + private: Boolean + pushedAt: Date + size: Int + team_id: Int + updatedAt: Date + url: String + visibility: String +} + +type Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount @shareable { + avatarUrl: String + id: Int + login: String + nodeId: String + type: String +} + +type Github__com___kloudlite___api___common__CreatedOrUpdatedBy @shareable { + userEmail: String! + userId: String! + userName: String! +} + +type Github__com___kloudlite___api___pkg___types__SyncStatus @shareable { + action: Github__com___kloudlite___api___pkg___types__SyncAction! + error: String + lastSyncedAt: Date + recordVersion: Int! + state: Github__com___kloudlite___api___pkg___types__SyncState! + syncScheduledAt: Date +} + +type Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions @shareable { + buildArgs: Map + buildContexts: Map + contextDir: String + dockerfileContent: String + dockerfilePath: String + targetPlatforms: [String!] +} + +type Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec @shareable { + accountName: String! + buildOptions: Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions + cacheKeyName: String + registry: Github__com___kloudlite___operator___apis___distribution___v1__Registry! + resource: Github__com___kloudlite___operator___apis___distribution___v1__Resource! +} + +type Github__com___kloudlite___operator___apis___distribution___v1__Registry @shareable { + repo: Github__com___kloudlite___operator___apis___distribution___v1__Repo! +} + +type Github__com___kloudlite___operator___apis___distribution___v1__Repo @shareable { + name: String! + tags: [String!]! +} + +type Github__com___kloudlite___operator___apis___distribution___v1__Resource @shareable { + cpu: Int! + memoryInMb: Int! +} + +type Github__com___kloudlite___operator___pkg___operator__Check @shareable { + generation: Int + message: String + status: Boolean! +} + +type Github__com___kloudlite___operator___pkg___operator__ResourceRef @shareable { + apiVersion: String! + kind: String! + name: String! + namespace: String! +} + +type Github__com___kloudlite___operator___pkg___operator__Status @shareable { + checks: Map + isReady: Boolean! + lastReadyGeneration: Int + lastReconcileTime: Date + message: Github__com___kloudlite___operator___pkg___raw____json__RawJson + resources: [Github__com___kloudlite___operator___pkg___operator__ResourceRef!] +} + +type Github__com___kloudlite___operator___pkg___raw____json__RawJson @shareable { + RawMessage: Any +} + +type Metadata @shareable { + annotations: Map + creationTimestamp: Date! + deletionTimestamp: Date + generation: Int! + labels: Map + name: String! + namespace: String +} + +type PageInfo @shareable { + endCursor: String + hasNextPage: Boolean + hasPreviousPage: Boolean + startCursor: String +} + +input Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationIn { + unit: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationUnit! + value: Int! +} + +input Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSourceIn { + branch: String! + provider: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitProvider! + repository: String! +} + +input Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccountIn { + avatarUrl: String + id: Int + login: String + nodeId: String + type: String +} + +input Github__com___kloudlite___operator___apis___distribution___v1__BuildOptionsIn { + buildArgs: Map + buildContexts: Map + contextDir: String + dockerfileContent: String + dockerfilePath: String + targetPlatforms: [String!] +} + +input Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpecIn { + buildOptions: Github__com___kloudlite___operator___apis___distribution___v1__BuildOptionsIn + cacheKeyName: String + registry: Github__com___kloudlite___operator___apis___distribution___v1__RegistryIn! + resource: Github__com___kloudlite___operator___apis___distribution___v1__ResourceIn! +} + +input Github__com___kloudlite___operator___apis___distribution___v1__RegistryIn { + repo: Github__com___kloudlite___operator___apis___distribution___v1__RepoIn! +} + +input Github__com___kloudlite___operator___apis___distribution___v1__RepoIn { + name: String! + tags: [String!]! +} + +input Github__com___kloudlite___operator___apis___distribution___v1__ResourceIn { + cpu: Int! + memoryInMb: Int! +} + +input Github__com___kloudlite___operator___pkg___operator__CheckIn { + generation: Int + message: String + status: Boolean! +} + +input Github__com___kloudlite___operator___pkg___operator__ResourceRefIn { + name: String! + namespace: String! +} + +input Github__com___kloudlite___operator___pkg___operator__StatusIn { + checks: Map + isReady: Boolean! + lastReadyGeneration: Int + lastReconcileTime: Date + message: Github__com___kloudlite___operator___pkg___raw____json__RawJsonIn + resources: [Github__com___kloudlite___operator___pkg___operator__ResourceRefIn!] +} + +input Github__com___kloudlite___operator___pkg___raw____json__RawJsonIn { + RawMessage: Any +} + +input MetadataIn { + annotations: Map + labels: Map + name: String! + namespace: String +} + +enum Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__BuildStatus { + error + failed + idle + pending + queued + running + success +} + +enum Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationUnit { + d + h + m + w + y +} + +enum Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitProvider { + github + gitlab +} + +enum Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__RepoAccess { + read + read_write +} + +enum Github__com___kloudlite___api___pkg___types__SyncAction { + APPLY + DELETE +} + +enum Github__com___kloudlite___api___pkg___types__SyncState { + APPLIED_AT_AGENT + DELETED_AT_AGENT + DELETING_AT_AGENT + ERRORED_AT_AGENT + IDLE + IN_QUEUE + RECEIVED_UPDATE_FROM_AGENT + UPDATED_AT_AGENT +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/credential.graphqls", Input: `type Credential @shareable { + access: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__RepoAccess! + accountName: String! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + expiration: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration! + id: String! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + name: String! + recordVersion: Int! + updateTime: Date! + username: String! +} + +type CredentialEdge @shareable { + cursor: String! + node: Credential! +} + +type CredentialPaginatedRecords @shareable { + edges: [CredentialEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input CredentialIn { + access: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__RepoAccess! + expiration: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationIn! + name: String! + username: String! +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/cursorpagination.graphqls", Input: `type CursorPagination @shareable { + after: String + before: String + first: Int + last: Int + orderBy: String + sortDirection: CursorPaginationSortDirection +} + +input CursorPaginationIn { + after: String + before: String + first: Int + last: Int + orderBy: String = "_id" + sortDirection: CursorPaginationSortDirection = "ASC" +} + +enum CursorPaginationSortDirection { + ASC + DESC +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/digest.graphqls", Input: `type Digest @shareable { + accountName: String! + actor: String! + creationTime: Date! + deleting: Boolean! + digest: String! + id: String! + length: Int! + markedForDeletion: Boolean + mediaType: String! + recordVersion: Int! + repository: String! + size: Int! + tags: [String!]! + updateTime: Date! + url: String! +} + +type DigestEdge @shareable { + cursor: String! + node: Digest! +} + +type DigestPaginatedRecords @shareable { + edges: [DigestEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/directives.graphqls", Input: `extend schema @link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@key", "@shareable", "@external"]) + +directive @goField( + forceResolver: Boolean + name: String +) on INPUT_FIELD_DEFINITION | FIELD_DEFINITION +`, BuiltIn: false}, + {Name: "../struct-to-graphql/gitbranch.graphqls", Input: `type GitBranch @shareable { + name: String + protected: Boolean +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/githubbranch.graphqls", Input: `type GithubBranch @shareable { + name: String + protected: Boolean +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/githubinstallation.graphqls", Input: `type GithubInstallation @shareable { + account: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount + appId: Int + id: Int + nodeId: String + repositoriesUrl: String + targetId: Int + targetType: String +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/githublistrepository.graphqls", Input: `type GithubListRepository @shareable { + repositories: [Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository]! + totalCount: Int +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/githubsearchrepository.graphqls", Input: `type GithubSearchRepository @shareable { + incompleteResults: Boolean + repositories: [Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository]! + total: Int +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/gitlabbranch.graphqls", Input: `type GitlabBranch @shareable { + canPush: Boolean! + default: Boolean! + developersCanMerge: Boolean! + developersCanPush: Boolean! + merged: Boolean! + name: String! + protected: Boolean! + webUrl: String! +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/gitlabgroup.graphqls", Input: `type GitlabGroup @shareable { + avatarUrl: String! + fullName: String! + id: String! +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/gitlabproject.graphqls", Input: `type GitlabProject @shareable { + archived: Boolean! + avatarUrl: String! + createdAt: Date + creatorId: Int! + defaultBranch: String! + description: String! + emptyRepo: Boolean! + httpUrlToRepo: String! + id: Int! + lastActivityAt: Date + name: String! + nameWithNamespace: String! + path: String! + pathWithNamespace: String! + public: Boolean! + sshUrlToRepo: String! + tagList: [String!]! + topics: [String!]! + webUrl: String! +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/matchfilter.graphqls", Input: `type MatchFilter @shareable { + array: [Any!] + exact: Any + matchType: MatchFilterMatchType! + regex: String +} + +input MatchFilterIn { + array: [Any!] + exact: Any + matchType: MatchFilterMatchType! + regex: String +} + +enum MatchFilterMatchType { + array + exact + regex +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/pagination.graphqls", Input: `type Pagination @shareable { + page: Int + per_page: Int +} + +input PaginationIn { + page: Int + per_page: Int +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/repository.graphqls", Input: `type Repository @shareable { + accountName: String! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + id: String! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + name: String! + recordVersion: Int! + updateTime: Date! +} + +type RepositoryEdge @shareable { + cursor: String! + node: Repository! +} + +type RepositoryPaginatedRecords @shareable { + edges: [RepositoryEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input RepositoryIn { + name: String! +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/scalars.graphqls", Input: `scalar Any +scalar Json +scalar Map +scalar Date +`, BuiltIn: false}, + {Name: "../../federation/directives.graphql", Input: ` + scalar _Any + scalar _FieldSet + directive @requires(fields: _FieldSet!) on FIELD_DEFINITION + directive @provides(fields: _FieldSet!) on FIELD_DEFINITION + directive @extends on OBJECT | INTERFACE + + directive @key(fields: _FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE + directive @external on FIELD_DEFINITION | OBJECT + directive @link(import: [String!], url: String!) repeatable on SCHEMA + directive @shareable on OBJECT | FIELD_DEFINITION + directive @tag(name: String!) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION + directive @override(from: String!) on FIELD_DEFINITION + directive @inaccessible on SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION +`, BuiltIn: true}, + {Name: "../../federation/entity.graphql", Input: ` +type _Service { + sdl: String +} + +extend type Query { + _service: _Service! +} +`, BuiltIn: true}, +} +var parsedSchema = gqlparser.MustLoadSchema(sources...) + +// endregion ************************** generated!.gotpl ************************** + +// region ***************************** args.gotpl ***************************** + +func (ec *executionContext) field_Mutation_cr_addBuildCacheKey_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 entities.BuildCacheKey + if tmp, ok := rawArgs["buildCacheKey"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("buildCacheKey")) + arg0, err = ec.unmarshalNBuildCacheKeyIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐBuildCacheKey(ctx, tmp) + if err != nil { + return nil, err + } + } + args["buildCacheKey"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_cr_addBuild_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 entities.Build + if tmp, ok := rawArgs["build"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("build")) + arg0, err = ec.unmarshalNBuildIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐBuild(ctx, tmp) + if err != nil { + return nil, err + } + } + args["build"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_cr_createCred_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 entities.Credential + if tmp, ok := rawArgs["credential"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("credential")) + arg0, err = ec.unmarshalNCredentialIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐCredential(ctx, tmp) + if err != nil { + return nil, err + } + } + args["credential"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_cr_createRepo_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 entities.Repository + if tmp, ok := rawArgs["repository"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("repository")) + arg0, err = ec.unmarshalNRepositoryIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐRepository(ctx, tmp) + if err != nil { + return nil, err + } + } + args["repository"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_cr_deleteBuildCacheKey_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 repos.ID + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_cr_deleteBuild_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 repos.ID + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_cr_deleteCred_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["username"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("username")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["username"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_cr_deleteDigest_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["repoName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("repoName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["repoName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["digest"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("digest")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["digest"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_cr_deleteRepo_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_Mutation_cr_listBuildsByBuildCacheId_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 repos.ID + if tmp, ok := rawArgs["buildCacheKeyId"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("buildCacheKeyId")) + arg0, err = ec.unmarshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx, tmp) + if err != nil { + return nil, err + } + } + args["buildCacheKeyId"] = arg0 + var arg1 *repos.CursorPagination + if tmp, ok := rawArgs["pagination"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pagination")) + arg1, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pagination"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_cr_triggerBuild_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 repos.ID + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_cr_updateBuildCacheKey_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 repos.ID + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 entities.BuildCacheKey + if tmp, ok := rawArgs["buildCacheKey"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("buildCacheKey")) + arg1, err = ec.unmarshalNBuildCacheKeyIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐBuildCacheKey(ctx, tmp) + if err != nil { + return nil, err + } + } + args["buildCacheKey"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_cr_updateBuild_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 repos.ID + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 entities.Build + if tmp, ok := rawArgs["build"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("build")) + arg1, err = ec.unmarshalNBuildIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐBuild(ctx, tmp) + if err != nil { + return nil, err + } + } + args["build"] = 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_cr_checkUserNameAvailability_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_cr_getBuildRun_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["repoName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("repoName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["repoName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["buildRunName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("buildRunName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["buildRunName"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Query_cr_getBuild_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 repos.ID + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_cr_getCredToken_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["username"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("username")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["username"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_cr_listBuildCacheKeys_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *repos.CursorPagination + if tmp, ok := rawArgs["pq"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) + arg0, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pq"] = arg0 + var arg1 *model.SearchBuildCacheKeys + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg1, err = ec.unmarshalOSearchBuildCacheKeys2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐSearchBuildCacheKeys(ctx, tmp) + if err != nil { + return nil, err + } + } + args["search"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Query_cr_listBuildRuns_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["repoName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("repoName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["repoName"] = arg0 + var arg1 *model.SearchBuildRuns + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg1, err = ec.unmarshalOSearchBuildRuns2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐSearchBuildRuns(ctx, tmp) + if err != nil { + return nil, err + } + } + args["search"] = arg1 + var arg2 *repos.CursorPagination + if tmp, ok := rawArgs["pq"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) + arg2, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pq"] = arg2 + return args, nil +} + +func (ec *executionContext) field_Query_cr_listBuilds_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["repoName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("repoName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["repoName"] = arg0 + var arg1 *model.SearchBuilds + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg1, err = ec.unmarshalOSearchBuilds2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐSearchBuilds(ctx, tmp) + if err != nil { + return nil, err + } + } + args["search"] = arg1 + var arg2 *repos.CursorPagination + if tmp, ok := rawArgs["pagination"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pagination")) + arg2, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pagination"] = arg2 + return args, nil +} + +func (ec *executionContext) field_Query_cr_listCreds_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *model.SearchCreds + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg0, err = ec.unmarshalOSearchCreds2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐSearchCreds(ctx, tmp) + if err != nil { + return nil, err + } + } + args["search"] = arg0 + var arg1 *repos.CursorPagination + if tmp, ok := rawArgs["pagination"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pagination")) + arg1, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pagination"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Query_cr_listDigests_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["repoName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("repoName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["repoName"] = arg0 + var arg1 *model.SearchRepos + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg1, err = ec.unmarshalOSearchRepos2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐSearchRepos(ctx, tmp) + if err != nil { + return nil, err + } + } + args["search"] = arg1 + var arg2 *repos.CursorPagination + if tmp, ok := rawArgs["pagination"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pagination")) + arg2, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pagination"] = arg2 + return args, nil +} + +func (ec *executionContext) field_Query_cr_listGithubBranches_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["repoUrl"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("repoUrl")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["repoUrl"] = arg0 + var arg1 *types.Pagination + if tmp, ok := rawArgs["pagination"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pagination")) + arg1, err = ec.unmarshalOPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pagination"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Query_cr_listGithubInstallations_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *types.Pagination + if tmp, ok := rawArgs["pagination"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pagination")) + arg0, err = ec.unmarshalOPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pagination"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_cr_listGithubRepos_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 int + if tmp, ok := rawArgs["installationId"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("installationId")) + arg0, err = ec.unmarshalNInt2int(ctx, tmp) + if err != nil { + return nil, err + } + } + args["installationId"] = arg0 + var arg1 *types.Pagination + if tmp, ok := rawArgs["pagination"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pagination")) + arg1, err = ec.unmarshalOPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pagination"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Query_cr_listGitlabBranches_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["repoId"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("repoId")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["repoId"] = arg0 + var arg1 *string + if tmp, ok := rawArgs["query"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("query")) + arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) + if err != nil { + return nil, err + } + } + args["query"] = arg1 + var arg2 *types.Pagination + if tmp, ok := rawArgs["pagination"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pagination")) + arg2, err = ec.unmarshalOPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pagination"] = arg2 + return args, nil +} + +func (ec *executionContext) field_Query_cr_listGitlabGroups_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *string + if tmp, ok := rawArgs["query"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("query")) + arg0, err = ec.unmarshalOString2ᚖstring(ctx, tmp) + if err != nil { + return nil, err + } + } + args["query"] = arg0 + var arg1 *types.Pagination + if tmp, ok := rawArgs["pagination"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pagination")) + arg1, err = ec.unmarshalOPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pagination"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Query_cr_listGitlabRepositories_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["groupId"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupId")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["groupId"] = arg0 + var arg1 *string + if tmp, ok := rawArgs["query"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("query")) + arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) + if err != nil { + return nil, err + } + } + args["query"] = arg1 + var arg2 *types.Pagination + if tmp, ok := rawArgs["pagination"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pagination")) + arg2, err = ec.unmarshalOPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pagination"] = arg2 + return args, nil +} + +func (ec *executionContext) field_Query_cr_listRepos_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *model.SearchRepos + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg0, err = ec.unmarshalOSearchRepos2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐSearchRepos(ctx, tmp) + if err != nil { + return nil, err + } + } + args["search"] = arg0 + var arg1 *repos.CursorPagination + if tmp, ok := rawArgs["pagination"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pagination")) + arg1, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pagination"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Query_cr_searchGithubRepos_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["organization"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organization")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["organization"] = arg0 + var arg1 string + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["search"] = arg1 + var arg2 *types.Pagination + if tmp, ok := rawArgs["pagination"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pagination")) + arg2, err = ec.unmarshalOPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pagination"] = arg2 + 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) _Build_buildClusterName(ctx context.Context, field graphql.CollectedField, obj *entities.Build) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Build_buildClusterName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.BuildClusterName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Build_buildClusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Build", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Build_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.Build) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Build_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Build_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Build", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Build_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.Build) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Build_creationTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Build().CreationTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Build_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Build", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Build_credUser(ctx context.Context, field graphql.CollectedField, obj *entities.Build) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Build_credUser(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CredUser, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Build_credUser(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Build", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Build_errorMessages(ctx context.Context, field graphql.CollectedField, obj *entities.Build) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Build_errorMessages(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Build().ErrorMessages(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.(map[string]interface{}) + fc.Result = res + return ec.marshalNMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Build_errorMessages(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Build", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Build_id(ctx context.Context, field graphql.CollectedField, obj *entities.Build) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Build_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 ec.resolvers.Build().ID(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_Build_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Build", + 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) _Build_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.Build) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Build_lastUpdatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastUpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Build_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Build", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Build_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.Build) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Build_markedForDeletion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MarkedForDeletion, 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_Build_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Build", + 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) _Build_name(ctx context.Context, field graphql.CollectedField, obj *entities.Build) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Build_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_Build_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Build", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Build_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Build) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Build_recordVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RecordVersion, nil + }) + if err != nil { + ec.Error(ctx, 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_Build_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Build", + 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) _Build_source(ctx context.Context, field graphql.CollectedField, obj *entities.Build) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Build_source(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Build().Source(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.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitSource) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Build_source(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Build", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "branch": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource_branch(ctx, field) + case "provider": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource_provider(ctx, field) + case "repository": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource_repository(ctx, field) + case "webhookId": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource_webhookId(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Build_spec(ctx context.Context, field graphql.CollectedField, obj *entities.Build) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Build_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 ec.resolvers.Build().Spec(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.GithubComKloudliteOperatorApisDistributionV1BuildRunSpec) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisDistributionV1BuildRunSpec(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Build_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Build", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accountName": + return ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_accountName(ctx, field) + case "buildOptions": + return ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_buildOptions(ctx, field) + case "cacheKeyName": + return ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_cacheKeyName(ctx, field) + case "registry": + return ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_registry(ctx, field) + case "resource": + return ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_resource(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Build_status(ctx context.Context, field graphql.CollectedField, obj *entities.Build) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Build_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 ec.resolvers.Build().Status(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.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatus) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__BuildStatus2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Build_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Build", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__BuildStatus does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Build_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.Build) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Build_updateTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Build().UpdateTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Build_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Build", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildCacheKey_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.BuildCacheKey) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildCacheKey_accountName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_BuildCacheKey_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildCacheKey", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildCacheKey_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.BuildCacheKey) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildCacheKey_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BuildCacheKey_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildCacheKey", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildCacheKey_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.BuildCacheKey) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildCacheKey_creationTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.BuildCacheKey().CreationTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BuildCacheKey_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildCacheKey", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildCacheKey_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.BuildCacheKey) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildCacheKey_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_BuildCacheKey_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildCacheKey", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildCacheKey_id(ctx context.Context, field graphql.CollectedField, obj *entities.BuildCacheKey) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildCacheKey_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 ec.resolvers.BuildCacheKey().ID(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_BuildCacheKey_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildCacheKey", + 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) _BuildCacheKey_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.BuildCacheKey) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildCacheKey_lastUpdatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastUpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BuildCacheKey_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildCacheKey", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildCacheKey_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.BuildCacheKey) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildCacheKey_markedForDeletion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MarkedForDeletion, 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_BuildCacheKey_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildCacheKey", + 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) _BuildCacheKey_name(ctx context.Context, field graphql.CollectedField, obj *entities.BuildCacheKey) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildCacheKey_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_BuildCacheKey_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildCacheKey", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildCacheKey_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.BuildCacheKey) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildCacheKey_recordVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RecordVersion, nil + }) + if err != nil { + ec.Error(ctx, 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_BuildCacheKey_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildCacheKey", + 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) _BuildCacheKey_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.BuildCacheKey) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildCacheKey_updateTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.BuildCacheKey().UpdateTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BuildCacheKey_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildCacheKey", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildCacheKey_volumeSizeInGB(ctx context.Context, field graphql.CollectedField, obj *entities.BuildCacheKey) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildCacheKey_volumeSizeInGB(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.BuildCacheKey().VolumeSizeInGb(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.(float64) + fc.Result = res + return ec.marshalNFloat2float64(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BuildCacheKey_volumeSizeInGB(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildCacheKey", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Float does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildCacheKeyEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.BuildCacheKeyEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildCacheKeyEdge_cursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BuildCacheKeyEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildCacheKeyEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildCacheKeyEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.BuildCacheKeyEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildCacheKeyEdge_node(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*entities.BuildCacheKey) + fc.Result = res + return ec.marshalNBuildCacheKey2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐBuildCacheKey(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BuildCacheKeyEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildCacheKeyEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accountName": + return ec.fieldContext_BuildCacheKey_accountName(ctx, field) + case "createdBy": + return ec.fieldContext_BuildCacheKey_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_BuildCacheKey_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_BuildCacheKey_displayName(ctx, field) + case "id": + return ec.fieldContext_BuildCacheKey_id(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_BuildCacheKey_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_BuildCacheKey_markedForDeletion(ctx, field) + case "name": + return ec.fieldContext_BuildCacheKey_name(ctx, field) + case "recordVersion": + return ec.fieldContext_BuildCacheKey_recordVersion(ctx, field) + case "updateTime": + return ec.fieldContext_BuildCacheKey_updateTime(ctx, field) + case "volumeSizeInGB": + return ec.fieldContext_BuildCacheKey_volumeSizeInGB(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type BuildCacheKey", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildCacheKeyPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.BuildCacheKeyPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildCacheKeyPaginatedRecords_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.BuildCacheKeyEdge) + fc.Result = res + return ec.marshalNBuildCacheKeyEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐBuildCacheKeyEdgeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BuildCacheKeyPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildCacheKeyPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cursor": + return ec.fieldContext_BuildCacheKeyEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_BuildCacheKeyEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type BuildCacheKeyEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildCacheKeyPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.BuildCacheKeyPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildCacheKeyPaginatedRecords_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.PageInfo) + fc.Result = res + return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BuildCacheKeyPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildCacheKeyPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildCacheKeyPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.BuildCacheKeyPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildCacheKeyPaginatedRecords_totalCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalCount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BuildCacheKeyPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildCacheKeyPaginatedRecords", + 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) _BuildEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.BuildEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildEdge_cursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BuildEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.BuildEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildEdge_node(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*entities.Build) + fc.Result = res + return ec.marshalNBuild2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐBuild(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BuildEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "buildClusterName": + return ec.fieldContext_Build_buildClusterName(ctx, field) + case "createdBy": + return ec.fieldContext_Build_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Build_creationTime(ctx, field) + case "credUser": + return ec.fieldContext_Build_credUser(ctx, field) + case "errorMessages": + return ec.fieldContext_Build_errorMessages(ctx, field) + case "id": + return ec.fieldContext_Build_id(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Build_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Build_markedForDeletion(ctx, field) + case "name": + return ec.fieldContext_Build_name(ctx, field) + case "recordVersion": + return ec.fieldContext_Build_recordVersion(ctx, field) + case "source": + return ec.fieldContext_Build_source(ctx, field) + case "spec": + return ec.fieldContext_Build_spec(ctx, field) + case "status": + return ec.fieldContext_Build_status(ctx, field) + case "updateTime": + return ec.fieldContext_Build_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Build", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.BuildPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildPaginatedRecords_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.BuildEdge) + fc.Result = res + return ec.marshalNBuildEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐBuildEdgeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BuildPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cursor": + return ec.fieldContext_BuildEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_BuildEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type BuildEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.BuildPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildPaginatedRecords_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.PageInfo) + fc.Result = res + return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BuildPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.BuildPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildPaginatedRecords_totalCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalCount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BuildPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildPaginatedRecords", + 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) _BuildRun_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.BuildRun) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildRun_accountName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_BuildRun_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildRun", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildRun_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.BuildRun) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildRun_apiVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.APIVersion, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_BuildRun_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildRun", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildRun_buildName(ctx context.Context, field graphql.CollectedField, obj *entities.BuildRun) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildRun_buildName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.BuildName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_BuildRun_buildName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildRun", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildRun_clusterName(ctx context.Context, field graphql.CollectedField, obj *entities.BuildRun) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildRun_clusterName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ClusterName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_BuildRun_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildRun", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildRun_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.BuildRun) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildRun_creationTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.BuildRun().CreationTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BuildRun_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildRun", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildRun_id(ctx context.Context, field graphql.CollectedField, obj *entities.BuildRun) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildRun_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 ec.resolvers.BuildRun().ID(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_BuildRun_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildRun", + 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) _BuildRun_kind(ctx context.Context, field graphql.CollectedField, obj *entities.BuildRun) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildRun_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_BuildRun_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildRun", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildRun_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.BuildRun) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildRun_markedForDeletion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MarkedForDeletion, 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_BuildRun_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildRun", + 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) _BuildRun_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.BuildRun) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildRun_metadata(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ObjectMeta, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(v1.ObjectMeta) + fc.Result = res + return ec.marshalOMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BuildRun_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildRun", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "annotations": + return ec.fieldContext_Metadata_annotations(ctx, field) + case "creationTimestamp": + return ec.fieldContext_Metadata_creationTimestamp(ctx, field) + case "deletionTimestamp": + return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) + case "generation": + return ec.fieldContext_Metadata_generation(ctx, field) + case "labels": + return ec.fieldContext_Metadata_labels(ctx, field) + case "name": + return ec.fieldContext_Metadata_name(ctx, field) + case "namespace": + return ec.fieldContext_Metadata_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildRun_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.BuildRun) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildRun_recordVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RecordVersion, nil + }) + if err != nil { + ec.Error(ctx, 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_BuildRun_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildRun", + 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) _BuildRun_spec(ctx context.Context, field graphql.CollectedField, obj *entities.BuildRun) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildRun_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 ec.resolvers.BuildRun().Spec(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorApisDistributionV1BuildRunSpec) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisDistributionV1BuildRunSpec(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BuildRun_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildRun", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accountName": + return ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_accountName(ctx, field) + case "buildOptions": + return ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_buildOptions(ctx, field) + case "cacheKeyName": + return ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_cacheKeyName(ctx, field) + case "registry": + return ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_registry(ctx, field) + case "resource": + return ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_resource(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildRun_status(ctx context.Context, field graphql.CollectedField, obj *entities.BuildRun) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildRun_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 ec.resolvers.BuildRun().Status(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorPkgOperatorStatus) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___pkg___operator__Status2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BuildRun_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildRun", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "checks": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx, field) + case "isReady": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_isReady(ctx, field) + case "lastReadyGeneration": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReadyGeneration(ctx, field) + case "lastReconcileTime": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReconcileTime(ctx, field) + case "message": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_message(ctx, field) + case "resources": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_resources(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___pkg___operator__Status", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildRun_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.BuildRun) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildRun_syncStatus(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.BuildRun().SyncStatus(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.GithubComKloudliteAPIPkgTypesSyncStatus) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___pkg___types__SyncStatus2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIPkgTypesSyncStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BuildRun_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildRun", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "action": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx, field) + case "error": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx, field) + case "lastSyncedAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx, field) + case "recordVersion": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx, field) + case "state": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx, field) + case "syncScheduledAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___pkg___types__SyncStatus", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildRun_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.BuildRun) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildRun_updateTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.BuildRun().UpdateTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BuildRun_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildRun", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildRunEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.BuildRunEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildRunEdge_cursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BuildRunEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildRunEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildRunEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.BuildRunEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildRunEdge_node(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*entities.BuildRun) + fc.Result = res + return ec.marshalNBuildRun2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐBuildRun(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BuildRunEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildRunEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accountName": + return ec.fieldContext_BuildRun_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_BuildRun_apiVersion(ctx, field) + case "buildName": + return ec.fieldContext_BuildRun_buildName(ctx, field) + case "clusterName": + return ec.fieldContext_BuildRun_clusterName(ctx, field) + case "creationTime": + return ec.fieldContext_BuildRun_creationTime(ctx, field) + case "id": + return ec.fieldContext_BuildRun_id(ctx, field) + case "kind": + return ec.fieldContext_BuildRun_kind(ctx, field) + case "markedForDeletion": + return ec.fieldContext_BuildRun_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_BuildRun_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_BuildRun_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_BuildRun_spec(ctx, field) + case "status": + return ec.fieldContext_BuildRun_status(ctx, field) + case "syncStatus": + return ec.fieldContext_BuildRun_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_BuildRun_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type BuildRun", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildRunPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.BuildRunPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildRunPaginatedRecords_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.BuildRunEdge) + fc.Result = res + return ec.marshalNBuildRunEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐBuildRunEdgeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BuildRunPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildRunPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cursor": + return ec.fieldContext_BuildRunEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_BuildRunEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type BuildRunEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildRunPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.BuildRunPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildRunPaginatedRecords_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.PageInfo) + fc.Result = res + return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BuildRunPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildRunPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _BuildRunPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.BuildRunPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BuildRunPaginatedRecords_totalCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalCount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BuildRunPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BuildRunPaginatedRecords", + 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) _CRCheckNameAvailabilityOutput_result(ctx context.Context, field graphql.CollectedField, obj *domain.CheckNameAvailabilityOutput) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CRCheckNameAvailabilityOutput_result(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Result, nil + }) + if err != nil { + ec.Error(ctx, 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_CRCheckNameAvailabilityOutput_result(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CRCheckNameAvailabilityOutput", + 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) _CRCheckNameAvailabilityOutput_suggestedNames(ctx context.Context, field graphql.CollectedField, obj *domain.CheckNameAvailabilityOutput) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CRCheckNameAvailabilityOutput_suggestedNames(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SuggestedNames, nil + }) + 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_CRCheckNameAvailabilityOutput_suggestedNames(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CRCheckNameAvailabilityOutput", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Credential_access(ctx context.Context, field graphql.CollectedField, obj *entities.Credential) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Credential_access(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Credential().Access(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.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesRepoAccess) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__RepoAccess2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesRepoAccess(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Credential_access(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Credential", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__RepoAccess does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Credential_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.Credential) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Credential_accountName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Credential_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Credential", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Credential_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.Credential) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Credential_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Credential_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Credential", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Credential_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.Credential) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Credential_creationTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Credential().CreationTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Credential_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Credential", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Credential_expiration(ctx context.Context, field graphql.CollectedField, obj *entities.Credential) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Credential_expiration(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Credential().Expiration(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.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpiration) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpiration(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Credential_expiration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Credential", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "unit": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration_unit(ctx, field) + case "value": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration_value(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Credential_id(ctx context.Context, field graphql.CollectedField, obj *entities.Credential) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Credential_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 ec.resolvers.Credential().ID(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_Credential_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Credential", + 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) _Credential_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.Credential) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Credential_lastUpdatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastUpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Credential_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Credential", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Credential_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.Credential) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Credential_markedForDeletion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MarkedForDeletion, 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_Credential_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Credential", + 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) _Credential_name(ctx context.Context, field graphql.CollectedField, obj *entities.Credential) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Credential_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_Credential_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Credential", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Credential_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Credential) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Credential_recordVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RecordVersion, nil + }) + if err != nil { + ec.Error(ctx, 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_Credential_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Credential", + 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) _Credential_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.Credential) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Credential_updateTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Credential().UpdateTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Credential_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Credential", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Credential_username(ctx context.Context, field graphql.CollectedField, obj *entities.Credential) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Credential_username(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UserName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Credential_username(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Credential", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _CredentialEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.CredentialEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CredentialEdge_cursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_CredentialEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CredentialEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _CredentialEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.CredentialEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CredentialEdge_node(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*entities.Credential) + fc.Result = res + return ec.marshalNCredential2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐCredential(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_CredentialEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CredentialEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "access": + return ec.fieldContext_Credential_access(ctx, field) + case "accountName": + return ec.fieldContext_Credential_accountName(ctx, field) + case "createdBy": + return ec.fieldContext_Credential_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Credential_creationTime(ctx, field) + case "expiration": + return ec.fieldContext_Credential_expiration(ctx, field) + case "id": + return ec.fieldContext_Credential_id(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Credential_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Credential_markedForDeletion(ctx, field) + case "name": + return ec.fieldContext_Credential_name(ctx, field) + case "recordVersion": + return ec.fieldContext_Credential_recordVersion(ctx, field) + case "updateTime": + return ec.fieldContext_Credential_updateTime(ctx, field) + case "username": + return ec.fieldContext_Credential_username(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Credential", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _CredentialPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.CredentialPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CredentialPaginatedRecords_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.CredentialEdge) + fc.Result = res + return ec.marshalNCredentialEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐCredentialEdgeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_CredentialPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CredentialPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cursor": + return ec.fieldContext_CredentialEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_CredentialEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type CredentialEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _CredentialPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.CredentialPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CredentialPaginatedRecords_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.PageInfo) + fc.Result = res + return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_CredentialPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CredentialPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _CredentialPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.CredentialPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CredentialPaginatedRecords_totalCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalCount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_CredentialPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CredentialPaginatedRecords", + 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) _CursorPagination_after(ctx context.Context, field graphql.CollectedField, obj *repos.CursorPagination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CursorPagination_after(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.After, nil + }) + 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_CursorPagination_after(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CursorPagination", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _CursorPagination_before(ctx context.Context, field graphql.CollectedField, obj *repos.CursorPagination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CursorPagination_before(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Before, nil + }) + 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_CursorPagination_before(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CursorPagination", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _CursorPagination_first(ctx context.Context, field graphql.CollectedField, obj *repos.CursorPagination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CursorPagination_first(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.First, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int64) + fc.Result = res + return ec.marshalOInt2ᚖint64(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_CursorPagination_first(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CursorPagination", + 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) _CursorPagination_last(ctx context.Context, field graphql.CollectedField, obj *repos.CursorPagination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CursorPagination_last(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Last, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int64) + fc.Result = res + return ec.marshalOInt2ᚖint64(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_CursorPagination_last(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CursorPagination", + 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) _CursorPagination_orderBy(ctx context.Context, field graphql.CollectedField, obj *repos.CursorPagination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CursorPagination_orderBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OrderBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_CursorPagination_orderBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CursorPagination", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _CursorPagination_sortDirection(ctx context.Context, field graphql.CollectedField, obj *repos.CursorPagination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CursorPagination_sortDirection(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SortDirection, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(repos.SortDirection) + fc.Result = res + return ec.marshalOCursorPaginationSortDirection2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐSortDirection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_CursorPagination_sortDirection(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CursorPagination", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type CursorPaginationSortDirection does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Digest_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.Digest) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Digest_accountName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Digest_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Digest", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Digest_actor(ctx context.Context, field graphql.CollectedField, obj *entities.Digest) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Digest_actor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Actor, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Digest_actor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Digest", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Digest_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.Digest) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Digest_creationTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Digest().CreationTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Digest_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Digest", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Digest_deleting(ctx context.Context, field graphql.CollectedField, obj *entities.Digest) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Digest_deleting(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Deleting, nil + }) + if err != nil { + ec.Error(ctx, 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_Digest_deleting(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Digest", + 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) _Digest_digest(ctx context.Context, field graphql.CollectedField, obj *entities.Digest) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Digest_digest(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Digest, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Digest_digest(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Digest", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Digest_id(ctx context.Context, field graphql.CollectedField, obj *entities.Digest) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Digest_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 ec.resolvers.Digest().ID(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_Digest_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Digest", + 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) _Digest_length(ctx context.Context, field graphql.CollectedField, obj *entities.Digest) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Digest_length(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Length, nil + }) + if err != nil { + ec.Error(ctx, 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_Digest_length(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Digest", + 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) _Digest_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.Digest) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Digest_markedForDeletion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MarkedForDeletion, 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_Digest_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Digest", + 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) _Digest_mediaType(ctx context.Context, field graphql.CollectedField, obj *entities.Digest) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Digest_mediaType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MediaType, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Digest_mediaType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Digest", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Digest_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Digest) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Digest_recordVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RecordVersion, nil + }) + if err != nil { + ec.Error(ctx, 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_Digest_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Digest", + 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) _Digest_repository(ctx context.Context, field graphql.CollectedField, obj *entities.Digest) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Digest_repository(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Repository, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Digest_repository(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Digest", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Digest_size(ctx context.Context, field graphql.CollectedField, obj *entities.Digest) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Digest_size(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Size, nil + }) + if err != nil { + ec.Error(ctx, 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_Digest_size(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Digest", + 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) _Digest_tags(ctx context.Context, field graphql.CollectedField, obj *entities.Digest) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Digest_tags(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Tags, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + 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_Digest_tags(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Digest", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Digest_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.Digest) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Digest_updateTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Digest().UpdateTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Digest_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Digest", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Digest_url(ctx context.Context, field graphql.CollectedField, obj *entities.Digest) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Digest_url(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.URL, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Digest_url(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Digest", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DigestEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.DigestEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DigestEdge_cursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DigestEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DigestEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DigestEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.DigestEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DigestEdge_node(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*entities.Digest) + fc.Result = res + return ec.marshalNDigest2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐDigest(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DigestEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DigestEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accountName": + return ec.fieldContext_Digest_accountName(ctx, field) + case "actor": + return ec.fieldContext_Digest_actor(ctx, field) + case "creationTime": + return ec.fieldContext_Digest_creationTime(ctx, field) + case "deleting": + return ec.fieldContext_Digest_deleting(ctx, field) + case "digest": + return ec.fieldContext_Digest_digest(ctx, field) + case "id": + return ec.fieldContext_Digest_id(ctx, field) + case "length": + return ec.fieldContext_Digest_length(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Digest_markedForDeletion(ctx, field) + case "mediaType": + return ec.fieldContext_Digest_mediaType(ctx, field) + case "recordVersion": + return ec.fieldContext_Digest_recordVersion(ctx, field) + case "repository": + return ec.fieldContext_Digest_repository(ctx, field) + case "size": + return ec.fieldContext_Digest_size(ctx, field) + case "tags": + return ec.fieldContext_Digest_tags(ctx, field) + case "updateTime": + return ec.fieldContext_Digest_updateTime(ctx, field) + case "url": + return ec.fieldContext_Digest_url(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Digest", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DigestPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.DigestPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DigestPaginatedRecords_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.DigestEdge) + fc.Result = res + return ec.marshalNDigestEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐDigestEdgeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DigestPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DigestPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cursor": + return ec.fieldContext_DigestEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_DigestEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DigestEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DigestPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.DigestPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DigestPaginatedRecords_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.PageInfo) + fc.Result = res + return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DigestPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DigestPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DigestPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.DigestPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DigestPaginatedRecords_totalCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalCount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DigestPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DigestPaginatedRecords", + 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) _GitBranch_name(ctx context.Context, field graphql.CollectedField, obj *entities.GitBranch) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitBranch_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GitBranch_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitBranch", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GitBranch_protected(ctx context.Context, field graphql.CollectedField, obj *entities.GitBranch) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitBranch_protected(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Protected, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalOBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GitBranch_protected(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitBranch", + 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) _GithubBranch_name(ctx context.Context, field graphql.CollectedField, obj *model.GithubBranch) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GithubBranch_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_GithubBranch_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GithubBranch", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GithubBranch_protected(ctx context.Context, field graphql.CollectedField, obj *model.GithubBranch) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GithubBranch_protected(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Protected, 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_GithubBranch_protected(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GithubBranch", + 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) _GithubInstallation_account(ctx context.Context, field graphql.CollectedField, obj *entities.GithubInstallation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GithubInstallation_account(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.GithubInstallation().Account(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubUserAccount) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubUserAccount(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GithubInstallation_account(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GithubInstallation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "avatarUrl": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount_avatarUrl(ctx, field) + case "id": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount_id(ctx, field) + case "login": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount_login(ctx, field) + case "nodeId": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount_nodeId(ctx, field) + case "type": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount_type(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GithubInstallation_appId(ctx context.Context, field graphql.CollectedField, obj *entities.GithubInstallation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GithubInstallation_appId(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AppID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int64) + fc.Result = res + return ec.marshalOInt2ᚖint64(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GithubInstallation_appId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GithubInstallation", + 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) _GithubInstallation_id(ctx context.Context, field graphql.CollectedField, obj *entities.GithubInstallation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GithubInstallation_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 { + return graphql.Null + } + res := resTmp.(*int64) + fc.Result = res + return ec.marshalOInt2ᚖint64(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GithubInstallation_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GithubInstallation", + 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) _GithubInstallation_nodeId(ctx context.Context, field graphql.CollectedField, obj *entities.GithubInstallation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GithubInstallation_nodeId(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.NodeID, nil + }) + 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_GithubInstallation_nodeId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GithubInstallation", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GithubInstallation_repositoriesUrl(ctx context.Context, field graphql.CollectedField, obj *entities.GithubInstallation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GithubInstallation_repositoriesUrl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RepositoriesURL, nil + }) + 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_GithubInstallation_repositoriesUrl(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GithubInstallation", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GithubInstallation_targetId(ctx context.Context, field graphql.CollectedField, obj *entities.GithubInstallation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GithubInstallation_targetId(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TargetID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int64) + fc.Result = res + return ec.marshalOInt2ᚖint64(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GithubInstallation_targetId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GithubInstallation", + 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) _GithubInstallation_targetType(ctx context.Context, field graphql.CollectedField, obj *entities.GithubInstallation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GithubInstallation_targetType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TargetType, nil + }) + 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_GithubInstallation_targetType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GithubInstallation", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GithubListRepository_repositories(ctx context.Context, field graphql.CollectedField, obj *entities.GithubListRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GithubListRepository_repositories(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.GithubListRepository().Repositories(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.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GithubListRepository_repositories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GithubListRepository", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "archived": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_archived(ctx, field) + case "cloneUrl": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_cloneUrl(ctx, field) + case "createdAt": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_createdAt(ctx, field) + case "defaultBranch": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_defaultBranch(ctx, field) + case "description": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_description(ctx, field) + case "disabled": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_disabled(ctx, field) + case "fullName": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_fullName(ctx, field) + case "gitignoreTemplate": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_gitignoreTemplate(ctx, field) + case "gitUrl": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_gitUrl(ctx, field) + case "htmlUrl": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_htmlUrl(ctx, field) + case "id": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_id(ctx, field) + case "language": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_language(ctx, field) + case "masterBranch": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_masterBranch(ctx, field) + case "mirrorUrl": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_mirrorUrl(ctx, field) + case "name": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_name(ctx, field) + case "node_id": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_node_id(ctx, field) + case "permissions": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_permissions(ctx, field) + case "private": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_private(ctx, field) + case "pushedAt": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_pushedAt(ctx, field) + case "size": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_size(ctx, field) + case "team_id": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_team_id(ctx, field) + case "updatedAt": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_updatedAt(ctx, field) + case "url": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_url(ctx, field) + case "visibility": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_visibility(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GithubListRepository_totalCount(ctx context.Context, field graphql.CollectedField, obj *entities.GithubListRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GithubListRepository_totalCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalCount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int) + fc.Result = res + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GithubListRepository_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GithubListRepository", + 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) _GithubSearchRepository_incompleteResults(ctx context.Context, field graphql.CollectedField, obj *entities.GithubSearchRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GithubSearchRepository_incompleteResults(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IncompleteResults, 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_GithubSearchRepository_incompleteResults(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GithubSearchRepository", + 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) _GithubSearchRepository_repositories(ctx context.Context, field graphql.CollectedField, obj *entities.GithubSearchRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GithubSearchRepository_repositories(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.GithubSearchRepository().Repositories(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.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GithubSearchRepository_repositories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GithubSearchRepository", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "archived": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_archived(ctx, field) + case "cloneUrl": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_cloneUrl(ctx, field) + case "createdAt": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_createdAt(ctx, field) + case "defaultBranch": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_defaultBranch(ctx, field) + case "description": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_description(ctx, field) + case "disabled": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_disabled(ctx, field) + case "fullName": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_fullName(ctx, field) + case "gitignoreTemplate": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_gitignoreTemplate(ctx, field) + case "gitUrl": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_gitUrl(ctx, field) + case "htmlUrl": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_htmlUrl(ctx, field) + case "id": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_id(ctx, field) + case "language": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_language(ctx, field) + case "masterBranch": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_masterBranch(ctx, field) + case "mirrorUrl": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_mirrorUrl(ctx, field) + case "name": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_name(ctx, field) + case "node_id": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_node_id(ctx, field) + case "permissions": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_permissions(ctx, field) + case "private": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_private(ctx, field) + case "pushedAt": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_pushedAt(ctx, field) + case "size": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_size(ctx, field) + case "team_id": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_team_id(ctx, field) + case "updatedAt": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_updatedAt(ctx, field) + case "url": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_url(ctx, field) + case "visibility": + return ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_visibility(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GithubSearchRepository_total(ctx context.Context, field graphql.CollectedField, obj *entities.GithubSearchRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GithubSearchRepository_total(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Total, 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_GithubSearchRepository_total(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GithubSearchRepository", + 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) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration_unit(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpiration) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration_unit(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Unit, nil + }) + if err != nil { + ec.Error(ctx, 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.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnit) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationUnit2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnit(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration_unit(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationUnit does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration_value(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpiration) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration_value(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration", + 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) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource_branch(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource_branch(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Branch, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource_branch(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource_provider(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource_provider(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Provider, nil + }) + if err != nil { + ec.Error(ctx, 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.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitProvider) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitProvider2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitProvider(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource_provider(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitProvider does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource_repository(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource_repository(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Repository, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource_repository(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource_webhookId(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource_webhookId(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.WebhookID, 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_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource_webhookId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource", + 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) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_archived(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_archived(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Archived, 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_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_archived(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository", + 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) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_cloneUrl(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_cloneUrl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CloneURL, nil + }) + 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_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_cloneUrl(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_createdAt(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalODate2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_createdAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_defaultBranch(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_defaultBranch(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DefaultBranch, nil + }) + 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_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_defaultBranch(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_description(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_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_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_disabled(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_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_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_disabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository", + 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) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_fullName(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_fullName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.FullName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_fullName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_gitignoreTemplate(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_gitignoreTemplate(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.GitignoreTemplate, nil + }) + 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_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_gitignoreTemplate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_gitUrl(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_gitUrl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.GitURL, nil + }) + 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_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_gitUrl(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_htmlUrl(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_htmlUrl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.HTMLURL, nil + }) + 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_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_htmlUrl(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_id(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_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 { + return graphql.Null + } + res := resTmp.(*int) + fc.Result = res + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository", + 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) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_language(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_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.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_language(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_masterBranch(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_masterBranch(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MasterBranch, nil + }) + 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_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_masterBranch(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_mirrorUrl(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_mirrorUrl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MirrorURL, nil + }) + 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_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_mirrorUrl(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_name(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_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_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_node_id(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_node_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.NodeID, nil + }) + 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_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_node_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_permissions(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_permissions(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Permissions, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_permissions(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_private(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_private(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Private, 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_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_private(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository", + 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) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_pushedAt(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_pushedAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PushedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalODate2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_pushedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_size(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_size(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Size, 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_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_size(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository", + 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) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_team_id(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_team_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.TeamID, 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_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_team_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository", + 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) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_updatedAt(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_updatedAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalODate2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_updatedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_url(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_url(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.URL, nil + }) + 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_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_url(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_visibility(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_visibility(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Visibility, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_visibility(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount_avatarUrl(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubUserAccount) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount_avatarUrl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AvatarURL, nil + }) + 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_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount_avatarUrl(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount_id(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubUserAccount) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount_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 { + return graphql.Null + } + res := resTmp.(*int) + fc.Result = res + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount", + 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) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount_login(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubUserAccount) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount_login(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Login, nil + }) + 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_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount_login(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount_nodeId(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubUserAccount) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount_nodeId(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.NodeID, nil + }) + 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_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount_nodeId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount_type(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubUserAccount) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount_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 { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx context.Context, field graphql.CollectedField, obj *common.CreatedOrUpdatedBy) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UserEmail, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___common__CreatedOrUpdatedBy", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx context.Context, field graphql.CollectedField, obj *common.CreatedOrUpdatedBy) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Github__com___kloudlite___api___common__CreatedOrUpdatedBy().UserID(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_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___common__CreatedOrUpdatedBy", + 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) _Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx context.Context, field graphql.CollectedField, obj *common.CreatedOrUpdatedBy) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UserName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___common__CreatedOrUpdatedBy", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIPkgTypesSyncStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Action, nil + }) + if err != nil { + ec.Error(ctx, 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.GithubComKloudliteAPIPkgTypesSyncAction) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___pkg___types__SyncAction2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIPkgTypesSyncAction(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___pkg___types__SyncStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Github__com___kloudlite___api___pkg___types__SyncAction does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIPkgTypesSyncStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Error, nil + }) + 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_Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___pkg___types__SyncStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIPkgTypesSyncStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastSyncedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalODate2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___pkg___types__SyncStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIPkgTypesSyncStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RecordVersion, nil + }) + if err != nil { + ec.Error(ctx, 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_Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___pkg___types__SyncStatus", + 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) _Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIPkgTypesSyncStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.State, nil + }) + if err != nil { + ec.Error(ctx, 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.GithubComKloudliteAPIPkgTypesSyncState) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___pkg___types__SyncState2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIPkgTypesSyncState(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___pkg___types__SyncStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Github__com___kloudlite___api___pkg___types__SyncState does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIPkgTypesSyncStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SyncScheduledAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalODate2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___pkg___types__SyncStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_buildArgs(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisDistributionV1BuildOptions) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_buildArgs(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.BuildArgs, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_buildArgs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_buildContexts(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisDistributionV1BuildOptions) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_buildContexts(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.BuildContexts, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_buildContexts(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_contextDir(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisDistributionV1BuildOptions) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_contextDir(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ContextDir, nil + }) + 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_Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_contextDir(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_dockerfileContent(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisDistributionV1BuildOptions) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_dockerfileContent(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DockerfileContent, nil + }) + 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_Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_dockerfileContent(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_dockerfilePath(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisDistributionV1BuildOptions) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_dockerfilePath(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DockerfilePath, nil + }) + 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_Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_dockerfilePath(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_targetPlatforms(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisDistributionV1BuildOptions) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_targetPlatforms(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TargetPlatforms, nil + }) + 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_Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_targetPlatforms(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_accountName(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisDistributionV1BuildRunSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_accountName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_buildOptions(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisDistributionV1BuildRunSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_buildOptions(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.BuildOptions, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorApisDistributionV1BuildOptions) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___distribution___v1__BuildOptions2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisDistributionV1BuildOptions(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_buildOptions(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "buildArgs": + return ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_buildArgs(ctx, field) + case "buildContexts": + return ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_buildContexts(ctx, field) + case "contextDir": + return ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_contextDir(ctx, field) + case "dockerfileContent": + return ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_dockerfileContent(ctx, field) + case "dockerfilePath": + return ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_dockerfilePath(ctx, field) + case "targetPlatforms": + return ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_targetPlatforms(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_cacheKeyName(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisDistributionV1BuildRunSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_cacheKeyName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CacheKeyName, nil + }) + 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_Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_cacheKeyName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_registry(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisDistributionV1BuildRunSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_registry(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Registry, nil + }) + if err != nil { + ec.Error(ctx, 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.GithubComKloudliteOperatorApisDistributionV1Registry) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___operator___apis___distribution___v1__Registry2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisDistributionV1Registry(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_registry(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "repo": + return ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__Registry_repo(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___distribution___v1__Registry", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_resource(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisDistributionV1BuildRunSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_resource(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Resource, nil + }) + if err != nil { + ec.Error(ctx, 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.GithubComKloudliteOperatorApisDistributionV1Resource) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___operator___apis___distribution___v1__Resource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisDistributionV1Resource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_resource(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cpu": + return ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__Resource_cpu(ctx, field) + case "memoryInMb": + return ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__Resource_memoryInMb(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___distribution___v1__Resource", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___distribution___v1__Registry_repo(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisDistributionV1Registry) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__Registry_repo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Repo, nil + }) + if err != nil { + ec.Error(ctx, 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.GithubComKloudliteOperatorApisDistributionV1Repo) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___operator___apis___distribution___v1__Repo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisDistributionV1Repo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__Registry_repo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___distribution___v1__Registry", + 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_Github__com___kloudlite___operator___apis___distribution___v1__Repo_name(ctx, field) + case "tags": + return ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__Repo_tags(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___distribution___v1__Repo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___distribution___v1__Repo_name(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisDistributionV1Repo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__Repo_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_Github__com___kloudlite___operator___apis___distribution___v1__Repo_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___distribution___v1__Repo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___distribution___v1__Repo_tags(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisDistributionV1Repo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__Repo_tags(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Tags, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + 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_Github__com___kloudlite___operator___apis___distribution___v1__Repo_tags(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___distribution___v1__Repo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___distribution___v1__Resource_cpu(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisDistributionV1Resource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__Resource_cpu(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CPU, nil + }) + if err != nil { + ec.Error(ctx, 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_Github__com___kloudlite___operator___apis___distribution___v1__Resource_cpu(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___distribution___v1__Resource", + 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) _Github__com___kloudlite___operator___apis___distribution___v1__Resource_memoryInMb(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisDistributionV1Resource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___distribution___v1__Resource_memoryInMb(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MemoryInMb, nil + }) + if err != nil { + ec.Error(ctx, 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_Github__com___kloudlite___operator___apis___distribution___v1__Resource_memoryInMb(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___distribution___v1__Resource", + 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) _Github__com___kloudlite___operator___pkg___operator__Check_generation(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheck) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_generation(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Generation, 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_Github__com___kloudlite___operator___pkg___operator__Check_generation(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Check", + 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) _Github__com___kloudlite___operator___pkg___operator__Check_message(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheck) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_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_Github__com___kloudlite___operator___pkg___operator__Check_message(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Check", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Check_status(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheck) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_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.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Check", + 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) _Github__com___kloudlite___operator___pkg___operator__ResourceRef_apiVersion(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorResourceRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_apiVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.APIVersion, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___pkg___operator__ResourceRef_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__ResourceRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__ResourceRef_kind(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorResourceRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_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_Github__com___kloudlite___operator___pkg___operator__ResourceRef_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__ResourceRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__ResourceRef_name(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorResourceRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_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_Github__com___kloudlite___operator___pkg___operator__ResourceRef_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__ResourceRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__ResourceRef_namespace(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorResourceRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_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_Github__com___kloudlite___operator___pkg___operator__ResourceRef_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__ResourceRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Checks, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Status", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Status_isReady(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_isReady(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsReady, nil + }) + if err != nil { + ec.Error(ctx, 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_Github__com___kloudlite___operator___pkg___operator__Status_isReady(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Status", + 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) _Github__com___kloudlite___operator___pkg___operator__Status_lastReadyGeneration(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReadyGeneration(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastReadyGeneration, 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_Github__com___kloudlite___operator___pkg___operator__Status_lastReadyGeneration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Status", + 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) _Github__com___kloudlite___operator___pkg___operator__Status_lastReconcileTime(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReconcileTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastReconcileTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalODate2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReconcileTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Status", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Status_message(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_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.(*model.GithubComKloudliteOperatorPkgRawJSONRawJSON) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___pkg___raw____json__RawJson2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgRawJSONRawJSON(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_message(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Status", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "RawMessage": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___raw____json__RawJson_RawMessage(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___pkg___raw____json__RawJson", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Status_resources(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_resources(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Resources, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.GithubComKloudliteOperatorPkgOperatorResourceRef) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___pkg___operator__ResourceRef2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorResourceRefᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_resources(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Status", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "apiVersion": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_apiVersion(ctx, field) + case "kind": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_kind(ctx, field) + case "name": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_name(ctx, field) + case "namespace": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___pkg___operator__ResourceRef", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___raw____json__RawJson_RawMessage(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgRawJSONRawJSON) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___raw____json__RawJson_RawMessage(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RawMessage, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(interface{}) + fc.Result = res + return ec.marshalOAny2interface(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___raw____json__RawJson_RawMessage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___raw____json__RawJson", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Any does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GitlabBranch_canPush(ctx context.Context, field graphql.CollectedField, obj *model.GitlabBranch) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabBranch_canPush(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CanPush, nil + }) + if err != nil { + ec.Error(ctx, 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_GitlabBranch_canPush(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabBranch", + 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) _GitlabBranch_default(ctx context.Context, field graphql.CollectedField, obj *model.GitlabBranch) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabBranch_default(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Default, nil + }) + if err != nil { + ec.Error(ctx, 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_GitlabBranch_default(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabBranch", + 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) _GitlabBranch_developersCanMerge(ctx context.Context, field graphql.CollectedField, obj *model.GitlabBranch) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabBranch_developersCanMerge(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DevelopersCanMerge, nil + }) + if err != nil { + ec.Error(ctx, 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_GitlabBranch_developersCanMerge(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabBranch", + 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) _GitlabBranch_developersCanPush(ctx context.Context, field graphql.CollectedField, obj *model.GitlabBranch) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabBranch_developersCanPush(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DevelopersCanPush, nil + }) + if err != nil { + ec.Error(ctx, 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_GitlabBranch_developersCanPush(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabBranch", + 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) _GitlabBranch_merged(ctx context.Context, field graphql.CollectedField, obj *model.GitlabBranch) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabBranch_merged(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Merged, nil + }) + if err != nil { + ec.Error(ctx, 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_GitlabBranch_merged(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabBranch", + 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) _GitlabBranch_name(ctx context.Context, field graphql.CollectedField, obj *model.GitlabBranch) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabBranch_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_GitlabBranch_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabBranch", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GitlabBranch_protected(ctx context.Context, field graphql.CollectedField, obj *model.GitlabBranch) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabBranch_protected(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Protected, nil + }) + if err != nil { + ec.Error(ctx, 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_GitlabBranch_protected(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabBranch", + 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) _GitlabBranch_webUrl(ctx context.Context, field graphql.CollectedField, obj *model.GitlabBranch) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabBranch_webUrl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.WebURL, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_GitlabBranch_webUrl(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabBranch", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GitlabGroup_avatarUrl(ctx context.Context, field graphql.CollectedField, obj *entities.GitlabGroup) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabGroup_avatarUrl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AvatarUrl, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_GitlabGroup_avatarUrl(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabGroup", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GitlabGroup_fullName(ctx context.Context, field graphql.CollectedField, obj *entities.GitlabGroup) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabGroup_fullName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.FullName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GitlabGroup_fullName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabGroup", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GitlabGroup_id(ctx context.Context, field graphql.CollectedField, obj *entities.GitlabGroup) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabGroup_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_GitlabGroup_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabGroup", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GitlabProject_archived(ctx context.Context, field graphql.CollectedField, obj *entities.GitlabProject) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabProject_archived(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Archived, nil + }) + if err != nil { + ec.Error(ctx, 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_GitlabProject_archived(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabProject", + 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) _GitlabProject_avatarUrl(ctx context.Context, field graphql.CollectedField, obj *entities.GitlabProject) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabProject_avatarUrl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AvatarURL, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_GitlabProject_avatarUrl(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabProject", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GitlabProject_createdAt(ctx context.Context, field graphql.CollectedField, obj *entities.GitlabProject) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabProject_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.GitlabProject().CreatedAt(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalODate2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GitlabProject_createdAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabProject", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GitlabProject_creatorId(ctx context.Context, field graphql.CollectedField, obj *entities.GitlabProject) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabProject_creatorId(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatorID, nil + }) + if err != nil { + ec.Error(ctx, 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_GitlabProject_creatorId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabProject", + 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) _GitlabProject_defaultBranch(ctx context.Context, field graphql.CollectedField, obj *entities.GitlabProject) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabProject_defaultBranch(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DefaultBranch, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_GitlabProject_defaultBranch(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabProject", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GitlabProject_description(ctx context.Context, field graphql.CollectedField, obj *entities.GitlabProject) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabProject_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 { + 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_GitlabProject_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabProject", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GitlabProject_emptyRepo(ctx context.Context, field graphql.CollectedField, obj *entities.GitlabProject) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabProject_emptyRepo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.EmptyRepo, nil + }) + if err != nil { + ec.Error(ctx, 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_GitlabProject_emptyRepo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabProject", + 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) _GitlabProject_httpUrlToRepo(ctx context.Context, field graphql.CollectedField, obj *entities.GitlabProject) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabProject_httpUrlToRepo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.HTTPURLToRepo, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_GitlabProject_httpUrlToRepo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabProject", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GitlabProject_id(ctx context.Context, field graphql.CollectedField, obj *entities.GitlabProject) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabProject_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GitlabProject_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabProject", + 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) _GitlabProject_lastActivityAt(ctx context.Context, field graphql.CollectedField, obj *entities.GitlabProject) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabProject_lastActivityAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.GitlabProject().LastActivityAt(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalODate2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GitlabProject_lastActivityAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabProject", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GitlabProject_name(ctx context.Context, field graphql.CollectedField, obj *entities.GitlabProject) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabProject_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_GitlabProject_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabProject", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GitlabProject_nameWithNamespace(ctx context.Context, field graphql.CollectedField, obj *entities.GitlabProject) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabProject_nameWithNamespace(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.NameWithNamespace, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_GitlabProject_nameWithNamespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabProject", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GitlabProject_path(ctx context.Context, field graphql.CollectedField, obj *entities.GitlabProject) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabProject_path(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Path, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_GitlabProject_path(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabProject", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GitlabProject_pathWithNamespace(ctx context.Context, field graphql.CollectedField, obj *entities.GitlabProject) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabProject_pathWithNamespace(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PathWithNamespace, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_GitlabProject_pathWithNamespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabProject", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GitlabProject_public(ctx context.Context, field graphql.CollectedField, obj *entities.GitlabProject) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabProject_public(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Public, nil + }) + if err != nil { + ec.Error(ctx, 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_GitlabProject_public(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabProject", + 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) _GitlabProject_sshUrlToRepo(ctx context.Context, field graphql.CollectedField, obj *entities.GitlabProject) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabProject_sshUrlToRepo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SSHURLToRepo, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_GitlabProject_sshUrlToRepo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabProject", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GitlabProject_tagList(ctx context.Context, field graphql.CollectedField, obj *entities.GitlabProject) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabProject_tagList(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TagList, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_GitlabProject_tagList(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabProject", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GitlabProject_topics(ctx context.Context, field graphql.CollectedField, obj *entities.GitlabProject) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabProject_topics(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Topics, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_GitlabProject_topics(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabProject", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GitlabProject_webUrl(ctx context.Context, field graphql.CollectedField, obj *entities.GitlabProject) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GitlabProject_webUrl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.WebURL, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_GitlabProject_webUrl(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GitlabProject", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _MatchFilter_array(ctx context.Context, field graphql.CollectedField, obj *repos.MatchFilter) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_MatchFilter_array(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Array, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]any) + fc.Result = res + return ec.marshalOAny2ᚕinterfaceᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_MatchFilter_array(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "MatchFilter", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Any does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _MatchFilter_exact(ctx context.Context, field graphql.CollectedField, obj *repos.MatchFilter) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_MatchFilter_exact(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Exact, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(any) + fc.Result = res + return ec.marshalOAny2interface(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_MatchFilter_exact(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "MatchFilter", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Any does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _MatchFilter_matchType(ctx context.Context, field graphql.CollectedField, obj *repos.MatchFilter) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_MatchFilter_matchType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MatchType, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(repos.MatchType) + fc.Result = res + return ec.marshalNMatchFilterMatchType2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_MatchFilter_matchType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "MatchFilter", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type MatchFilterMatchType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _MatchFilter_regex(ctx context.Context, field graphql.CollectedField, obj *repos.MatchFilter) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_MatchFilter_regex(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Regex, nil + }) + 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_MatchFilter_regex(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "MatchFilter", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Metadata_annotations(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_annotations(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Metadata().Annotations(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Metadata_annotations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Metadata", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Metadata_creationTimestamp(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_creationTimestamp(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Metadata().CreationTimestamp(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Metadata_creationTimestamp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Metadata", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Metadata_deletionTimestamp(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_deletionTimestamp(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Metadata().DeletionTimestamp(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalODate2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Metadata_deletionTimestamp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Metadata", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Metadata_generation(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_generation(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Generation, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int64) + fc.Result = res + return ec.marshalNInt2int64(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Metadata_generation(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Metadata", + 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) _Metadata_labels(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_labels(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Metadata().Labels(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Metadata_labels(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Metadata", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Metadata_name(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_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_Metadata_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Metadata", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Metadata_namespace(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_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 { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Metadata_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Metadata", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Mutation_cr_createRepo(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_cr_createRepo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CrCreateRepo(rctx, fc.Args["repository"].(entities.Repository)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Repository); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/container-registry/internal/domain/entities.Repository`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.Repository) + fc.Result = res + return ec.marshalORepository2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐRepository(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_cr_createRepo(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 "accountName": + return ec.fieldContext_Repository_accountName(ctx, field) + case "createdBy": + return ec.fieldContext_Repository_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Repository_creationTime(ctx, field) + case "id": + return ec.fieldContext_Repository_id(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Repository_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Repository_markedForDeletion(ctx, field) + case "name": + return ec.fieldContext_Repository_name(ctx, field) + case "recordVersion": + return ec.fieldContext_Repository_recordVersion(ctx, field) + case "updateTime": + return ec.fieldContext_Repository_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Repository", field.Name) + }, + } + defer func() { + if 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_cr_createRepo_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_cr_createCred(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_cr_createCred(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CrCreateCred(rctx, fc.Args["credential"].(entities.Credential)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Credential); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/container-registry/internal/domain/entities.Credential`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.Credential) + fc.Result = res + return ec.marshalOCredential2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐCredential(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_cr_createCred(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 "access": + return ec.fieldContext_Credential_access(ctx, field) + case "accountName": + return ec.fieldContext_Credential_accountName(ctx, field) + case "createdBy": + return ec.fieldContext_Credential_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Credential_creationTime(ctx, field) + case "expiration": + return ec.fieldContext_Credential_expiration(ctx, field) + case "id": + return ec.fieldContext_Credential_id(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Credential_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Credential_markedForDeletion(ctx, field) + case "name": + return ec.fieldContext_Credential_name(ctx, field) + case "recordVersion": + return ec.fieldContext_Credential_recordVersion(ctx, field) + case "updateTime": + return ec.fieldContext_Credential_updateTime(ctx, field) + case "username": + return ec.fieldContext_Credential_username(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Credential", field.Name) + }, + } + defer func() { + if 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_cr_createCred_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_cr_deleteRepo(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_cr_deleteRepo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CrDeleteRepo(rctx, fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_cr_deleteRepo(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_cr_deleteRepo_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_cr_deleteCred(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_cr_deleteCred(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CrDeleteCred(rctx, fc.Args["username"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_cr_deleteCred(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_cr_deleteCred_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_cr_deleteDigest(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_cr_deleteDigest(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CrDeleteDigest(rctx, fc.Args["repoName"].(string), fc.Args["digest"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_cr_deleteDigest(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_cr_deleteDigest_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_cr_addBuild(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_cr_addBuild(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CrAddBuild(rctx, fc.Args["build"].(entities.Build)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Build); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/container-registry/internal/domain/entities.Build`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.Build) + fc.Result = res + return ec.marshalOBuild2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐBuild(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_cr_addBuild(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 "buildClusterName": + return ec.fieldContext_Build_buildClusterName(ctx, field) + case "createdBy": + return ec.fieldContext_Build_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Build_creationTime(ctx, field) + case "credUser": + return ec.fieldContext_Build_credUser(ctx, field) + case "errorMessages": + return ec.fieldContext_Build_errorMessages(ctx, field) + case "id": + return ec.fieldContext_Build_id(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Build_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Build_markedForDeletion(ctx, field) + case "name": + return ec.fieldContext_Build_name(ctx, field) + case "recordVersion": + return ec.fieldContext_Build_recordVersion(ctx, field) + case "source": + return ec.fieldContext_Build_source(ctx, field) + case "spec": + return ec.fieldContext_Build_spec(ctx, field) + case "status": + return ec.fieldContext_Build_status(ctx, field) + case "updateTime": + return ec.fieldContext_Build_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Build", field.Name) + }, + } + defer func() { + if 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_cr_addBuild_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_cr_updateBuild(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_cr_updateBuild(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CrUpdateBuild(rctx, fc.Args["id"].(repos.ID), fc.Args["build"].(entities.Build)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Build); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/container-registry/internal/domain/entities.Build`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.Build) + fc.Result = res + return ec.marshalOBuild2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐBuild(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_cr_updateBuild(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 "buildClusterName": + return ec.fieldContext_Build_buildClusterName(ctx, field) + case "createdBy": + return ec.fieldContext_Build_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Build_creationTime(ctx, field) + case "credUser": + return ec.fieldContext_Build_credUser(ctx, field) + case "errorMessages": + return ec.fieldContext_Build_errorMessages(ctx, field) + case "id": + return ec.fieldContext_Build_id(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Build_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Build_markedForDeletion(ctx, field) + case "name": + return ec.fieldContext_Build_name(ctx, field) + case "recordVersion": + return ec.fieldContext_Build_recordVersion(ctx, field) + case "source": + return ec.fieldContext_Build_source(ctx, field) + case "spec": + return ec.fieldContext_Build_spec(ctx, field) + case "status": + return ec.fieldContext_Build_status(ctx, field) + case "updateTime": + return ec.fieldContext_Build_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Build", field.Name) + }, + } + defer func() { + if 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_cr_updateBuild_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_cr_deleteBuild(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_cr_deleteBuild(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CrDeleteBuild(rctx, fc.Args["id"].(repos.ID)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_cr_deleteBuild(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_cr_deleteBuild_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_cr_triggerBuild(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_cr_triggerBuild(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CrTriggerBuild(rctx, fc.Args["id"].(repos.ID)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_cr_triggerBuild(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_cr_triggerBuild_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_cr_addBuildCacheKey(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_cr_addBuildCacheKey(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CrAddBuildCacheKey(rctx, fc.Args["buildCacheKey"].(entities.BuildCacheKey)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.BuildCacheKey); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/container-registry/internal/domain/entities.BuildCacheKey`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.BuildCacheKey) + fc.Result = res + return ec.marshalOBuildCacheKey2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐBuildCacheKey(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_cr_addBuildCacheKey(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 "accountName": + return ec.fieldContext_BuildCacheKey_accountName(ctx, field) + case "createdBy": + return ec.fieldContext_BuildCacheKey_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_BuildCacheKey_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_BuildCacheKey_displayName(ctx, field) + case "id": + return ec.fieldContext_BuildCacheKey_id(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_BuildCacheKey_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_BuildCacheKey_markedForDeletion(ctx, field) + case "name": + return ec.fieldContext_BuildCacheKey_name(ctx, field) + case "recordVersion": + return ec.fieldContext_BuildCacheKey_recordVersion(ctx, field) + case "updateTime": + return ec.fieldContext_BuildCacheKey_updateTime(ctx, field) + case "volumeSizeInGB": + return ec.fieldContext_BuildCacheKey_volumeSizeInGB(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type BuildCacheKey", field.Name) + }, + } + defer func() { + if 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_cr_addBuildCacheKey_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_cr_deleteBuildCacheKey(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_cr_deleteBuildCacheKey(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CrDeleteBuildCacheKey(rctx, fc.Args["id"].(repos.ID)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_cr_deleteBuildCacheKey(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_cr_deleteBuildCacheKey_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_cr_updateBuildCacheKey(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_cr_updateBuildCacheKey(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CrUpdateBuildCacheKey(rctx, fc.Args["id"].(repos.ID), fc.Args["buildCacheKey"].(entities.BuildCacheKey)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.BuildCacheKey); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/container-registry/internal/domain/entities.BuildCacheKey`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.BuildCacheKey) + fc.Result = res + return ec.marshalOBuildCacheKey2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐBuildCacheKey(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_cr_updateBuildCacheKey(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 "accountName": + return ec.fieldContext_BuildCacheKey_accountName(ctx, field) + case "createdBy": + return ec.fieldContext_BuildCacheKey_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_BuildCacheKey_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_BuildCacheKey_displayName(ctx, field) + case "id": + return ec.fieldContext_BuildCacheKey_id(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_BuildCacheKey_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_BuildCacheKey_markedForDeletion(ctx, field) + case "name": + return ec.fieldContext_BuildCacheKey_name(ctx, field) + case "recordVersion": + return ec.fieldContext_BuildCacheKey_recordVersion(ctx, field) + case "updateTime": + return ec.fieldContext_BuildCacheKey_updateTime(ctx, field) + case "volumeSizeInGB": + return ec.fieldContext_BuildCacheKey_volumeSizeInGB(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type BuildCacheKey", field.Name) + }, + } + defer func() { + if 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_cr_updateBuildCacheKey_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_cr_listBuildsByBuildCacheId(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_cr_listBuildsByBuildCacheId(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CrListBuildsByBuildCacheID(rctx, fc.Args["buildCacheKeyId"].(repos.ID), fc.Args["pagination"].(*repos.CursorPagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.BuildPaginatedRecords); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/container-registry/internal/app/graph/model.BuildPaginatedRecords`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.BuildPaginatedRecords) + fc.Result = res + return ec.marshalOBuildPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐBuildPaginatedRecords(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_cr_listBuildsByBuildCacheId(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 "edges": + return ec.fieldContext_BuildPaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_BuildPaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_BuildPaginatedRecords_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type BuildPaginatedRecords", field.Name) + }, + } + defer func() { + if 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_cr_listBuildsByBuildCacheId_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_endCursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.EndCursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PageInfo_endCursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PageInfo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_hasNextPage(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.HasNextPage, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*bool) + fc.Result = res + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PageInfo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.HasPreviousPage, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*bool) + fc.Result = res + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PageInfo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_startCursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.StartCursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PageInfo_startCursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PageInfo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Pagination_page(ctx context.Context, field graphql.CollectedField, obj *types.Pagination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Pagination_page(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Page, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Pagination_page(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Pagination", + 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) _Pagination_per_page(ctx context.Context, field graphql.CollectedField, obj *types.Pagination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Pagination_per_page(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PerPage, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Pagination_per_page(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Pagination", + 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) _Query_cr_listRepos(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_cr_listRepos(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CrListRepos(rctx, fc.Args["search"].(*model.SearchRepos), fc.Args["pagination"].(*repos.CursorPagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.RepositoryPaginatedRecords); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/container-registry/internal/app/graph/model.RepositoryPaginatedRecords`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.RepositoryPaginatedRecords) + fc.Result = res + return ec.marshalORepositoryPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐRepositoryPaginatedRecords(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_cr_listRepos(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_RepositoryPaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_RepositoryPaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_RepositoryPaginatedRecords_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type RepositoryPaginatedRecords", field.Name) + }, + } + defer func() { + if 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_cr_listRepos_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_cr_listCreds(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_cr_listCreds(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CrListCreds(rctx, fc.Args["search"].(*model.SearchCreds), fc.Args["pagination"].(*repos.CursorPagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.CredentialPaginatedRecords); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/container-registry/internal/app/graph/model.CredentialPaginatedRecords`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.CredentialPaginatedRecords) + fc.Result = res + return ec.marshalOCredentialPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐCredentialPaginatedRecords(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_cr_listCreds(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_CredentialPaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_CredentialPaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_CredentialPaginatedRecords_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type CredentialPaginatedRecords", field.Name) + }, + } + defer func() { + if 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_cr_listCreds_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_cr_listDigests(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_cr_listDigests(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CrListDigests(rctx, fc.Args["repoName"].(string), fc.Args["search"].(*model.SearchRepos), fc.Args["pagination"].(*repos.CursorPagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.DigestPaginatedRecords); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/container-registry/internal/app/graph/model.DigestPaginatedRecords`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.DigestPaginatedRecords) + fc.Result = res + return ec.marshalODigestPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐDigestPaginatedRecords(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_cr_listDigests(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_DigestPaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_DigestPaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_DigestPaginatedRecords_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DigestPaginatedRecords", field.Name) + }, + } + defer func() { + if 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_cr_listDigests_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_cr_getCredToken(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_cr_getCredToken(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CrGetCredToken(rctx, fc.Args["username"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + 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_Query_cr_getCredToken(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_cr_getCredToken_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_cr_checkUserNameAvailability(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_cr_checkUserNameAvailability(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CrCheckUserNameAvailability(rctx, fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*domain.CheckNameAvailabilityOutput); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/container-registry/internal/domain.CheckNameAvailabilityOutput`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*domain.CheckNameAvailabilityOutput) + fc.Result = res + return ec.marshalNCRCheckNameAvailabilityOutput2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚐCheckNameAvailabilityOutput(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_cr_checkUserNameAvailability(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 "result": + return ec.fieldContext_CRCheckNameAvailabilityOutput_result(ctx, field) + case "suggestedNames": + return ec.fieldContext_CRCheckNameAvailabilityOutput_suggestedNames(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type CRCheckNameAvailabilityOutput", field.Name) + }, + } + defer func() { + if 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_cr_checkUserNameAvailability_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_cr_getBuild(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_cr_getBuild(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CrGetBuild(rctx, fc.Args["id"].(repos.ID)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Build); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/container-registry/internal/domain/entities.Build`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.Build) + fc.Result = res + return ec.marshalOBuild2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐBuild(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_cr_getBuild(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 "buildClusterName": + return ec.fieldContext_Build_buildClusterName(ctx, field) + case "createdBy": + return ec.fieldContext_Build_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Build_creationTime(ctx, field) + case "credUser": + return ec.fieldContext_Build_credUser(ctx, field) + case "errorMessages": + return ec.fieldContext_Build_errorMessages(ctx, field) + case "id": + return ec.fieldContext_Build_id(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Build_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Build_markedForDeletion(ctx, field) + case "name": + return ec.fieldContext_Build_name(ctx, field) + case "recordVersion": + return ec.fieldContext_Build_recordVersion(ctx, field) + case "source": + return ec.fieldContext_Build_source(ctx, field) + case "spec": + return ec.fieldContext_Build_spec(ctx, field) + case "status": + return ec.fieldContext_Build_status(ctx, field) + case "updateTime": + return ec.fieldContext_Build_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Build", field.Name) + }, + } + defer func() { + if 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_cr_getBuild_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_cr_listBuilds(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_cr_listBuilds(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CrListBuilds(rctx, fc.Args["repoName"].(string), fc.Args["search"].(*model.SearchBuilds), fc.Args["pagination"].(*repos.CursorPagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.BuildPaginatedRecords); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/container-registry/internal/app/graph/model.BuildPaginatedRecords`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.BuildPaginatedRecords) + fc.Result = res + return ec.marshalOBuildPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐBuildPaginatedRecords(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_cr_listBuilds(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_BuildPaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_BuildPaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_BuildPaginatedRecords_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type BuildPaginatedRecords", field.Name) + }, + } + defer func() { + if 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_cr_listBuilds_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_cr_listGithubInstallations(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_cr_listGithubInstallations(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CrListGithubInstallations(rctx, fc.Args["pagination"].(*types.Pagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.([]*entities.GithubInstallation); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/kloudlite/api/apps/container-registry/internal/domain/entities.GithubInstallation`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*entities.GithubInstallation) + fc.Result = res + return ec.marshalOGithubInstallation2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐGithubInstallationᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_cr_listGithubInstallations(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 "account": + return ec.fieldContext_GithubInstallation_account(ctx, field) + case "appId": + return ec.fieldContext_GithubInstallation_appId(ctx, field) + case "id": + return ec.fieldContext_GithubInstallation_id(ctx, field) + case "nodeId": + return ec.fieldContext_GithubInstallation_nodeId(ctx, field) + case "repositoriesUrl": + return ec.fieldContext_GithubInstallation_repositoriesUrl(ctx, field) + case "targetId": + return ec.fieldContext_GithubInstallation_targetId(ctx, field) + case "targetType": + return ec.fieldContext_GithubInstallation_targetType(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GithubInstallation", field.Name) + }, + } + defer func() { + if 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_cr_listGithubInstallations_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_cr_listGithubRepos(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_cr_listGithubRepos(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CrListGithubRepos(rctx, fc.Args["installationId"].(int), fc.Args["pagination"].(*types.Pagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.GithubListRepository); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/container-registry/internal/domain/entities.GithubListRepository`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.GithubListRepository) + fc.Result = res + return ec.marshalOGithubListRepository2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐGithubListRepository(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_cr_listGithubRepos(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 "repositories": + return ec.fieldContext_GithubListRepository_repositories(ctx, field) + case "totalCount": + return ec.fieldContext_GithubListRepository_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GithubListRepository", field.Name) + }, + } + defer func() { + if 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_cr_listGithubRepos_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_cr_searchGithubRepos(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_cr_searchGithubRepos(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CrSearchGithubRepos(rctx, fc.Args["organization"].(string), fc.Args["search"].(string), fc.Args["pagination"].(*types.Pagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.GithubSearchRepository); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/container-registry/internal/domain/entities.GithubSearchRepository`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.GithubSearchRepository) + fc.Result = res + return ec.marshalOGithubSearchRepository2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐGithubSearchRepository(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_cr_searchGithubRepos(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 "incompleteResults": + return ec.fieldContext_GithubSearchRepository_incompleteResults(ctx, field) + case "repositories": + return ec.fieldContext_GithubSearchRepository_repositories(ctx, field) + case "total": + return ec.fieldContext_GithubSearchRepository_total(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GithubSearchRepository", field.Name) + }, + } + defer func() { + if 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_cr_searchGithubRepos_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_cr_listGithubBranches(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_cr_listGithubBranches(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CrListGithubBranches(rctx, fc.Args["repoUrl"].(string), fc.Args["pagination"].(*types.Pagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.([]*entities.GitBranch); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/kloudlite/api/apps/container-registry/internal/domain/entities.GitBranch`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*entities.GitBranch) + fc.Result = res + return ec.marshalOGitBranch2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐGitBranchᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_cr_listGithubBranches(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 "name": + return ec.fieldContext_GitBranch_name(ctx, field) + case "protected": + return ec.fieldContext_GitBranch_protected(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GitBranch", field.Name) + }, + } + defer func() { + if 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_cr_listGithubBranches_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_cr_listGitlabGroups(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_cr_listGitlabGroups(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CrListGitlabGroups(rctx, fc.Args["query"].(*string), fc.Args["pagination"].(*types.Pagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.([]*entities.GitlabGroup); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/kloudlite/api/apps/container-registry/internal/domain/entities.GitlabGroup`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*entities.GitlabGroup) + fc.Result = res + return ec.marshalOGitlabGroup2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐGitlabGroupᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_cr_listGitlabGroups(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 "avatarUrl": + return ec.fieldContext_GitlabGroup_avatarUrl(ctx, field) + case "fullName": + return ec.fieldContext_GitlabGroup_fullName(ctx, field) + case "id": + return ec.fieldContext_GitlabGroup_id(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GitlabGroup", field.Name) + }, + } + defer func() { + if 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_cr_listGitlabGroups_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_cr_listGitlabRepositories(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_cr_listGitlabRepositories(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CrListGitlabRepositories(rctx, fc.Args["groupId"].(string), fc.Args["query"].(*string), fc.Args["pagination"].(*types.Pagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.([]*entities.GitlabProject); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/kloudlite/api/apps/container-registry/internal/domain/entities.GitlabProject`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*entities.GitlabProject) + fc.Result = res + return ec.marshalOGitlabProject2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐGitlabProjectᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_cr_listGitlabRepositories(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 "archived": + return ec.fieldContext_GitlabProject_archived(ctx, field) + case "avatarUrl": + return ec.fieldContext_GitlabProject_avatarUrl(ctx, field) + case "createdAt": + return ec.fieldContext_GitlabProject_createdAt(ctx, field) + case "creatorId": + return ec.fieldContext_GitlabProject_creatorId(ctx, field) + case "defaultBranch": + return ec.fieldContext_GitlabProject_defaultBranch(ctx, field) + case "description": + return ec.fieldContext_GitlabProject_description(ctx, field) + case "emptyRepo": + return ec.fieldContext_GitlabProject_emptyRepo(ctx, field) + case "httpUrlToRepo": + return ec.fieldContext_GitlabProject_httpUrlToRepo(ctx, field) + case "id": + return ec.fieldContext_GitlabProject_id(ctx, field) + case "lastActivityAt": + return ec.fieldContext_GitlabProject_lastActivityAt(ctx, field) + case "name": + return ec.fieldContext_GitlabProject_name(ctx, field) + case "nameWithNamespace": + return ec.fieldContext_GitlabProject_nameWithNamespace(ctx, field) + case "path": + return ec.fieldContext_GitlabProject_path(ctx, field) + case "pathWithNamespace": + return ec.fieldContext_GitlabProject_pathWithNamespace(ctx, field) + case "public": + return ec.fieldContext_GitlabProject_public(ctx, field) + case "sshUrlToRepo": + return ec.fieldContext_GitlabProject_sshUrlToRepo(ctx, field) + case "tagList": + return ec.fieldContext_GitlabProject_tagList(ctx, field) + case "topics": + return ec.fieldContext_GitlabProject_topics(ctx, field) + case "webUrl": + return ec.fieldContext_GitlabProject_webUrl(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GitlabProject", field.Name) + }, + } + defer func() { + if 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_cr_listGitlabRepositories_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_cr_listGitlabBranches(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_cr_listGitlabBranches(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CrListGitlabBranches(rctx, fc.Args["repoId"].(string), fc.Args["query"].(*string), fc.Args["pagination"].(*types.Pagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.([]*entities.GitBranch); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/kloudlite/api/apps/container-registry/internal/domain/entities.GitBranch`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*entities.GitBranch) + fc.Result = res + return ec.marshalOGitBranch2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐGitBranchᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_cr_listGitlabBranches(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 "name": + return ec.fieldContext_GitBranch_name(ctx, field) + case "protected": + return ec.fieldContext_GitBranch_protected(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GitBranch", field.Name) + }, + } + defer func() { + if 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_cr_listGitlabBranches_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_cr_listBuildCacheKeys(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_cr_listBuildCacheKeys(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CrListBuildCacheKeys(rctx, fc.Args["pq"].(*repos.CursorPagination), fc.Args["search"].(*model.SearchBuildCacheKeys)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.BuildCacheKeyPaginatedRecords); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/container-registry/internal/app/graph/model.BuildCacheKeyPaginatedRecords`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.BuildCacheKeyPaginatedRecords) + fc.Result = res + return ec.marshalOBuildCacheKeyPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐBuildCacheKeyPaginatedRecords(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_cr_listBuildCacheKeys(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_BuildCacheKeyPaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_BuildCacheKeyPaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_BuildCacheKeyPaginatedRecords_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type BuildCacheKeyPaginatedRecords", field.Name) + }, + } + defer func() { + if 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_cr_listBuildCacheKeys_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_cr_listBuildRuns(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_cr_listBuildRuns(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CrListBuildRuns(rctx, fc.Args["repoName"].(string), fc.Args["search"].(*model.SearchBuildRuns), fc.Args["pq"].(*repos.CursorPagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.BuildRunPaginatedRecords); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/container-registry/internal/app/graph/model.BuildRunPaginatedRecords`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.BuildRunPaginatedRecords) + fc.Result = res + return ec.marshalOBuildRunPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐBuildRunPaginatedRecords(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_cr_listBuildRuns(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_BuildRunPaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_BuildRunPaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_BuildRunPaginatedRecords_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type BuildRunPaginatedRecords", field.Name) + }, + } + defer func() { + if 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_cr_listBuildRuns_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_cr_getBuildRun(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_cr_getBuildRun(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CrGetBuildRun(rctx, fc.Args["repoName"].(string), fc.Args["buildRunName"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.BuildRun); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/container-registry/internal/domain/entities.BuildRun`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.BuildRun) + fc.Result = res + return ec.marshalOBuildRun2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐBuildRun(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_cr_getBuildRun(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 "accountName": + return ec.fieldContext_BuildRun_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_BuildRun_apiVersion(ctx, field) + case "buildName": + return ec.fieldContext_BuildRun_buildName(ctx, field) + case "clusterName": + return ec.fieldContext_BuildRun_clusterName(ctx, field) + case "creationTime": + return ec.fieldContext_BuildRun_creationTime(ctx, field) + case "id": + return ec.fieldContext_BuildRun_id(ctx, field) + case "kind": + return ec.fieldContext_BuildRun_kind(ctx, field) + case "markedForDeletion": + return ec.fieldContext_BuildRun_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_BuildRun_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_BuildRun_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_BuildRun_spec(ctx, field) + case "status": + return ec.fieldContext_BuildRun_status(ctx, field) + case "syncStatus": + return ec.fieldContext_BuildRun_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_BuildRun_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type BuildRun", field.Name) + }, + } + defer func() { + if 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_cr_getBuildRun_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query__service(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query__service(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.__resolve__service(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(fedruntime.Service) + fc.Result = res + return ec.marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query__service(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 "sdl": + return ec.fieldContext__Service_sdl(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type _Service", 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 + } + 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(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 "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) _Repository_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.Repository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Repository_accountName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Repository_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Repository", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Repository_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.Repository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Repository_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Repository_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Repository", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Repository_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.Repository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Repository_creationTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Repository().CreationTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Repository_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Repository", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Repository_id(ctx context.Context, field graphql.CollectedField, obj *entities.Repository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Repository_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 ec.resolvers.Repository().ID(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_Repository_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Repository", + 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) _Repository_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.Repository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Repository_lastUpdatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastUpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Repository_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Repository", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Repository_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.Repository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Repository_markedForDeletion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MarkedForDeletion, 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_Repository_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Repository", + 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) _Repository_name(ctx context.Context, field graphql.CollectedField, obj *entities.Repository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Repository_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_Repository_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Repository", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Repository_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Repository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Repository_recordVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RecordVersion, nil + }) + if err != nil { + ec.Error(ctx, 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_Repository_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Repository", + 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) _Repository_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.Repository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Repository_updateTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Repository().UpdateTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Repository_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Repository", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _RepositoryEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.RepositoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RepositoryEdge_cursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_RepositoryEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "RepositoryEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _RepositoryEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.RepositoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RepositoryEdge_node(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*entities.Repository) + fc.Result = res + return ec.marshalNRepository2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐRepository(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_RepositoryEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "RepositoryEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accountName": + return ec.fieldContext_Repository_accountName(ctx, field) + case "createdBy": + return ec.fieldContext_Repository_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Repository_creationTime(ctx, field) + case "id": + return ec.fieldContext_Repository_id(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Repository_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Repository_markedForDeletion(ctx, field) + case "name": + return ec.fieldContext_Repository_name(ctx, field) + case "recordVersion": + return ec.fieldContext_Repository_recordVersion(ctx, field) + case "updateTime": + return ec.fieldContext_Repository_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Repository", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _RepositoryPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.RepositoryPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RepositoryPaginatedRecords_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.RepositoryEdge) + fc.Result = res + return ec.marshalNRepositoryEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐRepositoryEdgeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_RepositoryPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "RepositoryPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cursor": + return ec.fieldContext_RepositoryEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_RepositoryEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type RepositoryEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _RepositoryPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.RepositoryPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RepositoryPaginatedRecords_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.PageInfo) + fc.Result = res + return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_RepositoryPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "RepositoryPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _RepositoryPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.RepositoryPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RepositoryPaginatedRecords_totalCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalCount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_RepositoryPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "RepositoryPaginatedRecords", + 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) __Service_sdl(ctx context.Context, field graphql.CollectedField, obj *fedruntime.Service) (ret graphql.Marshaler) { + fc, err := ec.fieldContext__Service_sdl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SDL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext__Service_sdl(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "_Service", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field 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(ctx 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(ctx 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(ctx 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(ctx 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(ctx 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(ctx 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(ctx 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(ctx 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(ctx 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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + 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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, 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(ctx 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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + 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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, 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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_types(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Types(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_types(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_queryType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.QueryType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_queryType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_mutationType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MutationType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_mutationType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SubscriptionType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_directives(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Directives(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Directive) + fc.Result = res + return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_directives(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Directive_name(ctx, field) + case "description": + return ec.fieldContext___Directive_description(ctx, field) + case "locations": + return ec.fieldContext___Directive_locations(ctx, field) + case "args": + return ec.fieldContext___Directive_args(ctx, field) + case "isRepeatable": + return ec.fieldContext___Directive_isRepeatable(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalN__TypeKind2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __TypeKind does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_fields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Field) + fc.Result = res + return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Field_name(ctx, field) + case "description": + return ec.fieldContext___Field_description(ctx, field) + case "args": + return ec.fieldContext___Field_args(ctx, field) + case "type": + return ec.fieldContext___Field_type(ctx, field) + case "isDeprecated": + return ec.fieldContext___Field_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___Field_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_interfaces(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Interfaces(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_interfaces(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PossibleTypes(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_possibleTypes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_enumValues(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.EnumValue) + fc.Result = res + return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___EnumValue_name(ctx, field) + case "description": + return ec.fieldContext___EnumValue_description(ctx, field) + case "isDeprecated": + return ec.fieldContext___EnumValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___EnumValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_inputFields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.InputFields(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_inputFields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_ofType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OfType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_ofType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": return ec.fieldContext___Type_enumValues(ctx, field) case "inputFields": return ec.fieldContext___Type_inputFields(ctx, field) @@ -5014,1160 +20188,4431 @@ func (ec *executionContext) fieldContext___Schema_types(ctx context.Context, fie case "specifiedByURL": return ec.fieldContext___Type_specifiedByURL(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SpecifiedByURL(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +// endregion **************************** field.gotpl ***************************** + +// region **************************** input.gotpl ***************************** + +func (ec *executionContext) unmarshalInputBuildCacheKeyIn(ctx context.Context, obj interface{}) (entities.BuildCacheKey, error) { + var it entities.BuildCacheKey + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"displayName", "name", "volumeSizeInGB"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "displayName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + it.DisplayName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "name": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + it.Name, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "volumeSizeInGB": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("volumeSizeInGB")) + data, err := ec.unmarshalNFloat2float64(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.BuildCacheKeyIn().VolumeSizeInGb(ctx, &it, data); err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputBuildIn(ctx context.Context, obj interface{}) (entities.Build, error) { + var it entities.Build + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"buildClusterName", "name", "source", "spec"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "buildClusterName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("buildClusterName")) + it.BuildClusterName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "name": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + it.Name, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "source": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("source")) + data, err := ec.unmarshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitSourceIn(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.BuildIn().Source(ctx, &it, data); err != nil { + return it, err + } + case "spec": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) + data, err := ec.unmarshalNGithub__com___kloudlite___operator___apis___distribution___v1__BuildRunSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisDistributionV1BuildRunSpecIn(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.BuildIn().Spec(ctx, &it, data); err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCredentialIn(ctx context.Context, obj interface{}) (entities.Credential, error) { + var it entities.Credential + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"access", "expiration", "name", "username"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "access": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("access")) + data, err := ec.unmarshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__RepoAccess2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesRepoAccess(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.CredentialIn().Access(ctx, &it, data); err != nil { + return it, err + } + case "expiration": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiration")) + data, err := ec.unmarshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationIn(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.CredentialIn().Expiration(ctx, &it, data); err != nil { + return it, err + } + case "name": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + it.Name, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "username": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("username")) + it.UserName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCursorPaginationIn(ctx context.Context, obj interface{}) (repos.CursorPagination, error) { + var it repos.CursorPagination + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + if _, present := asMap["orderBy"]; !present { + asMap["orderBy"] = "_id" + } + if _, present := asMap["sortDirection"]; !present { + asMap["sortDirection"] = "ASC" + } + + fieldsInOrder := [...]string{"after", "before", "first", "last", "orderBy", "sortDirection"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "after": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + it.After, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "before": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + it.Before, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "first": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + it.First, err = ec.unmarshalOInt2ᚖint64(ctx, v) + if err != nil { + return it, err + } + case "last": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + it.Last, err = ec.unmarshalOInt2ᚖint64(ctx, v) + if err != nil { + return it, err + } + case "orderBy": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) + it.OrderBy, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "sortDirection": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sortDirection")) + it.SortDirection, err = ec.unmarshalOCursorPaginationSortDirection2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐSortDirection(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationIn, error) { + var it model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"unit", "value"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "unit": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("unit")) + it.Unit, err = ec.unmarshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationUnit2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnit(ctx, v) + if err != nil { + return it, err + } + case "value": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + it.Value, err = ec.unmarshalNInt2int(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSourceIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitSourceIn, error) { + var it model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitSourceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"branch", "provider", "repository"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "branch": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("branch")) + it.Branch, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "provider": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("provider")) + it.Provider, err = ec.unmarshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitProvider2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitProvider(ctx, v) + if err != nil { + return it, err + } + case "repository": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("repository")) + it.Repository, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccountIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubUserAccountIn, error) { + var it model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubUserAccountIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"avatarUrl", "id", "login", "nodeId", "type"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "avatarUrl": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarUrl")) + it.AvatarURL, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "id": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + it.ID, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + case "login": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("login")) + it.Login, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "nodeId": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nodeId")) + it.NodeID, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "type": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) + it.Type, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___distribution___v1__BuildOptionsIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisDistributionV1BuildOptionsIn, error) { + var it model.GithubComKloudliteOperatorApisDistributionV1BuildOptionsIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"buildArgs", "buildContexts", "contextDir", "dockerfileContent", "dockerfilePath", "targetPlatforms"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "buildArgs": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("buildArgs")) + it.BuildArgs, err = ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + case "buildContexts": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("buildContexts")) + it.BuildContexts, err = ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + case "contextDir": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contextDir")) + it.ContextDir, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "dockerfileContent": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("dockerfileContent")) + it.DockerfileContent, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "dockerfilePath": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("dockerfilePath")) + it.DockerfilePath, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "targetPlatforms": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetPlatforms")) + it.TargetPlatforms, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___distribution___v1__BuildRunSpecIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisDistributionV1BuildRunSpecIn, error) { + var it model.GithubComKloudliteOperatorApisDistributionV1BuildRunSpecIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"buildOptions", "cacheKeyName", "registry", "resource"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "buildOptions": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("buildOptions")) + it.BuildOptions, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___distribution___v1__BuildOptionsIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisDistributionV1BuildOptionsIn(ctx, v) + if err != nil { + return it, err + } + case "cacheKeyName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cacheKeyName")) + it.CacheKeyName, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "registry": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("registry")) + it.Registry, err = ec.unmarshalNGithub__com___kloudlite___operator___apis___distribution___v1__RegistryIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisDistributionV1RegistryIn(ctx, v) + if err != nil { + return it, err + } + case "resource": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("resource")) + it.Resource, err = ec.unmarshalNGithub__com___kloudlite___operator___apis___distribution___v1__ResourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisDistributionV1ResourceIn(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___distribution___v1__RegistryIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisDistributionV1RegistryIn, error) { + var it model.GithubComKloudliteOperatorApisDistributionV1RegistryIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"repo"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "repo": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("repo")) + it.Repo, err = ec.unmarshalNGithub__com___kloudlite___operator___apis___distribution___v1__RepoIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisDistributionV1RepoIn(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___distribution___v1__RepoIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisDistributionV1RepoIn, error) { + var it model.GithubComKloudliteOperatorApisDistributionV1RepoIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"name", "tags"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "name": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + it.Name, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "tags": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + it.Tags, err = ec.unmarshalNString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___distribution___v1__ResourceIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisDistributionV1ResourceIn, error) { + var it model.GithubComKloudliteOperatorApisDistributionV1ResourceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"cpu", "memoryInMb"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "cpu": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cpu")) + it.CPU, err = ec.unmarshalNInt2int(ctx, v) + if err != nil { + return it, err + } + case "memoryInMb": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("memoryInMb")) + it.MemoryInMb, err = ec.unmarshalNInt2int(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___pkg___operator__CheckIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorPkgOperatorCheckIn, error) { + var it model.GithubComKloudliteOperatorPkgOperatorCheckIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"generation", "message", "status"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "generation": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("generation")) + it.Generation, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + case "message": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("message")) + it.Message, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "status": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + it.Status, err = ec.unmarshalNBoolean2bool(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___pkg___operator__ResourceRefIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorPkgOperatorResourceRefIn, error) { + var it model.GithubComKloudliteOperatorPkgOperatorResourceRefIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"name", "namespace"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "name": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + it.Name, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "namespace": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) + it.Namespace, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___pkg___operator__StatusIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorPkgOperatorStatusIn, error) { + var it model.GithubComKloudliteOperatorPkgOperatorStatusIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"checks", "isReady", "lastReadyGeneration", "lastReconcileTime", "message", "resources"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "checks": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("checks")) + it.Checks, err = ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + case "isReady": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) + it.IsReady, err = ec.unmarshalNBoolean2bool(ctx, v) + if err != nil { + return it, err + } + case "lastReadyGeneration": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastReadyGeneration")) + it.LastReadyGeneration, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + case "lastReconcileTime": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastReconcileTime")) + it.LastReconcileTime, err = ec.unmarshalODate2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "message": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("message")) + it.Message, err = ec.unmarshalOGithub__com___kloudlite___operator___pkg___raw____json__RawJsonIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgRawJSONRawJSONIn(ctx, v) + if err != nil { + return it, err + } + case "resources": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("resources")) + it.Resources, err = ec.unmarshalOGithub__com___kloudlite___operator___pkg___operator__ResourceRefIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorResourceRefInᚄ(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___pkg___raw____json__RawJsonIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorPkgRawJSONRawJSONIn, error) { + var it model.GithubComKloudliteOperatorPkgRawJSONRawJSONIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"RawMessage"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "RawMessage": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("RawMessage")) + it.RawMessage, err = ec.unmarshalOAny2interface(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMatchFilterIn(ctx context.Context, obj interface{}) (repos.MatchFilter, error) { + var it repos.MatchFilter + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"array", "exact", "matchType", "regex"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "array": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("array")) + it.Array, err = ec.unmarshalOAny2ᚕinterfaceᚄ(ctx, v) + if err != nil { + return it, err + } + case "exact": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("exact")) + it.Exact, err = ec.unmarshalOAny2interface(ctx, v) + if err != nil { + return it, err + } + case "matchType": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("matchType")) + it.MatchType, err = ec.unmarshalNMatchFilterMatchType2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchType(ctx, v) + if err != nil { + return it, err + } + case "regex": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("regex")) + it.Regex, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMetadataIn(ctx context.Context, obj interface{}) (v1.ObjectMeta, error) { + var it v1.ObjectMeta + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"annotations", "labels", "name", "namespace"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "annotations": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotations")) + data, err := ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.MetadataIn().Annotations(ctx, &it, data); err != nil { + return it, err + } + case "labels": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("labels")) + data, err := ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.MetadataIn().Labels(ctx, &it, data); err != nil { + return it, err + } + case "name": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + it.Name, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "namespace": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) + it.Namespace, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputPaginationIn(ctx context.Context, obj interface{}) (types.Pagination, error) { + var it types.Pagination + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"page", "per_page"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "page": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("page")) + it.Page, err = ec.unmarshalOInt2int(ctx, v) + if err != nil { + return it, err + } + case "per_page": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("per_page")) + it.PerPage, err = ec.unmarshalOInt2int(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputRepositoryIn(ctx context.Context, obj interface{}) (entities.Repository, error) { + var it entities.Repository + 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": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + it.Name, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputSearchBuildCacheKeys(ctx context.Context, obj interface{}) (model.SearchBuildCacheKeys, error) { + var it model.SearchBuildCacheKeys + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"text"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "text": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + it.Text, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputSearchBuildRuns(ctx context.Context, obj interface{}) (model.SearchBuildRuns, error) { + var it model.SearchBuildRuns + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"text"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "text": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + it.Text, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputSearchBuilds(ctx context.Context, obj interface{}) (model.SearchBuilds, error) { + var it model.SearchBuilds + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"text"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "text": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + it.Text, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputSearchCreds(ctx context.Context, obj interface{}) (model.SearchCreds, error) { + var it model.SearchCreds + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"text"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "text": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + it.Text, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputSearchRepos(ctx context.Context, obj interface{}) (model.SearchRepos, error) { + var it model.SearchRepos + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"text"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "text": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + it.Text, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +// endregion **************************** input.gotpl ***************************** + +// region ************************** interface.gotpl *************************** + +// endregion ************************** interface.gotpl *************************** + +// region **************************** object.gotpl **************************** + +var buildImplementors = []string{"Build"} + +func (ec *executionContext) _Build(ctx context.Context, sel ast.SelectionSet, obj *entities.Build) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, buildImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Build") + case "buildClusterName": + + out.Values[i] = ec._Build_buildClusterName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "createdBy": + + out.Values[i] = ec._Build_createdBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "creationTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Build_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "credUser": + + out.Values[i] = ec._Build_credUser(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "errorMessages": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Build_errorMessages(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "id": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Build_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "lastUpdatedBy": + + out.Values[i] = ec._Build_lastUpdatedBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "markedForDeletion": + + out.Values[i] = ec._Build_markedForDeletion(ctx, field, obj) + + case "name": + + out.Values[i] = ec._Build_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "recordVersion": + + out.Values[i] = ec._Build_recordVersion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "source": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Build_source(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "spec": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Build_spec(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "status": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Build_status(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "updateTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Build_updateTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var buildCacheKeyImplementors = []string{"BuildCacheKey"} + +func (ec *executionContext) _BuildCacheKey(ctx context.Context, sel ast.SelectionSet, obj *entities.BuildCacheKey) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, buildCacheKeyImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("BuildCacheKey") + case "accountName": + + out.Values[i] = ec._BuildCacheKey_accountName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "createdBy": + + out.Values[i] = ec._BuildCacheKey_createdBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "creationTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._BuildCacheKey_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "displayName": + + out.Values[i] = ec._BuildCacheKey_displayName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "id": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._BuildCacheKey_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "lastUpdatedBy": + + out.Values[i] = ec._BuildCacheKey_lastUpdatedBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "markedForDeletion": + + out.Values[i] = ec._BuildCacheKey_markedForDeletion(ctx, field, obj) + + case "name": + + out.Values[i] = ec._BuildCacheKey_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "recordVersion": + + out.Values[i] = ec._BuildCacheKey_recordVersion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "updateTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._BuildCacheKey_updateTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "volumeSizeInGB": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._BuildCacheKey_volumeSizeInGB(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var buildCacheKeyEdgeImplementors = []string{"BuildCacheKeyEdge"} + +func (ec *executionContext) _BuildCacheKeyEdge(ctx context.Context, sel ast.SelectionSet, obj *model.BuildCacheKeyEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, buildCacheKeyEdgeImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("BuildCacheKeyEdge") + case "cursor": + + out.Values[i] = ec._BuildCacheKeyEdge_cursor(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "node": + + out.Values[i] = ec._BuildCacheKeyEdge_node(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var buildCacheKeyPaginatedRecordsImplementors = []string{"BuildCacheKeyPaginatedRecords"} + +func (ec *executionContext) _BuildCacheKeyPaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.BuildCacheKeyPaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, buildCacheKeyPaginatedRecordsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("BuildCacheKeyPaginatedRecords") + case "edges": + + out.Values[i] = ec._BuildCacheKeyPaginatedRecords_edges(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "pageInfo": + + out.Values[i] = ec._BuildCacheKeyPaginatedRecords_pageInfo(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "totalCount": + + out.Values[i] = ec._BuildCacheKeyPaginatedRecords_totalCount(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var buildEdgeImplementors = []string{"BuildEdge"} + +func (ec *executionContext) _BuildEdge(ctx context.Context, sel ast.SelectionSet, obj *model.BuildEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, buildEdgeImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("BuildEdge") + case "cursor": + + out.Values[i] = ec._BuildEdge_cursor(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "node": + + out.Values[i] = ec._BuildEdge_node(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var buildPaginatedRecordsImplementors = []string{"BuildPaginatedRecords"} + +func (ec *executionContext) _BuildPaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.BuildPaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, buildPaginatedRecordsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("BuildPaginatedRecords") + case "edges": + + out.Values[i] = ec._BuildPaginatedRecords_edges(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "pageInfo": + + out.Values[i] = ec._BuildPaginatedRecords_pageInfo(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "totalCount": + + out.Values[i] = ec._BuildPaginatedRecords_totalCount(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var buildRunImplementors = []string{"BuildRun"} + +func (ec *executionContext) _BuildRun(ctx context.Context, sel ast.SelectionSet, obj *entities.BuildRun) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, buildRunImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("BuildRun") + case "accountName": + + out.Values[i] = ec._BuildRun_accountName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "apiVersion": + + out.Values[i] = ec._BuildRun_apiVersion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "buildName": + + out.Values[i] = ec._BuildRun_buildName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "clusterName": + + out.Values[i] = ec._BuildRun_clusterName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "creationTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._BuildRun_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "id": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._BuildRun_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "kind": + + out.Values[i] = ec._BuildRun_kind(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "markedForDeletion": + + out.Values[i] = ec._BuildRun_markedForDeletion(ctx, field, obj) + + case "metadata": + + out.Values[i] = ec._BuildRun_metadata(ctx, field, obj) + + case "recordVersion": + + out.Values[i] = ec._BuildRun_recordVersion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "spec": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._BuildRun_spec(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "status": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._BuildRun_status(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "syncStatus": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._BuildRun_syncStatus(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "updateTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._BuildRun_updateTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var buildRunEdgeImplementors = []string{"BuildRunEdge"} + +func (ec *executionContext) _BuildRunEdge(ctx context.Context, sel ast.SelectionSet, obj *model.BuildRunEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, buildRunEdgeImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("BuildRunEdge") + case "cursor": + + out.Values[i] = ec._BuildRunEdge_cursor(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "node": + + out.Values[i] = ec._BuildRunEdge_node(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var buildRunPaginatedRecordsImplementors = []string{"BuildRunPaginatedRecords"} + +func (ec *executionContext) _BuildRunPaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.BuildRunPaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, buildRunPaginatedRecordsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("BuildRunPaginatedRecords") + case "edges": + + out.Values[i] = ec._BuildRunPaginatedRecords_edges(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "pageInfo": + + out.Values[i] = ec._BuildRunPaginatedRecords_pageInfo(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "totalCount": + + out.Values[i] = ec._BuildRunPaginatedRecords_totalCount(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var cRCheckNameAvailabilityOutputImplementors = []string{"CRCheckNameAvailabilityOutput"} + +func (ec *executionContext) _CRCheckNameAvailabilityOutput(ctx context.Context, sel ast.SelectionSet, obj *domain.CheckNameAvailabilityOutput) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, cRCheckNameAvailabilityOutputImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("CRCheckNameAvailabilityOutput") + case "result": + + out.Values[i] = ec._CRCheckNameAvailabilityOutput_result(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "suggestedNames": + + out.Values[i] = ec._CRCheckNameAvailabilityOutput_suggestedNames(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var credentialImplementors = []string{"Credential"} + +func (ec *executionContext) _Credential(ctx context.Context, sel ast.SelectionSet, obj *entities.Credential) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, credentialImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Credential") + case "access": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Credential_access(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "accountName": + + out.Values[i] = ec._Credential_accountName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "createdBy": + + out.Values[i] = ec._Credential_createdBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "creationTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Credential_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "expiration": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Credential_expiration(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "id": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Credential_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "lastUpdatedBy": + + out.Values[i] = ec._Credential_lastUpdatedBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "markedForDeletion": + + out.Values[i] = ec._Credential_markedForDeletion(ctx, field, obj) + + case "name": + + out.Values[i] = ec._Credential_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "recordVersion": + + out.Values[i] = ec._Credential_recordVersion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "updateTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Credential_updateTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "username": + + out.Values[i] = ec._Credential_username(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var credentialEdgeImplementors = []string{"CredentialEdge"} + +func (ec *executionContext) _CredentialEdge(ctx context.Context, sel ast.SelectionSet, obj *model.CredentialEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, credentialEdgeImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("CredentialEdge") + case "cursor": + + out.Values[i] = ec._CredentialEdge_cursor(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "node": + + out.Values[i] = ec._CredentialEdge_node(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var credentialPaginatedRecordsImplementors = []string{"CredentialPaginatedRecords"} + +func (ec *executionContext) _CredentialPaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.CredentialPaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, credentialPaginatedRecordsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("CredentialPaginatedRecords") + case "edges": + + out.Values[i] = ec._CredentialPaginatedRecords_edges(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "pageInfo": + + out.Values[i] = ec._CredentialPaginatedRecords_pageInfo(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "totalCount": + + out.Values[i] = ec._CredentialPaginatedRecords_totalCount(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var cursorPaginationImplementors = []string{"CursorPagination"} + +func (ec *executionContext) _CursorPagination(ctx context.Context, sel ast.SelectionSet, obj *repos.CursorPagination) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, cursorPaginationImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("CursorPagination") + case "after": + + out.Values[i] = ec._CursorPagination_after(ctx, field, obj) + + case "before": + + out.Values[i] = ec._CursorPagination_before(ctx, field, obj) + + case "first": + + out.Values[i] = ec._CursorPagination_first(ctx, field, obj) + + case "last": + + out.Values[i] = ec._CursorPagination_last(ctx, field, obj) + + case "orderBy": + + out.Values[i] = ec._CursorPagination_orderBy(ctx, field, obj) + + case "sortDirection": + + out.Values[i] = ec._CursorPagination_sortDirection(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var digestImplementors = []string{"Digest"} + +func (ec *executionContext) _Digest(ctx context.Context, sel ast.SelectionSet, obj *entities.Digest) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, digestImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Digest") + case "accountName": + + out.Values[i] = ec._Digest_accountName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "actor": + + out.Values[i] = ec._Digest_actor(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "creationTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Digest_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "deleting": + + out.Values[i] = ec._Digest_deleting(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "digest": + + out.Values[i] = ec._Digest_digest(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "id": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Digest_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "length": + + out.Values[i] = ec._Digest_length(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "markedForDeletion": + + out.Values[i] = ec._Digest_markedForDeletion(ctx, field, obj) + + case "mediaType": + + out.Values[i] = ec._Digest_mediaType(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "recordVersion": + + out.Values[i] = ec._Digest_recordVersion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "repository": + + out.Values[i] = ec._Digest_repository(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "size": + + out.Values[i] = ec._Digest_size(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "tags": + + out.Values[i] = ec._Digest_tags(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "updateTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Digest_updateTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "url": + + out.Values[i] = ec._Digest_url(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var digestEdgeImplementors = []string{"DigestEdge"} + +func (ec *executionContext) _DigestEdge(ctx context.Context, sel ast.SelectionSet, obj *model.DigestEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, digestEdgeImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("DigestEdge") + case "cursor": + + out.Values[i] = ec._DigestEdge_cursor(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "node": + + out.Values[i] = ec._DigestEdge_node(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var digestPaginatedRecordsImplementors = []string{"DigestPaginatedRecords"} + +func (ec *executionContext) _DigestPaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.DigestPaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, digestPaginatedRecordsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("DigestPaginatedRecords") + case "edges": + + out.Values[i] = ec._DigestPaginatedRecords_edges(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "pageInfo": + + out.Values[i] = ec._DigestPaginatedRecords_pageInfo(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "totalCount": + + out.Values[i] = ec._DigestPaginatedRecords_totalCount(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var gitBranchImplementors = []string{"GitBranch"} + +func (ec *executionContext) _GitBranch(ctx context.Context, sel ast.SelectionSet, obj *entities.GitBranch) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, gitBranchImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("GitBranch") + case "name": + + out.Values[i] = ec._GitBranch_name(ctx, field, obj) + + case "protected": + + out.Values[i] = ec._GitBranch_protected(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var githubBranchImplementors = []string{"GithubBranch"} + +func (ec *executionContext) _GithubBranch(ctx context.Context, sel ast.SelectionSet, obj *model.GithubBranch) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, githubBranchImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("GithubBranch") + case "name": + + out.Values[i] = ec._GithubBranch_name(ctx, field, obj) + + case "protected": + + out.Values[i] = ec._GithubBranch_protected(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var githubInstallationImplementors = []string{"GithubInstallation"} + +func (ec *executionContext) _GithubInstallation(ctx context.Context, sel ast.SelectionSet, obj *entities.GithubInstallation) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, githubInstallationImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("GithubInstallation") + case "account": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._GithubInstallation_account(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "appId": + + out.Values[i] = ec._GithubInstallation_appId(ctx, field, obj) + + case "id": + + out.Values[i] = ec._GithubInstallation_id(ctx, field, obj) + + case "nodeId": + + out.Values[i] = ec._GithubInstallation_nodeId(ctx, field, obj) + + case "repositoriesUrl": + + out.Values[i] = ec._GithubInstallation_repositoriesUrl(ctx, field, obj) + + case "targetId": + + out.Values[i] = ec._GithubInstallation_targetId(ctx, field, obj) + + case "targetType": + + out.Values[i] = ec._GithubInstallation_targetType(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var githubListRepositoryImplementors = []string{"GithubListRepository"} + +func (ec *executionContext) _GithubListRepository(ctx context.Context, sel ast.SelectionSet, obj *entities.GithubListRepository) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, githubListRepositoryImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("GithubListRepository") + case "repositories": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._GithubListRepository_repositories(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "totalCount": + + out.Values[i] = ec._GithubListRepository_totalCount(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var githubSearchRepositoryImplementors = []string{"GithubSearchRepository"} + +func (ec *executionContext) _GithubSearchRepository(ctx context.Context, sel ast.SelectionSet, obj *entities.GithubSearchRepository) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, githubSearchRepositoryImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("GithubSearchRepository") + case "incompleteResults": + + out.Values[i] = ec._GithubSearchRepository_incompleteResults(ctx, field, obj) + + case "repositories": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._GithubSearchRepository_repositories(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "total": + + out.Values[i] = ec._GithubSearchRepository_total(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationImplementors = []string{"Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration"} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpiration) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration") + case "unit": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration_unit(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "value": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration_value(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } } - return fc, nil + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -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 { +var github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSourceImplementors = []string{"Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource"} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitSource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSourceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource") + case "branch": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource_branch(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "provider": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource_provider(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "repository": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource_repository(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "webhookId": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource_webhookId(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { return graphql.Null } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return out +} + +var github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepositoryImplementors = []string{"Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository"} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepositoryImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository") + case "archived": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_archived(ctx, field, obj) + + case "cloneUrl": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_cloneUrl(ctx, field, obj) + + case "createdAt": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_createdAt(ctx, field, obj) + + case "defaultBranch": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_defaultBranch(ctx, field, obj) + + case "description": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_description(ctx, field, obj) + + case "disabled": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_disabled(ctx, field, obj) + + case "fullName": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_fullName(ctx, field, obj) + + case "gitignoreTemplate": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_gitignoreTemplate(ctx, field, obj) + + case "gitUrl": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_gitUrl(ctx, field, obj) + + case "htmlUrl": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_htmlUrl(ctx, field, obj) + + case "id": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_id(ctx, field, obj) + + case "language": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_language(ctx, field, obj) + + case "masterBranch": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_masterBranch(ctx, field, obj) + + case "mirrorUrl": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_mirrorUrl(ctx, field, obj) + + case "name": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_name(ctx, field, obj) + + case "node_id": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_node_id(ctx, field, obj) + + case "permissions": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_permissions(ctx, field, obj) + + case "private": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_private(ctx, field, obj) + + case "pushedAt": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_pushedAt(ctx, field, obj) + + case "size": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_size(ctx, field, obj) + + case "team_id": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_team_id(ctx, field, obj) + + case "updatedAt": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_updatedAt(ctx, field, obj) + + case "url": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_url(ctx, field, obj) + + case "visibility": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository_visibility(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccountImplementors = []string{"Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount"} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubUserAccount) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccountImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount") + case "avatarUrl": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount_avatarUrl(ctx, field, obj) + + case "id": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount_id(ctx, field, obj) + + case "login": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount_login(ctx, field, obj) + + case "nodeId": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount_nodeId(ctx, field, obj) + + case "type": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount_type(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___api___common__CreatedOrUpdatedByImplementors = []string{"Github__com___kloudlite___api___common__CreatedOrUpdatedBy"} + +func (ec *executionContext) _Github__com___kloudlite___api___common__CreatedOrUpdatedBy(ctx context.Context, sel ast.SelectionSet, obj *common.CreatedOrUpdatedBy) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___api___common__CreatedOrUpdatedByImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___api___common__CreatedOrUpdatedBy") + case "userEmail": + + out.Values[i] = ec._Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "userId": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "userName": + + out.Values[i] = ec._Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___api___pkg___types__SyncStatusImplementors = []string{"Github__com___kloudlite___api___pkg___types__SyncStatus"} + +func (ec *executionContext) _Github__com___kloudlite___api___pkg___types__SyncStatus(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteAPIPkgTypesSyncStatus) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___api___pkg___types__SyncStatusImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___api___pkg___types__SyncStatus") + case "action": + + out.Values[i] = ec._Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "error": + + out.Values[i] = ec._Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx, field, obj) + + case "lastSyncedAt": + + out.Values[i] = ec._Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx, field, obj) + + case "recordVersion": + + out.Values[i] = ec._Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "state": + + out.Values[i] = ec._Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "syncScheduledAt": + + out.Values[i] = ec._Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) } - }() - 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) + } + out.Dispatch() + if invalids > 0 { return graphql.Null } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + return out +} + +var github__com___kloudlite___operator___apis___distribution___v1__BuildOptionsImplementors = []string{"Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisDistributionV1BuildOptions) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___distribution___v1__BuildOptionsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions") + case "buildArgs": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_buildArgs(ctx, field, obj) + + case "buildContexts": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_buildContexts(ctx, field, obj) + + case "contextDir": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_contextDir(ctx, field, obj) + + case "dockerfileContent": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_dockerfileContent(ctx, field, obj) + + case "dockerfilePath": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_dockerfilePath(ctx, field, obj) + + case "targetPlatforms": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions_targetPlatforms(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) } + } + out.Dispatch() + if invalids > 0 { return graphql.Null } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return out } -func (ec *executionContext) fieldContext___Schema_queryType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) +var github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpecImplementors = []string{"Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisDistributionV1BuildRunSpec) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpecImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec") + case "accountName": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_accountName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} + case "buildOptions": -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 { + out.Values[i] = ec._Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_buildOptions(ctx, field, obj) + + case "cacheKeyName": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_cacheKeyName(ctx, field, obj) + + case "registry": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_registry(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "resource": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec_resource(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { return graphql.Null } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return out +} + +var github__com___kloudlite___operator___apis___distribution___v1__RegistryImplementors = []string{"Github__com___kloudlite___operator___apis___distribution___v1__Registry"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___distribution___v1__Registry(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisDistributionV1Registry) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___distribution___v1__RegistryImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___distribution___v1__Registry") + case "repo": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___distribution___v1__Registry_repo(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) } - }() - 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 { + out.Dispatch() + if invalids > 0 { return graphql.Null } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return out } -func (ec *executionContext) fieldContext___Schema_mutationType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) +var github__com___kloudlite___operator___apis___distribution___v1__RepoImplementors = []string{"Github__com___kloudlite___operator___apis___distribution___v1__Repo"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___distribution___v1__Repo(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisDistributionV1Repo) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___distribution___v1__RepoImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___distribution___v1__Repo") + case "name": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___distribution___v1__Repo_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, + case "tags": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___distribution___v1__Repo_tags(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } } - return fc, nil + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -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 { +var github__com___kloudlite___operator___apis___distribution___v1__ResourceImplementors = []string{"Github__com___kloudlite___operator___apis___distribution___v1__Resource"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___distribution___v1__Resource(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisDistributionV1Resource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___distribution___v1__ResourceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___distribution___v1__Resource") + case "cpu": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___distribution___v1__Resource_cpu(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "memoryInMb": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___distribution___v1__Resource_memoryInMb(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { return graphql.Null } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return out +} + +var github__com___kloudlite___operator___pkg___operator__CheckImplementors = []string{"Github__com___kloudlite___operator___pkg___operator__Check"} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Check(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorPkgOperatorCheck) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___pkg___operator__CheckImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___pkg___operator__Check") + case "generation": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_generation(ctx, field, obj) + + case "message": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_message(ctx, field, obj) + + case "status": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_status(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) } - }() - 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 { + out.Dispatch() + if invalids > 0 { return graphql.Null } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return out } -func (ec *executionContext) fieldContext___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) +var github__com___kloudlite___operator___pkg___operator__ResourceRefImplementors = []string{"Github__com___kloudlite___operator___pkg___operator__ResourceRef"} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__ResourceRef(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorPkgOperatorResourceRef) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___pkg___operator__ResourceRefImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___pkg___operator__ResourceRef") + case "apiVersion": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__ResourceRef_apiVersion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} + case "kind": -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 + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__ResourceRef_kind(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "name": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__ResourceRef_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "namespace": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__ResourceRef_namespace(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) } - }() - 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") - } + out.Dispatch() + if invalids > 0 { 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) + return out } -func (ec *executionContext) fieldContext___Schema_directives(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___Directive_name(ctx, field) - case "description": - return ec.fieldContext___Directive_description(ctx, field) - case "locations": - return ec.fieldContext___Directive_locations(ctx, field) - case "args": - return ec.fieldContext___Directive_args(ctx, field) - case "isRepeatable": - return ec.fieldContext___Directive_isRepeatable(ctx, field) +var github__com___kloudlite___operator___pkg___operator__StatusImplementors = []string{"Github__com___kloudlite___operator___pkg___operator__Status"} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Status(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorPkgOperatorStatus) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___pkg___operator__StatusImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___pkg___operator__Status") + case "checks": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx, field, obj) + + case "isReady": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Status_isReady(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } - return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) - }, - } - return fc, nil -} + case "lastReadyGeneration": -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 + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Status_lastReadyGeneration(ctx, field, obj) + + case "lastReconcileTime": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Status_lastReconcileTime(ctx, field, obj) + + case "message": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Status_message(ctx, field, obj) + + case "resources": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Status_resources(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) } - }() - 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") - } + out.Dispatch() + if invalids > 0 { return graphql.Null } - res := resTmp.(string) - fc.Result = res - return ec.marshalN__TypeKind2string(ctx, field.Selections, res) + return out } -func (ec *executionContext) fieldContext___Type_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type __TypeKind does not have child fields") - }, - } - return fc, nil -} +var github__com___kloudlite___operator___pkg___raw____json__RawJsonImplementors = []string{"Github__com___kloudlite___operator___pkg___raw____json__RawJson"} -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 +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___raw____json__RawJson(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorPkgRawJSONRawJSON) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___pkg___raw____json__RawJsonImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___pkg___raw____json__RawJson") + case "RawMessage": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___raw____json__RawJson_RawMessage(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) } - }() - 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 { + out.Dispatch() + if invalids > 0 { return graphql.Null } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return out } -func (ec *executionContext) fieldContext___Type_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} +var gitlabBranchImplementors = []string{"GitlabBranch"} + +func (ec *executionContext) _GitlabBranch(ctx context.Context, sel ast.SelectionSet, obj *model.GitlabBranch) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, gitlabBranchImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("GitlabBranch") + case "canPush": + + out.Values[i] = ec._GitlabBranch_canPush(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "default": + + out.Values[i] = ec._GitlabBranch_default(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "developersCanMerge": + + out.Values[i] = ec._GitlabBranch_developersCanMerge(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "developersCanPush": + + out.Values[i] = ec._GitlabBranch_developersCanPush(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "merged": + + out.Values[i] = ec._GitlabBranch_merged(ctx, field, obj) -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 + if out.Values[i] == graphql.Null { + invalids++ + } + case "name": + + out.Values[i] = ec._GitlabBranch_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "protected": + + out.Values[i] = ec._GitlabBranch_protected(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "webUrl": + + out.Values[i] = ec._GitlabBranch_webUrl(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) } - }() - 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 { + out.Dispatch() + if invalids > 0 { return graphql.Null } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return out } -func (ec *executionContext) fieldContext___Type_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} +var gitlabGroupImplementors = []string{"GitlabGroup"} -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 +func (ec *executionContext) _GitlabGroup(ctx context.Context, sel ast.SelectionSet, obj *entities.GitlabGroup) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, gitlabGroupImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("GitlabGroup") + case "avatarUrl": + + out.Values[i] = ec._GitlabGroup_avatarUrl(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "fullName": + + out.Values[i] = ec._GitlabGroup_fullName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "id": + + out.Values[i] = ec._GitlabGroup_id(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) } - }() - 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 { + out.Dispatch() + if invalids > 0 { 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) + return out } -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) +var gitlabProjectImplementors = []string{"GitlabProject"} + +func (ec *executionContext) _GitlabProject(ctx context.Context, sel ast.SelectionSet, obj *entities.GitlabProject) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, gitlabProjectImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("GitlabProject") + case "archived": + + out.Values[i] = ec._GitlabProject_archived(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "avatarUrl": + + out.Values[i] = ec._GitlabProject_avatarUrl(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "createdAt": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._GitlabProject_createdAt(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "creatorId": + + out.Values[i] = ec._GitlabProject_creatorId(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "defaultBranch": + + out.Values[i] = ec._GitlabProject_defaultBranch(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "description": + + out.Values[i] = ec._GitlabProject_description(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "emptyRepo": + + out.Values[i] = ec._GitlabProject_emptyRepo(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "httpUrlToRepo": + + out.Values[i] = ec._GitlabProject_httpUrlToRepo(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "id": + + out.Values[i] = ec._GitlabProject_id(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "lastActivityAt": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._GitlabProject_lastActivityAt(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "name": + + out.Values[i] = ec._GitlabProject_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "nameWithNamespace": + + out.Values[i] = ec._GitlabProject_nameWithNamespace(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "path": + + out.Values[i] = ec._GitlabProject_path(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "pathWithNamespace": + + out.Values[i] = ec._GitlabProject_pathWithNamespace(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "public": + + out.Values[i] = ec._GitlabProject_public(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "sshUrlToRepo": + + out.Values[i] = ec._GitlabProject_sshUrlToRepo(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "tagList": + + out.Values[i] = ec._GitlabProject_tagList(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "topics": + + out.Values[i] = ec._GitlabProject_topics(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} + case "webUrl": -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 + out.Values[i] = ec._GitlabProject_webUrl(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + default: + panic("unknown field " + strconv.Quote(field.Name)) } - }() - 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 { + out.Dispatch() + if invalids > 0 { return graphql.Null } - res := resTmp.([]introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + return out } -func (ec *executionContext) fieldContext___Type_interfaces(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) +var matchFilterImplementors = []string{"MatchFilter"} + +func (ec *executionContext) _MatchFilter(ctx context.Context, sel ast.SelectionSet, obj *repos.MatchFilter) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, matchFilterImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("MatchFilter") + case "array": + + out.Values[i] = ec._MatchFilter_array(ctx, field, obj) + + case "exact": + + out.Values[i] = ec._MatchFilter_exact(ctx, field, obj) + + case "matchType": + + out.Values[i] = ec._MatchFilter_matchType(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} + case "regex": -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 + out.Values[i] = ec._MatchFilter_regex(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) } - }() - 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 { + out.Dispatch() + if invalids > 0 { return graphql.Null } - res := resTmp.([]introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + return out } -func (ec *executionContext) fieldContext___Type_possibleTypes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) +var metadataImplementors = []string{"Metadata"} + +func (ec *executionContext) _Metadata(ctx context.Context, sel ast.SelectionSet, obj *v1.ObjectMeta) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, metadataImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Metadata") + case "annotations": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Metadata_annotations(ctx, field, obj) + return res } - 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) -} + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "creationTimestamp": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Metadata_creationTimestamp(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "deletionTimestamp": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Metadata_deletionTimestamp(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "generation": + + out.Values[i] = ec._Metadata_generation(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "labels": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Metadata_labels(ctx, field, obj) + return 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) + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "name": + + out.Values[i] = ec._Metadata_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} + case "namespace": -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 + out.Values[i] = ec._Metadata_namespace(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) } - }() - 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 { + out.Dispatch() + if invalids > 0 { 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) + return out } -func (ec *executionContext) fieldContext___Type_inputFields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___InputValue_name(ctx, field) - case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) - }, - } - return fc, nil -} +var mutationImplementors = []string{"Mutation"} -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 +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", }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___Type_ofType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) + out := graphql.NewFieldSet(fields) + var invalids uint32 + 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 "cr_createRepo": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_cr_createRepo(ctx, field) + }) + + case "cr_createCred": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_cr_createCred(ctx, field) + }) + + case "cr_deleteRepo": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_cr_deleteRepo(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} + case "cr_deleteCred": -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 + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_cr_deleteCred(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "cr_deleteDigest": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_cr_deleteDigest(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "cr_addBuild": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_cr_addBuild(ctx, field) + }) + + case "cr_updateBuild": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_cr_updateBuild(ctx, field) + }) + + case "cr_deleteBuild": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_cr_deleteBuild(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "cr_triggerBuild": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_cr_triggerBuild(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "cr_addBuildCacheKey": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_cr_addBuildCacheKey(ctx, field) + }) + + case "cr_deleteBuildCacheKey": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_cr_deleteBuildCacheKey(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "cr_updateBuildCacheKey": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_cr_updateBuildCacheKey(ctx, field) + }) + + case "cr_listBuildsByBuildCacheId": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_cr_listBuildsByBuildCacheId(ctx, field) + }) + + default: + panic("unknown field " + strconv.Quote(field.Name)) } - }() - 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 { + out.Dispatch() + if invalids > 0 { return graphql.Null } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return out } -func (ec *executionContext) fieldContext___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} +var pageInfoImplementors = []string{"PageInfo"} -// endregion **************************** field.gotpl ***************************** +func (ec *executionContext) _PageInfo(ctx context.Context, sel ast.SelectionSet, obj *model.PageInfo) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, pageInfoImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("PageInfo") + case "endCursor": -// region **************************** input.gotpl ***************************** + out.Values[i] = ec._PageInfo_endCursor(ctx, field, obj) -func (ec *executionContext) unmarshalInputHarborRobotUserIn(ctx context.Context, obj interface{}) (entities.HarborRobotUser, error) { - var it entities.HarborRobotUser - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } + case "hasNextPage": - fieldsInOrder := [...]string{"spec", "apiVersion", "kind", "metadata"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "spec": - var err error + out.Values[i] = ec._PageInfo_hasNextPage(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) - it.Spec, err = ec.unmarshalOHarborRobotUserSpecIn2githubᚗcomᚋkloudliteᚋoperatorᚋapisᚋartifactsᚋv1ᚐHarborUserAccountSpec(ctx, v) - if err != nil { - return it, err - } - case "apiVersion": - var err error + case "hasPreviousPage": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) - it.APIVersion, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err - } - case "kind": - var err error + out.Values[i] = ec._PageInfo_hasPreviousPage(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) - it.Kind, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err - } - case "metadata": - var err error + case "startCursor": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) - it.ObjectMeta, err = ec.unmarshalNMetadataIn2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) - if err != nil { - return it, err - } + out.Values[i] = ec._PageInfo_startCursor(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -func (ec *executionContext) unmarshalInputHarborRobotUserSpecIn(ctx context.Context, obj interface{}) (v1.HarborUserAccountSpec, error) { - var it v1.HarborUserAccountSpec - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } +var paginationImplementors = []string{"Pagination"} - fieldsInOrder := [...]string{"accountName", "enabled", "harborProjectName", "permissions", "targetSecret"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue +func (ec *executionContext) _Pagination(ctx context.Context, sel ast.SelectionSet, obj *types.Pagination) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, paginationImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Pagination") + case "page": + + out.Values[i] = ec._Pagination_page(ctx, field, obj) + + case "per_page": + + out.Values[i] = ec._Pagination_per_page(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) } - switch k { - case "accountName": - var err error + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("accountName")) - it.AccountName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "enabled": - var err error +var queryImplementors = []string{"Query"} - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) - it.Enabled, err = ec.unmarshalOBoolean2bool(ctx, v) - if err != nil { - return it, err - } - case "harborProjectName": - var err error +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", + }) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("harborProjectName")) - it.HarborProjectName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "permissions": - var err error + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("permissions")) - data, err := ec.unmarshalOString2ᚕᚖstring(ctx, v) - if err != nil { - return it, err - } - if err = ec.resolvers.HarborRobotUserSpecIn().Permissions(ctx, &it, data); err != nil { - return it, err - } - case "targetSecret": - var err error + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Query") + case "cr_listRepos": + field := field - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetSecret")) - it.TargetSecret, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_cr_listRepos(ctx, field) + return res } - } - } - return it, nil -} + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } -func (ec *executionContext) unmarshalInputMetadataIn(ctx context.Context, obj interface{}) (v11.ObjectMeta, error) { - var it v11.ObjectMeta - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "cr_listCreds": + field := field - fieldsInOrder := [...]string{"name", "namespace", "labels", "annotations"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "name": - var err error + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_cr_listCreds(ctx, field) + return res + } - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - it.Name, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) } - case "namespace": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) - it.Namespace, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "cr_listDigests": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_cr_listDigests(ctx, field) + return res } - case "labels": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("labels")) - data, err := ec.unmarshalOJson2map(ctx, v) - if err != nil { - return it, err + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) } - if err = ec.resolvers.MetadataIn().Labels(ctx, &it, data); err != nil { - return it, err + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "cr_getCredToken": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_cr_getCredToken(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res } - case "annotations": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotations")) - data, err := ec.unmarshalOJson2map(ctx, v) - if err != nil { - return it, err + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) } - if err = ec.resolvers.MetadataIn().Annotations(ctx, &it, data); err != nil { - return it, err + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "cr_checkUserNameAvailability": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_cr_checkUserNameAvailability(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res } - } - } - return it, nil -} + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } -func (ec *executionContext) unmarshalInputOverridesIn(ctx context.Context, obj interface{}) (v12.JsonPatch, error) { - var it v12.JsonPatch - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "cr_getBuild": + field := field - fieldsInOrder := [...]string{"patches"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "patches": - var err error + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_cr_getBuild(ctx, field) + return res + } - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("patches")) - it.Patches, err = ec.unmarshalOPatchIn2ᚕgithubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋjsonᚑpatchᚐPatchOperationᚄ(ctx, v) - if err != nil { - return it, err + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) } - } - } - return it, nil -} + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "cr_listBuilds": + field := field -func (ec *executionContext) unmarshalInputPatchIn(ctx context.Context, obj interface{}) (json_patch.PatchOperation, error) { - var it json_patch.PatchOperation - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_cr_listBuilds(ctx, field) + return res + } - fieldsInOrder := [...]string{"op", "path", "value"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "op": - var err error + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("op")) - it.Op, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "cr_listGithubInstallations": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_cr_listGithubInstallations(ctx, field) + return res } - case "path": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("path")) - it.Path, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) } - case "value": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) - data, err := ec.unmarshalOAny2interface(ctx, v) - if err != nil { - return it, err + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "cr_listGithubRepos": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_cr_listGithubRepos(ctx, field) + return res } - if err = ec.resolvers.PatchIn().Value(ctx, &it, data); err != nil { - return it, err + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) } - } - } - return it, nil -} + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "cr_searchGithubRepos": + field := field -// endregion **************************** input.gotpl ***************************** + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_cr_searchGithubRepos(ctx, field) + return res + } -// region ************************** interface.gotpl *************************** + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } -// endregion ************************** interface.gotpl *************************** + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "cr_listGithubBranches": + field := field -// region **************************** object.gotpl **************************** + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_cr_listGithubBranches(ctx, field) + return res + } -var artifactImplementors = []string{"Artifact"} + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } -func (ec *executionContext) _Artifact(ctx context.Context, sel ast.SelectionSet, obj *harbor1.Artifact) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, artifactImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Artifact") - case "size": + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "cr_listGitlabGroups": + field := field - out.Values[i] = ec._Artifact_size(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_cr_listGitlabGroups(ctx, field) + return res + } - if out.Values[i] == graphql.Null { - invalids++ + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) } - case "tags": - out.Values[i] = ec._Artifact_tags(ctx, field, obj) + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "cr_listGitlabRepositories": + field := field - if out.Values[i] == graphql.Null { - invalids++ + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_cr_listGitlabRepositories(ctx, field) + return res } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var checkImplementors = []string{"Check"} -func (ec *executionContext) _Check(ctx context.Context, sel ast.SelectionSet, obj *operator.Check) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, checkImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Check") - case "status": + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } - out.Values[i] = ec._Check_status(ctx, field, obj) + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "cr_listGitlabBranches": + field := field - case "message": + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_cr_listGitlabBranches(ctx, field) + return res + } - out.Values[i] = ec._Check_message(ctx, field, obj) + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } - case "generation": + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "cr_listBuildCacheKeys": + field := field - out.Values[i] = ec._Check_generation(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_cr_listBuildCacheKeys(ctx, field) + return res + } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } -var harborRobotUserImplementors = []string{"HarborRobotUser"} + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "cr_listBuildRuns": + field := field -func (ec *executionContext) _HarborRobotUser(ctx context.Context, sel ast.SelectionSet, obj *entities.HarborRobotUser) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, harborRobotUserImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("HarborRobotUser") - case "syncStatus": + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_cr_listBuildRuns(ctx, field) + return res + } - out.Values[i] = ec._HarborRobotUser_syncStatus(ctx, field, obj) + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } - case "spec": + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "cr_getBuildRun": + field := field - out.Values[i] = ec._HarborRobotUser_spec(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_cr_getBuildRun(ctx, field) + return res + } - case "status": + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } - out.Values[i] = ec._HarborRobotUser_status(ctx, field, obj) + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "_service": + field := field - case "apiVersion": + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query__service(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } - out.Values[i] = ec._HarborRobotUser_apiVersion(ctx, field, obj) + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } - case "kind": + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "__type": - out.Values[i] = ec._HarborRobotUser_kind(ctx, field, obj) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + }) - case "metadata": + case "__schema": - out.Values[i] = ec._HarborRobotUser_metadata(ctx, field, obj) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___schema(ctx, field) + }) - if out.Values[i] == graphql.Null { - invalids++ - } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -6179,35 +24624,31 @@ func (ec *executionContext) _HarborRobotUser(ctx context.Context, sel ast.Select return out } -var harborRobotUserSpecImplementors = []string{"HarborRobotUserSpec"} +var repositoryImplementors = []string{"Repository"} -func (ec *executionContext) _HarborRobotUserSpec(ctx context.Context, sel ast.SelectionSet, obj *v1.HarborUserAccountSpec) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, harborRobotUserSpecImplementors) +func (ec *executionContext) _Repository(ctx context.Context, sel ast.SelectionSet, obj *entities.Repository) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, repositoryImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("HarborRobotUserSpec") + out.Values[i] = graphql.MarshalString("Repository") case "accountName": - out.Values[i] = ec._HarborRobotUserSpec_accountName(ctx, field, obj) + out.Values[i] = ec._Repository_accountName(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - case "enabled": + case "createdBy": - out.Values[i] = ec._HarborRobotUserSpec_enabled(ctx, field, obj) - - case "harborProjectName": - - out.Values[i] = ec._HarborRobotUserSpec_harborProjectName(ctx, field, obj) + out.Values[i] = ec._Repository_createdBy(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - case "permissions": + case "creationTime": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -6216,7 +24657,10 @@ func (ec *executionContext) _HarborRobotUserSpec(ctx context.Context, sel ast.Se ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._HarborRobotUserSpec_permissions(ctx, field, obj) + res = ec._Repository_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res } @@ -6224,53 +24668,52 @@ func (ec *executionContext) _HarborRobotUserSpec(ctx context.Context, sel ast.Se return innerFunc(ctx) }) - case "targetSecret": - - out.Values[i] = ec._HarborRobotUserSpec_targetSecret(ctx, field, obj) + case "id": + field := field - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Repository_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } -var imageTagImplementors = []string{"ImageTag"} + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) -func (ec *executionContext) _ImageTag(ctx context.Context, sel ast.SelectionSet, obj *harbor1.ImageTag) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, imageTagImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("ImageTag") - case "name": + }) + case "lastUpdatedBy": - out.Values[i] = ec._ImageTag_name(ctx, field, obj) + out.Values[i] = ec._Repository_lastUpdatedBy(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - case "signed": + case "markedForDeletion": + + out.Values[i] = ec._Repository_markedForDeletion(ctx, field, obj) - out.Values[i] = ec._ImageTag_signed(ctx, field, obj) + case "name": + + out.Values[i] = ec._Repository_name(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - case "immutable": + case "recordVersion": - out.Values[i] = ec._ImageTag_immutable(ctx, field, obj) + out.Values[i] = ec._Repository_recordVersion(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - case "pushedAt": + case "updateTime": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -6279,7 +24722,7 @@ func (ec *executionContext) _ImageTag(ctx context.Context, sel ast.SelectionSet, ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._ImageTag_pushedAt(ctx, field, obj) + res = ec._Repository_updateTime(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&invalids, 1) } @@ -6301,105 +24744,97 @@ func (ec *executionContext) _ImageTag(ctx context.Context, sel ast.SelectionSet, return out } -var metadataImplementors = []string{"Metadata"} +var repositoryEdgeImplementors = []string{"RepositoryEdge"} -func (ec *executionContext) _Metadata(ctx context.Context, sel ast.SelectionSet, obj *v11.ObjectMeta) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, metadataImplementors) +func (ec *executionContext) _RepositoryEdge(ctx context.Context, sel ast.SelectionSet, obj *model.RepositoryEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, repositoryEdgeImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Metadata") - case "name": + out.Values[i] = graphql.MarshalString("RepositoryEdge") + case "cursor": - out.Values[i] = ec._Metadata_name(ctx, field, obj) + out.Values[i] = ec._RepositoryEdge_cursor(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + invalids++ } - case "namespace": - - out.Values[i] = ec._Metadata_namespace(ctx, field, obj) + case "node": - case "labels": - field := field + out.Values[i] = ec._RepositoryEdge_node(ctx, field, obj) - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Metadata_labels(ctx, field, obj) - return res + if out.Values[i] == graphql.Null { + invalids++ } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) +var repositoryPaginatedRecordsImplementors = []string{"RepositoryPaginatedRecords"} - }) - case "annotations": - field := field +func (ec *executionContext) _RepositoryPaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.RepositoryPaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, repositoryPaginatedRecordsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("RepositoryPaginatedRecords") + case "edges": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Metadata_annotations(ctx, field, obj) - return res - } + out.Values[i] = ec._RepositoryPaginatedRecords_edges(ctx, field, obj) - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + if out.Values[i] == graphql.Null { + invalids++ + } + case "pageInfo": - }) - case "creationTimestamp": - field := field + out.Values[i] = ec._RepositoryPaginatedRecords_pageInfo(ctx, field, obj) - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Metadata_creationTimestamp(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res + if out.Values[i] == graphql.Null { + invalids++ } + case "totalCount": - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "deletionTimestamp": - field := field + out.Values[i] = ec._RepositoryPaginatedRecords_totalCount(ctx, field, obj) - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Metadata_deletionTimestamp(ctx, field, obj) - return res + if out.Values[i] == graphql.Null { + invalids++ } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) +var _ServiceImplementors = []string{"_Service"} - }) - case "generation": +func (ec *executionContext) __Service(ctx context.Context, sel ast.SelectionSet, obj *fedruntime.Service) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, _ServiceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("_Service") + case "sdl": - out.Values[i] = ec._Metadata_generation(ctx, field, obj) + out.Values[i] = ec.__Service_sdl(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -6411,60 +24846,44 @@ func (ec *executionContext) _Metadata(ctx context.Context, sel ast.SelectionSet, 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", - }) +var __DirectiveImplementors = []string{"__Directive"} +func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 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 "cr_createRobot": + out.Values[i] = graphql.MarshalString("__Directive") + case "name": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_cr_createRobot(ctx, field) - }) + out.Values[i] = ec.___Directive_name(ctx, field, obj) - case "cr_updateRobot": + if out.Values[i] == graphql.Null { + invalids++ + } + case "description": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_cr_updateRobot(ctx, field) - }) + out.Values[i] = ec.___Directive_description(ctx, field, obj) - case "cr_deleteRobot": + case "locations": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_cr_deleteRobot(ctx, field) - }) + out.Values[i] = ec.___Directive_locations(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "cr_resyncRobot": + case "args": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_cr_resyncRobot(ctx, field) - }) + out.Values[i] = ec.___Directive_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "cr_deleteRepo": + case "isRepeatable": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_cr_deleteRepo(ctx, field) - }) + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -6480,23 +24899,37 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) return out } -var overridesImplementors = []string{"Overrides"} +var __EnumValueImplementors = []string{"__EnumValue"} -func (ec *executionContext) _Overrides(ctx context.Context, sel ast.SelectionSet, obj *v12.JsonPatch) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, overridesImplementors) +func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Overrides") - case "applied": + out.Values[i] = graphql.MarshalString("__EnumValue") + case "name": + + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "description": + + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) - out.Values[i] = ec._Overrides_applied(ctx, field, obj) + case "isDeprecated": + + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) - case "patches": + if out.Values[i] == graphql.Null { + invalids++ + } + case "deprecationReason": - out.Values[i] = ec._Overrides_patches(ctx, field, obj) + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -6509,47 +24942,52 @@ func (ec *executionContext) _Overrides(ctx context.Context, sel ast.SelectionSet return out } -var patchImplementors = []string{"Patch"} +var __FieldImplementors = []string{"__Field"} -func (ec *executionContext) _Patch(ctx context.Context, sel ast.SelectionSet, obj *json_patch.PatchOperation) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, patchImplementors) +func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Patch") - case "op": + out.Values[i] = graphql.MarshalString("__Field") + case "name": - out.Values[i] = ec._Patch_op(ctx, field, obj) + out.Values[i] = ec.___Field_name(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + invalids++ } - case "path": + case "description": + + out.Values[i] = ec.___Field_description(ctx, field, obj) - out.Values[i] = ec._Patch_path(ctx, field, obj) + case "args": + + out.Values[i] = ec.___Field_args(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + invalids++ } - case "value": - field := field + case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Patch_value(ctx, field, obj) - return res + out.Values[i] = ec.___Field_type(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "isDeprecated": + + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } + case "deprecationReason": - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) - }) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -6561,128 +24999,37 @@ func (ec *executionContext) _Patch(ctx context.Context, sel ast.SelectionSet, ob 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", - }) +var __InputValueImplementors = []string{"__InputValue"} +func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 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 "cr_listRepos": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_cr_listRepos(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "cr_listArtifacts": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_cr_listArtifacts(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } + out.Values[i] = graphql.MarshalString("__InputValue") + case "name": - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "cr_listRobots": - field := field + out.Values[i] = ec.___InputValue_name(ctx, field, obj) - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_cr_listRobots(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res + if out.Values[i] == graphql.Null { + invalids++ } + case "description": - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } + out.Values[i] = ec.___InputValue_description(ctx, field, obj) - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "_service": - field := field + case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query__service(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } + out.Values[i] = ec.___InputValue_type(ctx, field, obj) - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + if out.Values[i] == graphql.Null { + invalids++ } + case "defaultValue": - out.Concurrently(i, func() 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) - }) + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -6695,40 +25042,45 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } -var repoImplementors = []string{"Repo"} +var __SchemaImplementors = []string{"__Schema"} -func (ec *executionContext) _Repo(ctx context.Context, sel ast.SelectionSet, obj *harbor1.Repository) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, repoImplementors) +func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Repo") - case "id": + out.Values[i] = graphql.MarshalString("__Schema") + case "description": - out.Values[i] = ec._Repo_id(ctx, field, obj) + out.Values[i] = ec.___Schema_description(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ - } - case "name": + case "types": - out.Values[i] = ec._Repo_name(ctx, field, obj) + out.Values[i] = ec.___Schema_types(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "artifactCount": + case "queryType": - out.Values[i] = ec._Repo_artifactCount(ctx, field, obj) + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "pullCount": + case "mutationType": + + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) + + case "subscriptionType": + + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) - out.Values[i] = ec._Repo_pullCount(ctx, field, obj) + case "directives": + + out.Values[i] = ec.___Schema_directives(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -6744,57 +25096,59 @@ func (ec *executionContext) _Repo(ctx context.Context, sel ast.SelectionSet, obj return out } -var statusImplementors = []string{"Status"} +var __TypeImplementors = []string{"__Type"} -func (ec *executionContext) _Status(ctx context.Context, sel ast.SelectionSet, obj *operator.Status) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, statusImplementors) +func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Status") - case "isReady": + out.Values[i] = graphql.MarshalString("__Type") + case "kind": - out.Values[i] = ec._Status_isReady(ctx, field, obj) + out.Values[i] = ec.___Type_kind(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + invalids++ } - case "checks": - field := field + case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Status_checks(ctx, field, obj) - return res - } + 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) - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + case "enumValues": - }) - case "displayVars": - field := field + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Status_displayVars(ctx, field, obj) - return res - } + case "inputFields": - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + 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)) } @@ -6806,433 +25160,817 @@ func (ec *executionContext) _Status(ctx context.Context, sel ast.SelectionSet, o return out } -var syncStatusImplementors = []string{"SyncStatus"} +// endregion **************************** object.gotpl **************************** -func (ec *executionContext) _SyncStatus(ctx context.Context, sel ast.SelectionSet, obj *types.SyncStatus) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, syncStatusImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("SyncStatus") - case "syncScheduledAt": - field := field +// region ***************************** type.gotpl ***************************** - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._SyncStatus_syncScheduledAt(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) +func (ec *executionContext) unmarshalNAny2interface(ctx context.Context, v interface{}) (any, error) { + res, err := graphql.UnmarshalAny(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNAny2interface(ctx context.Context, sel ast.SelectionSet, v any) 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 + } + res := graphql.MarshalAny(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) 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) marshalNBuild2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐBuild(ctx context.Context, sel ast.SelectionSet, v *entities.Build) 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._Build(ctx, sel, v) +} + +func (ec *executionContext) marshalNBuildCacheKey2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐBuildCacheKey(ctx context.Context, sel ast.SelectionSet, v *entities.BuildCacheKey) 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._BuildCacheKey(ctx, sel, v) +} + +func (ec *executionContext) marshalNBuildCacheKeyEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐBuildCacheKeyEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.BuildCacheKeyEdge) 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 } - return res + }() + if !isLen1 { + defer wg.Done() } + ret[i] = ec.marshalNBuildCacheKeyEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐBuildCacheKeyEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + } + wg.Wait() - }) - case "lastSyncedAt": - field := field + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._SyncStatus_lastSyncedAt(ctx, field, obj) - return res + return ret +} + +func (ec *executionContext) marshalNBuildCacheKeyEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐBuildCacheKeyEdge(ctx context.Context, sel ast.SelectionSet, v *model.BuildCacheKeyEdge) 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._BuildCacheKeyEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNBuildCacheKeyIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐBuildCacheKey(ctx context.Context, v interface{}) (entities.BuildCacheKey, error) { + res, err := ec.unmarshalInputBuildCacheKeyIn(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNBuildEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐBuildEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.BuildEdge) 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.marshalNBuildEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐBuildEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + } + wg.Wait() - }) - case "action": + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } - out.Values[i] = ec._SyncStatus_action(ctx, field, obj) + return ret +} - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "generation": +func (ec *executionContext) marshalNBuildEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐBuildEdge(ctx context.Context, sel ast.SelectionSet, v *model.BuildEdge) 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._BuildEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNBuildIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐBuild(ctx context.Context, v interface{}) (entities.Build, error) { + res, err := ec.unmarshalInputBuildIn(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec._SyncStatus_generation(ctx, field, obj) +func (ec *executionContext) marshalNBuildRun2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐBuildRun(ctx context.Context, sel ast.SelectionSet, v *entities.BuildRun) 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._BuildRun(ctx, sel, v) +} - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) +func (ec *executionContext) marshalNBuildRunEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐBuildRunEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.BuildRunEdge) 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() } - case "state": + ret[i] = ec.marshalNBuildRunEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐBuildRunEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - out.Values[i] = ec._SyncStatus_state(ctx, field, obj) + } + wg.Wait() - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "error": + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } - out.Values[i] = ec._SyncStatus_error(ctx, field, obj) + return ret +} - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNBuildRunEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐBuildRunEdge(ctx context.Context, sel ast.SelectionSet, v *model.BuildRunEdge) 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") } - } - out.Dispatch() - if invalids > 0 { return graphql.Null } - return out + return ec._BuildRunEdge(ctx, sel, v) } -var _ServiceImplementors = []string{"_Service"} - -func (ec *executionContext) __Service(ctx context.Context, sel ast.SelectionSet, obj *fedruntime.Service) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, _ServiceImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("_Service") - case "sdl": - - out.Values[i] = ec.__Service_sdl(ctx, field, obj) +func (ec *executionContext) marshalNCRCheckNameAvailabilityOutput2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚐCheckNameAvailabilityOutput(ctx context.Context, sel ast.SelectionSet, v domain.CheckNameAvailabilityOutput) graphql.Marshaler { + return ec._CRCheckNameAvailabilityOutput(ctx, sel, &v) +} - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNCRCheckNameAvailabilityOutput2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚐCheckNameAvailabilityOutput(ctx context.Context, sel ast.SelectionSet, v *domain.CheckNameAvailabilityOutput) 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") } - } - out.Dispatch() - if invalids > 0 { return graphql.Null } - return out + return ec._CRCheckNameAvailabilityOutput(ctx, sel, v) } -var __DirectiveImplementors = []string{"__Directive"} - -func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Directive") - case "name": - - out.Values[i] = ec.___Directive_name(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "description": - - out.Values[i] = ec.___Directive_description(ctx, field, obj) - - case "locations": - - out.Values[i] = ec.___Directive_locations(ctx, field, obj) +func (ec *executionContext) marshalNCredential2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐCredential(ctx context.Context, sel ast.SelectionSet, v *entities.Credential) 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._Credential(ctx, sel, v) +} - if out.Values[i] == graphql.Null { - invalids++ +func (ec *executionContext) marshalNCredentialEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐCredentialEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.CredentialEdge) 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() } - case "args": + ret[i] = ec.marshalNCredentialEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐCredentialEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - out.Values[i] = ec.___Directive_args(ctx, field, obj) + } + wg.Wait() - if out.Values[i] == graphql.Null { - invalids++ - } - case "isRepeatable": + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } - out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) + return ret +} - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNCredentialEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐCredentialEdge(ctx context.Context, sel ast.SelectionSet, v *model.CredentialEdge) 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") } - } - out.Dispatch() - if invalids > 0 { return graphql.Null } - return out + return ec._CredentialEdge(ctx, sel, v) } -var __EnumValueImplementors = []string{"__EnumValue"} - -func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__EnumValue") - case "name": - - out.Values[i] = ec.___EnumValue_name(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "description": - - out.Values[i] = ec.___EnumValue_description(ctx, field, obj) - - case "isDeprecated": - - out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "deprecationReason": +func (ec *executionContext) unmarshalNCredentialIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐCredential(ctx context.Context, v interface{}) (entities.Credential, error) { + res, err := ec.unmarshalInputCredentialIn(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) +func (ec *executionContext) unmarshalNDate2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNDate2string(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") } } - out.Dispatch() - if invalids > 0 { + return res +} + +func (ec *executionContext) marshalNDigest2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐDigest(ctx context.Context, sel ast.SelectionSet, v *entities.Digest) 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 out + return ec._Digest(ctx, sel, v) } -var __FieldImplementors = []string{"__Field"} - -func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Field") - case "name": - - out.Values[i] = ec.___Field_name(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ +func (ec *executionContext) marshalNDigestEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐDigestEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.DigestEdge) 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() } - case "description": - - out.Values[i] = ec.___Field_description(ctx, field, obj) - - case "args": - - out.Values[i] = ec.___Field_args(ctx, field, obj) + ret[i] = ec.marshalNDigestEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐDigestEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - if out.Values[i] == graphql.Null { - invalids++ - } - case "type": + } + wg.Wait() - out.Values[i] = ec.___Field_type(ctx, field, obj) + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } - if out.Values[i] == graphql.Null { - invalids++ - } - case "isDeprecated": + return ret +} - out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) +func (ec *executionContext) marshalNDigestEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐDigestEdge(ctx context.Context, sel ast.SelectionSet, v *model.DigestEdge) 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._DigestEdge(ctx, sel, v) +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "deprecationReason": +func (ec *executionContext) unmarshalNFloat2float64(ctx context.Context, v interface{}) (float64, error) { + res, err := graphql.UnmarshalFloatContext(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) +func (ec *executionContext) marshalNFloat2float64(ctx context.Context, sel ast.SelectionSet, v float64) graphql.Marshaler { + res := graphql.MarshalFloatContext(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 graphql.WrapContextMarshaler(ctx, res) +} - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNGitBranch2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐGitBranch(ctx context.Context, sel ast.SelectionSet, v *entities.GitBranch) 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 } - out.Dispatch() - if invalids > 0 { + return ec._GitBranch(ctx, sel, v) +} + +func (ec *executionContext) marshalNGithubInstallation2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐGithubInstallation(ctx context.Context, sel ast.SelectionSet, v *entities.GithubInstallation) 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 out + return ec._GithubInstallation(ctx, sel, v) } -var __InputValueImplementors = []string{"__InputValue"} +func (ec *executionContext) unmarshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__BuildStatus2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatus(ctx context.Context, v interface{}) (model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatus, error) { + var res model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatus + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} -func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__InputValue") - case "name": +func (ec *executionContext) marshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__BuildStatus2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatus(ctx context.Context, sel ast.SelectionSet, v model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatus) graphql.Marshaler { + return v +} - out.Values[i] = ec.___InputValue_name(ctx, field, obj) +func (ec *executionContext) marshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpiration(ctx context.Context, sel ast.SelectionSet, v model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpiration) graphql.Marshaler { + return ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration(ctx, sel, &v) +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "description": +func (ec *executionContext) marshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpiration(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpiration) 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._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration(ctx, sel, v) +} - out.Values[i] = ec.___InputValue_description(ctx, field, obj) +func (ec *executionContext) unmarshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationIn(ctx context.Context, v interface{}) (model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationIn(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} - case "type": +func (ec *executionContext) unmarshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___InputValue_type(ctx, field, obj) +func (ec *executionContext) unmarshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationUnit2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnit(ctx context.Context, v interface{}) (model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnit, error) { + var res model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnit + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "defaultValue": +func (ec *executionContext) marshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationUnit2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnit(ctx context.Context, sel ast.SelectionSet, v model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnit) graphql.Marshaler { + return v +} - out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) +func (ec *executionContext) unmarshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitProvider2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitProvider(ctx context.Context, v interface{}) (model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitProvider, error) { + var res model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitProvider + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitProvider2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitProvider(ctx context.Context, sel ast.SelectionSet, v model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitProvider) graphql.Marshaler { + return v +} + +func (ec *executionContext) marshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitSource(ctx context.Context, sel ast.SelectionSet, v model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitSource) graphql.Marshaler { + return ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource(ctx, sel, &v) +} + +func (ec *executionContext) marshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitSource(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitSource) 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") } - } - out.Dispatch() - if invalids > 0 { return graphql.Null } - return out + return ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource(ctx, sel, v) } -var __SchemaImplementors = []string{"__Schema"} +func (ec *executionContext) unmarshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSourceIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitSourceIn(ctx context.Context, v interface{}) (model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitSourceIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSourceIn(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} -func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Schema") - case "description": +func (ec *executionContext) unmarshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitSourceIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitSourceIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSourceIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___Schema_description(ctx, field, obj) +func (ec *executionContext) marshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository(ctx context.Context, sel ast.SelectionSet, v []*model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository) 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.marshalOGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - case "types": + } + wg.Wait() - out.Values[i] = ec.___Schema_types(ctx, field, obj) + return ret +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "queryType": +func (ec *executionContext) unmarshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__RepoAccess2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesRepoAccess(ctx context.Context, v interface{}) (model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesRepoAccess, error) { + var res model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesRepoAccess + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___Schema_queryType(ctx, field, obj) +func (ec *executionContext) marshalNGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__RepoAccess2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesRepoAccess(ctx context.Context, sel ast.SelectionSet, v model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesRepoAccess) graphql.Marshaler { + return v +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "mutationType": +func (ec *executionContext) marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx context.Context, sel ast.SelectionSet, v common.CreatedOrUpdatedBy) graphql.Marshaler { + return ec._Github__com___kloudlite___api___common__CreatedOrUpdatedBy(ctx, sel, &v) +} - out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) +func (ec *executionContext) unmarshalNGithub__com___kloudlite___api___pkg___types__SyncAction2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIPkgTypesSyncAction(ctx context.Context, v interface{}) (model.GithubComKloudliteAPIPkgTypesSyncAction, error) { + var res model.GithubComKloudliteAPIPkgTypesSyncAction + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} - case "subscriptionType": +func (ec *executionContext) marshalNGithub__com___kloudlite___api___pkg___types__SyncAction2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIPkgTypesSyncAction(ctx context.Context, sel ast.SelectionSet, v model.GithubComKloudliteAPIPkgTypesSyncAction) graphql.Marshaler { + return v +} - out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) +func (ec *executionContext) unmarshalNGithub__com___kloudlite___api___pkg___types__SyncState2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIPkgTypesSyncState(ctx context.Context, v interface{}) (model.GithubComKloudliteAPIPkgTypesSyncState, error) { + var res model.GithubComKloudliteAPIPkgTypesSyncState + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} - case "directives": +func (ec *executionContext) marshalNGithub__com___kloudlite___api___pkg___types__SyncState2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIPkgTypesSyncState(ctx context.Context, sel ast.SelectionSet, v model.GithubComKloudliteAPIPkgTypesSyncState) graphql.Marshaler { + return v +} - out.Values[i] = ec.___Schema_directives(ctx, field, obj) +func (ec *executionContext) marshalNGithub__com___kloudlite___api___pkg___types__SyncStatus2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIPkgTypesSyncStatus(ctx context.Context, sel ast.SelectionSet, v model.GithubComKloudliteAPIPkgTypesSyncStatus) graphql.Marshaler { + return ec._Github__com___kloudlite___api___pkg___types__SyncStatus(ctx, sel, &v) +} - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNGithub__com___kloudlite___api___pkg___types__SyncStatus2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIPkgTypesSyncStatus(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteAPIPkgTypesSyncStatus) 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 } - out.Dispatch() - if invalids > 0 { + return ec._Github__com___kloudlite___api___pkg___types__SyncStatus(ctx, sel, v) +} + +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisDistributionV1BuildRunSpec(ctx context.Context, sel ast.SelectionSet, v model.GithubComKloudliteOperatorApisDistributionV1BuildRunSpec) graphql.Marshaler { + return ec._Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec(ctx, sel, &v) +} + +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisDistributionV1BuildRunSpec(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisDistributionV1BuildRunSpec) 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 out + return ec._Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec(ctx, sel, v) } -var __TypeImplementors = []string{"__Type"} +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___distribution___v1__BuildRunSpecIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisDistributionV1BuildRunSpecIn(ctx context.Context, v interface{}) (model.GithubComKloudliteOperatorApisDistributionV1BuildRunSpecIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___distribution___v1__BuildRunSpecIn(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} -func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Type") - case "kind": +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___distribution___v1__BuildRunSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisDistributionV1BuildRunSpecIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisDistributionV1BuildRunSpecIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___distribution___v1__BuildRunSpecIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___Type_kind(ctx, field, obj) +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___distribution___v1__Registry2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisDistributionV1Registry(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisDistributionV1Registry) 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._Github__com___kloudlite___operator___apis___distribution___v1__Registry(ctx, sel, v) +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "name": +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___distribution___v1__RegistryIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisDistributionV1RegistryIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisDistributionV1RegistryIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___distribution___v1__RegistryIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___Type_name(ctx, field, obj) +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___distribution___v1__Repo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisDistributionV1Repo(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisDistributionV1Repo) 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._Github__com___kloudlite___operator___apis___distribution___v1__Repo(ctx, sel, v) +} - case "description": +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___distribution___v1__RepoIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisDistributionV1RepoIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisDistributionV1RepoIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___distribution___v1__RepoIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___Type_description(ctx, field, obj) +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___distribution___v1__Resource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisDistributionV1Resource(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisDistributionV1Resource) 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._Github__com___kloudlite___operator___apis___distribution___v1__Resource(ctx, sel, v) +} - case "fields": +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___distribution___v1__ResourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisDistributionV1ResourceIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisDistributionV1ResourceIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___distribution___v1__ResourceIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___Type_fields(ctx, field, obj) +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___pkg___operator__ResourceRef2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorResourceRef(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorPkgOperatorResourceRef) 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._Github__com___kloudlite___operator___pkg___operator__ResourceRef(ctx, sel, v) +} - case "interfaces": +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___pkg___operator__ResourceRefIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorResourceRefIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorPkgOperatorResourceRefIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___pkg___operator__ResourceRefIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___Type_interfaces(ctx, field, obj) +func (ec *executionContext) marshalNGitlabGroup2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐGitlabGroup(ctx context.Context, sel ast.SelectionSet, v *entities.GitlabGroup) 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._GitlabGroup(ctx, sel, v) +} - case "possibleTypes": +func (ec *executionContext) marshalNGitlabProject2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐGitlabProject(ctx context.Context, sel ast.SelectionSet, v *entities.GitlabProject) 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._GitlabProject(ctx, sel, v) +} - out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) +func (ec *executionContext) unmarshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx context.Context, v interface{}) (repos.ID, error) { + tmp, err := graphql.UnmarshalString(v) + res := repos.ID(tmp) + return res, graphql.ErrorOnPath(ctx, err) +} - case "enumValues": +func (ec *executionContext) marshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx context.Context, sel ast.SelectionSet, v repos.ID) graphql.Marshaler { + res := graphql.MarshalString(string(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 +} - out.Values[i] = ec.___Type_enumValues(ctx, field, obj) +func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v interface{}) (int, error) { + res, err := graphql.UnmarshalInt(v) + return res, graphql.ErrorOnPath(ctx, err) +} - case "inputFields": +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 +} - out.Values[i] = ec.___Type_inputFields(ctx, field, obj) +func (ec *executionContext) unmarshalNInt2int64(ctx context.Context, v interface{}) (int64, error) { + res, err := graphql.UnmarshalInt64(v) + return res, graphql.ErrorOnPath(ctx, err) +} - case "ofType": +func (ec *executionContext) marshalNInt2int64(ctx context.Context, sel ast.SelectionSet, v int64) graphql.Marshaler { + res := graphql.MarshalInt64(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 +} - out.Values[i] = ec.___Type_ofType(ctx, field, obj) +func (ec *executionContext) unmarshalNMap2map(ctx context.Context, v interface{}) (map[string]interface{}, error) { + res, err := graphql.UnmarshalMap(v) + return res, graphql.ErrorOnPath(ctx, err) +} - case "specifiedByURL": +func (ec *executionContext) marshalNMap2map(ctx context.Context, sel ast.SelectionSet, v map[string]interface{}) 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 + } + res := graphql.MarshalMap(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 +} - out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) +func (ec *executionContext) unmarshalNMatchFilterMatchType2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchType(ctx context.Context, v interface{}) (repos.MatchType, error) { + tmp, err := graphql.UnmarshalString(v) + res := repos.MatchType(tmp) + return res, graphql.ErrorOnPath(ctx, err) +} - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNMatchFilterMatchType2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchType(ctx context.Context, sel ast.SelectionSet, v repos.MatchType) graphql.Marshaler { + res := graphql.MarshalString(string(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") } } - out.Dispatch() - if invalids > 0 { + return res +} + +func (ec *executionContext) marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx context.Context, sel ast.SelectionSet, v *model.PageInfo) 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 out + return ec._PageInfo(ctx, sel, v) } -// endregion **************************** object.gotpl **************************** - -// region ***************************** type.gotpl ***************************** +func (ec *executionContext) marshalNRepository2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐRepository(ctx context.Context, sel ast.SelectionSet, v *entities.Repository) 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._Repository(ctx, sel, v) +} -func (ec *executionContext) marshalNArtifact2ᚕᚖkloudliteᚗioᚋpkgᚋharborᚐArtifactᚄ(ctx context.Context, sel ast.SelectionSet, v []*harbor1.Artifact) graphql.Marshaler { +func (ec *executionContext) marshalNRepositoryEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐRepositoryEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.RepositoryEdge) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -7256,7 +25994,7 @@ func (ec *executionContext) marshalNArtifact2ᚕᚖkloudliteᚗioᚋpkgᚋharbor if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNArtifact2ᚖkloudliteᚗioᚋpkgᚋharborᚐArtifact(ctx, sel, v[i]) + ret[i] = ec.marshalNRepositoryEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐRepositoryEdge(ctx, sel, v[i]) } if isLen1 { f(i) @@ -7276,23 +26014,28 @@ func (ec *executionContext) marshalNArtifact2ᚕᚖkloudliteᚗioᚋpkgᚋharbor return ret } -func (ec *executionContext) marshalNArtifact2ᚖkloudliteᚗioᚋpkgᚋharborᚐArtifact(ctx context.Context, sel ast.SelectionSet, v *harbor1.Artifact) graphql.Marshaler { +func (ec *executionContext) marshalNRepositoryEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐRepositoryEdge(ctx context.Context, sel ast.SelectionSet, v *model.RepositoryEdge) 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._Artifact(ctx, sel, v) + return ec._RepositoryEdge(ctx, sel, v) } -func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { - res, err := graphql.UnmarshalBoolean(v) +func (ec *executionContext) unmarshalNRepositoryIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐRepository(ctx context.Context, v interface{}) (entities.Repository, error) { + res, err := ec.unmarshalInputRepositoryIn(ctx, 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) +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") @@ -7301,29 +26044,45 @@ func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.Se return res } -func (ec *executionContext) unmarshalNDate2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(v) - return res, graphql.ErrorOnPath(ctx, err) +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) marshalNDate2string(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") +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 res + + return ret } -func (ec *executionContext) unmarshalNHarborPermission2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋharborᚐPermission(ctx context.Context, v interface{}) (harbor.Permission, error) { - tmp, err := graphql.UnmarshalString(v) - res := harbor.Permission(tmp) +func (ec *executionContext) unmarshalN_FieldSet2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNHarborPermission2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋharborᚐPermission(ctx context.Context, sel ast.SelectionSet, v harbor.Permission) graphql.Marshaler { - res := graphql.MarshalString(string(v)) +func (ec *executionContext) marshalN_FieldSet2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalString(v) if res == graphql.Null { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") @@ -7332,7 +26091,15 @@ func (ec *executionContext) marshalNHarborPermission2githubᚗcomᚋkloudliteᚋ return res } -func (ec *executionContext) marshalNHarborRobotUser2ᚕᚖkloudliteᚗioᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐHarborRobotUserᚄ(ctx context.Context, sel ast.SelectionSet, v []*entities.HarborRobotUser) graphql.Marshaler { +func (ec *executionContext) marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx context.Context, sel ast.SelectionSet, v fedruntime.Service) graphql.Marshaler { + return ec.__Service(ctx, sel, &v) +} + +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 @@ -7356,7 +26123,7 @@ func (ec *executionContext) marshalNHarborRobotUser2ᚕᚖkloudliteᚗioᚋapps if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNHarborRobotUser2ᚖkloudliteᚗioᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐHarborRobotUser(ctx, sel, v[i]) + ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) } if isLen1 { f(i) @@ -7376,26 +26143,39 @@ func (ec *executionContext) marshalNHarborRobotUser2ᚕᚖkloudliteᚗioᚋapps return ret } -func (ec *executionContext) marshalNHarborRobotUser2ᚖkloudliteᚗioᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐHarborRobotUser(ctx context.Context, sel ast.SelectionSet, v *entities.HarborRobotUser) graphql.Marshaler { - if v == nil { +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 graphql.Null } - return ec._HarborRobotUser(ctx, sel, v) -} - -func (ec *executionContext) unmarshalNHarborRobotUserIn2kloudliteᚗioᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐHarborRobotUser(ctx context.Context, v interface{}) (entities.HarborRobotUser, error) { - res, err := ec.unmarshalInputHarborRobotUserIn(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) + return res } -func (ec *executionContext) marshalNImageTag2kloudliteᚗioᚋpkgᚋharborᚐImageTag(ctx context.Context, sel ast.SelectionSet, v harbor1.ImageTag) graphql.Marshaler { - return ec._ImageTag(ctx, sel, &v) +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) marshalNImageTag2ᚕkloudliteᚗioᚋpkgᚋharborᚐImageTagᚄ(ctx context.Context, sel ast.SelectionSet, v []harbor1.ImageTag) graphql.Marshaler { +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 @@ -7419,7 +26199,7 @@ func (ec *executionContext) marshalNImageTag2ᚕkloudliteᚗioᚋpkgᚋharborᚐ if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNImageTag2kloudliteᚗioᚋpkgᚋharborᚐImageTag(ctx, sel, v[i]) + ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i]) } if isLen1 { f(i) @@ -7439,55 +26219,67 @@ func (ec *executionContext) marshalNImageTag2ᚕkloudliteᚗioᚋpkgᚋharborᚐ return ret } -func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v interface{}) (int, error) { - res, err := graphql.UnmarshalInt(v) - return res, graphql.ErrorOnPath(ctx, err) +func (ec *executionContext) 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) 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) 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) unmarshalNInt2int64(ctx context.Context, v interface{}) (int64, error) { - res, err := graphql.UnmarshalInt64(v) - return res, graphql.ErrorOnPath(ctx, err) +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) marshalNInt2int64(ctx context.Context, sel ast.SelectionSet, v int64) graphql.Marshaler { - res := graphql.MarshalInt64(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") - } +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)) } - return res -} + 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) + } -func (ec *executionContext) marshalNMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx context.Context, sel ast.SelectionSet, v v11.ObjectMeta) graphql.Marshaler { - return ec._Metadata(ctx, sel, &v) -} + } + wg.Wait() -func (ec *executionContext) unmarshalNMetadataIn2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx context.Context, v interface{}) (v11.ObjectMeta, error) { - res, err := ec.unmarshalInputMetadataIn(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) -} + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } -func (ec *executionContext) marshalNPatch2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋjsonᚑpatchᚐPatchOperation(ctx context.Context, sel ast.SelectionSet, v json_patch.PatchOperation) graphql.Marshaler { - return ec._Patch(ctx, sel, &v) + return ret } -func (ec *executionContext) unmarshalNPatchIn2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋjsonᚑpatchᚐPatchOperation(ctx context.Context, v interface{}) (json_patch.PatchOperation, error) { - res, err := ec.unmarshalInputPatchIn(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) +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) marshalNRepo2ᚕᚖkloudliteᚗioᚋpkgᚋharborᚐRepositoryᚄ(ctx context.Context, sel ast.SelectionSet, v []*harbor1.Repository) graphql.Marshaler { +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 @@ -7511,7 +26303,7 @@ func (ec *executionContext) marshalNRepo2ᚕᚖkloudliteᚗioᚋpkgᚋharborᚐR if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNRepo2ᚖkloudliteᚗioᚋpkgᚋharborᚐRepository(ctx, sel, v[i]) + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) } if isLen1 { f(i) @@ -7531,22 +26323,22 @@ func (ec *executionContext) marshalNRepo2ᚕᚖkloudliteᚗioᚋpkgᚋharborᚐR return ret } -func (ec *executionContext) marshalNRepo2ᚖkloudliteᚗioᚋpkgᚋharborᚐRepository(ctx context.Context, sel ast.SelectionSet, v *harbor1.Repository) graphql.Marshaler { +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._Repo(ctx, sel, v) + return ec.___Type(ctx, sel, v) } -func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { +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) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { +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)) { @@ -7556,138 +26348,188 @@ func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.S return res } -func (ec *executionContext) unmarshalNSyncAction2kloudliteᚗioᚋpkgᚋtypesᚐSyncAction(ctx context.Context, v interface{}) (types.SyncAction, error) { - tmp, err := graphql.UnmarshalString(v) - res := types.SyncAction(tmp) +func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v interface{}) (interface{}, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalAny(v) return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNSyncAction2kloudliteᚗioᚋpkgᚋtypesᚐSyncAction(ctx context.Context, sel ast.SelectionSet, v types.SyncAction) graphql.Marshaler { - res := graphql.MarshalString(string(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") - } +func (ec *executionContext) marshalOAny2interface(ctx context.Context, sel ast.SelectionSet, v interface{}) graphql.Marshaler { + if v == nil { + return graphql.Null } + res := graphql.MarshalAny(v) return res } -func (ec *executionContext) unmarshalNSyncState2kloudliteᚗioᚋpkgᚋtypesᚐSyncState(ctx context.Context, v interface{}) (types.SyncState, error) { - tmp, err := graphql.UnmarshalString(v) - res := types.SyncState(tmp) - return res, graphql.ErrorOnPath(ctx, err) +func (ec *executionContext) unmarshalOAny2ᚕinterfaceᚄ(ctx context.Context, v interface{}) ([]any, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]any, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNAny2interface(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil } -func (ec *executionContext) marshalNSyncState2kloudliteᚗioᚋpkgᚋtypesᚐSyncState(ctx context.Context, sel ast.SelectionSet, v types.SyncState) graphql.Marshaler { - res := graphql.MarshalString(string(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") +func (ec *executionContext) marshalOAny2ᚕinterfaceᚄ(ctx context.Context, sel ast.SelectionSet, v []any) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNAny2interface(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null } } - return res + + return ret } -func (ec *executionContext) unmarshalN_FieldSet2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(v) +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) marshalN_FieldSet2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - res := graphql.MarshalString(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } +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) marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx context.Context, sel ast.SelectionSet, v fedruntime.Service) graphql.Marshaler { - return ec.__Service(ctx, sel, &v) +func (ec *executionContext) marshalOBuild2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐBuild(ctx context.Context, sel ast.SelectionSet, v *entities.Build) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Build(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) marshalOBuildCacheKey2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐBuildCacheKey(ctx context.Context, sel ast.SelectionSet, v *entities.BuildCacheKey) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._BuildCacheKey(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)) +func (ec *executionContext) marshalOBuildCacheKeyPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐBuildCacheKeyPaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.BuildCacheKeyPaginatedRecords) graphql.Marshaler { + if v == nil { + return graphql.Null } - 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) - } + return ec._BuildCacheKeyPaginatedRecords(ctx, sel, v) +} + +func (ec *executionContext) marshalOBuildPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐBuildPaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.BuildPaginatedRecords) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._BuildPaginatedRecords(ctx, sel, v) +} +func (ec *executionContext) marshalOBuildRun2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐBuildRun(ctx context.Context, sel ast.SelectionSet, v *entities.BuildRun) graphql.Marshaler { + if v == nil { + return graphql.Null } - wg.Wait() + return ec._BuildRun(ctx, sel, v) +} - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } +func (ec *executionContext) marshalOBuildRunPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐBuildRunPaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.BuildRunPaginatedRecords) graphql.Marshaler { + if v == nil { + return graphql.Null } + return ec._BuildRunPaginatedRecords(ctx, sel, v) +} - return ret +func (ec *executionContext) marshalOCredential2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐCredential(ctx context.Context, sel ast.SelectionSet, v *entities.Credential) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Credential(ctx, sel, v) } -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) marshalOCredentialPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐCredentialPaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.CredentialPaginatedRecords) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._CredentialPaginatedRecords(ctx, sel, v) } -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") - } +func (ec *executionContext) unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx context.Context, v interface{}) (*repos.CursorPagination, error) { + if v == nil { + return nil, nil } + res, err := ec.unmarshalInputCursorPaginationIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOCursorPaginationSortDirection2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐSortDirection(ctx context.Context, v interface{}) (repos.SortDirection, error) { + tmp, err := graphql.UnmarshalString(v) + res := repos.SortDirection(tmp) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOCursorPaginationSortDirection2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐSortDirection(ctx context.Context, sel ast.SelectionSet, v repos.SortDirection) graphql.Marshaler { + res := graphql.MarshalString(string(v)) 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) +func (ec *executionContext) unmarshalODate2ᚖstring(ctx context.Context, v interface{}) (*string, error) { + if v == nil { + return nil, nil } - 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 - } + res, err := graphql.UnmarshalString(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalODate2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { + if v == nil { + return graphql.Null } - return res, nil + res := graphql.MarshalString(*v) + return res } -func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { +func (ec *executionContext) marshalODigestPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐDigestPaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.DigestPaginatedRecords) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._DigestPaginatedRecords(ctx, sel, v) +} + +func (ec *executionContext) marshalOGitBranch2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐGitBranchᚄ(ctx context.Context, sel ast.SelectionSet, v []*entities.GitBranch) graphql.Marshaler { + if v == nil { + return graphql.Null + } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -7711,7 +26553,7 @@ func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i]) + ret[i] = ec.marshalNGitBranch2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐGitBranch(ctx, sel, v[i]) } if isLen1 { f(i) @@ -7731,19 +26573,10 @@ func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context 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 { +func (ec *executionContext) marshalOGithubInstallation2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐGithubInstallationᚄ(ctx context.Context, sel ast.SelectionSet, v []*entities.GithubInstallation) graphql.Marshaler { + if v == nil { + return graphql.Null + } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -7767,7 +26600,7 @@ func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋg if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + ret[i] = ec.marshalNGithubInstallation2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐGithubInstallation(ctx, sel, v[i]) } if isLen1 { f(i) @@ -7787,11 +26620,60 @@ func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋg 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) marshalOGithubListRepository2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐGithubListRepository(ctx context.Context, sel ast.SelectionSet, v *entities.GithubListRepository) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._GithubListRepository(ctx, sel, v) +} + +func (ec *executionContext) marshalOGithubSearchRepository2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐGithubSearchRepository(ctx context.Context, sel ast.SelectionSet, v *entities.GithubSearchRepository) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._GithubSearchRepository(ctx, sel, v) +} + +func (ec *executionContext) marshalOGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository(ctx, sel, v) +} + +func (ec *executionContext) marshalOGithub__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubUserAccount(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubUserAccount) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount(ctx, sel, v) +} + +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___distribution___v1__BuildOptions2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisDistributionV1BuildOptions(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisDistributionV1BuildOptions) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___distribution___v1__BuildOptionsIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisDistributionV1BuildOptionsIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisDistributionV1BuildOptionsIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___distribution___v1__BuildOptionsIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisDistributionV1BuildRunSpec(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisDistributionV1BuildRunSpec) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec(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 { +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___pkg___operator__ResourceRef2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorResourceRefᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GithubComKloudliteOperatorPkgOperatorResourceRef) graphql.Marshaler { + if v == nil { + return graphql.Null + } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -7815,7 +26697,7 @@ func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgen if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + ret[i] = ec.marshalNGithub__com___kloudlite___operator___pkg___operator__ResourceRef2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorResourceRef(ctx, sel, v[i]) } if isLen1 { f(i) @@ -7835,110 +26717,96 @@ func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgen 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 { +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___pkg___operator__ResourceRefIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorResourceRefInᚄ(ctx context.Context, v interface{}) ([]*model.GithubComKloudliteOperatorPkgOperatorResourceRefIn, error) { 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 nil, nil } - 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") + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.GithubComKloudliteOperatorPkgOperatorResourceRefIn, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNGithub__com___kloudlite___operator___pkg___operator__ResourceRefIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorResourceRefIn(ctx, vSlice[i]) + if err != nil { + return nil, err } } - return res + return res, nil } -func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v interface{}) (interface{}, error) { +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___pkg___operator__Status2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorStatus(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorPkgOperatorStatus) graphql.Marshaler { if v == nil { - return nil, nil + return graphql.Null } - res, err := graphql.UnmarshalAny(v) - return res, graphql.ErrorOnPath(ctx, err) + return ec._Github__com___kloudlite___operator___pkg___operator__Status(ctx, sel, v) } -func (ec *executionContext) marshalOAny2interface(ctx context.Context, sel ast.SelectionSet, v interface{}) graphql.Marshaler { +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___pkg___raw____json__RawJson2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgRawJSONRawJSON(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorPkgRawJSONRawJSON) graphql.Marshaler { if v == nil { return graphql.Null } - res := graphql.MarshalAny(v) - 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 + return ec._Github__com___kloudlite___operator___pkg___raw____json__RawJson(ctx, sel, v) } -func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v interface{}) (*bool, error) { +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___pkg___raw____json__RawJsonIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgRawJSONRawJSONIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorPkgRawJSONRawJSONIn, error) { if v == nil { return nil, nil } - res, err := graphql.UnmarshalBoolean(v) + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___pkg___raw____json__RawJsonIn(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { +func (ec *executionContext) marshalOGitlabGroup2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐGitlabGroupᚄ(ctx context.Context, sel ast.SelectionSet, v []*entities.GitlabGroup) graphql.Marshaler { if v == nil { return graphql.Null } - res := graphql.MarshalBoolean(*v) - return res -} - -func (ec *executionContext) unmarshalODate2ᚖstring(ctx context.Context, v interface{}) (*string, error) { - if v == nil { - return nil, nil + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) } - res, err := graphql.UnmarshalString(v) - return &res, graphql.ErrorOnPath(ctx, err) -} + 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.marshalNGitlabGroup2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐGitlabGroup(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } -func (ec *executionContext) marshalODate2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { - if v == nil { - return graphql.Null } - res := graphql.MarshalString(*v) - return res -} + wg.Wait() -func (ec *executionContext) unmarshalOHarborPermission2ᚕgithubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋharborᚐPermissionᚄ(ctx context.Context, v interface{}) ([]harbor.Permission, error) { - if v == nil { - return nil, nil - } - var vSlice []interface{} - if v != nil { - vSlice = graphql.CoerceList(v) - } - var err error - res := make([]harbor.Permission, len(vSlice)) - for i := range vSlice { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalNHarborPermission2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋharborᚐPermission(ctx, vSlice[i]) - if err != nil { - return nil, err + for _, e := range ret { + if e == graphql.Null { + return graphql.Null } } - return res, nil + + return ret } -func (ec *executionContext) marshalOHarborPermission2ᚕgithubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋharborᚐPermissionᚄ(ctx context.Context, sel ast.SelectionSet, v []harbor.Permission) graphql.Marshaler { +func (ec *executionContext) marshalOGitlabProject2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐGitlabProjectᚄ(ctx context.Context, sel ast.SelectionSet, v []*entities.GitlabProject) graphql.Marshaler { if v == nil { return graphql.Null } @@ -7965,7 +26833,7 @@ func (ec *executionContext) marshalOHarborPermission2ᚕgithubᚗcomᚋkloudlite if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNHarborPermission2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋharborᚐPermission(ctx, sel, v[i]) + ret[i] = ec.marshalNGitlabProject2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐGitlabProject(ctx, sel, v[i]) } if isLen1 { f(i) @@ -7985,45 +26853,45 @@ func (ec *executionContext) marshalOHarborPermission2ᚕgithubᚗcomᚋkloudlite return ret } -func (ec *executionContext) marshalOHarborRobotUser2ᚖkloudliteᚗioᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐHarborRobotUser(ctx context.Context, sel ast.SelectionSet, v *entities.HarborRobotUser) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._HarborRobotUser(ctx, sel, v) -} - -func (ec *executionContext) marshalOHarborRobotUserSpec2githubᚗcomᚋkloudliteᚋoperatorᚋapisᚋartifactsᚋv1ᚐHarborUserAccountSpec(ctx context.Context, sel ast.SelectionSet, v v1.HarborUserAccountSpec) graphql.Marshaler { - return ec._HarborRobotUserSpec(ctx, sel, &v) +func (ec *executionContext) unmarshalOInt2int(ctx context.Context, v interface{}) (int, error) { + res, err := graphql.UnmarshalInt(v) + return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalOHarborRobotUserSpecIn2githubᚗcomᚋkloudliteᚋoperatorᚋapisᚋartifactsᚋv1ᚐHarborUserAccountSpec(ctx context.Context, v interface{}) (v1.HarborUserAccountSpec, error) { - res, err := ec.unmarshalInputHarborRobotUserSpecIn(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) +func (ec *executionContext) marshalOInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { + res := graphql.MarshalInt(v) + return res } -func (ec *executionContext) unmarshalOInt2int64(ctx context.Context, v interface{}) (int64, error) { - res, err := graphql.UnmarshalInt64(v) - return res, graphql.ErrorOnPath(ctx, err) +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) marshalOInt2int64(ctx context.Context, sel ast.SelectionSet, v int64) graphql.Marshaler { - res := graphql.MarshalInt64(v) +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) unmarshalOJson2map(ctx context.Context, v interface{}) (map[string]interface{}, error) { +func (ec *executionContext) unmarshalOInt2ᚖint64(ctx context.Context, v interface{}) (*int64, error) { if v == nil { return nil, nil } - res, err := graphql.UnmarshalMap(v) - return res, graphql.ErrorOnPath(ctx, err) + res, err := graphql.UnmarshalInt64(v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOJson2map(ctx context.Context, sel ast.SelectionSet, v map[string]interface{}) graphql.Marshaler { +func (ec *executionContext) marshalOInt2ᚖint64(ctx context.Context, sel ast.SelectionSet, v *int64) graphql.Marshaler { if v == nil { return graphql.Null } - res := graphql.MarshalMap(v) + res := graphql.MarshalInt64(*v) return res } @@ -8043,75 +26911,78 @@ func (ec *executionContext) marshalOMap2map(ctx context.Context, sel ast.Selecti return res } -func (ec *executionContext) marshalOPatch2ᚕgithubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋjsonᚑpatchᚐPatchOperationᚄ(ctx context.Context, sel ast.SelectionSet, v []json_patch.PatchOperation) graphql.Marshaler { +func (ec *executionContext) unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx context.Context, v interface{}) (*repos.MatchFilter, error) { if v == nil { - return graphql.Null + return nil, nil } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) + res, err := ec.unmarshalInputMatchFilterIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx context.Context, sel ast.SelectionSet, v v1.ObjectMeta) graphql.Marshaler { + return ec._Metadata(ctx, sel, &v) +} + +func (ec *executionContext) unmarshalOPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐPagination(ctx context.Context, v interface{}) (*types.Pagination, error) { + if v == nil { + return nil, nil } - 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.marshalNPatch2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋjsonᚑpatchᚐPatchOperation(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } + res, err := ec.unmarshalInputPaginationIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} +func (ec *executionContext) marshalORepository2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋdomainᚋentitiesᚐRepository(ctx context.Context, sel ast.SelectionSet, v *entities.Repository) graphql.Marshaler { + if v == nil { + return graphql.Null } - wg.Wait() + return ec._Repository(ctx, sel, v) +} - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } +func (ec *executionContext) marshalORepositoryPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐRepositoryPaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.RepositoryPaginatedRecords) graphql.Marshaler { + if v == nil { + return graphql.Null } + return ec._RepositoryPaginatedRecords(ctx, sel, v) +} - return ret +func (ec *executionContext) unmarshalOSearchBuildCacheKeys2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐSearchBuildCacheKeys(ctx context.Context, v interface{}) (*model.SearchBuildCacheKeys, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputSearchBuildCacheKeys(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalOPatchIn2ᚕgithubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋjsonᚑpatchᚐPatchOperationᚄ(ctx context.Context, v interface{}) ([]json_patch.PatchOperation, error) { +func (ec *executionContext) unmarshalOSearchBuildRuns2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐSearchBuildRuns(ctx context.Context, v interface{}) (*model.SearchBuildRuns, error) { if v == nil { return nil, nil } - var vSlice []interface{} - if v != nil { - vSlice = graphql.CoerceList(v) + res, err := ec.unmarshalInputSearchBuildRuns(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOSearchBuilds2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐSearchBuilds(ctx context.Context, v interface{}) (*model.SearchBuilds, error) { + if v == nil { + return nil, nil } - var err error - res := make([]json_patch.PatchOperation, len(vSlice)) - for i := range vSlice { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalNPatchIn2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋjsonᚑpatchᚐPatchOperation(ctx, vSlice[i]) - if err != nil { - return nil, err - } + res, err := ec.unmarshalInputSearchBuilds(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOSearchCreds2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐSearchCreds(ctx context.Context, v interface{}) (*model.SearchCreds, error) { + if v == nil { + return nil, nil } - return res, nil + res, err := ec.unmarshalInputSearchCreds(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOStatus2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx context.Context, sel ast.SelectionSet, v operator.Status) graphql.Marshaler { - return ec._Status(ctx, sel, &v) +func (ec *executionContext) unmarshalOSearchRepos2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐSearchRepos(ctx context.Context, v interface{}) (*model.SearchRepos, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputSearchRepos(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { @@ -8162,38 +27033,6 @@ func (ec *executionContext) marshalOString2ᚕstringᚄ(ctx context.Context, sel 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 @@ -8210,10 +27049,6 @@ func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel as return res } -func (ec *executionContext) marshalOSyncStatus2kloudliteᚗioᚋpkgᚋtypesᚐSyncStatus(ctx context.Context, sel ast.SelectionSet, v types.SyncStatus) graphql.Marshaler { - return ec._SyncStatus(ctx, sel, &v) -} - 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 diff --git a/apps/container-registry/internal/app/graph/githubinstallation.resolvers.go b/apps/container-registry/internal/app/graph/githubinstallation.resolvers.go new file mode 100644 index 000000000..179141357 --- /dev/null +++ b/apps/container-registry/internal/app/graph/githubinstallation.resolvers.go @@ -0,0 +1,35 @@ +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.28 + +import ( + "context" + "github.com/kloudlite/api/apps/container-registry/internal/app/graph/generated" + "github.com/kloudlite/api/apps/container-registry/internal/app/graph/model" + "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" + "github.com/kloudlite/api/pkg/errors" + fn "github.com/kloudlite/api/pkg/functions" +) + +// Account is the resolver for the account field. +func (r *githubInstallationResolver) Account(ctx context.Context, obj *entities.GithubInstallation) (*model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubUserAccount, error) { + if obj == nil { + return nil, errors.Newf("Account: obj is nil") + } + + var m model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubUserAccount + if err := fn.JsonConversion(obj.Account, &m); err != nil { + return nil, err + } + + return &m, nil +} + +// GithubInstallation returns generated.GithubInstallationResolver implementation. +func (r *Resolver) GithubInstallation() generated.GithubInstallationResolver { + return &githubInstallationResolver{r} +} + +type githubInstallationResolver struct{ *Resolver } diff --git a/apps/container-registry/internal/app/graph/githublistrepository.resolvers.go b/apps/container-registry/internal/app/graph/githublistrepository.resolvers.go new file mode 100644 index 000000000..50476b873 --- /dev/null +++ b/apps/container-registry/internal/app/graph/githublistrepository.resolvers.go @@ -0,0 +1,69 @@ +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.28 + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + "time" + + "github.com/kloudlite/api/apps/container-registry/internal/app/graph/generated" + "github.com/kloudlite/api/apps/container-registry/internal/app/graph/model" + "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" + fn "github.com/kloudlite/api/pkg/functions" +) + +// Repositories is the resolver for the repositories field. +func (r *githubListRepositoryResolver) Repositories(ctx context.Context, obj *entities.GithubListRepository) ([]*model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository, error) { + if obj == nil { + return nil, errors.Newf("Repositories: obj is nil") + } + + repositories := make([]*model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository, len(obj.Repositories)) + + for i, gr := range obj.Repositories { + repositories[i] = &model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository{ + Archived: gr.Archived, + CloneURL: gr.CloneURL, + CreatedAt: fn.New(gr.CreatedAt.Format(time.RFC3339)), + DefaultBranch: gr.DefaultBranch, + Description: gr.Description, + Disabled: gr.Disabled, + FullName: gr.FullName, + GitURL: gr.GitURL, + GitignoreTemplate: gr.GitignoreTemplate, + HTMLURL: gr.HTMLURL, + ID: fn.New(int(fn.DefaultIfNil(gr.ID))), + Language: gr.Language, + MasterBranch: gr.MasterBranch, + MirrorURL: gr.MirrorURL, + Name: gr.Name, + NodeID: gr.NodeID, + Permissions: (func() map[string]any { + m := make(map[string]any) + for k, v := range gr.Permissions { + m[k] = v + } + return m + })(), + Private: gr.Private, + PushedAt: fn.New(gr.PushedAt.Format(time.RFC3339)), + Size: gr.Size, + TeamID: fn.New(int(fn.DefaultIfNil(gr.TeamID))), + UpdatedAt: fn.New(gr.UpdatedAt.Format(time.RFC3339)), + Visibility: gr.Visibility, + URL: gr.URL, + } + } + + return repositories, nil +} + +// GithubListRepository returns generated.GithubListRepositoryResolver implementation. +func (r *Resolver) GithubListRepository() generated.GithubListRepositoryResolver { + return &githubListRepositoryResolver{r} +} + +type githubListRepositoryResolver struct{ *Resolver } diff --git a/apps/container-registry/internal/app/graph/githubsearchrepository.resolvers.go b/apps/container-registry/internal/app/graph/githubsearchrepository.resolvers.go new file mode 100644 index 000000000..aa42beacf --- /dev/null +++ b/apps/container-registry/internal/app/graph/githubsearchrepository.resolvers.go @@ -0,0 +1,35 @@ +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.28 + +import ( + "context" + "github.com/kloudlite/api/apps/container-registry/internal/app/graph/generated" + "github.com/kloudlite/api/apps/container-registry/internal/app/graph/model" + "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" + "github.com/kloudlite/api/pkg/errors" + fn "github.com/kloudlite/api/pkg/functions" +) + +// Repositories is the resolver for the repositories field. +func (r *githubSearchRepositoryResolver) Repositories(ctx context.Context, obj *entities.GithubSearchRepository) ([]*model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository, error) { + if obj == nil { + return nil, errors.Newf("Repositories: obj is nil") + } + + var repositories []*model.GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository + if err := fn.JsonConversion(obj.Repositories, &repositories); err != nil { + return nil, err + } + + return repositories, nil +} + +// GithubSearchRepository returns generated.GithubSearchRepositoryResolver implementation. +func (r *Resolver) GithubSearchRepository() generated.GithubSearchRepositoryResolver { + return &githubSearchRepositoryResolver{r} +} + +type githubSearchRepositoryResolver struct{ *Resolver } diff --git a/apps/container-registry/internal/app/graph/gitlabproject.resolvers.go b/apps/container-registry/internal/app/graph/gitlabproject.resolvers.go new file mode 100644 index 000000000..70cf664bd --- /dev/null +++ b/apps/container-registry/internal/app/graph/gitlabproject.resolvers.go @@ -0,0 +1,45 @@ +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.28 + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + "time" + + "github.com/kloudlite/api/apps/container-registry/internal/app/graph/generated" + "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" +) + +// CreatedAt is the resolver for the created_at field. +func (r *gitlabProjectResolver) CreatedAt(ctx context.Context, obj *entities.GitlabProject) (*string, error) { + if obj == nil { + return nil, errors.Newf("Object is nil") + } + if obj.CreatedAt == nil { + return nil, nil + } + + t := obj.CreatedAt.Format(time.RFC3339) + return &t, nil +} + +// LastActivityAt is the resolver for the last_activity_at field. +func (r *gitlabProjectResolver) LastActivityAt(ctx context.Context, obj *entities.GitlabProject) (*string, error) { + if obj == nil { + return nil, errors.Newf("Object is nil") + } + if obj.LastActivityAt == nil { + return nil, nil + } + + t := obj.LastActivityAt.Format(time.RFC3339) + return &t, nil +} + +// GitlabProject returns generated.GitlabProjectResolver implementation. +func (r *Resolver) GitlabProject() generated.GitlabProjectResolver { return &gitlabProjectResolver{r} } + +type gitlabProjectResolver struct{ *Resolver } diff --git a/apps/container-registry/internal/app/graph/harborrobotuser.resolvers.go b/apps/container-registry/internal/app/graph/harborrobotuser.resolvers.go deleted file mode 100644 index c85ab3410..000000000 --- a/apps/container-registry/internal/app/graph/harborrobotuser.resolvers.go +++ /dev/null @@ -1,49 +0,0 @@ -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.28 - -import ( - "context" - - "github.com/kloudlite/operator/apis/artifacts/v1" - "kloudlite.io/apps/container-registry/internal/app/graph/generated" - fn "kloudlite.io/pkg/functions" -) - -// Permissions is the resolver for the permissions field. -func (r *harborRobotUserSpecResolver) Permissions(ctx context.Context, obj *v1.HarborUserAccountSpec) ([]*string, error) { - if obj == nil { - return nil, nil - } - - m := make([]*string, len(obj.Permissions)) - - if err := fn.JsonConversion(obj.Permissions, &m); err != nil { - return m, err - } - return m, nil -} - -// Permissions is the resolver for the permissions field. -func (r *harborRobotUserSpecInResolver) Permissions(ctx context.Context, obj *v1.HarborUserAccountSpec, data []*string) error { - if obj == nil || data == nil { - return nil - } - - return fn.JsonConversion(data, &obj.Permissions) -} - -// HarborRobotUserSpec returns generated.HarborRobotUserSpecResolver implementation. -func (r *Resolver) HarborRobotUserSpec() generated.HarborRobotUserSpecResolver { - return &harborRobotUserSpecResolver{r} -} - -// HarborRobotUserSpecIn returns generated.HarborRobotUserSpecInResolver implementation. -func (r *Resolver) HarborRobotUserSpecIn() generated.HarborRobotUserSpecInResolver { - return &harborRobotUserSpecInResolver{r} -} - -type harborRobotUserSpecResolver struct{ *Resolver } -type harborRobotUserSpecInResolver struct{ *Resolver } diff --git a/apps/container-registry/internal/app/graph/model/models_gen.go b/apps/container-registry/internal/app/graph/model/models_gen.go index 8e0d251dc..ff47a7655 100644 --- a/apps/container-registry/internal/app/graph/model/models_gen.go +++ b/apps/container-registry/internal/app/graph/model/models_gen.go @@ -1,3 +1,581 @@ // Code generated by github.com/99designs/gqlgen, DO NOT EDIT. package model + +import ( + "fmt" + "io" + "strconv" + + "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" + "github.com/kloudlite/api/pkg/repos" +) + +type BuildCacheKeyEdge struct { + Cursor string `json:"cursor"` + Node *entities.BuildCacheKey `json:"node"` +} + +type BuildCacheKeyPaginatedRecords struct { + Edges []*BuildCacheKeyEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +type BuildEdge struct { + Cursor string `json:"cursor"` + Node *entities.Build `json:"node"` +} + +type BuildPaginatedRecords struct { + Edges []*BuildEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +type BuildRunEdge struct { + Cursor string `json:"cursor"` + Node *entities.BuildRun `json:"node"` +} + +type BuildRunPaginatedRecords struct { + Edges []*BuildRunEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +type CredentialEdge struct { + Cursor string `json:"cursor"` + Node *entities.Credential `json:"node"` +} + +type CredentialPaginatedRecords struct { + Edges []*CredentialEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +type DigestEdge struct { + Cursor string `json:"cursor"` + Node *entities.Digest `json:"node"` +} + +type DigestPaginatedRecords struct { + Edges []*DigestEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +type GithubBranch struct { + Name *string `json:"name,omitempty"` + Protected *bool `json:"protected,omitempty"` +} + +type GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpiration struct { + Unit GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnit `json:"unit"` + Value int `json:"value"` +} + +type GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationIn struct { + Unit GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnit `json:"unit"` + Value int `json:"value"` +} + +type GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitSource struct { + Branch string `json:"branch"` + Provider GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitProvider `json:"provider"` + Repository string `json:"repository"` + WebhookID *int `json:"webhookId,omitempty"` +} + +type GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitSourceIn struct { + Branch string `json:"branch"` + Provider GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitProvider `json:"provider"` + Repository string `json:"repository"` +} + +type GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubRepository struct { + Archived *bool `json:"archived,omitempty"` + CloneURL *string `json:"cloneUrl,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + DefaultBranch *string `json:"defaultBranch,omitempty"` + Description *string `json:"description,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + FullName *string `json:"fullName,omitempty"` + GitignoreTemplate *string `json:"gitignoreTemplate,omitempty"` + GitURL *string `json:"gitUrl,omitempty"` + HTMLURL *string `json:"htmlUrl,omitempty"` + ID *int `json:"id,omitempty"` + Language *string `json:"language,omitempty"` + MasterBranch *string `json:"masterBranch,omitempty"` + MirrorURL *string `json:"mirrorUrl,omitempty"` + Name *string `json:"name,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Permissions map[string]interface{} `json:"permissions,omitempty"` + Private *bool `json:"private,omitempty"` + PushedAt *string `json:"pushedAt,omitempty"` + Size *int `json:"size,omitempty"` + TeamID *int `json:"team_id,omitempty"` + UpdatedAt *string `json:"updatedAt,omitempty"` + URL *string `json:"url,omitempty"` + Visibility *string `json:"visibility,omitempty"` +} + +type GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubUserAccount struct { + AvatarURL *string `json:"avatarUrl,omitempty"` + ID *int `json:"id,omitempty"` + Login *string `json:"login,omitempty"` + NodeID *string `json:"nodeId,omitempty"` + Type *string `json:"type,omitempty"` +} + +type GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGithubUserAccountIn struct { + AvatarURL *string `json:"avatarUrl,omitempty"` + ID *int `json:"id,omitempty"` + Login *string `json:"login,omitempty"` + NodeID *string `json:"nodeId,omitempty"` + Type *string `json:"type,omitempty"` +} + +type GithubComKloudliteAPIPkgTypesSyncStatus struct { + Action GithubComKloudliteAPIPkgTypesSyncAction `json:"action"` + Error *string `json:"error,omitempty"` + LastSyncedAt *string `json:"lastSyncedAt,omitempty"` + RecordVersion int `json:"recordVersion"` + State GithubComKloudliteAPIPkgTypesSyncState `json:"state"` + SyncScheduledAt *string `json:"syncScheduledAt,omitempty"` +} + +type GithubComKloudliteOperatorApisDistributionV1BuildOptions struct { + BuildArgs map[string]interface{} `json:"buildArgs,omitempty"` + BuildContexts map[string]interface{} `json:"buildContexts,omitempty"` + ContextDir *string `json:"contextDir,omitempty"` + DockerfileContent *string `json:"dockerfileContent,omitempty"` + DockerfilePath *string `json:"dockerfilePath,omitempty"` + TargetPlatforms []string `json:"targetPlatforms,omitempty"` +} + +type GithubComKloudliteOperatorApisDistributionV1BuildOptionsIn struct { + BuildArgs map[string]interface{} `json:"buildArgs,omitempty"` + BuildContexts map[string]interface{} `json:"buildContexts,omitempty"` + ContextDir *string `json:"contextDir,omitempty"` + DockerfileContent *string `json:"dockerfileContent,omitempty"` + DockerfilePath *string `json:"dockerfilePath,omitempty"` + TargetPlatforms []string `json:"targetPlatforms,omitempty"` +} + +type GithubComKloudliteOperatorApisDistributionV1BuildRunSpec struct { + AccountName string `json:"accountName"` + BuildOptions *GithubComKloudliteOperatorApisDistributionV1BuildOptions `json:"buildOptions,omitempty"` + CacheKeyName *string `json:"cacheKeyName,omitempty"` + Registry *GithubComKloudliteOperatorApisDistributionV1Registry `json:"registry"` + Resource *GithubComKloudliteOperatorApisDistributionV1Resource `json:"resource"` +} + +type GithubComKloudliteOperatorApisDistributionV1BuildRunSpecIn struct { + BuildOptions *GithubComKloudliteOperatorApisDistributionV1BuildOptionsIn `json:"buildOptions,omitempty"` + CacheKeyName *string `json:"cacheKeyName,omitempty"` + Registry *GithubComKloudliteOperatorApisDistributionV1RegistryIn `json:"registry"` + Resource *GithubComKloudliteOperatorApisDistributionV1ResourceIn `json:"resource"` +} + +type GithubComKloudliteOperatorApisDistributionV1Registry struct { + Repo *GithubComKloudliteOperatorApisDistributionV1Repo `json:"repo"` +} + +type GithubComKloudliteOperatorApisDistributionV1RegistryIn struct { + Repo *GithubComKloudliteOperatorApisDistributionV1RepoIn `json:"repo"` +} + +type GithubComKloudliteOperatorApisDistributionV1Repo struct { + Name string `json:"name"` + Tags []string `json:"tags"` +} + +type GithubComKloudliteOperatorApisDistributionV1RepoIn struct { + Name string `json:"name"` + Tags []string `json:"tags"` +} + +type GithubComKloudliteOperatorApisDistributionV1Resource struct { + CPU int `json:"cpu"` + MemoryInMb int `json:"memoryInMb"` +} + +type GithubComKloudliteOperatorApisDistributionV1ResourceIn struct { + CPU int `json:"cpu"` + MemoryInMb int `json:"memoryInMb"` +} + +type GithubComKloudliteOperatorPkgOperatorCheck struct { + Generation *int `json:"generation,omitempty"` + Message *string `json:"message,omitempty"` + Status bool `json:"status"` +} + +type GithubComKloudliteOperatorPkgOperatorCheckIn struct { + Generation *int `json:"generation,omitempty"` + Message *string `json:"message,omitempty"` + Status bool `json:"status"` +} + +type GithubComKloudliteOperatorPkgOperatorResourceRef struct { + APIVersion string `json:"apiVersion"` + Kind string `json:"kind"` + Name string `json:"name"` + Namespace string `json:"namespace"` +} + +type GithubComKloudliteOperatorPkgOperatorResourceRefIn struct { + Name string `json:"name"` + Namespace string `json:"namespace"` +} + +type GithubComKloudliteOperatorPkgOperatorStatus struct { + Checks map[string]interface{} `json:"checks,omitempty"` + IsReady bool `json:"isReady"` + LastReadyGeneration *int `json:"lastReadyGeneration,omitempty"` + LastReconcileTime *string `json:"lastReconcileTime,omitempty"` + Message *GithubComKloudliteOperatorPkgRawJSONRawJSON `json:"message,omitempty"` + Resources []*GithubComKloudliteOperatorPkgOperatorResourceRef `json:"resources,omitempty"` +} + +type GithubComKloudliteOperatorPkgOperatorStatusIn struct { + Checks map[string]interface{} `json:"checks,omitempty"` + IsReady bool `json:"isReady"` + LastReadyGeneration *int `json:"lastReadyGeneration,omitempty"` + LastReconcileTime *string `json:"lastReconcileTime,omitempty"` + Message *GithubComKloudliteOperatorPkgRawJSONRawJSONIn `json:"message,omitempty"` + Resources []*GithubComKloudliteOperatorPkgOperatorResourceRefIn `json:"resources,omitempty"` +} + +type GithubComKloudliteOperatorPkgRawJSONRawJSON struct { + RawMessage interface{} `json:"RawMessage,omitempty"` +} + +type GithubComKloudliteOperatorPkgRawJSONRawJSONIn struct { + RawMessage interface{} `json:"RawMessage,omitempty"` +} + +type GitlabBranch struct { + CanPush bool `json:"canPush"` + Default bool `json:"default"` + DevelopersCanMerge bool `json:"developersCanMerge"` + DevelopersCanPush bool `json:"developersCanPush"` + Merged bool `json:"merged"` + Name string `json:"name"` + Protected bool `json:"protected"` + WebURL string `json:"webUrl"` +} + +type PageInfo struct { + EndCursor *string `json:"endCursor,omitempty"` + HasNextPage *bool `json:"hasNextPage,omitempty"` + HasPreviousPage *bool `json:"hasPreviousPage,omitempty"` + StartCursor *string `json:"startCursor,omitempty"` +} + +type RepositoryEdge struct { + Cursor string `json:"cursor"` + Node *entities.Repository `json:"node"` +} + +type RepositoryPaginatedRecords struct { + Edges []*RepositoryEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +type SearchBuildCacheKeys struct { + Text *repos.MatchFilter `json:"text,omitempty"` +} + +type SearchBuildRuns struct { + Text *repos.MatchFilter `json:"text,omitempty"` +} + +type SearchBuilds struct { + Text *repos.MatchFilter `json:"text,omitempty"` +} + +type SearchCreds struct { + Text *repos.MatchFilter `json:"text,omitempty"` +} + +type SearchRepos struct { + Text *repos.MatchFilter `json:"text,omitempty"` +} + +type GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatus string + +const ( + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatusError GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatus = "error" + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatusFailed GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatus = "failed" + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatusIdle GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatus = "idle" + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatusPending GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatus = "pending" + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatusQueued GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatus = "queued" + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatusRunning GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatus = "running" + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatusSuccess GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatus = "success" +) + +var AllGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatus = []GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatus{ + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatusError, + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatusFailed, + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatusIdle, + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatusPending, + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatusQueued, + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatusRunning, + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatusSuccess, +} + +func (e GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatus) IsValid() bool { + switch e { + case GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatusError, GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatusFailed, GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatusIdle, GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatusPending, GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatusQueued, GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatusRunning, GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatusSuccess: + return true + } + return false +} + +func (e GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatus) String() string { + return string(e) +} + +func (e *GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatus) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatus(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__BuildStatus", str) + } + return nil +} + +func (e GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesBuildStatus) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnit string + +const ( + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnitD GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnit = "d" + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnitH GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnit = "h" + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnitM GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnit = "m" + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnitW GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnit = "w" + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnitY GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnit = "y" +) + +var AllGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnit = []GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnit{ + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnitD, + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnitH, + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnitM, + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnitW, + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnitY, +} + +func (e GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnit) IsValid() bool { + switch e { + case GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnitD, GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnitH, GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnitM, GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnitW, GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnitY: + return true + } + return false +} + +func (e GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnit) String() string { + return string(e) +} + +func (e *GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnit) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnit(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationUnit", str) + } + return nil +} + +func (e GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesExpirationUnit) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitProvider string + +const ( + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitProviderGithub GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitProvider = "github" + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitProviderGitlab GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitProvider = "gitlab" +) + +var AllGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitProvider = []GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitProvider{ + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitProviderGithub, + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitProviderGitlab, +} + +func (e GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitProvider) IsValid() bool { + switch e { + case GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitProviderGithub, GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitProviderGitlab: + return true + } + return false +} + +func (e GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitProvider) String() string { + return string(e) +} + +func (e *GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitProvider) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitProvider(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitProvider", str) + } + return nil +} + +func (e GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesGitProvider) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesRepoAccess string + +const ( + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesRepoAccessRead GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesRepoAccess = "read" + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesRepoAccessReadWrite GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesRepoAccess = "read_write" +) + +var AllGithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesRepoAccess = []GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesRepoAccess{ + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesRepoAccessRead, + GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesRepoAccessReadWrite, +} + +func (e GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesRepoAccess) IsValid() bool { + switch e { + case GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesRepoAccessRead, GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesRepoAccessReadWrite: + return true + } + return false +} + +func (e GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesRepoAccess) String() string { + return string(e) +} + +func (e *GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesRepoAccess) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesRepoAccess(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__RepoAccess", str) + } + return nil +} + +func (e GithubComKloudliteAPIAppsContainerRegistryInternalDomainEntitiesRepoAccess) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type GithubComKloudliteAPIPkgTypesSyncAction string + +const ( + GithubComKloudliteAPIPkgTypesSyncActionApply GithubComKloudliteAPIPkgTypesSyncAction = "APPLY" + GithubComKloudliteAPIPkgTypesSyncActionDelete GithubComKloudliteAPIPkgTypesSyncAction = "DELETE" +) + +var AllGithubComKloudliteAPIPkgTypesSyncAction = []GithubComKloudliteAPIPkgTypesSyncAction{ + GithubComKloudliteAPIPkgTypesSyncActionApply, + GithubComKloudliteAPIPkgTypesSyncActionDelete, +} + +func (e GithubComKloudliteAPIPkgTypesSyncAction) IsValid() bool { + switch e { + case GithubComKloudliteAPIPkgTypesSyncActionApply, GithubComKloudliteAPIPkgTypesSyncActionDelete: + return true + } + return false +} + +func (e GithubComKloudliteAPIPkgTypesSyncAction) String() string { + return string(e) +} + +func (e *GithubComKloudliteAPIPkgTypesSyncAction) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = GithubComKloudliteAPIPkgTypesSyncAction(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid Github__com___kloudlite___api___pkg___types__SyncAction", str) + } + return nil +} + +func (e GithubComKloudliteAPIPkgTypesSyncAction) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type GithubComKloudliteAPIPkgTypesSyncState string + +const ( + GithubComKloudliteAPIPkgTypesSyncStateAppliedAtAgent GithubComKloudliteAPIPkgTypesSyncState = "APPLIED_AT_AGENT" + GithubComKloudliteAPIPkgTypesSyncStateDeletedAtAgent GithubComKloudliteAPIPkgTypesSyncState = "DELETED_AT_AGENT" + GithubComKloudliteAPIPkgTypesSyncStateDeletingAtAgent GithubComKloudliteAPIPkgTypesSyncState = "DELETING_AT_AGENT" + GithubComKloudliteAPIPkgTypesSyncStateErroredAtAgent GithubComKloudliteAPIPkgTypesSyncState = "ERRORED_AT_AGENT" + GithubComKloudliteAPIPkgTypesSyncStateIDLe GithubComKloudliteAPIPkgTypesSyncState = "IDLE" + GithubComKloudliteAPIPkgTypesSyncStateInQueue GithubComKloudliteAPIPkgTypesSyncState = "IN_QUEUE" + GithubComKloudliteAPIPkgTypesSyncStateReceivedUpdateFromAgent GithubComKloudliteAPIPkgTypesSyncState = "RECEIVED_UPDATE_FROM_AGENT" + GithubComKloudliteAPIPkgTypesSyncStateUpdatedAtAgent GithubComKloudliteAPIPkgTypesSyncState = "UPDATED_AT_AGENT" +) + +var AllGithubComKloudliteAPIPkgTypesSyncState = []GithubComKloudliteAPIPkgTypesSyncState{ + GithubComKloudliteAPIPkgTypesSyncStateAppliedAtAgent, + GithubComKloudliteAPIPkgTypesSyncStateDeletedAtAgent, + GithubComKloudliteAPIPkgTypesSyncStateDeletingAtAgent, + GithubComKloudliteAPIPkgTypesSyncStateErroredAtAgent, + GithubComKloudliteAPIPkgTypesSyncStateIDLe, + GithubComKloudliteAPIPkgTypesSyncStateInQueue, + GithubComKloudliteAPIPkgTypesSyncStateReceivedUpdateFromAgent, + GithubComKloudliteAPIPkgTypesSyncStateUpdatedAtAgent, +} + +func (e GithubComKloudliteAPIPkgTypesSyncState) IsValid() bool { + switch e { + case GithubComKloudliteAPIPkgTypesSyncStateAppliedAtAgent, GithubComKloudliteAPIPkgTypesSyncStateDeletedAtAgent, GithubComKloudliteAPIPkgTypesSyncStateDeletingAtAgent, GithubComKloudliteAPIPkgTypesSyncStateErroredAtAgent, GithubComKloudliteAPIPkgTypesSyncStateIDLe, GithubComKloudliteAPIPkgTypesSyncStateInQueue, GithubComKloudliteAPIPkgTypesSyncStateReceivedUpdateFromAgent, GithubComKloudliteAPIPkgTypesSyncStateUpdatedAtAgent: + return true + } + return false +} + +func (e GithubComKloudliteAPIPkgTypesSyncState) String() string { + return string(e) +} + +func (e *GithubComKloudliteAPIPkgTypesSyncState) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = GithubComKloudliteAPIPkgTypesSyncState(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid Github__com___kloudlite___api___pkg___types__SyncState", str) + } + return nil +} + +func (e GithubComKloudliteAPIPkgTypesSyncState) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} diff --git a/apps/container-registry/internal/app/graph/repository.resolvers.go b/apps/container-registry/internal/app/graph/repository.resolvers.go new file mode 100644 index 000000000..1e868a630 --- /dev/null +++ b/apps/container-registry/internal/app/graph/repository.resolvers.go @@ -0,0 +1,46 @@ +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.28 + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + "time" + + "github.com/kloudlite/api/apps/container-registry/internal/app/graph/generated" + "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" +) + +// CreationTime is the resolver for the creationTime field. +func (r *repositoryResolver) CreationTime(ctx context.Context, obj *entities.Repository) (string, error) { + if obj == nil { + return "", errors.Newf("resource is nil") + } + + return obj.CreationTime.Format(time.RFC3339), nil +} + +// ID is the resolver for the id field. +func (r *repositoryResolver) ID(ctx context.Context, obj *entities.Repository) (string, error) { + if obj == nil { + return "", errors.Newf("resource is nil") + } + + return string(obj.Id), nil +} + +// UpdateTime is the resolver for the updateTime field. +func (r *repositoryResolver) UpdateTime(ctx context.Context, obj *entities.Repository) (string, error) { + if obj == nil { + return "", errors.Newf("resource is nil") + } + + return obj.UpdateTime.Format(time.RFC3339), nil +} + +// Repository returns generated.RepositoryResolver implementation. +func (r *Resolver) Repository() generated.RepositoryResolver { return &repositoryResolver{r} } + +type repositoryResolver struct{ *Resolver } diff --git a/apps/container-registry/internal/app/graph/resolver.go b/apps/container-registry/internal/app/graph/resolver.go index a6cb4c9e8..75e463767 100644 --- a/apps/container-registry/internal/app/graph/resolver.go +++ b/apps/container-registry/internal/app/graph/resolver.go @@ -1,6 +1,6 @@ package graph -import "kloudlite.io/apps/container-registry/internal/domain" +import "github.com/kloudlite/api/apps/container-registry/internal/domain" // This file will not be regenerated automatically. // diff --git a/apps/container-registry/internal/app/graph/scalars-override.resolvers.go b/apps/container-registry/internal/app/graph/scalars-override.resolvers.go deleted file mode 100644 index d894ea499..000000000 --- a/apps/container-registry/internal/app/graph/scalars-override.resolvers.go +++ /dev/null @@ -1,18 +0,0 @@ -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.28 - -import ( - "kloudlite.io/common" - - "kloudlite.io/apps/container-registry/internal/app/graph/generated" -) - -func (r *Resolver) Metadata() generated.MetadataResolver { return &common.MetadataResolver{} } -func (r *Resolver) Status() generated.StatusResolver { return &common.StatusResolver{} } -func (r *Resolver) SyncStatus() generated.SyncStatusResolver { return &common.SyncStatusResolver{} } -func (r *Resolver) MetadataIn() generated.MetadataInResolver { return &common.MetadataInResolver{} } -func (r *Resolver) Patch() generated.PatchResolver { return &common.PatchResolver{} } -func (r *Resolver) PatchIn() generated.PatchInResolver { return &common.PatchInResolver{} } diff --git a/apps/container-registry/internal/app/graph/schema.graphqls b/apps/container-registry/internal/app/graph/schema.graphqls index b096f4aae..05c89d83a 100644 --- a/apps/container-registry/internal/app/graph/schema.graphqls +++ b/apps/container-registry/internal/app/graph/schema.graphqls @@ -1,46 +1,75 @@ -directive @isLoggedIn on FIELD_DEFINITION +directive @isLoggedInAndVerified on FIELD_DEFINITION directive @hasAccount on FIELD_DEFINITION -directive @canActOnAccount(action: String) on FIELD_DEFINITION -# scalar Json -# scalar Any +input SearchRepos { + text: MatchFilterIn +} + +input SearchCreds { + text: MatchFilterIn +} -type Repo { - id: Int! - name: String! - artifactCount: Int! - pullCount: Int! +input SearchBuilds { + text: MatchFilterIn } -enum HarborPermission { - PushRepository - PullRepository +input SearchBuildRuns { + text: MatchFilterIn } -type Artifact { - size: Int! - tags: [ImageTag!]! +input SearchBuildCacheKeys { + text: MatchFilterIn } -type ImageTag { - name: String! - signed: Boolean! - immutable: Boolean! - pushedAt: String! +type CRCheckNameAvailabilityOutput @shareable { + result: Boolean! + suggestedNames: [String!] } type Query { - cr_listRepos :[Repo!]! @hasAccount @isLoggedIn @canActOnAccount(action: "read-container-registry") - cr_listArtifacts(repoName:String!) :[Artifact!]! @hasAccount @isLoggedIn @canActOnAccount(action: "read-container-registry") - cr_listRobots :[HarborRobotUser!]! @hasAccount @isLoggedIn @canActOnAccount(action: "read-container-registry") + cr_listRepos(search:SearchRepos, pagination:CursorPaginationIn) : RepositoryPaginatedRecords @isLoggedInAndVerified @hasAccount + cr_listCreds(search:SearchCreds, pagination:CursorPaginationIn) : CredentialPaginatedRecords @isLoggedInAndVerified @hasAccount + cr_listDigests(repoName:String!, search: SearchRepos, pagination:CursorPaginationIn) : DigestPaginatedRecords @isLoggedInAndVerified @hasAccount + + cr_getCredToken(username:String!) : String! @isLoggedInAndVerified @hasAccount + + cr_checkUserNameAvailability(name:String!) :CRCheckNameAvailabilityOutput! @isLoggedInAndVerified @hasAccount + + cr_getBuild(id:ID!) : Build @isLoggedInAndVerified @hasAccount + cr_listBuilds(repoName:String!, search:SearchBuilds, pagination:CursorPaginationIn) : BuildPaginatedRecords @isLoggedInAndVerified @hasAccount + + cr_listGithubInstallations(pagination:PaginationIn) : [GithubInstallation!] @isLoggedInAndVerified + cr_listGithubRepos(installationId:Int!, pagination:PaginationIn) : GithubListRepository @isLoggedInAndVerified + cr_searchGithubRepos(organization:String!, search:String!, pagination:PaginationIn) : GithubSearchRepository @isLoggedInAndVerified + cr_listGithubBranches(repoUrl:String!, pagination:PaginationIn) : [GitBranch!] @isLoggedInAndVerified + + cr_listGitlabGroups(query:String, pagination:PaginationIn) : [GitlabGroup!] @isLoggedInAndVerified + cr_listGitlabRepositories(groupId:String!, query:String, pagination:PaginationIn) : [GitlabProject!] @isLoggedInAndVerified + cr_listGitlabBranches(repoId:String!, query:String, pagination:PaginationIn) : [GitBranch!] @isLoggedInAndVerified + cr_listBuildCacheKeys(pq:CursorPaginationIn, search: SearchBuildCacheKeys) : BuildCacheKeyPaginatedRecords @isLoggedInAndVerified @hasAccount + + + cr_listBuildRuns(repoName: String!, search: SearchBuildRuns, pq: CursorPaginationIn): BuildRunPaginatedRecords @isLoggedInAndVerified @hasAccount + cr_getBuildRun(repoName: String!, buildRunName: String!): BuildRun @isLoggedInAndVerified @hasAccount } type Mutation { - # cr_createRobot(name: String!, description: String, readOnly: Boolean!) :Robot! @hasAccount @isLoggedIn @canActOnAccount(action: "write-container-registry") - cr_createRobot(robotUser: HarborRobotUserIn!): HarborRobotUser @hasAccount @isLoggedIn @canActOnAccount(action: "write-container-registry") - cr_updateRobot(name: String!, permissions: [HarborPermission!]): HarborRobotUser @hasAccount @isLoggedIn @canActOnAccount(action: "write-container-registry") - cr_deleteRobot(robotId: Int!) :Boolean! @hasAccount @isLoggedIn @canActOnAccount(action: "write-container-registry") - cr_resyncRobot(name: String!): Boolean! @hasAccount @isLoggedIn @canActOnAccount(action: "write-container-registry") + cr_createRepo(repository:RepositoryIn!) : Repository @isLoggedInAndVerified @hasAccount + cr_createCred(credential: CredentialIn!) : Credential @isLoggedInAndVerified @hasAccount + + cr_deleteRepo(name:String!) :Boolean! @isLoggedInAndVerified @hasAccount + cr_deleteCred(username:String!) :Boolean! @isLoggedInAndVerified @hasAccount + cr_deleteDigest(repoName:String!, digest:String!) :Boolean! @isLoggedInAndVerified @hasAccount + + + cr_addBuild(build:BuildIn!) : Build @isLoggedInAndVerified @hasAccount + cr_updateBuild(id:ID!, build:BuildIn!) : Build @isLoggedInAndVerified @hasAccount + cr_deleteBuild(id:ID!) : Boolean! @isLoggedInAndVerified @hasAccount + cr_triggerBuild(id:ID!) : Boolean! @isLoggedInAndVerified @hasAccount + + cr_addBuildCacheKey(buildCacheKey:BuildCacheKeyIn!) : BuildCacheKey @isLoggedInAndVerified @hasAccount + cr_deleteBuildCacheKey(id:ID!) : Boolean! @isLoggedInAndVerified @hasAccount + cr_updateBuildCacheKey(id:ID!, buildCacheKey:BuildCacheKeyIn!) : BuildCacheKey @isLoggedInAndVerified @hasAccount - cr_deleteRepo(repoId:Int!) :Boolean! @hasAccount @isLoggedIn @canActOnAccount(action: "write-container-registry") + cr_listBuildsByBuildCacheId(buildCacheKeyId:ID!, pagination:CursorPaginationIn) : BuildPaginatedRecords @isLoggedInAndVerified @hasAccount } diff --git a/apps/container-registry/internal/app/graph/schema.resolvers.go b/apps/container-registry/internal/app/graph/schema.resolvers.go index 41eeff3df..ff5c07be9 100644 --- a/apps/container-registry/internal/app/graph/schema.resolvers.go +++ b/apps/container-registry/internal/app/graph/schema.resolvers.go @@ -6,92 +6,553 @@ package graph import ( "context" - "fmt" - "time" - - harbor1 "github.com/kloudlite/operator/pkg/harbor" - generated1 "kloudlite.io/apps/container-registry/internal/app/graph/generated" - "kloudlite.io/apps/container-registry/internal/domain/entities" - "kloudlite.io/pkg/harbor" + generated1 "github.com/kloudlite/api/apps/container-registry/internal/app/graph/generated" + "github.com/kloudlite/api/apps/container-registry/internal/app/graph/model" + "github.com/kloudlite/api/apps/container-registry/internal/domain" + "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" + "github.com/kloudlite/api/pkg/errors" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/repos" + "github.com/kloudlite/api/pkg/types" ) -// PushedAt is the resolver for the pushedAt field. -func (r *imageTagResolver) PushedAt(ctx context.Context, obj *harbor.ImageTag) (string, error) { - if obj == nil { - return "", nil +// CrCreateRepo is the resolver for the cr_createRepo field. +func (r *mutationResolver) CrCreateRepo(ctx context.Context, repository entities.Repository) (*entities.Repository, error) { + cc, err := toRegistryContext(ctx) + if err != nil { + return nil, errors.NewE(err) } - return obj.PushTime.Format(time.RFC3339), nil + + return r.Domain.CreateRepository(cc, repository.Name) } -// CrCreateRobot is the resolver for the cr_createRobot field. -func (r *mutationResolver) CrCreateRobot(ctx context.Context, robotUser entities.HarborRobotUser) (*entities.HarborRobotUser, error) { - return r.Domain.CreateHarborRobot(toRegistryContext(ctx), &robotUser) +// CrCreateCred is the resolver for the cr_createCred field. +func (r *mutationResolver) CrCreateCred(ctx context.Context, credential entities.Credential) (*entities.Credential, error) { + cc, err := toRegistryContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.Domain.CreateCredential(cc, credential) +} + +// CrDeleteRepo is the resolver for the cr_deleteRepo field. +func (r *mutationResolver) CrDeleteRepo(ctx context.Context, name string) (bool, error) { + cc, err := toRegistryContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + if err := r.Domain.DeleteRepository(cc, name); err != nil { + return false, errors.NewE(err) + } + + return true, nil } -// CrUpdateRobot is the resolver for the cr_updateRobot field. -func (r *mutationResolver) CrUpdateRobot(ctx context.Context, name string, permissions []harbor1.Permission) (*entities.HarborRobotUser, error) { - panic(fmt.Errorf("not implemented: CrUpdateRobot - cr_updateRobot")) +// CrDeleteCred is the resolver for the cr_deleteCred field. +func (r *mutationResolver) CrDeleteCred(ctx context.Context, username string) (bool, error) { + cc, err := toRegistryContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + if err := r.Domain.DeleteCredential(cc, username); err != nil { + return false, errors.NewE(err) + } + return true, nil } -// CrDeleteRobot is the resolver for the cr_deleteRobot field. -func (r *mutationResolver) CrDeleteRobot(ctx context.Context, robotID int) (bool, error) { - err := r.Domain.DeleteHarborRobot(toRegistryContext(ctx), robotID) +// CrDeleteDigest is the resolver for the cr_deleteDigest field. +func (r *mutationResolver) CrDeleteDigest(ctx context.Context, repoName string, digest string) (bool, error) { + cc, err := toRegistryContext(ctx) if err != nil { - return false, err + return false, errors.NewE(err) + } + if err := r.Domain.DeleteRepositoryDigest(cc, repoName, digest); err != nil { + return false, errors.NewE(err) } return true, nil } -// CrResyncRobot is the resolver for the cr_resyncRobot field. -func (r *mutationResolver) CrResyncRobot(ctx context.Context, name string) (bool, error) { - panic(fmt.Errorf("not implemented: CrResyncRobot - cr_resyncRobot")) +// CrAddBuild is the resolver for the cr_addBuild field. +func (r *mutationResolver) CrAddBuild(ctx context.Context, build entities.Build) (*entities.Build, error) { + cc, err := toRegistryContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.Domain.AddBuild(cc, build) } -// CrDeleteRepo is the resolver for the cr_deleteRepo field. -func (r *mutationResolver) CrDeleteRepo(ctx context.Context, repoID int) (bool, error) { - panic(fmt.Errorf("not implemented")) +// CrUpdateBuild is the resolver for the cr_updateBuild field. +func (r *mutationResolver) CrUpdateBuild(ctx context.Context, id repos.ID, build entities.Build) (*entities.Build, error) { + cc, err := toRegistryContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.Domain.UpdateBuild(cc, id, build) +} + +// CrDeleteBuild is the resolver for the cr_deleteBuild field. +func (r *mutationResolver) CrDeleteBuild(ctx context.Context, id repos.ID) (bool, error) { + cc, err := toRegistryContext(ctx) + + if err != nil { + return false, errors.NewE(err) + } + + if err := r.Domain.DeleteBuild(cc, id); err != nil { + return false, errors.NewE(err) + } + return true, nil +} + +// CrTriggerBuild is the resolver for the cr_triggerBuild field. +func (r *mutationResolver) CrTriggerBuild(ctx context.Context, id repos.ID) (bool, error) { + cc, err := toRegistryContext(ctx) + + if err != nil { + return false, errors.NewE(err) + } + + if err := r.Domain.TriggerBuild(cc, id); err != nil { + return false, errors.NewE(err) + } + return true, nil +} + +// CrAddBuildCacheKey is the resolver for the cr_addBuildCacheKey field. +func (r *mutationResolver) CrAddBuildCacheKey(ctx context.Context, buildCacheKey entities.BuildCacheKey) (*entities.BuildCacheKey, error) { + cc, err := toRegistryContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.Domain.AddBuildCache(cc, buildCacheKey) +} + +// CrDeleteBuildCacheKey is the resolver for the cr_deleteBuildCacheKey field. +func (r *mutationResolver) CrDeleteBuildCacheKey(ctx context.Context, id repos.ID) (bool, error) { + cc, err := toRegistryContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + + if err := r.Domain.DeleteBuildCache(cc, id); err != nil { + return false, errors.NewE(err) + } + return true, nil +} + +// CrUpdateBuildCacheKey is the resolver for the cr_updateBuildCacheKey field. +func (r *mutationResolver) CrUpdateBuildCacheKey(ctx context.Context, id repos.ID, buildCacheKey entities.BuildCacheKey) (*entities.BuildCacheKey, error) { + cc, err := toRegistryContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.Domain.UpdateBuildCache(cc, id, buildCacheKey) +} + +// CrListBuildsByBuildCacheID is the resolver for the cr_listBuildsByBuildCacheId field. +func (r *mutationResolver) CrListBuildsByBuildCacheID(ctx context.Context, buildCacheKeyID repos.ID, pagination *repos.CursorPagination) (*model.BuildPaginatedRecords, error) { + cc, err := toRegistryContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + rr, err := r.Domain.ListBuildsByCache(cc, buildCacheKeyID, fn.DefaultIfNil(pagination, repos.DefaultCursorPagination)) + if err != nil { + return nil, errors.NewE(err) + } + + records := make([]*model.BuildEdge, len(rr.Edges)) + + for i := range rr.Edges { + records[i] = &model.BuildEdge{ + Node: rr.Edges[i].Node, + Cursor: rr.Edges[i].Cursor, + } + } + + m := &model.BuildPaginatedRecords{ + Edges: records, + PageInfo: &model.PageInfo{ + HasNextPage: rr.PageInfo.HasNextPage, + HasPreviousPage: rr.PageInfo.HasPrevPage, + StartCursor: &rr.PageInfo.StartCursor, + EndCursor: &rr.PageInfo.EndCursor, + }, + } + + return m, nil } // CrListRepos is the resolver for the cr_listRepos field. -func (r *queryResolver) CrListRepos(ctx context.Context) ([]*harbor.Repository, error) { - images, err := r.Domain.GetHarborImages(toRegistryContext(ctx)) +func (r *queryResolver) CrListRepos(ctx context.Context, search *model.SearchRepos, pagination *repos.CursorPagination) (*model.RepositoryPaginatedRecords, error) { + cc, err := toRegistryContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + filter := map[string]repos.MatchFilter{} + if search != nil { + if search.Text != nil { + filter["name"] = *search.Text + } + } + + rr, err := r.Domain.ListRepositories(cc, filter, fn.DefaultIfNil(pagination, repos.DefaultCursorPagination)) + if err != nil { + return nil, errors.NewE(err) + } + + records := make([]*model.RepositoryEdge, len(rr.Edges)) + + for i := range rr.Edges { + records[i] = &model.RepositoryEdge{ + Node: rr.Edges[i].Node, + Cursor: rr.Edges[i].Cursor, + } + } + + m := &model.RepositoryPaginatedRecords{ + Edges: records, + PageInfo: &model.PageInfo{ + HasNextPage: rr.PageInfo.HasNextPage, + HasPreviousPage: rr.PageInfo.HasPrevPage, + StartCursor: &rr.PageInfo.StartCursor, + EndCursor: &rr.PageInfo.EndCursor, + }, + TotalCount: int(rr.TotalCount), + } + + return m, nil +} + +// CrListCreds is the resolver for the cr_listCreds field. +func (r *queryResolver) CrListCreds(ctx context.Context, search *model.SearchCreds, pagination *repos.CursorPagination) (*model.CredentialPaginatedRecords, error) { + cc, err := toRegistryContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + filter := map[string]repos.MatchFilter{} + if search != nil { + if search.Text != nil { + filter["name"] = *search.Text + } + } + + rr, err := r.Domain.ListCredentials(cc, filter, fn.DefaultIfNil(pagination, repos.DefaultCursorPagination)) + if err != nil { + return nil, errors.NewE(err) + } + + records := make([]*model.CredentialEdge, len(rr.Edges)) + + for i := range rr.Edges { + records[i] = &model.CredentialEdge{ + Node: rr.Edges[i].Node, + Cursor: rr.Edges[i].Cursor, + } + } + + m := &model.CredentialPaginatedRecords{ + Edges: records, + PageInfo: &model.PageInfo{ + HasNextPage: rr.PageInfo.HasNextPage, + HasPreviousPage: rr.PageInfo.HasPrevPage, + StartCursor: &rr.PageInfo.StartCursor, + EndCursor: &rr.PageInfo.EndCursor, + }, + TotalCount: int(rr.TotalCount), + } + + return m, nil +} + +// CrListDigests is the resolver for the cr_listDigests field. +func (r *queryResolver) CrListDigests(ctx context.Context, repoName string, search *model.SearchRepos, pagination *repos.CursorPagination) (*model.DigestPaginatedRecords, error) { + cc, err := toRegistryContext(ctx) if err != nil { - return nil, err + return nil, errors.NewE(err) } - repositories := make([]*harbor.Repository, len(images)) - for i := range images { - repositories[i] = &images[i] + + filter := map[string]repos.MatchFilter{} + if search != nil { + if search.Text != nil { + filter["name"] = *search.Text + } + } + + rr, err := r.Domain.ListRepositoryDigests(cc, repoName, filter, fn.DefaultIfNil(pagination, repos.DefaultCursorPagination)) + if err != nil { + return nil, errors.NewE(err) + } + + records := make([]*model.DigestEdge, len(rr.Edges)) + + for i := range rr.Edges { + records[i] = &model.DigestEdge{ + Node: rr.Edges[i].Node, + Cursor: rr.Edges[i].Cursor, + } + } + m := &model.DigestPaginatedRecords{ + Edges: records, + PageInfo: &model.PageInfo{ + HasNextPage: rr.PageInfo.HasNextPage, + HasPreviousPage: rr.PageInfo.HasPrevPage, + StartCursor: &rr.PageInfo.StartCursor, + EndCursor: &rr.PageInfo.EndCursor, + }, + TotalCount: int(rr.TotalCount), + } + + return m, nil +} + +// CrGetCredToken is the resolver for the cr_getCredToken field. +func (r *queryResolver) CrGetCredToken(ctx context.Context, username string) (string, error) { + cc, err := toRegistryContext(ctx) + if err != nil { + return "", errors.NewE(err) + } + + token, err := r.Domain.GetToken(cc, username) + if err != nil { + return "", errors.NewE(err) + } + + return token, nil +} + +// CrCheckUserNameAvailability is the resolver for the cr_checkUserNameAvailability field. +func (r *queryResolver) CrCheckUserNameAvailability(ctx context.Context, name string) (*domain.CheckNameAvailabilityOutput, error) { + cc, err := toRegistryContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.Domain.CheckUserNameAvailability(cc, name) +} + +// CrGetBuild is the resolver for the cr_getBuild field. +func (r *queryResolver) CrGetBuild(ctx context.Context, id repos.ID) (*entities.Build, error) { + cc, err := toRegistryContext(ctx) + + if err != nil { + return nil, errors.NewE(err) + } + + return r.Domain.GetBuild(cc, id) +} + +// CrListBuilds is the resolver for the cr_listBuilds field. +func (r *queryResolver) CrListBuilds(ctx context.Context, repoName string, search *model.SearchBuilds, pagination *repos.CursorPagination) (*model.BuildPaginatedRecords, error) { + cc, err := toRegistryContext(ctx) + + if err != nil { + return nil, errors.NewE(err) + } + + filter := map[string]repos.MatchFilter{} + if search != nil { + if search.Text != nil { + filter["name"] = *search.Text + } + } + + rr, err := r.Domain.ListBuilds(cc, repoName, filter, fn.DefaultIfNil(pagination, repos.DefaultCursorPagination)) + + if err != nil { + return nil, errors.NewE(err) + } + + records := make([]*model.BuildEdge, len(rr.Edges)) + + for i := range rr.Edges { + records[i] = &model.BuildEdge{ + Node: rr.Edges[i].Node, + Cursor: rr.Edges[i].Cursor, + } + } + + m := &model.BuildPaginatedRecords{ + Edges: records, + PageInfo: &model.PageInfo{ + HasNextPage: rr.PageInfo.HasNextPage, + HasPreviousPage: rr.PageInfo.HasPrevPage, + StartCursor: &rr.PageInfo.StartCursor, + EndCursor: &rr.PageInfo.EndCursor, + }, + TotalCount: int(rr.TotalCount), + } + + return m, nil +} + +// CrListGithubInstallations is the resolver for the cr_listGithubInstallations field. +func (r *queryResolver) CrListGithubInstallations(ctx context.Context, pagination *types.Pagination) ([]*entities.GithubInstallation, error) { + userId, err := getUserId(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.Domain.GithubListInstallations(ctx, userId, pagination) +} + +// CrListGithubRepos is the resolver for the cr_listGithubRepos field. +func (r *queryResolver) CrListGithubRepos(ctx context.Context, installationID int, pagination *types.Pagination) (*entities.GithubListRepository, error) { + userId, err := getUserId(ctx) + if err != nil { + return nil, errors.NewE(err) } - return repositories, nil + + return r.Domain.GithubListRepos(ctx, userId, int64(installationID), pagination) } -// CrListArtifacts is the resolver for the cr_listArtifacts field. -func (r *queryResolver) CrListArtifacts(ctx context.Context, repoName string) ([]*harbor.Artifact, error) { - artifacts, err := r.Domain.GetRepoArtifacts(toRegistryContext(ctx), repoName) +// CrSearchGithubRepos is the resolver for the cr_searchGithubRepos field. +func (r *queryResolver) CrSearchGithubRepos(ctx context.Context, organization string, search string, pagination *types.Pagination) (*entities.GithubSearchRepository, error) { + userId, err := getUserId(ctx) if err != nil { - return nil, err + return nil, errors.NewE(err) } - artifactsReturn := make([]*harbor.Artifact, len(artifacts)) - for i := range artifacts { - artifactsReturn[i] = &artifacts[i] + + return r.Domain.GithubSearchRepos(ctx, userId, search, organization, pagination) +} + +// CrListGithubBranches is the resolver for the cr_listGithubBranches field. +func (r *queryResolver) CrListGithubBranches(ctx context.Context, repoURL string, pagination *types.Pagination) ([]*entities.GitBranch, error) { + userId, err := getUserId(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.Domain.GithubListBranches(ctx, userId, repoURL, pagination) +} + +// CrListGitlabGroups is the resolver for the cr_listGitlabGroups field. +func (r *queryResolver) CrListGitlabGroups(ctx context.Context, query *string, pagination *types.Pagination) ([]*entities.GitlabGroup, error) { + userId, err := getUserId(ctx) + if err != nil { + return nil, errors.NewE(err) } - return artifactsReturn, nil + + return r.Domain.GitlabListGroups(ctx, userId, query, pagination) } -// CrListRobots is the resolver for the cr_listRobots field. -func (r *queryResolver) CrListRobots(ctx context.Context) ([]*entities.HarborRobotUser, error) { - robots, err := r.Domain.ListHarborRobots(toRegistryContext(ctx)) +// CrListGitlabRepositories is the resolver for the cr_listGitlabRepositories field. +func (r *queryResolver) CrListGitlabRepositories(ctx context.Context, groupID string, query *string, pagination *types.Pagination) ([]*entities.GitlabProject, error) { + userId, err := getUserId(ctx) if err != nil { - return nil, err + return nil, errors.NewE(err) } - if robots == nil { - return make([]*entities.HarborRobotUser, 0), nil + return r.Domain.GitlabListRepos(ctx, userId, groupID, query, pagination) +} + +// CrListGitlabBranches is the resolver for the cr_listGitlabBranches field. +func (r *queryResolver) CrListGitlabBranches(ctx context.Context, repoID string, query *string, pagination *types.Pagination) ([]*entities.GitBranch, error) { + userId, err := getUserId(ctx) + if err != nil { + return nil, errors.NewE(err) } - return robots, nil + + return r.Domain.GitlabListBranches(ctx, userId, repoID, query, pagination) } -// ImageTag returns generated1.ImageTagResolver implementation. -func (r *Resolver) ImageTag() generated1.ImageTagResolver { return &imageTagResolver{r} } +// CrListBuildCacheKeys is the resolver for the cr_listBuildCacheKeys field. +func (r *queryResolver) CrListBuildCacheKeys(ctx context.Context, pq *repos.CursorPagination, search *model.SearchBuildCacheKeys) (*model.BuildCacheKeyPaginatedRecords, error) { + cc, err := toRegistryContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + filter := map[string]repos.MatchFilter{} + if search != nil { + if search.Text != nil { + filter["name"] = *search.Text + } + } + + rr, err := r.Domain.ListBuildCaches(cc, filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) + if err != nil { + return nil, errors.NewE(err) + } + + records := make([]*model.BuildCacheKeyEdge, len(rr.Edges)) + + for i := range rr.Edges { + records[i] = &model.BuildCacheKeyEdge{ + Node: rr.Edges[i].Node, + Cursor: rr.Edges[i].Cursor, + } + } + + m := &model.BuildCacheKeyPaginatedRecords{ + Edges: records, + PageInfo: &model.PageInfo{ + HasNextPage: rr.PageInfo.HasNextPage, + HasPreviousPage: rr.PageInfo.HasPrevPage, + StartCursor: &rr.PageInfo.StartCursor, + EndCursor: &rr.PageInfo.EndCursor, + }, + } + + return m, nil +} + +// CrListBuildRuns is the resolver for the cr_listBuildRuns field. +func (r *queryResolver) CrListBuildRuns(ctx context.Context, repoName string, search *model.SearchBuildRuns, pq *repos.CursorPagination) (*model.BuildRunPaginatedRecords, error) { + filter := map[string]repos.MatchFilter{} + if search != nil { + if search.Text != nil { + filter["metadata.name"] = *search.Text + } + } + + cc, err := toRegistryContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + buildRuns, err := r.Domain.ListBuildRuns(cc, repoName, filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) + if err != nil { + return nil, errors.NewE(err) + } + + ve := make([]*model.BuildRunEdge, len(buildRuns.Edges)) + for i := range buildRuns.Edges { + ve[i] = &model.BuildRunEdge{ + Node: buildRuns.Edges[i].Node, + Cursor: buildRuns.Edges[i].Cursor, + } + } + + m := model.BuildRunPaginatedRecords{ + Edges: ve, + PageInfo: &model.PageInfo{ + EndCursor: &buildRuns.PageInfo.EndCursor, + HasNextPage: buildRuns.PageInfo.HasNextPage, + HasPreviousPage: buildRuns.PageInfo.HasPrevPage, + StartCursor: &buildRuns.PageInfo.StartCursor, + }, + TotalCount: int(buildRuns.TotalCount), + } + + return &m, nil +} + +// CrGetBuildRun is the resolver for the cr_getBuildRun field. +func (r *queryResolver) CrGetBuildRun(ctx context.Context, repoName string, buildRunName string) (*entities.BuildRun, error) { + cc, err := toRegistryContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.Domain.GetBuildRun(cc, repoName, buildRunName) +} // Mutation returns generated1.MutationResolver implementation. func (r *Resolver) Mutation() generated1.MutationResolver { return &mutationResolver{r} } @@ -99,6 +560,5 @@ func (r *Resolver) Mutation() generated1.MutationResolver { return &mutationReso // Query returns generated1.QueryResolver implementation. func (r *Resolver) Query() generated1.QueryResolver { return &queryResolver{r} } -type imageTagResolver struct{ *Resolver } type mutationResolver struct{ *Resolver } type queryResolver struct{ *Resolver } diff --git a/apps/container-registry/internal/app/graph/struct-to-graphql/build.graphqls b/apps/container-registry/internal/app/graph/struct-to-graphql/build.graphqls new file mode 100644 index 000000000..82999cfe1 --- /dev/null +++ b/apps/container-registry/internal/app/graph/struct-to-graphql/build.graphqls @@ -0,0 +1,35 @@ +type Build @shareable { + buildClusterName: String! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + credUser: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + errorMessages: Map! + id: String! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + name: String! + recordVersion: Int! + source: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource! + spec: Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec! + status: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__BuildStatus! + updateTime: Date! +} + +type BuildEdge @shareable { + cursor: String! + node: Build! +} + +type BuildPaginatedRecords @shareable { + edges: [BuildEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input BuildIn { + buildClusterName: String! + name: String! + source: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSourceIn! + spec: Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpecIn! +} + diff --git a/apps/container-registry/internal/app/graph/struct-to-graphql/buildcachekey.graphqls b/apps/container-registry/internal/app/graph/struct-to-graphql/buildcachekey.graphqls new file mode 100644 index 000000000..c3a23cf22 --- /dev/null +++ b/apps/container-registry/internal/app/graph/struct-to-graphql/buildcachekey.graphqls @@ -0,0 +1,31 @@ +type BuildCacheKey @shareable { + accountName: String! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + id: String! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + name: String! + recordVersion: Int! + updateTime: Date! + volumeSizeInGB: Float! +} + +type BuildCacheKeyEdge @shareable { + cursor: String! + node: BuildCacheKey! +} + +type BuildCacheKeyPaginatedRecords @shareable { + edges: [BuildCacheKeyEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input BuildCacheKeyIn { + displayName: String! + name: String! + volumeSizeInGB: Float! +} + diff --git a/apps/container-registry/internal/app/graph/struct-to-graphql/buildrun.graphqls b/apps/container-registry/internal/app/graph/struct-to-graphql/buildrun.graphqls new file mode 100644 index 000000000..f9b4d61f4 --- /dev/null +++ b/apps/container-registry/internal/app/graph/struct-to-graphql/buildrun.graphqls @@ -0,0 +1,28 @@ +type BuildRun @shareable { + accountName: String! + apiVersion: String! + buildName: String! + clusterName: String! + creationTime: Date! + id: String! + kind: String! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + recordVersion: Int! + spec: Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec + status: Github__com___kloudlite___operator___pkg___operator__Status + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type BuildRunEdge @shareable { + cursor: String! + node: BuildRun! +} + +type BuildRunPaginatedRecords @shareable { + edges: [BuildRunEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + diff --git a/apps/container-registry/internal/app/graph/struct-to-graphql/common-types.graphqls b/apps/container-registry/internal/app/graph/struct-to-graphql/common-types.graphqls new file mode 100644 index 000000000..4d6db420e --- /dev/null +++ b/apps/container-registry/internal/app/graph/struct-to-graphql/common-types.graphqls @@ -0,0 +1,260 @@ +type Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration @shareable { + unit: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationUnit! + value: Int! +} + +type Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource @shareable { + branch: String! + provider: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitProvider! + repository: String! + webhookId: Int +} + +type Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository @shareable { + archived: Boolean + cloneUrl: String + createdAt: Date + defaultBranch: String + description: String + disabled: Boolean + fullName: String + gitignoreTemplate: String + gitUrl: String + htmlUrl: String + id: Int + language: String + masterBranch: String + mirrorUrl: String + name: String + node_id: String + permissions: Map + private: Boolean + pushedAt: Date + size: Int + team_id: Int + updatedAt: Date + url: String + visibility: String +} + +type Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount @shareable { + avatarUrl: String + id: Int + login: String + nodeId: String + type: String +} + +type Github__com___kloudlite___api___common__CreatedOrUpdatedBy @shareable { + userEmail: String! + userId: String! + userName: String! +} + +type Github__com___kloudlite___api___pkg___types__SyncStatus @shareable { + action: Github__com___kloudlite___api___pkg___types__SyncAction! + error: String + lastSyncedAt: Date + recordVersion: Int! + state: Github__com___kloudlite___api___pkg___types__SyncState! + syncScheduledAt: Date +} + +type Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions @shareable { + buildArgs: Map + buildContexts: Map + contextDir: String + dockerfileContent: String + dockerfilePath: String + targetPlatforms: [String!] +} + +type Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec @shareable { + accountName: String! + buildOptions: Github__com___kloudlite___operator___apis___distribution___v1__BuildOptions + cacheKeyName: String + registry: Github__com___kloudlite___operator___apis___distribution___v1__Registry! + resource: Github__com___kloudlite___operator___apis___distribution___v1__Resource! +} + +type Github__com___kloudlite___operator___apis___distribution___v1__Registry @shareable { + repo: Github__com___kloudlite___operator___apis___distribution___v1__Repo! +} + +type Github__com___kloudlite___operator___apis___distribution___v1__Repo @shareable { + name: String! + tags: [String!]! +} + +type Github__com___kloudlite___operator___apis___distribution___v1__Resource @shareable { + cpu: Int! + memoryInMb: Int! +} + +type Github__com___kloudlite___operator___pkg___operator__Check @shareable { + generation: Int + message: String + status: Boolean! +} + +type Github__com___kloudlite___operator___pkg___operator__ResourceRef @shareable { + apiVersion: String! + kind: String! + name: String! + namespace: String! +} + +type Github__com___kloudlite___operator___pkg___operator__Status @shareable { + checks: Map + isReady: Boolean! + lastReadyGeneration: Int + lastReconcileTime: Date + message: Github__com___kloudlite___operator___pkg___raw____json__RawJson + resources: [Github__com___kloudlite___operator___pkg___operator__ResourceRef!] +} + +type Github__com___kloudlite___operator___pkg___raw____json__RawJson @shareable { + RawMessage: Any +} + +type Metadata @shareable { + annotations: Map + creationTimestamp: Date! + deletionTimestamp: Date + generation: Int! + labels: Map + name: String! + namespace: String +} + +type PageInfo @shareable { + endCursor: String + hasNextPage: Boolean + hasPreviousPage: Boolean + startCursor: String +} + +input Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationIn { + unit: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationUnit! + value: Int! +} + +input Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSourceIn { + branch: String! + provider: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitProvider! + repository: String! +} + +input Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccountIn { + avatarUrl: String + id: Int + login: String + nodeId: String + type: String +} + +input Github__com___kloudlite___operator___apis___distribution___v1__BuildOptionsIn { + buildArgs: Map + buildContexts: Map + contextDir: String + dockerfileContent: String + dockerfilePath: String + targetPlatforms: [String!] +} + +input Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpecIn { + buildOptions: Github__com___kloudlite___operator___apis___distribution___v1__BuildOptionsIn + cacheKeyName: String + registry: Github__com___kloudlite___operator___apis___distribution___v1__RegistryIn! + resource: Github__com___kloudlite___operator___apis___distribution___v1__ResourceIn! +} + +input Github__com___kloudlite___operator___apis___distribution___v1__RegistryIn { + repo: Github__com___kloudlite___operator___apis___distribution___v1__RepoIn! +} + +input Github__com___kloudlite___operator___apis___distribution___v1__RepoIn { + name: String! + tags: [String!]! +} + +input Github__com___kloudlite___operator___apis___distribution___v1__ResourceIn { + cpu: Int! + memoryInMb: Int! +} + +input Github__com___kloudlite___operator___pkg___operator__CheckIn { + generation: Int + message: String + status: Boolean! +} + +input Github__com___kloudlite___operator___pkg___operator__ResourceRefIn { + name: String! + namespace: String! +} + +input Github__com___kloudlite___operator___pkg___operator__StatusIn { + checks: Map + isReady: Boolean! + lastReadyGeneration: Int + lastReconcileTime: Date + message: Github__com___kloudlite___operator___pkg___raw____json__RawJsonIn + resources: [Github__com___kloudlite___operator___pkg___operator__ResourceRefIn!] +} + +input Github__com___kloudlite___operator___pkg___raw____json__RawJsonIn { + RawMessage: Any +} + +input MetadataIn { + annotations: Map + labels: Map + name: String! + namespace: String +} + +enum Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__BuildStatus { + error + failed + idle + pending + queued + running + success +} + +enum Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationUnit { + d + h + m + w + y +} + +enum Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitProvider { + github + gitlab +} + +enum Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__RepoAccess { + read + read_write +} + +enum Github__com___kloudlite___api___pkg___types__SyncAction { + APPLY + DELETE +} + +enum Github__com___kloudlite___api___pkg___types__SyncState { + APPLIED_AT_AGENT + DELETED_AT_AGENT + DELETING_AT_AGENT + ERRORED_AT_AGENT + IDLE + IN_QUEUE + RECEIVED_UPDATE_FROM_AGENT + UPDATED_AT_AGENT +} + diff --git a/apps/container-registry/internal/app/graph/struct-to-graphql/credential.graphqls b/apps/container-registry/internal/app/graph/struct-to-graphql/credential.graphqls new file mode 100644 index 000000000..a85573b35 --- /dev/null +++ b/apps/container-registry/internal/app/graph/struct-to-graphql/credential.graphqls @@ -0,0 +1,33 @@ +type Credential @shareable { + access: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__RepoAccess! + accountName: String! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + expiration: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration! + id: String! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + name: String! + recordVersion: Int! + updateTime: Date! + username: String! +} + +type CredentialEdge @shareable { + cursor: String! + node: Credential! +} + +type CredentialPaginatedRecords @shareable { + edges: [CredentialEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input CredentialIn { + access: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__RepoAccess! + expiration: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationIn! + name: String! + username: String! +} + diff --git a/apps/container-registry/internal/app/graph/struct-to-graphql/cursorpagination.graphqls b/apps/container-registry/internal/app/graph/struct-to-graphql/cursorpagination.graphqls new file mode 100644 index 000000000..58815e858 --- /dev/null +++ b/apps/container-registry/internal/app/graph/struct-to-graphql/cursorpagination.graphqls @@ -0,0 +1,23 @@ +type CursorPagination @shareable { + after: String + before: String + first: Int + last: Int + orderBy: String + sortDirection: CursorPaginationSortDirection +} + +input CursorPaginationIn { + after: String + before: String + first: Int + last: Int + orderBy: String = "_id" + sortDirection: CursorPaginationSortDirection = "ASC" +} + +enum CursorPaginationSortDirection { + ASC + DESC +} + diff --git a/apps/container-registry/internal/app/graph/struct-to-graphql/digest.graphqls b/apps/container-registry/internal/app/graph/struct-to-graphql/digest.graphqls new file mode 100644 index 000000000..7d6e996a2 --- /dev/null +++ b/apps/container-registry/internal/app/graph/struct-to-graphql/digest.graphqls @@ -0,0 +1,29 @@ +type Digest @shareable { + accountName: String! + actor: String! + creationTime: Date! + deleting: Boolean! + digest: String! + id: String! + length: Int! + markedForDeletion: Boolean + mediaType: String! + recordVersion: Int! + repository: String! + size: Int! + tags: [String!]! + updateTime: Date! + url: String! +} + +type DigestEdge @shareable { + cursor: String! + node: Digest! +} + +type DigestPaginatedRecords @shareable { + edges: [DigestEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + diff --git a/apps/infra/internal/app/graph/crd-to-gql/directives.graphqls b/apps/container-registry/internal/app/graph/struct-to-graphql/directives.graphqls similarity index 77% rename from apps/infra/internal/app/graph/crd-to-gql/directives.graphqls rename to apps/container-registry/internal/app/graph/struct-to-graphql/directives.graphqls index 7f717fc28..59d6b45c6 100644 --- a/apps/infra/internal/app/graph/crd-to-gql/directives.graphqls +++ b/apps/container-registry/internal/app/graph/struct-to-graphql/directives.graphqls @@ -1,5 +1,4 @@ - -extend schema @link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@key", "@shareable"]) +extend schema @link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@key", "@shareable", "@external"]) directive @goField( forceResolver: Boolean diff --git a/apps/container-registry/internal/app/graph/struct-to-graphql/gitbranch.graphqls b/apps/container-registry/internal/app/graph/struct-to-graphql/gitbranch.graphqls new file mode 100644 index 000000000..24e93d4d6 --- /dev/null +++ b/apps/container-registry/internal/app/graph/struct-to-graphql/gitbranch.graphqls @@ -0,0 +1,5 @@ +type GitBranch @shareable { + name: String + protected: Boolean +} + diff --git a/apps/container-registry/internal/app/graph/struct-to-graphql/githubbranch.graphqls b/apps/container-registry/internal/app/graph/struct-to-graphql/githubbranch.graphqls new file mode 100644 index 000000000..7917ada03 --- /dev/null +++ b/apps/container-registry/internal/app/graph/struct-to-graphql/githubbranch.graphqls @@ -0,0 +1,5 @@ +type GithubBranch @shareable { + name: String + protected: Boolean +} + diff --git a/apps/container-registry/internal/app/graph/struct-to-graphql/githubinstallation.graphqls b/apps/container-registry/internal/app/graph/struct-to-graphql/githubinstallation.graphqls new file mode 100644 index 000000000..c48c4ac9b --- /dev/null +++ b/apps/container-registry/internal/app/graph/struct-to-graphql/githubinstallation.graphqls @@ -0,0 +1,10 @@ +type GithubInstallation @shareable { + account: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount + appId: Int + id: Int + nodeId: String + repositoriesUrl: String + targetId: Int + targetType: String +} + diff --git a/apps/container-registry/internal/app/graph/struct-to-graphql/githublistrepository.graphqls b/apps/container-registry/internal/app/graph/struct-to-graphql/githublistrepository.graphqls new file mode 100644 index 000000000..313fe5054 --- /dev/null +++ b/apps/container-registry/internal/app/graph/struct-to-graphql/githublistrepository.graphqls @@ -0,0 +1,5 @@ +type GithubListRepository @shareable { + repositories: [Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository]! + totalCount: Int +} + diff --git a/apps/container-registry/internal/app/graph/struct-to-graphql/githubsearchrepository.graphqls b/apps/container-registry/internal/app/graph/struct-to-graphql/githubsearchrepository.graphqls new file mode 100644 index 000000000..0ac90646c --- /dev/null +++ b/apps/container-registry/internal/app/graph/struct-to-graphql/githubsearchrepository.graphqls @@ -0,0 +1,6 @@ +type GithubSearchRepository @shareable { + incompleteResults: Boolean + repositories: [Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository]! + total: Int +} + diff --git a/apps/container-registry/internal/app/graph/struct-to-graphql/gitlabbranch.graphqls b/apps/container-registry/internal/app/graph/struct-to-graphql/gitlabbranch.graphqls new file mode 100644 index 000000000..99a9c755a --- /dev/null +++ b/apps/container-registry/internal/app/graph/struct-to-graphql/gitlabbranch.graphqls @@ -0,0 +1,11 @@ +type GitlabBranch @shareable { + canPush: Boolean! + default: Boolean! + developersCanMerge: Boolean! + developersCanPush: Boolean! + merged: Boolean! + name: String! + protected: Boolean! + webUrl: String! +} + diff --git a/apps/container-registry/internal/app/graph/struct-to-graphql/gitlabgroup.graphqls b/apps/container-registry/internal/app/graph/struct-to-graphql/gitlabgroup.graphqls new file mode 100644 index 000000000..9658137ec --- /dev/null +++ b/apps/container-registry/internal/app/graph/struct-to-graphql/gitlabgroup.graphqls @@ -0,0 +1,6 @@ +type GitlabGroup @shareable { + avatarUrl: String! + fullName: String! + id: String! +} + diff --git a/apps/container-registry/internal/app/graph/struct-to-graphql/gitlabproject.graphqls b/apps/container-registry/internal/app/graph/struct-to-graphql/gitlabproject.graphqls new file mode 100644 index 000000000..2592db821 --- /dev/null +++ b/apps/container-registry/internal/app/graph/struct-to-graphql/gitlabproject.graphqls @@ -0,0 +1,22 @@ +type GitlabProject @shareable { + archived: Boolean! + avatarUrl: String! + createdAt: Date + creatorId: Int! + defaultBranch: String! + description: String! + emptyRepo: Boolean! + httpUrlToRepo: String! + id: Int! + lastActivityAt: Date + name: String! + nameWithNamespace: String! + path: String! + pathWithNamespace: String! + public: Boolean! + sshUrlToRepo: String! + tagList: [String!]! + topics: [String!]! + webUrl: String! +} + diff --git a/apps/container-registry/internal/app/graph/struct-to-graphql/matchfilter.graphqls b/apps/container-registry/internal/app/graph/struct-to-graphql/matchfilter.graphqls new file mode 100644 index 000000000..ef1a0cb45 --- /dev/null +++ b/apps/container-registry/internal/app/graph/struct-to-graphql/matchfilter.graphqls @@ -0,0 +1,20 @@ +type MatchFilter @shareable { + array: [Any!] + exact: Any + matchType: MatchFilterMatchType! + regex: String +} + +input MatchFilterIn { + array: [Any!] + exact: Any + matchType: MatchFilterMatchType! + regex: String +} + +enum MatchFilterMatchType { + array + exact + regex +} + diff --git a/apps/container-registry/internal/app/graph/struct-to-graphql/pagination.graphqls b/apps/container-registry/internal/app/graph/struct-to-graphql/pagination.graphqls new file mode 100644 index 000000000..c3bd803a3 --- /dev/null +++ b/apps/container-registry/internal/app/graph/struct-to-graphql/pagination.graphqls @@ -0,0 +1,10 @@ +type Pagination @shareable { + page: Int + per_page: Int +} + +input PaginationIn { + page: Int + per_page: Int +} + diff --git a/apps/container-registry/internal/app/graph/struct-to-graphql/repository.graphqls b/apps/container-registry/internal/app/graph/struct-to-graphql/repository.graphqls new file mode 100644 index 000000000..4f4884436 --- /dev/null +++ b/apps/container-registry/internal/app/graph/struct-to-graphql/repository.graphqls @@ -0,0 +1,27 @@ +type Repository @shareable { + accountName: String! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + id: String! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + name: String! + recordVersion: Int! + updateTime: Date! +} + +type RepositoryEdge @shareable { + cursor: String! + node: Repository! +} + +type RepositoryPaginatedRecords @shareable { + edges: [RepositoryEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input RepositoryIn { + name: String! +} + diff --git a/apps/container-registry/internal/app/graph/struct-to-graphql/scalars.graphqls b/apps/container-registry/internal/app/graph/struct-to-graphql/scalars.graphqls new file mode 100644 index 000000000..1f83443a9 --- /dev/null +++ b/apps/container-registry/internal/app/graph/struct-to-graphql/scalars.graphqls @@ -0,0 +1,4 @@ +scalar Any +scalar Json +scalar Map +scalar Date diff --git a/apps/container-registry/internal/app/graph/util.go b/apps/container-registry/internal/app/graph/util.go index 1c940ed05..cd7939770 100644 --- a/apps/container-registry/internal/app/graph/util.go +++ b/apps/container-registry/internal/app/graph/util.go @@ -3,12 +3,49 @@ package graph import ( "context" "fmt" - "kloudlite.io/apps/container-registry/internal/domain" + "strings" + + "github.com/kloudlite/api/apps/container-registry/internal/domain" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" ) -func toRegistryContext(ctx context.Context) domain.RegistryContext { - if cc, ok := ctx.Value("kloudlite-ctx").(domain.RegistryContext); ok { - return cc +func getUserId(ctx context.Context) (repos.ID, error) { + session, ok := ctx.Value("user-session").(*common.AuthSession) + + if !ok { + return "", errors.NewE(errors.Newf("context values %q is missing", "user-session")) + } + + return session.UserId, nil +} + +func toRegistryContext(ctx context.Context) (domain.RegistryContext, error) { + session, ok := ctx.Value("user-session").(*common.AuthSession) + + errMsgs := []string{} + if !ok { + errMsgs = append(errMsgs, fmt.Sprintf("context values %q is missing", "user-session")) } - panic(fmt.Errorf("context values '%s' is missing", "kloudlite-ctx")) + + accountName, ok := ctx.Value("account-name").(string) + if !ok { + errMsgs = append(errMsgs, fmt.Sprintf("context values %q is missing", "account-name")) + } + + var err error + if len(errMsgs) != 0 { + err = errors.NewE(errors.Newf("%v", strings.Join(errMsgs, ","))) + } + + return domain.RegistryContext{ + Context: ctx, + AccountName: accountName, + + UserId: session.UserId, + UserName: session.UserName, + UserEmail: session.UserEmail, + }, errors.NewE(err) + } diff --git a/apps/container-registry/internal/app/grpc-server.go b/apps/container-registry/internal/app/grpc-server.go deleted file mode 100644 index 0a39bd8b8..000000000 --- a/apps/container-registry/internal/app/grpc-server.go +++ /dev/null @@ -1,41 +0,0 @@ -package app - -import ( - "context" - "kloudlite.io/apps/container-registry/internal/domain" - - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/container_registry" -) - -type containerRegistryGrpcServer struct { - container_registry.UnimplementedContainerRegistryServer - d domain.Domain -} - -func (c *containerRegistryGrpcServer) CreateProjectForAccount(ctx context.Context, in *container_registry.CreateProjectIn) (*container_registry.CreateProjectOut, error) { - return nil, nil - // _, err := c.d.CreateHarborProject(domain.NewRegistryContext(ctx, "", in.AccountName)) - // if err != nil { - // return nil, err - // } - // return &container_registry.CreateProjectOut{ - // Success: true, - // }, nil -} - -func (c *containerRegistryGrpcServer) GetSvcCredentials(ctx context.Context, in *container_registry.GetSvcCredentialsIn) (*container_registry.GetSvcCredentialsOut, error) { - credentials, err := c.d.GetHarborCredentials(domain.NewRegistryContext(ctx, "", in.AccountName)) - if err != nil { - return nil, err - } - return &container_registry.GetSvcCredentialsOut{ - UserName: credentials.Username, - Password: credentials.Password, - }, nil -} - -func fxRPCServer(d domain.Domain) container_registry.ContainerRegistryServer { - return &containerRegistryGrpcServer{ - d: d, - } -} diff --git a/apps/container-registry/internal/app/main.go b/apps/container-registry/internal/app/main.go index 4b4896f60..3817327b9 100644 --- a/apps/container-registry/internal/app/main.go +++ b/apps/container-registry/internal/app/main.go @@ -2,101 +2,318 @@ package app import ( "context" - "fmt" + "net/url" + + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/kv" + msg_nats "github.com/kloudlite/api/pkg/messaging/nats" + "github.com/kloudlite/api/pkg/nats" + "github.com/99designs/gqlgen/graphql" "github.com/gofiber/fiber/v2" + "github.com/gofiber/fiber/v2/middleware/basicauth" + "github.com/kloudlite/api/apps/container-registry/internal/app/graph" + "github.com/kloudlite/api/apps/container-registry/internal/app/graph/generated" + "github.com/kloudlite/api/apps/container-registry/internal/domain" + "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" + "github.com/kloudlite/api/apps/container-registry/internal/env" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/constants" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/auth" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" + "github.com/kloudlite/api/pkg/grpc" + httpServer "github.com/kloudlite/api/pkg/http-server" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/api/pkg/repos" + registryAuth "github.com/kloudlite/container-registry-authorizer/auth" "go.uber.org/fx" - "google.golang.org/grpc" - "kloudlite.io/apps/container-registry/internal/app/graph" - "kloudlite.io/apps/container-registry/internal/app/graph/generated" - "kloudlite.io/apps/container-registry/internal/domain" - "kloudlite.io/apps/container-registry/internal/domain/entities" - "kloudlite.io/apps/container-registry/internal/env" - "kloudlite.io/common" - "kloudlite.io/constants" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/container_registry" - "kloudlite.io/pkg/cache" - "kloudlite.io/pkg/harbor" - httpServer "kloudlite.io/pkg/http-server" - "kloudlite.io/pkg/repos" ) -type AuthCacheClient cache.Client +type ( + IAMGrpcClient grpc.Client + AuthGrpcClient grpc.Client + AuthorizerHttpServer httpServer.Server +) + +type venv struct { + ev *env.Env +} + +func (venv *venv) GithubConfig() (clientId, clientSecret, callbackUrl, ghAppId, ghAppPKFile string) { + return venv.ev.GithubClientId, venv.ev.GithubClientSecret, venv.ev.GithubCallbackUrl, venv.ev.GithubAppId, venv.ev.GithubAppPKFile +} + +func (fm *venv) GithubScopes() string { + return fm.ev.GithubScopes +} + +func (fm *venv) GitlabConfig() (clientId, clientSecret, callbackUrl string) { + return fm.ev.GitlabClientId, fm.ev.GitlabClientSecret, fm.ev.GitlabCallbackUrl +} + +func (fm *venv) GitlabScopes() string { + return fm.ev.GitlabScopes +} + +func (fm *venv) GitlabWebhookAuthzSecret() *string { + return &fm.ev.GitlabWebhookAuthzSecret +} + +func (fm *venv) GitlabWebhookUrl() *string { + return &fm.ev.GitlabWebhookUrl +} var Module = fx.Module("app", - repos.NewFxMongoRepo[*entities.HarborProject]("project", "prj", entities.HarborProjectIndexes), - repos.NewFxMongoRepo[*entities.HarborRobotUser]("robot_users", "rob", entities.HarborRobotUserIndexes), + repos.NewFxMongoRepo[*entities.Repository]("repositories", "prj", entities.RepositoryIndexes), + repos.NewFxMongoRepo[*entities.Credential]("credentials", "cred", entities.CredentialIndexes), + repos.NewFxMongoRepo[*entities.Digest]("tags", "tag", entities.TagIndexes), + repos.NewFxMongoRepo[*entities.Build]("builds", "build", entities.BuildIndexes), + repos.NewFxMongoRepo[*entities.BuildCacheKey]("build-caches", "build-cache", entities.BuildCacheKeyIndexes), + repos.NewFxMongoRepo[*entities.BuildRun]("build_runs", "build_run", entities.BuildRunIndices), - fx.Provide(fxRPCServer), - fx.Invoke( - func(server *grpc.Server, crServer container_registry.ContainerRegistryServer) { - container_registry.RegisterContainerRegistryServer(server, crServer) + fx.Provide(func(jc *nats.JetstreamClient, ev *env.Env, logger logging.Logger) (GitWebhookConsumer, error) { + topic := string(common.GitWebhookTopicName) + consumerName := "cr:git-webhook" + return msg_nats.NewJetstreamConsumer(context.TODO(), jc, msg_nats.JetstreamConsumerArgs{ + Stream: ev.EventsNatsStream, + ConsumerConfig: msg_nats.ConsumerConfig{ + Name: consumerName, + Durable: consumerName, + Description: "this consumer reads message from a subject dedicated to errors, that occurred when the resource was applied at the agent", + FilterSubjects: []string{ + topic, + }, + }, + }) + }), + + fx.Invoke(func(lf fx.Lifecycle, consumer GitWebhookConsumer, d domain.Domain, logr logging.Logger) { + lf.Append(fx.Hook{ + OnStart: func(ctx context.Context) error { + go func() { + err := processGitWebhooks(ctx, d, consumer, logr) + if err != nil { + logr.Errorf(err, "could not process git webhooks") + } + }() + return nil + }, + OnStop: func(ctx context.Context) error { + return nil + }, + }) + }), + + fx.Provide(func(jc *nats.JetstreamClient, ev *env.Env, logger logging.Logger) BuildRunProducer { + return msg_nats.NewJetstreamProducer(jc) + }), + + fx.Provide(func(jsc *nats.JetstreamClient, ev *env.Env) (ReceiveResourceUpdatesConsumer, error) { + topic := common.GetPlatformClusterMessagingTopic("*", "*", common.ContainerRegistryReceiver, common.EventResourceUpdate) + + consumerName := "cr:resource-updates" + return msg_nats.NewJetstreamConsumer(context.TODO(), jsc, msg_nats.JetstreamConsumerArgs{ + Stream: ev.ResourceNatsStream, + ConsumerConfig: msg_nats.ConsumerConfig{ + Name: consumerName, + Durable: consumerName, + Description: "this consumer receives container registry resource updates, processes them, and keeps our Database updated about things happening in the cluster", + FilterSubjects: []string{topic}, + }, + }) + }), + + fx.Invoke(func(lf fx.Lifecycle, consumer ReceiveResourceUpdatesConsumer, d domain.Domain, logger logging.Logger) { + lf.Append(fx.Hook{ + OnStart: func(context.Context) error { + go processResourceUpdates(consumer, d, logger) + return nil + }, + OnStop: func(ctx context.Context) error { + return consumer.Stop(ctx) + }, + }) + }), + + fx.Provide(func(jsc *nats.JetstreamClient, ev *env.Env) (ErrorOnApplyConsumer, error) { + topic := common.GetPlatformClusterMessagingTopic("*", "*", common.ConsoleReceiver, common.EventErrorOnApply) + + consumerName := "cr:error-on-apply" + + return msg_nats.NewJetstreamConsumer(context.TODO(), jsc, msg_nats.JetstreamConsumerArgs{ + Stream: ev.ResourceNatsStream, + ConsumerConfig: msg_nats.ConsumerConfig{ + Name: consumerName, + Durable: consumerName, + Description: "this consumer receives container registry resource apply error on agent, processes them, and keeps our Database updated about why the resource apply failed at agent", + FilterSubjects: []string{topic}, + }, + }) + }), + + fx.Invoke(func(lf fx.Lifecycle, consumer ErrorOnApplyConsumer, d domain.Domain, logger logging.Logger) { + lf.Append(fx.Hook{ + OnStart: func(context.Context) error { + go ProcessErrorOnApply(consumer, logger, d) + return nil + }, + OnStop: func(ctx context.Context) error { + return consumer.Stop(ctx) + }, + }) + }), + + fx.Provide(func(jsc *nats.JetstreamClient, logger logging.Logger) SendTargetClusterMessagesProducer { + return msg_nats.NewJetstreamProducer(jsc) + }), + + fx.Provide(func(targetMessageProducer SendTargetClusterMessagesProducer) domain.ResourceDispatcher { + return NewResourceDispatcher(targetMessageProducer) + }), + + fx.Provide(func(cli *nats.Client, logger logging.Logger) domain.ResourceEventPublisher { + return NewResourceEventPublisher(cli, logger) + }), + + fx.Provide( + func(conn IAMGrpcClient) iam.IAMClient { + return iam.NewIAMClient(conn) }, ), fx.Provide( - func(ev *env.Env) (*harbor.Client, error) { - return harbor.NewClient( - harbor.Args{ - HarborAdminUsername: ev.HarborAdminUsername, - HarborAdminPassword: ev.HarborAdminPassword, - HarborRegistryHost: ev.HarborRegistryHost, - }, - ) + func(conn AuthGrpcClient) auth.AuthClient { + return auth.NewAuthClient(conn) }, ), + fx.Provide(func(ev *env.Env) *venv { + return &venv{ev} + }), + + fxGithub[*venv](), + fxGitlab[*venv](), + fx.Invoke( - func( - server *fiber.App, - d domain.Domain, - cacheClient AuthCacheClient, - ev *env.Env, - ) { + func(server httpServer.Server, d domain.Domain, sessionRepo kv.Repo[*common.AuthSession], ev *env.Env) { gqlConfig := generated.Config{Resolvers: &graph.Resolver{Domain: d}} - gqlConfig.Directives.IsLoggedIn = func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) { + + gqlConfig.Directives.IsLoggedInAndVerified = func(ctx context.Context, _ interface{}, next graphql.Resolver) (res interface{}, err error) { sess := httpServer.GetSession[*common.AuthSession](ctx) if sess == nil { return nil, fiber.ErrUnauthorized } - return next(ctx) + + if !sess.UserVerified { + return nil, &fiber.Error{ + Code: fiber.StatusForbidden, + Message: "user's email is not verified", + } + } + + return next(context.WithValue(ctx, "user-session", sess)) } - gqlConfig.Directives.HasAccount = func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) { + gqlConfig.Directives.HasAccount = func(ctx context.Context, _ interface{}, next graphql.Resolver) (res interface{}, err error) { sess := httpServer.GetSession[*common.AuthSession](ctx) if sess == nil { return nil, fiber.ErrUnauthorized } - m := httpServer.GetHttpCookies(ctx) - klAccount := m["kloudlite-account"] + klAccount := m[ev.AccountCookieName] if klAccount == "" { - return nil, fmt.Errorf("no cookie named '%s' present in request", "kloudlite-account") + return nil, errors.Newf("no cookie named %q present in request", ev.AccountCookieName) } - cc := domain.NewRegistryContext(ctx, sess.UserId, klAccount) - return next(context.WithValue(ctx, "kloudlite-ctx", cc)) - } - - gqlConfig.Directives.CanActOnAccount = func(ctx context.Context, obj interface{}, next graphql.Resolver, action *string) (res interface{}, err error) { - if action == nil { - - } - return next(ctx) + nctx := context.WithValue(ctx, "user-session", sess) + nctx = context.WithValue(nctx, "account-name", klAccount) + return next(nctx) } schema := generated.NewExecutableSchema(gqlConfig) - httpServer.SetupGQLServer( - server, - schema, - httpServer.NewSessionMiddleware[*common.AuthSession]( - cacheClient, - "hotspot-session", - ev.CookieDomain, - constants.CacheSessionPrefix, - ), - ) + server.SetupGraphqlServer(schema, httpServer.NewSessionMiddleware( + sessionRepo, + "hotspot-session", + ev.CookieDomain, + constants.CacheSessionPrefix, + )) }, ), + + fx.Invoke(func(server AuthorizerHttpServer, envs *env.Env, d domain.Domain, logger logging.Logger) { + + authLogger := logger.WithKV("route", "/auth") + + a := server.Raw() + a.Post("/events", func(c *fiber.Ctx) error { + ctx := c.Context() + + var eventMessage entities.EventMessage + if err := c.BodyParser(&eventMessage); err != nil { + return c.SendStatus(400) + } + + if err := d.ProcessRegistryEvents(ctx, eventMessage.Events, logger); err != nil { + return c.SendStatus(400) + } + + return c.SendStatus(200) + }) + + a.Use("/auth", func(c *fiber.Ctx) error { + path := c.Query("path", "/") + method := c.Query("method", "GET") + + u, err := url.Parse("http://example.com" + path) + if err != nil { + return c.SendStatus(400) + } + + if u.Query().Has("_state") { + return c.Next() + } + + if method == "HEAD" { + return c.Next() + } + logger.Infof("path: %s, method: %s", path, method) + + b_auth := basicauth.New(basicauth.Config{ + Realm: "Forbidden", + Authorizer: func(u string, p string) bool { + if method == "DELETE" && u != domain.KL_ADMIN { + return false + } + + userName, accountName, _, err := registryAuth.ParseToken(p) + if err != nil { + authLogger.Errorf(err, "could not parse token") + return false + } + + s, err := d.GetTokenKey(context.TODO(), userName, accountName) + if err != nil { + authLogger.Errorf(err, "could not get token key") + return false + } + + if err := registryAuth.Authorizer(u, p, path, method, envs.RegistrySecretKey+s); err != nil { + authLogger.Errorf(err, "could not authorize") + return false + } + return true + }, + }) + + r := b_auth(c) + + return r + }) + + a.Get("/auth", func(c *fiber.Ctx) error { + return c.SendStatus(200) + }) + }), + domain.Module, ) diff --git a/apps/container-registry/internal/app/process-error-on-apply.go b/apps/container-registry/internal/app/process-error-on-apply.go new file mode 100644 index 000000000..d0d2b52cc --- /dev/null +++ b/apps/container-registry/internal/app/process-error-on-apply.go @@ -0,0 +1,69 @@ +package app + +import ( + "context" + "encoding/json" + "github.com/kloudlite/api/apps/container-registry/internal/domain" + + t "github.com/kloudlite/api/apps/tenant-agent/types" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/api/pkg/messaging" + "github.com/kloudlite/api/pkg/messaging/types" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" +) + +type ErrorOnApplyConsumer messaging.Consumer + +func ProcessErrorOnApply(consumer ErrorOnApplyConsumer, logger logging.Logger, d domain.Domain) { + counter := 0 + processMsg := func(msg *types.ConsumeMsg) error { + counter += 1 + + var errMsg t.AgentErrMessage + if err := json.Unmarshal(msg.Payload, &errMsg); err != nil { + return errors.NewE(err) + } + + obj := unstructured.Unstructured{Object: errMsg.Object} + + mLogger := logger.WithKV( + "gvk", obj.GroupVersionKind(), + "accountName", errMsg.AccountName, + "clusterName", errMsg.ClusterName, + ) + + mLogger.Infof("[%d] received message", counter) + defer func() { + mLogger.Infof("[%d] processed message", counter) + }() + + kind := obj.GroupVersionKind().Kind + dctx := domain.RegistryContext{ + Context: context.TODO(), + UserId: "sys-user:error-on-apply-worker", + UserEmail: "", + UserName: "", + AccountName: errMsg.AccountName, + } + + switch obj.GroupVersionKind().String() { + case buildRunGVK.String(): + { + return d.OnBuildRunApplyErrorMessage(dctx, errMsg.ClusterName, obj.GetName(), errMsg.Error) + } + default: + { + return errors.Newf("infra error-on-apply reader does not acknowledge resource with kind (%s)", kind) + } + } + } + + if err := consumer.Consume(processMsg, types.ConsumeOpts{ + OnError: func(err error) error { + return nil + }, + }); err != nil { + logger.Errorf(err, "when setting up error-on-apply consumer") + } +} diff --git a/apps/container-registry/internal/app/process-resource-updates.go b/apps/container-registry/internal/app/process-resource-updates.go new file mode 100644 index 000000000..e22ab19aa --- /dev/null +++ b/apps/container-registry/internal/app/process-resource-updates.go @@ -0,0 +1,96 @@ +package app + +import ( + "context" + "encoding/json" + "fmt" + "strings" + "time" + + "github.com/kloudlite/api/apps/container-registry/internal/domain" + "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" + + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/operator/operators/resource-watcher/types" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + + "github.com/kloudlite/api/pkg/messaging" + msgTypes "github.com/kloudlite/api/pkg/messaging/types" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +type ReceiveResourceUpdatesConsumer messaging.Consumer + +func gvk(obj client.Object) string { + val := obj.GetObjectKind().GroupVersionKind().String() + return val +} + +var buildRunGVK = fn.GVK("distribution.kloudlite.io/v1", "BuildRun") + +func processResourceUpdates(consumer ReceiveResourceUpdatesConsumer, d domain.Domain, logger logging.Logger) { + readMsg := func(msg *msgTypes.ConsumeMsg) error { + logger.Debugf("processing msg timestamp %s", msg.Timestamp.Format(time.RFC3339)) + + var su types.ResourceUpdate + if err := json.Unmarshal(msg.Payload, &su); err != nil { + logger.Errorf(err, "parsing into status update") + return nil + } + + if su.Object == nil { + logger.Infof("message does not contain 'object', so won't be able to find a resource uniquely, thus ignoring ...") + return nil + } + + if len(strings.TrimSpace(su.AccountName)) == 0 { + logger.Infof("message does not contain 'accountName', so won't be able to find a resource uniquely, thus ignoring ...") + return nil + } + + obj := unstructured.Unstructured{Object: su.Object} + mLogger := logger.WithKV( + "gvk", obj.GetObjectKind().GroupVersionKind(), + "accountName/clusterName", fmt.Sprintf("%s/%s", su.AccountName, su.ClusterName), + ) + + mLogger.Infof("received message") + defer func() { + mLogger.Infof("processed message") + }() + + dctx := domain.RegistryContext{Context: context.TODO(), UserId: "sys-user-process-infra-updates", AccountName: su.AccountName} + + gvkStr := obj.GetObjectKind().GroupVersionKind().String() + + switch gvkStr { + case buildRunGVK.String(): + { + var buildRun entities.BuildRun + if err := fn.JsonConversion(su.Object, &buildRun); err != nil { + return err + } + if obj.GetDeletionTimestamp() != nil { + return d.OnBuildRunDeleteMessage(dctx, buildRun) + } + return d.OnBuildRunUpdateMessage(dctx, buildRun) + } + + default: + { + mLogger.Infof("container registry status updates consumer does not acknowledge the gvk %s", gvk(&obj)) + return nil + } + } + } + + if err := consumer.Consume(readMsg, msgTypes.ConsumeOpts{ + OnError: func(err error) error { + logger.Errorf(err, "error while consuming message") + return nil + }, + }); err != nil { + logger.Errorf(err, "error while consuming messages") + } +} diff --git a/apps/container-registry/internal/domain/api.go b/apps/container-registry/internal/domain/api.go index 1022b032e..2bbf95bc0 100644 --- a/apps/container-registry/internal/domain/api.go +++ b/apps/container-registry/internal/domain/api.go @@ -2,33 +2,86 @@ package domain import ( "context" - "kloudlite.io/apps/container-registry/internal/domain/entities" - "kloudlite.io/pkg/harbor" - "kloudlite.io/pkg/repos" - opHarbor "github.com/kloudlite/operator/pkg/harbor" + + "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/api/pkg/repos" + "github.com/kloudlite/api/pkg/types" ) func NewRegistryContext(parent context.Context, userId repos.ID, accountName string) RegistryContext { return RegistryContext{ Context: parent, - userId: userId, - accountName: accountName, + UserId: userId, + AccountName: accountName, } } +type CheckNameAvailabilityOutput struct { + Result bool `json:"result"` + SuggestedNames []string `json:"suggestedNames,omitempty"` +} + type Domain interface { - GetHarborImages(ctx RegistryContext) ([]harbor.Repository, error) - GetRepoArtifacts(ctx RegistryContext, repoName string) ([]harbor.Artifact, error) + ProcessRegistryEvents(ctx context.Context, events []entities.Event, logger logging.Logger) error + + CheckUserNameAvailability(ctx RegistryContext, username string) (*CheckNameAvailabilityOutput, error) + // registry + ListRepositories(ctx RegistryContext, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.Repository], error) + CreateRepository(ctx RegistryContext, repoName string) (*entities.Repository, error) + DeleteRepository(ctx RegistryContext, repoName string) error + + // tags + ListRepositoryDigests(ctx RegistryContext, repoName string, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.Digest], error) + DeleteRepositoryDigest(ctx RegistryContext, repoName string, digest string) error + + // credential + ListCredentials(ctx RegistryContext, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.Credential], error) + CreateCredential(ctx RegistryContext, credential entities.Credential) (*entities.Credential, error) + DeleteCredential(ctx RegistryContext, userName string) error + + GetToken(ctx RegistryContext, username string) (string, error) + GetTokenKey(ctx context.Context, username string, accountname string) (string, error) + + AddBuild(ctx RegistryContext, build entities.Build) (*entities.Build, error) + UpdateBuild(ctx RegistryContext, id repos.ID, build entities.Build) (*entities.Build, error) + UpdateBuildInternal(ctx context.Context, build *entities.Build) (*entities.Build, error) + ListBuilds(ctx RegistryContext, repoName string, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.Build], error) + GetBuild(ctx RegistryContext, buildId repos.ID) (*entities.Build, error) + DeleteBuild(ctx RegistryContext, buildId repos.ID) error + TriggerBuild(ctx RegistryContext, buildId repos.ID) error + + // webhook + ParseGithubHook(eventType string, hookBody []byte) (*GitWebhookPayload, error) + ParseGitlabHook(eventType string, hookBody []byte) (*GitWebhookPayload, error) + + GithubInstallationToken(ctx context.Context, repoUrl string) (string, error) + GithubListInstallations(ctx context.Context, userId repos.ID, pagination *types.Pagination) ([]*entities.GithubInstallation, error) + GithubListRepos(ctx context.Context, userId repos.ID, installationId int64, pagination *types.Pagination) (*entities.GithubListRepository, error) + GithubSearchRepos(ctx context.Context, userId repos.ID, q, org string, pagination *types.Pagination) (*entities.GithubSearchRepository, error) + GithubListBranches(ctx context.Context, userId repos.ID, repoUrl string, pagination *types.Pagination) ([]*entities.GitBranch, error) + GithubAddWebhook(ctx context.Context, userId repos.ID, repoUrl string) (repos.ID, error) + + GitlabListGroups(ctx context.Context, userId repos.ID, query *string, pagination *types.Pagination) ([]*entities.GitlabGroup, error) + GitlabListRepos(ctx context.Context, userId repos.ID, gid string, query *string, pagination *types.Pagination) ([]*entities.GitlabProject, error) + GitlabListBranches(ctx context.Context, userId repos.ID, repoId string, query *string, pagination *types.Pagination) ([]*entities.GitBranch, error) + GitlabAddWebhook(ctx context.Context, userId repos.ID, repoId string) (*int, error) + GitlabPullToken(ctx context.Context, userId repos.ID) (string, error) + + GetBuildTemplate(obj BuildJobTemplateData) ([]byte, error) - // query:harbor robots - ListHarborRobots(ctx RegistryContext) ([]*entities.HarborRobotUser, error) + ListBuildsByGit(ctx context.Context, repoUrl, branch, provider string) ([]*entities.Build, error) - // mutation:harbor robots - CreateHarborRobot(ctx RegistryContext, hru *entities.HarborRobotUser) (*entities.HarborRobotUser, error) - DeleteHarborRobot(ctx RegistryContext, robotId int) error - UpdateHarborRobot(ctx RegistryContext, name string, permissions []opHarbor.Permission) (*entities.HarborRobotUser, error) - ReSyncHarborRobot(ctx RegistryContext, name string) error + AddBuildCache(ctx RegistryContext, buildCache entities.BuildCacheKey) (*entities.BuildCacheKey, error) + UpdateBuildCache(ctx RegistryContext, id repos.ID, buildCache entities.BuildCacheKey) (*entities.BuildCacheKey, error) + DeleteBuildCache(ctx RegistryContext, id repos.ID) error + ListBuildCaches(ctx RegistryContext, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.BuildCacheKey], error) - // CreateHarborProject(ctx RegistryContext) (*entities.HarborProject, error) - GetHarborCredentials(ctx RegistryContext) (*entities.HarborCredentials, error) + ListBuildRuns(ctx RegistryContext, repoName string, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.BuildRun], error) + GetBuildRun(ctx RegistryContext, repoName string, runName string) (*entities.BuildRun, error) + OnBuildRunUpdateMessage(ctx RegistryContext, buildRun entities.BuildRun) error + OnBuildRunDeleteMessage(ctx RegistryContext, buildRun entities.BuildRun) error + OnBuildRunApplyErrorMessage(ctx RegistryContext, clusterName string,name string, errorMsg string) error + ListBuildsByCache(ctx RegistryContext, cacheId repos.ID, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.Build], error) + CreateBuildRun(ctx RegistryContext, build *entities.Build, hook *GitWebhookPayload, pullToken string) error } diff --git a/apps/container-registry/internal/domain/build-cache.go b/apps/container-registry/internal/domain/build-cache.go new file mode 100644 index 000000000..5d91eb0ff --- /dev/null +++ b/apps/container-registry/internal/domain/build-cache.go @@ -0,0 +1,130 @@ +package domain + +import ( + "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" + fc "github.com/kloudlite/api/apps/container-registry/internal/domain/entities/field-constants" + iamT "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" +) + +func (d *Impl) AddBuildCache(ctx RegistryContext, buildCache entities.BuildCacheKey) (*entities.BuildCacheKey, error) { + co, err := d.iamClient.Can(ctx, &iam.CanIn{ + UserId: string(ctx.UserId), + ResourceRefs: []string{ + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), + }, + Action: string(iamT.UpdateAccount), + }) + if err != nil { + return nil, errors.NewE(err) + } + + if !co.Status { + return nil, errors.Newf("unauthorized to add build cache") + } + + buildCache.AccountName = ctx.AccountName + buildCacheRepoCreated, err := d.buildCacheRepo.Create(ctx, &buildCache) + if err != nil { + return nil, errors.NewE(err) + } + d.resourceEventPublisher.PublishBuildCacheEvent(buildCacheRepoCreated, PublishAdd) + return buildCacheRepoCreated, nil +} + +func (d *Impl) UpdateBuildCache(ctx RegistryContext, id repos.ID, buildCache entities.BuildCacheKey) (*entities.BuildCacheKey, error) { + co, err := d.iamClient.Can(ctx, &iam.CanIn{ + UserId: string(ctx.UserId), + ResourceRefs: []string{ + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), + }, + Action: string(iamT.UpdateAccount), + }) + if err != nil { + return nil, errors.NewE(err) + } + + if !co.Status { + return nil, errors.Newf("unauthorized to update build cache") + } + + buildCacheRepoUpdated, err := d.buildCacheRepo.PatchById( + ctx, + id, + repos.Document{ + fc.BuildCacheKeyVolumeSizeInGB: buildCache.VolumeSize, + fields.DisplayName: buildCache.DisplayName, + fields.AccountName: ctx.AccountName, + }, + ) + + d.resourceEventPublisher.PublishBuildCacheEvent(buildCacheRepoUpdated, PublishUpdate) + return buildCacheRepoUpdated, nil +} + +func (d *Impl) DeleteBuildCache(ctx RegistryContext, id repos.ID) error { + co, err := d.iamClient.Can(ctx, &iam.CanIn{ + UserId: string(ctx.UserId), + ResourceRefs: []string{ + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), + }, + Action: string(iamT.UpdateAccount), + }) + if err != nil { + return errors.NewE(err) + } + + if !co.Status { + return errors.Newf("unauthorized to delete build cache") + } + + back, err := d.buildCacheRepo.FindOne(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.Id: id, + }) + + if err != nil { + return errors.NewE(err) + } + + i, err := d.buildRepo.Count(ctx, repos.Filter{ + fc.BuildSpecAccountName: ctx.AccountName, + fc.BuildSpecCacheKeyName: back.Name, + }) + if err != nil { + return errors.NewE(err) + } + + if i > 0 { + return errors.Newf("build cache is in use, please delete all builds that use this cache first") + } + + err = d.buildCacheRepo.DeleteOne(ctx, repos.Filter{"accountName": ctx.AccountName, "id": id}) + if err != nil { + return errors.NewE(err) + } + d.resourceEventPublisher.PublishBuildCacheEvent(back, PublishDelete) + return nil +} + +func (d *Impl) ListBuildCaches(ctx RegistryContext, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.BuildCacheKey], error) { + co, err := d.iamClient.Can(ctx, &iam.CanIn{ + UserId: string(ctx.UserId), + ResourceRefs: []string{ + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), + }, + Action: string(iamT.GetAccount), + }) + if err != nil { + return nil, errors.NewE(err) + } + + if !co.Status { + return nil, errors.Newf("unauthorized to list build caches") + } + + return d.buildCacheRepo.FindPaginated(ctx, d.buildCacheRepo.MergeMatchFilters(repos.Filter{"accountName": ctx.AccountName}, search), pagination) +} diff --git a/apps/container-registry/internal/domain/build-run.go b/apps/container-registry/internal/domain/build-run.go new file mode 100644 index 000000000..a692420f0 --- /dev/null +++ b/apps/container-registry/internal/domain/build-run.go @@ -0,0 +1,215 @@ +package domain + +import ( + "crypto/md5" + "fmt" + "strings" + "time" + + fc "github.com/kloudlite/api/apps/container-registry/internal/domain/entities/field-constants" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/common/fields" + + "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" + "github.com/kloudlite/api/constants" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + "github.com/kloudlite/container-registry-authorizer/admin" + common_types "github.com/kloudlite/operator/apis/common-types" + dbv1 "github.com/kloudlite/operator/apis/distribution/v1" + distributionv1 "github.com/kloudlite/operator/apis/distribution/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/yaml" +) + +func (d *Impl) ListBuildRuns(ctx RegistryContext, repoName string, matchFilters map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.BuildRun], error) { + filter := repos.Filter{ + fields.AccountName: ctx.AccountName, + fc.BuildRunSpecRegistryRepoName: repoName, + } + paginated, err := d.buildRunRepo.FindPaginated(ctx, d.buildRunRepo.MergeMatchFilters(filter, matchFilters), pagination) + return paginated, err +} + +func (d *Impl) GetBuildRun(ctx RegistryContext, repoName string, buildRunName string) (*entities.BuildRun, error) { + brun, err := d.buildRunRepo.FindOne(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataName: buildRunName, + fc.BuildRunSpecRegistryRepoName: repoName, + }) + if err != nil { + return nil, errors.NewE(err) + } + + if brun == nil { + return nil, errors.Newf("build run with name %q not found", buildRunName) + } + return brun, nil +} + +func (d *Impl) OnBuildRunUpdateMessage(ctx RegistryContext, buildRun entities.BuildRun) error { + if _, err := d.buildRunRepo.Upsert(ctx, repos.Filter{ + fields.MetadataName: buildRun.Name, + fields.MetadataNamespace: buildRun.Namespace, + fields.AccountName: ctx.AccountName, + fields.ClusterName: buildRun.ClusterName, + }, &buildRun); err != nil { + return errors.NewE(err) + } + d.resourceEventPublisher.PublishBuildRunEvent(&buildRun, PublishAdd) + + return nil +} + +func (d *Impl) OnBuildRunDeleteMessage(ctx RegistryContext, buildRun entities.BuildRun) error { + if err := d.buildRunRepo.DeleteOne(ctx, repos.Filter{ + fields.MetadataName: buildRun.Name, + fields.MetadataNamespace: buildRun.Namespace, + fields.AccountName: ctx.AccountName, + fields.ClusterName: buildRun.ClusterName, + }); err != nil { + return errors.NewE(err) + } + d.resourceEventPublisher.PublishBuildRunEvent(&buildRun, PublishDelete) + return nil +} + +func (d *Impl) OnBuildRunApplyErrorMessage(ctx RegistryContext, clusterName string, name string, errorMsg string) error { + upBuildRun, err := d.buildRunRepo.Patch( + ctx, + repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataName: name, + fields.ClusterName: clusterName, + }, + common.PatchForErrorFromAgent( + errorMsg, + common.PatchOpts{ + MessageTimestamp: time.Time{}, + }, + ), + ) + + d.resourceEventPublisher.PublishBuildRunEvent(upBuildRun, PublishUpdate) + return errors.NewE(err) +} + +func getUniqueKey(build *entities.Build, hook *GitWebhookPayload) string { + uid := fmt.Sprint(build.Id, hook.CommitHash) + return fmt.Sprintf("%x", md5.Sum([]byte(uid))) +} + +func (d *Impl) CreateBuildRun(ctx RegistryContext, build *entities.Build, hook *GitWebhookPayload, pullToken string) error { + uniqueKey := getUniqueKey(build, hook) + i, err := admin.GetExpirationTime(fmt.Sprintf("%d%s", 1, "d")) + if err != nil { + return errors.NewE(err) + } + token, err := admin.GenerateToken(KL_ADMIN, build.Spec.AccountName, string("read_write"), i, d.envs.RegistrySecretKey+build.Spec.AccountName) + + sec := corev1.Secret{ + TypeMeta: metav1.TypeMeta{ + Kind: "Secret", + APIVersion: "v1", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: fmt.Sprint("build-run-", uniqueKey), + Namespace: d.envs.JobBuildNamespace, + Annotations: map[string]string{ + "kloudlite.io/build-run.name": uniqueKey, + }, + }, + StringData: map[string]string{ + "registry-admin": KL_ADMIN, + "registry-host": d.envs.RegistryHost, + "registry-token": token, + "github-token": pullToken, + }, + } + var secretCreationError error + if err = d.dispatcher.ApplyToTargetCluster(ctx, build.BuildClusterName, &sec, 0); err != nil { + d.logger.Errorf(err, "could not apply secret") + secretCreationError = err + } + + b, err := d.GetBuildTemplate(BuildJobTemplateData{ + AccountName: build.Spec.AccountName, + Name: uniqueKey, + Namespace: d.envs.JobBuildNamespace, + Labels: map[string]string{ + "kloudlite.io/build-id": string(build.Id), + "kloudlite.io/account": build.Spec.AccountName, + "github.com/commit": hook.CommitHash, + }, + Annotations: map[string]string{ + "kloudlite.io/build-id": string(build.Id), + "kloudlite.io/account": build.Spec.AccountName, + "github.com/commit": hook.CommitHash, + "github.com/repository": hook.RepoUrl, + "github.com/branch": hook.GitBranch, + "kloudlite.io/repo": build.Spec.Registry.Repo.Name, + "kloudlite.io/tag": strings.Join(build.Spec.Registry.Repo.Tags, ","), + }, + BuildOptions: build.Spec.BuildOptions, + Registry: dbv1.Registry{ + Repo: dbv1.Repo{ + Name: build.Spec.Registry.Repo.Name, + Tags: build.Spec.Registry.Repo.Tags, + }, + }, + CacheKeyName: build.Spec.CacheKeyName, + GitRepo: dbv1.GitRepo{ + Url: hook.RepoUrl, + Branch: hook.CommitHash, + }, + Resource: build.Spec.Resource, + CredentialsRef: common_types.SecretRef{ + Name: fmt.Sprint("build-run-", uniqueKey), + Namespace: d.envs.JobBuildNamespace, + }, + }) + brRaw := distributionv1.BuildRun{} + err = yaml.Unmarshal(b, &brRaw) + if err != nil { + d.logger.Errorf(err, "could not unmarshal build run") + return errors.NewE(err) + } + br := entities.BuildRun{ + BuildRun: brRaw, + BuildName: build.Name, + SyncStatus: t.SyncStatus{}, + } + br.AccountName = build.Spec.AccountName + br.ClusterName = build.BuildClusterName + if secretCreationError != nil { + msg := secretCreationError.Error() + br.SyncStatus.Error = &msg + } + cbr, err := d.buildRunRepo.Create(ctx, &br) + if err != nil { + d.logger.Errorf(err, "could not create build run") + return errors.NewE(err) + } + if secretCreationError != nil { + return errors.NewE(secretCreationError) + } + + if err != nil { + d.logger.Errorf(err, "could not get build template") + return errors.NewE(err) + } + + if cbr.Annotations == nil { + cbr.Annotations = make(map[string]string) + } + + cbr.Annotations[constants.ObservabilityTrackingKey] = string(cbr.Id) + + if err = d.dispatcher.ApplyToTargetCluster(ctx, build.BuildClusterName, &cbr.BuildRun, 0); err != nil { + d.logger.Errorf(err, "could not apply build run") + return errors.NewE(err) + } + return nil +} diff --git a/apps/container-registry/internal/domain/build-template.go b/apps/container-registry/internal/domain/build-template.go new file mode 100644 index 000000000..4769ef9cd --- /dev/null +++ b/apps/container-registry/internal/domain/build-template.go @@ -0,0 +1,69 @@ +package domain + +import ( + "bytes" + "fmt" + "github.com/kloudlite/api/pkg/errors" + "net/url" + "text/template" + + dbv1 "github.com/kloudlite/operator/apis/distribution/v1" + + "github.com/kloudlite/api/apps/container-registry/templates" + text_templates "github.com/kloudlite/api/pkg/text-templates" + common_types "github.com/kloudlite/operator/apis/common-types" +) + +func BuildUrl(repo, pullToken string) (string, error) { + parsedURL, err := url.Parse(repo) + if err != nil { + fmt.Println("Error parsing Repo URL:", err) + return "", errors.NewE(err) + } + + parsedURL.User = url.User(pullToken) + + return parsedURL.String(), nil +} + +type BuildJobTemplateData struct { + AccountName string + Name string + Namespace string + Labels map[string]string + Annotations map[string]string + + Registry dbv1.Registry + CacheKeyName *string + Resource dbv1.Resource + GitRepo dbv1.GitRepo + BuildOptions *dbv1.BuildOptions + + CredentialsRef common_types.SecretRef +} + +func getTemplate(obj BuildJobTemplateData) ([]byte, error) { + b, err := templates.ReadBuildJobTemplate() + if err != nil { + return nil, errors.NewE(err) + } + + tmpl := text_templates.WithFunctions(template.New("build-job-template")) + + tmpl, err = tmpl.Parse(string(b)) + if err != nil { + return nil, errors.NewE(err) + } + + out := new(bytes.Buffer) + err = tmpl.Execute(out, obj) + if err != nil { + return nil, errors.NewE(err) + } + + return out.Bytes(), nil +} + +func (*Impl) GetBuildTemplate(obj BuildJobTemplateData) ([]byte, error) { + return getTemplate(obj) +} diff --git a/apps/container-registry/internal/domain/build.go b/apps/container-registry/internal/domain/build.go new file mode 100644 index 000000000..a56fc8c96 --- /dev/null +++ b/apps/container-registry/internal/domain/build.go @@ -0,0 +1,243 @@ +package domain + +import ( + "context" + "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" + fc "github.com/kloudlite/api/apps/container-registry/internal/domain/entities/field-constants" + iamT "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" + dbv1 "github.com/kloudlite/operator/apis/distribution/v1" +) + +func (d *Impl) ListBuildsByCache(ctx RegistryContext, cacheId repos.ID, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.Build], error) { + co, err := d.iamClient.Can(ctx, &iam.CanIn{ + UserId: string(ctx.UserId), + ResourceRefs: []string{ + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), + }, + Action: string(iamT.GetAccount), + }) + + if err != nil { + return nil, errors.NewE(err) + } + + if !co.Status { + return nil, errors.Newf("unauthorized to list builds") + } + + filter := repos.Filter{ + fc.BuildSpecAccountName: ctx.AccountName, + fc.BuildSpecCacheKeyName: cacheId, + } + + return d.buildRepo.FindPaginated(ctx, filter, pagination) +} + +func (d *Impl) AddBuild(ctx RegistryContext, build entities.Build) (*entities.Build, error) { + co, err := d.iamClient.Can(ctx, &iam.CanIn{ + UserId: string(ctx.UserId), + ResourceRefs: []string{ + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), + }, + Action: string(iamT.UpdateAccount), + }) + + if err != nil { + return nil, errors.NewE(err) + } + + if !co.Status { + return nil, errors.Newf("unauthorized to add build") + } + + if err := validateBuild(build); err != nil { + return nil, errors.NewE(err) + } + + var webhookId *int + + if build.Source.Provider == "gitlab" { + webhookId, err = d.GitlabAddWebhook(ctx, ctx.UserId, d.gitlab.GetRepoId(build.Source.Repository)) + if err != nil { + return nil, errors.NewE(err) + } + } + + return d.buildRepo.Create(ctx, &entities.Build{ + Spec: func() dbv1.BuildRunSpec { + build.Spec.AccountName = ctx.AccountName + return build.Spec + }(), + Name: build.Name, + BuildClusterName: build.BuildClusterName, + CreatedBy: common.CreatedOrUpdatedBy{UserId: ctx.UserId, UserName: ctx.UserName, UserEmail: ctx.UserEmail}, + LastUpdatedBy: common.CreatedOrUpdatedBy{}, + Source: entities.GitSource{Repository: build.Source.Repository, Branch: build.Source.Branch, Provider: build.Source.Provider, WebhookId: webhookId}, + CredUser: common.CreatedOrUpdatedBy{UserId: ctx.UserId, UserName: ctx.UserName, UserEmail: ctx.UserEmail}, + ErrorMessages: map[string]string{}, + Status: entities.BuildStatusIdle, + }) +} + +func (d *Impl) UpdateBuild(ctx RegistryContext, id repos.ID, build entities.Build) (*entities.Build, error) { + co, err := d.iamClient.Can(ctx, &iam.CanIn{ + UserId: string(ctx.UserId), + ResourceRefs: []string{ + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), + }, + Action: string(iamT.UpdateAccount), + }) + + if err != nil { + return nil, errors.NewE(err) + } + + if !co.Status { + return nil, errors.Newf("unauthorized to update build") + } + + if err := validateBuild(build); err != nil { + return nil, errors.NewE(err) + } + return d.buildRepo.UpdateById(ctx, id, &entities.Build{ + Spec: func() dbv1.BuildRunSpec { + build.Spec.AccountName = ctx.AccountName + return build.Spec + }(), + Name: build.Name, + BuildClusterName: build.BuildClusterName, + CreatedBy: common.CreatedOrUpdatedBy{}, + LastUpdatedBy: common.CreatedOrUpdatedBy{UserId: ctx.UserId, UserName: ctx.UserName, UserEmail: ctx.UserEmail}, + Source: build.Source, + CredUser: common.CreatedOrUpdatedBy{UserId: ctx.UserId, UserName: ctx.UserName, UserEmail: ctx.UserEmail}, + ErrorMessages: map[string]string{}, + Status: build.Status, + }) +} + +func (d *Impl) UpdateBuildInternal(ctx context.Context, build *entities.Build) (*entities.Build, error) { + return d.buildRepo.UpdateById(ctx, build.Id, build) +} + +func (d *Impl) ListBuildsByGit(ctx context.Context, repoUrl, branch, provider string) ([]*entities.Build, error) { + filter := repos.Filter{ + fc.BuildSourceRepository: repoUrl, + fc.BuildSourceBranch: branch, + fc.BuildSourceProvider: provider, + } + + b, err := d.buildRepo.Find(ctx, repos.Query{ + Filter: filter, + }) + if err != nil { + return nil, errors.NewE(err) + } + + return b, nil +} + +func (d *Impl) ListBuilds(ctx RegistryContext, repoName string, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.Build], error) { + co, err := d.iamClient.Can(ctx, &iam.CanIn{ + UserId: string(ctx.UserId), + ResourceRefs: []string{ + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), + }, + Action: string(iamT.GetAccount), + }) + + if err != nil { + return nil, errors.NewE(err) + } + + if !co.Status { + return nil, errors.Newf("unauthorized to list builds") + } + + filter := repos.Filter{ + fc.BuildSpecAccountName: ctx.AccountName, + fc.BuildSpecRegistryRepoName: repoName, + } + + return d.buildRepo.FindPaginated(ctx, d.buildRepo.MergeMatchFilters(filter, search), pagination) +} + +func (d *Impl) GetBuild(ctx RegistryContext, buildId repos.ID) (*entities.Build, error) { + co, err := d.iamClient.Can(ctx, &iam.CanIn{ + UserId: string(ctx.UserId), + ResourceRefs: []string{ + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), + }, + Action: string(iamT.GetAccount), + }) + + if err != nil { + return nil, errors.NewE(err) + } + + if !co.Status { + return nil, errors.Newf("unauthorized to get build") + } + + b, err := d.buildRepo.FindOne(ctx, repos.Filter{"spec.accountName": ctx.AccountName, "id": buildId}) + if err != nil { + return nil, errors.NewE(err) + } + + if b == nil { + return nil, errors.Newf("build not found") + } + + return b, nil +} + +func (d *Impl) DeleteBuild(ctx RegistryContext, buildId repos.ID) error { + co, err := d.iamClient.Can(ctx, &iam.CanIn{ + UserId: string(ctx.UserId), + ResourceRefs: []string{ + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), + }, + Action: string(iamT.UpdateAccount), + }) + + if err != nil { + return errors.NewE(err) + } + + if !co.Status { + return errors.Newf("unauthorized to delete build") + } + + b, err := d.buildRepo.FindById(ctx, buildId) + if err != nil { + return errors.NewE(err) + } + + if err = d.buildRepo.DeleteOne(ctx, repos.Filter{ + fc.BuildSpecAccountName: ctx.AccountName, + fields.Id: buildId, + }); err != nil { + return errors.NewE(err) + } + + if b.Source.Provider == "gitlab" { + at, err := d.getAccessTokenByUserId(ctx, "gitlab", ctx.UserId) + if err != nil { + return nil + } + + if err := d.gitlab.DeleteWebhook(ctx, at, string(b.Source.Repository), entities.GitlabWebhookId(*b.Source.WebhookId)); err != nil { + d.logger.Errorf(err, "error while deleting webhook") + } + } + + return nil +} + +func (d *Impl) TriggerBuild(ctx RegistryContext, buildId repos.ID) error { + panic("implement me") +} diff --git a/apps/container-registry/internal/domain/context.go b/apps/container-registry/internal/domain/context.go index 4732e5558..8c9baf47b 100644 --- a/apps/container-registry/internal/domain/context.go +++ b/apps/container-registry/internal/domain/context.go @@ -2,15 +2,17 @@ package domain import ( "context" - "kloudlite.io/pkg/repos" + "github.com/kloudlite/api/pkg/repos" ) type RegistryContext struct { context.Context - userId repos.ID - accountName string + UserId repos.ID + UserName string + AccountName string + UserEmail string } func (c *RegistryContext) GetAccountName() string { - return c.accountName + return c.AccountName } diff --git a/apps/container-registry/internal/domain/credential.go b/apps/container-registry/internal/domain/credential.go new file mode 100644 index 000000000..b47a5a226 --- /dev/null +++ b/apps/container-registry/internal/domain/credential.go @@ -0,0 +1,231 @@ +package domain + +import ( + "context" + "fmt" + fc "github.com/kloudlite/api/apps/container-registry/internal/domain/entities/field-constants" + "github.com/kloudlite/api/common/fields" + "regexp" + "time" + + "github.com/kloudlite/api/pkg/errors" + + "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" + iamT "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" + "github.com/kloudlite/api/pkg/repos" + "github.com/kloudlite/container-registry-authorizer/admin" +) + +const ( + KL_ADMIN = "kloudlite" +) + +func (d *Impl) GetTokenKey(ctx context.Context, username string, accountname string) (string, error) { + if username == KL_ADMIN { + return accountname, nil + } + + key := fmt.Sprintf("%s/%s", accountname, username) + + b, err := d.cacheClient.Get(ctx, key) + if err == nil { + return string(b), nil + } + + c, err := d.credentialRepo.FindOne(ctx, repos.Filter{ + fc.CredentialUsername: username, + fields.AccountName: accountname, + }) + if err != nil { + return "", errors.NewE(err) + } + + if c == nil { + return "", errors.Newf("credential not found") + } + + if err := d.cacheClient.SetWithExpiry(ctx, key, []byte(c.TokenKey), time.Minute*5); err != nil { + return "", errors.NewE(err) + } + + if c == nil { + return "", errors.Newf("credential not found") + } + + return c.TokenKey, nil +} + +func (d *Impl) GetToken(ctx RegistryContext, username string) (string, error) { + if username == KL_ADMIN { + return "", errors.Newf("invalid credential name, %s is reserved", KL_ADMIN) + } + + co, err := d.iamClient.Can(ctx, &iam.CanIn{ + UserId: string(ctx.UserId), + ResourceRefs: []string{ + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), + }, + Action: string(iamT.GetAccount), + }) + if err != nil { + return "", errors.NewE(err) + } + + if !co.Status { + return "", errors.Newf("unauthorized to get credentials") + } + + c, err := d.credentialRepo.FindOne(ctx, repos.Filter{ + fc.CredentialUsername: username, + fields.AccountName: ctx.AccountName, + }) + if err != nil { + return "", errors.NewE(err) + } + if c == nil { + return "", errors.Newf("credential not found") + } + + i, err := admin.GetExpirationTime(fmt.Sprintf("%d%s", c.Expiration.Value, c.Expiration.Unit)) + if err != nil { + return "", errors.NewE(err) + } + + token, err := admin.GenerateToken(c.UserName, ctx.AccountName, string(c.Access), i, d.envs.RegistrySecretKey+c.TokenKey) + if err != nil { + return "", errors.NewE(err) + } + + return token, nil +} + +func (d *Impl) CheckUserNameAvailability(ctx RegistryContext, username string) (*CheckNameAvailabilityOutput, error) { + co, err := d.iamClient.Can(ctx, &iam.CanIn{ + UserId: string(ctx.UserId), + ResourceRefs: []string{ + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), + }, + Action: string(iamT.GetAccount), + }) + if err != nil { + return nil, errors.NewE(err) + } + + if !co.Status { + return nil, errors.Newf("unauthorized to check username availability") + } + + c, err := d.credentialRepo.FindOne(ctx, repos.Filter{ + fc.CredentialUsername: username, + fields.AccountName: ctx.AccountName, + }) + if err != nil { + return nil, errors.NewE(err) + } + + if c != nil { + return &CheckNameAvailabilityOutput{ + SuggestedNames: generateUserNames(username, 5), + Result: false, + }, nil + } + + if isValidUserName(username) == nil { + return &CheckNameAvailabilityOutput{ + Result: true, + }, nil + } + + return &CheckNameAvailabilityOutput{ + Result: false, + SuggestedNames: generateUserNames(username, 5), + }, nil +} + +// CreateCredential implements Domain. +func (d *Impl) CreateCredential(ctx RegistryContext, credential entities.Credential) (*entities.Credential, error) { + pattern := `^([a-z])[a-z0-9_]+$` + + re := regexp.MustCompile(pattern) + + if !re.MatchString(credential.UserName) { + return nil, errors.Newf("invalid credential name, must be lowercase alphanumeric with underscore") + } + + if credential.UserName == KL_ADMIN { + return nil, errors.Newf("invalid credential name, %s is reserved", KL_ADMIN) + } + + key := Nonce(12) + + return d.credentialRepo.Create(ctx, &entities.Credential{ + Name: credential.Name, + Access: credential.Access, + AccountName: ctx.AccountName, + UserName: credential.UserName, + TokenKey: key, + Expiration: credential.Expiration, + CreatedBy: common.CreatedOrUpdatedBy{ + UserId: ctx.UserId, + UserName: ctx.UserName, + UserEmail: ctx.UserEmail, + }, + }) +} + +// ListCredentials implements Domain. +func (d *Impl) ListCredentials(ctx RegistryContext, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.Credential], error) { + co, err := d.iamClient.Can(ctx, &iam.CanIn{ + UserId: string(ctx.UserId), + ResourceRefs: []string{ + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), + }, + Action: string(iamT.GetAccount), + }) + if err != nil { + return nil, errors.NewE(err) + } + + if !co.Status { + return nil, errors.Newf("unauthorized to get credentials") + } + + filter := repos.Filter{ + fields.AccountName: ctx.AccountName, + } + return d.credentialRepo.FindPaginated(ctx, d.credentialRepo.MergeMatchFilters(filter, search), pagination) +} + +// DeleteCredential implements Domain. +func (d *Impl) DeleteCredential(ctx RegistryContext, userName string) error { + co, err := d.iamClient.Can(ctx, &iam.CanIn{ + UserId: string(ctx.UserId), + ResourceRefs: []string{ + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), + }, + Action: string(iamT.UpdateAccount), + }) + if err != nil { + return errors.NewE(err) + } + + if !co.Status { + return errors.Newf("unauthorized to delete credentials") + } + + err = d.credentialRepo.DeleteOne(ctx, repos.Filter{ + fc.CredentialUsername: userName, + fields.AccountName: ctx.AccountName, + }) + if err != nil { + return errors.NewE(err) + } + + if _, err = d.cacheClient.Get(ctx, userName+"::"+ctx.AccountName); err != nil { + return nil + } + + return d.cacheClient.Drop(ctx, userName+"::"+ctx.AccountName) +} diff --git a/apps/container-registry/internal/domain/entities/access-token.go b/apps/container-registry/internal/domain/entities/access-token.go new file mode 100644 index 000000000..cd3c88ac4 --- /dev/null +++ b/apps/container-registry/internal/domain/entities/access-token.go @@ -0,0 +1,15 @@ +package entities + +import ( + "github.com/kloudlite/api/pkg/repos" + "golang.org/x/oauth2" +) + +type AccessToken struct { + Id repos.ID `json:"_id"` + UserId repos.ID `json:"user_id" bson:"user_id"` + Email string `json:"email" bson:"email"` + Provider string `json:"provider" bson:"provider"` + Token *oauth2.Token `json:"token" bson:"token"` + Data map[string]any `json:"data" bson:"data"` +} diff --git a/apps/container-registry/internal/domain/entities/account.go b/apps/container-registry/internal/domain/entities/account.go deleted file mode 100644 index d550723ba..000000000 --- a/apps/container-registry/internal/domain/entities/account.go +++ /dev/null @@ -1,30 +0,0 @@ -package entities - -import "kloudlite.io/pkg/repos" - -type HarborProject struct { - repos.BaseEntity `json:",inline"` - HarborProjectName string `json:"harbor_project_name"` - AccountName string `json:"account_name"` - Credentials HarborCredentials `json:"credentials"` -} - -type HarborCredentials struct { - Username string `json:"username"` - Password string `json:"password"` -} - -var HarborProjectIndexes = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: "project_id", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "account_name", Value: repos.IndexAsc}, - }, - Unique: true, - }, -} diff --git a/apps/container-registry/internal/domain/entities/build-cache.go b/apps/container-registry/internal/domain/entities/build-cache.go new file mode 100644 index 000000000..b4523c880 --- /dev/null +++ b/apps/container-registry/internal/domain/entities/build-cache.go @@ -0,0 +1,35 @@ +package entities + +import ( + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/repos" +) + +type BuildCacheKey struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + + Name string `json:"name"` + DisplayName string `json:"displayName"` + AccountName string `json:"accountName" graphql:"noinput"` + + CreatedBy common.CreatedOrUpdatedBy `json:"createdBy" graphql:"noinput"` + LastUpdatedBy common.CreatedOrUpdatedBy `json:"lastUpdatedBy" graphql:"noinput"` + + VolumeSize float32 `json:"volumeSizeInGB"` +} + +var BuildCacheKeyIndexes = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: "id", Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: "name", Value: repos.IndexAsc}, + {Key: "accountName", Value: repos.IndexAsc}, + }, + Unique: true, + }, +} diff --git a/apps/container-registry/internal/domain/entities/build-run.go b/apps/container-registry/internal/domain/entities/build-run.go new file mode 100644 index 000000000..f4c34b89e --- /dev/null +++ b/apps/container-registry/internal/domain/entities/build-run.go @@ -0,0 +1,34 @@ +package entities + +import ( + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + distributionv1 "github.com/kloudlite/operator/apis/distribution/v1" +) + +type BuildRun struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + distributionv1.BuildRun `json:",inline" graphql:"noinput"` + BuildName string `json:"buildName" graphql:"noinput"` + AccountName string `json:"accountName" graphql:"noinput"` + ClusterName string `json:"clusterName" graphql:"noinput"` + SyncStatus t.SyncStatus `json:"syncStatus" graphql:"noinput"` +} + +var BuildRunIndices = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: "id", Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: "metadata.name", Value: repos.IndexAsc}, + {Key: "metadata.namespace", Value: repos.IndexAsc}, + {Key: "accountName", Value: repos.IndexAsc}, + {Key: "clusterName", Value: repos.IndexAsc}, + }, + Unique: true, + }, +} diff --git a/apps/container-registry/internal/domain/entities/build.go b/apps/container-registry/internal/domain/entities/build.go new file mode 100644 index 000000000..1017d5f32 --- /dev/null +++ b/apps/container-registry/internal/domain/entities/build.go @@ -0,0 +1,72 @@ +package entities + +import ( + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/repos" + dbv1 "github.com/kloudlite/operator/apis/distribution/v1" +) + +type ( + GitProvider string + BuildStatus string +) + +const ( + Github GitProvider = "github" + Gitlab GitProvider = "gitlab" +) + +const ( + BuildStatusPending BuildStatus = "pending" + BuildStatusQueued BuildStatus = "queued" + BuildStatusRunning BuildStatus = "running" + BuildStatusSuccess BuildStatus = "success" + BuildStatusFailed BuildStatus = "failed" + BuildStatusError BuildStatus = "error" + BuildStatusIdle BuildStatus = "idle" +) + +type GitSource struct { + Repository string `json:"repository"` + Branch string `json:"branch"` + Provider GitProvider `json:"provider"` + WebhookId *int `json:"webhookId" graphql:"noinput"` +} + +type Build struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + Name string `json:"name"` + CreatedBy common.CreatedOrUpdatedBy `json:"createdBy" graphql:"noinput"` + LastUpdatedBy common.CreatedOrUpdatedBy `json:"lastUpdatedBy" graphql:"noinput"` + + BuildClusterName string `json:"buildClusterName"` + Spec dbv1.BuildRunSpec `json:"spec"` + + Source GitSource `json:"source"` + + CredUser common.CreatedOrUpdatedBy `json:"credUser" graphql:"noinput"` + + ErrorMessages map[string]string `json:"errorMessages" graphql:"noinput"` + Status BuildStatus `json:"status" graphql:"noinput"` +} + +var BuildIndexes = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: "id", Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: "spec.registry.repo.name", Value: repos.IndexAsc}, + {Key: "spec.accountName", Value: repos.IndexAsc}, + }, + }, + { + Field: []repos.IndexKey{ + {Key: "spec.accountName", Value: repos.IndexAsc}, + {Key: "spec.cacheKeyName", Value: repos.IndexAsc}, + }, + }, +} diff --git a/apps/container-registry/internal/domain/entities/credential.go b/apps/container-registry/internal/domain/entities/credential.go new file mode 100644 index 000000000..caa7a003a --- /dev/null +++ b/apps/container-registry/internal/domain/entities/credential.go @@ -0,0 +1,57 @@ +package entities + +import ( + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/repos" +) + +type ExpirationUnit string + +const ( + ExpirationUnitHour ExpirationUnit = "h" + ExpirationUnitDays ExpirationUnit = "d" + ExpirationUnitWeek ExpirationUnit = "w" + ExpirationUnitMonth ExpirationUnit = "m" + ExpirationUnitYear ExpirationUnit = "y" +) + +type RepoAccess string +type Expiration struct { + Unit ExpirationUnit `json:"unit"` + Value int `json:"value"` +} + +const ( + RepoAccessReadOnly RepoAccess = "read" + RepoAccessReadWrite RepoAccess = "read_write" +) + +type Credential struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + + CreatedBy common.CreatedOrUpdatedBy `json:"createdBy" graphql:"noinput"` + LastUpdatedBy common.CreatedOrUpdatedBy `json:"lastUpdatedBy" graphql:"noinput"` + + AccountName string `json:"accountName" graphql:"noinput"` + Access RepoAccess `json:"access"` + Expiration Expiration `json:"expiration"` + Name string `json:"name"` + UserName string `json:"username"` + TokenKey string `json:"token_key" graphql:"ignore"` +} + +var CredentialIndexes = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: "id", Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: "username", Value: repos.IndexAsc}, + {Key: "accountName", Value: repos.IndexAsc}, + }, + Unique: true, + }, +} diff --git a/apps/container-registry/internal/domain/entities/digest.go b/apps/container-registry/internal/domain/entities/digest.go new file mode 100644 index 000000000..5eea3842c --- /dev/null +++ b/apps/container-registry/internal/domain/entities/digest.go @@ -0,0 +1,43 @@ +package entities + +import ( + "github.com/kloudlite/api/pkg/repos" +) + +type Digest struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + + Tags []string `json:"tags" graphql:"noinput"` + AccountName string `json:"accountName" graphql:"noinput"` + Repository string `json:"repository" graphql:"noinput"` + Actor string `json:"actor" graphql:"noinput"` + Digest string `json:"digest" graphql:"noinput"` + Size int `json:"size" graphql:"noinput"` + Length int `json:"length" graphql:"noinput"` + MediaType string `json:"mediaType" graphql:"noinput"` + URL string `json:"url" graphql:"noinput"` + // References []RepoReference `json:"references" graphql:"noinput"` + Deleting bool `json:"deleting" graphql:"noinput"` +} + +var TagIndexes = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: "id", Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: "digest", Value: repos.IndexAsc}, + {Key: "repository", Value: repos.IndexAsc}, + {Key: "accountName", Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: "tags", Value: repos.IndexAsc}, + }, + }, +} diff --git a/apps/container-registry/internal/domain/entities/events.go b/apps/container-registry/internal/domain/entities/events.go new file mode 100644 index 000000000..cb2241c4d --- /dev/null +++ b/apps/container-registry/internal/domain/entities/events.go @@ -0,0 +1,41 @@ +package entities + +type RepoReference struct { + MediaType string `json:"mediaType"` + Size int `json:"size"` + Digest string `json:"digest"` +} + +type Event struct { + ID string `json:"id"` + Timestamp string `json:"timestamp"` + Action string `json:"action"` + Target struct { + MediaType string `json:"mediaType"` + Size int `json:"size"` + Digest string `json:"digest"` + Length int `json:"length"` + Repository string `json:"repository"` + URL string `json:"url"` + Tag string `json:"tag"` + References []RepoReference `json:"references"` + } `json:"target"` + Request struct { + ID string `json:"id"` + Addr string `json:"addr"` + Host string `json:"host"` + Method string `json:"method"` + Useragent string `json:"useragent"` + } `json:"request"` + Actor struct { + Name string `json:"name"` + } `json:"actor"` + Source struct { + Addr string `json:"addr"` + InstanceID string `json:"instanceID"` + } `json:"source"` +} + +type EventMessage struct { + Events []Event +} diff --git a/apps/container-registry/internal/domain/entities/field-constants/gen.go b/apps/container-registry/internal/domain/entities/field-constants/gen.go new file mode 100644 index 000000000..8d9bba1bd --- /dev/null +++ b/apps/container-registry/internal/domain/entities/field-constants/gen.go @@ -0,0 +1,3 @@ +package field_constants + +//go:generate go run github.com/kloudlite/api/cmd/struct-json-path --pkg github.com/kloudlite/api/apps/container-registry/internal/domain/entities --common-path "metadata" --common-path "apiVersion" --common-path "kind" --common-path "status" --common-path "syncStatus" --common-path "lastUpdatedBy" --common-path "createdBy" --common-path "displayName" --common-path "creationTime" --common-path "updateTime" --common-path "id" --common-path "recordVersion" --common-path "accountName" --common-path "clusterName" --common-path "markedForDeletion" --out-file ./generated_constants.go --banner "package field_constants" --ignore-nesting "time.Time" --ignore-nesting "k8s.io/apimachinery/pkg/apis/meta/v1.Time" diff --git a/apps/container-registry/internal/domain/entities/field-constants/generated_constants.go b/apps/container-registry/internal/domain/entities/field-constants/generated_constants.go new file mode 100644 index 000000000..6496f8bed --- /dev/null +++ b/apps/container-registry/internal/domain/entities/field-constants/generated_constants.go @@ -0,0 +1,285 @@ +// DO NOT EDIT. generated by "github.com/kloudlite/api/cmd/struct-json-path" + +package field_constants + +// constant vars generated for struct AccessToken +const ( + AccessTokenId = "_id" + AccessTokenData = "data" + AccessTokenEmail = "email" + AccessTokenProvider = "provider" + AccessTokenToken = "token" + AccessTokenTokenAccessToken = "token.access_token" + AccessTokenTokenExpiry = "token.expiry" + AccessTokenTokenExpiryDelta = "token.expiryDelta" + AccessTokenTokenRaw = "token.raw" + AccessTokenTokenRefreshToken = "token.refresh_token" + AccessTokenTokenTokenType = "token.token_type" + AccessTokenUserId = "user_id" +) + +// constant vars generated for struct Build +const ( + BuildBuildClusterName = "buildClusterName" + BuildCredUser = "credUser" + BuildCredUserUserEmail = "credUser.userEmail" + BuildCredUserUserId = "credUser.userId" + BuildCredUserUserName = "credUser.userName" + BuildErrorMessages = "errorMessages" + BuildName = "name" + BuildSource = "source" + BuildSourceBranch = "source.branch" + BuildSourceProvider = "source.provider" + BuildSourceRepository = "source.repository" + BuildSourceWebhookId = "source.webhookId" + BuildSpec = "spec" + BuildSpecAccountName = "spec.accountName" + BuildSpecBuildOptions = "spec.buildOptions" + BuildSpecBuildOptionsBuildArgs = "spec.buildOptions.buildArgs" + BuildSpecBuildOptionsBuildContexts = "spec.buildOptions.buildContexts" + BuildSpecBuildOptionsContextDir = "spec.buildOptions.contextDir" + BuildSpecBuildOptionsDockerfileContent = "spec.buildOptions.dockerfileContent" + BuildSpecBuildOptionsDockerfilePath = "spec.buildOptions.dockerfilePath" + BuildSpecBuildOptionsTargetPlatforms = "spec.buildOptions.targetPlatforms" + BuildSpecCacheKeyName = "spec.cacheKeyName" + BuildSpecCredentialsRef = "spec.credentialsRef" + BuildSpecCredentialsRefName = "spec.credentialsRef.name" + BuildSpecCredentialsRefNamespace = "spec.credentialsRef.namespace" + BuildSpecGitRepo = "spec.gitRepo" + BuildSpecGitRepoBranch = "spec.gitRepo.branch" + BuildSpecGitRepoUrl = "spec.gitRepo.url" + BuildSpecRegistry = "spec.registry" + BuildSpecRegistryRepo = "spec.registry.repo" + BuildSpecRegistryRepoName = "spec.registry.repo.name" + BuildSpecRegistryRepoTags = "spec.registry.repo.tags" + BuildSpecResource = "spec.resource" + BuildSpecResourceCpu = "spec.resource.cpu" + BuildSpecResourceMemoryInMb = "spec.resource.memoryInMb" +) + +// constant vars generated for struct BuildCacheKey +const ( + BuildCacheKeyName = "name" + BuildCacheKeyVolumeSizeInGB = "volumeSizeInGB" +) + +// constant vars generated for struct BuildRun +const ( + BuildRunBuildName = "buildName" + BuildRunSpec = "spec" + BuildRunSpecAccountName = "spec.accountName" + BuildRunSpecBuildOptions = "spec.buildOptions" + BuildRunSpecBuildOptionsBuildArgs = "spec.buildOptions.buildArgs" + BuildRunSpecBuildOptionsBuildContexts = "spec.buildOptions.buildContexts" + BuildRunSpecBuildOptionsContextDir = "spec.buildOptions.contextDir" + BuildRunSpecBuildOptionsDockerfileContent = "spec.buildOptions.dockerfileContent" + BuildRunSpecBuildOptionsDockerfilePath = "spec.buildOptions.dockerfilePath" + BuildRunSpecBuildOptionsTargetPlatforms = "spec.buildOptions.targetPlatforms" + BuildRunSpecCacheKeyName = "spec.cacheKeyName" + BuildRunSpecCredentialsRef = "spec.credentialsRef" + BuildRunSpecCredentialsRefName = "spec.credentialsRef.name" + BuildRunSpecCredentialsRefNamespace = "spec.credentialsRef.namespace" + BuildRunSpecGitRepo = "spec.gitRepo" + BuildRunSpecGitRepoBranch = "spec.gitRepo.branch" + BuildRunSpecGitRepoUrl = "spec.gitRepo.url" + BuildRunSpecRegistry = "spec.registry" + BuildRunSpecRegistryRepo = "spec.registry.repo" + BuildRunSpecRegistryRepoName = "spec.registry.repo.name" + BuildRunSpecRegistryRepoTags = "spec.registry.repo.tags" + BuildRunSpecResource = "spec.resource" + BuildRunSpecResourceCpu = "spec.resource.cpu" + BuildRunSpecResourceMemoryInMb = "spec.resource.memoryInMb" +) + +// constant vars generated for struct Credential +const ( + CredentialAccess = "access" + CredentialExpiration = "expiration" + CredentialExpirationUnit = "expiration.unit" + CredentialExpirationValue = "expiration.value" + CredentialName = "name" + CredentialTokenKey = "token_key" + CredentialUsername = "username" +) + +// constant vars generated for struct Digest +const ( + DigestActor = "actor" + DigestDeleting = "deleting" + DigestDigest = "digest" + DigestLength = "length" + DigestMediaType = "mediaType" + DigestRepository = "repository" + DigestSize = "size" + DigestTags = "tags" + DigestUrl = "url" +) + +// constant vars generated for struct Event +const ( + EventAction = "action" + EventActor = "actor" + EventActorName = "actor.name" + EventRequest = "request" + EventRequestAddr = "request.addr" + EventRequestHost = "request.host" + EventRequestId = "request.id" + EventRequestMethod = "request.method" + EventRequestUseragent = "request.useragent" + EventSource = "source" + EventSourceAddr = "source.addr" + EventSourceInstanceID = "source.instanceID" + EventTarget = "target" + EventTargetDigest = "target.digest" + EventTargetLength = "target.length" + EventTargetMediaType = "target.mediaType" + EventTargetReferences = "target.references" + EventTargetRepository = "target.repository" + EventTargetSize = "target.size" + EventTargetTag = "target.tag" + EventTargetUrl = "target.url" + EventTimestamp = "timestamp" +) + +// constant vars generated for struct EventMessage +const ( + EventMessageEvents = "Events" +) + +// constant vars generated for struct Expiration +const ( + ExpirationUnit = "unit" + ExpirationValue = "value" +) + +// constant vars generated for struct GInst +const ( + GInstAccount = "account" + GInstAccountAvatarUrl = "account.avatarUrl" + GInstAccountId = "account.id" + GInstAccountLogin = "account.login" + GInstAccountNodeId = "account.nodeId" + GInstAccountType = "account.type" + GInstAppId = "appId" + GInstNodeId = "nodeId" + GInstRepositoriesUrl = "repositoriesUrl" + GInstTargetId = "targetId" + GInstTargetType = "targetType" +) + +// constant vars generated for struct GitBranch +const ( + GitBranchName = "name" + GitBranchProtected = "protected" +) + +// constant vars generated for struct GitSource +const ( + GitSourceBranch = "branch" + GitSourceProvider = "provider" + GitSourceRepository = "repository" + GitSourceWebhookId = "webhookId" +) + +// constant vars generated for struct GithubInstallation +const ( + GithubInstallationAccount = "account" + GithubInstallationAccountAvatarUrl = "account.avatarUrl" + GithubInstallationAccountId = "account.id" + GithubInstallationAccountLogin = "account.login" + GithubInstallationAccountNodeId = "account.nodeId" + GithubInstallationAccountType = "account.type" + GithubInstallationAppId = "appId" + GithubInstallationNodeId = "nodeId" + GithubInstallationRepositoriesUrl = "repositoriesUrl" + GithubInstallationTargetId = "targetId" + GithubInstallationTargetType = "targetType" +) + +// constant vars generated for struct GithubListRepository +const ( + GithubListRepositoryRepositories = "repositories" + GithubListRepositoryTotalCount = "totalCount" +) + +// constant vars generated for struct GithubRepository +const ( + GithubRepositoryArchived = "archived" + GithubRepositoryCloneUrl = "cloneUrl" + GithubRepositoryCreatedAt = "createdAt" + GithubRepositoryDefaultBranch = "defaultBranch" + GithubRepositoryDescription = "description" + GithubRepositoryDisabled = "disabled" + GithubRepositoryFullName = "fullName" + GithubRepositoryGitUrl = "gitUrl" + GithubRepositoryGitignoreTemplate = "gitignoreTemplate" + GithubRepositoryHtmlUrl = "htmlUrl" + GithubRepositoryLanguage = "language" + GithubRepositoryMasterBranch = "masterBranch" + GithubRepositoryMirrorUrl = "mirrorUrl" + GithubRepositoryName = "name" + GithubRepositoryNodeId = "node_id" + GithubRepositoryPermissions = "permissions" + GithubRepositoryPrivate = "private" + GithubRepositoryPushedAt = "pushedAt" + GithubRepositorySize = "size" + GithubRepositoryTeamId = "team_id" + GithubRepositoryUpdatedAt = "updatedAt" + GithubRepositoryUrl = "url" + GithubRepositoryVisibility = "visibility" +) + +// constant vars generated for struct GithubSearchRepository +const ( + GithubSearchRepositoryIncompleteResults = "incompleteResults" + GithubSearchRepositoryRepositories = "repositories" + GithubSearchRepositoryTotal = "total" +) + +// constant vars generated for struct GithubUserAccount +const ( + GithubUserAccountAvatarUrl = "avatarUrl" + GithubUserAccountLogin = "login" + GithubUserAccountNodeId = "nodeId" + GithubUserAccountType = "type" +) + +// constant vars generated for struct GitlabGroup +const ( + GitlabGroupAvatarUrl = "avatarUrl" + GitlabGroupFullName = "fullName" +) + +// constant vars generated for struct GitlabProject +const ( + GitlabProjectArchived = "archived" + GitlabProjectAvatarUrl = "avatarUrl" + GitlabProjectCreatedAt = "createdAt" + GitlabProjectCreatorId = "creatorId" + GitlabProjectDefaultBranch = "defaultBranch" + GitlabProjectDescription = "description" + GitlabProjectEmptyRepo = "emptyRepo" + GitlabProjectHttpUrlToRepo = "httpUrlToRepo" + GitlabProjectLastActivityAt = "lastActivityAt" + GitlabProjectName = "name" + GitlabProjectNameWithNamespace = "nameWithNamespace" + GitlabProjectPath = "path" + GitlabProjectPathWithNamespace = "pathWithNamespace" + GitlabProjectPublic = "public" + GitlabProjectSshUrlToRepo = "sshUrlToRepo" + GitlabProjectTagList = "tagList" + GitlabProjectTopics = "topics" + GitlabProjectWebUrl = "webUrl" +) + +// constant vars generated for struct RepoReference +const ( + RepoReferenceDigest = "digest" + RepoReferenceMediaType = "mediaType" + RepoReferenceSize = "size" +) + +// constant vars generated for struct Repository +const ( + RepositoryName = "name" +) diff --git a/apps/container-registry/internal/domain/entities/github.go b/apps/container-registry/internal/domain/entities/github.go new file mode 100644 index 000000000..836f16666 --- /dev/null +++ b/apps/container-registry/internal/domain/entities/github.go @@ -0,0 +1,75 @@ +package entities + +import ( + "time" +) + +type GithubUserAccount struct { + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"nodeId,omitempty"` + Type *string `json:"type,omitempty"` + Login *string `json:"login,omitempty"` + AvatarURL *string `json:"avatarUrl,omitempty"` +} + +type GInst struct { + ID *int64 `json:"id,omitempty"` + AppID *int64 `json:"appId,omitempty"` + TargetType *string `json:"targetType,omitempty"` + TargetID *int64 `json:"targetId,omitempty"` + NodeID *string `json:"nodeId,omitempty"` + RepositoriesURL *string `json:"repositoriesUrl,omitempty"` + Account GithubUserAccount `json:"account,omitempty"` +} + +type GithubInstallation struct { + GInst `json:",inline" graphql:"noinput"` +} + +type GithubRepository struct { + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + URL *string `json:"url,omitempty"` + Name *string `json:"name,omitempty"` + FullName *string `json:"fullName,omitempty"` + Description *string `json:"description,omitempty"` + DefaultBranch *string `json:"defaultBranch,omitempty"` + MasterBranch *string `json:"masterBranch,omitempty"` + CreatedAt time.Time `json:"createdAt,omitempty"` + PushedAt time.Time `json:"pushedAt,omitempty"` + UpdatedAt time.Time `json:"updatedAt,omitempty"` + HTMLURL *string `json:"htmlUrl,omitempty"` + CloneURL *string `json:"cloneUrl,omitempty"` + GitURL *string `json:"gitUrl,omitempty"` + MirrorURL *string `json:"mirrorUrl,omitempty"` + Language *string `json:"language,omitempty"` + Size *int `json:"size,omitempty"` + Permissions map[string]bool `json:"permissions,omitempty"` + Archived *bool `json:"archived,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + + // Additional mutable fields when creating and editing a repository + Private *bool `json:"private,omitempty"` + GitignoreTemplate *string `json:"gitignoreTemplate,omitempty"` + + // Creating an organization repository. Required for non-owners. + TeamID *int64 `json:"team_id,omitempty"` + + Visibility *string `json:"visibility,omitempty"` +} + +type GithubListRepository struct { + TotalCount *int `json:"totalCount,omitempty" graphql:"noinput"` + Repositories []*GithubRepository `json:"repositories" graphql:"noinput"` +} + +type GithubSearchRepository struct { + Total *int `json:"total,omitempty" graphql:"noinput"` + Repositories []*GithubRepository `json:"repositories" graphql:"noinput"` + IncompleteResults *bool `json:"incompleteResults,omitempty" graphql:"noinput"` +} + +type GitBranch struct { + Name string `json:"name,omitempty" graphql:"noinput"` + Protected bool `json:"protected,omitempty" graphql:"noinput"` +} diff --git a/apps/container-registry/internal/domain/entities/gitlab.go b/apps/container-registry/internal/domain/entities/gitlab.go new file mode 100644 index 000000000..d0d9aeaf1 --- /dev/null +++ b/apps/container-registry/internal/domain/entities/gitlab.go @@ -0,0 +1,50 @@ +package entities + +import ( + "time" + // "kloudlite.io/pkg/repos" +) + +// type GitRepositoryHook struct { +// repos.BaseEntity `bson:",inline"` +// HttpUrl string `json:"httpUrl" bson:"httpUrl"` +// GitProvider string `json:"gitProvider" bson:"gitProvider"` +// GitlabWebhookId *GitlabWebhookId `json:"gitlabWebhookId" bson:"gitlabWebhookId"` +// } +// +// var GitRepositoryHookIndices = []repos.IndexField{ +// { +// Field: []repos.IndexKey{ +// {Key: "httpUrl", Value: repos.IndexAsc}, +// }, +// Unique: true, +// }, +// } + +type GitlabGroup struct { + Id string `json:"id" graphql:"noinput"` + FullName string `json:"fullName" graphql:"noinput"` + AvatarUrl string `json:"avatarUrl" graphql:"noinput"` +} + +type GitlabProject struct { + ID int `json:"id" graphql:"noinput"` + Description string `json:"description" graphql:"noinput"` + DefaultBranch string `json:"defaultBranch" graphql:"noinput"` + Public bool `json:"public" graphql:"noinput"` + SSHURLToRepo string `json:"sshUrlToRepo" graphql:"noinput"` + HTTPURLToRepo string `json:"httpUrlToRepo" graphql:"noinput"` + WebURL string `json:"webUrl" graphql:"noinput"` + TagList []string `json:"tagList" graphql:"noinput"` + Topics []string `json:"topics" graphql:"noinput"` + Name string `json:"name" graphql:"noinput"` + NameWithNamespace string `json:"nameWithNamespace" graphql:"noinput"` + Path string `json:"path" graphql:"noinput"` + PathWithNamespace string `json:"pathWithNamespace" graphql:"noinput"` + CreatedAt *time.Time `json:"createdAt,omitempty" graphql:"noinput"` + LastActivityAt *time.Time `json:"lastActivityAt,omitempty" graphql:"noinput"` + CreatorID int `json:"creatorId" graphql:"noinput"` + EmptyRepo bool `json:"emptyRepo" graphql:"noinput"` + Archived bool `json:"archived" graphql:"noinput"` + AvatarURL string `json:"avatarUrl" graphql:"noinput"` +} diff --git a/apps/container-registry/internal/domain/entities/repository.go b/apps/container-registry/internal/domain/entities/repository.go new file mode 100644 index 000000000..16a8f681a --- /dev/null +++ b/apps/container-registry/internal/domain/entities/repository.go @@ -0,0 +1,32 @@ +package entities + +import ( + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/repos" +) + +type Repository struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + + CreatedBy common.CreatedOrUpdatedBy `json:"createdBy" graphql:"noinput"` + LastUpdatedBy common.CreatedOrUpdatedBy `json:"lastUpdatedBy" graphql:"noinput"` + + AccountName string `json:"accountName" graphql:"noinput"` + Name string `json:"name"` +} + +var RepositoryIndexes = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: "id", Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: "name", Value: repos.IndexAsc}, + {Key: "accountName", Value: repos.IndexAsc}, + }, + Unique: true, + }, +} diff --git a/apps/container-registry/internal/domain/entities/robot-user.go b/apps/container-registry/internal/domain/entities/robot-user.go deleted file mode 100644 index dd75521a5..000000000 --- a/apps/container-registry/internal/domain/entities/robot-user.go +++ /dev/null @@ -1,28 +0,0 @@ -package entities - -import ( - artifactsv1 "github.com/kloudlite/operator/apis/artifacts/v1" - "kloudlite.io/pkg/repos" - t "kloudlite.io/pkg/types" -) - -type HarborRobotUser struct { - repos.BaseEntity `json:",inline"` - artifactsv1.HarborUserAccount `json:",inline"` - SyncStatus t.SyncStatus `json:"syncStatus"` -} - -var HarborRobotUserIndexes = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: "metadata.name", Value: repos.IndexAsc}, - {Key: "metadata.namespace", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "spec.harborProjectName", Value: repos.IndexAsc}, - }, - }, -} diff --git a/apps/container-registry/internal/domain/entities/webhook.go b/apps/container-registry/internal/domain/entities/webhook.go new file mode 100644 index 000000000..e044dfd97 --- /dev/null +++ b/apps/container-registry/internal/domain/entities/webhook.go @@ -0,0 +1,4 @@ +package entities + +type GitlabWebhookId int +type GithubWebhookId int64 diff --git a/apps/container-registry/internal/domain/github.go b/apps/container-registry/internal/domain/github.go new file mode 100644 index 000000000..fa97adca2 --- /dev/null +++ b/apps/container-registry/internal/domain/github.go @@ -0,0 +1,248 @@ +package domain + +import ( + "context" + "strings" + "time" + + "github.com/google/go-github/v45/github" + "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" + "github.com/kloudlite/api/constants" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/auth" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" + "github.com/kloudlite/api/pkg/types" + "golang.org/x/oauth2" +) + +type ErrEventNotSupported struct { + err error +} + +func (e *ErrEventNotSupported) Error() string { + return e.err.Error() +} + +type GitWebhookPayload struct { + GitProvider string `json:"git_provider,omitempty"` + RepoUrl string `json:"repo_url,omitempty"` + GitBranch string `json:"git_branch,omitempty"` + CommitHash string `json:"commit_hash,omitempty"` +} + +func getBranchFromRef(gitRef string) string { + sp := strings.SplitN(gitRef, "/", 3) + if len(sp) == 3 { + return sp[2] + } + return "" +} + +func (d *Impl) ParseGithubHook(eventType string, hookBody []byte) (*GitWebhookPayload, error) { + hook, err := github.ParseWebHook(eventType, hookBody) + if err != nil { + d.logger.Infof("bad webhook body, dropping message ...") + return nil, errors.NewE(err) + } + + switch h := hook.(type) { + case *github.PushEvent: + { + + payload := GitWebhookPayload{ + GitProvider: constants.ProviderGithub, + RepoUrl: *h.Repo.CloneURL, + GitBranch: getBranchFromRef(h.GetRef()), + CommitHash: h.GetAfter(), + } + return &payload, nil + } + default: + return nil, &ErrEventNotSupported{err: errors.Newf("event type (%s), currently not supported", eventType)} + } + +} + +func (d *Impl) getAccessTokenByUserId(ctx context.Context, provider string, userId repos.ID) (*entities.AccessToken, error) { + accTokenOut, err := d.authClient.GetAccessToken( + ctx, &auth.GetAccessTokenRequest{ + UserId: string(userId), + Provider: provider, + }, + ) + if err != nil { + return nil, errors.NewEf(err, "finding accessToken") + } + return &entities.AccessToken{ + Id: repos.ID(accTokenOut.Id), + UserId: repos.ID(accTokenOut.UserId), + Email: accTokenOut.Email, + Provider: accTokenOut.Provider, + Token: &oauth2.Token{AccessToken: accTokenOut.OauthToken.AccessToken, TokenType: accTokenOut.OauthToken.TokenType, RefreshToken: accTokenOut.OauthToken.RefreshToken, Expiry: time.UnixMilli(accTokenOut.OauthToken.Expiry)}, + Data: map[string]any{}, + }, errors.NewE(err) +} + +func (d *Impl) GithubInstallationToken(ctx context.Context, repoUrl string) (string, error) { + return d.github.GetInstallationToken(ctx, repoUrl) +} + +func (d *Impl) GithubListInstallations(ctx context.Context, userId repos.ID, pagination *types.Pagination) ([]*entities.GithubInstallation, error) { + token, err := d.getAccessTokenByUserId(ctx, "github", userId) + if err != nil { + return nil, errors.NewE(err) + } + i, err := d.github.ListInstallations(ctx, token, pagination) + if err != nil { + return nil, errors.NewE(err) + } + + res := make([]*entities.GithubInstallation, len(i)) + for i2, i3 := range i { + res[i2] = &entities.GithubInstallation{ + GInst: entities.GInst{ + ID: i3.ID, + AppID: i3.AppID, + TargetType: i3.TargetType, + TargetID: i3.TargetID, + NodeID: i3.NodeID, + RepositoriesURL: i3.RepositoriesURL, + Account: entities.GithubUserAccount{ + ID: i3.Account.ID, + NodeID: i3.Account.NodeID, + Type: i3.Account.Type, + Login: i3.Account.Login, + AvatarURL: i3.Account.AvatarURL, + }, + }, + } + } + + return res, nil +} + +func (d *Impl) GithubListRepos(ctx context.Context, userId repos.ID, installationId int64, pagination *types.Pagination) (*entities.GithubListRepository, error) { + token, err := d.getAccessTokenByUserId(ctx, "github", userId) + if err != nil { + return nil, errors.NewE(err) + } + + i, err := d.github.ListRepos(ctx, token, installationId, pagination) + + repositories := make([]*entities.GithubRepository, len(i.Repositories)) + + for i2, r := range i.Repositories { + + repositories[i2] = &entities.GithubRepository{ + ID: r.ID, + NodeID: r.NodeID, + Name: r.Name, + FullName: r.FullName, + Description: r.Description, + DefaultBranch: r.DefaultBranch, + MasterBranch: r.MasterBranch, + CreatedAt: r.CreatedAt.Time, + PushedAt: r.PushedAt.Time, + UpdatedAt: r.UpdatedAt.Time, + HTMLURL: r.HTMLURL, + CloneURL: r.CloneURL, + GitURL: r.GitURL, + MirrorURL: r.MirrorURL, + Language: r.Language, + Size: r.Size, + Permissions: r.Permissions, + Archived: r.Archived, + Disabled: r.Disabled, + Private: r.Private, + GitignoreTemplate: r.GitignoreTemplate, + TeamID: r.TeamID, + Visibility: r.Visibility, + URL: r.URL, + } + + } + + return &entities.GithubListRepository{ + TotalCount: i.TotalCount, + Repositories: repositories, + }, errors.NewE(err) +} + +func (d *Impl) GithubSearchRepos(ctx context.Context, userId repos.ID, q, org string, pagination *types.Pagination) (*entities.GithubSearchRepository, error) { + + token, err := d.getAccessTokenByUserId(ctx, "github", userId) + if err != nil { + return nil, errors.NewE(err) + } + + i, err := d.github.SearchRepos(ctx, token, q, org, pagination) + + repositories := make([]*entities.GithubRepository, len(i.Repositories)) + + for i2, r := range i.Repositories { + + repositories[i2] = &entities.GithubRepository{ + ID: r.ID, + NodeID: r.NodeID, + Name: r.Name, + FullName: r.FullName, + Description: r.Description, + DefaultBranch: r.DefaultBranch, + MasterBranch: r.MasterBranch, + CreatedAt: r.CreatedAt.Time, + PushedAt: r.PushedAt.Time, + UpdatedAt: r.UpdatedAt.Time, + HTMLURL: r.HTMLURL, + CloneURL: r.CloneURL, + GitURL: r.GitURL, + MirrorURL: r.MirrorURL, + Language: r.Language, + Size: r.Size, + Permissions: r.Permissions, + Archived: r.Archived, + Disabled: r.Disabled, + Private: r.Private, + GitignoreTemplate: r.GitignoreTemplate, + TeamID: r.TeamID, + Visibility: r.Visibility, + URL: r.URL, + } + } + + return &entities.GithubSearchRepository{ + Total: i.Total, + Repositories: repositories, + IncompleteResults: i.IncompleteResults, + }, nil +} + +func getString(s *string) string { + if s == nil { + return "" + } + return *s +} + +func (d *Impl) GithubListBranches(ctx context.Context, userId repos.ID, repoUrl string, pagination *types.Pagination) ([]*entities.GitBranch, error) { + token, err := d.getAccessTokenByUserId(ctx, "github", userId) + if err != nil { + return nil, errors.NewE(err) + } + + i, err := d.github.ListBranches(ctx, token, repoUrl, pagination) + + branches := make([]*entities.GitBranch, len(i)) + + for i2, b := range i { + branches[i2] = &entities.GitBranch{ + Name: *b.Name, + Protected: *b.Protected, + } + } + + return branches, errors.NewE(err) +} + +func (d *Impl) GithubAddWebhook(ctx context.Context, userId repos.ID, repoUrl string) (repos.ID, error) { + panic("not implemented") +} diff --git a/apps/container-registry/internal/domain/gitlab.go b/apps/container-registry/internal/domain/gitlab.go new file mode 100644 index 000000000..424e634e6 --- /dev/null +++ b/apps/container-registry/internal/domain/gitlab.go @@ -0,0 +1,183 @@ +package domain + +import ( + "context" + "time" + + "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" + "github.com/kloudlite/api/constants" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/auth" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" + "github.com/kloudlite/api/pkg/types" + "github.com/xanzy/go-gitlab" + "golang.org/x/oauth2" +) + +func (d *Impl) GitlabListGroups(ctx context.Context, userId repos.ID, query *string, pagination *types.Pagination) ([]*entities.GitlabGroup, error) { + token, err := d.getAccessTokenByUserId(ctx, "gitlab", userId) + if err != nil { + return nil, errors.NewE(err) + } + + return d.gitlab.ListGroups(ctx, token, query, pagination) +} + +func (d *Impl) GitlabListRepos(ctx context.Context, userId repos.ID, gid string, query *string, pagination *types.Pagination) ([]*entities.GitlabProject, error) { + token, err := d.getAccessTokenByUserId(ctx, "gitlab", userId) + if err != nil { + return nil, errors.NewE(err) + } + gitRepos, err := d.gitlab.ListRepos(ctx, token, gid, query, pagination) + if err != nil { + return nil, errors.NewE(err) + } + + res := make([]*entities.GitlabProject, len(gitRepos)) + + for i, r := range gitRepos { + res[i] = &entities.GitlabProject{ + ID: r.ID, + Description: r.Description, + DefaultBranch: r.DefaultBranch, + Public: r.Public, + SSHURLToRepo: r.SSHURLToRepo, + HTTPURLToRepo: r.HTTPURLToRepo, + WebURL: r.WebURL, + TagList: r.TagList, + Topics: r.Topics, + Name: r.Name, + NameWithNamespace: r.NameWithNamespace, + Path: r.Path, + PathWithNamespace: r.PathWithNamespace, + CreatedAt: r.CreatedAt, + LastActivityAt: r.LastActivityAt, + CreatorID: r.CreatorID, + EmptyRepo: r.EmptyRepo, + Archived: r.Archived, + AvatarURL: r.AvatarURL, + } + } + + return res, nil +} + +func (d *Impl) GitlabListBranches(ctx context.Context, userId repos.ID, repoId string, query *string, pagination *types.Pagination) ([]*entities.GitBranch, error) { + + token, err := d.getAccessTokenByUserId(ctx, "gitlab", userId) + if err != nil { + return nil, errors.NewE(err) + } + + branches, err := d.gitlab.ListBranches(ctx, token, repoId, query, pagination) + + if err != nil { + return nil, errors.NewE(err) + } + + res := make([]*entities.GitBranch, len(branches)) + + for i, b := range branches { + res[i] = &entities.GitBranch{ + Name: b.Name, + Protected: b.Protected, + } + } + + return res, nil +} + +func (d *Impl) GitlabAddWebhook(ctx context.Context, userId repos.ID, repoId string) (*int, error) { + + // grHook, err := d.gitRepoHookRepo.FindOne(ctx, repos.Filter{"httpUrl": d.envs.GitlabWebhookUrl}) + // if err != nil { + // return "", err + // } + + token, err := d.getAccessTokenByUserId(ctx, "gitlab", userId) + if err != nil { + return nil, errors.NewE(err) + } + + // if grHook != nil { + // exists, _ := d.gitlab.CheckWebhookExists(ctx, token, repoId, grHook.GitlabWebhookId) + // if exists { + // return grHook.Id, nil + // } + // if err := d.gitRepoHookRepo.DeleteById(ctx, grHook.Id); err != nil { + // return "", err + // } + // } + + webhookId, err := d.gitlab.AddWebhook(ctx, token, repoId) + if err != nil { + return nil, errors.NewE(err) + } + + // grHook, err = d.gitRepoHookRepo.Create( + // ctx, &GitRepositoryHook{ + // HttpUrl: d.gitlabWebhookUrl, + // GitProvider: GitlabProvider, + // GitlabWebhookId: webhookId, + // }, + // ) + + return webhookId, nil +} + +func (d *Impl) gitlabPullToken(ctx context.Context, accTokenReq *auth.GetAccessTokenRequest) (string, error) { + accessToken, err := d.authClient.GetAccessToken(ctx, accTokenReq) + if err != nil || accessToken == nil { + return "", errors.NewEf(err, "could not get gitlab access token") + } + + accToken := entities.AccessToken{ + UserId: repos.ID(accessToken.UserId), + Email: accessToken.Email, + Provider: accessToken.Provider, + Token: &oauth2.Token{ + AccessToken: accessToken.OauthToken.AccessToken, + TokenType: accessToken.OauthToken.TokenType, + RefreshToken: accessToken.OauthToken.RefreshToken, + Expiry: time.UnixMilli(accessToken.OauthToken.Expiry), + }, + Data: nil, + } + repoToken, err := d.gitlab.RepoToken(ctx, &accToken) + if err != nil || repoToken == nil { + return "", errors.NewEf(err, "could not get repoToken") + } + return repoToken.AccessToken, nil +} + +func (d *Impl) GitlabPullToken(ctx context.Context, userId repos.ID) (string, error) { + + at, err := d.getAccessTokenByUserId(ctx, "gitlab", userId) + + if err != nil { + return "", errors.NewE(err) + } + + return at.Token.AccessToken, nil +} + +func (d *Impl) ParseGitlabHook(eventType string, hookBody []byte) (*GitWebhookPayload, error) { + hook, err := gitlab.ParseWebhook(gitlab.EventType(eventType), hookBody) + if err != nil { + return nil, errors.NewEf(err, "could not parse webhook body for eventType=%s", eventType) + } + switch h := hook.(type) { + case *gitlab.PushEvent: + { + payload := &GitWebhookPayload{ + GitProvider: constants.ProviderGitlab, + RepoUrl: h.Repository.GitHTTPURL, + GitBranch: getBranchFromRef(h.Ref), + CommitHash: h.CheckoutSHA, + } + return payload, nil + } + default: + return nil, &ErrEventNotSupported{err: errors.Newf("event type (%s) currently not supported", eventType)} + } +} diff --git a/apps/container-registry/internal/domain/main.go b/apps/container-registry/internal/domain/main.go index cdb5b5d97..879f5d4ef 100644 --- a/apps/container-registry/internal/domain/main.go +++ b/apps/container-registry/internal/domain/main.go @@ -1,208 +1,245 @@ package domain import ( + "context" "fmt" - - "encoding/json" - - opHarbor "github.com/kloudlite/operator/pkg/harbor" - "github.com/kloudlite/operator/pkg/kubectl" + fc "github.com/kloudlite/api/apps/container-registry/internal/domain/entities/field-constants" + "github.com/kloudlite/api/common/fields" + "regexp" + "strings" + + "github.com/kloudlite/api/pkg/errors" + + "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" + "github.com/kloudlite/api/apps/container-registry/internal/env" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/auth" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" + "github.com/kloudlite/api/pkg/kv" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/api/pkg/repos" "go.uber.org/fx" - "kloudlite.io/apps/container-registry/internal/domain/entities" - "kloudlite.io/apps/container-registry/internal/env" - "kloudlite.io/constants" - "kloudlite.io/pkg/harbor" - "kloudlite.io/pkg/k8s" - "kloudlite.io/pkg/repos" - t "kloudlite.io/pkg/types" + "k8s.io/utils/strings/slices" ) type Impl struct { - harborCli *harbor.Client - k8sExtendedClient k8s.ExtendedK8sClient - harborProjectRepo repos.DbRepo[*entities.HarborProject] - harborRobotUsersRepo repos.DbRepo[*entities.HarborRobotUser] - k8sYamlCli *kubectl.YAMLClient + repositoryRepo repos.DbRepo[*entities.Repository] + credentialRepo repos.DbRepo[*entities.Credential] + buildRepo repos.DbRepo[*entities.Build] + buildCacheRepo repos.DbRepo[*entities.BuildCacheKey] + digestRepo repos.DbRepo[*entities.Digest] + buildRunRepo repos.DbRepo[*entities.BuildRun] + iamClient iam.IAMClient + envs *env.Env + logger logging.Logger + cacheClient kv.BinaryDataRepo + + authClient auth.AuthClient + + github Github + gitlab Gitlab + resourceEventPublisher ResourceEventPublisher + dispatcher ResourceDispatcher } -func (i *Impl) findHarborRobot(ctx RegistryContext, name string) (*entities.HarborRobotUser, error) { - hru, err := i.harborRobotUsersRepo.FindOne(ctx, repos.Filter{"metadata.name": name, "spec.accountName": ctx.accountName}) - if err != nil { - return nil, err - } - if hru == nil { - return nil, fmt.Errorf("no robot user account found for (name: %q, accountName: %q)", name, ctx.accountName) - } +func (d *Impl) ProcessRegistryEvents(ctx context.Context, events []entities.Event, logger logging.Logger) error { + l := logger.WithName("registry-event") - return hru, nil -} + pattern := `.*[^\/].*\/.*$` -// ReSyncHarborRobot implements Domain -func (d *Impl) ReSyncHarborRobot(ctx RegistryContext, name string) error { - hru, err := d.findHarborRobot(ctx, name) + re, err := regexp.Compile(pattern) if err != nil { - return err + l.Errorf(err) + return errors.NewE(err) } - b, err := json.Marshal(hru.HarborUserAccount) - if err != nil { - return err - } + for _, e := range events { - _, err = d.k8sYamlCli.ApplyYAML(ctx, b) - return err -} + r := e.Target.Repository -// UpdateHarborRobot implements Domain -func (d *Impl) UpdateHarborRobot(ctx RegistryContext, name string, permissions []opHarbor.Permission) (*entities.HarborRobotUser, error) { - hru, err := d.findHarborRobot(ctx, name) - if err != nil { - return nil, err - } + if !re.MatchString(r) { + l.Warnf("invalid repository name %s\n, ignoring", r) + return nil + } - hru.Spec.Permissions = permissions - upHru, err := d.harborRobotUsersRepo.UpdateById(ctx, hru.Id, hru) - if err != nil { - return nil, err - } + rArray := strings.Split(r, "/") - b, err := json.Marshal(hru.HarborUserAccount) - if err != nil { - return nil, err - } + accountName := rArray[0] + repoName := strings.Join(rArray[1:], "/") + tag := e.Target.Tag - _, err = d.k8sYamlCli.ApplyYAML(ctx, b) - if err != nil { - return nil, err - } + switch e.Request.Method { + case "PUT": - return upHru, nil -} + if tag == "" { + fmt.Println("tag is empty with digest", e.Target.Digest) + return nil + } -func (d *Impl) GetHarborCredentials(ctx RegistryContext) (*entities.HarborCredentials, error) { - one, err := d.harborProjectRepo.FindOne(ctx, repos.Filter{"account_name": ctx.GetAccountName()}) - if err != nil { - return nil, err - } - if one == nil { - return nil, nil - } - return &one.Credentials, nil -} + digest, err := d.digestRepo.FindOne(ctx, repos.Filter{ + fc.DigestTags: map[string]any{ + "$in": []string{tag}, + }, + fc.DigestRepository: repoName, + fields.AccountName: accountName, + }) + if err != nil { + return errors.NewE(err) + } -// func (d *Impl) CreateHarborProject(ctx RegistryContext) (*entities.HarborProject, error) { -// project, err := d.harborCli.CreateProject(ctx, ctx.GetAccountName()) -// if err != nil { -// return nil, err -// } -// robot, err := d.harborCli.CreateRobot(ctx, ctx.GetAccountName(), "svc-account", func() *string { -// s := "Service account for kloudlite" -// return &s -// }(), true) -// create, err := d.harborProjectRepo.Create(ctx, &entities.HarborProject{ -// AccountName: ctx.GetAccountName(), -// ProjectId: project.ProjectId, -// Credentials: entities.HarborCredentials{ -// Username: robot.Name, -// Password: robot.Secret, -// }, -// }) -// if err != nil { -// return nil, err -// } -// return create, nil -// } - -func (d *Impl) GetRepoArtifacts(ctx RegistryContext, repoName string) ([]harbor.Artifact, error) { - return d.harborCli.ListArtifacts(ctx, ctx.GetAccountName(), repoName, harbor.ListTagsOpts{ - WithImmutable: false, - WithSignature: false, - ListOptions: harbor.ListOptions{ - Page: 1, - PageSize: 100, - }, - }) -} + if digest == nil { + } else { + digest.Tags = func() []string { + tags := []string{} + + for _, v := range digest.Tags { + if v != tag { + tags = append(tags, v) + } + } + + return tags + }() + + if len(digest.Tags) == 0 { + if err := d.digestRepo.DeleteById(ctx, digest.Id); err != nil { + d.logger.Errorf(err) + } + } else { + _, err := d.digestRepo.UpdateById(ctx, digest.Id, digest) + if err != nil { + return errors.NewE(err) + } + } -func (d *Impl) CreateHarborRobot(ctx RegistryContext, hru *entities.HarborRobotUser) (*entities.HarborRobotUser, error) { - hru.EnsureGVK() - hru.Namespace = constants.NamespaceCore - hru.Spec.AccountName = ctx.accountName + } - if err := d.k8sExtendedClient.ValidateStruct(ctx, &hru.HarborUserAccount); err != nil { - return nil, err - } + digest, err = d.digestRepo.FindOne(ctx, repos.Filter{ + fc.DigestDigest: e.Target.Digest, + fc.DigestRepository: repoName, + fields.AccountName: accountName, + }) - hru.SyncStatus = t.GetSyncStatusForCreation() - nHru, err := d.harborRobotUsersRepo.Create(ctx, hru) - if err != nil { - if d.harborRobotUsersRepo.ErrAlreadyExists(err) { - return nil, fmt.Errorf("harbor robot user with name %q, already exists", hru.Name) - } - return nil, err - } + if err != nil { + return errors.NewE(err) + } - b, err := json.Marshal(nHru.HarborUserAccount) - if err != nil { - return nil, err - } + if digest == nil { + if _, err := d.digestRepo.Create(ctx, &entities.Digest{ + Tags: func() []string { + if tag != "" { + return []string{tag} + } + return []string{} + }(), + AccountName: accountName, + Repository: repoName, + Actor: e.Actor.Name, + Digest: e.Target.Digest, + Size: e.Target.Size, + Length: e.Target.Length, + MediaType: e.Target.MediaType, + URL: e.Target.URL, + }); err != nil { + return errors.NewE(err) + } + } else { + if b := slices.Contains(digest.Tags, tag); !b { + digest.Tags = append(digest.Tags, tag) + _, err := d.digestRepo.UpdateById(ctx, digest.Id, digest) + if err != nil { + return errors.NewE(err) + } + } + } - if _, err := d.k8sYamlCli.ApplyYAML(ctx, b); err != nil { - return nil, err - } + ee, err := d.repositoryRepo.FindOne(ctx, repos.Filter{ + fields.AccountName: accountName, + fc.RepositoryName: repoName, + }) + if err != nil { + return errors.NewE(err) + } - return nHru, nil -} + if ee == nil { + _, err := d.repositoryRepo.Create(ctx, &entities.Repository{}) + if err != nil { + return errors.NewE(err) + } + return nil + } -func (d *Impl) GetHarborImages(ctx RegistryContext) ([]harbor.Repository, error) { - return d.harborCli.SearchRepositories(ctx, ctx.GetAccountName(), "", harbor.ListOptions{ - PageSize: 100, - Page: 1, - }) -} + ee.LastUpdatedBy = common.CreatedOrUpdatedBy{ + UserName: e.Actor.Name, + } -func (d *Impl) ListHarborRobots(ctx RegistryContext) ([]*entities.HarborRobotUser, error) { - return d.harborRobotUsersRepo.Find(ctx, repos.Query{ - Filter: repos.Filter{"spec.accountName": ctx.accountName}, - }) + if _, err := d.repositoryRepo.UpdateById(ctx, ee.Id, ee); err != nil { + d.logger.Errorf(err) + } - // if one == nil { - // return nil, errors.New(fmt.Sprintf("project for account %s not found", accountName)) - // } + case "DELETE": - // return d.harborCli.GetRobots(ctx, one.ProjectId, harbor.ListOptions{ - // PageSize: 100, - // Page: 1, - // }) -} + l.Infof("DELETE %s:%s %s", e.Target.Repository, e.Target.Tag, e.Target.Digest) + + if err := d.digestRepo.DeleteOne(ctx, repos.Filter{ + fc.DigestDigest: e.Target.Digest, + fc.DigestRepository: repoName, + fields.AccountName: accountName, + }); err != nil { + d.logger.Errorf(err) + return errors.NewE(err) + } + + case "HEAD": + l.Infof("HEAD %s:%s", e.Target.Repository, e.Target.Tag) -func (d *Impl) DeleteHarborRobot(ctx RegistryContext, robotId int) error { - return d.harborCli.DeleteRobot(ctx, ctx.GetAccountName(), robotId) + case "GET": + l.Infof("GET %s:%s", e.Target.Repository, e.Target.Tag) + + default: + l.Infof("unhandled method", e.Request.Method) + return errors.Newf("unhandled method %s", e.Request.Method) + } + + } + return nil } var Module = fx.Module( "domain", fx.Provide( func(e *env.Env, - projectRepo repos.DbRepo[*entities.HarborProject], - hruRepo repos.DbRepo[*entities.HarborRobotUser], - k8sYamlCli *kubectl.YAMLClient, - k8sExtendedClient k8s.ExtendedK8sClient, + logger logging.Logger, + repositoryRepo repos.DbRepo[*entities.Repository], + credentialRepo repos.DbRepo[*entities.Credential], + buildRepo repos.DbRepo[*entities.Build], + buildCacheRepo repos.DbRepo[*entities.BuildCacheKey], + tagRepo repos.DbRepo[*entities.Digest], + buildRunRepo repos.DbRepo[*entities.BuildRun], + iamClient iam.IAMClient, + cacheClient kv.BinaryDataRepo, + authClient auth.AuthClient, + github Github, + gitlab Gitlab, + resourceEventPublisher ResourceEventPublisher, + dispatcher ResourceDispatcher, ) (Domain, error) { - client, err := harbor.NewClient(harbor.Args{ - HarborAdminUsername: e.HarborAdminUsername, - HarborAdminPassword: e.HarborAdminPassword, - HarborRegistryHost: e.HarborRegistryHost, - }) - if err != nil { - return nil, err - } return &Impl{ - harborCli: client, - harborProjectRepo: projectRepo, - harborRobotUsersRepo: hruRepo, - k8sYamlCli: k8sYamlCli, - k8sExtendedClient: k8sExtendedClient, + repositoryRepo: repositoryRepo, + credentialRepo: credentialRepo, + iamClient: iamClient, + envs: e, + digestRepo: tagRepo, + logger: logger, + cacheClient: cacheClient, + buildRepo: buildRepo, + buildCacheRepo: buildCacheRepo, + buildRunRepo: buildRunRepo, + authClient: authClient, + github: github, + gitlab: gitlab, + resourceEventPublisher: resourceEventPublisher, + dispatcher: dispatcher, }, nil }), ) diff --git a/apps/container-registry/internal/domain/ports.go b/apps/container-registry/internal/domain/ports.go new file mode 100644 index 000000000..6825dec6a --- /dev/null +++ b/apps/container-registry/internal/domain/ports.go @@ -0,0 +1,59 @@ +package domain + +import ( + "context" + "sigs.k8s.io/controller-runtime/pkg/client" + + "github.com/google/go-github/v45/github" + "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" + "github.com/kloudlite/api/pkg/types" + "github.com/xanzy/go-gitlab" + "golang.org/x/oauth2" +) + +type Github interface { + Callback(ctx context.Context, code, state string) (*github.User, *oauth2.Token, error) + GetToken(ctx context.Context, token *oauth2.Token) (*oauth2.Token, error) + GetInstallationToken(ctx context.Context, repoUrl string) (string, error) + + ListInstallations(ctx context.Context, accToken *entities.AccessToken, pagination *types.Pagination) ([]*github.Installation, error) + ListRepos(ctx context.Context, accToken *entities.AccessToken, instId int64, pagination *types.Pagination) (*github.ListRepositories, error) + SearchRepos(ctx context.Context, accToken *entities.AccessToken, q, org string, pagination *types.Pagination) (*github.RepositoriesSearchResult, error) + ListBranches(ctx context.Context, accToken *entities.AccessToken, repoUrl string, pagination *types.Pagination) ([]*github.Branch, error) + CheckWebhookExists(ctx context.Context, token *entities.AccessToken, repoUrl string, webhookId *entities.GithubWebhookId) (bool, error) + AddWebhook(ctx context.Context, accToken *entities.AccessToken, repoUrl string, webhookUrl string) (*entities.GithubWebhookId, error) + DeleteWebhook(ctx context.Context, accToken *entities.AccessToken, repoUrl string, hookId entities.GithubWebhookId) error + GetLatestCommit(ctx context.Context, accToken *entities.AccessToken, repoUrl string, branchName string) (string, error) +} + +type Gitlab interface { + Callback(ctx context.Context, code, state string) (*gitlab.User, *oauth2.Token, error) + ListGroups(ctx context.Context, token *entities.AccessToken, query *string, pagination *types.Pagination) ([]*entities.GitlabGroup, error) + ListRepos(ctx context.Context, token *entities.AccessToken, gid string, query *string, pagination *types.Pagination) ([]*gitlab.Project, error) + ListBranches(ctx context.Context, token *entities.AccessToken, repoId string, query *string, pagination *types.Pagination) ([]*gitlab.Branch, error) + CheckWebhookExists(ctx context.Context, token *entities.AccessToken, repoId string, webhookId *entities.GitlabWebhookId) (bool, error) + AddWebhook(ctx context.Context, token *entities.AccessToken, repoId string) (*int, error) + DeleteWebhook(ctx context.Context, token *entities.AccessToken, repoUrl string, hookId entities.GitlabWebhookId) error + RepoToken(ctx context.Context, token *entities.AccessToken) (*oauth2.Token, error) + GetRepoId(repoUrl string) string + GetLatestCommit(ctx context.Context, token *entities.AccessToken, repoUrl string, branchName string) (string, error) + GetTriggerWebhookUrl() string +} + +type ResourceDispatcher interface { + ApplyToTargetCluster(ctx RegistryContext, clusterName string, obj client.Object, recordVersion int) error + DeleteFromTargetCluster(ctx RegistryContext, clusterName string, obj client.Object) error +} + +type PublishMsg string + +const ( + PublishAdd PublishMsg = "added" + PublishDelete PublishMsg = "deleted" + PublishUpdate PublishMsg = "updated" +) + +type ResourceEventPublisher interface { + PublishBuildRunEvent(cluster *entities.BuildRun, msg PublishMsg) + PublishBuildCacheEvent(buildcache *entities.BuildCacheKey, msg PublishMsg) +} diff --git a/apps/container-registry/internal/domain/repository.go b/apps/container-registry/internal/domain/repository.go new file mode 100644 index 000000000..84138ae8b --- /dev/null +++ b/apps/container-registry/internal/domain/repository.go @@ -0,0 +1,216 @@ +package domain + +import ( + "fmt" + fc "github.com/kloudlite/api/apps/container-registry/internal/domain/entities/field-constants" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/errors" + "log" + "net/url" + "regexp" + + "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" + iamT "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" + "github.com/kloudlite/api/pkg/docker" + "github.com/kloudlite/api/pkg/repos" + "github.com/kloudlite/container-registry-authorizer/admin" +) + +// CreateRepository implements Domain. +func (d *Impl) CreateRepository(ctx RegistryContext, repoName string) (*entities.Repository, error) { + + pattern := `^[a-z0-9]+([._/-][a-z0-9]+)*$` + + re, err := regexp.Compile(pattern) + if err != nil { + log.Println(err) + } + + if !re.MatchString(repoName) { + return nil, errors.Newf("invalid repository name, must be lowercase alphanumeric with underscore") + } + + co, err := d.iamClient.Can(ctx, &iam.CanIn{ + UserId: string(ctx.UserId), + ResourceRefs: []string{ + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), + }, + Action: string(iamT.UpdateAccount), + }) + + if err != nil { + return nil, errors.NewE(err) + } + + if !co.Status { + return nil, errors.Newf("unauthorized to create repository") + } + + return d.repositoryRepo.Create(ctx, &entities.Repository{ + Name: repoName, + AccountName: ctx.AccountName, + CreatedBy: common.CreatedOrUpdatedBy{ + UserId: ctx.UserId, + UserName: ctx.UserName, + UserEmail: ctx.UserEmail, + }, + }) +} + +// DeleteRepository implements Domain. +func (d *Impl) DeleteRepository(ctx RegistryContext, repoName string) error { + + co, err := d.iamClient.Can(ctx, &iam.CanIn{ + UserId: string(ctx.UserId), + ResourceRefs: []string{ + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), + }, + Action: string(iamT.UpdateAccount), + }) + + if err != nil { + return errors.NewE(err) + } + + if !co.Status { + return errors.Newf("unauthorized to delete repository") + } + + if _, err = d.repositoryRepo.FindOne(ctx, repos.Filter{ + fc.RepositoryName: repoName, + fields.AccountName: ctx.AccountName, + }); err != nil { + return errors.NewE(err) + } + + res, err := d.digestRepo.Find(ctx, repos.Query{ + Filter: repos.Filter{ + fc.RepositoryName: repoName, + fields.AccountName: ctx.AccountName, + }, + }) + + if err != nil { + return errors.NewE(err) + } + + if len(res) > 0 { + return errors.Newf("repository %s is not empty, please delete all Digests first", repoName) + } + + return d.repositoryRepo.DeleteOne(ctx, repos.Filter{"name": repoName, "accountName": ctx.AccountName}) +} + +func (d *Impl) DeleteRepositoryDigest(ctx RegistryContext, repoName string, digest string) error { + + co, err := d.iamClient.Can(ctx, &iam.CanIn{ + UserId: string(ctx.UserId), + ResourceRefs: []string{ + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), + }, + Action: string(iamT.UpdateAccount), + }) + + if err != nil { + return errors.NewE(err) + } + + if !co.Status { + return errors.Newf("unauthorized to delete repository digest") + } + + e, err := d.digestRepo.FindOne(ctx, repos.Filter{ + fc.DigestDigest: digest, + fc.DigestRepository: repoName, + fields.AccountName: ctx.AccountName, + }) + + if err != nil { + return errors.NewE(err) + } + + if e == nil { + return errors.Newf("%s not found in repository %s", digest, repoName) + } + + r_url, err := url.Parse(fmt.Sprintf("https://%s", d.envs.RegistryHost)) + if err != nil { + return errors.NewE(err) + } + + i, err := admin.GetExpirationTime(fmt.Sprintf("%d%s", 10, "s")) + if err != nil { + return errors.NewE(err) + } + + token, err := admin.GenerateToken(KL_ADMIN, e.AccountName, string("read_write"), i, d.envs.RegistrySecretKey+e.AccountName) + if err != nil { + return errors.NewE(err) + } + + r_url.User = url.UserPassword(KL_ADMIN, token) + + dockerCli := docker.NewDockerClient(r_url.String()) + if err := dockerCli.DeleteDigest(fmt.Sprintf("%s/%s", ctx.AccountName, repoName), e.Digest); err != nil { + return errors.NewE(err) + } + + // update if present else, ignore + e.Deleting = true + if _, err := d.digestRepo.UpdateById(ctx, e.Id, e); err != nil { + d.logger.Errorf(err) + } + + return nil +} + +// ListRepositories implements Domain. +func (d *Impl) ListRepositories(ctx RegistryContext, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.Repository], error) { + + co, err := d.iamClient.Can(ctx, &iam.CanIn{ + UserId: string(ctx.UserId), + ResourceRefs: []string{ + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), + }, + Action: string(iamT.GetAccount), + }) + + if err != nil { + return nil, errors.NewE(err) + } + + if !co.Status { + return nil, errors.Newf("unauthorized to list repositories") + } + + filter := repos.Filter{ + fields.AccountName: ctx.AccountName, + } + return d.repositoryRepo.FindPaginated(ctx, d.repositoryRepo.MergeMatchFilters(filter, search), pagination) +} + +func (d *Impl) ListRepositoryDigests(ctx RegistryContext, repoName string, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.Digest], error) { + co, err := d.iamClient.Can(ctx, &iam.CanIn{ + UserId: string(ctx.UserId), + ResourceRefs: []string{ + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), + }, + Action: string(iamT.GetAccount), + }) + + if err != nil { + return nil, errors.NewE(err) + } + + if !co.Status { + return nil, errors.Newf("unauthorized to list repository digests") + } + + filter := repos.Filter{ + fields.AccountName: ctx.AccountName, + fc.DigestRepository: repoName, + } + return d.digestRepo.FindPaginated(ctx, d.digestRepo.MergeMatchFilters(filter, search), pagination) +} diff --git a/apps/container-registry/internal/domain/util.go b/apps/container-registry/internal/domain/util.go new file mode 100644 index 000000000..bc09d48d3 --- /dev/null +++ b/apps/container-registry/internal/domain/util.go @@ -0,0 +1,80 @@ +package domain + +import ( + "github.com/kloudlite/api/pkg/errors" + "math/rand" + "regexp" + "strings" +) + +// Nonce generates a random string of length size +func Nonce(size int) string { + chars := "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + nonceBytes := make([]byte, size) + + for i := range nonceBytes { + nonceBytes[i] = chars[rand.Intn(len(chars))] + } + + return string(nonceBytes) +} + +func intnonce(size int) string { + from := "0123456789" + buf := make([]byte, size) + for i := 0; i < size; i++ { + buf[i] = from[rand.Intn(len(from))] + } + return string(buf) +} + +func generateUserNames(input string, size int) []string { + usernames := []string{} + + for i := 0; i < size; i++ { + usernames = append(usernames, generateUsername(input)) + } + + return usernames +} + +func generateUsername(input string) string { + // Convert input to lowercase + lowerInput := strings.ToLower(input) + + // Remove characters that are not a-z, 0-9, space or _ + cleaned := regexp.MustCompile("[^a-z0-9_ ]").ReplaceAllString(lowerInput, "") + + // Replace spaces with underscores + cleaned = strings.ReplaceAll(cleaned, " ", "_") + + // Ensure the string is long enough. If not, pad with underscores + for len(cleaned) < 5 { + cleaned += "_" + } + + // Ensure the string is not too long + if len(cleaned) > 12 { + cleaned = cleaned[:12] + } + + // Verify that the string matches the required pattern + match, _ := regexp.MatchString("^([a-z])([a-z0-9_])+$", cleaned) + if !match { + return generateUsername("user") + } + + return cleaned + intnonce(4) +} + +func isValidUserName(name string) error { + pattern := `^([a-z])([a-z0-9_])+$` + + re := regexp.MustCompile(pattern) + + if !re.MatchString(name) { + return errors.Newf("invalid username, must be lowercase alphanumeric with underscore") + } + + return nil +} diff --git a/apps/container-registry/internal/domain/validator.go b/apps/container-registry/internal/domain/validator.go new file mode 100644 index 000000000..74138a380 --- /dev/null +++ b/apps/container-registry/internal/domain/validator.go @@ -0,0 +1,95 @@ +package domain + +import ( + "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" + "github.com/kloudlite/api/pkg/errors" + "k8s.io/utils/strings/slices" +) + +func validateTag(tag string) error { + if tag == "" { + return errors.Newf("tag is required") + } + + // re := regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,127}$`) + // + // if !re.MatchString(tag) { + // return errors.Newf("tag is invalid") + // } + return nil +} + +func validateRepository(repository string) error { + if repository == "" { + return errors.Newf("repository is required") + } + + // re := regexp.MustCompile(`\b(?:http(?:s)?://)?(?:[a-zA-Z0-9]+(?::[a-zA-Z0-9]+)?@)?(?:www\.)?(?:github\.com|bitbucket\.org|gitlab\.com)[:/][a-zA-Z0-9_.\-]+(?:/[a-zA-Z0-9_.\-]+)*(?:\.git)?\b`) + // + // if !re.MatchString(repository) { + // return errors.Newf("repository is invalid") + // } + return nil +} + +func validateBranch(branch string) error { + if branch == "" { + return errors.Newf("branch is required") + } + + // re := regexp.MustCompile(`^(?!\/)(?!.*\/\/)(?!.*\@\{)(?!.*\.\.)(?![\.\:~\^?*\[\]\\\/]).*(? $tDir/Dockerfile.base - - #lineNo=$(cat Dockerfile | grep -i '^FROM' -n | tail -1 | awk -F: '{print $1}') - CGO_ENABLED=0 go build -o $tDir/{{.APP}} . - - cat $tDir/Dockerfile.base | sed "5 i COPY --from=local-builder ./{{.APP}} ./{{.APP}}" > $tDir/Dockerfile - cat $tDir/Dockerfile - - docker buildx build -f $tDir/Dockerfile -t {{.IMAGE}} . --build-context local-builder=${tDir} - docker push {{.IMAGE}} - rm -rf $tDir diff --git a/apps/dns/internal/app/gqlgen.yml b/apps/dns/internal/app/gqlgen.yml deleted file mode 100644 index 37d61dff5..000000000 --- a/apps/dns/internal/app/gqlgen.yml +++ /dev/null @@ -1,71 +0,0 @@ -# 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/generated.go - package: generated - -# Uncomment to enable federation -federation: - filename: graph/generated/federation.go - package: generated - -# 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 - -# Optional: turn on use ` + "`" + `gqlgen:"fieldName"` + "`" + ` tags in your models -# struct_tag: json - -# Optional: turn on to use []Thing instead of []*Thing -# omit_slice_element_pointers: false - -# Optional: set to speed up generation time by not performing a final validation pass. -# skip_validation: true - -# gqlgen will search for any type names in the schema in these go packages -# if they match it will use them, otherwise it will generate them. -autobind: - - "kloudlite.io/pkg/errors" - # - "kloudlite.io/apps/wireguard/internal/domain/entities" - -# This section declares type mapping between the GraphQL and go type systems -# -# The first line in each type will be used as defaults for resolver arguments and -# modelgen, the others will be allowed when binding to fields. Configure them to -# your liking -skip_validation: true -models: - Account: - fields: - edgeCname: - resolver: true - sites: - resolver: true - Site: - fields: - records: - resolver: true - ID: - model: - - kloudlite.io/pkg/repos.ID - Int: - model: - - github.com/99designs/gqlgen/graphql.Int - - github.com/99designs/gqlgen/graphql.Int64 - - github.com/99designs/gqlgen/graphql.Int32 - PaginationIn: - model: - - kloudlite.io/pkg/types.Pagination - Json: - model: - - github.com/99designs/gqlgen/graphql.Map diff --git a/apps/dns/internal/app/graph/entity.resolvers.go b/apps/dns/internal/app/graph/entity.resolvers.go deleted file mode 100644 index 35d5832e0..000000000 --- a/apps/dns/internal/app/graph/entity.resolvers.go +++ /dev/null @@ -1,35 +0,0 @@ -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. - -import ( - "context" - - "kloudlite.io/apps/dns/internal/app/graph/generated" - "kloudlite.io/apps/dns/internal/app/graph/model" - "kloudlite.io/pkg/repos" -) - -func (r *entityResolver) FindAccountByID(ctx context.Context, id repos.ID) (*model.Account, error) { - return &model.Account{ - ID: id, - }, nil -} - -func (r *entityResolver) FindSiteByID(ctx context.Context, id repos.ID) (*model.Site, error) { - site, err := r.d.GetSite(ctx, string(id)) - if err != nil { - return nil, err - } - return &model.Site{ - ID: id, - AccountID: site.AccountId, - Domain: site.Domain, - }, nil -} - -// Entity returns generated.EntityResolver implementation. -func (r *Resolver) Entity() generated.EntityResolver { return &entityResolver{r} } - -type entityResolver struct{ *Resolver } diff --git a/apps/dns/internal/app/graph/generated/federation.go b/apps/dns/internal/app/graph/generated/federation.go deleted file mode 100644 index f8a10c758..000000000 --- a/apps/dns/internal/app/graph/generated/federation.go +++ /dev/null @@ -1,224 +0,0 @@ -// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. - -package generated - -import ( - "context" - "errors" - "fmt" - "strings" - "sync" - - "github.com/99designs/gqlgen/plugin/federation/fedruntime" -) - -var ( - ErrUnknownType = errors.New("unknown type") - ErrTypeNotFound = errors.New("type not found") -) - -func (ec *executionContext) __resolve__service(ctx context.Context) (fedruntime.Service, error) { - if ec.DisableIntrospection { - return fedruntime.Service{}, errors.New("federated introspection disabled") - } - - var sdl []string - - for _, src := range sources { - if src.BuiltIn { - continue - } - sdl = append(sdl, src.Input) - } - - return fedruntime.Service{ - SDL: strings.Join(sdl, "\n"), - }, nil -} - -func (ec *executionContext) __resolve_entities(ctx context.Context, representations []map[string]interface{}) []fedruntime.Entity { - list := make([]fedruntime.Entity, len(representations)) - - repsMap := map[string]struct { - i []int - r []map[string]interface{} - }{} - - // We group entities by typename so that we can parallelize their resolution. - // This is particularly helpful when there are entity groups in multi mode. - buildRepresentationGroups := func(reps []map[string]interface{}) { - for i, rep := range reps { - typeName, ok := rep["__typename"].(string) - if !ok { - // If there is no __typename, we just skip the representation; - // we just won't be resolving these unknown types. - ec.Error(ctx, errors.New("__typename must be an existing string")) - continue - } - - _r := repsMap[typeName] - _r.i = append(_r.i, i) - _r.r = append(_r.r, rep) - repsMap[typeName] = _r - } - } - - isMulti := func(typeName string) bool { - switch typeName { - default: - return false - } - } - - resolveEntity := func(ctx context.Context, typeName string, rep map[string]interface{}, idx []int, i int) (err error) { - // we need to do our own panic handling, because we may be called in a - // goroutine, where the usual panic handling can't catch us - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - } - }() - - switch typeName { - case "Account": - resolverName, err := entityResolverNameForAccount(ctx, rep) - if err != nil { - return fmt.Errorf(`finding resolver for Entity "Account": %w`, err) - } - switch resolverName { - - case "findAccountByID": - id0, err := ec.unmarshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, rep["id"]) - if err != nil { - return fmt.Errorf(`unmarshalling param 0 for findAccountByID(): %w`, err) - } - entity, err := ec.resolvers.Entity().FindAccountByID(ctx, id0) - if err != nil { - return fmt.Errorf(`resolving Entity "Account": %w`, err) - } - - list[idx[i]] = entity - return nil - } - case "Site": - resolverName, err := entityResolverNameForSite(ctx, rep) - if err != nil { - return fmt.Errorf(`finding resolver for Entity "Site": %w`, err) - } - switch resolverName { - - case "findSiteByID": - id0, err := ec.unmarshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, rep["id"]) - if err != nil { - return fmt.Errorf(`unmarshalling param 0 for findSiteByID(): %w`, err) - } - entity, err := ec.resolvers.Entity().FindSiteByID(ctx, id0) - if err != nil { - return fmt.Errorf(`resolving Entity "Site": %w`, err) - } - - list[idx[i]] = entity - return nil - } - - } - return fmt.Errorf("%w: %s", ErrUnknownType, typeName) - } - - resolveManyEntities := func(ctx context.Context, typeName string, reps []map[string]interface{}, idx []int) (err error) { - // we need to do our own panic handling, because we may be called in a - // goroutine, where the usual panic handling can't catch us - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - } - }() - - switch typeName { - - default: - return errors.New("unknown type: " + typeName) - } - } - - resolveEntityGroup := func(typeName string, reps []map[string]interface{}, idx []int) { - if isMulti(typeName) { - err := resolveManyEntities(ctx, typeName, reps, idx) - if err != nil { - ec.Error(ctx, err) - } - } else { - // if there are multiple entities to resolve, parallelize (similar to - // graphql.FieldSet.Dispatch) - var e sync.WaitGroup - e.Add(len(reps)) - for i, rep := range reps { - i, rep := i, rep - go func(i int, rep map[string]interface{}) { - err := resolveEntity(ctx, typeName, rep, idx, i) - if err != nil { - ec.Error(ctx, err) - } - e.Done() - }(i, rep) - } - e.Wait() - } - } - buildRepresentationGroups(representations) - - switch len(repsMap) { - case 0: - return list - case 1: - for typeName, reps := range repsMap { - resolveEntityGroup(typeName, reps.r, reps.i) - } - return list - default: - var g sync.WaitGroup - g.Add(len(repsMap)) - for typeName, reps := range repsMap { - go func(typeName string, reps []map[string]interface{}, idx []int) { - resolveEntityGroup(typeName, reps, idx) - g.Done() - }(typeName, reps.r, reps.i) - } - g.Wait() - return list - } -} - -func entityResolverNameForAccount(ctx context.Context, rep map[string]interface{}) (string, error) { - for { - var ( - m map[string]interface{} - val interface{} - ok bool - ) - _ = val - m = rep - if _, ok = m["id"]; !ok { - break - } - return "findAccountByID", nil - } - return "", fmt.Errorf("%w for Account", ErrTypeNotFound) -} - -func entityResolverNameForSite(ctx context.Context, rep map[string]interface{}) (string, error) { - for { - var ( - m map[string]interface{} - val interface{} - ok bool - ) - _ = val - m = rep - if _, ok = m["id"]; !ok { - break - } - return "findSiteByID", nil - } - return "", fmt.Errorf("%w for Site", ErrTypeNotFound) -} diff --git a/apps/dns/internal/app/graph/generated/generated.go b/apps/dns/internal/app/graph/generated/generated.go deleted file mode 100644 index 511e4ff4b..000000000 --- a/apps/dns/internal/app/graph/generated/generated.go +++ /dev/null @@ -1,4135 +0,0 @@ -// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. - -package generated - -import ( - "bytes" - "context" - "errors" - "fmt" - "strconv" - "sync" - "sync/atomic" - - "github.com/99designs/gqlgen/graphql" - "github.com/99designs/gqlgen/graphql/introspection" - "github.com/99designs/gqlgen/plugin/federation/fedruntime" - gqlparser "github.com/vektah/gqlparser/v2" - "github.com/vektah/gqlparser/v2/ast" - "kloudlite.io/apps/dns/internal/app/graph/model" - "kloudlite.io/pkg/repos" -) - -// region ************************** generated!.gotpl ************************** - -// NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface. -func NewExecutableSchema(cfg Config) graphql.ExecutableSchema { - return &executableSchema{ - resolvers: cfg.Resolvers, - directives: cfg.Directives, - complexity: cfg.Complexity, - } -} - -type Config struct { - Resolvers ResolverRoot - Directives DirectiveRoot - Complexity ComplexityRoot -} - -type ResolverRoot interface { - Account() AccountResolver - Entity() EntityResolver - Mutation() MutationResolver - Query() QueryResolver -} - -type DirectiveRoot struct { -} - -type ComplexityRoot struct { - Account struct { - ID func(childComplexity int) int - Sites func(childComplexity int) int - } - - Entity struct { - FindAccountByID func(childComplexity int, id repos.ID) int - FindSiteByID func(childComplexity int, id repos.ID) int - } - - Mutation struct { - DNSCreateSite func(childComplexity int, domain string, accountID repos.ID, regionID repos.ID) int - DNSDeleteSite func(childComplexity int, siteID repos.ID) int - DNSVerifySite func(childComplexity int, siteID repos.ID) int - } - - Query struct { - DNSGetSite func(childComplexity int, siteID repos.ID) int - __resolve__service func(childComplexity int) int - __resolve_entities func(childComplexity int, representations []map[string]interface{}) int - } - - Site struct { - AccountID func(childComplexity int) int - CreationDate func(childComplexity int) int - Domain func(childComplexity int) int - EdgeCname func(childComplexity int) int - ID func(childComplexity int) int - IsVerified func(childComplexity int) int - RegionID func(childComplexity int) int - } - - _Service struct { - SDL func(childComplexity int) int - } -} - -type AccountResolver interface { - Sites(ctx context.Context, obj *model.Account) ([]*model.Site, error) -} -type EntityResolver interface { - FindAccountByID(ctx context.Context, id repos.ID) (*model.Account, error) - FindSiteByID(ctx context.Context, id repos.ID) (*model.Site, error) -} -type MutationResolver interface { - DNSCreateSite(ctx context.Context, domain string, accountID repos.ID, regionID repos.ID) (bool, error) - DNSDeleteSite(ctx context.Context, siteID repos.ID) (bool, error) - DNSVerifySite(ctx context.Context, siteID repos.ID) (bool, error) -} -type QueryResolver interface { - DNSGetSite(ctx context.Context, siteID repos.ID) (*model.Site, error) -} - -type executableSchema struct { - resolvers ResolverRoot - directives DirectiveRoot - complexity ComplexityRoot -} - -func (e *executableSchema) Schema() *ast.Schema { - return parsedSchema -} - -func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) { - ec := executionContext{nil, e} - _ = ec - switch typeName + "." + field { - - case "Account.id": - if e.complexity.Account.ID == nil { - break - } - - return e.complexity.Account.ID(childComplexity), true - - case "Account.sites": - if e.complexity.Account.Sites == nil { - break - } - - return e.complexity.Account.Sites(childComplexity), true - - case "Entity.findAccountByID": - if e.complexity.Entity.FindAccountByID == nil { - break - } - - args, err := ec.field_Entity_findAccountByID_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Entity.FindAccountByID(childComplexity, args["id"].(repos.ID)), true - - case "Entity.findSiteByID": - if e.complexity.Entity.FindSiteByID == nil { - break - } - - args, err := ec.field_Entity_findSiteByID_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Entity.FindSiteByID(childComplexity, args["id"].(repos.ID)), true - - case "Mutation.dns_createSite": - if e.complexity.Mutation.DNSCreateSite == nil { - break - } - - args, err := ec.field_Mutation_dns_createSite_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Mutation.DNSCreateSite(childComplexity, args["domain"].(string), args["accountId"].(repos.ID), args["regionId"].(repos.ID)), true - - case "Mutation.dns_deleteSite": - if e.complexity.Mutation.DNSDeleteSite == nil { - break - } - - args, err := ec.field_Mutation_dns_deleteSite_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Mutation.DNSDeleteSite(childComplexity, args["siteId"].(repos.ID)), true - - case "Mutation.dns_VerifySite": - if e.complexity.Mutation.DNSVerifySite == nil { - break - } - - args, err := ec.field_Mutation_dns_VerifySite_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Mutation.DNSVerifySite(childComplexity, args["siteId"].(repos.ID)), true - - case "Query.dns_getSite": - if e.complexity.Query.DNSGetSite == nil { - break - } - - args, err := ec.field_Query_dns_getSite_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.DNSGetSite(childComplexity, args["siteId"].(repos.ID)), true - - case "Query._service": - if e.complexity.Query.__resolve__service == nil { - break - } - - return e.complexity.Query.__resolve__service(childComplexity), true - - case "Query._entities": - if e.complexity.Query.__resolve_entities == nil { - break - } - - args, err := ec.field_Query__entities_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.__resolve_entities(childComplexity, args["representations"].([]map[string]interface{})), true - - case "Site.accountId": - if e.complexity.Site.AccountID == nil { - break - } - - return e.complexity.Site.AccountID(childComplexity), true - - case "Site.creationDate": - if e.complexity.Site.CreationDate == nil { - break - } - - return e.complexity.Site.CreationDate(childComplexity), true - - case "Site.domain": - if e.complexity.Site.Domain == nil { - break - } - - return e.complexity.Site.Domain(childComplexity), true - - case "Site.edgeCname": - if e.complexity.Site.EdgeCname == nil { - break - } - - return e.complexity.Site.EdgeCname(childComplexity), true - - case "Site.id": - if e.complexity.Site.ID == nil { - break - } - - return e.complexity.Site.ID(childComplexity), true - - case "Site.isVerified": - if e.complexity.Site.IsVerified == nil { - break - } - - return e.complexity.Site.IsVerified(childComplexity), true - - case "Site.regionId": - if e.complexity.Site.RegionID == nil { - break - } - - return e.complexity.Site.RegionID(childComplexity), true - - case "_Service.sdl": - if e.complexity._Service.SDL == nil { - break - } - - return e.complexity._Service.SDL(childComplexity), true - - } - return 0, false -} - -func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { - rc := graphql.GetOperationContext(ctx) - ec := executionContext{rc, e} - first := true - - switch rc.Operation.Operation { - case ast.Query: - return func(ctx context.Context) *graphql.Response { - if !first { - return nil - } - first = false - data := ec._Query(ctx, rc.Operation.SelectionSet) - var buf bytes.Buffer - data.MarshalGQL(&buf) - - return &graphql.Response{ - Data: buf.Bytes(), - } - } - case ast.Mutation: - return func(ctx context.Context) *graphql.Response { - if !first { - return nil - } - first = false - 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 -} - -func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { - if ec.DisableIntrospection { - return nil, errors.New("introspection disabled") - } - return introspection.WrapSchema(parsedSchema), nil -} - -func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { - if ec.DisableIntrospection { - return nil, errors.New("introspection disabled") - } - return introspection.WrapTypeFromDef(parsedSchema, parsedSchema.Types[name]), nil -} - -var sources = []*ast.Source{ - {Name: "graph/schema.graphqls", Input: `scalar Json -scalar Any - -type Query { - dns_getSite(siteId:ID!): Site! # account-owner-access, account-admin-access -} - -extend type Account @key(fields: "id") { - id: ID! @external - sites:[Site]! # account-owner-access, account-admin-access, project-admin-access, project-developer-access, account-developer-access -} - -type Site @key(fields: "id"){ - id : ID! - regionId: ID! - accountId: ID! - isVerified: Boolean! - domain: String! - creationDate: String! - edgeCname: String! -} - - -type Mutation { - dns_createSite(domain:String!, accountId:ID!, regionId:ID!) :Boolean! # account-owner-access, account-admin-access - dns_deleteSite(siteId:ID!) :Boolean! # account-owner-access, account-admin-access - dns_VerifySite(siteId:ID!) :Boolean! # account-owner-access, account-admin-access -} -`, BuiltIn: false}, - {Name: "federation/directives.graphql", Input: ` -scalar _Any -scalar _FieldSet - -directive @external on FIELD_DEFINITION -directive @requires(fields: _FieldSet!) on FIELD_DEFINITION -directive @provides(fields: _FieldSet!) on FIELD_DEFINITION -directive @key(fields: _FieldSet!) repeatable on OBJECT | INTERFACE -directive @extends on OBJECT | INTERFACE -`, BuiltIn: true}, - {Name: "federation/entity.graphql", Input: ` -# a union of all types that use the @key directive -union _Entity = Account | Site - -# fake type to build resolver interfaces for users to implement -type Entity { - findAccountByID(id: ID!,): Account! - findSiteByID(id: ID!,): Site! - -} - -type _Service { - sdl: String -} - -extend type Query { - _entities(representations: [_Any!]!): [_Entity]! - _service: _Service! -} -`, BuiltIn: true}, -} -var parsedSchema = gqlparser.MustLoadSchema(sources...) - -// endregion ************************** generated!.gotpl ************************** - -// region ***************************** args.gotpl ***************************** - -func (ec *executionContext) field_Entity_findAccountByID_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 repos.ID - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, tmp) - if err != nil { - return nil, err - } - } - args["id"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Entity_findSiteByID_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 repos.ID - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, tmp) - if err != nil { - return nil, err - } - } - args["id"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Mutation_dns_VerifySite_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 repos.ID - if tmp, ok := rawArgs["siteId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("siteId")) - arg0, err = ec.unmarshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, tmp) - if err != nil { - return nil, err - } - } - args["siteId"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Mutation_dns_createSite_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["domain"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("domain")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["domain"] = arg0 - var arg1 repos.ID - if tmp, ok := rawArgs["accountId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("accountId")) - arg1, err = ec.unmarshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, tmp) - if err != nil { - return nil, err - } - } - args["accountId"] = arg1 - var arg2 repos.ID - if tmp, ok := rawArgs["regionId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("regionId")) - arg2, err = ec.unmarshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, tmp) - if err != nil { - return nil, err - } - } - args["regionId"] = arg2 - return args, nil -} - -func (ec *executionContext) field_Mutation_dns_deleteSite_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 repos.ID - if tmp, ok := rawArgs["siteId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("siteId")) - arg0, err = ec.unmarshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, tmp) - if err != nil { - return nil, err - } - } - args["siteId"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["name"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Query__entities_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 []map[string]interface{} - if tmp, ok := rawArgs["representations"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("representations")) - arg0, err = ec.unmarshalN_Any2ᚕmapᚄ(ctx, tmp) - if err != nil { - return nil, err - } - } - args["representations"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Query_dns_getSite_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 repos.ID - if tmp, ok := rawArgs["siteId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("siteId")) - arg0, err = ec.unmarshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, tmp) - if err != nil { - return nil, err - } - } - args["siteId"] = 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) _Account_id(ctx context.Context, field graphql.CollectedField, obj *model.Account) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Account", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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.(repos.ID) - fc.Result = res - return ec.marshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, field.Selections, res) -} - -func (ec *executionContext) _Account_sites(ctx context.Context, field graphql.CollectedField, obj *model.Account) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Account", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Account().Sites(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.Site) - fc.Result = res - return ec.marshalNSite2ᚕᚖkloudliteᚗioᚋappsᚋdnsᚋinternalᚋappᚋgraphᚋmodelᚐSite(ctx, field.Selections, res) -} - -func (ec *executionContext) _Entity_findAccountByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Entity", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Entity_findAccountByID_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Entity().FindAccountByID(rctx, args["id"].(repos.ID)) - }) - if err != nil { - ec.Error(ctx, 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.Account) - fc.Result = res - return ec.marshalNAccount2ᚖkloudliteᚗioᚋappsᚋdnsᚋinternalᚋappᚋgraphᚋmodelᚐAccount(ctx, field.Selections, res) -} - -func (ec *executionContext) _Entity_findSiteByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Entity", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Entity_findSiteByID_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Entity().FindSiteByID(rctx, args["id"].(repos.ID)) - }) - if err != nil { - ec.Error(ctx, 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.Site) - fc.Result = res - return ec.marshalNSite2ᚖkloudliteᚗioᚋappsᚋdnsᚋinternalᚋappᚋgraphᚋmodelᚐSite(ctx, field.Selections, res) -} - -func (ec *executionContext) _Mutation_dns_createSite(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_dns_createSite_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().DNSCreateSite(rctx, args["domain"].(string), args["accountId"].(repos.ID), args["regionId"].(repos.ID)) - }) - if err != nil { - ec.Error(ctx, 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) _Mutation_dns_deleteSite(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_dns_deleteSite_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().DNSDeleteSite(rctx, args["siteId"].(repos.ID)) - }) - if err != nil { - ec.Error(ctx, 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) _Mutation_dns_VerifySite(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_dns_VerifySite_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().DNSVerifySite(rctx, args["siteId"].(repos.ID)) - }) - if err != nil { - ec.Error(ctx, 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) _Query_dns_getSite(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_dns_getSite_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().DNSGetSite(rctx, args["siteId"].(repos.ID)) - }) - if err != nil { - ec.Error(ctx, 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.Site) - fc.Result = res - return ec.marshalNSite2ᚖkloudliteᚗioᚋappsᚋdnsᚋinternalᚋappᚋgraphᚋmodelᚐSite(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query__entities(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query__entities_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.__resolve_entities(ctx, args["representations"].([]map[string]interface{})), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]fedruntime.Entity) - fc.Result = res - return ec.marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query__service(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.__resolve__service(ctx) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(fedruntime.Service) - fc.Result = res - return ec.marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query___type_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.introspectType(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) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) _Site_id(ctx context.Context, field graphql.CollectedField, obj *model.Site) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Site", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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.(repos.ID) - fc.Result = res - return ec.marshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, field.Selections, res) -} - -func (ec *executionContext) _Site_regionId(ctx context.Context, field graphql.CollectedField, obj *model.Site) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Site", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.RegionID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(repos.ID) - fc.Result = res - return ec.marshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, field.Selections, res) -} - -func (ec *executionContext) _Site_accountId(ctx context.Context, field graphql.CollectedField, obj *model.Site) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Site", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.AccountID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(repos.ID) - fc.Result = res - return ec.marshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, field.Selections, res) -} - -func (ec *executionContext) _Site_isVerified(ctx context.Context, field graphql.CollectedField, obj *model.Site) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Site", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.IsVerified, nil - }) - if err != nil { - ec.Error(ctx, 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) _Site_domain(ctx context.Context, field graphql.CollectedField, obj *model.Site) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Site", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Domain, nil - }) - if err != nil { - ec.Error(ctx, err) - 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) _Site_creationDate(ctx context.Context, field graphql.CollectedField, obj *model.Site) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Site", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.CreationDate, nil - }) - if err != nil { - ec.Error(ctx, err) - 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) _Site_edgeCname(ctx context.Context, field graphql.CollectedField, obj *model.Site) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Site", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.EdgeCname, nil - }) - if err != nil { - ec.Error(ctx, err) - 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) __Service_sdl(ctx context.Context, field graphql.CollectedField, obj *fedruntime.Service) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "_Service", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SDL, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Directive", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Directive", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Directive", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Directive", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Directive", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field___Type_fields_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Fields(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) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field___Type_enumValues_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.EnumValues(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) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - 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) -} - -// endregion **************************** field.gotpl ***************************** - -// region **************************** input.gotpl ***************************** - -// endregion **************************** input.gotpl ***************************** - -// region ************************** interface.gotpl *************************** - -func (ec *executionContext) __Entity(ctx context.Context, sel ast.SelectionSet, obj fedruntime.Entity) graphql.Marshaler { - switch obj := (obj).(type) { - case nil: - return graphql.Null - case model.Account: - return ec._Account(ctx, sel, &obj) - case *model.Account: - if obj == nil { - return graphql.Null - } - return ec._Account(ctx, sel, obj) - case model.Site: - return ec._Site(ctx, sel, &obj) - case *model.Site: - if obj == nil { - return graphql.Null - } - return ec._Site(ctx, sel, obj) - default: - panic(fmt.Errorf("unexpected type %T", obj)) - } -} - -// endregion ************************** interface.gotpl *************************** - -// region **************************** object.gotpl **************************** - -var accountImplementors = []string{"Account", "_Entity"} - -func (ec *executionContext) _Account(ctx context.Context, sel ast.SelectionSet, obj *model.Account) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, accountImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Account") - case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Account_id(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "sites": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Account_sites(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var entityImplementors = []string{"Entity"} - -func (ec *executionContext) _Entity(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, entityImplementors) - ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ - Object: "Entity", - }) - - out := graphql.NewFieldSet(fields) - var invalids uint32 - 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("Entity") - case "findAccountByID": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Entity_findAccountByID(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "findSiteByID": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Entity_findSiteByID(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - 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) - var invalids uint32 - 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 "dns_createSite": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_dns_createSite(ctx, field) - } - - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "dns_deleteSite": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_dns_deleteSite(ctx, field) - } - - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "dns_VerifySite": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_dns_VerifySite(ctx, field) - } - - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var 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) - var invalids uint32 - 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 "dns_getSite": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_dns_getSite(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "_entities": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query__entities(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "_service": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query__service(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "__type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___type(ctx, field) - } - - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) - - case "__schema": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___schema(ctx, field) - } - - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var siteImplementors = []string{"Site", "_Entity"} - -func (ec *executionContext) _Site(ctx context.Context, sel ast.SelectionSet, obj *model.Site) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, siteImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Site") - case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Site_id(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "regionId": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Site_regionId(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "accountId": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Site_accountId(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "isVerified": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Site_isVerified(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "domain": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Site_domain(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "creationDate": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Site_creationDate(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "edgeCname": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Site_edgeCname(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var _ServiceImplementors = []string{"_Service"} - -func (ec *executionContext) __Service(ctx context.Context, sel ast.SelectionSet, obj *fedruntime.Service) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, _ServiceImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("_Service") - case "sdl": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.__Service_sdl(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - 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) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Directive") - case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_name(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_description(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "locations": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_locations(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_args(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "isRepeatable": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_isRepeatable(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var __EnumValueImplementors = []string{"__EnumValue"} - -func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__EnumValue") - case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_name(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_description(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_isDeprecated(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_deprecationReason(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - 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) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Field") - case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_name(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_description(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_args(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_type(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_isDeprecated(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_deprecationReason(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - 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) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__InputValue") - case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_name(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_description(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_type(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "defaultValue": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_defaultValue(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - 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) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Schema") - case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_description(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "types": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_types(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "queryType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_queryType(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "mutationType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_mutationType(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "subscriptionType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_subscriptionType(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "directives": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_directives(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var __TypeImplementors = []string{"__Type"} - -func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Type") - case "kind": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_kind(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_name(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_description(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "fields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_fields(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "interfaces": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_interfaces(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "possibleTypes": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_possibleTypes(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "enumValues": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_enumValues(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "inputFields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_inputFields(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "ofType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_ofType(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - case "specifiedByURL": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_specifiedByURL(ctx, field, obj) - } - - out.Values[i] = innerFunc(ctx) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -// endregion **************************** object.gotpl **************************** - -// region ***************************** type.gotpl ***************************** - -func (ec *executionContext) marshalNAccount2kloudliteᚗioᚋappsᚋdnsᚋinternalᚋappᚋgraphᚋmodelᚐAccount(ctx context.Context, sel ast.SelectionSet, v model.Account) graphql.Marshaler { - return ec._Account(ctx, sel, &v) -} - -func (ec *executionContext) marshalNAccount2ᚖkloudliteᚗioᚋappsᚋdnsᚋinternalᚋappᚋgraphᚋmodelᚐAccount(ctx context.Context, sel ast.SelectionSet, v *model.Account) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - return ec._Account(ctx, sel, v) -} - -func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { - res, err := graphql.UnmarshalBoolean(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { - res := graphql.MarshalBoolean(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - } - return res -} - -func (ec *executionContext) unmarshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx context.Context, v interface{}) (repos.ID, error) { - tmp, err := graphql.UnmarshalString(v) - res := repos.ID(tmp) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx context.Context, sel ast.SelectionSet, v repos.ID) graphql.Marshaler { - res := graphql.MarshalString(string(v)) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - } - return res -} - -func (ec *executionContext) marshalNSite2kloudliteᚗioᚋappsᚋdnsᚋinternalᚋappᚋgraphᚋmodelᚐSite(ctx context.Context, sel ast.SelectionSet, v model.Site) graphql.Marshaler { - return ec._Site(ctx, sel, &v) -} - -func (ec *executionContext) marshalNSite2ᚕᚖkloudliteᚗioᚋappsᚋdnsᚋinternalᚋappᚋgraphᚋmodelᚐSite(ctx context.Context, sel ast.SelectionSet, v []*model.Site) 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.marshalOSite2ᚖkloudliteᚗioᚋappsᚋdnsᚋinternalᚋappᚋgraphᚋmodelᚐSite(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - return ret -} - -func (ec *executionContext) marshalNSite2ᚖkloudliteᚗioᚋappsᚋdnsᚋinternalᚋappᚋgraphᚋmodelᚐSite(ctx context.Context, sel ast.SelectionSet, v *model.Site) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - return ec._Site(ctx, sel, 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, "must not be null") - } - } - return res -} - -func (ec *executionContext) unmarshalN_Any2map(ctx context.Context, v interface{}) (map[string]interface{}, error) { - res, err := graphql.UnmarshalMap(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalN_Any2map(ctx context.Context, sel ast.SelectionSet, v map[string]interface{}) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := graphql.MarshalMap(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - } - return res -} - -func (ec *executionContext) unmarshalN_Any2ᚕmapᚄ(ctx context.Context, v interface{}) ([]map[string]interface{}, error) { - var vSlice []interface{} - if v != nil { - vSlice = graphql.CoerceList(v) - } - var err error - res := make([]map[string]interface{}, len(vSlice)) - for i := range vSlice { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalN_Any2map(ctx, vSlice[i]) - if err != nil { - return nil, err - } - } - return res, nil -} - -func (ec *executionContext) marshalN_Any2ᚕmapᚄ(ctx context.Context, sel ast.SelectionSet, v []map[string]interface{}) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - for i := range v { - ret[i] = ec.marshalN_Any2map(ctx, sel, v[i]) - } - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx context.Context, sel ast.SelectionSet, v []fedruntime.Entity) 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.marshalO_Entity2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - return ret -} - -func (ec *executionContext) unmarshalN_FieldSet2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalN_FieldSet2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - res := graphql.MarshalString(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - } - return res -} - -func (ec *executionContext) marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx context.Context, sel ast.SelectionSet, v fedruntime.Service) graphql.Marshaler { - return ec.__Service(ctx, sel, &v) -} - -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, "must not be null") - } - } - 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, "must not be null") - } - 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, "must not be null") - } - } - 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) marshalOSite2ᚖkloudliteᚗioᚋappsᚋdnsᚋinternalᚋappᚋgraphᚋmodelᚐSite(ctx context.Context, sel ast.SelectionSet, v *model.Site) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._Site(ctx, sel, v) -} - -func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - res := graphql.MarshalString(v) - return res -} - -func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v interface{}) (*string, error) { - if v == nil { - return nil, nil - } - 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_Entity2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx context.Context, sel ast.SelectionSet, v fedruntime.Entity) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec.__Entity(ctx, sel, v) -} - -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/apps/dns/internal/app/graph/model/models_gen.go b/apps/dns/internal/app/graph/model/models_gen.go deleted file mode 100644 index ba1448b52..000000000 --- a/apps/dns/internal/app/graph/model/models_gen.go +++ /dev/null @@ -1,26 +0,0 @@ -// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. - -package model - -import ( - "kloudlite.io/pkg/repos" -) - -type Account struct { - ID repos.ID `json:"id"` - Sites []*Site `json:"sites"` -} - -func (Account) IsEntity() {} - -type Site struct { - ID repos.ID `json:"id"` - RegionID repos.ID `json:"regionId"` - AccountID repos.ID `json:"accountId"` - IsVerified bool `json:"isVerified"` - Domain string `json:"domain"` - CreationDate string `json:"creationDate"` - EdgeCname string `json:"edgeCname"` -} - -func (Site) IsEntity() {} diff --git a/apps/dns/internal/app/graph/resolver.go b/apps/dns/internal/app/graph/resolver.go deleted file mode 100644 index 5959dda75..000000000 --- a/apps/dns/internal/app/graph/resolver.go +++ /dev/null @@ -1,19 +0,0 @@ -package graph - -import ( - "kloudlite.io/apps/dns/internal/domain" -) - -// This file will not be regenerated automatically. -// -// It serves as dependency injection for your app, add any dependencies you require here. - -type Resolver struct { - d domain.Domain -} - -func NewResolver(domain domain.Domain) *Resolver { - return &Resolver{ - domain, - } -} diff --git a/apps/dns/internal/app/graph/schema.graphqls b/apps/dns/internal/app/graph/schema.graphqls deleted file mode 100644 index 3c56a1785..000000000 --- a/apps/dns/internal/app/graph/schema.graphqls +++ /dev/null @@ -1,28 +0,0 @@ -scalar Json -scalar Any - -type Query { - dns_getSite(siteId:ID!): Site! # account-owner-access, account-admin-access -} - -extend type Account @key(fields: "name") { - name: String! @external - sites:[Site]! # account-owner-access, account-admin-access, project-admin-access, project-developer-access, account-developer-access -} - -type Site @key(fields: "id"){ - id : ID! - regionId: ID! - accountId: ID! - isVerified: Boolean! - domain: String! - creationDate: String! - edgeCname: String! -} - - -type Mutation { - dns_createSite(domain:String!, accountId:ID!, regionId:ID!) :Boolean! # account-owner-access, account-admin-access - dns_deleteSite(siteId:ID!) :Boolean! # account-owner-access, account-admin-access - dns_VerifySite(siteId:ID!) :Boolean! # account-owner-access, account-admin-access -} diff --git a/apps/dns/internal/app/graph/schema.resolvers.go b/apps/dns/internal/app/graph/schema.resolvers.go deleted file mode 100644 index d6e2e8a5f..000000000 --- a/apps/dns/internal/app/graph/schema.resolvers.go +++ /dev/null @@ -1,89 +0,0 @@ -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. - -import ( - "context" - - "kloudlite.io/apps/dns/internal/app/graph/generated" - "kloudlite.io/apps/dns/internal/app/graph/model" - "kloudlite.io/pkg/repos" -) - -func (r *accountResolver) Sites(ctx context.Context, obj *model.Account) ([]*model.Site, error) { - sitesEntities, err := r.d.GetSites(ctx, string(obj.ID)) - if err != nil { - return nil, err - } - sites := make([]*model.Site, 0) - for _, e := range sitesEntities { - edgeCname, err := r.d.GetAccountEdgeCName(ctx, string(e.AccountId), e.RegionId) - if err != nil { - edgeCname = "" - } - sites = append(sites, &model.Site{ - ID: e.Id, - RegionID: e.RegionId, - AccountID: e.AccountId, - IsVerified: e.Verified, - Domain: e.Domain, - EdgeCname: edgeCname, - }) - } - return sites, nil -} - -func (r *mutationResolver) DNSCreateSite(ctx context.Context, domain string, accountID repos.ID, regionID repos.ID) (bool, error) { - err := r.d.CreateSite(ctx, domain, accountID, regionID) - if err != nil { - return false, err - } - return true, nil -} - -func (r *mutationResolver) DNSDeleteSite(ctx context.Context, siteID repos.ID) (bool, error) { - err := r.d.DeleteSite(ctx, siteID) - if err != nil { - return false, err - } - return true, nil -} - -func (r *mutationResolver) DNSVerifySite(ctx context.Context, siteID repos.ID) (bool, error) { - err := r.d.VerifySite(ctx, siteID) - return err == nil, err -} - -func (r *queryResolver) DNSGetSite(ctx context.Context, siteID repos.ID) (*model.Site, error) { - site, err := r.d.GetSite(ctx, string(siteID)) - if err != nil { - return nil, err - } - edgeCname, err := r.d.GetAccountEdgeCName(ctx, string(site.AccountId), site.RegionId) - if err != nil { - return nil, err - } - - return &model.Site{ - ID: site.Id, - RegionID: site.RegionId, - AccountID: site.AccountId, - IsVerified: site.Verified, - Domain: site.Domain, - EdgeCname: edgeCname, - }, nil -} - -// Account returns generated.AccountResolver implementation. -func (r *Resolver) Account() generated.AccountResolver { return &accountResolver{r} } - -// Mutation returns generated.MutationResolver implementation. -func (r *Resolver) Mutation() generated.MutationResolver { return &mutationResolver{r} } - -// Query returns generated.QueryResolver implementation. -func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} } - -type accountResolver struct{ *Resolver } -type mutationResolver struct{ *Resolver } -type queryResolver struct{ *Resolver } diff --git a/apps/dns/internal/app/grpc-server.go b/apps/dns/internal/app/grpc-server.go deleted file mode 100644 index 4b8f7db25..000000000 --- a/apps/dns/internal/app/grpc-server.go +++ /dev/null @@ -1,34 +0,0 @@ -package app - -import ( - "context" - "kloudlite.io/apps/dns/internal/domain" - kldns "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/dns" -) - -type dnsServerI struct { - kldns.UnimplementedDNSServer - d domain.Domain -} - -func (d *dnsServerI) GetAccountDomains(ctx context.Context, in *kldns.GetAccountDomainsIn) (*kldns.GetAccountDomainsOut, error) { - _sites, err := d.d.GetSites(ctx, in.AccountId) - if err != nil { - return nil, err - } - return &kldns.GetAccountDomainsOut{ - Domains: func() []string { - sites := make([]string, 0) - for _, site := range _sites { - sites = append(sites, site.Domain) - } - return sites - }(), - }, nil -} - -func fxDNSGrpcServer(d domain.Domain) kldns.DNSServer { - return &dnsServerI{ - d: d, - } -} diff --git a/apps/dns/internal/app/main.go b/apps/dns/internal/app/main.go deleted file mode 100644 index 39f9e4671..000000000 --- a/apps/dns/internal/app/main.go +++ /dev/null @@ -1,286 +0,0 @@ -package app - -import ( - "context" - "encoding/json" - "fmt" - "github.com/codingconcepts/env" - "github.com/gofiber/fiber/v2" - "google.golang.org/grpc" - "kloudlite.io/constants" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/console" - kldns "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/dns" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/finance" - "math/rand" - "net" - "strings" - - "github.com/miekg/dns" - "go.uber.org/fx" - "kloudlite.io/apps/dns/internal/app/graph" - "kloudlite.io/apps/dns/internal/app/graph/generated" - "kloudlite.io/apps/dns/internal/domain" - "kloudlite.io/common" - "kloudlite.io/pkg/cache" - "kloudlite.io/pkg/config" - httpServer "kloudlite.io/pkg/http-server" - "kloudlite.io/pkg/repos" -) - -type Env struct { - CookieDomain string `env:"COOKIE_DOMAIN"` - EdgeCnameBaseDomain string `env:"EDGE_CNAME_BASE_DOMAIN" required:"true"` - DNSDomainNames string `env:"DNS_DOMAIN_NAMES" required:"true"` -} - -type DNSHandler struct { - domain domain.Domain - EdgeCnameBaseDomain string - dnsDomainNames []string -} - -func (h *DNSHandler) ServeDNS(w dns.ResponseWriter, r *dns.Msg) { - var e Env - if err := env.Set(&e); err == nil { - h.EdgeCnameBaseDomain = e.EdgeCnameBaseDomain - } - msg := dns.Msg{} - msg.SetReply(r) - msg.Answer = []dns.RR{} - for _, q := range r.Question { - switch q.Qtype { - case dns.TypeNS: - for _, name := range h.dnsDomainNames { - rr := &dns.NS{ - Hdr: dns.RR_Header{ - Name: q.Name, - Rrtype: dns.TypeNS, - Class: q.Qclass, - Ttl: 60, - }, - Ns: fmt.Sprintf("%s.", name), - } - msg.Answer = append(msg.Answer, rr) - } - case dns.TypeA: - msg.Authoritative = true - d := q.Name - todo := context.TODO() - host := strings.ToLower(d[:len(d)-1]) - - if strings.HasSuffix(host, h.EdgeCnameBaseDomain) { - splits := strings.Split(host, h.EdgeCnameBaseDomain) - queryPart := splits[0] - querySplits := strings.Split(queryPart, ".") - var ips []string - var err error - if len(querySplits) == 4 { - regionPart := querySplits[0] - accountPart := querySplits[1] - clusterPart := querySplits[2] - ips, err = h.domain.GetNodeIps(todo, ®ionPart, &accountPart, clusterPart) - if err != nil { - fmt.Println(err) - continue - } - } else if len(querySplits) == 3 { - accountPart := querySplits[0] - clusterPart := querySplits[1] - ips, err = h.domain.GetNodeIps(todo, nil, &accountPart, clusterPart) - if err != nil { - fmt.Println(err) - continue - } - } else { - clusterPart := querySplits[0] - ips, err = h.domain.GetNodeIps(todo, nil, nil, clusterPart) - if err != nil { - fmt.Println(err) - continue - } - } - - //ips, err := h.domain.GetNodeIps(todo, nil) - if len(ips) == 0 { - msg.Answer = append(msg.Answer, &dns.A{ - Hdr: dns.RR_Header{Name: d, Rrtype: dns.TypeA, Class: dns.ClassINET}, - }) - } - for _, ip := range ips { - msg.Answer = append(msg.Answer, &dns.A{ - Hdr: dns.RR_Header{Name: d, Rrtype: dns.TypeA, Class: dns.ClassINET, Ttl: 300}, - A: net.ParseIP(ip), - }, - ) - } - } else { - record, err := h.domain.GetRecord(todo, host) - if err != nil || record == nil { - msg.Answer = append(msg.Answer, &dns.A{ - Hdr: dns.RR_Header{Name: d, Rrtype: dns.TypeA, Class: dns.ClassINET}, - }) - } else { - rand.Shuffle(len(record.Answers), func(i, j int) { - record.Answers[i], record.Answers[j] = record.Answers[j], record.Answers[i] - }) - - for _, a := range record.Answers { - msg.Answer = append(msg.Answer, &dns.A{ - Hdr: dns.RR_Header{Name: d, Rrtype: dns.TypeA, Class: dns.ClassINET, Ttl: uint32(30)}, - A: net.ParseIP(a), - }, - ) - } - } - } - } - } - - err := w.WriteMsg(&msg) - if err != nil { - fmt.Println(err) - } - fmt.Println("HERE3", msg.Answer) -} - -type ConsoleClientConnection *grpc.ClientConn -type FinanceClientConnection *grpc.ClientConn - -var Module = fx.Module( - "app", - config.EnvFx[Env](), - repos.NewFxMongoRepo[*domain.Record]("records", "rec", domain.RecordIndexes), - repos.NewFxMongoRepo[*domain.Site]("sites", "site", domain.SiteIndexes), - repos.NewFxMongoRepo[*domain.AccountCName]("account_cnames", "dns", domain.AccountCNameIndexes), - repos.NewFxMongoRepo[*domain.RegionCName]("region_cnames", "dns", domain.RegionCNameIndexes), - repos.NewFxMongoRepo[*domain.NodeIps]("node_ips", "nips", domain.NodeIpIndexes), - cache.NewFxRepo[[]*domain.Record](), - domain.Module, - - fx.Provide(func(conn ConsoleClientConnection) console.ConsoleClient { - return console.NewConsoleClient((*grpc.ClientConn)(conn)) - }), - - fx.Provide(func(conn FinanceClientConnection) finance.FinanceClient { - return finance.NewFinanceClient((*grpc.ClientConn)(conn)) - }), - - fx.Invoke(func(lifecycle fx.Lifecycle, s *dns.Server, d domain.Domain, recCache cache.Repo[[]*domain.Record], env *Env) { - lifecycle.Append(fx.Hook{ - OnStart: func(ctx context.Context) error { - s.Handler = &DNSHandler{ - domain: d, - dnsDomainNames: strings.Split(env.DNSDomainNames, ","), - } - return nil - }, - }) - }), - fx.Provide(fxDNSGrpcServer), - fx.Invoke(func(server *grpc.Server, dnsServer kldns.DNSServer) { - kldns.RegisterDNSServer(server, dnsServer) - }), - fx.Invoke(func( - server *fiber.App, - d domain.Domain, - env *Env, - cacheClient cache.Client, - ) { - schema := generated.NewExecutableSchema( - generated.Config{Resolvers: graph.NewResolver(d)}, - ) - - server.Post("/upsert-domain", func(c *fiber.Ctx) error { - var data struct { - Domain string - ARecords []string - } - err := json.Unmarshal(c.Body(), &data) - if err != nil { - return err - } - err = d.UpsertARecords(c.Context(), data.Domain, data.ARecords) - if err != nil { - return err - } - c.Send([]byte("done")) - return nil - - }) - - server.Post("/upsert-node-ips", func(c *fiber.Ctx) error { - var regionIps struct { - RegionId string `json:"region"` - Cluster string `json:"cluster"` - AccountId string `json:"account"` - Ips []string `json:"ips"` - } - - err := json.Unmarshal(c.Body(), ®ionIps) - if err != nil { - return err - } - done := d.UpdateNodeIPs( - c.Context(), - regionIps.RegionId, - regionIps.AccountId, - regionIps.Cluster, - regionIps.Ips, - ) - if !done { - return fmt.Errorf("failed to update node ips") - } - c.Send([]byte("done")) - return nil - }) - - server.Get("/get-records/:domain_name", func(c *fiber.Ctx) error { - domainName := c.Params("domain_name") - record, err := d.GetRecord(c.Context(), domainName) - if err != nil { - return err - } - r, err := json.Marshal(record) - if err != nil { - return err - } - c.Send(r) - return nil - }) - - server.Get("/get-region-domain/:accountId/:regionId", func(c *fiber.Ctx) error { - accountId := c.Params("accountId") - regionId := c.Params("regionId") - s, err := d.GetAccountEdgeCName(c.Context(), accountId, repos.ID(regionId)) - if err != nil { - return err - } - c.Send([]byte(s)) - return nil - }) - - server.Delete("/delete-domain/:domain_name", func(c *fiber.Ctx) error { - domainName := c.Params("domain_name") - - err := d.DeleteRecords(c.Context(), domainName) - - if err != nil { - return err - } - - c.Send([]byte("done")) - return nil - }) - - httpServer.SetupGQLServer( - server, - schema, - httpServer.NewSessionMiddleware[*common.AuthSession]( - cacheClient, - constants.CookieName, - env.CookieDomain, - constants.CacheSessionPrefix, - ), - ) - }), -) diff --git a/apps/dns/internal/domain/data.go b/apps/dns/internal/domain/data.go deleted file mode 100644 index f6ba9461e..000000000 --- a/apps/dns/internal/domain/data.go +++ /dev/null @@ -1,2879 +0,0 @@ -package domain - -var ADJECTIVES = []string{ - "abandoned", - "able", - "absolute", - "adorable", - "adventurous", - "academic", - "acceptable", - "acclaimed", - "accomplished", - "accurate", - "aching", - "acidic", - "acrobatic", - "active", - "actual", - "adept", - "admirable", - "admired", - "adolescent", - "adorable", - "adored", - "advanced", - "afraid", - "affectionate", - "aged", - "aggravating", - "aggressive", - "agile", - "agitated", - "agonizing", - "agreeable", - "ajar", - "alarmed", - "alarming", - "alert", - "alienated", - "alive", - "all", - "altruistic", - "amazing", - "ambitious", - "ample", - "amused", - "amusing", - "anchored", - "ancient", - "angelic", - "angry", - "anguished", - "animated", - "annual", - "another", - "antique", - "anxious", - "any", - "apprehensive", - "appropriate", - "apt", - "arctic", - "arid", - "aromatic", - "artistic", - "ashamed", - "assured", - "astonishing", - "athletic", - "attached", - "attentive", - "attractive", - "austere", - "authentic", - "authorized", - "automatic", - "avaricious", - "average", - "aware", - "awesome", - "awful", - "awkward", - "babyish", - "bad", - "back", - "baggy", - "bare", - "barren", - "basic", - "beautiful", - "belated", - "beloved", - "beneficial", - "better", - "best", - "bewitched", - "big", - "big-hearted", - "biodegradable", - "bite-sized", - "bitter", - "black", - "black-and-white", - "bland", - "blank", - "blaring", - "bleak", - "blind", - "blissful", - "blond", - "blue", - "blushing", - "bogus", - "boiling", - "bold", - "bony", - "boring", - "bossy", - "both", - "bouncy", - "bountiful", - "bowed", - "brave", - "breakable", - "brief", - "bright", - "brilliant", - "brisk", - "broken", - "bronze", - "brown", - "bruised", - "bubbly", - "bulky", - "bumpy", - "buoyant", - "burdensome", - "burly", - "bustling", - "busy", - "buttery", - "buzzing", - "calculating", - "calm", - "candid", - "canine", - "capital", - "carefree", - "careful", - "careless", - "caring", - "cautious", - "cavernous", - "celebrated", - "charming", - "cheap", - "cheerful", - "cheery", - "chief", - "chilly", - "chubby", - "circular", - "classic", - "clean", - "clear", - "clear-cut", - "clever", - "close", - "closed", - "cloudy", - "clueless", - "clumsy", - "cluttered", - "coarse", - "cold", - "colorful", - "colorless", - "colossal", - "comfortable", - "common", - "compassionate", - "competent", - "complete", - "complex", - "complicated", - "composed", - "concerned", - "concrete", - "confused", - "conscious", - "considerate", - "constant", - "content", - "conventional", - "cooked", - "cool", - "cooperative", - "coordinated", - "corny", - "corrupt", - "costly", - "courageous", - "courteous", - "crafty", - "crazy", - "creamy", - "creative", - "creepy", - "criminal", - "crisp", - "critical", - "crooked", - "crowded", - "cruel", - "crushing", - "cuddly", - "cultivated", - "cultured", - "cumbersome", - "curly", - "curvy", - "cute", - "cylindrical", - "damaged", - "damp", - "dangerous", - "dapper", - "daring", - "darling", - "dark", - "dazzling", - "dead", - "deadly", - "deafening", - "dear", - "dearest", - "decent", - "decimal", - "decisive", - "deep", - "defenseless", - "defensive", - "defiant", - "deficient", - "definite", - "definitive", - "delayed", - "delectable", - "delicious", - "delightful", - "delirious", - "demanding", - "dense", - "dental", - "dependable", - "dependent", - "descriptive", - "deserted", - "detailed", - "determined", - "devoted", - "different", - "difficult", - "digital", - "diligent", - "dim", - "dimpled", - "dimwitted", - "direct", - "disastrous", - "discrete", - "disfigured", - "disgusting", - "disloyal", - "dismal", - "distant", - "downright", - "dreary", - "dirty", - "disguised", - "dishonest", - "dismal", - "distant", - "distinct", - "distorted", - "dizzy", - "dopey", - "doting", - "double", - "downright", - "drab", - "drafty", - "dramatic", - "dreary", - "droopy", - "dry", - "dual", - "dull", - "dutiful", - "each", - "eager", - "earnest", - "early", - "easy", - "easy-going", - "ecstatic", - "edible", - "educated", - "elaborate", - "elastic", - "elated", - "elderly", - "electric", - "elegant", - "elementary", - "elliptical", - "embarrassed", - "embellished", - "eminent", - "emotional", - "empty", - "enchanted", - "enchanting", - "energetic", - "enlightened", - "enormous", - "enraged", - "entire", - "envious", - "equal", - "equatorial", - "essential", - "esteemed", - "ethical", - "euphoric", - "even", - "evergreen", - "everlasting", - "every", - "evil", - "exalted", - "excellent", - "exemplary", - "exhausted", - "excitable", - "excited", - "exciting", - "exotic", - "expensive", - "experienced", - "expert", - "extraneous", - "extroverted", - "extra-large", - "extra-small", - "fabulous", - "failing", - "faint", - "fair", - "faithful", - "fake", - "false", - "familiar", - "famous", - "fancy", - "fantastic", - "far", - "faraway", - "far-flung", - "far-off", - "fast", - "fat", - "fatal", - "fatherly", - "favorable", - "favorite", - "fearful", - "fearless", - "feisty", - "feline", - "female", - "feminine", - "few", - "fickle", - "filthy", - "fine", - "finished", - "firm", - "first", - "firsthand", - "fitting", - "fixed", - "flaky", - "flamboyant", - "flashy", - "flat", - "flawed", - "flawless", - "flickering", - "flimsy", - "flippant", - "flowery", - "fluffy", - "fluid", - "flustered", - "focused", - "fond", - "foolhardy", - "foolish", - "forceful", - "forked", - "formal", - "forsaken", - "forthright", - "fortunate", - "fragrant", - "frail", - "frank", - "frayed", - "free", - "French", - "fresh", - "frequent", - "friendly", - "frightened", - "frightening", - "frigid", - "frilly", - "frizzy", - "frivolous", - "front", - "frosty", - "frozen", - "frugal", - "fruitful", - "full", - "fumbling", - "functional", - "funny", - "fussy", - "fuzzy", - "gargantuan", - "gaseous", - "general", - "generous", - "gentle", - "genuine", - "giant", - "giddy", - "gigantic", - "gifted", - "giving", - "glamorous", - "glaring", - "glass", - "gleaming", - "gleeful", - "glistening", - "glittering", - "gloomy", - "glorious", - "glossy", - "glum", - "golden", - "good", - "good-natured", - "gorgeous", - "graceful", - "gracious", - "grand", - "grandiose", - "granular", - "grateful", - "grave", - "gray", - "great", - "greedy", - "green", - "gregarious", - "grim", - "grimy", - "gripping", - "grizzled", - "gross", - "grotesque", - "grouchy", - "grounded", - "growing", - "growling", - "grown", - "grubby", - "gruesome", - "grumpy", - "guilty", - "gullible", - "gummy", - "hairy", - "half", - "handmade", - "handsome", - "handy", - "happy", - "happy-go-lucky", - "hard", - "hard-to-find", - "harmful", - "harmless", - "harmonious", - "harsh", - "hasty", - "hateful", - "haunting", - "healthy", - "heartfelt", - "hearty", - "heavenly", - "heavy", - "hefty", - "helpful", - "helpless", - "hidden", - "hideous", - "high", - "high-level", - "hilarious", - "hoarse", - "hollow", - "homely", - "honest", - "honorable", - "honored", - "hopeful", - "horrible", - "hospitable", - "hot", - "huge", - "humble", - "humiliating", - "humming", - "humongous", - "hungry", - "hurtful", - "husky", - "icky", - "icy", - "ideal", - "idealistic", - "identical", - "idle", - "idiotic", - "idolized", - "ignorant", - "ill", - "illegal", - "ill-fated", - "ill-informed", - "illiterate", - "illustrious", - "imaginary", - "imaginative", - "immaculate", - "immaterial", - "immediate", - "immense", - "impassioned", - "impeccable", - "impartial", - "imperfect", - "imperturbable", - "impish", - "impolite", - "important", - "impossible", - "impractical", - "impressionable", - "impressive", - "improbable", - "impure", - "inborn", - "incomparable", - "incompatible", - "incomplete", - "inconsequential", - "incredible", - "indelible", - "inexperienced", - "indolent", - "infamous", - "infantile", - "infatuated", - "inferior", - "infinite", - "informal", - "innocent", - "insecure", - "insidious", - "insignificant", - "insistent", - "instructive", - "insubstantial", - "intelligent", - "intent", - "intentional", - "interesting", - "internal", - "international", - "intrepid", - "ironclad", - "irresponsible", - "irritating", - "itchy", - "jaded", - "jagged", - "jam-packed", - "jaunty", - "jealous", - "jittery", - "joint", - "jolly", - "jovial", - "joyful", - "joyous", - "jubilant", - "judicious", - "juicy", - "jumbo", - "junior", - "jumpy", - "juvenile", - "kaleidoscopic", - "keen", - "key", - "kind", - "kindhearted", - "kindly", - "klutzy", - "knobby", - "knotty", - "knowledgeable", - "knowing", - "known", - "kooky", - "kosher", - "lame", - "lanky", - "large", - "last", - "lasting", - "late", - "lavish", - "lawful", - "lazy", - "leading", - "lean", - "leafy", - "left", - "legal", - "legitimate", - "light", - "lighthearted", - "likable", - "likely", - "limited", - "limp", - "limping", - "linear", - "lined", - "liquid", - "little", - "live", - "lively", - "livid", - "loathsome", - "lone", - "lonely", - "long", - "long-term", - "loose", - "lopsided", - "lost", - "loud", - "lovable", - "lovely", - "loving", - "low", - "loyal", - "lucky", - "lumbering", - "luminous", - "lumpy", - "lustrous", - "luxurious", - "mad", - "made-up", - "magnificent", - "majestic", - "major", - "male", - "mammoth", - "married", - "marvelous", - "masculine", - "massive", - "mature", - "meager", - "mealy", - "mean", - "measly", - "meaty", - "medical", - "mediocre", - "medium", - "meek", - "mellow", - "melodic", - "memorable", - "menacing", - "merry", - "messy", - "metallic", - "mild", - "milky", - "mindless", - "miniature", - "minor", - "minty", - "miserable", - "miserly", - "misguided", - "misty", - "mixed", - "modern", - "modest", - "moist", - "monstrous", - "monthly", - "monumental", - "moral", - "mortified", - "motherly", - "motionless", - "mountainous", - "muddy", - "muffled", - "multicolored", - "mundane", - "murky", - "mushy", - "musty", - "muted", - "mysterious", - "naive", - "narrow", - "nasty", - "natural", - "naughty", - "nautical", - "near", - "neat", - "necessary", - "needy", - "negative", - "neglected", - "negligible", - "neighboring", - "nervous", - "new", - "next", - "nice", - "nifty", - "nimble", - "nippy", - "nocturnal", - "noisy", - "nonstop", - "normal", - "notable", - "noted", - "noteworthy", - "novel", - "noxious", - "numb", - "nutritious", - "nutty", - "obedient", - "obese", - "oblong", - "oily", - "oblong", - "obvious", - "occasional", - "odd", - "oddball", - "offbeat", - "offensive", - "official", - "old", - "old-fashioned", - "only", - "open", - "optimal", - "optimistic", - "opulent", - "orange", - "orderly", - "organic", - "ornate", - "ornery", - "ordinary", - "original", - "other", - "our", - "outlying", - "outgoing", - "outlandish", - "outrageous", - "outstanding", - "oval", - "overcooked", - "overdue", - "overjoyed", - "overlooked", - "palatable", - "pale", - "paltry", - "parallel", - "parched", - "partial", - "passionate", - "past", - "pastel", - "peaceful", - "peppery", - "perfect", - "perfumed", - "periodic", - "perky", - "personal", - "pertinent", - "pesky", - "pessimistic", - "petty", - "phony", - "physical", - "piercing", - "pink", - "pitiful", - "plain", - "plaintive", - "plastic", - "playful", - "pleasant", - "pleased", - "pleasing", - "plump", - "plush", - "polished", - "polite", - "political", - "pointed", - "pointless", - "poised", - "poor", - "popular", - "portly", - "posh", - "positive", - "possible", - "potable", - "powerful", - "powerless", - "practical", - "precious", - "present", - "prestigious", - "pretty", - "precious", - "previous", - "pricey", - "prickly", - "primary", - "prime", - "pristine", - "private", - "prize", - "probable", - "productive", - "profitable", - "profuse", - "proper", - "proud", - "prudent", - "punctual", - "pungent", - "puny", - "pure", - "purple", - "pushy", - "putrid", - "puzzled", - "puzzling", - "quaint", - "qualified", - "quarrelsome", - "quarterly", - "queasy", - "querulous", - "questionable", - "quick", - "quick-witted", - "quiet", - "quintessential", - "quirky", - "quixotic", - "quizzical", - "radiant", - "ragged", - "rapid", - "rare", - "rash", - "raw", - "recent", - "reckless", - "rectangular", - "ready", - "real", - "realistic", - "reasonable", - "red", - "reflecting", - "regal", - "regular", - "reliable", - "relieved", - "remarkable", - "remorseful", - "remote", - "repentant", - "required", - "respectful", - "responsible", - "repulsive", - "revolving", - "rewarding", - "rich", - "rigid", - "right", - "ringed", - "ripe", - "roasted", - "robust", - "rosy", - "rotating", - "rotten", - "rough", - "round", - "rowdy", - "royal", - "rubbery", - "rundown", - "ruddy", - "rude", - "runny", - "rural", - "rusty", - "sad", - "safe", - "salty", - "same", - "sandy", - "sane", - "sarcastic", - "sardonic", - "satisfied", - "scaly", - "scarce", - "scared", - "scary", - "scented", - "scholarly", - "scientific", - "scornful", - "scratchy", - "scrawny", - "second", - "secondary", - "second-hand", - "secret", - "self-assured", - "self-reliant", - "selfish", - "sentimental", - "separate", - "serene", - "serious", - "serpentine", - "several", - "severe", - "shabby", - "shadowy", - "shady", - "shallow", - "shameful", - "shameless", - "sharp", - "shimmering", - "shiny", - "shocked", - "shocking", - "shoddy", - "short", - "short-term", - "showy", - "shrill", - "shy", - "sick", - "silent", - "silky", - "silly", - "silver", - "similar", - "simple", - "simplistic", - "sinful", - "single", - "sizzling", - "skeletal", - "skinny", - "sleepy", - "slight", - "slim", - "slimy", - "slippery", - "slow", - "slushy", - "small", - "smart", - "smoggy", - "smooth", - "smug", - "snappy", - "snarling", - "sneaky", - "sniveling", - "snoopy", - "sociable", - "soft", - "soggy", - "solid", - "somber", - "some", - "spherical", - "sophisticated", - "sore", - "sorrowful", - "soulful", - "soupy", - "sour", - "Spanish", - "sparkling", - "sparse", - "specific", - "spectacular", - "speedy", - "spicy", - "spiffy", - "spirited", - "spiteful", - "splendid", - "spotless", - "spotted", - "spry", - "square", - "squeaky", - "squiggly", - "stable", - "staid", - "stained", - "stale", - "standard", - "starchy", - "stark", - "starry", - "steep", - "sticky", - "stiff", - "stimulating", - "stingy", - "stormy", - "straight", - "strange", - "steel", - "strict", - "strident", - "striking", - "striped", - "strong", - "studious", - "stunning", - "stupendous", - "stupid", - "sturdy", - "stylish", - "subdued", - "submissive", - "substantial", - "subtle", - "suburban", - "sudden", - "sugary", - "sunny", - "super", - "superb", - "superficial", - "superior", - "supportive", - "sure-footed", - "surprised", - "suspicious", - "svelte", - "sweaty", - "sweet", - "sweltering", - "swift", - "sympathetic", - "tall", - "talkative", - "tame", - "tan", - "tangible", - "tart", - "tasty", - "tattered", - "taut", - "tedious", - "teeming", - "tempting", - "tender", - "tense", - "tepid", - "terrible", - "terrific", - "testy", - "thankful", - "that", - "these", - "thick", - "thin", - "third", - "thirsty", - "this", - "thorough", - "thorny", - "those", - "thoughtful", - "threadbare", - "thrifty", - "thunderous", - "tidy", - "tight", - "timely", - "tinted", - "tiny", - "tired", - "torn", - "total", - "tough", - "traumatic", - "treasured", - "tremendous", - "tragic", - "trained", - "tremendous", - "triangular", - "tricky", - "trifling", - "trim", - "trivial", - "troubled", - "true", - "trusting", - "trustworthy", - "trusty", - "truthful", - "tubby", - "turbulent", - "twin", - "ugly", - "ultimate", - "unacceptable", - "unaware", - "uncomfortable", - "uncommon", - "unconscious", - "understated", - "unequaled", - "uneven", - "unfinished", - "unfit", - "unfolded", - "unfortunate", - "unhappy", - "unhealthy", - "uniform", - "unimportant", - "unique", - "united", - "unkempt", - "unknown", - "unlawful", - "unlined", - "unlucky", - "unnatural", - "unpleasant", - "unrealistic", - "unripe", - "unruly", - "unselfish", - "unsightly", - "unsteady", - "unsung", - "untidy", - "untimely", - "untried", - "untrue", - "unused", - "unusual", - "unwelcome", - "unwieldy", - "unwilling", - "unwitting", - "unwritten", - "upbeat", - "upright", - "upset", - "urban", - "usable", - "used", - "useful", - "useless", - "utilized", - "utter", - "vacant", - "vague", - "vain", - "valid", - "valuable", - "vapid", - "variable", - "vast", - "velvety", - "venerated", - "vengeful", - "verifiable", - "vibrant", - "vicious", - "victorious", - "vigilant", - "vigorous", - "villainous", - "violet", - "violent", - "virtual", - "virtuous", - "visible", - "vital", - "vivacious", - "vivid", - "voluminous", - "wan", - "warlike", - "warm", - "warmhearted", - "warped", - "wary", - "wasteful", - "watchful", - "waterlogged", - "watery", - "wavy", - "wealthy", - "weak", - "weary", - "webbed", - "wee", - "weekly", - "weepy", - "weighty", - "weird", - "welcome", - "well-documented", - "well-groomed", - "well-informed", - "well-lit", - "well-made", - "well-off", - "well-to-do", - "well-worn", - "wet", - "which", - "whimsical", - "whirlwind", - "whispered", - "white", - "whole", - "whopping", - "wicked", - "wide", - "wide-eyed", - "wiggly", - "wild", - "willing", - "wilted", - "winding", - "windy", - "winged", - "wiry", - "wise", - "witty", - "wobbly", - "woeful", - "wonderful", - "wooden", - "woozy", - "wordy", - "worldly", - "worn", - "worried", - "worrisome", - "worse", - "worst", - "worthless", - "worthwhile", - "worthy", - "wrathful", - "wretched", - "writhing", - "wrong", - "wry", - "yawning", - "yearly", - "yellow", - "yellowish", - "young", - "youthful", - "yummy", - "zany", - "zealous", - "zesty", - "zigzag", -} - -var NOUNS = []string{ - "people", - "history", - "way", - "art", - "world", - "information", - "map", - "two", - "family", - "government", - "health", - "system", - "computer", - "meat", - "year", - "thanks", - "music", - "person", - "reading", - "method", - "data", - "food", - "understanding", - "theory", - "law", - "bird", - "literature", - "problem", - "software", - "control", - "knowledge", - "power", - "ability", - "economics", - "love", - "internet", - "television", - "science", - "library", - "nature", - "fact", - "product", - "idea", - "temperature", - "investment", - "area", - "society", - "activity", - "story", - "industry", - "media", - "thing", - "oven", - "community", - "definition", - "safety", - "quality", - "development", - "language", - "management", - "player", - "variety", - "video", - "week", - "security", - "country", - "exam", - "movie", - "organization", - "equipment", - "physics", - "analysis", - "policy", - "series", - "thought", - "basis", - "boyfriend", - "direction", - "strategy", - "technology", - "army", - "camera", - "freedom", - "paper", - "environment", - "child", - "instance", - "month", - "truth", - "marketing", - "university", - "writing", - "article", - "department", - "difference", - "goal", - "news", - "audience", - "fishing", - "growth", - "income", - "marriage", - "user", - "combination", - "failure", - "meaning", - "medicine", - "philosophy", - "teacher", - "communication", - "night", - "chemistry", - "disease", - "disk", - "energy", - "nation", - "road", - "role", - "soup", - "advertising", - "location", - "success", - "addition", - "apartment", - "education", - "math", - "moment", - "painting", - "politics", - "attention", - "decision", - "event", - "property", - "shopping", - "student", - "wood", - "competition", - "distribution", - "entertainment", - "office", - "population", - "president", - "unit", - "category", - "cigarette", - "context", - "introduction", - "opportunity", - "performance", - "driver", - "flight", - "length", - "magazine", - "newspaper", - "relationship", - "teaching", - "cell", - "dealer", - "finding", - "lake", - "member", - "message", - "phone", - "scene", - "appearance", - "association", - "concept", - "customer", - "death", - "discussion", - "housing", - "inflation", - "insurance", - "mood", - "woman", - "advice", - "blood", - "effort", - "expression", - "importance", - "opinion", - "payment", - "reality", - "responsibility", - "situation", - "skill", - "statement", - "wealth", - "application", - "city", - "county", - "depth", - "estate", - "foundation", - "grandmother", - "heart", - "perspective", - "photo", - "recipe", - "studio", - "topic", - "collection", - "depression", - "imagination", - "passion", - "percentage", - "resource", - "setting", - "ad", - "agency", - "college", - "connection", - "criticism", - "debt", - "description", - "memory", - "patience", - "secretary", - "solution", - "administration", - "aspect", - "attitude", - "director", - "personality", - "psychology", - "recommendation", - "response", - "selection", - "storage", - "version", - "alcohol", - "argument", - "complaint", - "contract", - "emphasis", - "highway", - "loss", - "membership", - "possession", - "preparation", - "steak", - "union", - "agreement", - "cancer", - "currency", - "employment", - "engineering", - "entry", - "interaction", - "mixture", - "preference", - "region", - "republic", - "tradition", - "virus", - "actor", - "classroom", - "delivery", - "device", - "difficulty", - "drama", - "election", - "engine", - "football", - "guidance", - "hotel", - "owner", - "priority", - "protection", - "suggestion", - "tension", - "variation", - "anxiety", - "atmosphere", - "awareness", - "bath", - "bread", - "candidate", - "climate", - "comparison", - "confusion", - "construction", - "elevator", - "emotion", - "employee", - "employer", - "guest", - "height", - "leadership", - "mall", - "manager", - "operation", - "recording", - "sample", - "transportation", - "charity", - "cousin", - "disaster", - "editor", - "efficiency", - "excitement", - "extent", - "feedback", - "guitar", - "homework", - "leader", - "mom", - "outcome", - "permission", - "presentation", - "promotion", - "reflection", - "refrigerator", - "resolution", - "revenue", - "session", - "singer", - "tennis", - "basket", - "bonus", - "cabinet", - "childhood", - "church", - "clothes", - "coffee", - "dinner", - "drawing", - "hair", - "hearing", - "initiative", - "judgment", - "lab", - "measurement", - "mode", - "mud", - "orange", - "poetry", - "police", - "possibility", - "procedure", - "queen", - "ratio", - "relation", - "restaurant", - "satisfaction", - "sector", - "signature", - "significance", - "song", - "tooth", - "town", - "vehicle", - "volume", - "wife", - "accident", - "airport", - "appointment", - "arrival", - "assumption", - "baseball", - "chapter", - "committee", - "conversation", - "database", - "enthusiasm", - "error", - "explanation", - "farmer", - "gate", - "girl", - "hall", - "historian", - "hospital", - "injury", - "instruction", - "maintenance", - "manufacturer", - "meal", - "perception", - "pie", - "poem", - "presence", - "proposal", - "reception", - "replacement", - "revolution", - "river", - "son", - "speech", - "tea", - "village", - "warning", - "winner", - "worker", - "writer", - "assistance", - "breath", - "buyer", - "chest", - "chocolate", - "conclusion", - "contribution", - "cookie", - "courage", - "dad", - "desk", - "drawer", - "establishment", - "examination", - "garbage", - "grocery", - "honey", - "impression", - "improvement", - "independence", - "insect", - "inspection", - "inspector", - "king", - "ladder", - "menu", - "penalty", - "piano", - "potato", - "profession", - "professor", - "quantity", - "reaction", - "requirement", - "salad", - "sister", - "supermarket", - "tongue", - "weakness", - "wedding", - "affair", - "ambition", - "analyst", - "apple", - "assignment", - "assistant", - "bathroom", - "bedroom", - "beer", - "birthday", - "celebration", - "championship", - "cheek", - "client", - "consequence", - "departure", - "diamond", - "dirt", - "ear", - "fortune", - "friendship", - "funeral", - "gene", - "girlfriend", - "hat", - "indication", - "intention", - "lady", - "midnight", - "negotiation", - "obligation", - "passenger", - "pizza", - "platform", - "poet", - "pollution", - "recognition", - "reputation", - "shirt", - "sir", - "speaker", - "stranger", - "surgery", - "sympathy", - "tale", - "throat", - "trainer", - "uncle", - "youth", - "time", - "work", - "film", - "water", - "money", - "example", - "while", - "business", - "study", - "game", - "life", - "form", - "air", - "day", - "place", - "number", - "part", - "field", - "fish", - "back", - "process", - "heat", - "hand", - "experience", - "job", - "book", - "end", - "point", - "type", - "home", - "economy", - "value", - "body", - "market", - "guide", - "interest", - "state", - "radio", - "course", - "company", - "price", - "size", - "card", - "list", - "mind", - "trade", - "line", - "care", - "group", - "risk", - "word", - "fat", - "force", - "key", - "light", - "training", - "name", - "school", - "top", - "amount", - "level", - "order", - "practice", - "research", - "sense", - "service", - "piece", - "web", - "boss", - "sport", - "fun", - "house", - "page", - "term", - "test", - "answer", - "sound", - "focus", - "matter", - "kind", - "soil", - "board", - "oil", - "picture", - "access", - "garden", - "range", - "rate", - "reason", - "future", - "site", - "demand", - "exercise", - "image", - "case", - "cause", - "coast", - "action", - "age", - "bad", - "boat", - "record", - "result", - "section", - "building", - "mouse", - "cash", - "class", - "nothing", - "period", - "plan", - "store", - "tax", - "side", - "subject", - "space", - "rule", - "stock", - "weather", - "chance", - "figure", - "man", - "model", - "source", - "beginning", - "earth", - "program", - "chicken", - "design", - "feature", - "head", - "material", - "purpose", - "question", - "rock", - "salt", - "act", - "birth", - "car", - "dog", - "object", - "scale", - "sun", - "note", - "profit", - "rent", - "speed", - "style", - "war", - "bank", - "craft", - "half", - "inside", - "outside", - "standard", - "bus", - "exchange", - "eye", - "fire", - "position", - "pressure", - "stress", - "advantage", - "benefit", - "box", - "frame", - "issue", - "step", - "cycle", - "face", - "item", - "metal", - "paint", - "review", - "room", - "screen", - "structure", - "view", - "account", - "ball", - "discipline", - "medium", - "share", - "balance", - "bit", - "black", - "bottom", - "choice", - "gift", - "impact", - "machine", - "shape", - "tool", - "wind", - "address", - "average", - "career", - "culture", - "morning", - "pot", - "sign", - "table", - "task", - "condition", - "contact", - "credit", - "egg", - "hope", - "ice", - "network", - "north", - "square", - "attempt", - "date", - "effect", - "link", - "post", - "star", - "voice", - "capital", - "challenge", - "friend", - "self", - "shot", - "brush", - "couple", - "debate", - "exit", - "front", - "function", - "lack", - "living", - "plant", - "plastic", - "spot", - "summer", - "taste", - "theme", - "track", - "wing", - "brain", - "button", - "click", - "desire", - "foot", - "gas", - "influence", - "notice", - "rain", - "wall", - "base", - "damage", - "distance", - "feeling", - "pair", - "savings", - "staff", - "sugar", - "target", - "text", - "animal", - "author", - "budget", - "discount", - "file", - "ground", - "lesson", - "minute", - "officer", - "phase", - "reference", - "register", - "sky", - "stage", - "stick", - "title", - "trouble", - "bowl", - "bridge", - "campaign", - "character", - "club", - "edge", - "evidence", - "fan", - "letter", - "lock", - "maximum", - "novel", - "option", - "pack", - "park", - "plenty", - "quarter", - "skin", - "sort", - "weight", - "baby", - "background", - "carry", - "dish", - "factor", - "fruit", - "glass", - "joint", - "master", - "muscle", - "red", - "strength", - "traffic", - "trip", - "vegetable", - "appeal", - "chart", - "gear", - "ideal", - "kitchen", - "land", - "log", - "mother", - "net", - "party", - "principle", - "relative", - "sale", - "season", - "signal", - "spirit", - "street", - "tree", - "wave", - "belt", - "bench", - "commission", - "copy", - "drop", - "minimum", - "path", - "progress", - "project", - "sea", - "south", - "status", - "stuff", - "ticket", - "tour", - "angle", - "blue", - "breakfast", - "confidence", - "daughter", - "degree", - "doctor", - "dot", - "dream", - "duty", - "essay", - "father", - "fee", - "finance", - "hour", - "juice", - "limit", - "luck", - "milk", - "mouth", - "peace", - "pipe", - "seat", - "stable", - "storm", - "substance", - "team", - "trick", - "afternoon", - "bat", - "beach", - "blank", - "catch", - "chain", - "consideration", - "cream", - "crew", - "detail", - "gold", - "interview", - "kid", - "mark", - "match", - "mission", - "pain", - "pleasure", - "score", - "screw", - "sex", - "shop", - "shower", - "suit", - "tone", - "window", - "agent", - "band", - "block", - "bone", - "calendar", - "cap", - "coat", - "contest", - "corner", - "court", - "cup", - "district", - "door", - "east", - "finger", - "garage", - "guarantee", - "hole", - "hook", - "implement", - "layer", - "lecture", - "lie", - "manner", - "meeting", - "nose", - "parking", - "partner", - "profile", - "respect", - "rice", - "routine", - "schedule", - "swimming", - "telephone", - "tip", - "winter", - "airline", - "bag", - "battle", - "bed", - "bill", - "bother", - "cake", - "code", - "curve", - "designer", - "dimension", - "dress", - "ease", - "emergency", - "evening", - "extension", - "farm", - "fight", - "gap", - "grade", - "holiday", - "horror", - "horse", - "host", - "husband", - "loan", - "mistake", - "mountain", - "nail", - "noise", - "occasion", - "package", - "patient", - "pause", - "phrase", - "proof", - "race", - "relief", - "sand", - "sentence", - "shoulder", - "smoke", - "stomach", - "string", - "tourist", - "towel", - "vacation", - "west", - "wheel", - "wine", - "arm", - "aside", - "associate", - "bet", - "blow", - "border", - "branch", - "breast", - "brother", - "buddy", - "bunch", - "chip", - "coach", - "cross", - "document", - "draft", - "dust", - "expert", - "floor", - "god", - "golf", - "habit", - "iron", - "judge", - "knife", - "landscape", - "league", - "mail", - "mess", - "native", - "opening", - "parent", - "pattern", - "pin", - "pool", - "pound", - "request", - "salary", - "shame", - "shelter", - "shoe", - "silver", - "tackle", - "tank", - "trust", - "assist", - "bake", - "bar", - "bell", - "bike", - "blame", - "boy", - "brick", - "chair", - "closet", - "clue", - "collar", - "comment", - "conference", - "devil", - "diet", - "fear", - "fuel", - "glove", - "jacket", - "lunch", - "monitor", - "mortgage", - "nurse", - "pace", - "panic", - "peak", - "plane", - "reward", - "row", - "sandwich", - "shock", - "spite", - "spray", - "surprise", - "till", - "transition", - "weekend", - "welcome", - "yard", - "alarm", - "bend", - "bicycle", - "bite", - "blind", - "bottle", - "cable", - "candle", - "clerk", - "cloud", - "concert", - "counter", - "flower", - "grandfather", - "harm", - "knee", - "lawyer", - "leather", - "load", - "mirror", - "neck", - "pension", - "plate", - "purple", - "ruin", - "ship", - "skirt", - "slice", - "snow", - "specialist", - "stroke", - "switch", - "trash", - "tune", - "zone", - "anger", - "award", - "bid", - "bitter", - "boot", - "bug", - "camp", - "candy", - "carpet", - "cat", - "champion", - "channel", - "clock", - "comfort", - "cow", - "crack", - "engineer", - "entrance", - "fault", - "grass", - "guy", - "hell", - "highlight", - "incident", - "island", - "joke", - "jury", - "leg", - "lip", - "mate", - "motor", - "nerve", - "passage", - "pen", - "pride", - "priest", - "prize", - "promise", - "resident", - "resort", - "ring", - "roof", - "rope", - "sail", - "scheme", - "script", - "sock", - "station", - "toe", - "tower", - "truck", - "witness", - "a", - "you", - "it", - "can", - "will", - "if", - "one", - "many", - "most", - "other", - "use", - "make", - "good", - "look", - "help", - "go", - "great", - "being", - "few", - "might", - "still", - "public", - "read", - "keep", - "start", - "give", - "human", - "local", - "general", - "she", - "specific", - "long", - "play", - "feel", - "high", - "tonight", - "put", - "common", - "set", - "change", - "simple", - "past", - "big", - "possible", - "particular", - "today", - "major", - "personal", - "current", - "national", - "cut", - "natural", - "physical", - "show", - "try", - "check", - "second", - "call", - "move", - "pay", - "let", - "increase", - "single", - "individual", - "turn", - "ask", - "buy", - "guard", - "hold", - "main", - "offer", - "potential", - "professional", - "international", - "travel", - "cook", - "alternative", - "following", - "special", - "working", - "whole", - "dance", - "excuse", - "cold", - "commercial", - "low", - "purchase", - "deal", - "primary", - "worth", - "fall", - "necessary", - "positive", - "produce", - "search", - "present", - "spend", - "talk", - "creative", - "tell", - "cost", - "drive", - "green", - "support", - "glad", - "remove", - "return", - "run", - "complex", - "due", - "effective", - "middle", - "regular", - "reserve", - "independent", - "leave", - "original", - "reach", - "rest", - "serve", - "watch", - "beautiful", - "charge", - "active", - "break", - "negative", - "safe", - "stay", - "visit", - "visual", - "affect", - "cover", - "report", - "rise", - "walk", - "white", - "beyond", - "junior", - "pick", - "unique", - "anything", - "classic", - "final", - "lift", - "mix", - "private", - "stop", - "teach", - "western", - "concern", - "familiar", - "fly", - "official", - "broad", - "comfortable", - "gain", - "maybe", - "rich", - "save", - "stand", - "young", - "fail", - "heavy", - "hello", - "lead", - "listen", - "valuable", - "worry", - "handle", - "leading", - "meet", - "release", - "sell", - "finish", - "normal", - "press", - "ride", - "secret", - "spread", - "spring", - "tough", - "wait", - "brown", - "deep", - "display", - "flow", - "hit", - "objective", - "shoot", - "touch", - "cancel", - "chemical", - "cry", - "dump", - "extreme", - "push", - "conflict", - "eat", - "fill", - "formal", - "jump", - "kick", - "opposite", - "pass", - "pitch", - "remote", - "total", - "treat", - "vast", - "abuse", - "beat", - "burn", - "deposit", - "print", - "raise", - "sleep", - "somewhere", - "advance", - "anywhere", - "consist", - "dark", - "double", - "draw", - "equal", - "fix", - "hire", - "internal", - "join", - "kill", - "sensitive", - "tap", - "win", - "attack", - "claim", - "constant", - "drag", - "drink", - "guess", - "minor", - "pull", - "raw", - "soft", - "solid", - "wear", - "weird", - "wonder", - "annual", - "count", - "dead", - "doubt", - "feed", - "forever", - "impress", - "nobody", - "repeat", - "round", - "sing", - "slide", - "strip", - "whereas", - "wish", - "combine", - "command", - "dig", - "divide", - "equivalent", - "hang", - "hunt", - "initial", - "march", - "mention", - "smell", - "spiritual", - "survey", - "tie", - "adult", - "brief", - "crazy", - "escape", - "gather", - "hate", - "prior", - "repair", - "rough", - "sad", - "scratch", - "sick", - "strike", - "employ", - "external", - "hurt", - "illegal", - "laugh", - "lay", - "mobile", - "nasty", - "ordinary", - "respond", - "royal", - "senior", - "split", - "strain", - "struggle", - "swim", - "train", - "upper", - "wash", - "yellow", - "convert", - "crash", - "dependent", - "fold", - "funny", - "grab", - "hide", - "miss", - "permit", - "quote", - "recover", - "resolve", - "roll", - "sink", - "slip", - "spare", - "suspect", - "sweet", - "swing", - "twist", - "upstairs", - "usual", - "abroad", - "brave", - "calm", - "concentrate", - "estimate", - "grand", - "male", - "mine", - "prompt", - "quiet", - "refuse", - "regret", - "reveal", - "rush", - "shake", - "shift", - "shine", - "steal", - "suck", - "surround", - "anybody", - "bear", - "brilliant", - "dare", - "dear", - "delay", - "drunk", - "female", - "hurry", - "inevitable", - "invite", - "kiss", - "neat", - "pop", - "punch", - "quit", - "reply", - "representative", - "resist", - "rip", - "rub", - "silly", - "smile", - "spell", - "stretch", - "stupid", - "tear", - "temporary", - "tomorrow", - "wake", - "wrap", - "yesterday", -} diff --git a/apps/dns/internal/domain/entity.go b/apps/dns/internal/domain/entity.go deleted file mode 100644 index 4b611398c..000000000 --- a/apps/dns/internal/domain/entity.go +++ /dev/null @@ -1,118 +0,0 @@ -package domain - -import "kloudlite.io/pkg/repos" - -type AccountCName struct { - repos.BaseEntity `bson:",inline"` - AccountId repos.ID `bson:"accountId" json:"accountId"` - CName string `bson:"cName" json:"cName"` -} - -type RegionCName struct { - repos.BaseEntity `bson:",inline"` - RegionId repos.ID `bson:"regionId" json:"regionId"` - CName string `bson:"cName" json:"cName"` - IsShared bool `bson:"isShared" json:"isShared"` -} - -type NodeIps struct { - repos.BaseEntity `bson:",inline"` - RegionPart string `bson:"regionPart" json:"regionPart"` - ClusterPart string `bson:"clusterPart" json:"clusterPart"` - AccountPart string `bson:"accountPart" json:"accountPart"` - Ips []string `bson:"ips"` -} - -type Site struct { - repos.BaseEntity `bson:",inline"` - AccountId repos.ID `bson:"accountId,omitempty" json:"accountId,omitempty"` - RegionId repos.ID `bson:"regionId,omitempty" json:"regionId,omitempty"` - Domain string `bson:"host,omitempty" json:"host,omitempty"` - Verified bool `bson:"verified,omitempty" json:"verified,omitempty"` -} - -type Record struct { - repos.BaseEntity `bson:",inline"` - Host string `bson:"host,omitempty" json:"host,omitempty"` - Answers []string `bson:"answers,omitempty" json:"answers,omitempty"` -} - -var RecordIndexes = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: "id", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "host", Value: repos.IndexAsc}, - {Key: "type", Value: repos.IndexAsc}, - {Key: "answer", Value: repos.IndexAsc}, - }, - Unique: true, - }, -} -var SiteIndexes = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: "id", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "domain", Value: repos.IndexAsc}, - }, - }, -} -var NodeIpIndexes = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: "id", Value: repos.IndexAsc}, - }, - Unique: true, - }, -} - -var RegionCNameIndexes = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: "id", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "regionId", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "cName", Value: repos.IndexAsc}, - }, - Unique: true, - }, -} - -var AccountCNameIndexes = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: "id", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "accountId", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "cName", Value: repos.IndexAsc}, - }, - Unique: true, - }, -} diff --git a/apps/dns/internal/domain/main.go b/apps/dns/internal/domain/main.go deleted file mode 100644 index e2819368c..000000000 --- a/apps/dns/internal/domain/main.go +++ /dev/null @@ -1,441 +0,0 @@ -package domain - -import ( - "context" - "fmt" - "go.uber.org/fx" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/console" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/finance" - "kloudlite.io/pkg/cache" - "kloudlite.io/pkg/config" - "kloudlite.io/pkg/errors" - "kloudlite.io/pkg/repos" - "math/rand" - "net" -) - -type domainI struct { - recordsRepo repos.DbRepo[*Record] - sitesRepo repos.DbRepo[*Site] - recordsCache cache.Repo[[]*Record] - accountCNamesRepo repos.DbRepo[*AccountCName] - regionCNamesRepo repos.DbRepo[*RegionCName] - nodeIpsRepo repos.DbRepo[*NodeIps] - env *Env - consoleClient console.ConsoleClient - financeClient finance.FinanceClient -} - -func (d *domainI) UpsertARecords(ctx context.Context, host string, records []string) error { - err := d.deleteRecords(ctx, host) - if err != nil { - return err - } - return d.addARecords(ctx, host, records) -} - -func (d *domainI) UpdateNodeIPs(ctx context.Context, regionId string, accountId string, clusterPart string, ips []string) bool { - accountCname, err := d.getAccountCName(ctx, accountId) - if err != nil { - return false - } - regionCname, err := d.getRegionCName(ctx, regionId) - if err != nil { - return false - } - one, err := d.nodeIpsRepo.FindOne(ctx, repos.Filter{ - "regionPart": regionCname, - "accountPart": accountCname, - "clusterPart": clusterPart, - }) - if err != nil { - return false - } - if one == nil { - _, err = d.nodeIpsRepo.Create(ctx, &NodeIps{ - RegionPart: regionCname, - AccountPart: accountCname, - ClusterPart: clusterPart, - Ips: ips, - }) - if err != nil { - return false - } - } else { - one.Ips = ips - _, err = d.nodeIpsRepo.UpdateById(ctx, one.Id, one) - if err != nil { - return false - } - } - return true -} - -func (d *domainI) GetNodeIps(ctx context.Context, - regionPart *string, accountPart *string, clusterPart string, -) ([]string, error) { - filter := repos.Filter{ - "clusterPart": clusterPart, - } - if regionPart != nil { - filter["regionPart"] = *regionPart - } - if accountPart != nil { - filter["accountPart"] = *accountPart - } - all, err := d.nodeIpsRepo.Find(ctx, repos.Query{ - Filter: filter, - }) - out := make([]string, 0) - for _, nodeIps := range all { - out = append(out, nodeIps.Ips...) - } - if len(out) == 0 && regionPart != nil { - result, e := d.regionCNamesRepo.FindOne(ctx, repos.Filter{ - "cName": regionPart, - }) - if e == nil && result != nil && result.IsShared { - filter := repos.Filter{ - "regionPart": regionPart, - } - all, e2 := d.nodeIpsRepo.Find(ctx, repos.Query{ - Filter: filter, - }) - if e2 == nil { - for _, nodeIps := range all { - out = append(out, nodeIps.Ips...) - } - } - } - } - return out, err -} - -func (d *domainI) DeleteSite(ctx context.Context, siteId repos.ID) error { - site, err := d.sitesRepo.FindById(ctx, siteId) - if err != nil { - return err - } - err = d.sitesRepo.DeleteById(ctx, siteId) - if err != nil { - return err - } - _, err = d.consoleClient.SetupAccount(ctx, &console.AccountSetupIn{ - AccountId: string(site.AccountId), - }) - if err != nil { - return err - } - return err -} - -func (d *domainI) GetSiteFromDomain(ctx context.Context, domain string) (*Site, error) { - one, err := d.sitesRepo.FindOne(ctx, repos.Filter{ - "host": domain, - }) - if err != nil { - return nil, err - } - if one == nil { - return nil, errors.New("site not found") - } - return one, nil -} - -func (d *domainI) GetSites(ctx context.Context, accountId string) ([]*Site, error) { - return d.sitesRepo.Find(ctx, repos.Query{ - Filter: repos.Filter{ - "accountId": accountId, - }, - }) -} - -func (d *domainI) GetVerifiedSites(ctx context.Context, accountId string) ([]*Site, error) { - return d.sitesRepo.Find(ctx, repos.Query{ - Filter: repos.Filter{ - "accountId": accountId, - "verified": true, - }, - }) -} - -func (d *domainI) CreateSite(ctx context.Context, domain string, accountId, regionId repos.ID) error { - one, err := d.sitesRepo.FindOne(ctx, repos.Filter{ - "host": domain, - "accountId": accountId, - }) - if err != nil { - return err - } - if one != nil { - return errors.New("site already exists") - } - if one == nil { - _, err = d.sitesRepo.Create(ctx, &Site{ - Domain: domain, - AccountId: accountId, - RegionId: regionId, - Verified: false, - }) - if err != nil { - return err - } - } - if err != nil { - return err - } - return nil -} - -func (d *domainI) VerifySite(ctx context.Context, siteId repos.ID) error { - site, err := d.sitesRepo.FindById(ctx, siteId) - if err != nil { - return err - } - if site == nil { - return errors.New("site not found") - } - if site.Verified { - return errors.New("site already verified") - } - - cname, err := net.LookupCNAME(site.Domain) - if err != nil { - return errors.New("Unable to verify CName. Please wait for a while and try again.") - } - - fmt.Println(site.Domain, cname) - accountCnameIdentity, err := d.getAccountCName(ctx, string(site.AccountId)) - if err != nil { - return err - } - - regionCnameIdentity, err := d.getRegionCName(ctx, string(site.RegionId)) - if err != nil { - return err - } - - accountId := string(site.AccountId) - - clusterId, err := d.getClusterFromAccount(ctx, err, accountId) - if err != nil { - return err - } - - if cname != fmt.Sprintf("%s.%s.%s.%s.", regionCnameIdentity, accountCnameIdentity, clusterId, d.env.EdgeCnameBaseDomain) { - return errors.New("cname does not match") - } - err = d.sitesRepo.UpdateMany(ctx, repos.Filter{ - "host": site.Domain, - }, map[string]any{ - "verified": false, - }) - if err != nil { - return err - } - site.Verified = true - _, err = d.sitesRepo.UpdateById(ctx, site.Id, site) - if err != nil { - return err - } - _, err = d.consoleClient.SetupAccount(ctx, &console.AccountSetupIn{ - AccountId: string(site.AccountId), - }) - if err != nil { - return err - } - return err -} - -func (d *domainI) getClusterFromAccount(ctx context.Context, err error, accountId string) (string, error) { - cluster, err := d.financeClient.GetAttachedCluster(ctx, &finance.GetAttachedClusterIn{ - AccountId: accountId, - }) - if err != nil { - return "", err - } - return cluster.ClusterId, nil -} - -func (d *domainI) GetSite(ctx context.Context, siteId string) (*Site, error) { - return d.sitesRepo.FindById(ctx, repos.ID(siteId)) -} - -func (d *domainI) GetAccountEdgeCName(ctx context.Context, accountId string, regionId repos.ID) (string, error) { - name, err := d.getAccountCName(ctx, accountId) - if err != nil { - return "", err - } - - regionCnameIdentity, err := d.getRegionCName(ctx, string(regionId)) - if err != nil { - return "", err - } - - cluster, err := d.getClusterFromAccount(ctx, err, accountId) - if err != nil { - return fmt.Sprintf("%s.%s.%s", regionCnameIdentity, name, d.env.EdgeCnameBaseDomain), nil - } - - return fmt.Sprintf("%s.%s.%s.%s", regionCnameIdentity, name, cluster, d.env.EdgeCnameBaseDomain), nil -} - -func generateName() string { - randomAdjective := ADJECTIVES[rand.Intn(len(ADJECTIVES))] - randomNoun := NOUNS[rand.Intn(len(NOUNS))] - return fmt.Sprintf("%v-%v", randomAdjective, randomNoun) -} - -func (d *domainI) getRegionCName(ctx context.Context, regionId string) (string, error) { - regionDNS, err := d.regionCNamesRepo.FindOne(ctx, repos.Filter{ - "regionId": regionId, - }) - if err != nil { - return "", err - } - if regionDNS != nil { - return regionDNS.CName, nil - } - var genUniqueName func() (string, error) - genUniqueName = func() (string, error) { - name := generateName() - regionDNS, err = d.regionCNamesRepo.FindOne(ctx, repos.Filter{ - "cName": name, - }) - if err != nil { - return "", err - } - if regionDNS != nil { - return genUniqueName() - } - return name, nil - } - - generatedName, err := genUniqueName() - if err != nil { - return "", err - } - if regionDNS == nil { - create, err := d.regionCNamesRepo.Create(ctx, &RegionCName{ - RegionId: repos.ID(regionId), - CName: generatedName, - }) - if err != nil { - return "", err - } - return create.CName, nil - } - return regionDNS.CName, nil -} - -func (d *domainI) getAccountCName(ctx context.Context, accountId string) (string, error) { - accountDNS, err := d.accountCNamesRepo.FindOne(ctx, repos.Filter{ - "accountId": accountId, - }) - if err != nil { - return "", err - } - if err == nil && accountDNS != nil { - return accountDNS.CName, nil - } - var genUniqueName func() (string, error) - genUniqueName = func() (string, error) { - name := generateName() - accountDNS, err = d.accountCNamesRepo.FindOne(ctx, repos.Filter{ - "cName": name, - }) - if err != nil { - return "", err - } - if accountDNS != nil { - return genUniqueName() - } - return name, nil - } - - generatedName, err := genUniqueName() - if err != nil { - return "", err - } - if accountDNS == nil { - create, err := d.accountCNamesRepo.Create(ctx, &AccountCName{ - AccountId: repos.ID(accountId), - CName: generatedName, - }) - if err != nil { - return "", err - } - return create.CName, nil - } - return accountDNS.CName, nil -} - -func (d *domainI) GetRecord(ctx context.Context, host string) (*Record, error) { - one, err := d.recordsRepo.FindOne(ctx, repos.Filter{ - "host": host, - }) - if err != nil { - return nil, err - } - return one, nil -} - -func (d *domainI) deleteRecords(ctx context.Context, host string) error { - d.recordsCache.Drop(ctx, host) - return d.recordsRepo.DeleteMany(ctx, repos.Filter{ - "host": host, - }) -} - -func (d *domainI) DeleteRecords(ctx context.Context, host string) error { - return d.deleteRecords(ctx, host) -} - -func (d *domainI) addARecords(ctx context.Context, host string, aRecords []string) error { - var err error - d.recordsCache.Drop(ctx, host) - _, err = d.recordsRepo.Create(ctx, &Record{ - Host: host, - Answers: aRecords, - }) - return err -} - -func (d *domainI) AddARecords(ctx context.Context, host string, aRecords []string) error { - return d.addARecords(ctx, host, aRecords) -} - -func fxDomain( - recordsRepo repos.DbRepo[*Record], - sitesRepo repos.DbRepo[*Site], - nodeIpsRepo repos.DbRepo[*NodeIps], - accountDNSRepo repos.DbRepo[*AccountCName], - regionDNSRepo repos.DbRepo[*RegionCName], - recordsCache cache.Repo[[]*Record], - consoleclient console.ConsoleClient, - financeClient finance.FinanceClient, - env *Env, -) Domain { - return &domainI{ - recordsRepo, - sitesRepo, - recordsCache, - accountDNSRepo, - regionDNSRepo, - nodeIpsRepo, - env, - consoleclient, - financeClient, - } -} - -type Env struct { - EdgeCnameBaseDomain string `env:"EDGE_CNAME_BASE_DOMAIN" required:"true"` - MongoUri string `env:"MONGO_URI" required:"true"` -} - -var Module = fx.Module( - "domain", - config.EnvFx[Env](), - fx.Provide(fxDomain), -) diff --git a/apps/dns/internal/domain/port.go b/apps/dns/internal/domain/port.go deleted file mode 100644 index 1873cb81a..000000000 --- a/apps/dns/internal/domain/port.go +++ /dev/null @@ -1,31 +0,0 @@ -package domain - -import ( - "context" - "kloudlite.io/pkg/repos" -) - -type Domain interface { - GetNodeIps(ctx context.Context, regionPart *string, accountPart *string, clusterPart string) ([]string, error) - GetRecord(ctx context.Context, host string) (*Record, error) - DeleteRecords(ctx context.Context, host string) error - AddARecords(ctx context.Context, host string, aRecords []string) error - - UpsertARecords(ctx context.Context, host string, records []string) error - VerifySite(ctx context.Context, claimId repos.ID) error - GetSites(ctx context.Context, accountId string) ([]*Site, error) - GetVerifiedSites(ctx context.Context, accountId string) ([]*Site, error) - GetSite(ctx context.Context, siteId string) (*Site, error) - GetSiteFromDomain(ctx context.Context, domain string) (*Site, error) - GetAccountEdgeCName(ctx context.Context, accountId string, regionId repos.ID) (string, error) - - CreateSite(ctx context.Context, domain string, accountId, regionId repos.ID) error - DeleteSite(ctx context.Context, siteId repos.ID) error - UpdateNodeIPs( - ctx context.Context, - regionId string, - accountId string, - clusterPart string, - ips []string, - ) bool -} diff --git a/apps/dns/internal/framework/main.go b/apps/dns/internal/framework/main.go deleted file mode 100644 index 7bc1e44af..000000000 --- a/apps/dns/internal/framework/main.go +++ /dev/null @@ -1,83 +0,0 @@ -package framework - -import ( - "go.uber.org/fx" - "kloudlite.io/apps/dns/internal/app" - rpc "kloudlite.io/pkg/grpc" - - // "kloudlite.io/pkg/cache" - "kloudlite.io/pkg/cache" - "kloudlite.io/pkg/config" - "kloudlite.io/pkg/dns" - httpServer "kloudlite.io/pkg/http-server" - "kloudlite.io/pkg/repos" -) - -type GrpcConsoleConfig struct { - ConsoleService string `env:"CONSOLE_SERVICE" required:"true"` -} - -func (e *GrpcConsoleConfig) GetGRPCServerURL() string { - return e.ConsoleService -} - -type GrpcFinanceConfig struct { - FinanceService string `env:"FINANCE_SERVICE" required:"true"` -} - -func (e *GrpcFinanceConfig) GetGRPCServerURL() string { - return e.FinanceService -} - -type Env struct { - DNSPort uint16 `env:"DNS_PORT" required:"true"` - MongoUri string `env:"MONGO_URI" required:"true"` - RedisHosts string `env:"REDIS_HOSTS" required:"true"` - RedisUserName string `env:"REDIS_USERNAME"` - RedisPassword string `env:"REDIS_PASSWORD"` - RedisPrefix string `env:"REDIS_PREFIX"` - MongoDbName string `env:"MONGO_DB_NAME" required:"true"` - Port uint16 `env:"PORT" required:"true"` - IsDev bool `env:"DEV" default:"false" required:"true"` - CorsOrigins string `env:"ORIGINS"` - GrpcPort uint16 `env:"GRPC_PORT" required:"true"` -} - -func (e *Env) GetDNSPort() uint16 { - return e.DNSPort -} - -func (e *Env) GetMongoConfig() (url string, dbName string) { - return e.MongoUri, e.MongoDbName -} - -func (e *Env) RedisOptions() (hosts, username, password, prefix string) { - return e.RedisHosts, e.RedisUserName, e.RedisPassword, e.RedisPrefix -} - -func (e *Env) GetHttpPort() uint16 { - return e.Port -} - -func (e *Env) GetHttpCors() string { - return e.CorsOrigins -} - -func (e *Env) GetGRPCPort() uint16 { - return e.GrpcPort -} - -var Module = fx.Module( - "framework", - config.EnvFx[Env](), - config.EnvFx[GrpcConsoleConfig](), - config.EnvFx[GrpcFinanceConfig](), - rpc.NewGrpcServerFx[*Env](), - repos.NewMongoClientFx[*Env](), - cache.NewRedisFx[*Env](), - httpServer.NewHttpServerFx[*Env](), - rpc.NewGrpcClientFx[*GrpcConsoleConfig, app.ConsoleClientConnection](), - rpc.NewGrpcClientFx[*GrpcFinanceConfig, app.FinanceClientConnection](), - dns.Fx[*Env](), - app.Module, -) diff --git a/apps/dns/main.go b/apps/dns/main.go deleted file mode 100644 index 943434c32..000000000 --- a/apps/dns/main.go +++ /dev/null @@ -1,23 +0,0 @@ -package main - -import ( - "flag" - - "go.uber.org/fx" - "kloudlite.io/apps/dns/internal/framework" - "kloudlite.io/pkg/logging" -) - -func main() { - var isDev bool - flag.BoolVar(&isDev, "dev", false, "--dev") - flag.Parse() - fx.New( - framework.Module, - fx.Provide( - func() (logging.Logger, error) { - return logging.New(&logging.Options{Name: "auth", Dev: isDev}) - }, - ), - ).Run() -} diff --git a/apps/finance/Taskfile.yml b/apps/finance/Taskfile.yml deleted file mode 100644 index 7ecba1807..000000000 --- a/apps/finance/Taskfile.yml +++ /dev/null @@ -1,70 +0,0 @@ -version: "3" - -dotenv: - - .secrets/env - -tasks: - gql: - dir: ./internal/app - cmds: - - go run -tags dynamic github.com/99designs/gqlgen generate - - run: - dotenv: - - .secrets/env - cmds: - - go run main.go --dev - - docker-build: - vars: - APP: finance - IMAGE: registry.kloudlite.io/kloudlite/{{.EnvName}}/{{.APP}}-api:{{.Tag}} - preconditions: - - sh: '[[ -n "{{.Tag}}" ]]' - msg: 'var Tag must have a value' - - - sh: '[[ "{{.EnvName}}" == "development" ]] || [[ "{{.EnvName}}" == "staging" ]] || [[ "{{.EnvName}}" == "production" ]]' - msg: 'var EnvName must have one of [development, staging, production] as its value' - cmds: - - docker buildx build -f ./Dockerfile -t {{.IMAGE}} . --build-arg APP={{.APP}} --platform linux/amd64 --build-context project-root=../.. - - docker push {{.IMAGE}} - - local-build: - preconditions: - - sh: '[ -n "{{.EnvName}}" ]' - msg: 'var EnvName must have a value' - - sh: '[ -n "{{.Tag}}" ]' - msg: 'var Tag must have a value' - vars: - APP: finance - IMAGE: registry.kloudlite.io/kloudlite/{{.EnvName}}/{{.APP}}-api:{{.Tag}} - env: - CGO_ENABLED: 0 - GOOS: linux - GOARCH: amd64 - silent: true - cmds: - - |+ - lineNumbers=$(cat Dockerfile | grep -i '^FROM' -n | tail +2 | awk -F: '{print $1}') - - startLineNo=$(echo "$lineNumbers" | head -n+1) - finalLineNo=$(echo "$lineNumbers" | tail -1) - - tDir=$(mktemp -d) - - nDockerfile=$(cat Dockerfile | tail --lines=+$startLineNo | grep -i --invert-match 'from=base') - echo "$nDockerfile" | sed "1 i # syntax=docker/dockerfile:1.4" > $tDir/Dockerfile.base - - #lineNo=$(cat Dockerfile | grep -i '^FROM' -n | tail -1 | awk -F: '{print $1}') - - cat $tDir/Dockerfile.base | sed "5 i COPY --from=local-builder ./{{.APP}} ./finance" > $tDir/Dockerfile - cat $tDir/Dockerfile - - CGO_ENABLED=0 go build -o $tDir/{{.APP}} . - - docker buildx build -f $tDir/Dockerfile -t {{.IMAGE}} . --build-context local-builder=${tDir} - docker push {{.IMAGE}} - rm -rf $tDir - - - diff --git a/apps/finance/cron/main.go b/apps/finance/cron/main.go deleted file mode 100644 index 8733b7a45..000000000 --- a/apps/finance/cron/main.go +++ /dev/null @@ -1,33 +0,0 @@ -package main - -import ( - "context" - "flag" - - "go.uber.org/fx" - "kloudlite.io/apps/finance/internal/domain" - "kloudlite.io/apps/finance/internal/framework" - "kloudlite.io/pkg/logging" - "kloudlite.io/pkg/repos" -) - -func main() { - accountId := flag.String("dev", "", "--accountId") - flag.Parse() - if accountId == nil { - panic("accountId is required") - } - fx.New( - fx.Provide( - func() (logging.Logger, error) { - return logging.New(&logging.Options{Name: "console", Dev: false}) - }, - ), - framework.Module, - fx.Invoke( - func(d domain.Domain) { - d.GenerateBillingInvoice(context.Background(), repos.ID(*accountId)) - }, - ), - ).Start(context.TODO()) -} diff --git a/apps/finance/internal/app/graph/entity.resolvers.go b/apps/finance/internal/app/graph/entity.resolvers.go deleted file mode 100644 index bcd3ce34a..000000000 --- a/apps/finance/internal/app/graph/entity.resolvers.go +++ /dev/null @@ -1,43 +0,0 @@ -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.28 - -import ( - "context" - "time" - - "kloudlite.io/apps/finance/internal/app/graph/generated" - "kloudlite.io/apps/finance/internal/app/graph/model" - fn "kloudlite.io/pkg/functions" - "kloudlite.io/pkg/repos" -) - -// FindAccountByName is the resolver for the findAccountByName field. -func (r *entityResolver) FindAccountByName(ctx context.Context, name string) (*model.Account, error) { - cc := toFinanceContext(ctx) - acc, err := r.domain.GetAccount(cc, name) - if err != nil { - return nil, err - } - return &model.Account{ - // ID: acc.Id, - Name: acc.Name, - Billing: nil, - IsActive: fn.DefaultIfNil(acc.IsActive, false), - ContactEmail: acc.ContactEmail, - ReadableID: acc.ReadableId, - Created: acc.CreatedAt.Format(time.RFC3339), - }, nil -} - -// FindUserByID is the resolver for the findUserByID field. -func (r *entityResolver) FindUserByID(ctx context.Context, id repos.ID) (*model.User, error) { - return &model.User{ID: id}, nil -} - -// Entity returns generated.EntityResolver implementation. -func (r *Resolver) Entity() generated.EntityResolver { return &entityResolver{r} } - -type entityResolver struct{ *Resolver } diff --git a/apps/finance/internal/app/graph/generated/federation.go b/apps/finance/internal/app/graph/generated/federation.go deleted file mode 100644 index 40a14d07a..000000000 --- a/apps/finance/internal/app/graph/generated/federation.go +++ /dev/null @@ -1,224 +0,0 @@ -// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. - -package generated - -import ( - "context" - "errors" - "fmt" - "strings" - "sync" - - "github.com/99designs/gqlgen/plugin/federation/fedruntime" -) - -var ( - ErrUnknownType = errors.New("unknown type") - ErrTypeNotFound = errors.New("type not found") -) - -func (ec *executionContext) __resolve__service(ctx context.Context) (fedruntime.Service, error) { - if ec.DisableIntrospection { - return fedruntime.Service{}, errors.New("federated introspection disabled") - } - - var sdl []string - - for _, src := range sources { - if src.BuiltIn { - continue - } - sdl = append(sdl, src.Input) - } - - return fedruntime.Service{ - SDL: strings.Join(sdl, "\n"), - }, nil -} - -func (ec *executionContext) __resolve_entities(ctx context.Context, representations []map[string]interface{}) []fedruntime.Entity { - list := make([]fedruntime.Entity, len(representations)) - - repsMap := map[string]struct { - i []int - r []map[string]interface{} - }{} - - // We group entities by typename so that we can parallelize their resolution. - // This is particularly helpful when there are entity groups in multi mode. - buildRepresentationGroups := func(reps []map[string]interface{}) { - for i, rep := range reps { - typeName, ok := rep["__typename"].(string) - if !ok { - // If there is no __typename, we just skip the representation; - // we just won't be resolving these unknown types. - ec.Error(ctx, errors.New("__typename must be an existing string")) - continue - } - - _r := repsMap[typeName] - _r.i = append(_r.i, i) - _r.r = append(_r.r, rep) - repsMap[typeName] = _r - } - } - - isMulti := func(typeName string) bool { - switch typeName { - default: - return false - } - } - - resolveEntity := func(ctx context.Context, typeName string, rep map[string]interface{}, idx []int, i int) (err error) { - // we need to do our own panic handling, because we may be called in a - // goroutine, where the usual panic handling can't catch us - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - } - }() - - switch typeName { - case "Account": - resolverName, err := entityResolverNameForAccount(ctx, rep) - if err != nil { - return fmt.Errorf(`finding resolver for Entity "Account": %w`, err) - } - switch resolverName { - - case "findAccountByName": - id0, err := ec.unmarshalNString2string(ctx, rep["name"]) - if err != nil { - return fmt.Errorf(`unmarshalling param 0 for findAccountByName(): %w`, err) - } - entity, err := ec.resolvers.Entity().FindAccountByName(ctx, id0) - if err != nil { - return fmt.Errorf(`resolving Entity "Account": %w`, err) - } - - list[idx[i]] = entity - return nil - } - case "User": - resolverName, err := entityResolverNameForUser(ctx, rep) - if err != nil { - return fmt.Errorf(`finding resolver for Entity "User": %w`, err) - } - switch resolverName { - - case "findUserByID": - id0, err := ec.unmarshalNID2kloudliteᚗioᚋpkgᚋreposᚐID(ctx, rep["id"]) - if err != nil { - return fmt.Errorf(`unmarshalling param 0 for findUserByID(): %w`, err) - } - entity, err := ec.resolvers.Entity().FindUserByID(ctx, id0) - if err != nil { - return fmt.Errorf(`resolving Entity "User": %w`, err) - } - - list[idx[i]] = entity - return nil - } - - } - return fmt.Errorf("%w: %s", ErrUnknownType, typeName) - } - - resolveManyEntities := func(ctx context.Context, typeName string, reps []map[string]interface{}, idx []int) (err error) { - // we need to do our own panic handling, because we may be called in a - // goroutine, where the usual panic handling can't catch us - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - } - }() - - switch typeName { - - default: - return errors.New("unknown type: " + typeName) - } - } - - resolveEntityGroup := func(typeName string, reps []map[string]interface{}, idx []int) { - if isMulti(typeName) { - err := resolveManyEntities(ctx, typeName, reps, idx) - if err != nil { - ec.Error(ctx, err) - } - } else { - // if there are multiple entities to resolve, parallelize (similar to - // graphql.FieldSet.Dispatch) - var e sync.WaitGroup - e.Add(len(reps)) - for i, rep := range reps { - i, rep := i, rep - go func(i int, rep map[string]interface{}) { - err := resolveEntity(ctx, typeName, rep, idx, i) - if err != nil { - ec.Error(ctx, err) - } - e.Done() - }(i, rep) - } - e.Wait() - } - } - buildRepresentationGroups(representations) - - switch len(repsMap) { - case 0: - return list - case 1: - for typeName, reps := range repsMap { - resolveEntityGroup(typeName, reps.r, reps.i) - } - return list - default: - var g sync.WaitGroup - g.Add(len(repsMap)) - for typeName, reps := range repsMap { - go func(typeName string, reps []map[string]interface{}, idx []int) { - resolveEntityGroup(typeName, reps, idx) - g.Done() - }(typeName, reps.r, reps.i) - } - g.Wait() - return list - } -} - -func entityResolverNameForAccount(ctx context.Context, rep map[string]interface{}) (string, error) { - for { - var ( - m map[string]interface{} - val interface{} - ok bool - ) - _ = val - m = rep - if _, ok = m["name"]; !ok { - break - } - return "findAccountByName", nil - } - return "", fmt.Errorf("%w for Account", ErrTypeNotFound) -} - -func entityResolverNameForUser(ctx context.Context, rep map[string]interface{}) (string, error) { - for { - var ( - m map[string]interface{} - val interface{} - ok bool - ) - _ = val - m = rep - if _, ok = m["id"]; !ok { - break - } - return "findUserByID", nil - } - return "", fmt.Errorf("%w for User", ErrTypeNotFound) -} diff --git a/apps/finance/internal/app/graph/helper.go b/apps/finance/internal/app/graph/helper.go deleted file mode 100644 index f6a2ede3b..000000000 --- a/apps/finance/internal/app/graph/helper.go +++ /dev/null @@ -1,35 +0,0 @@ -package graph - -import ( - "context" - "fmt" - - "kloudlite.io/apps/finance/internal/app/graph/model" - "kloudlite.io/apps/finance/internal/domain" - fn "kloudlite.io/pkg/functions" -) - -func AccountModelFromEntity(account *domain.Account) *model.Account { - if account == nil { - return nil - } - return &model.Account{ - // ID: account.Id, - Name: account.Name, - Billing: &model.Billing{ - CardholderName: account.Billing.CardholderName, - Address: account.Billing.Address, - }, - IsActive: fn.DefaultIfNil(account.IsActive, false), - ContactEmail: account.ContactEmail, - ReadableID: account.ReadableId, - Created: account.CreatedAt.String(), - } -} - -func toFinanceContext(ctx context.Context) domain.FinanceContext { - if cc, ok := ctx.Value("kl-finance-ctx").(domain.FinanceContext); ok { - return cc - } - panic(fmt.Errorf("context values '%s' is missing", "kl-finance-ctx")) -} diff --git a/apps/finance/internal/app/graph/model/models_gen.go b/apps/finance/internal/app/graph/model/models_gen.go deleted file mode 100644 index c55a3847c..000000000 --- a/apps/finance/internal/app/graph/model/models_gen.go +++ /dev/null @@ -1,47 +0,0 @@ -// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. - -package model - -import ( - "kloudlite.io/pkg/repos" -) - -type Account struct { - Name string `json:"name"` - DisplayName string `json:"displayName"` - Billing *Billing `json:"billing"` - IsActive bool `json:"isActive"` - ContactEmail string `json:"contactEmail"` - ReadableID repos.ID `json:"readableId"` - Memberships []*AccountMembership `json:"memberships"` - Created string `json:"created"` - OutstandingAmount float64 `json:"outstandingAmount"` -} - -func (Account) IsEntity() {} - -type AccountMembership struct { - User *User `json:"user"` - Role string `json:"role"` - Account *Account `json:"account"` - Accepted bool `json:"accepted"` -} - -type Billing struct { - CardholderName string `json:"cardholderName"` - Address map[string]interface{} `json:"address"` -} - -type BillingInput struct { - StripePaymentMethodID string `json:"stripePaymentMethodId"` - CardholderName string `json:"cardholderName"` - Address map[string]interface{} `json:"address"` -} - -type User struct { - ID repos.ID `json:"id"` - AccountMemberships []*AccountMembership `json:"accountMemberships"` - AccountMembership *AccountMembership `json:"accountMembership"` -} - -func (User) IsEntity() {} diff --git a/apps/finance/internal/app/graph/resolver.go b/apps/finance/internal/app/graph/resolver.go deleted file mode 100644 index dbaca51c3..000000000 --- a/apps/finance/internal/app/graph/resolver.go +++ /dev/null @@ -1,17 +0,0 @@ -package graph - -import "kloudlite.io/apps/finance/internal/domain" - -// This file will not be regenerated automatically. -// -// It serves as dependency injection for your app, add any dependencies you require here. - -type Resolver struct { - domain domain.Domain -} - -func NewResolver(domain domain.Domain) *Resolver { - return &Resolver{ - domain: domain, - } -} diff --git a/apps/finance/internal/app/graph/schema.graphqls b/apps/finance/internal/app/graph/schema.graphqls deleted file mode 100644 index bb5184d8a..000000000 --- a/apps/finance/internal/app/graph/schema.graphqls +++ /dev/null @@ -1,87 +0,0 @@ -directive @isLoggedIn on FIELD_DEFINITION - -type Query { - finance_listAccounts: [Account] @isLoggedIn - finance_account(accountName: String!): Account @isLoggedIn - finance_listInvitations(accountName: String!): [AccountMembership] @isLoggedIn - # finance_stripeSetupIntent: String # user-access - # finance_testStripe(accountId: ID!): Boolean! #private - - finance_reSyncAccount(accountName: String!): Boolean! @isLoggedIn -} - -type Mutation { - finance_createAccount(name: String!, displayName: String!): Account! @isLoggedIn - finance_updateAccount(accountName: String!, name: String, contactEmail: String): Account! @isLoggedIn - # finance_updateAccountBilling(accountId: ID!, billing: BillingInput!): Account! # account-admin-access, account-owner-access - finance_removeAccountMember(accountName: String!, userId: ID!): Boolean! @isLoggedIn - finance_updateAccountMember(accountName: String!, userId: ID!, role: String!): Boolean! @isLoggedIn - finance_deactivateAccount(accountName: String!): Boolean! @isLoggedIn - finance_activateAccount(accountName: String!): Boolean! @isLoggedIn - finance_deleteAccount(accountName: String!): Boolean! @isLoggedIn - # finance_attachToCluster(accountId: ID!, clusterId: ID!): Boolean! - - finance_inviteUser(accountName: String!, name: String, email: String!, role: String!): Boolean! @isLoggedIn - finance_deleteInvitation(accountName: String!, email: String!): Boolean! @isLoggedIn -} - -scalar Json -scalar Date - -type Account @key(fields: "name") { - name: String! - displayName: String! - billing: Billing! - isActive: Boolean! - contactEmail: String! - readableId: ID! - memberships: [AccountMembership!]! # account-admin-access, account-owner-access - created: Date! - outstandingAmount: Float! -} - -# extend type Account @key(fields: "name") { -# name: String! -# memberships: [AccountMembership!]! # account-admin-access, account-owner-access -# } - -# extend type StoragePlan @key(fields: "name"){ -# name: String! @external -# pricePerGB: Float! -# } -# -# extend type ComputePlan @key(fields: "name"){ -# name: String! @external -# sharedPrice: Float! -# dedicatedPrice: Float! -# } -# -# extend type LambdaPlan @key(fields: "name"){ -# name: String! @external -# freeTier: Int! -# pricePerGBHr: Float! -# } - -extend type User @key(fields: "id") { - id: ID! @external - accountMemberships:[AccountMembership!]! @isLoggedIn # user-access - accountMembership(accountName: String!):AccountMembership! @isLoggedIn # user-access -} - -type AccountMembership { - user: User! - role: String! - account: Account! - accepted: Boolean! -} - -type Billing { - cardholderName: String! - address: Json! -} - -input BillingInput { - stripePaymentMethodId: String! - cardholderName: String! - address: Json! -} diff --git a/apps/finance/internal/app/graph/schema.resolvers.go b/apps/finance/internal/app/graph/schema.resolvers.go deleted file mode 100644 index c9d5d5d1f..000000000 --- a/apps/finance/internal/app/graph/schema.resolvers.go +++ /dev/null @@ -1,228 +0,0 @@ -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.28 - -import ( - "context" - "errors" - "fmt" - - "kloudlite.io/apps/finance/internal/app/graph/generated" - "kloudlite.io/apps/finance/internal/app/graph/model" - "kloudlite.io/apps/finance/internal/domain" - iamT "kloudlite.io/apps/iam/types" - "kloudlite.io/pkg/repos" -) - -// Memberships is the resolver for the memberships field. -func (r *accountResolver) Memberships(ctx context.Context, obj *model.Account) ([]*model.AccountMembership, error) { - entities, err := r.domain.GetUserMemberships(toFinanceContext(ctx), iamT.NewResourceRef(obj.Name, iamT.ResourceAccount, obj.Name)) - accountMemberships := make([]*model.AccountMembership, len(entities)) - for i, entity := range entities { - accountMemberships[i] = &model.AccountMembership{ - Account: &model.Account{ - Name: entity.AccountName, - }, - User: &model.User{ - ID: entity.UserId, - }, - Role: string(entity.Role), - Accepted: entity.Accepted, - } - } - return accountMemberships, err -} - -// User is the resolver for the user field. -func (r *accountMembershipResolver) User(ctx context.Context, obj *model.AccountMembership) (*model.User, error) { - return &model.User{ - ID: obj.User.ID, - }, nil -} - -// Account is the resolver for the account field. -func (r *accountMembershipResolver) Account(ctx context.Context, obj *model.AccountMembership) (*model.Account, error) { - acc, err := r.domain.GetAccount(toFinanceContext(ctx), obj.Account.Name) - if err != nil { - return nil, err - } - if acc == nil { - return nil, errors.New("account not found") - } - return AccountModelFromEntity(acc), nil -} - -// FinanceCreateAccount is the resolver for the finance_createAccount field. -func (r *mutationResolver) FinanceCreateAccount(ctx context.Context, name string, displayName string) (*model.Account, error) { - account, err := r.domain.CreateAccount(toFinanceContext(ctx), name, displayName) - if err != nil { - return nil, err - } - return AccountModelFromEntity(account), nil -} - -// FinanceUpdateAccount is the resolver for the finance_updateAccount field. -func (r *mutationResolver) FinanceUpdateAccount(ctx context.Context, accountName string, name *string, contactEmail *string) (*model.Account, error) { - account, err := r.domain.UpdateAccount(toFinanceContext(ctx), accountName, contactEmail) - if err != nil { - return nil, err - } - return AccountModelFromEntity(account), nil -} - -// FinanceRemoveAccountMember is the resolver for the finance_removeAccountMember field. -func (r *mutationResolver) FinanceRemoveAccountMember(ctx context.Context, accountName string, userID repos.ID) (bool, error) { - return r.domain.RemoveAccountMember(toFinanceContext(ctx), accountName, userID) -} - -// FinanceUpdateAccountMember is the resolver for the finance_updateAccountMember field. -func (r *mutationResolver) FinanceUpdateAccountMember(ctx context.Context, accountName string, userID repos.ID, role string) (bool, error) { - return r.domain.UpdateAccountMember(toFinanceContext(ctx), accountName, userID, role) -} - -// FinanceDeactivateAccount is the resolver for the finance_deactivateAccount field. -func (r *mutationResolver) FinanceDeactivateAccount(ctx context.Context, accountName string) (bool, error) { - return r.domain.DeactivateAccount(toFinanceContext(ctx), accountName) -} - -// FinanceActivateAccount is the resolver for the finance_activateAccount field. -func (r *mutationResolver) FinanceActivateAccount(ctx context.Context, accountName string) (bool, error) { - return r.domain.ActivateAccount(toFinanceContext(ctx), accountName) -} - -// FinanceDeleteAccount is the resolver for the finance_deleteAccount field. -func (r *mutationResolver) FinanceDeleteAccount(ctx context.Context, accountName string) (bool, error) { - return r.domain.DeleteAccount(toFinanceContext(ctx), accountName) -} - -// FinanceInviteUser is the resolver for the finance_inviteUser field. -func (r *mutationResolver) FinanceInviteUser(ctx context.Context, accountName string, name *string, email string, role string) (bool, error) { - return r.domain.InviteUser(toFinanceContext(ctx), accountName, email, iamT.Role(role)) -} - -// FinanceDeleteInvitation is the resolver for the finance_deleteInvitation field. -func (r *mutationResolver) FinanceDeleteInvitation(ctx context.Context, accountName string, email string) (bool, error) { - panic(fmt.Errorf("not implemented")) -} - -// FinanceListAccounts is the resolver for the finance_listAccounts field. -func (r *queryResolver) FinanceListAccounts(ctx context.Context) ([]*model.Account, error) { - acc, err := r.domain.ListAccounts(toFinanceContext(ctx)) - if err != nil || acc == nil { - return make([]*model.Account, 0), err - } - - m := make([]*model.Account, len(acc)) - for i := range acc { - m[i] = &model.Account{ - Name: acc[i].Name, - Billing: &model.Billing{ - CardholderName: acc[i].Billing.CardholderName, - Address: acc[i].Billing.Address, - }, - // IsActive: fn.DefaultIfNil(acc[i].IsActive, false), - ContactEmail: acc[i].ContactEmail, - ReadableID: acc[i].ReadableId, - } - } - - return m, nil -} - -// FinanceAccount is the resolver for the finance_account field. -func (r *queryResolver) FinanceAccount(ctx context.Context, accountName string) (*model.Account, error) { - accountEntity, err := r.domain.GetAccount(toFinanceContext(ctx), accountName) - return AccountModelFromEntity(accountEntity), err -} - -// FinanceListInvitations is the resolver for the finance_listInvitations field. -func (r *queryResolver) FinanceListInvitations(ctx context.Context, accountName string) ([]*model.AccountMembership, error) { - m, err := r.domain.ListInvitations(toFinanceContext(ctx), accountName) - if err != nil { - return nil, err - } - - am := make([]*model.AccountMembership, len(m)) - for i := range m { - am[i] = &model.AccountMembership{ - User: &model.User{ - ID: m[i].UserId, - }, - Role: string(m[i].Role), - Account: &model.Account{ - Name: m[i].AccountName, - }, - Accepted: m[i].Accepted, - } - } - return am, nil -} - -// FinanceReSyncAccount is the resolver for the finance_reSyncAccount field. -func (r *queryResolver) FinanceReSyncAccount(ctx context.Context, accountName string) (bool, error) { - if err := r.domain.ReSyncToK8s(toFinanceContext(ctx), accountName); err != nil { - return false, err - } - return true, nil -} - -// AccountMemberships is the resolver for the accountMemberships field. -func (r *userResolver) AccountMemberships(ctx context.Context, obj *model.User) ([]*model.AccountMembership, error) { - // entities, err := r.domain.GetAccountMemberships(toFinanceContext(ctx), obj.ID) - entities, err := r.domain.GetAccountMemberships(domain.FinanceContext{Context: ctx, UserId: obj.ID}) - accountMemberships := make([]*model.AccountMembership, len(entities)) - for i, entity := range entities { - accountMemberships[i] = &model.AccountMembership{ - Account: &model.Account{ - Name: entity.AccountName, - }, - User: &model.User{ - ID: entity.UserId, - }, - Role: string(entity.Role), - } - } - return accountMemberships, err -} - -// AccountMembership is the resolver for the accountMembership field. -func (r *userResolver) AccountMembership(ctx context.Context, obj *model.User, accountName string) (*model.AccountMembership, error) { - membership, err := r.domain.GetAccountMembership(domain.FinanceContext{UserId: obj.ID, Context: ctx}, accountName) - if err != nil { - return nil, err - } - return &model.AccountMembership{ - Account: &model.Account{ - Name: membership.AccountName, - }, - User: &model.User{ - ID: membership.UserId, - }, - Role: string(membership.Role), - }, nil -} - -// Account returns generated.AccountResolver implementation. -func (r *Resolver) Account() generated.AccountResolver { return &accountResolver{r} } - -// AccountMembership returns generated.AccountMembershipResolver implementation. -func (r *Resolver) AccountMembership() generated.AccountMembershipResolver { - return &accountMembershipResolver{r} -} - -// Mutation returns generated.MutationResolver implementation. -func (r *Resolver) Mutation() generated.MutationResolver { return &mutationResolver{r} } - -// Query returns generated.QueryResolver implementation. -func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} } - -// User returns generated.UserResolver implementation. -func (r *Resolver) User() generated.UserResolver { return &userResolver{r} } - -type accountResolver struct{ *Resolver } -type accountMembershipResolver struct{ *Resolver } -type mutationResolver struct{ *Resolver } -type queryResolver struct{ *Resolver } -type userResolver struct{ *Resolver } diff --git a/apps/finance/internal/app/grpc-client.go b/apps/finance/internal/app/grpc-client.go deleted file mode 100644 index ccabe0a65..000000000 --- a/apps/finance/internal/app/grpc-client.go +++ /dev/null @@ -1,39 +0,0 @@ -package app - -import ( - "go.uber.org/fx" - "google.golang.org/grpc" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/auth" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/comms" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/console" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/container_registry" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/iam" -) - -type AuthGrpcClientConn *grpc.ClientConn -type ConsoleClientConnection *grpc.ClientConn -type ContainerRegistryClientConnection *grpc.ClientConn -type CommsClientConnection *grpc.ClientConn -type IAMClientConnection *grpc.ClientConn - -var ConsoleClientFx = fx.Provide(func(conn ConsoleClientConnection) console.ConsoleClient { - return console.NewConsoleClient((*grpc.ClientConn)(conn)) -}) - -var ContainerRegistryFx = fx.Provide(func(conn ContainerRegistryClientConnection) container_registry.ContainerRegistryClient { - return container_registry.NewContainerRegistryClient((*grpc.ClientConn)(conn)) -}) - -var IAMClientFx = fx.Provide(func(conn IAMClientConnection) iam.IAMClient { - return iam.NewIAMClient((*grpc.ClientConn)(conn)) -}) - -var CommsClientFx = fx.Provide(func(conn CommsClientConnection) comms.CommsClient { - return comms.NewCommsClient((*grpc.ClientConn)(conn)) -}) - -var AuthClientFx = fx.Provide( - func(conn AuthGrpcClientConn) auth.AuthClient { - return auth.NewAuthClient((*grpc.ClientConn)(conn)) - }, -) diff --git a/apps/finance/internal/app/grpc-server.go b/apps/finance/internal/app/grpc-server.go deleted file mode 100644 index 2a9e36f05..000000000 --- a/apps/finance/internal/app/grpc-server.go +++ /dev/null @@ -1,37 +0,0 @@ -package app - -import ( - "context" - - "kloudlite.io/apps/finance/internal/domain" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/finance" -) - -type financeServerImpl struct { - finance.UnimplementedFinanceServer - d domain.Domain -} - -func (f financeServerImpl) StartBillable(ctx context.Context, in *finance.StartBillableIn) (*finance.StartBillableOut, error) { - // TODO implement me - panic("implement me") -} - -func (f financeServerImpl) StopBillable(ctx context.Context, in *finance.StopBillableIn) (*finance.StopBillableOut, error) { - // TODO implement me - panic("implement me") -} - -func (f financeServerImpl) GetAttachedCluster(ctx context.Context, in *finance.GetAttachedClusterIn) (*finance.GetAttachedClusterOut, error) { - account, err := f.d.GetAccount(domain.FinanceContext{Context: ctx, UserId: ""}, in.AccountName) - if err != nil { - return nil, err - } - return &finance.GetAttachedClusterOut{ClusterId: string(account.ClusterID)}, nil -} - -func fxFinanceGrpcServer(domain domain.Domain) finance.FinanceServer { - return &financeServerImpl{ - d: domain, - } -} diff --git a/apps/finance/internal/app/main.go b/apps/finance/internal/app/main.go deleted file mode 100644 index 88a7ca129..000000000 --- a/apps/finance/internal/app/main.go +++ /dev/null @@ -1,138 +0,0 @@ -package app - -import ( - "context" - - "kloudlite.io/constants" - - "github.com/99designs/gqlgen/graphql" - "github.com/gofiber/fiber/v2" - "go.uber.org/fx" - "google.golang.org/grpc" - "kloudlite.io/apps/finance/internal/app/graph" - "kloudlite.io/apps/finance/internal/app/graph/generated" - "kloudlite.io/apps/finance/internal/domain" - "kloudlite.io/apps/finance/internal/env" - "kloudlite.io/common" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/finance" - "kloudlite.io/pkg/cache" - httpServer "kloudlite.io/pkg/http-server" - "kloudlite.io/pkg/repos" -) - -// type Env struct { -// CookieDomain string `env:"COOKIE_DOMAIN" required:"true"` -// StripePublicKey string `env:"STRIPE_PUBLIC_KEY" required:"true"` -// StripeSecretKey string `env:"STRIPE_SECRET_KEY" required:"true"` -// } - -// func (e *WorkloadFinanceConsumerEnv) GetSubscriptionTopics() []string { -// return []string{ -// e.Topic, -// } -// } -// -// func (*WorkloadFinanceConsumerEnv) GetConsumerGroupId() string { -// return "console-workload-finance-consumer-2" -// } - -type AuthCacheClient cache.Client - -var Module = fx.Module( - "application", - // config.EnvFx[Env](), - repos.NewFxMongoRepo[*domain.Account]("accounts", "acc", domain.AccountIndexes), - repos.NewFxMongoRepo[*domain.AccountBilling]("account_billings", "accbill", domain.BillableIndexes), - repos.NewFxMongoRepo[*domain.BillingInvoice]("account_invoices", "inv", domain.BillingInvoiceIndexes), - cache.NewFxRepo[*domain.AccountInviteToken](), - IAMClientFx, - ConsoleClientFx, - ContainerRegistryFx, - AuthClientFx, - CommsClientFx, - fx.Invoke( - func(server *fiber.App, d domain.Domain, env *env.Env, cacheClient AuthCacheClient) { - gqlConfig := generated.Config{Resolvers: graph.NewResolver(d)} - - gqlConfig.Directives.IsLoggedIn = func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) { - sess := httpServer.GetSession[*common.AuthSession](ctx) - if sess == nil { - return nil, fiber.ErrUnauthorized - } - - cc := domain.FinanceContext{Context: ctx, UserId: sess.UserId} - return next(context.WithValue(ctx, "kl-finance-ctx", cc)) - } - - schema := generated.NewExecutableSchema(gqlConfig) - httpServer.SetupGQLServer( - server, - schema, - httpServer.NewSessionMiddleware[*common.AuthSession]( - cacheClient, - constants.CookieName, - env.CookieDomain, - constants.CacheSessionPrefix, - ), - ) - }, - ), - - // config.EnvFx[WorkloadFinanceConsumerEnv](), - // fx.Provide( - // func(env *Env) *stripe.Client { - // return stripe.NewClient(env.StripeSecretKey) - // }, - // ), - fx.Invoke( - func(server *fiber.App) { - // server.Get( - // "/stripe/get-setup-intent", func(ctx *fiber.Ctx) error { - // intentClientSecret, err := ds.GetSetupIntent() - // if err != nil { - // return err - // } - // return ctx.JSON( - // map[string]any{ - // "client-secret": intentClientSecret, - // }, - // ) - // }, - // ) - - // server.Post( - // "/stripe/create-customer", func(ctx *fiber.Ctx) error { - // var j struct { - // AccountId string `json:"accountId"` - // PaymentMethodId string `json:"paymentMethodId"` - // } - // if err := json.Unmarshal(ctx.Body(), &j); err != nil { - // return err - // } - // customer, err := ds.CreateCustomer(j.AccountId, j.PaymentMethodId) - // if err != nil { - // return errors.NewEf(err, "creating customer") - // } - // //payment, err := ds.MakePayment(*customer, j.PaymentMethodId, 20000) - // //if err != nil { - // // return errors.NewEf(err, "making initial payment") - // //} - // return ctx.JSON( - // map[string]any{ - // "customerId": *customer, - // "init-payment": payment, - // }, - // ) - // }, - // ) - }, - ), - - fx.Provide(fxFinanceGrpcServer), - fx.Invoke( - func(server *grpc.Server, financeServer finance.FinanceServer) { - finance.RegisterFinanceServer(server, financeServer) - }, - ), - domain.Module, -) diff --git a/apps/finance/internal/domain/api.go b/apps/finance/internal/domain/api.go deleted file mode 100644 index a755992fd..000000000 --- a/apps/finance/internal/domain/api.go +++ /dev/null @@ -1,39 +0,0 @@ -package domain - -import ( - "context" - - iamT "kloudlite.io/apps/iam/types" - "kloudlite.io/pkg/repos" -) - -type FinanceContext struct { - context.Context - UserId repos.ID -} - -type Domain interface { - // CRUD - CreateAccount(ctx FinanceContext, name string, displayName string) (*Account, error) - ListAccounts(ctx FinanceContext) ([]*Account, error) - GetAccount(ctx FinanceContext, name string) (*Account, error) - UpdateAccount(ctx FinanceContext, name string, email *string) (*Account, error) - DeleteAccount(ctx FinanceContext, name string) (bool, error) - ReSyncToK8s(ctx FinanceContext, name string) error - - DeactivateAccount(ctx FinanceContext, name string) (bool, error) - ActivateAccount(ctx FinanceContext, name string) (bool, error) - - // invitations - InviteUser(ctx FinanceContext, accountName string, email string, role iamT.Role) (bool, error) - ListInvitations(ctx FinanceContext, accountName string) ([]*Membership, error) - DeleteInvitation(ctx FinanceContext, email string) (bool, error) - - // Memberships - RemoveAccountMember(ctx FinanceContext, accountName string, userId repos.ID) (bool, error) - UpdateAccountMember(ctx FinanceContext, accountName string, userId repos.ID, role string) (bool, error) - - GetUserMemberships(ctx FinanceContext, resourceRef string) ([]*Membership, error) - GetAccountMemberships(ctx FinanceContext) ([]*Membership, error) - GetAccountMembership(ctx FinanceContext, accountName string) (*Membership, error) -} diff --git a/apps/finance/internal/domain/commons.go b/apps/finance/internal/domain/commons.go deleted file mode 100644 index ab6423658..000000000 --- a/apps/finance/internal/domain/commons.go +++ /dev/null @@ -1,36 +0,0 @@ -package domain - -import ( - "errors" - - "go.mongodb.org/mongo-driver/mongo" - "kloudlite.io/common" - httpServer "kloudlite.io/pkg/http-server" -) - -// access -const ( - READ_PROJECT = "read_project" - UPDATE_PROJECT = "update_project" - - READ_ACCOUNT = "read_account" - UPDATE_ACCOUNT = "update_account" -) - -func mongoError(err error, descp string) error { - if err != nil { - if err == mongo.ErrNoDocuments { - return errors.New(descp) - } - return err - } - return nil -} - -func GetUser(ctx FinanceContext) (string, error) { - session := httpServer.GetSession[*common.AuthSession](ctx) - if session == nil { - return "", errors.New("Unauthorized") - } - return string(session.UserId), nil -} diff --git a/apps/finance/internal/domain/entities.go b/apps/finance/internal/domain/entities.go deleted file mode 100644 index 859737e9c..000000000 --- a/apps/finance/internal/domain/entities.go +++ /dev/null @@ -1,139 +0,0 @@ -package domain - -import ( - "time" - - iamT "kloudlite.io/apps/iam/types" - "kloudlite.io/pkg/repos" -) - -type AccountInviteToken struct { - Token string `json:"token"` - UserId repos.ID `json:"user_id"` - Role string `json:"role"` - AccountName string `json:"account_name"` -} - -type Billing struct { - StripeCustomerId string `json:"stripe_customer_id" bson:"stripe_customer_id"` - PaymentMethodId string `json:"payment_method_id" bson:"payment_method_id"` - CardholderName string `json:"cardholder_name" bson:"cardholder_name"` - Address map[string]any `json:"address" bson:"address"` -} - -type Account struct { - repos.BaseEntity `bson:",inline"` - Name string `json:"name" bson:"name"` - DisplayName string `json:"display_name" bson:"display_name"` - ContactEmail string `json:"contact_email" bson:"contact_email"` - Billing Billing `json:"billing" bson:"billing"` - IsActive *bool `json:"is_active,omitempty" bson:"is_active"` - IsDeleted *bool `json:"is_deleted" bson:"is_deleted"` - CreatedAt time.Time `json:"created_at" bson:"created_at"` - ReadableId repos.ID `json:"readable_id" bson:"readable_id"` - ClusterID repos.ID `json:"cluster_id" bson:"cluster_id"` -} - -var AccountIndexes = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: "id", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "name", Value: repos.IndexAsc}, - }, - Unique: true, - }, -} - -type Membership struct { - AccountName string - UserId repos.ID - Role iamT.Role - Accepted bool -} - -type Billable struct { - ResourceType string `json:"resource_type" bson:"resource_type"` - Plan string `json:"plan" bson:"plan"` - IsShared bool `json:"is_shared" bson:"is_shared"` - Quantity float64 `json:"quantity" bson:"quantity"` - Count int `json:"count" bson:"count"` -} - -type AccountBilling struct { - repos.BaseEntity `bson:",inline"` - AccountName string `json:"account_id" bson:"account_id"` - ProjectId repos.ID `json:"project_id" bson:"project_id"` - ResourceId repos.ID `json:"resource_id" bson:"resource_id"` - Billables []Billable `json:"billables" bson:"billables"` - StartTime time.Time `json:"start_time" bson:"start_time"` - EndTime *time.Time `json:"end_time" bson:"end_time"` - BillAmount float64 `json:"bill_amount" bson:"bill_amount"` - Month *string `json:"month" bson:"month"` -} - -var BillableIndexes = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: "id", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "account_name", Value: repos.IndexAsc}, - }, - }, - { - Field: []repos.IndexKey{ - {Key: "resource_id", Value: repos.IndexAsc}, - }, - }, -} - -type ComputePlan struct { - Name string `yaml:"name"` - SharedPrice float64 `yaml:"sharedPrice"` - DedicatedPrice float64 `yaml:"dedicatedPrice"` -} - -type LamdaPlan struct { - Name string `yaml:"name"` - PricePerGBHr float64 `yaml:"pricePerGBHr"` - FreeTire int `yaml:"freeTire"` -} - -type StoragePlan struct { - Name string `yaml:"name"` - PricePerGB float64 `yaml:"pricePerGB"` -} - -type BillingEvent struct { - Key string `json:"key"` - Stage string `json:"stage"` - Billing struct { - Name string `json:"name"` - Items []struct { - Type string `json:"type"` - Count int `json:"count"` - Plan string `json:"plan"` - PlanQ float64 `json:"planQuantity"` - IsShared string `json:"isShared"` - } `json:"items"` - } `json:"billing"` - Metadata struct { - ClusterId string `json:"clusterId"` - AccountName string `json:"accountName"` - ProjectId string `json:"projectId"` - ResourceId string `json:"resourceId"` - GroupVersionKind struct { - Group string `json:"Group"` - Version string `json:"Version"` - Kind string `json:"Kind"` - } `json:"groupVersionKind"` - } `json:"metadata"` -} diff --git a/apps/finance/internal/domain/impl.go b/apps/finance/internal/domain/impl.go deleted file mode 100644 index 754f125ab..000000000 --- a/apps/finance/internal/domain/impl.go +++ /dev/null @@ -1,573 +0,0 @@ -package domain - -import ( - "encoding/json" - "fmt" - "math" - "math/rand" - "reflect" - "regexp" - "strings" - "time" - - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/container_registry" - - "github.com/kloudlite/operator/pkg/kubectl" - "kloudlite.io/constants" - - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/auth" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/comms" - "kloudlite.io/pkg/cache" - "kloudlite.io/pkg/stripe" - - crdsv1 "github.com/kloudlite/operator/apis/crds/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - iamT "kloudlite.io/apps/iam/types" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/console" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/iam" - "kloudlite.io/pkg/errors" - fn "kloudlite.io/pkg/functions" - "kloudlite.io/pkg/repos" -) - -func generateId(prefix string) string { - id, e := fn.CleanerNanoid(28) - if e != nil { - panic(fmt.Errorf("could not get cleanerNanoid()")) - } - return fmt.Sprintf("%s-%s", prefix, strings.ToLower(id)) -} - -func toK8sAccountCR(acc *Account) ([]byte, error) { - kAcc := crdsv1.Account{ - ObjectMeta: metav1.ObjectMeta{ - Name: acc.Name, - }, - Spec: crdsv1.AccountSpec{ - HarborProjectName: acc.Name, - HarborUsername: acc.Name, - HarborSecretsNamespace: constants.NamespaceCore, - }, - } - kAcc.EnsureGVK() - return json.Marshal(kAcc) -} - -type domainI struct { - invoiceRepo repos.DbRepo[*BillingInvoice] - authClient auth.AuthClient - iamClient iam.IAMClient - consoleClient console.ConsoleClient - containerRegistryClient container_registry.ContainerRegistryClient - accountRepo repos.DbRepo[*Account] - commsClient comms.CommsClient - billablesRepo repos.DbRepo[*AccountBilling] - accountInviteTokenRepo cache.Repo[*AccountInviteToken] - inventoryPath string - stripeCli *stripe.Client - k8sYamlClient *kubectl.YAMLClient - env *Env -} - -func (d *domainI) ListAccounts(ctx FinanceContext) ([]*Account, error) { - out, err := d.iamClient.ListMembershipsForUser(ctx, &iam.MembershipsForUserIn{ - UserId: string(ctx.UserId), - ResourceType: string(iamT.ResourceAccount), - }) - // out, err := d.iamClient.ListMembershipsByResource(ctx, &iam.MembershipsByResourceIn{ - // ResourceType: string(iamT.ResourceAccount), - // }) - if err != nil { - return nil, err - } - acc := make([]*Account, len(out.RoleBindings)) - for i := range out.RoleBindings { - acc[i] = &Account{ - Name: strings.Split(out.RoleBindings[i].ResourceRef, "/")[0], - } - } - return acc, nil -} - -// ListInvitations implements Domain -func (d *domainI) ListInvitations(ctx FinanceContext, accountName string) ([]*Membership, error) { - mems, err := d.iamClient.ListResourceMemberships(ctx, &iam.ResourceMembershipsIn{ - ResourceType: string(iamT.ResourceAccount), - ResourceRef: iamT.NewResourceRef(accountName, iamT.ResourceAccount, accountName), - }) - if err != nil { - return nil, err - } - - m := make([]*Membership, len(mems.RoleBindings)) - - for i := range mems.RoleBindings { - //body - m[i] = &Membership{ - AccountName: accountName, - UserId: repos.ID(mems.RoleBindings[i].UserId), - Role: iamT.Role(mems.RoleBindings[i].Role), - Accepted: mems.RoleBindings[i].Accepted, - } - } - - return m, nil -} - -func JSONBytesEqual(a, b []byte) (bool, error) { - var j, j2 interface{} - if err := json.Unmarshal(a, &j); err != nil { - return false, err - } - if err := json.Unmarshal(b, &j2); err != nil { - return false, err - } - return reflect.DeepEqual(j2, j), nil -} - -func (d *domainI) ConfirmAccountMembership(ctx FinanceContext, invitationToken string) (bool, error) { - existingToken, err := d.accountInviteTokenRepo.Get(ctx, invitationToken) - if err != nil { - return false, err - } - - if existingToken == nil { - return false, errors.New("invitation token not found") - } - - err = d.accountInviteTokenRepo.Drop(ctx, invitationToken) - if err != nil { - return false, err - } - _, err = d.iamClient.ConfirmMembership( - ctx, &iam.ConfirmMembershipIn{ - UserId: string(existingToken.UserId), - // ResourceId: string(existingToken.AccountName), - // ResourceRef: iamT.NewResourceRef(clusterName string, kind string, namespace string, name string), - Role: existingToken.Role, - }, - ) - if err != nil { - return false, err - } - return true, nil -} - -func (d *domainI) GetAccountMembership(ctx FinanceContext, accountName string) (*Membership, error) { - membership, err := d.iamClient.GetMembership( - ctx, &iam.GetMembershipIn{ - UserId: string(ctx.UserId), - ResourceType: string(iamT.ResourceAccount), - ResourceRef: iamT.NewResourceRef(accountName, iamT.ResourceAccount, accountName), - }, - ) - if err != nil { - return nil, err - } - return &Membership{ - AccountName: accountName, - UserId: repos.ID(membership.UserId), - Role: iamT.Role(membership.Role), - }, nil -} - -func (d *domainI) GetUserMemberships(ctx FinanceContext, resourceRef string) ([]*Membership, error) { - rbs, err := d.iamClient.ListResourceMemberships( - ctx, &iam.ResourceMembershipsIn{ - ResourceType: string(iamT.ResourceAccount), - ResourceRef: resourceRef, - }, - ) - if err != nil { - return nil, err - } - - memberships := make([]*Membership, 0, len(rbs.RoleBindings)) - for _, rb := range rbs.RoleBindings { - memberships = append( - memberships, &Membership{ - AccountName: "", - UserId: repos.ID(rb.UserId), - Role: iamT.Role(rb.Role), - }, - ) - } - - return memberships, nil -} - -func (d *domainI) GetAccountMemberships(ctx FinanceContext) ([]*Membership, error) { - rbs, err := d.iamClient.ListUserMemberships( - ctx, &iam.UserMembershipsIn{ - UserId: string(ctx.UserId), - ResourceType: string(iamT.ResourceAccount), - }, - ) - if err != nil { - return nil, err - } - - var memberships []*Membership - for _, rb := range rbs.RoleBindings { - memberships = append( - memberships, &Membership{ - AccountName: strings.Split(rb.ResourceRef, "/")[0], - UserId: repos.ID(rb.UserId), - Role: iamT.Role(rb.Role), - Accepted: rb.Accepted, - }, - ) - } - - if err != nil { - return nil, err - } - return memberships, nil -} - -func generateReadable(name string) string { - compile := regexp.MustCompile(`[^\da-zA-Z:,/s]+`) - allString := compile.ReplaceAllString(strings.ToLower(name), "") - m := math.Min(10, float64(len(allString))) - return fmt.Sprintf("%v_%v", allString[:int(m)], rand.Intn(9999)) -} - -func (d *domainI) CreateAccount(ctx FinanceContext, name string, displayName string) (*Account, error) { - uid, err := GetUser(ctx) - if err != nil { - return nil, err - } - if uid != string(ctx.UserId) { - return nil, errors.New("you don't have permission to perform this operation") - } - - id := d.accountRepo.NewId() - - acc, err := d.accountRepo.Create( - ctx, &Account{ - BaseEntity: repos.BaseEntity{Id: id}, - Name: name, - DisplayName: displayName, - IsActive: fn.New(true), - CreatedAt: time.Now(), - ReadableId: repos.ID(generateReadable(name)), - }, - ) - if err != nil { - return nil, err - } - - _, err = d.iamClient.AddMembership( - ctx, &iam.AddMembershipIn{ - UserId: string(ctx.UserId), - ResourceType: string(iamT.ResourceAccount), - ResourceRef: iamT.NewResourceRef(acc.Name, iamT.ResourceAccount, acc.Name), - Role: string(iamT.RoleAccountAdmin), - }, - ) - if err != nil { - return nil, err - } - - b, err := toK8sAccountCR(acc) - if err != nil { - return nil, err - } - - if _, err = d.k8sYamlClient.ApplyYAML(ctx, b); err != nil { - return nil, err - } - - return acc, err -} - -func (d *domainI) UpdateAccount(ctx FinanceContext, accountName string, contactEmail *string) (*Account, error) { - if err := d.checkAccountAccess(ctx, accountName, iamT.UpdateAccount); err != nil { - return nil, err - } - - acc, err := d.findAccount(ctx, accountName) - if err != nil { - return nil, err - } - - if contactEmail != nil { - acc.ContactEmail = *contactEmail - } - return d.accountRepo.UpdateById(ctx, acc.Id, acc) -} - -func (d *domainI) UpdateAccountBilling(ctx FinanceContext, accountName string, b *Billing) (*Account, error) { - if err := d.checkAccountAccess(ctx, accountName, "update_account"); err != nil { - return nil, err - } - - acc, err := d.findAccount(ctx, accountName) - if err != nil { - return nil, err - } - - acc.Billing = Billing{ - PaymentMethodId: b.PaymentMethodId, - CardholderName: b.CardholderName, - Address: b.Address, - } - - return d.accountRepo.UpdateById(ctx, acc.Id, acc) -} - -// Invitation - -func (d *domainI) DeleteInvitation(ctx FinanceContext, email string) (bool, error) { - panic("not implemented") -} - -func (d *domainI) InviteUser(ctx FinanceContext, accountName string, email string, role iamT.Role) (bool, error) { - switch role { - case "account-member": - if err := d.checkAccountAccess(ctx, accountName, iamT.InviteAccountMember); err != nil { - return false, err - } - case "account-admin": - if err := d.checkAccountAccess(ctx, accountName, iamT.InviteAccountAdmin); err != nil { - return false, err - } - default: - return false, errors.New("role must be one of [account-member, account-admin]") - } - - acc, err := d.findAccount(ctx, accountName) - if err != nil { - return false, err - } - - invitedUser, err := d.authClient.EnsureUserByEmail(ctx, &auth.GetUserByEmailRequest{Email: email}) - if err != nil { - return false, err - } - - _, err = d.iamClient.InviteMembership( - ctx, &iam.AddMembershipIn{ - UserId: string(invitedUser.UserId), - ResourceType: string(iamT.ResourceAccount), - ResourceRef: iamT.NewResourceRef(accountName, iamT.ResourceAccount, accountName), - Role: string(role), - }, - ) - if err != nil { - return false, err - } - - token := generateId("acc-invite") - if err := d.accountInviteTokenRepo.Set( - ctx, token, &AccountInviteToken{ - Token: token, - UserId: ctx.UserId, - Role: string(role), - AccountName: accountName, - }, - ); err != nil { - return false, err - } - - if _, err = d.commsClient.SendAccountMemberInviteEmail( - ctx, &comms.AccountMemberInviteEmailInput{ - AccountName: acc.Name, - InvitationToken: token, - Email: email, - Name: "", - }, - ); err != nil { - return false, err - } - - return true, nil -} - -func (d *domainI) RemoveAccountMember( - ctx FinanceContext, - accountName string, - userId repos.ID, -) (bool, error) { - _, err := d.iamClient.RemoveMembership( - ctx, &iam.RemoveMembershipIn{ - UserId: string(userId), - ResourceRef: iamT.NewResourceRef(accountName, iamT.ResourceAccount, accountName), - }, - ) - if err != nil { - return false, err - } - return true, nil -} - -func (d *domainI) checkAccountAccess(ctx FinanceContext, accountName string, action iamT.Action) error { - co, err := d.iamClient.Can(ctx, &iam.CanIn{ - UserId: string(ctx.UserId), - ResourceRefs: []string{iamT.NewResourceRef(accountName, iamT.ResourceAccount, accountName)}, - Action: string(iamT.GetAccount), - }) - - if err != nil { - return err - } - - if !co.Status { - return fmt.Errorf("unauthorized to access this account") - } - - return nil -} - -func (d *domainI) findAccount(ctx FinanceContext, name string) (*Account, error) { - acc, err := d.accountRepo.FindOne(ctx, repos.Filter{"name": name}) - if err != nil { - return nil, err - } - - if acc == nil { - return nil, fmt.Errorf("account with name=%q not found", name) - } - return acc, nil -} - -func (d *domainI) UpdateAccountMember( - ctx FinanceContext, - accountName string, - userId repos.ID, - role string, -) (bool, error) { - - if err := d.checkAccountAccess(ctx, accountName, iamT.UpdateAccount); err != nil { - return false, err - } - - _, err := d.iamClient.AddMembership( - ctx, &iam.AddMembershipIn{ - UserId: string(userId), - ResourceType: string(constants.ResourceAccount), - Role: role, - }, - ) - if err != nil { - return false, err - } - return true, nil -} - -func (d *domainI) DeactivateAccount(ctx FinanceContext, accountName string) (bool, error) { - if err := d.checkAccountAccess(ctx, accountName, iamT.ActivateAccount); err != nil { - return false, err - } - - acc, err := d.findAccount(ctx, accountName) - if err != nil { - return false, err - } - - acc.IsActive = fn.New(false) - _, err = d.accountRepo.UpdateById(ctx, acc.Id, acc) - if err != nil { - return false, err - } - return true, nil -} - -func (d *domainI) ActivateAccount(ctx FinanceContext, accountName string) (bool, error) { - if err := d.checkAccountAccess(ctx, accountName, iamT.ActivateAccount); err != nil { - return false, err - } - - acc, err := d.findAccount(ctx, accountName) - if err != nil { - return false, err - } - - acc.IsActive = fn.New(true) - _, err = d.accountRepo.UpdateById(ctx, acc.Id, acc) - if err != nil { - return false, err - } - - return true, nil -} - -func (d *domainI) DeleteAccount(ctx FinanceContext, accountName string) (bool, error) { - // TODO: delete harbor project - if err := d.checkAccountAccess(ctx, accountName, iamT.DeleteAccount); err != nil { - return false, err - } - - acc, err := d.findAccount(ctx, accountName) - if err != nil { - return false, err - } - acc.IsDeleted = fn.New(true) - _, err = d.accountRepo.UpdateById(ctx, acc.Id, acc) - if err != nil { - return false, err - } - return true, nil -} - -func (d *domainI) GetAccount(ctx FinanceContext, accountName string) (*Account, error) { - // _, err := GetUser(ctx) - // if err != nil { - // return nil, err - // } - if err := d.checkAccountAccess(ctx, accountName, iamT.GetAccount); err != nil { - return nil, err - } - return d.findAccount(ctx, accountName) -} - -func (d *domainI) ReSyncToK8s(ctx FinanceContext, accountName string) error { - if err := d.checkAccountAccess(ctx, accountName, iamT.GetAccount); err != nil { - return err - } - acc, err := d.findAccount(ctx, accountName) - if err != nil { - return err - } - - b, err := toK8sAccountCR(acc) - if err != nil { - return err - } - - if _, err := d.k8sYamlClient.ApplyYAML(ctx, b); err != nil { - return err - } - - return nil -} - -func fxDomain( - accountRepo repos.DbRepo[*Account], - billablesRepo repos.DbRepo[*AccountBilling], - invoiceRepo repos.DbRepo[*BillingInvoice], - iamCli iam.IAMClient, - consoleClient console.ConsoleClient, - containerRegistryClient container_registry.ContainerRegistryClient, - authClient auth.AuthClient, - env *Env, - commsClient comms.CommsClient, - accountInviteTokenRepo cache.Repo[*AccountInviteToken], - // stripeCli *stripe.Client, - k8sYamlClient *kubectl.YAMLClient, -) Domain { - return &domainI{ - invoiceRepo: invoiceRepo, - authClient: authClient, - iamClient: iamCli, - consoleClient: consoleClient, - containerRegistryClient: containerRegistryClient, - accountRepo: accountRepo, - commsClient: commsClient, - accountInviteTokenRepo: accountInviteTokenRepo, - inventoryPath: env.InventoryPath, - env: env, - // stripeCli: stripeCli, - k8sYamlClient: k8sYamlClient, - } -} diff --git a/apps/finance/internal/domain/invoice-entities.go b/apps/finance/internal/domain/invoice-entities.go deleted file mode 100644 index 04888d551..000000000 --- a/apps/finance/internal/domain/invoice-entities.go +++ /dev/null @@ -1,59 +0,0 @@ -package domain - -import ( - "time" - - "kloudlite.io/pkg/repos" -) - -type ProjectInvoice struct { - ProjectName string `json:"project_name"` - BillAmount float64 `json:"bill_amount" bson:"bill_amount"` - ResourceBillings map[repos.ID]ResourceInvoice `json:"resource_billings" bson:"resource_billings"` -} - -type ResourceInvoice struct { - ReadableName string `json:"readable_name" bson:"readable_name"` - BillAmount float64 `json:"bill_amount" bson:"bill_amount"` - Consumptions map[string]ConsumptionInvoice `json:"consumptions" bson:"consumptions"` -} - -type ConsumptionInvoice struct { - Plan float64 `json:"plan" bson:"plan"` - Size float64 `json:"size" bson:"size"` - Quantity float64 `json:"quantity" bson:"quantity"` - Duration int `json:"duration" bson:"duration"` - Amount float64 `json:"amount" bson:"amount"` -} - -type BillingInvoice struct { - AccountId repos.ID `json:"account_id" bson:"account_id"` - Amount float64 `json:"amount" bson:"amount"` - CreatedAt time.Time `json:"created_at" bson:"created_at"` - Month string `json:"month" bson:"month"` - Year int `json:"year" bson:"year"` - Projects map[repos.ID]ProjectInvoice `json:"projects" bson:"projects"` - repos.BaseEntity `bson:",inline"` -} - -var BillingInvoiceIndexes = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: "id", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "account_id", Value: repos.IndexAsc}, - {Key: "month", Value: repos.IndexAsc}, - {Key: "year", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "account_id", Value: repos.IndexAsc}, - }, - }, -} diff --git a/apps/finance/internal/domain/main.go b/apps/finance/internal/domain/main.go deleted file mode 100644 index f8b017aef..000000000 --- a/apps/finance/internal/domain/main.go +++ /dev/null @@ -1,18 +0,0 @@ -package domain - -import ( - "go.uber.org/fx" - "kloudlite.io/pkg/config" -) - -type Env struct { - InventoryPath string `env:"INVENTORY_PATH"` - CurrClusterConfigNS string `env:"CURR_CLUSTER_CONFIG_NAMESPACE" required:"true"` - CurrClusterConfigName string `env:"CURR_CLUSTER_CONFIG_NAME" required:"true"` - CurrClusterConfigClusterIdKey string `env:"CURR_CLUSTER_CONFIG_CLUSTER_ID_KEY" required:"true"` -} - -var Module = fx.Module("domain", - fx.Provide(fxDomain), - config.EnvFx[Env](), -) diff --git a/apps/finance/internal/env/env.go b/apps/finance/internal/env/env.go deleted file mode 100644 index f1b628fc1..000000000 --- a/apps/finance/internal/env/env.go +++ /dev/null @@ -1,34 +0,0 @@ -package env - -import "github.com/codingconcepts/env" - -type Env struct { - HttpPort uint16 `env:"HTTP_PORT" required:"true"` - HttpCors string `env:"ORIGINS"` - GrpcPort uint16 `env:"GRPC_PORT" required:"true"` - - DBName string `env:"MONGO_DB_NAME" required:"true"` - DBUrl string `env:"MONGO_URI" required:"true"` - - RedisHosts string `env:"REDIS_HOSTS" required:"true"` - RedisUsername string `env:"REDIS_USERNAME" required:"true"` - RedisPassword string `env:"REDIS_PASSWORD" required:"true"` - RedisPrefix string `env:"REDIS_PREFIX" required:"true"` - - AuthRedisHosts string `env:"REDIS_AUTH_HOSTS" required:"true"` - AuthRedisUserName string `env:"REDIS_AUTH_USERNAME" required:"true"` - AuthRedisPassword string `env:"REDIS_AUTH_PASSWORD" required:"true"` - AuthRedisPrefix string `env:"REDIS_AUTH_PREFIX" required:"true"` - - CookieDomain string `env:"COOKIE_DOMAIN" required:"true"` - // StripePublicKey string `env:"STRIPE_PUBLIC_KEY" required:"true"` - // StripeSecretKey string `env:"STRIPE_SECRET_KEY" required:"true"` -} - -func LoadEnvOrDie() (*Env, error) { - var ev Env - if err := env.Set(&ev); err != nil { - return nil, err - } - return &ev, nil -} diff --git a/apps/finance/internal/framework/main.go b/apps/finance/internal/framework/main.go deleted file mode 100644 index d720584b3..000000000 --- a/apps/finance/internal/framework/main.go +++ /dev/null @@ -1,118 +0,0 @@ -package framework - -import ( - "go.uber.org/fx" - "kloudlite.io/apps/finance/internal/app" - "kloudlite.io/apps/finance/internal/env" - "kloudlite.io/pkg/cache" - "kloudlite.io/pkg/config" - rpc "kloudlite.io/pkg/grpc" - httpServer "kloudlite.io/pkg/http-server" - "kloudlite.io/pkg/repos" -) - -type AuthGRPCEnv struct { - AuthService string `env:"AUTH_SERVICE"` -} - -func (e *AuthGRPCEnv) GetGRPCServerURL() string { - return e.AuthService -} - -type CommsGRPCEnv struct { - CommsGrpcService string `env:"COMMS_SERVICE"` -} - -func (e *CommsGRPCEnv) GetGRPCServerURL() string { - return e.CommsGrpcService -} - -type ContainerRegistryGRPCEnv struct { - ContainerRegistryGrpcService string `env:"CONTAINER_REGISTRY_SERVICE"` -} - -func (e *ContainerRegistryGRPCEnv) GetGRPCServerURL() string { - return e.ContainerRegistryGrpcService -} - -type ConsoleGRPCEnv struct { - ConsoleGrpcService string `env:"CONSOLE_SERVICE"` -} - -func (e *ConsoleGRPCEnv) GetGRPCServerURL() string { - return e.ConsoleGrpcService -} - -type IAMGRPCEnv struct { - IAMService string `env:"IAM_SERVICE"` -} - -func (e *IAMGRPCEnv) GetGRPCServerURL() string { - return e.IAMService -} - -type fm struct { - *env.Env -} - -func (f *fm) GetGRPCPort() uint16 { - return f.GrpcPort -} - -func (f *fm) GetMongoConfig() (url string, dbName string) { - return f.DBUrl, f.DBName -} - -func (f *fm) RedisOptions() (hosts, username, password, basePrefix string) { - return f.RedisHosts, f.RedisUsername, f.RedisPassword, f.RedisPrefix -} - -func (f *fm) GetHttpPort() uint16 { - return f.HttpPort -} - -func (f *fm) GetHttpCors() string { - return f.HttpCors -} - -var Module fx.Option = fx.Module( - "framework", - fx.Provide(func(ev *env.Env) *fm { - return &fm{Env: ev} - }), - - // config.EnvFx[Env](), - config.EnvFx[ConsoleGRPCEnv](), - config.EnvFx[CommsGRPCEnv](), - config.EnvFx[IAMGRPCEnv](), - config.EnvFx[AuthGRPCEnv](), - config.EnvFx[ContainerRegistryGRPCEnv](), - rpc.NewGrpcServerFx[*fm](), - rpc.NewGrpcClientFx[*ConsoleGRPCEnv, app.ConsoleClientConnection](), - rpc.NewGrpcClientFx[*ContainerRegistryGRPCEnv, app.ContainerRegistryClientConnection](), - rpc.NewGrpcClientFx[*CommsGRPCEnv, app.CommsClientConnection](), - rpc.NewGrpcClientFx[*IAMGRPCEnv, app.IAMClientConnection](), - rpc.NewGrpcClientFx[*AuthGRPCEnv, app.AuthGrpcClientConn](), - repos.NewMongoClientFx[*fm](), - fx.Provide( - func(env *fm) app.AuthCacheClient { - return cache.NewRedisClient( - env.AuthRedisHosts, - env.AuthRedisUserName, - env.AuthRedisPassword, - env.AuthRedisPrefix, - ) - }, - ), - cache.FxLifeCycle[app.AuthCacheClient](), - - fx.Provide( - func(f *fm) cache.Client { - return cache.NewRedisClient(f.RedisOptions()) - }, - ), - - cache.FxLifeCycle[cache.Client](), - httpServer.NewHttpServerFx[*fm](), - app.Module, -) diff --git a/apps/finance/inventory.yaml b/apps/finance/inventory.yaml deleted file mode 100644 index 29b91a5ca..000000000 --- a/apps/finance/inventory.yaml +++ /dev/null @@ -1,29 +0,0 @@ -- type: Storage - name: BlockStorage - unit: 100GB - pricePerHour: - quantity: 0.0138 - currency: $ - pricePerMonth: - quantity: 10 - currency: $ - -- type: Storage - name: ObjectStorage - provider: do - desc: 100 GB - pricePerHour: - quantity: 0.0138 - currency: $ - pricePerMonth: - quantity: 10 - currency: $ - - -- type: CiHours - name: Tekton Hours - price_per_min: 0.00006$ - -- type: UserAccess - price_per_day: 0.5$ - price_per_month: 15$ diff --git a/apps/finance/inventory/block-storage.yaml b/apps/finance/inventory/block-storage.yaml deleted file mode 100644 index 29f033517..000000000 --- a/apps/finance/inventory/block-storage.yaml +++ /dev/null @@ -1,2 +0,0 @@ -- name: Default - pricePerGB: 0.1 diff --git a/apps/finance/inventory/ci.yaml b/apps/finance/inventory/ci.yaml deleted file mode 100644 index e69de29bb..000000000 diff --git a/apps/finance/inventory/compute.yaml b/apps/finance/inventory/compute.yaml deleted file mode 100644 index 2805fef59..000000000 --- a/apps/finance/inventory/compute.yaml +++ /dev/null @@ -1,11 +0,0 @@ -- name: Basic - sharedPrice: 10.2 - dedicatedPrice: -1 - -- name: General - sharedPrice: 12.6 - dedicatedPrice: 28.2 - -- name: HighMemory - sharedPrice: 17.4 - dedicatedPrice: 40 diff --git a/apps/finance/inventory/lambda.yaml b/apps/finance/inventory/lambda.yaml deleted file mode 100644 index a3cec90c0..000000000 --- a/apps/finance/inventory/lambda.yaml +++ /dev/null @@ -1,3 +0,0 @@ -- name: Default - pricePerGBHr: 0.05 - freeTire: 1000 diff --git a/apps/finance/main.go b/apps/finance/main.go deleted file mode 100644 index 0457f1130..000000000 --- a/apps/finance/main.go +++ /dev/null @@ -1,50 +0,0 @@ -package main - -import ( - "flag" - - "github.com/kloudlite/operator/pkg/kubectl" - "go.uber.org/fx" - "k8s.io/client-go/rest" - "kloudlite.io/apps/finance/internal/env" - "kloudlite.io/apps/finance/internal/framework" - "kloudlite.io/pkg/k8s" - "kloudlite.io/pkg/logging" -) - -func main() { - var isDev bool - flag.BoolVar(&isDev, "dev", false, "--dev") - flag.Parse() - - fx.New( - fx.Provide( - func() (logging.Logger, error) { - return logging.New(&logging.Options{Name: "finance", Dev: isDev}) - }, - ), - - fx.Provide(func() (*env.Env, error) { - return env.LoadEnvOrDie() - }), - - fx.Provide(func() (*rest.Config, error) { - if isDev { - return &rest.Config{Host: "localhost:8080"}, nil - } - return rest.InClusterConfig() - }), - - fx.Provide( - func(restCfg *rest.Config) (*k8s.YAMLClient, error) { - return k8s.NewYAMLClient(restCfg) - }, - ), - - fx.Provide(func(restCfg *rest.Config) (*kubectl.YAMLClient, error) { - return kubectl.NewYAMLClient(restCfg) - }), - - framework.Module, - ).Run() -} diff --git a/apps/gateway/Taskfile.yml b/apps/gateway/Taskfile.yml index 264bad92d..4e6d678e3 100644 --- a/apps/gateway/Taskfile.yml +++ b/apps/gateway/Taskfile.yml @@ -3,6 +3,9 @@ version: 3 dotenv: - "./.secrets/env" +vars: + ImagePrefix: ghcr.io/kloudlite/platform/apis + tasks: dev: interactive: true @@ -10,13 +13,11 @@ tasks: - npm start docker-build: vars: - Image: registry.kloudlite.io/kloudlite/{{.EnvName}}/gateway-api:{{.Tag}} + Image: "{{.ImagePrefix}}/gateway:{{.Tag}}" preconditions: - - sh: test -n '{{.EnvName}}' - msg: 'var EnvName must be defined' - sh: test -n '{{.Tag}}' msg: 'var Tag must be defined' cmds: - - docker build . -t {{.Image}} - - docker push {{.Image}} + - podman build . -t {{.Image}} + - podman push {{.Image}} diff --git a/apps/gateway/pnpm-lock.yaml b/apps/gateway/pnpm-lock.yaml index 8bdc134d6..a1d890163 100644 --- a/apps/gateway/pnpm-lock.yaml +++ b/apps/gateway/pnpm-lock.yaml @@ -1,43 +1,51 @@ -lockfileVersion: 5.4 +lockfileVersion: '6.0' -specifiers: - '@apollo/gateway': ^2.4.1 - '@apollo/server': ^4.6.0 - cookie: ^0.5.0 - express: ^4.18.2 - graphql: ^16.6.0 - js-yaml: ^4.1.0 +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false dependencies: - '@apollo/gateway': 2.4.1_graphql@16.6.0 - '@apollo/server': 4.6.0_graphql@16.6.0 - cookie: 0.5.0 - express: 4.18.2 - graphql: 16.6.0 - js-yaml: 4.1.0 + '@apollo/gateway': + specifier: ^2.4.1 + version: 2.4.1(graphql@16.8.1) + '@apollo/server': + specifier: ^4.6.0 + version: 4.9.3(graphql@16.8.1) + cookie: + specifier: ^0.5.0 + version: 0.5.0 + express: + specifier: ^4.18.2 + version: 4.18.2 + graphql: + specifier: ^16.6.0 + version: 16.8.1 + js-yaml: + specifier: ^4.1.0 + version: 4.1.0 packages: - /@apollo/cache-control-types/1.0.2_graphql@16.6.0: - resolution: {integrity: sha512-Por80co1eUm4ATsvjCOoS/tIR8PHxqVjsA6z76I6Vw0rFn4cgyVElQcmQDIZiYsy41k8e5xkrMRECkM2WR8pNw==} + /@apollo/cache-control-types@1.0.3(graphql@16.8.1): + resolution: {integrity: sha512-F17/vCp7QVwom9eG7ToauIKdAxpSoadsJnqIfyryLFSkLSOEqu+eC5Z3N8OXcUVStuOMcNHlyraRsA6rRICu4g==} peerDependencies: graphql: 14.x || 15.x || 16.x dependencies: - graphql: 16.6.0 + graphql: 16.8.1 dev: false - /@apollo/composition/2.4.1_graphql@16.6.0: + /@apollo/composition@2.4.1(graphql@16.8.1): resolution: {integrity: sha512-3da3gNMYw1OwsPJjH9jGkhDJffK3Wn4pu2m5CeJixpv8g5vBCFxlXOZ1ItsN+oNPkwmUplPUuTAWKAvwGfoYOA==} engines: {node: '>=14.15.0'} peerDependencies: graphql: ^16.5.0 dependencies: - '@apollo/federation-internals': 2.4.1_graphql@16.6.0 - '@apollo/query-graphs': 2.4.1_graphql@16.6.0 - graphql: 16.6.0 + '@apollo/federation-internals': 2.4.1(graphql@16.8.1) + '@apollo/query-graphs': 2.4.1(graphql@16.8.1) + graphql: 16.8.1 dev: false - /@apollo/federation-internals/2.4.1_graphql@16.6.0: + /@apollo/federation-internals@2.4.1(graphql@16.8.1): resolution: {integrity: sha512-C0jI/jApL0DIY2a6ig/RDRDpWinUpc3hSARhyBVNFQX0xtnuW+AjB+lpRZoEoWOZzGjfbaN+zmbUUqkxqjlc9Q==} engines: {node: '>=14.15.0'} peerDependencies: @@ -45,21 +53,21 @@ packages: dependencies: '@types/uuid': 9.0.1 chalk: 4.1.2 - graphql: 16.6.0 + graphql: 16.8.1 js-levenshtein: 1.1.6 uuid: 9.0.0 dev: false - /@apollo/gateway/2.4.1_graphql@16.6.0: + /@apollo/gateway@2.4.1(graphql@16.8.1): resolution: {integrity: sha512-rNdaxpStWP+2yG2sQZPXIuHyl9RB3K1AuM4LVH4z207HWdOLYubqmfCJF7aQrhEXuHcOsU675D5BFQ6xcNhv1Q==} engines: {node: '>=14.15.0'} peerDependencies: graphql: ^16.5.0 dependencies: - '@apollo/composition': 2.4.1_graphql@16.6.0 - '@apollo/federation-internals': 2.4.1_graphql@16.6.0 - '@apollo/query-planner': 2.4.1_graphql@16.6.0 - '@apollo/server-gateway-interface': 1.1.0_graphql@16.6.0 + '@apollo/composition': 2.4.1(graphql@16.8.1) + '@apollo/federation-internals': 2.4.1(graphql@16.8.1) + '@apollo/query-planner': 2.4.1(graphql@16.8.1) + '@apollo/server-gateway-interface': 1.1.0(graphql@16.8.1) '@apollo/usage-reporting-protobuf': 4.1.0 '@apollo/utils.createhash': 2.0.1 '@apollo/utils.fetcher': 2.0.1 @@ -70,7 +78,7 @@ packages: '@opentelemetry/api': 1.4.1 '@types/node-fetch': 2.6.3 async-retry: 1.3.3 - graphql: 16.6.0 + graphql: 16.8.1 loglevel: 1.8.1 make-fetch-happen: 11.0.3 node-abort-controller: 3.1.1 @@ -81,7 +89,7 @@ packages: - supports-color dev: false - /@apollo/protobufjs/1.2.7: + /@apollo/protobufjs@1.2.7: resolution: {integrity: sha512-Lahx5zntHPZia35myYDBRuF58tlwPskwHc5CWBZC/4bMKB6siTBWwtMrkqXcsNwQiFSzSx5hKdRPUmemrEp3Gg==} hasBin: true requiresBuild: true @@ -100,35 +108,35 @@ packages: long: 4.0.0 dev: false - /@apollo/query-graphs/2.4.1_graphql@16.6.0: + /@apollo/query-graphs@2.4.1(graphql@16.8.1): resolution: {integrity: sha512-14dnaZ3DnY/dLOsOI19BQkfkda3cxPmen+t8S/LqAOHMDky/vrgccoDIb3hc7TSlM08EJgRQiVytRjdhQzS3yQ==} engines: {node: '>=14.15.0'} peerDependencies: graphql: ^16.5.0 dependencies: - '@apollo/federation-internals': 2.4.1_graphql@16.6.0 + '@apollo/federation-internals': 2.4.1(graphql@16.8.1) deep-equal: 2.2.0 - graphql: 16.6.0 + graphql: 16.8.1 ts-graphviz: 1.5.5 uuid: 9.0.0 dev: false - /@apollo/query-planner/2.4.1_graphql@16.6.0: + /@apollo/query-planner@2.4.1(graphql@16.8.1): resolution: {integrity: sha512-s16fb5/AZMhxdjuNI/Jm1YDRWFZSeSOuNn72YOdnZzkdC1OUNsuc3y8BDn9QY6PK9UK4c6gK4seWOb3HYkxDfQ==} engines: {node: '>=14.15.0'} peerDependencies: graphql: ^16.5.0 dependencies: - '@apollo/federation-internals': 2.4.1_graphql@16.6.0 - '@apollo/query-graphs': 2.4.1_graphql@16.6.0 + '@apollo/federation-internals': 2.4.1(graphql@16.8.1) + '@apollo/query-graphs': 2.4.1(graphql@16.8.1) '@apollo/utils.keyvaluecache': 2.1.1 chalk: 4.1.2 deep-equal: 2.2.0 - graphql: 16.6.0 + graphql: 16.8.1 pretty-format: 29.5.0 dev: false - /@apollo/server-gateway-interface/1.1.0_graphql@16.6.0: + /@apollo/server-gateway-interface@1.1.0(graphql@16.8.1): resolution: {integrity: sha512-0rhG++QtGfr4YhhIHgxZ9BdMFthaPY6LbhI9Au90osbfLMiZ7f8dmZsEX1mp7O1h8MJwCu6Dp0I/KcGbSvfUGA==} peerDependencies: graphql: 14.x || 15.x || 16.x @@ -137,26 +145,38 @@ packages: '@apollo/utils.fetcher': 2.0.1 '@apollo/utils.keyvaluecache': 2.1.1 '@apollo/utils.logger': 2.0.1 - graphql: 16.6.0 + graphql: 16.8.1 dev: false - /@apollo/server/4.6.0_graphql@16.6.0: - resolution: {integrity: sha512-02dgZ5ywBZP7xVZ+Xf62uEtA0jCYcpD5gEluCADudUSwbGuQTnJ9F056SxOVLpJRM69sWDrOMKF5kncYYH5wSA==} + /@apollo/server-gateway-interface@1.1.1(graphql@16.8.1): + resolution: {integrity: sha512-pGwCl/po6+rxRmDMFgozKQo2pbsSwE91TpsDBAOgf74CRDPXHHtM88wbwjab0wMMZh95QfR45GGyDIdhY24bkQ==} + peerDependencies: + graphql: 14.x || 15.x || 16.x + dependencies: + '@apollo/usage-reporting-protobuf': 4.1.1 + '@apollo/utils.fetcher': 2.0.1 + '@apollo/utils.keyvaluecache': 2.1.1 + '@apollo/utils.logger': 2.0.1 + graphql: 16.8.1 + dev: false + + /@apollo/server@4.9.3(graphql@16.8.1): + resolution: {integrity: sha512-U56Sx/UmzR3Es344hQ/Ptf2EJrH+kV4ZPoLmgGjWoiwf2wYQ/pRSvkSXgjOvoyE34wSa8Gh7f92ljfLfY+6q1w==} engines: {node: '>=14.16.0'} peerDependencies: graphql: ^16.6.0 dependencies: - '@apollo/cache-control-types': 1.0.2_graphql@16.6.0 - '@apollo/server-gateway-interface': 1.1.0_graphql@16.6.0 - '@apollo/usage-reporting-protobuf': 4.1.0 + '@apollo/cache-control-types': 1.0.3(graphql@16.8.1) + '@apollo/server-gateway-interface': 1.1.1(graphql@16.8.1) + '@apollo/usage-reporting-protobuf': 4.1.1 '@apollo/utils.createhash': 2.0.1 '@apollo/utils.fetcher': 2.0.1 '@apollo/utils.isnodelike': 2.0.1 '@apollo/utils.keyvaluecache': 2.1.1 '@apollo/utils.logger': 2.0.1 - '@apollo/utils.usagereporting': 2.0.1_graphql@16.6.0 + '@apollo/utils.usagereporting': 2.1.0(graphql@16.8.1) '@apollo/utils.withrequired': 2.0.1 - '@graphql-tools/schema': 9.0.17_graphql@16.6.0 + '@graphql-tools/schema': 9.0.17(graphql@16.8.1) '@josephg/resolvable': 1.0.1 '@types/express': 4.17.17 '@types/express-serve-static-core': 4.17.33 @@ -165,7 +185,7 @@ packages: body-parser: 1.20.2 cors: 2.8.5 express: 4.18.2 - graphql: 16.6.0 + graphql: 16.8.1 loglevel: 1.8.1 lru-cache: 7.18.3 negotiator: 0.6.3 @@ -178,13 +198,19 @@ packages: - supports-color dev: false - /@apollo/usage-reporting-protobuf/4.1.0: + /@apollo/usage-reporting-protobuf@4.1.0: resolution: {integrity: sha512-hXouMuw5pQVkzi8dgMybmr6Y11+eRmMQVoB5TF0HyTwAg9SOq/v3OCuiYqcVUKdBcskU9Msp+XvjAk0GKpWCwQ==} dependencies: '@apollo/protobufjs': 1.2.7 dev: false - /@apollo/utils.createhash/2.0.1: + /@apollo/usage-reporting-protobuf@4.1.1: + resolution: {integrity: sha512-u40dIUePHaSKVshcedO7Wp+mPiZsaU6xjv9J+VyxpoU/zL6Jle+9zWeG98tr/+SZ0nZ4OXhrbb8SNr0rAPpIDA==} + dependencies: + '@apollo/protobufjs': 1.2.7 + dev: false + + /@apollo/utils.createhash@2.0.1: resolution: {integrity: sha512-fQO4/ZOP8LcXWvMNhKiee+2KuKyqIcfHrICA+M4lj/h/Lh1H10ICcUtk6N/chnEo5HXu0yejg64wshdaiFitJg==} engines: {node: '>=14'} dependencies: @@ -192,26 +218,26 @@ packages: sha.js: 2.4.11 dev: false - /@apollo/utils.dropunuseddefinitions/2.0.1_graphql@16.6.0: + /@apollo/utils.dropunuseddefinitions@2.0.1(graphql@16.8.1): resolution: {integrity: sha512-EsPIBqsSt2BwDsv8Wu76LK5R1KtsVkNoO4b0M5aK0hx+dGg9xJXuqlr7Fo34Dl+y83jmzn+UvEW+t1/GP2melA==} engines: {node: '>=14'} peerDependencies: graphql: 14.x || 15.x || 16.x dependencies: - graphql: 16.6.0 + graphql: 16.8.1 dev: false - /@apollo/utils.fetcher/2.0.1: + /@apollo/utils.fetcher@2.0.1: resolution: {integrity: sha512-jvvon885hEyWXd4H6zpWeN3tl88QcWnHp5gWF5OPF34uhvoR+DFqcNxs9vrRaBBSY3qda3Qe0bdud7tz2zGx1A==} engines: {node: '>=14'} dev: false - /@apollo/utils.isnodelike/2.0.1: + /@apollo/utils.isnodelike@2.0.1: resolution: {integrity: sha512-w41XyepR+jBEuVpoRM715N2ZD0xMD413UiJx8w5xnAZD2ZkSJnMJBoIzauK83kJpSgNuR6ywbV29jG9NmxjK0Q==} engines: {node: '>=14'} dev: false - /@apollo/utils.keyvaluecache/2.1.1: + /@apollo/utils.keyvaluecache@2.1.1: resolution: {integrity: sha512-qVo5PvUUMD8oB9oYvq4ViCjYAMWnZ5zZwEjNF37L2m1u528x5mueMlU+Cr1UinupCgdB78g+egA1G98rbJ03Vw==} engines: {node: '>=14'} dependencies: @@ -219,197 +245,197 @@ packages: lru-cache: 7.18.3 dev: false - /@apollo/utils.logger/2.0.1: + /@apollo/utils.logger@2.0.1: resolution: {integrity: sha512-YuplwLHaHf1oviidB7MxnCXAdHp3IqYV8n0momZ3JfLniae92eYqMIx+j5qJFX6WKJPs6q7bczmV4lXIsTu5Pg==} engines: {node: '>=14'} dev: false - /@apollo/utils.printwithreducedwhitespace/2.0.1_graphql@16.6.0: + /@apollo/utils.printwithreducedwhitespace@2.0.1(graphql@16.8.1): resolution: {integrity: sha512-9M4LUXV/fQBh8vZWlLvb/HyyhjJ77/I5ZKu+NBWV/BmYGyRmoEP9EVAy7LCVoY3t8BDcyCAGfxJaLFCSuQkPUg==} engines: {node: '>=14'} peerDependencies: graphql: 14.x || 15.x || 16.x dependencies: - graphql: 16.6.0 + graphql: 16.8.1 dev: false - /@apollo/utils.removealiases/2.0.1_graphql@16.6.0: + /@apollo/utils.removealiases@2.0.1(graphql@16.8.1): resolution: {integrity: sha512-0joRc2HBO4u594Op1nev+mUF6yRnxoUH64xw8x3bX7n8QBDYdeYgY4tF0vJReTy+zdn2xv6fMsquATSgC722FA==} engines: {node: '>=14'} peerDependencies: graphql: 14.x || 15.x || 16.x dependencies: - graphql: 16.6.0 + graphql: 16.8.1 dev: false - /@apollo/utils.sortast/2.0.1_graphql@16.6.0: + /@apollo/utils.sortast@2.0.1(graphql@16.8.1): resolution: {integrity: sha512-eciIavsWpJ09za1pn37wpsCGrQNXUhM0TktnZmHwO+Zy9O4fu/WdB4+5BvVhFiZYOXvfjzJUcc+hsIV8RUOtMw==} engines: {node: '>=14'} peerDependencies: graphql: 14.x || 15.x || 16.x dependencies: - graphql: 16.6.0 + graphql: 16.8.1 lodash.sortby: 4.7.0 dev: false - /@apollo/utils.stripsensitiveliterals/2.0.1_graphql@16.6.0: + /@apollo/utils.stripsensitiveliterals@2.0.1(graphql@16.8.1): resolution: {integrity: sha512-QJs7HtzXS/JIPMKWimFnUMK7VjkGQTzqD9bKD1h3iuPAqLsxd0mUNVbkYOPTsDhUKgcvUOfOqOJWYohAKMvcSA==} engines: {node: '>=14'} peerDependencies: graphql: 14.x || 15.x || 16.x dependencies: - graphql: 16.6.0 + graphql: 16.8.1 dev: false - /@apollo/utils.usagereporting/2.0.1_graphql@16.6.0: - resolution: {integrity: sha512-18smkNfiSfu5yj2mpCIfSzmpDNh90a4PQ6t8kSwGKcPRD3KD83TfK7fF37fSRdnvO93dBkGreWisLXnCpqfWXg==} + /@apollo/utils.usagereporting@2.1.0(graphql@16.8.1): + resolution: {integrity: sha512-LPSlBrn+S17oBy5eWkrRSGb98sWmnEzo3DPTZgp8IQc8sJe0prDgDuppGq4NeQlpoqEHz0hQeYHAOA0Z3aQsxQ==} engines: {node: '>=14'} peerDependencies: graphql: 14.x || 15.x || 16.x dependencies: - '@apollo/usage-reporting-protobuf': 4.1.0 - '@apollo/utils.dropunuseddefinitions': 2.0.1_graphql@16.6.0 - '@apollo/utils.printwithreducedwhitespace': 2.0.1_graphql@16.6.0 - '@apollo/utils.removealiases': 2.0.1_graphql@16.6.0 - '@apollo/utils.sortast': 2.0.1_graphql@16.6.0 - '@apollo/utils.stripsensitiveliterals': 2.0.1_graphql@16.6.0 - graphql: 16.6.0 + '@apollo/usage-reporting-protobuf': 4.1.1 + '@apollo/utils.dropunuseddefinitions': 2.0.1(graphql@16.8.1) + '@apollo/utils.printwithreducedwhitespace': 2.0.1(graphql@16.8.1) + '@apollo/utils.removealiases': 2.0.1(graphql@16.8.1) + '@apollo/utils.sortast': 2.0.1(graphql@16.8.1) + '@apollo/utils.stripsensitiveliterals': 2.0.1(graphql@16.8.1) + graphql: 16.8.1 dev: false - /@apollo/utils.withrequired/2.0.1: + /@apollo/utils.withrequired@2.0.1: resolution: {integrity: sha512-YBDiuAX9i1lLc6GeTy1m7DGLFn/gMnvXqlalOIMjM7DeOgIacEjjfwPqb0M1CQ2v11HhR15d1NmxJoRCfrNqcA==} engines: {node: '>=14'} dev: false - /@graphql-tools/merge/8.4.0_graphql@16.6.0: + /@graphql-tools/merge@8.4.0(graphql@16.8.1): resolution: {integrity: sha512-3XYCWe0d3I4F1azNj1CdShlbHfTIfiDgj00R9uvFH8tHKh7i1IWN3F7QQYovcHKhayaR6zPok3YYMESYQcBoaA==} peerDependencies: graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: - '@graphql-tools/utils': 9.2.1_graphql@16.6.0 - graphql: 16.6.0 + '@graphql-tools/utils': 9.2.1(graphql@16.8.1) + graphql: 16.8.1 tslib: 2.5.0 dev: false - /@graphql-tools/schema/9.0.17_graphql@16.6.0: + /@graphql-tools/schema@9.0.17(graphql@16.8.1): resolution: {integrity: sha512-HVLq0ecbkuXhJlpZ50IHP5nlISqH2GbNgjBJhhRzHeXhfwlUOT4ISXGquWTmuq61K0xSaO0aCjMpxe4QYbKTng==} peerDependencies: graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: - '@graphql-tools/merge': 8.4.0_graphql@16.6.0 - '@graphql-tools/utils': 9.2.1_graphql@16.6.0 - graphql: 16.6.0 + '@graphql-tools/merge': 8.4.0(graphql@16.8.1) + '@graphql-tools/utils': 9.2.1(graphql@16.8.1) + graphql: 16.8.1 tslib: 2.5.0 value-or-promise: 1.0.12 dev: false - /@graphql-tools/utils/9.2.1_graphql@16.6.0: + /@graphql-tools/utils@9.2.1(graphql@16.8.1): resolution: {integrity: sha512-WUw506Ql6xzmOORlriNrD6Ugx+HjVgYxt9KCXD9mHAak+eaXSwuGGPyE60hy9xaDEoXKBsG7SkG69ybitaVl6A==} peerDependencies: graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: - '@graphql-typed-document-node/core': 3.2.0_graphql@16.6.0 - graphql: 16.6.0 + '@graphql-typed-document-node/core': 3.2.0(graphql@16.8.1) + graphql: 16.8.1 tslib: 2.5.0 dev: false - /@graphql-typed-document-node/core/3.2.0_graphql@16.6.0: + /@graphql-typed-document-node/core@3.2.0(graphql@16.8.1): resolution: {integrity: sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==} peerDependencies: graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: - graphql: 16.6.0 + graphql: 16.8.1 dev: false - /@jest/schemas/29.4.3: + /@jest/schemas@29.4.3: resolution: {integrity: sha512-VLYKXQmtmuEz6IxJsrZwzG9NvtkQsWNnWMsKxqWNu3+CnfzJQhp0WDDKWLVV9hLKr0l3SLLFRqcYHjhtyuDVxg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@sinclair/typebox': 0.25.24 dev: false - /@josephg/resolvable/1.0.1: + /@josephg/resolvable@1.0.1: resolution: {integrity: sha512-CtzORUwWTTOTqfVtHaKRJ0I1kNQd1bpn3sUh8I3nJDVY+5/M/Oe1DnEWzPQvqq/xPIIkzzzIP7mfCoAjFRvDhg==} dev: false - /@npmcli/fs/3.1.0: + /@npmcli/fs@3.1.0: resolution: {integrity: sha512-7kZUAaLscfgbwBQRbvdMYaZOWyMEcPTH/tJjnyAWJ/dvvs9Ef+CERx/qJb9GExJpl1qipaDGn7KqHnFGGixd0w==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dependencies: - semver: 7.3.8 + semver: 7.5.4 dev: false - /@opentelemetry/api/1.4.1: + /@opentelemetry/api@1.4.1: resolution: {integrity: sha512-O2yRJce1GOc6PAy3QxFM4NzFiWzvScDC1/5ihYBL6BUEVdq0XMWN01sppE+H6bBXbaFYipjwFLEWLg5PaSOThA==} engines: {node: '>=8.0.0'} dev: false - /@protobufjs/aspromise/1.1.2: + /@protobufjs/aspromise@1.1.2: resolution: {integrity: sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==} dev: false - /@protobufjs/base64/1.1.2: + /@protobufjs/base64@1.1.2: resolution: {integrity: sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==} dev: false - /@protobufjs/codegen/2.0.4: + /@protobufjs/codegen@2.0.4: resolution: {integrity: sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==} dev: false - /@protobufjs/eventemitter/1.1.0: + /@protobufjs/eventemitter@1.1.0: resolution: {integrity: sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==} dev: false - /@protobufjs/fetch/1.1.0: + /@protobufjs/fetch@1.1.0: resolution: {integrity: sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==} dependencies: '@protobufjs/aspromise': 1.1.2 '@protobufjs/inquire': 1.1.0 dev: false - /@protobufjs/float/1.0.2: + /@protobufjs/float@1.0.2: resolution: {integrity: sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==} dev: false - /@protobufjs/inquire/1.1.0: + /@protobufjs/inquire@1.1.0: resolution: {integrity: sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==} dev: false - /@protobufjs/path/1.1.2: + /@protobufjs/path@1.1.2: resolution: {integrity: sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==} dev: false - /@protobufjs/pool/1.1.0: + /@protobufjs/pool@1.1.0: resolution: {integrity: sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==} dev: false - /@protobufjs/utf8/1.1.0: + /@protobufjs/utf8@1.1.0: resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==} dev: false - /@sinclair/typebox/0.25.24: + /@sinclair/typebox@0.25.24: resolution: {integrity: sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==} dev: false - /@tootallnate/once/2.0.0: + /@tootallnate/once@2.0.0: resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==} engines: {node: '>= 10'} dev: false - /@types/body-parser/1.19.2: + /@types/body-parser@1.19.2: resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} dependencies: '@types/connect': 3.4.35 '@types/node': 18.15.11 dev: false - /@types/connect/3.4.35: + /@types/connect@3.4.35: resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} dependencies: '@types/node': 18.15.11 dev: false - /@types/express-serve-static-core/4.17.33: + /@types/express-serve-static-core@4.17.33: resolution: {integrity: sha512-TPBqmR/HRYI3eC2E5hmiivIzv+bidAfXofM+sbonAGvyDhySGw9/PQZFt2BLOrjUUR++4eJVpx6KnLQK1Fk9tA==} dependencies: '@types/node': 18.15.11 @@ -417,7 +443,7 @@ packages: '@types/range-parser': 1.2.4 dev: false - /@types/express/4.17.17: + /@types/express@4.17.17: resolution: {integrity: sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q==} dependencies: '@types/body-parser': 1.19.2 @@ -426,45 +452,45 @@ packages: '@types/serve-static': 1.15.1 dev: false - /@types/long/4.0.2: + /@types/long@4.0.2: resolution: {integrity: sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==} dev: false - /@types/mime/3.0.1: + /@types/mime@3.0.1: resolution: {integrity: sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==} dev: false - /@types/node-fetch/2.6.3: + /@types/node-fetch@2.6.3: resolution: {integrity: sha512-ETTL1mOEdq/sxUtgtOhKjyB2Irra4cjxksvcMUR5Zr4n+PxVhsCD9WS46oPbHL3et9Zde7CNRr+WUNlcHvsX+w==} dependencies: '@types/node': 18.15.11 form-data: 3.0.1 dev: false - /@types/node/18.15.11: + /@types/node@18.15.11: resolution: {integrity: sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==} dev: false - /@types/qs/6.9.7: + /@types/qs@6.9.7: resolution: {integrity: sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==} dev: false - /@types/range-parser/1.2.4: + /@types/range-parser@1.2.4: resolution: {integrity: sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==} dev: false - /@types/serve-static/1.15.1: + /@types/serve-static@1.15.1: resolution: {integrity: sha512-NUo5XNiAdULrJENtJXZZ3fHtfMolzZwczzBbnAeBbqBwG+LaG6YaJtuwzwGSQZ2wsCrxjEhNNjAkKigy3n8teQ==} dependencies: '@types/mime': 3.0.1 '@types/node': 18.15.11 dev: false - /@types/uuid/9.0.1: + /@types/uuid@9.0.1: resolution: {integrity: sha512-rFT3ak0/2trgvp4yYZo5iKFEPsET7vKydKF+VRCxlQ9bpheehyAJH89dAkaLEq/j/RZXJIqcgsmPJKUP1Z28HA==} dev: false - /accepts/1.3.8: + /accepts@1.3.8: resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} engines: {node: '>= 0.6'} dependencies: @@ -472,7 +498,7 @@ packages: negotiator: 0.6.3 dev: false - /agent-base/6.0.2: + /agent-base@6.0.2: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} engines: {node: '>= 6.0.0'} dependencies: @@ -481,7 +507,7 @@ packages: - supports-color dev: false - /agentkeepalive/4.3.0: + /agentkeepalive@4.3.0: resolution: {integrity: sha512-7Epl1Blf4Sy37j4v9f9FjICCh4+KAQOyXgHEwlyBiAQLbhKdq/i2QQU3amQalS/wPhdPzDXPL5DMR5bkn+YeWg==} engines: {node: '>= 8.0.0'} dependencies: @@ -492,7 +518,7 @@ packages: - supports-color dev: false - /aggregate-error/3.1.0: + /aggregate-error@3.1.0: resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==} engines: {node: '>=8'} dependencies: @@ -500,46 +526,46 @@ packages: indent-string: 4.0.0 dev: false - /ansi-styles/4.3.0: + /ansi-styles@4.3.0: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} dependencies: color-convert: 2.0.1 dev: false - /ansi-styles/5.2.0: + /ansi-styles@5.2.0: resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} engines: {node: '>=10'} dev: false - /argparse/2.0.1: + /argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} dev: false - /array-flatten/1.1.1: + /array-flatten@1.1.1: resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} dev: false - /async-retry/1.3.3: + /async-retry@1.3.3: resolution: {integrity: sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw==} dependencies: retry: 0.13.1 dev: false - /asynckit/0.4.0: + /asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} dev: false - /available-typed-arrays/1.0.5: + /available-typed-arrays@1.0.5: resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==} engines: {node: '>= 0.4'} dev: false - /balanced-match/1.0.2: + /balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} dev: false - /body-parser/1.20.1: + /body-parser@1.20.1: resolution: {integrity: sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==} engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} dependencies: @@ -559,7 +585,7 @@ packages: - supports-color dev: false - /body-parser/1.20.2: + /body-parser@1.20.2: resolution: {integrity: sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==} engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} dependencies: @@ -579,18 +605,18 @@ packages: - supports-color dev: false - /brace-expansion/2.0.1: + /brace-expansion@2.0.1: resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} dependencies: balanced-match: 1.0.2 dev: false - /bytes/3.1.2: + /bytes@3.1.2: resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} engines: {node: '>= 0.8'} dev: false - /cacache/17.0.5: + /cacache@17.0.5: resolution: {integrity: sha512-Y/PRQevNSsjAPWykl9aeGz8Pr+OI6BYM9fYDNMvOkuUiG9IhG4LEmaYrZZZvioMUEQ+cBCxT0v8wrnCURccyKA==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dependencies: @@ -611,14 +637,14 @@ packages: - bluebird dev: false - /call-bind/1.0.2: + /call-bind@1.0.2: resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==} dependencies: function-bind: 1.1.1 get-intrinsic: 1.2.0 dev: false - /chalk/4.1.2: + /chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} dependencies: @@ -626,56 +652,56 @@ packages: supports-color: 7.2.0 dev: false - /chownr/2.0.0: + /chownr@2.0.0: resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} engines: {node: '>=10'} dev: false - /clean-stack/2.2.0: + /clean-stack@2.2.0: resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} engines: {node: '>=6'} dev: false - /color-convert/2.0.1: + /color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} dependencies: color-name: 1.1.4 dev: false - /color-name/1.1.4: + /color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} dev: false - /combined-stream/1.0.8: + /combined-stream@1.0.8: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} engines: {node: '>= 0.8'} dependencies: delayed-stream: 1.0.0 dev: false - /content-disposition/0.5.4: + /content-disposition@0.5.4: resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} engines: {node: '>= 0.6'} dependencies: safe-buffer: 5.2.1 dev: false - /content-type/1.0.5: + /content-type@1.0.5: resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==} engines: {node: '>= 0.6'} dev: false - /cookie-signature/1.0.6: + /cookie-signature@1.0.6: resolution: {integrity: sha1-4wOogrNCzD7oylE6eZmXNNqzriw=} dev: false - /cookie/0.5.0: + /cookie@0.5.0: resolution: {integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==} engines: {node: '>= 0.6'} dev: false - /cors/2.8.5: + /cors@2.8.5: resolution: {integrity: sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==} engines: {node: '>= 0.10'} dependencies: @@ -683,7 +709,7 @@ packages: vary: 1.1.2 dev: false - /debug/2.6.9: + /debug@2.6.9: resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} peerDependencies: supports-color: '*' @@ -694,7 +720,7 @@ packages: ms: 2.0.0 dev: false - /debug/4.3.4: + /debug@4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} peerDependencies: @@ -706,7 +732,7 @@ packages: ms: 2.1.2 dev: false - /deep-equal/2.2.0: + /deep-equal@2.2.0: resolution: {integrity: sha512-RdpzE0Hv4lhowpIUKKMJfeH6C1pXdtT1/it80ubgWqwI3qpuxUBpC1S4hnHg+zjnuOoDkzUtUCEEkG+XG5l3Mw==} dependencies: call-bind: 1.0.2 @@ -728,7 +754,7 @@ packages: which-typed-array: 1.1.9 dev: false - /define-properties/1.2.0: + /define-properties@1.2.0: resolution: {integrity: sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==} engines: {node: '>= 0.4'} dependencies: @@ -736,31 +762,31 @@ packages: object-keys: 1.1.1 dev: false - /delayed-stream/1.0.0: + /delayed-stream@1.0.0: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} engines: {node: '>=0.4.0'} dev: false - /depd/2.0.0: + /depd@2.0.0: resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} engines: {node: '>= 0.8'} dev: false - /destroy/1.2.0: + /destroy@1.2.0: resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} dev: false - /ee-first/1.1.1: + /ee-first@1.1.1: resolution: {integrity: sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=} dev: false - /encodeurl/1.0.2: + /encodeurl@1.0.2: resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} engines: {node: '>= 0.8'} dev: false - /encoding/0.1.13: + /encoding@0.1.13: resolution: {integrity: sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==} requiresBuild: true dependencies: @@ -768,11 +794,11 @@ packages: dev: false optional: true - /err-code/2.0.3: + /err-code@2.0.3: resolution: {integrity: sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==} dev: false - /es-get-iterator/1.1.3: + /es-get-iterator@1.1.3: resolution: {integrity: sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==} dependencies: call-bind: 1.0.2 @@ -786,16 +812,16 @@ packages: stop-iteration-iterator: 1.0.0 dev: false - /escape-html/1.0.3: + /escape-html@1.0.3: resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} dev: false - /etag/1.8.1: + /etag@1.8.1: resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} engines: {node: '>= 0.6'} dev: false - /express/4.18.2: + /express@4.18.2: resolution: {integrity: sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==} engines: {node: '>= 0.10.0'} dependencies: @@ -834,7 +860,7 @@ packages: - supports-color dev: false - /finalhandler/1.2.0: + /finalhandler@1.2.0: resolution: {integrity: sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==} engines: {node: '>= 0.8'} dependencies: @@ -849,13 +875,13 @@ packages: - supports-color dev: false - /for-each/0.3.3: + /for-each@0.3.3: resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} dependencies: is-callable: 1.2.7 dev: false - /form-data/3.0.1: + /form-data@3.0.1: resolution: {integrity: sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==} engines: {node: '>= 6'} dependencies: @@ -864,43 +890,43 @@ packages: mime-types: 2.1.35 dev: false - /forwarded/0.2.0: + /forwarded@0.2.0: resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} engines: {node: '>= 0.6'} dev: false - /fresh/0.5.2: + /fresh@0.5.2: resolution: {integrity: sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=} engines: {node: '>= 0.6'} dev: false - /fs-minipass/2.1.0: + /fs-minipass@2.1.0: resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} engines: {node: '>= 8'} dependencies: minipass: 3.3.6 dev: false - /fs-minipass/3.0.1: + /fs-minipass@3.0.1: resolution: {integrity: sha512-MhaJDcFRTuLidHrIttu0RDGyyXs/IYHVmlcxfLAEFIWjc1vdLAkdwT7Ace2u7DbitWC0toKMl5eJZRYNVreIMw==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dependencies: minipass: 4.2.5 dev: false - /fs.realpath/1.0.0: + /fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} dev: false - /function-bind/1.1.1: + /function-bind@1.1.1: resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} dev: false - /functions-have-names/1.2.3: + /functions-have-names@1.2.3: resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} dev: false - /get-intrinsic/1.2.0: + /get-intrinsic@1.2.0: resolution: {integrity: sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==} dependencies: function-bind: 1.1.1 @@ -908,7 +934,7 @@ packages: has-symbols: 1.0.3 dev: false - /glob/9.3.4: + /glob@9.3.4: resolution: {integrity: sha512-qaSc49hojMOv1EPM4EuyITjDSgSKI0rthoHnvE81tcOi1SCVndHko7auqxdQ14eiQG2NDBJBE86+2xIrbIvrbA==} engines: {node: '>=16 || 14 >=14.17'} dependencies: @@ -918,56 +944,56 @@ packages: path-scurry: 1.6.3 dev: false - /gopd/1.0.1: + /gopd@1.0.1: resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} dependencies: get-intrinsic: 1.2.0 dev: false - /graphql/16.6.0: - resolution: {integrity: sha512-KPIBPDlW7NxrbT/eh4qPXz5FiFdL5UbaA0XUNz2Rp3Z3hqBSkbj0GVjwFDztsWVauZUWsbKHgMg++sk8UX0bkw==} + /graphql@16.8.1: + resolution: {integrity: sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==} engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} dev: false - /has-bigints/1.0.2: + /has-bigints@1.0.2: resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} dev: false - /has-flag/4.0.0: + /has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} dev: false - /has-property-descriptors/1.0.0: + /has-property-descriptors@1.0.0: resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==} dependencies: get-intrinsic: 1.2.0 dev: false - /has-symbols/1.0.3: + /has-symbols@1.0.3: resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} engines: {node: '>= 0.4'} dev: false - /has-tostringtag/1.0.0: + /has-tostringtag@1.0.0: resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==} engines: {node: '>= 0.4'} dependencies: has-symbols: 1.0.3 dev: false - /has/1.0.3: + /has@1.0.3: resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} engines: {node: '>= 0.4.0'} dependencies: function-bind: 1.1.1 dev: false - /http-cache-semantics/4.1.1: + /http-cache-semantics@4.1.1: resolution: {integrity: sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==} dev: false - /http-errors/2.0.0: + /http-errors@2.0.0: resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==} engines: {node: '>= 0.8'} dependencies: @@ -978,7 +1004,7 @@ packages: toidentifier: 1.0.1 dev: false - /http-proxy-agent/5.0.0: + /http-proxy-agent@5.0.0: resolution: {integrity: sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==} engines: {node: '>= 6'} dependencies: @@ -989,7 +1015,7 @@ packages: - supports-color dev: false - /https-proxy-agent/5.0.1: + /https-proxy-agent@5.0.1: resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} engines: {node: '>= 6'} dependencies: @@ -999,42 +1025,43 @@ packages: - supports-color dev: false - /humanize-ms/1.2.1: + /humanize-ms@1.2.1: resolution: {integrity: sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==} dependencies: ms: 2.1.3 dev: false - /iconv-lite/0.4.24: + /iconv-lite@0.4.24: resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} engines: {node: '>=0.10.0'} dependencies: safer-buffer: 2.1.2 dev: false - /iconv-lite/0.6.3: + /iconv-lite@0.6.3: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} engines: {node: '>=0.10.0'} + requiresBuild: true dependencies: safer-buffer: 2.1.2 dev: false optional: true - /imurmurhash/0.1.4: + /imurmurhash@0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} dev: false - /indent-string/4.0.0: + /indent-string@4.0.0: resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} engines: {node: '>=8'} dev: false - /inherits/2.0.4: + /inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} dev: false - /internal-slot/1.0.5: + /internal-slot@1.0.5: resolution: {integrity: sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==} engines: {node: '>= 0.4'} dependencies: @@ -1043,16 +1070,16 @@ packages: side-channel: 1.0.4 dev: false - /ip/2.0.0: + /ip@2.0.0: resolution: {integrity: sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==} dev: false - /ipaddr.js/1.9.1: + /ipaddr.js@1.9.1: resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} engines: {node: '>= 0.10'} dev: false - /is-arguments/1.1.1: + /is-arguments@1.1.1: resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==} engines: {node: '>= 0.4'} dependencies: @@ -1060,7 +1087,7 @@ packages: has-tostringtag: 1.0.0 dev: false - /is-array-buffer/3.0.2: + /is-array-buffer@3.0.2: resolution: {integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==} dependencies: call-bind: 1.0.2 @@ -1068,13 +1095,13 @@ packages: is-typed-array: 1.1.10 dev: false - /is-bigint/1.0.4: + /is-bigint@1.0.4: resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} dependencies: has-bigints: 1.0.2 dev: false - /is-boolean-object/1.1.2: + /is-boolean-object@1.1.2: resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} engines: {node: '>= 0.4'} dependencies: @@ -1082,34 +1109,34 @@ packages: has-tostringtag: 1.0.0 dev: false - /is-callable/1.2.7: + /is-callable@1.2.7: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} engines: {node: '>= 0.4'} dev: false - /is-date-object/1.0.5: + /is-date-object@1.0.5: resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} engines: {node: '>= 0.4'} dependencies: has-tostringtag: 1.0.0 dev: false - /is-lambda/1.0.1: + /is-lambda@1.0.1: resolution: {integrity: sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==} dev: false - /is-map/2.0.2: + /is-map@2.0.2: resolution: {integrity: sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==} dev: false - /is-number-object/1.0.7: + /is-number-object@1.0.7: resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} engines: {node: '>= 0.4'} dependencies: has-tostringtag: 1.0.0 dev: false - /is-regex/1.1.4: + /is-regex@1.1.4: resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} engines: {node: '>= 0.4'} dependencies: @@ -1117,31 +1144,31 @@ packages: has-tostringtag: 1.0.0 dev: false - /is-set/2.0.2: + /is-set@2.0.2: resolution: {integrity: sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==} dev: false - /is-shared-array-buffer/1.0.2: + /is-shared-array-buffer@1.0.2: resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==} dependencies: call-bind: 1.0.2 dev: false - /is-string/1.0.7: + /is-string@1.0.7: resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} engines: {node: '>= 0.4'} dependencies: has-tostringtag: 1.0.0 dev: false - /is-symbol/1.0.4: + /is-symbol@1.0.4: resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} engines: {node: '>= 0.4'} dependencies: has-symbols: 1.0.3 dev: false - /is-typed-array/1.1.10: + /is-typed-array@1.1.10: resolution: {integrity: sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==} engines: {node: '>= 0.4'} dependencies: @@ -1152,59 +1179,59 @@ packages: has-tostringtag: 1.0.0 dev: false - /is-weakmap/2.0.1: + /is-weakmap@2.0.1: resolution: {integrity: sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==} dev: false - /is-weakset/2.0.2: + /is-weakset@2.0.2: resolution: {integrity: sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==} dependencies: call-bind: 1.0.2 get-intrinsic: 1.2.0 dev: false - /isarray/2.0.5: + /isarray@2.0.5: resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} dev: false - /js-levenshtein/1.1.6: + /js-levenshtein@1.1.6: resolution: {integrity: sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==} engines: {node: '>=0.10.0'} dev: false - /js-yaml/4.1.0: + /js-yaml@4.1.0: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} hasBin: true dependencies: argparse: 2.0.1 dev: false - /lodash.sortby/4.7.0: + /lodash.sortby@4.7.0: resolution: {integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==} dev: false - /loglevel/1.8.1: + /loglevel@1.8.1: resolution: {integrity: sha512-tCRIJM51SHjAayKwC+QAg8hT8vg6z7GSgLJKGvzuPb1Wc+hLzqtuVLxp6/HzSPOozuK+8ErAhy7U/sVzw8Dgfg==} engines: {node: '>= 0.6.0'} dev: false - /long/4.0.0: + /long@4.0.0: resolution: {integrity: sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==} dev: false - /lru-cache/6.0.0: + /lru-cache@6.0.0: resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} engines: {node: '>=10'} dependencies: yallist: 4.0.0 dev: false - /lru-cache/7.18.3: + /lru-cache@7.18.3: resolution: {integrity: sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==} engines: {node: '>=12'} dev: false - /make-fetch-happen/11.0.3: + /make-fetch-happen@11.0.3: resolution: {integrity: sha512-oPLh5m10lRNNZDjJ2kP8UpboUx2uFXVaVweVe/lWut4iHWcQEmfqSVJt2ihZsFI8HbpwyyocaXbCAWf0g1ukIA==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dependencies: @@ -1228,53 +1255,53 @@ packages: - supports-color dev: false - /media-typer/0.3.0: + /media-typer@0.3.0: resolution: {integrity: sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=} engines: {node: '>= 0.6'} dev: false - /merge-descriptors/1.0.1: + /merge-descriptors@1.0.1: resolution: {integrity: sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=} dev: false - /methods/1.1.2: + /methods@1.1.2: resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} engines: {node: '>= 0.6'} dev: false - /mime-db/1.52.0: + /mime-db@1.52.0: resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} engines: {node: '>= 0.6'} dev: false - /mime-types/2.1.35: + /mime-types@2.1.35: resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} engines: {node: '>= 0.6'} dependencies: mime-db: 1.52.0 dev: false - /mime/1.6.0: + /mime@1.6.0: resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==} engines: {node: '>=4'} hasBin: true dev: false - /minimatch/8.0.3: + /minimatch@8.0.3: resolution: {integrity: sha512-tEEvU9TkZgnFDCtpnrEYnPsjT7iUx42aXfs4bzmQ5sMA09/6hZY0jeZcGkXyDagiBOvkUjNo8Viom+Me6+2x7g==} engines: {node: '>=16 || 14 >=14.17'} dependencies: brace-expansion: 2.0.1 dev: false - /minipass-collect/1.0.2: + /minipass-collect@1.0.2: resolution: {integrity: sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==} engines: {node: '>= 8'} dependencies: minipass: 3.3.6 dev: false - /minipass-fetch/3.0.1: + /minipass-fetch@3.0.1: resolution: {integrity: sha512-t9/wowtf7DYkwz8cfMSt0rMwiyNIBXf5CKZ3S5ZMqRqMYT0oLTp0x1WorMI9WTwvaPg21r1JbFxJMum8JrLGfw==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dependencies: @@ -1285,40 +1312,40 @@ packages: encoding: 0.1.13 dev: false - /minipass-flush/1.0.5: + /minipass-flush@1.0.5: resolution: {integrity: sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==} engines: {node: '>= 8'} dependencies: minipass: 3.3.6 dev: false - /minipass-pipeline/1.2.4: + /minipass-pipeline@1.2.4: resolution: {integrity: sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==} engines: {node: '>=8'} dependencies: minipass: 3.3.6 dev: false - /minipass-sized/1.0.3: + /minipass-sized@1.0.3: resolution: {integrity: sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==} engines: {node: '>=8'} dependencies: minipass: 3.3.6 dev: false - /minipass/3.3.6: + /minipass@3.3.6: resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} engines: {node: '>=8'} dependencies: yallist: 4.0.0 dev: false - /minipass/4.2.5: + /minipass@4.2.5: resolution: {integrity: sha512-+yQl7SX3bIT83Lhb4BVorMAHVuqsskxRdlmO9kTpyukp8vsm2Sn/fUOV9xlnG8/a5JsypJzap21lz/y3FBMJ8Q==} engines: {node: '>=8'} dev: false - /minizlib/2.1.2: + /minizlib@2.1.2: resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} engines: {node: '>= 8'} dependencies: @@ -1326,34 +1353,34 @@ packages: yallist: 4.0.0 dev: false - /mkdirp/1.0.4: + /mkdirp@1.0.4: resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} engines: {node: '>=10'} hasBin: true dev: false - /ms/2.0.0: + /ms@2.0.0: resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} dev: false - /ms/2.1.2: + /ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} dev: false - /ms/2.1.3: + /ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} dev: false - /negotiator/0.6.3: + /negotiator@0.6.3: resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} engines: {node: '>= 0.6'} dev: false - /node-abort-controller/3.1.1: + /node-abort-controller@3.1.1: resolution: {integrity: sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==} dev: false - /node-fetch/2.6.9: + /node-fetch@2.6.9: resolution: {integrity: sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg==} engines: {node: 4.x || >=6.0.0} peerDependencies: @@ -1365,16 +1392,16 @@ packages: whatwg-url: 5.0.0 dev: false - /object-assign/4.1.1: + /object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} dev: false - /object-inspect/1.12.3: + /object-inspect@1.12.3: resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==} dev: false - /object-is/1.1.5: + /object-is@1.1.5: resolution: {integrity: sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==} engines: {node: '>= 0.4'} dependencies: @@ -1382,12 +1409,12 @@ packages: define-properties: 1.2.0 dev: false - /object-keys/1.1.1: + /object-keys@1.1.1: resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} engines: {node: '>= 0.4'} dev: false - /object.assign/4.1.4: + /object.assign@4.1.4: resolution: {integrity: sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==} engines: {node: '>= 0.4'} dependencies: @@ -1397,26 +1424,26 @@ packages: object-keys: 1.1.1 dev: false - /on-finished/2.4.1: + /on-finished@2.4.1: resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} engines: {node: '>= 0.8'} dependencies: ee-first: 1.1.1 dev: false - /p-map/4.0.0: + /p-map@4.0.0: resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==} engines: {node: '>=10'} dependencies: aggregate-error: 3.1.0 dev: false - /parseurl/1.3.3: + /parseurl@1.3.3: resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} engines: {node: '>= 0.8'} dev: false - /path-scurry/1.6.3: + /path-scurry@1.6.3: resolution: {integrity: sha512-RAmB+n30SlN+HnNx6EbcpoDy9nwdpcGPnEKrJnu6GZoDWBdIjo1UQMVtW2ybtC7LC2oKLcMq8y5g8WnKLiod9g==} engines: {node: '>=16 || 14 >=14.17'} dependencies: @@ -1424,11 +1451,11 @@ packages: minipass: 4.2.5 dev: false - /path-to-regexp/0.1.7: + /path-to-regexp@0.1.7: resolution: {integrity: sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=} dev: false - /pretty-format/29.5.0: + /pretty-format@29.5.0: resolution: {integrity: sha512-V2mGkI31qdttvTFX7Mt4efOqHXqJWMu4/r66Xh3Z3BwZaPfPJgp6/gbwoujRpPUtfEF6AUUWx3Jim3GCw5g/Qw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -1437,7 +1464,7 @@ packages: react-is: 18.2.0 dev: false - /promise-inflight/1.0.1: + /promise-inflight@1.0.1: resolution: {integrity: sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==} peerDependencies: bluebird: '*' @@ -1446,7 +1473,7 @@ packages: optional: true dev: false - /promise-retry/2.0.1: + /promise-retry@2.0.1: resolution: {integrity: sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==} engines: {node: '>=10'} dependencies: @@ -1454,7 +1481,7 @@ packages: retry: 0.12.0 dev: false - /proxy-addr/2.0.7: + /proxy-addr@2.0.7: resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} engines: {node: '>= 0.10'} dependencies: @@ -1462,19 +1489,19 @@ packages: ipaddr.js: 1.9.1 dev: false - /qs/6.11.0: + /qs@6.11.0: resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==} engines: {node: '>=0.6'} dependencies: side-channel: 1.0.4 dev: false - /range-parser/1.2.1: + /range-parser@1.2.1: resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} engines: {node: '>= 0.6'} dev: false - /raw-body/2.5.1: + /raw-body@2.5.1: resolution: {integrity: sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==} engines: {node: '>= 0.8'} dependencies: @@ -1484,7 +1511,7 @@ packages: unpipe: 1.0.0 dev: false - /raw-body/2.5.2: + /raw-body@2.5.2: resolution: {integrity: sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==} engines: {node: '>= 0.8'} dependencies: @@ -1494,11 +1521,11 @@ packages: unpipe: 1.0.0 dev: false - /react-is/18.2.0: + /react-is@18.2.0: resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} dev: false - /regexp.prototype.flags/1.4.3: + /regexp.prototype.flags@1.4.3: resolution: {integrity: sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==} engines: {node: '>= 0.4'} dependencies: @@ -1507,33 +1534,33 @@ packages: functions-have-names: 1.2.3 dev: false - /retry/0.12.0: + /retry@0.12.0: resolution: {integrity: sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==} engines: {node: '>= 4'} dev: false - /retry/0.13.1: + /retry@0.13.1: resolution: {integrity: sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==} engines: {node: '>= 4'} dev: false - /safe-buffer/5.2.1: + /safe-buffer@5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} dev: false - /safer-buffer/2.1.2: + /safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} dev: false - /semver/7.3.8: - resolution: {integrity: sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==} + /semver@7.5.4: + resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} engines: {node: '>=10'} hasBin: true dependencies: lru-cache: 6.0.0 dev: false - /send/0.18.0: + /send@0.18.0: resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==} engines: {node: '>= 0.8.0'} dependencies: @@ -1554,7 +1581,7 @@ packages: - supports-color dev: false - /serve-static/1.15.0: + /serve-static@1.15.0: resolution: {integrity: sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==} engines: {node: '>= 0.8.0'} dependencies: @@ -1566,11 +1593,11 @@ packages: - supports-color dev: false - /setprototypeof/1.2.0: + /setprototypeof@1.2.0: resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} dev: false - /sha.js/2.4.11: + /sha.js@2.4.11: resolution: {integrity: sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==} hasBin: true dependencies: @@ -1578,7 +1605,7 @@ packages: safe-buffer: 5.2.1 dev: false - /side-channel/1.0.4: + /side-channel@1.0.4: resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} dependencies: call-bind: 1.0.2 @@ -1586,12 +1613,12 @@ packages: object-inspect: 1.12.3 dev: false - /smart-buffer/4.2.0: + /smart-buffer@4.2.0: resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==} engines: {node: '>= 6.0.0', npm: '>= 3.0.0'} dev: false - /socks-proxy-agent/7.0.0: + /socks-proxy-agent@7.0.0: resolution: {integrity: sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww==} engines: {node: '>= 10'} dependencies: @@ -1602,7 +1629,7 @@ packages: - supports-color dev: false - /socks/2.7.1: + /socks@2.7.1: resolution: {integrity: sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==} engines: {node: '>= 10.13.0', npm: '>= 3.0.0'} dependencies: @@ -1610,33 +1637,33 @@ packages: smart-buffer: 4.2.0 dev: false - /ssri/10.0.2: + /ssri@10.0.2: resolution: {integrity: sha512-LWMXUSh7fEfCXNBq4UnRzC4Qc5Y1PPg5ogmb+6HX837i2cKzjB133aYmQ4lgO0shVTcTQHquKp3v5bn898q3Sw==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dependencies: minipass: 4.2.5 dev: false - /statuses/2.0.1: + /statuses@2.0.1: resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} engines: {node: '>= 0.8'} dev: false - /stop-iteration-iterator/1.0.0: + /stop-iteration-iterator@1.0.0: resolution: {integrity: sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==} engines: {node: '>= 0.4'} dependencies: internal-slot: 1.0.5 dev: false - /supports-color/7.2.0: + /supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} dependencies: has-flag: 4.0.0 dev: false - /tar/6.1.13: + /tar@6.1.13: resolution: {integrity: sha512-jdIBIN6LTIe2jqzay/2vtYLlBHa3JF42ot3h1dW8Q0PaAG4v8rm0cvpVePtau5C6OKXGGcgO9q2AMNSWxiLqKw==} engines: {node: '>=10'} dependencies: @@ -1648,25 +1675,25 @@ packages: yallist: 4.0.0 dev: false - /toidentifier/1.0.1: + /toidentifier@1.0.1: resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} engines: {node: '>=0.6'} dev: false - /tr46/0.0.3: + /tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} dev: false - /ts-graphviz/1.5.5: + /ts-graphviz@1.5.5: resolution: {integrity: sha512-abon0Tlcgvxcqr8x+p8QH1fTbR2R4cEXKGZfT4OJONZWah2YfqkmERb6hrr82omAc1IHwk5PlF8g4BS/ECYvwQ==} engines: {node: '>=14.16'} dev: false - /tslib/2.5.0: + /tslib@2.5.0: resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==} dev: false - /type-is/1.6.18: + /type-is@1.6.18: resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} engines: {node: '>= 0.6'} dependencies: @@ -1674,62 +1701,62 @@ packages: mime-types: 2.1.35 dev: false - /unique-filename/3.0.0: + /unique-filename@3.0.0: resolution: {integrity: sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dependencies: unique-slug: 4.0.0 dev: false - /unique-slug/4.0.0: + /unique-slug@4.0.0: resolution: {integrity: sha512-WrcA6AyEfqDX5bWige/4NQfPZMtASNVxdmWR76WESYQVAACSgWcR6e9i0mofqqBxYFtL4oAxPIptY73/0YE1DQ==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dependencies: imurmurhash: 0.1.4 dev: false - /unpipe/1.0.0: + /unpipe@1.0.0: resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} engines: {node: '>= 0.8'} dev: false - /utils-merge/1.0.1: + /utils-merge@1.0.1: resolution: {integrity: sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=} engines: {node: '>= 0.4.0'} dev: false - /uuid/9.0.0: + /uuid@9.0.0: resolution: {integrity: sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==} hasBin: true dev: false - /value-or-promise/1.0.12: + /value-or-promise@1.0.12: resolution: {integrity: sha512-Z6Uz+TYwEqE7ZN50gwn+1LCVo9ZVrpxRPOhOLnncYkY1ZzOYtrX8Fwf/rFktZ8R5mJms6EZf5TqNOMeZmnPq9Q==} engines: {node: '>=12'} dev: false - /vary/1.1.2: + /vary@1.1.2: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} dev: false - /webidl-conversions/3.0.1: + /webidl-conversions@3.0.1: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} dev: false - /whatwg-mimetype/3.0.0: + /whatwg-mimetype@3.0.0: resolution: {integrity: sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==} engines: {node: '>=12'} dev: false - /whatwg-url/5.0.0: + /whatwg-url@5.0.0: resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} dependencies: tr46: 0.0.3 webidl-conversions: 3.0.1 dev: false - /which-boxed-primitive/1.0.2: + /which-boxed-primitive@1.0.2: resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} dependencies: is-bigint: 1.0.4 @@ -1739,7 +1766,7 @@ packages: is-symbol: 1.0.4 dev: false - /which-collection/1.0.1: + /which-collection@1.0.1: resolution: {integrity: sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==} dependencies: is-map: 2.0.2 @@ -1748,7 +1775,7 @@ packages: is-weakset: 2.0.2 dev: false - /which-typed-array/1.1.9: + /which-typed-array@1.1.9: resolution: {integrity: sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==} engines: {node: '>= 0.4'} dependencies: @@ -1760,6 +1787,6 @@ packages: is-typed-array: 1.1.10 dev: false - /yallist/4.0.0: + /yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} dev: false diff --git a/apps/gateway/src/index.js b/apps/gateway/src/index.js index 3986a0106..ff2dc747c 100644 --- a/apps/gateway/src/index.js +++ b/apps/gateway/src/index.js @@ -1,8 +1,7 @@ -import { ApolloServer } from '@apollo/server'; -import { startStandaloneServer } from '@apollo/server/standalone'; -import { expressMiddleware } from '@apollo/server/express4'; +import {ApolloServer} from '@apollo/server'; +import {expressMiddleware} from '@apollo/server/express4'; import express from 'express'; -import { ApolloGateway, RemoteGraphQLDataSource, IntrospectAndCompose } from '@apollo/gateway'; +import {ApolloGateway, IntrospectAndCompose, RemoteGraphQLDataSource} from '@apollo/gateway'; import fs from 'fs/promises'; import yaml from 'js-yaml'; import assert from 'assert'; @@ -13,21 +12,8 @@ const useEnv = (key) => { return v }; -// const cfgMap = yaml.load(await fs.readFile(useEnv("SUPERGRAPH_CONFIG"), 'utf8')); -const cfgMap = { - serviceList: [ - { name: 'auth-api', url: 'http://auth-api.kl-core.svc.cluster.local/query' }, - { name: 'infra-api', url: 'http://infra-api.kl-core.svc.cluster.local/query' }, - { name: 'console-api', url: 'http://console-api.kl-core.svc.cluster.local/query' }, - { name: 'finance-api', url: 'http://finance-api.kl-core.svc.cluster.local/query' }, - { name: 'message-office-api', url: 'http://message-office-api.kl-core.svc.cluster.local/query' }, - ] -} +const cfgMap = yaml.load(await fs.readFile(useEnv("SUPERGRAPH_CONFIG"), 'utf8')); -// const supergraphSdl = ( -// await fs.readFile(useEnv('SUPERGRAPH_CONFIG'), 'utf8') -// ).toString(); -// class CustomDataSource extends RemoteGraphQLDataSource { // eslint-disable-next-line class-methods-use-this willSendRequest({ request, context }) { @@ -77,7 +63,7 @@ const server = new ApolloServer({ const app = express() await server.start() -app.get("/health", (req, res) => { +app.get("/healthz", (req, res) => { return res.sendStatus(200); }) @@ -94,3 +80,25 @@ app.listen(port, (err) => { } console.log(`🚀 Federation Gateway ready at :${port}`); }) + +console.log(String.raw` + , + ##### + ######## + ######## + ######## ##### + ######## *######### ██╗ ██╗██╗ ██████╗ ██╗ ██╗██████╗ ██╗ ██╗████████╗███████╗ + ######## ############### ██║ ██╔╝██║ ██╔═══██╗██║ ██║██╔══██╗██║ ██║╚══██╔══╝██╔════╝ + ######## *################### █████╔╝ ██║ ██║ ██║██║ ██║██║ ██║██║ ██║ ██║ █████╗ + #######/ ######################## ██╔═██╗ ██║ ██║ ██║██║ ██║██║ ██║██║ ██║ ██║ ██╔══╝ + #######( ################### ██║ ██╗███████╗╚██████╔╝╚██████╔╝██████╔╝███████╗██║ ██║ ███████╗ + (#######. ##############* ╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝ ╚══════╝ + ######## #(####### + (#######. ####* __ ___ __ + ######## |__) |__ /\ | \ \ / + /######(. | \ |___ /~~\ |__/ | + ##### + , + +`) + diff --git a/apps/iam/Containerfile.local b/apps/iam/Containerfile.local new file mode 100644 index 000000000..5b9fcdec2 --- /dev/null +++ b/apps/iam/Containerfile.local @@ -0,0 +1,6 @@ +# syntax=docker/dockerfile:1 +FROM gcr.io/distroless/static-debian11:nonroot +WORKDIR /app +ARG APP +COPY --from=builder --chown=1001 $APP ./iam +ENTRYPOINT ["./iam"] diff --git a/apps/iam/Dockerfile b/apps/iam/Dockerfile index a95cc8d9c..5ea307ecb 100644 --- a/apps/iam/Dockerfile +++ b/apps/iam/Dockerfile @@ -19,6 +19,5 @@ RUN chmod +x /tmp/bin/$APP FROM gcr.io/distroless/static-debian11 USER 1001 WORKDIR /tmp/app -# COPY ./configs/iam.json ./configs/iam.json COPY --from=base --chown=1001 /tmp/bin/iam ./iam CMD ["./iam"] diff --git a/apps/iam/Taskfile.yml b/apps/iam/Taskfile.yml index 2d966384c..2df616a24 100644 --- a/apps/iam/Taskfile.yml +++ b/apps/iam/Taskfile.yml @@ -8,6 +8,9 @@ includes: taskfile: ../../grpc-interfaces/Taskfile.yml dir: ../../grpc-interfaces/ +vars: + ImagePrefix: "ghcr.io/kloudlite/api" + tasks: proto: cmds: @@ -16,86 +19,37 @@ tasks: build: env: CGO_ENABLED: 0 + GOOS: linux + GOARCH: amd64 + vars: + BuiltAt: + sh: date | sed 's/\s/_/g' preconditions: - sh: '[ -n "{{.Out}}" ]' msg: var Out must have a value cmds: - - go build -ldflags="-s -w" -o {{.Out}} + - go build -ldflags="-s -w -X kloudlite.io/common.BuiltAt=\"{{.BuiltAt}}\"" -o {{.Out}} - upx {{.Out}} run: dotenv: - .secrets/env - # deps: [killPort] - # sources: - # - ./**/*.go - # - main.go cmds: - go run ./main.go - # - nodemon -q -w '**/*' -e go --signal SIGKILL --exec 'go run ./main.go || exit 1' - # nethod: timestamp - - killPort: - run: always - cmds: - - | - PID=$(lsof -t -i:3000) - echo "$PID" - if [ "$PID" != "" ]; then - kill -9 $PID - fi - silent: true - - docker-build: - vars: - APP: iam - IMAGE: registry.kloudlite.io/kloudlite/{{.EnvName}}/{{.APP}}:{{.Tag}} - preconditions: - - sh: '[[ -n "{{.Tag}}" ]]' - msg: 'var Tag must have a value' - - - sh: '[[ "{{.EnvName}}" == "development" ]] || [[ "{{.EnvName}}" == "staging" ]] || [[ "{{.EnvName}}" == "production" ]]' - msg: 'var EnvName must have one of [development, staging, production] as its value' - cmds: - - docker buildx build -f ./Dockerfile -t {{.IMAGE}} . --build-arg APP={{.APP}} --platform linux/amd64 --build-context project-root=../.. - - docker push {{.IMAGE}} - local-build: vars: APP: iam - IMAGE: registry.kloudlite.io/kloudlite/{{.EnvName}}/{{.APP}}-api:{{.Tag}} + IMAGE: "{{.ImagePrefix}}/{{.APP}}:{{.Tag}}" preconditions: - sh: '[[ -n "{{.Tag}}" ]]' msg: 'var Tag must have a value' - - - sh: '[[ "{{.EnvName}}" == "development" ]] || [[ "{{.EnvName}}" == "staging" ]] || [[ "{{.EnvName}}" == "production" ]]' - msg: 'var EnvName must have one of [development, staging, production] as its value' - env: - CGO_ENABLED: 0 - GOOS: linux - GOARCH: amd64 silent: true cmds: - |+ - lineNumbers=$(cat Dockerfile | grep -i '^FROM' -n | tail +2 | awk -F: '{print $1}') - - startLineNo=$(echo "$lineNumbers" | head -n+1) - finalLineNo=$(echo "$lineNumbers" | tail -1) - - tDir=$(mktemp -d) - - nDockerfile=$(cat Dockerfile | tail --lines=+$startLineNo | grep -i --invert-match 'from=base') - echo "$nDockerfile" | sed "1 i # syntax=docker/dockerfile:1.4" > $tDir/Dockerfile.base - - #lineNo=$(cat Dockerfile | grep -i '^FROM' -n | tail -1 | awk -F: '{print $1}') - - cat $tDir/Dockerfile.base | sed "5 i COPY --from=local-builder ./{{.APP}} ./{{.APP}}" > $tDir/Dockerfile - cat $tDir/Dockerfile - - # CGO_ENABLED=0 go build -o $tDir/{{.APP}} . - task build Out=$tDir/{{.APP}} + tdir=$(mktemp -d) + task build Out=$tdir/{{.APP}} - docker buildx build -f $tDir/Dockerfile -t {{.IMAGE}} . --build-context local-builder=${tDir} - docker push {{.IMAGE}} - rm -rf $tDir + podman buildx build -f ./Containerfile.local -t {{.IMAGE}} . --build-context builder=${tdir} --build-arg APP="{{.APP}}" + podman push {{.IMAGE}} + rm -rf $tdir diff --git a/apps/iam/internal/app/action-role-binding.go b/apps/iam/internal/app/action-role-binding.go new file mode 100644 index 000000000..df476f83e --- /dev/null +++ b/apps/iam/internal/app/action-role-binding.go @@ -0,0 +1,114 @@ +package app + +import ( + t "github.com/kloudlite/api/apps/iam/types" +) + +type RoleBindingMap map[t.Action][]t.Role + +var roleBindings RoleBindingMap = RoleBindingMap{ + // for accounts + t.CreateAccount: []t.Role{t.RoleAccountOwner}, + t.GetAccount: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleAccountMember, t.RoleProjectAdmin, t.RoleProjectMember}, + t.UpdateAccount: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, + t.DeleteAccount: []t.Role{t.RoleAccountOwner}, + + // for account invitations + t.ListAccountInvitations: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, + t.GetAccountInvitation: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, + t.DeleteAccountInvitation: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, + + t.ReadLogs: []t.Role{t.RoleAccountMember}, + t.ReadMetrics: []t.Role{t.RoleAccountMember}, + + // for account advance actions + t.DeactivateAccount: []t.Role{t.RoleAccountOwner}, + t.ActivateAccount: []t.Role{t.RoleAccountOwner}, + + // for account membership + t.InviteAccountAdmin: []t.Role{t.RoleAccountOwner}, + t.InviteAccountMember: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, + t.UpdateAccountMembership: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, // should not update role of himself + t.RemoveAccountMembership: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, + t.ListMembershipsForAccount: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, + + // for clusters + t.CreateCluster: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, + t.DeleteCluster: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, + t.UpdateCluster: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, + t.ListClusters: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleAccountMember, t.RoleProjectAdmin, t.RoleProjectMember}, + t.GetCluster: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleAccountAdmin, t.RoleProjectAdmin, t.RoleProjectMember}, + + // for helm release + t.CreateHelmRelease: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, + t.DeleteHelmRelease: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, + t.UpdateHelmRelease: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, + t.ListHelmReleases: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleAccountMember}, + t.GetHelmRelease: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleAccountAdmin}, + + // for clusterManagedService + t.CreateClusterManagedService: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, + t.DeleteClusterManagedService: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, + t.UpdateClusterManagedService: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, + t.ListClusterManagedServices: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleAccountMember}, + t.GetClusterManagedService: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleAccountAdmin}, + + // for domain entries + t.CreateDomainEntry: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, + t.UpdateDomainEntry: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, + t.DeleteDomainEntry: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, + t.ListDomainEntries: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleAccountMember, t.RoleProjectAdmin, t.RoleProjectMember}, + t.GetDomainEntry: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleAccountMember, t.RoleProjectAdmin, t.RoleProjectMember}, + + // for nodepools + t.CreateNodepool: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, + t.UpdateNodepool: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, + t.DeleteNodepool: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, + t.ListNodepools: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleAccountMember, t.RoleProjectAdmin, t.RoleProjectMember}, + t.GetNodepool: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleAccountMember, t.RoleProjectAdmin, t.RoleProjectMember}, + + // for cloud provider secrets + t.CreateCloudProviderSecret: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, + t.UpdateCloudProviderSecret: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, + t.DeleteCloudProviderSecret: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, + t.ListCloudProviderSecrets: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, + t.GetCloudProviderSecret: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, + + // for projects + t.CreateProject: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, + t.ListProjects: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin, t.RoleProjectMember}, + t.GetProject: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin, t.RoleProjectMember}, + t.UpdateProject: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin, t.RoleProjectMember}, + t.DeleteProject: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin}, + + // for project invitations + t.InviteProjectAdmin: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, + t.InviteProjectMember: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin}, + t.ListProjectInvitations: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin}, + t.GetProjectInvitation: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin}, + t.DeleteProjectInvitation: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin}, + + t.MutateResourcesInProject: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin, t.RoleProjectMember}, + + t.ListMembershipsForProject: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin}, + t.UpdateProjectMembership: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin}, + t.RemoveProjectMembership: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin}, + + // for environments + t.ListEnvironments: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin, t.RoleProjectMember}, + t.GetEnvironment: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin, t.RoleProjectMember}, + t.CreateEnvironment: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin, t.RoleProjectMember}, + t.UpdateEnvironment: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin, t.RoleResourceOwner}, + t.DeleteEnvironment: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin, t.RoleResourceOwner}, + + t.ReadResourcesInEnvironment: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin, t.RoleProjectMember}, + t.MutateResourcesInEnvironment: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin, t.RoleResourceOwner}, + + // for vpn devices + t.ListVPNDevices: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin, t.RoleProjectMember}, + t.GetVPNDevice: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin, t.RoleProjectMember}, + t.CreateVPNDevice: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin, t.RoleProjectMember}, + t.UpdateVPNDevice: []t.Role{t.RoleResourceOwner}, + t.DeleteVPNDevice: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin, t.RoleResourceOwner}, + t.GetVPNDeviceConnectConfig: []t.Role{t.RoleResourceOwner}, +} diff --git a/apps/iam/internal/app/grpc-server.go b/apps/iam/internal/app/grpc-server.go new file mode 100644 index 000000000..94173dd2c --- /dev/null +++ b/apps/iam/internal/app/grpc-server.go @@ -0,0 +1,224 @@ +package app + +import ( + "context" + "strings" + + "github.com/kloudlite/api/apps/iam/internal/entities" + "github.com/kloudlite/api/pkg/grpc" + + t "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/api/pkg/repos" +) + +type IAMGrpcServer grpc.Server + +type GrpcService struct { + iam.UnimplementedIAMServer + logger logging.Logger + rbRepo repos.DbRepo[*entities.RoleBinding] + roleBindingMap map[t.Action][]t.Role +} + +// UpdateMembership updates only the role for a user on already specified resource_ref +func (s *GrpcService) UpdateMembership(ctx context.Context, in *iam.UpdateMembershipIn) (*iam.UpdateMembershipOut, error) { + rb, err := s.rbRepo.FindOne( + ctx, repos.Filter{ + "user_id": in.UserId, + "resource_ref": in.ResourceRef, + "resource_type": in.ResourceType, + }, + ) + if err != nil { + return nil, errors.NewE(err) + } + if rb == nil { + return nil, errors.Newf("role binding for (userId=%q, ResourceRef=%q, ResourceType=%q) not found", in.UserId, in.ResourceRef, in.ResourceType) + } + + rb.Role = t.Role(in.Role) + + if _, err = s.rbRepo.UpdateById(ctx, rb.Id, rb); err != nil { + return nil, errors.NewE(err) + } + + return &iam.UpdateMembershipOut{ + Result: true, + }, nil +} + +func (s *GrpcService) findRoleBinding(ctx context.Context, userId repos.ID, resourceRef string) (*entities.RoleBinding, error) { + rb, err := s.rbRepo.FindOne( + ctx, repos.Filter{ + "user_id": userId, + "resource_ref": resourceRef, + }, + ) + if err != nil { + return nil, errors.NewE(err) + } + if rb == nil { + return nil, errors.Newf("role binding for (userId=%s, ResourceRef=%s) not found", userId, resourceRef) + } + return rb, nil +} + +func (s *GrpcService) GetMembership(ctx context.Context, in *iam.GetMembershipIn) (*iam.GetMembershipOut, error) { + rb, err := s.findRoleBinding(ctx, repos.ID(in.UserId), in.ResourceRef) + if err != nil { + return nil, errors.NewE(err) + } + return &iam.GetMembershipOut{ + UserId: rb.UserId, + ResourceRef: rb.ResourceRef, + Role: string(rb.Role), + }, nil +} + +func (s *GrpcService) ListMembershipsForResource(ctx context.Context, in *iam.MembershipsForResourceIn) (*iam.ListMembershipsOut, error) { + filter := repos.Filter{} + if in.ResourceRef != "" { + filter["resource_ref"] = in.ResourceRef + } + if in.ResourceType != "" { + filter["resource_type"] = in.ResourceType + } + + rbs, err := s.rbRepo.Find(ctx, repos.Query{Filter: filter}) + if err != nil { + return nil, errors.NewEf(err, "could not find memberships by (ResourceRef=%q, resourceType=%q)", in.ResourceRef, in.ResourceType) + } + + var result []*iam.RoleBinding + for _, rb := range rbs { + result = append( + result, &iam.RoleBinding{ + UserId: rb.UserId, + ResourceType: string(rb.ResourceType), + ResourceRef: rb.ResourceRef, + Role: string(rb.Role), + }, + ) + } + + return &iam.ListMembershipsOut{ + RoleBindings: result, + }, nil +} + +func (s *GrpcService) Can(ctx context.Context, in *iam.CanIn) (*iam.CanOut, error) { + if strings.HasPrefix(in.UserId, "sys-user") { + return &iam.CanOut{Status: true}, nil + } + + rbs, err := s.rbRepo.Find( + ctx, repos.Query{Filter: repos.Filter{ + "resource_ref": map[string]any{"$in": in.ResourceRefs}, + "user_id": in.UserId, + }}, + ) + if err != nil { + return nil, errors.NewEf(err, "could not find rolebindings for (resourceRefs=%s)", strings.Join(in.ResourceRefs, ",")) + } + + if rbs == nil { + return nil, errors.Newf("no rolebinding found for (userId=%s, resourceRefs=%s)", in.UserId, strings.Join(in.ResourceRefs, ",")) + } + + for i := range rbs { + // 2nd loop, but very small length (always < #roles), so it's not exactly O(n^2), much like XO(n) + for _, role := range s.roleBindingMap[t.Action(in.Action)] { + if role == rbs[i].Role { + return &iam.CanOut{Status: true}, nil + } + } + } + + return &iam.CanOut{Status: false}, nil +} + +func (s *GrpcService) ListMembershipsForUser(ctx context.Context, in *iam.MembershipsForUserIn) (*iam.ListMembershipsOut, error) { + filter := repos.Filter{"user_id": in.UserId} + if in.ResourceType != "" { + filter["resource_type"] = in.ResourceType + } + + rbs, err := s.rbRepo.Find(ctx, repos.Query{Filter: filter}) + if err != nil { + return nil, errors.NewEf(err, "could not find memberships by (userId=%q)", in.UserId) + } + + result := make([]*iam.RoleBinding, 0, len(rbs)) + for i := range rbs { + result = append( + result, &iam.RoleBinding{ + UserId: rbs[i].UserId, + ResourceType: string(rbs[i].ResourceType), + ResourceRef: rbs[i].ResourceRef, + Role: string(rbs[i].Role), + }, + ) + } + + return &iam.ListMembershipsOut{ + RoleBindings: result, + }, nil +} + +func (s *GrpcService) AddMembership(ctx context.Context, in *iam.AddMembershipIn) (*iam.AddMembershipOut, error) { + _, err := s.rbRepo.Create( + ctx, &entities.RoleBinding{ + UserId: in.UserId, + ResourceType: t.ResourceType(in.ResourceType), + ResourceRef: in.ResourceRef, + Role: t.Role(in.Role), + }, + ) + if err != nil { + return nil, errors.NewEf(err, "could not create rolebinding") + } + return &iam.AddMembershipOut{Result: true}, nil +} + +func (s *GrpcService) RemoveMembership(ctx context.Context, in *iam.RemoveMembershipIn) (*iam.RemoveMembershipOut, error) { + s.logger.Debugf("received request for membership deletion for userid=%s, resourceRef=%s", in.UserId, in.ResourceRef) + if in.UserId == "" || in.ResourceRef == "" { + return nil, errors.Newf("userId or resourceRef is empty, rejecting") + } + + rb, err := s.findRoleBinding(ctx, repos.ID(in.UserId), in.ResourceRef) + if err != nil { + return nil, errors.NewE(err) + } + + if err := s.rbRepo.DeleteById(ctx, rb.Id); err != nil { + return nil, errors.NewEf(err, "could not delete resource for (userId=%s, resourceRef=%s)", in.UserId, in.ResourceRef) + } + s.logger.Debugf("removed user (%s) membership resourceRef=%s", in.UserId, in.ResourceRef) + + return &iam.RemoveMembershipOut{Result: true}, nil +} + +func (s *GrpcService) RemoveResource(ctx context.Context, in *iam.RemoveResourceIn) (*iam.RemoveResourceOut, error) { + if err := s.rbRepo.DeleteMany(ctx, repos.Filter{"resource_ref": in.ResourceRef}); err != nil { + return nil, errors.NewEf(err, "could not delete resources for (resourceRef=%s)", in.ResourceRef) + } + return &iam.RemoveResourceOut{Result: true}, nil +} + +func (s *GrpcService) Ping(ctx context.Context, in *iam.Message) (*iam.Message, error) { + return &iam.Message{ + Message: "ping", + }, nil +} + +func newIAMGrpcService(logger logging.Logger, rbRepo repos.DbRepo[*entities.RoleBinding], roleBindingMap map[t.Action][]t.Role) iam.IAMServer { + return &GrpcService{ + logger: logger, + rbRepo: rbRepo, + roleBindingMap: roleBindingMap, + } +} diff --git a/apps/iam/internal/app/grpc-server.go.bkp b/apps/iam/internal/app/grpc-server.go.bkp new file mode 100644 index 000000000..33ccb90fe --- /dev/null +++ b/apps/iam/internal/app/grpc-server.go.bkp @@ -0,0 +1,281 @@ +package app + +import ( + "context" + "fmt" + "kloudlite.io/apps/iam/internal/entities" + "kloudlite.io/pkg/grpc" + "strings" + + t "kloudlite.io/apps/iam/types" + "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/iam" + "kloudlite.io/pkg/errors" + "kloudlite.io/pkg/logging" + "kloudlite.io/pkg/repos" +) + +type IAMGrpcServer grpc.Server + +type GrpcService struct { + iam.UnimplementedIAMServer + logger logging.Logger + rbRepo repos.DbRepo[*entities.RoleBinding] + roleBindingMap map[t.Action][]t.Role +} + +// UpdateMembership updates only the role for a user on already specified resource_ref +func (s *GrpcService) UpdateMembership(ctx context.Context, in *iam.UpdateMembershipIn) (*iam.UpdateMembershipOut, error) { + rb, err := s.rbRepo.FindOne( + ctx, repos.Filter{ + "user_id": in.UserId, + "resource_ref": in.ResourceRef, + "resource_type": in.ResourceType, + }, + ) + if err != nil { + return nil, err + } + if rb == nil { + return nil, errors.Newf("role binding for (userId=%q, ResourceRef=%q, ResourceType=%q) not found", in.UserId, in.ResourceRef, in.ResourceType) + } + + rb.Role = t.Role(in.Role) + + if _, err = s.rbRepo.UpdateById(ctx, rb.Id, rb); err != nil { + return nil, err + } + + return &iam.UpdateMembershipOut{ + Result: true, + }, nil +} + +func (s *GrpcService) findRoleBinding(ctx context.Context, userId repos.ID, resourceRef string) (*entities.RoleBinding, error) { + rb, err := s.rbRepo.FindOne( + ctx, repos.Filter{ + "user_id": userId, + "resource_ref": resourceRef, + }, + ) + if err != nil { + return nil, err + } + if rb == nil { + return nil, errors.Newf("role binding for (userId=%s, ResourceRef=%s) not found", userId, resourceRef) + } + return rb, nil +} + +//func (s *GrpcService) ConfirmMembership(ctx context.Context, in *iam.ConfirmMembershipIn) (*iam.ConfirmMembershipOut, error) { +// //rb, err := s.findRoleBinding(ctx, repos.ID(in.UserId), in.ResourceRef) +// //if err != nil { +// // return nil, err +// //} +// // +// //if t.Role(in.Role) != rb.Role { +// // return nil, errors.New("The invitation has been updated") +// //} +// // +// //_, err = s.rbRepo.UpdateById(ctx, rb.Id, rb) +// //if err != nil { +// // return nil, err +// //} +// //return &iam.ConfirmMembershipOut{}, nil +// return nil, errors.Newf("not implemented") +//} + +//func (s *GrpcService) InviteMembership(ctx context.Context, in *iam.AddMembershipIn) (*iam.AddMembershipOut, error) { +// rb, err := s.rbRepo.FindOne( +// ctx, repos.Filter{ +// "user_id": in.UserId, +// "resource_ref": in.ResourceRef, +// }, +// ) +// if err != nil { +// return nil, err +// } +// +// if rb != nil { +// if string(rb.Role) == in.Role { +// s.logger.Infof("user %s already has role %s on resource %s", in.UserId, in.Role, in.ResourceRef) +// return &iam.AddMembershipOut{Result: true}, nil +// } +// rb.Role = t.Role(in.Role) +// //rb.Accepted = false +// _, err := s.rbRepo.UpdateById(ctx, rb.Id, rb) +// if err != nil { +// return nil, err +// } +// return &iam.AddMembershipOut{Result: true}, nil +// } +// +// _, err = s.rbRepo.Create( +// ctx, &entities.RoleBinding{ +// UserId: in.UserId, +// ResourceType: t.ResourceType(in.ResourceType), +// ResourceRef: in.ResourceRef, +// Role: t.Role(in.Role), +// //Accepted: false, +// }, +// ) +// if err != nil { +// return nil, errors.NewEf(err, "could not create rolebinding") +// } +// return &iam.AddMembershipOut{Result: true}, nil +//} + +func (s *GrpcService) GetMembership(ctx context.Context, in *iam.GetMembershipIn) (*iam.GetMembershipOut, error) { + rb, err := s.findRoleBinding(ctx, repos.ID(in.UserId), in.ResourceRef) + if err != nil { + return nil, err + } + return &iam.GetMembershipOut{ + UserId: rb.UserId, + ResourceRef: rb.ResourceRef, + Role: string(rb.Role), + }, nil +} + +func (s *GrpcService) ListMembershipsForResource(ctx context.Context, in *iam.MembershipsForResourceIn) (*iam.ListMembershipsOut, error) { + filter := repos.Filter{} + if in.ResourceRef != "" { + filter["resource_ref"] = in.ResourceRef + } + if in.ResourceType != "" { + filter["resource_type"] = in.ResourceType + } + + rbs, err := s.rbRepo.Find(ctx, repos.Query{Filter: filter}) + if err != nil { + return nil, errors.NewEf(err, "could not find memberships by (ResourceRef=%q, resourceType=%q)", in.ResourceRef, in.ResourceType) + } + + var result []*iam.RoleBinding + for _, rb := range rbs { + result = append( + result, &iam.RoleBinding{ + UserId: rb.UserId, + ResourceType: string(rb.ResourceType), + ResourceRef: rb.ResourceRef, + Role: string(rb.Role), + }, + ) + } + + return &iam.ListMembershipsOut{ + RoleBindings: result, + }, nil +} + +func (s *GrpcService) Can(ctx context.Context, in *iam.CanIn) (*iam.CanOut, error) { + rbs, err := s.rbRepo.Find( + ctx, repos.Query{Filter: repos.Filter{ + "resource_ref": map[string]any{"$in": in.ResourceRefs}, + "user_id": in.UserId, + }}, + ) + + if err != nil { + return nil, errors.NewEf(err, "could not find rolebindings for (resourceRefs=%s)", strings.Join(in.ResourceRefs, ",")) + } + + if rbs == nil { + return nil, errors.Newf("no rolebinding found for (userId=%s, resourceRefs=%s)", in.UserId, strings.Join(in.ResourceRefs, ",")) + } + + if strings.HasPrefix(in.UserId, "sys-user") { + return &iam.CanOut{Status: true}, nil + } + + for i := range rbs { + // 2nd loop, but very small length (always < #roles), so it's not exactly O(n^2), much like XO(n) + for _, role := range s.roleBindingMap[t.Action(in.Action)] { + if role == rbs[i].Role { + return &iam.CanOut{Status: true}, nil + } + } + } + + return &iam.CanOut{Status: false}, nil +} + +func (s *GrpcService) ListMembershipsForUser(ctx context.Context, in *iam.MembershipsForUserIn) (*iam.ListMembershipsOut, error) { + filter := repos.Filter{"user_id": in.UserId} + if in.ResourceType != "" { + filter["resource_type"] = in.ResourceType + } + + rbs, err := s.rbRepo.Find(ctx, repos.Query{Filter: filter}) + if err != nil { + return nil, errors.NewEf(err, "could not find memberships by (userId=%q)", in.UserId) + } + + result := make([]*iam.RoleBinding, 0, len(rbs)) + for i := range rbs { + result = append( + result, &iam.RoleBinding{ + UserId: rbs[i].UserId, + ResourceType: string(rbs[i].ResourceType), + ResourceRef: rbs[i].ResourceRef, + Role: string(rbs[i].Role), + }, + ) + } + + return &iam.ListMembershipsOut{ + RoleBindings: result, + }, nil +} + +func (s *GrpcService) AddMembership(ctx context.Context, in *iam.AddMembershipIn) (*iam.AddMembershipOut, error) { + _, err := s.rbRepo.Create( + ctx, &entities.RoleBinding{ + UserId: in.UserId, + ResourceType: t.ResourceType(in.ResourceType), + ResourceRef: in.ResourceRef, + Role: t.Role(in.Role), + }, + ) + if err != nil { + return nil, errors.NewEf(err, "could not create rolebinding") + } + return &iam.AddMembershipOut{Result: true}, nil +} + +func (s *GrpcService) RemoveMembership(ctx context.Context, in *iam.RemoveMembershipIn) (*iam.RemoveMembershipOut, error) { + if in.UserId == "" || in.ResourceRef == "" { + return nil, errors.Newf("userId or resourceRef is empty, rejecting") + } + + rb, err := s.findRoleBinding(ctx, repos.ID(in.UserId), in.ResourceRef) + if err != nil { + return nil, err + } + + if err := s.rbRepo.DeleteById(ctx, rb.Id); err != nil { + return nil, errors.NewEf(err, "could not delete resource for (userId=%s, resourceRef=%s)", in.UserId, in.ResourceRef) + } + + return &iam.RemoveMembershipOut{Result: true}, nil +} + +func (s *GrpcService) RemoveResource(ctx context.Context, in *iam.RemoveResourceIn) (*iam.RemoveResourceOut, error) { + if err := s.rbRepo.DeleteMany(ctx, repos.Filter{"resource_ref": in.ResourceRef}); err != nil { + return nil, errors.NewEf(err, "could not delete resources for (resourceRef=%s)", in.ResourceRef) + } + return &iam.RemoveResourceOut{Result: true}, nil +} + +func (s *GrpcService) Ping(ctx context.Context, in *iam.Message) (*iam.Message, error) { + return &iam.Message{ + Message: "ping", + }, nil +} + +func newIAMGrpcService(logger logging.Logger, rbRepo repos.DbRepo[*entities.RoleBinding], roleBindingMap map[t.Action][]t.Role) iam.IAMServer { + return &GrpcService{ + logger: logger, + rbRepo: rbRepo, + roleBindingMap: roleBindingMap, + } +} diff --git a/apps/iam/internal/app/main.go b/apps/iam/internal/app/main.go new file mode 100644 index 000000000..eb9a2105a --- /dev/null +++ b/apps/iam/internal/app/main.go @@ -0,0 +1,45 @@ +package app + +import ( + "encoding/json" + "github.com/kloudlite/api/apps/iam/internal/entities" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/logging" + "os" + + "github.com/kloudlite/api/apps/iam/internal/env" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" + "github.com/kloudlite/api/pkg/repos" + "go.uber.org/fx" +) + +var Module = fx.Module( + "app", + fx.Provide(func(ev *env.Env) (RoleBindingMap, error) { + if ev.ActionRoleMapFile != "" { + b, err := os.ReadFile(ev.ActionRoleMapFile) + if err != nil { + return nil, errors.NewE(err) + } + var rbm RoleBindingMap + if err := json.Unmarshal(b, &rbm); err != nil { + return nil, errors.NewE(err) + } + return rbm, nil + } + + return roleBindings, nil + }), + + repos.NewFxMongoRepo[*entities.RoleBinding]("role_bindings", "rb", entities.RoleBindingIndices), + + fx.Provide(func(logger logging.Logger, rbRepo repos.DbRepo[*entities.RoleBinding], rbm RoleBindingMap) iam.IAMServer { + return newIAMGrpcService(logger, rbRepo, rbm) + }), + + fx.Invoke( + func(server IAMGrpcServer, iamService iam.IAMServer) { + iam.RegisterIAMServer(server, iamService) + }, + ), +) diff --git a/apps/iam/internal/application/action-role-binding.go b/apps/iam/internal/application/action-role-binding.go deleted file mode 100644 index 0c089f1bf..000000000 --- a/apps/iam/internal/application/action-role-binding.go +++ /dev/null @@ -1,37 +0,0 @@ -package application - -import ( - t "kloudlite.io/apps/iam/types" -) - -type RoleBindingMap map[t.Action][]t.Role - -var roleBindings RoleBindingMap = RoleBindingMap{ - t.CreateAccount: []t.Role{t.RoleAccountOwner}, - t.GetAccount: []t.Role{t.RoleAccountAdmin, t.RoleAccountMember, t.RoleProjectAdmin, t.RoleProjectMember}, - // ListAccounts: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin}, - t.UpdateAccount: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, - t.DeleteAccount: []t.Role{t.RoleAccountOwner}, - - t.InviteAccountAdmin: []t.Role{t.RoleAccountOwner}, - t.InviteAccountMember: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, - - t.UpdateAccountMember: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, - - t.CreateProject: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, - t.ListProjects: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin, t.RoleProjectMember}, - t.GetProject: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin, t.RoleProjectMember}, - t.UpdateProject: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin, t.RoleProjectMember}, - t.DeleteProject: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin}, - - t.CreateEnvironment: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin, t.RoleProjectMember}, - t.ListEnvironments: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin, t.RoleProjectMember}, - t.GetEnvironment: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin, t.RoleProjectMember}, - t.UpdateEnvironment: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin, t.RoleProjectMember}, - t.DeleteEnvironment: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin, t.RoleProjectMember}, - - t.InviteProjectAdmin: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin}, - t.InviteProjectMember: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin}, - - t.MutateResourcesInProject: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleProjectAdmin, t.RoleProjectMember}, -} diff --git a/apps/iam/internal/application/grpc-server.go b/apps/iam/internal/application/grpc-server.go deleted file mode 100644 index 662a526bf..000000000 --- a/apps/iam/internal/application/grpc-server.go +++ /dev/null @@ -1,306 +0,0 @@ -package application - -import ( - context "context" - "fmt" - "strings" - - "kloudlite.io/apps/iam/internal/domain/entities" - t "kloudlite.io/apps/iam/types" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/iam" - "kloudlite.io/pkg/errors" - "kloudlite.io/pkg/logging" - "kloudlite.io/pkg/repos" -) - -type GrpcServer struct { - iam.UnimplementedIAMServer - logger logging.Logger - rbRepo repos.DbRepo[*entities.RoleBinding] - roleBindingMap map[t.Action][]t.Role -} - -func (s *GrpcServer) findRoleBinding(ctx context.Context, userId repos.ID, resourceRef string) (*entities.RoleBinding, error) { - rb, err := s.rbRepo.FindOne( - ctx, repos.Filter{ - "user_id": userId, - "resource_ref": resourceRef, - }, - ) - if err != nil { - return nil, err - } - if rb == nil { - return nil, fmt.Errorf("role binding for (userId=%s, ResourceRef=%s) not found", userId, resourceRef) - } - return rb, nil -} - -func (s *GrpcServer) ConfirmMembership(ctx context.Context, in *iam.ConfirmMembershipIn) (*iam.ConfirmMembershipOut, error) { - rb, err := s.findRoleBinding(ctx, repos.ID(in.UserId), in.ResourceRef) - if err != nil { - return nil, err - } - - if t.Role(in.Role) != rb.Role { - return nil, errors.New("The invitation has been updated") - } - - rb.Accepted = true - _, err = s.rbRepo.UpdateById(ctx, rb.Id, rb) - if err != nil { - return nil, err - } - return &iam.ConfirmMembershipOut{}, nil -} - -func (s *GrpcServer) InviteMembership(ctx context.Context, in *iam.AddMembershipIn) (*iam.AddMembershipOut, error) { - rb, err := s.rbRepo.FindOne( - ctx, repos.Filter{ - "user_id": in.UserId, - "resource_ref": in.ResourceRef, - }, - ) - if err != nil { - return nil, err - } - - if rb != nil { - if string(rb.Role) == in.Role { - s.logger.Infof("user %s already has role %s on resource %s", in.UserId, in.Role, in.ResourceRef) - return &iam.AddMembershipOut{Result: true}, nil - } - rb.Role = t.Role(in.Role) - rb.Accepted = false - _, err := s.rbRepo.UpdateById(ctx, rb.Id, rb) - if err != nil { - return nil, err - } - return &iam.AddMembershipOut{Result: true}, nil - } - - _, err = s.rbRepo.Create( - ctx, &entities.RoleBinding{ - UserId: in.UserId, - ResourceType: t.ResourceType(in.ResourceType), - ResourceRef: in.ResourceRef, - Role: t.Role(in.Role), - Accepted: false, - }, - ) - if err != nil { - return nil, errors.NewEf(err, "could not create rolebinding") - } - return &iam.AddMembershipOut{Result: true}, nil -} - -func (s *GrpcServer) GetMembership(ctx context.Context, in *iam.GetMembershipIn) (*iam.GetMembershipOut, error) { - rb, err := s.findRoleBinding(ctx, repos.ID(in.UserId), in.ResourceRef) - if err != nil { - return nil, err - } - return &iam.GetMembershipOut{ - UserId: rb.UserId, - ResourceRef: rb.ResourceRef, - Role: string(rb.Role), - Accepted: rb.Accepted, - }, nil -} - -func (s *GrpcServer) ListResourceMemberships(ctx context.Context, in *iam.ResourceMembershipsIn) (*iam.ListMembershipsOut, error) { - filter := repos.Filter{} - if in.ResourceRef != "" { - filter["resource_ref"] = in.ResourceRef - } - if in.ResourceType != "" { - filter["resource_type"] = in.ResourceType - } - - rbs, err := s.rbRepo.Find(ctx, repos.Query{Filter: filter}) - if err != nil { - return nil, errors.NewEf(err, "could not find memberships by (ResourceRef=%q, resourceType=%q)", in.ResourceRef, in.ResourceType) - } - - var result []*iam.RoleBinding - for _, rb := range rbs { - result = append( - result, &iam.RoleBinding{ - UserId: rb.UserId, - ResourceType: string(rb.ResourceType), - ResourceRef: rb.ResourceRef, - Role: string(rb.Role), - }, - ) - } - - return &iam.ListMembershipsOut{ - RoleBindings: result, - }, nil -} - -func (s *GrpcServer) ListMembershipsByResource(ctx context.Context, in *iam.MembershipsByResourceIn) (*iam.ListMembershipsOut, error) { - filter := repos.Filter{} - if in.ResourceRef != "" { - filter["resource_ref"] = in.ResourceRef - } - if in.ResourceType != "" { - filter["resource_type"] = in.ResourceType - } - if in.Accepted != nil { - filter["accepted"] = *in.Accepted - } - - rbs, err := s.rbRepo.Find(ctx, repos.Query{Filter: filter}) - if err != nil { - return nil, errors.NewEf(err, "could not find memberships by (ResourceRef=%q, resourceType=%q)", in.ResourceRef, in.ResourceType) - } - - var result []*iam.RoleBinding - for _, rb := range rbs { - result = append( - result, &iam.RoleBinding{ - UserId: rb.UserId, - ResourceType: string(rb.ResourceType), - ResourceRef: rb.ResourceRef, - Role: string(rb.Role), - }, - ) - } - - return &iam.ListMembershipsOut{ - RoleBindings: result, - }, nil -} - -func (s *GrpcServer) Can(ctx context.Context, in *iam.CanIn) (*iam.CanOut, error) { - rb, err := s.rbRepo.FindOne( - ctx, repos.Filter{ - "resource_ref": map[string]any{"$in": in.ResourceRefs}, - "user_id": in.UserId, - "accepted": true, - }, - ) - - if err != nil { - return nil, errors.NewEf(err, "could not find rolebindings for (resourceRefs=%s)", strings.Join(in.ResourceRefs, ",")) - } - - if rb == nil { - return nil, fmt.Errorf("no rolebinding found for (userId=%s, resourceRefs=%s)", in.UserId, strings.Join(in.ResourceRefs, ",")) - } - - if strings.HasPrefix(in.UserId, "sys-user") { - return &iam.CanOut{Status: true}, nil - } - - for _, role := range s.roleBindingMap[t.Action(in.Action)] { - if role == rb.Role { - return &iam.CanOut{Status: true}, nil - } - } - - return &iam.CanOut{Status: false}, nil -} - -func (s *GrpcServer) ListUserMemberships(ctx context.Context, in *iam.UserMembershipsIn) (*iam.ListMembershipsOut, error) { - filter := repos.Filter{"user_id": in.UserId} - if in.ResourceType != "" { - filter["resource_type"] = in.ResourceType - } - - rbs, err := s.rbRepo.Find(ctx, repos.Query{Filter: filter}) - if err != nil { - return nil, errors.NewEf(err, "could not find memberships by (userId=%q)", in.UserId) - } - - result := []*iam.RoleBinding{} - for i := range rbs { - result = append( - result, &iam.RoleBinding{ - UserId: rbs[i].UserId, - ResourceType: string(rbs[i].ResourceType), - ResourceRef: rbs[i].ResourceRef, - Role: string(rbs[i].Role), - }, - ) - } - - return &iam.ListMembershipsOut{ - RoleBindings: result, - }, nil -} - -func (s *GrpcServer) ListMembershipsForUser(ctx context.Context, in *iam.MembershipsForUserIn) (*iam.ListMembershipsOut, error) { - filter := repos.Filter{"user_id": in.UserId} - if in.ResourceType != "" { - filter["resource_type"] = in.ResourceType - } - - rbs, err := s.rbRepo.Find(ctx, repos.Query{Filter: filter}) - if err != nil { - return nil, errors.NewEf(err, "could not find memberships by (userId=%q)", in.UserId) - } - - result := []*iam.RoleBinding{} - for i := range rbs { - result = append( - result, &iam.RoleBinding{ - UserId: rbs[i].UserId, - ResourceType: string(rbs[i].ResourceType), - ResourceRef: rbs[i].ResourceRef, - Role: string(rbs[i].Role), - }, - ) - } - - return &iam.ListMembershipsOut{ - RoleBindings: result, - }, nil -} - -// Mutation -func (s *GrpcServer) AddMembership(ctx context.Context, in *iam.AddMembershipIn) (*iam.AddMembershipOut, error) { - _, err := s.rbRepo.Create( - ctx, &entities.RoleBinding{ - UserId: in.UserId, - ResourceType: t.ResourceType(in.ResourceType), - ResourceRef: in.ResourceRef, - Role: t.Role(in.Role), - Accepted: true, - }, - ) - if err != nil { - return nil, errors.NewEf(err, "could not create rolebinding") - } - return &iam.AddMembershipOut{Result: true}, nil -} - -func (s *GrpcServer) RemoveMembership(ctx context.Context, in *iam.RemoveMembershipIn) (*iam.RemoveMembershipOut, error) { - if in.UserId == "" || in.ResourceRef == "" { - return nil, fmt.Errorf("userId or resourceRef is empty, rejecting") - } - - rb, err := s.findRoleBinding(ctx, repos.ID(in.UserId), in.ResourceRef) - if err != nil { - return nil, err - } - - if err := s.rbRepo.DeleteById(ctx, rb.Id); err != nil { - return nil, errors.NewEf(err, "could not delete resource for (userId=%s, resourceRef=%s)", in.UserId, in.ResourceRef) - } - - return &iam.RemoveMembershipOut{Result: true}, nil -} - -func (s *GrpcServer) RemoveResource(ctx context.Context, in *iam.RemoveResourceIn) (*iam.RemoveResourceOut, error) { - if err := s.rbRepo.DeleteMany(ctx, repos.Filter{"resource_ref": in.ResourceRef}); err != nil { - return nil, errors.NewEf(err, "could not delete resources for (resourceRef=%s)", in.ResourceRef) - } - return &iam.RemoveResourceOut{Result: true}, nil -} - -func (i *GrpcServer) Ping(ctx context.Context, in *iam.Message) (*iam.Message, error) { - return &iam.Message{ - Message: "asdfasdf", - }, nil -} diff --git a/apps/iam/internal/application/main.go b/apps/iam/internal/application/main.go deleted file mode 100644 index f9829f2ce..000000000 --- a/apps/iam/internal/application/main.go +++ /dev/null @@ -1,48 +0,0 @@ -package application - -import ( - "encoding/json" - "os" - - "go.uber.org/fx" - "google.golang.org/grpc" - "kloudlite.io/apps/iam/internal/domain/entities" - "kloudlite.io/apps/iam/internal/env" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/iam" - "kloudlite.io/pkg/logging" - "kloudlite.io/pkg/repos" -) - -func fxServer(rbRepo repos.DbRepo[*entities.RoleBinding], rbm RoleBindingMap, logger logging.Logger) iam.IAMServer { - return &GrpcServer{ - logger: logger, - rbRepo: rbRepo, - roleBindingMap: rbm, - } -} - -var Module = fx.Module( - "application", - fx.Provide(func(ev *env.Env) (RoleBindingMap, error) { - if ev.ActionRoleMapFile != "" { - b, err := os.ReadFile(ev.ActionRoleMapFile) - if err != nil { - return nil, err - } - var rbm RoleBindingMap - if err := json.Unmarshal(b, &rbm); err != nil { - return nil, err - } - return rbm, nil - } - - return roleBindings, nil - }), - fx.Provide(fxServer), - repos.NewFxMongoRepo[*entities.RoleBinding]("role_bindings", "rb", entities.RoleBindingIndices), - fx.Invoke( - func(server *grpc.Server, iamService iam.IAMServer) { - iam.RegisterIAMServer(server, iamService) - }, - ), -) diff --git a/apps/iam/internal/domain/domain.go b/apps/iam/internal/domain/domain.go new file mode 100644 index 000000000..2b5476898 --- /dev/null +++ b/apps/iam/internal/domain/domain.go @@ -0,0 +1,185 @@ +package domain + +import ( + "context" + "fmt" + "strings" + + "github.com/kloudlite/api/apps/iam/internal/entities" + t "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" +) + +type Domain interface { + AddRoleBinding(ctx context.Context, rb entities.RoleBinding) (*entities.RoleBinding, error) + RemoveRoleBinding(ctx context.Context, userId repos.ID, resourceRef string) error + RemoveRoleBindingsForResource(ctx context.Context, resourceRef string) error + UpdateRoleBinding(ctx context.Context, rb entities.RoleBinding) (*entities.RoleBinding, error) + + GetRoleBinding(ctx context.Context, userId repos.ID, resourceRef string) (*entities.RoleBinding, error) + + ListRoleBindingsForResource(ctx context.Context, resourceType t.ResourceType, resourceRef string) ([]*entities.RoleBinding, error) + ListRoleBindingsForUser(ctx context.Context, userId repos.ID, resourceType *t.ResourceType) ([]*entities.RoleBinding, error) + + Can(ctx context.Context, userId repos.ID, resourceRefs []string, action t.Action) (bool, error) +} + +type domain struct { + rbRepo repos.DbRepo[*entities.RoleBinding] + roleBindingMap map[t.Action][]t.Role +} + +func (d domain) AddRoleBinding(ctx context.Context, rb entities.RoleBinding) (*entities.RoleBinding, error) { + if err := rb.Validate(); err != nil { + return nil, errors.NewE(err) + } + + exists, err := d.rbRepo.FindOne(ctx, repos.Filter{ + "user_id": rb.UserId, + "resource_ref": rb.ResourceRef, + }) + if err != nil { + return nil, errors.NewE(err) + } + + if exists != nil { + return nil, errors.Newf("role binding for (userId=%s, ResourceRef=%s) already exists", rb.UserId, rb.ResourceRef) + } + + nrb, err := d.rbRepo.Create(ctx, &rb) + if err != nil { + return nil, errors.NewE(err) + } + return nrb, nil +} + +func (s domain) findRoleBinding(ctx context.Context, userId repos.ID, resourceRef string) (*entities.RoleBinding, error) { + rb, err := s.rbRepo.FindOne( + ctx, repos.Filter{ + "user_id": userId, + "resource_ref": resourceRef, + }, + ) + if err != nil { + return nil, errors.NewE(err) + } + + if rb == nil { + return nil, errors.Newf("role binding for (userId=%s, ResourceRef=%s) not found", userId, resourceRef) + } + + return rb, nil +} + +func (d domain) RemoveRoleBinding(ctx context.Context, userId repos.ID, resourceRef string) error { + if userId == "" || resourceRef == "" { + return errors.Newf("userId or resourceRef is empty, rejecting") + } + + rb, err := d.findRoleBinding(ctx, userId, resourceRef) + if err != nil { + return errors.NewE(err) + } + + if err := d.rbRepo.DeleteById(ctx, rb.Id); err != nil { + return errors.NewEf(err, "could not delete resource for (userId=%s, resourceRef=%s)", userId, resourceRef) + } + + return nil +} + +func (d domain) RemoveRoleBindingsForResource(ctx context.Context, resourceRef string) error { + if err := d.rbRepo.DeleteMany(ctx, repos.Filter{"resource_ref": resourceRef}); err != nil { + return errors.NewEf(err, "could not delete role bindings for (resourceRef=%s)", resourceRef) + } + return nil +} + +// UpdateRoleBinding updates only the role for a user on an already specified resource_ref +func (d domain) UpdateRoleBinding(ctx context.Context, rb entities.RoleBinding) (*entities.RoleBinding, error) { + currRb, err := d.rbRepo.FindOne( + ctx, repos.Filter{ + "user_id": rb.UserId, + "resource_ref": rb.ResourceRef, + "resource_type": rb.ResourceType, + }, + ) + if err != nil { + return nil, errors.NewE(err) + } + if currRb == nil { + return nil, errors.Newf("role binding for (userId=%q, ResourceRef=%q, ResourceType=%q) not found", rb.UserId, rb.ResourceRef, rb.ResourceType) + } + + currRb.Role = rb.Role + return d.rbRepo.UpdateById(ctx, currRb.Id, currRb) +} + +func (d domain) GetRoleBinding(ctx context.Context, userId repos.ID, resourceRef string) (*entities.RoleBinding, error) { + return d.findRoleBinding(ctx, userId, resourceRef) +} + +func (d domain) ListRoleBindingsForResource(ctx context.Context, resourceType t.ResourceType, resourceRef string) ([]*entities.RoleBinding, error) { + filter := repos.Filter{ + "resource_type": resourceType, + "resource_ref": resourceRef, + } + + return d.rbRepo.Find(ctx, repos.Query{Filter: filter}) +} + +func (d domain) ListRoleBindingsForUser(ctx context.Context, userId repos.ID, resourceType *t.ResourceType) ([]*entities.RoleBinding, error) { + filter := repos.Filter{ + "user_id": userId, + } + + if resourceType != nil { + filter["resource_type"] = *resourceType + } + + return d.rbRepo.Find(ctx, repos.Query{Filter: filter}) +} + +func (d domain) Can(ctx context.Context, userId repos.ID, resourceRefs []string, action t.Action) (bool, error) { + if d.roleBindingMap == nil { + return false, UnAuthorizedError{debugMsg: "action-role-binding map is empty"} + } + + if strings.HasPrefix(string(userId), "sys-user") { + return true, nil + } + + rbs, err := d.rbRepo.Find( + ctx, repos.Query{Filter: repos.Filter{ + "resource_ref": map[string]any{"$in": resourceRefs}, + "user_id": userId, + }}, + ) + + if err != nil { + return false, UnAuthorizedError{debugMsg: "db repository find() call error", parentErr: errors.NewE(err)} + } + + if rbs == nil { + return false, UnAuthorizedError{debugMsg: fmt.Sprintf("no rolebinding found for (userId=%s, resourceRefs=%s)", userId, strings.Join(resourceRefs, ","))} + } + + for i := range rbs { + // 2nd loop, but very small length (always < #roles), so it's not exactly O(n^2), much like XO(n) + for _, role := range d.roleBindingMap[action] { + if role == rbs[i].Role { + return true, nil + } + } + } + + return false, UnAuthorizedError{debugMsg: fmt.Sprintf("no role bindings allow user %q to perform action %q on resource %q", userId, action, resourceRefs)} +} + +func NewDomain(rbRepo repos.DbRepo[*entities.RoleBinding], roleBindingMap map[t.Action][]t.Role) Domain { + return &domain{ + rbRepo: rbRepo, + roleBindingMap: roleBindingMap, + } +} diff --git a/apps/iam/internal/domain/domain_test.go b/apps/iam/internal/domain/domain_test.go new file mode 100644 index 000000000..b6f41dadc --- /dev/null +++ b/apps/iam/internal/domain/domain_test.go @@ -0,0 +1,182 @@ +package domain_test + +import ( + "context" + "errors" + + "github.com/kloudlite/api/apps/iam/internal/domain" + "github.com/kloudlite/api/apps/iam/internal/entities" + t "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/common" + reposMock "github.com/kloudlite/api/mocks/pkg/repos" + "github.com/kloudlite/api/pkg/repos" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +var _ = Describe("domain.AddRoleBinding() says", func() { + var rbRepo *reposMock.DbRepo[*entities.RoleBinding] + // var roleBindingMap map[t.Action][]t.Role + + BeforeEach(func() { + rbRepo = reposMock.NewDbRepo[*entities.RoleBinding]() + }) + + When("role binding already exists", func() { + BeforeEach(func() { + rbRepo.MockFindOne = func(ctx context.Context, filter repos.Filter) (*entities.RoleBinding, error) { + return &entities.RoleBinding{}, nil + } + }) + + It("should return error", func() { + d := domain.NewDomain(rbRepo, nil) + _, err := d.AddRoleBinding(context.Background(), entities.RoleBinding{ + UserId: "sample", + ResourceType: "sample", + ResourceRef: "sample", + Role: "sample", + }) + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring("already exists")) + }) + }) + + When("role binding does not exist", func() { + BeforeEach(func() { + rbRepo.MockFindOne = func(ctx context.Context, filter repos.Filter) (*entities.RoleBinding, error) { + return nil, nil + } + }) + + It("creating an empty role binding should throw validation error", func() { + d := domain.NewDomain(rbRepo, nil) + _, err := d.AddRoleBinding(context.Background(), entities.RoleBinding{}) + Expect(err).To(HaveOccurred()) + Expect(errors.As(err, &common.ValidationError{})).To(BeTrue()) + }) + + It("should create a new role binding", func() { + rbRepo.MockCreate = func(ctx context.Context, data *entities.RoleBinding) (*entities.RoleBinding, error) { + return data, nil + } + d := domain.NewDomain(rbRepo, nil) + _, err := d.AddRoleBinding(context.Background(), entities.RoleBinding{ + UserId: "sample", + ResourceType: "sample", + ResourceRef: "sample", + Role: "sample", + }) + Expect(err).NotTo(HaveOccurred()) + }) + }) +}) + +var _ = Describe("domain.Can() says", func() { + var rbRepo *reposMock.DbRepo[*entities.RoleBinding] + + BeforeEach(func() { + rbRepo = reposMock.NewDbRepo[*entities.RoleBinding]() + }) + + When("no action-role-binding map exists", func() { + It("should fail with error", func() { + d := domain.NewDomain(rbRepo, nil) + _, err := d.Can(context.Background(), "sample", []string{"sample"}, "sample") + Expect(err).To(HaveOccurred()) + Expect(errors.As(err, &domain.UnAuthorizedError{})).To(BeTrue()) + }) + }) + + Context("when action-role-binging map exists", func() { + When("no role bindings exist in db", func() { + It("should fail with error", func() { + rbRepo.MockFind = func(ctx context.Context, query repos.Query) ([]*entities.RoleBinding, error) { + return nil, nil + } + d := domain.NewDomain(rbRepo, map[t.Action][]t.Role{"sample": {"sample"}}) + _, err := d.Can(context.Background(), "sample", []string{"sample"}, "sample") + Expect(err).To(HaveOccurred()) + Expect(errors.As(err, &domain.UnAuthorizedError{})).To(BeTrue()) + }) + }) + + When("action is not permitted for the role", func() { + It("1. if allowed roles is empty, should fail with error", func() { + rbRepo.MockFind = func(ctx context.Context, query repos.Query) ([]*entities.RoleBinding, error) { + return []*entities.RoleBinding{ + { + UserId: "sample", + ResourceType: "sample-resource", + ResourceRef: "sample", + Role: "sample", + }, + }, nil + } + + actionRoleBindings := map[t.Action][]t.Role{ + "sample-action": {}, + } + + d := domain.NewDomain(rbRepo, actionRoleBindings) + _, err := d.Can(context.Background(), "sample", []string{"sample"}, "sample-action") + Expect(err).To(HaveOccurred()) + Expect(errors.As(err, &domain.UnAuthorizedError{})).To(BeTrue()) + }) + + It("2. if allowed roles does not contain current role, should fail with error", func() { + rbRepo.MockFind = func(ctx context.Context, query repos.Query) ([]*entities.RoleBinding, error) { + return []*entities.RoleBinding{ + { + UserId: "sample-userid", + ResourceType: "sample-resource", + ResourceRef: "sample-resourceRef", + Role: "sample-role", + }, + }, nil + } + + actionRoleBindings := map[t.Action][]t.Role{ + "sample-action": {"example-role"}, + } + + d := domain.NewDomain(rbRepo, actionRoleBindings) + _, err := d.Can(context.Background(), "sample", []string{"sample"}, "sample-action") + Expect(err).To(HaveOccurred()) + Expect(errors.As(err, &domain.UnAuthorizedError{})).To(BeTrue()) + }) + }) + + When("action is permitted for the role", func() { + It("should return true", func() { + rbRepo.MockFind = func(ctx context.Context, query repos.Query) ([]*entities.RoleBinding, error) { + return []*entities.RoleBinding{ + { + UserId: "sample-userid", + ResourceType: "sample-resource", + ResourceRef: "sample-resourceRef", + Role: "sample-role", + }, + }, nil + } + + actionRoleBindings := map[t.Action][]t.Role{ + "sample-action": {"sample-role"}, + } + + d := domain.NewDomain(rbRepo, actionRoleBindings) + _, err := d.Can(context.Background(), "sample", []string{"sample"}, "sample-action") + Expect(err).NotTo(HaveOccurred()) + }) + }) + }) + + Context("when system is internally accessing resources", func() { + It("should allow", func() { + d := domain.NewDomain(rbRepo, map[t.Action][]t.Role{"sample-action": {"sample"}}) + can, err := d.Can(context.Background(), "sys-user", []string{"sample"}, "sample-action") + Expect(err).NotTo(HaveOccurred()) + Expect(can).To(BeTrue()) + }) + }) +}) diff --git a/apps/iam/internal/domain/entities/types.go b/apps/iam/internal/domain/entities/types.go deleted file mode 100644 index c675d1faa..000000000 --- a/apps/iam/internal/domain/entities/types.go +++ /dev/null @@ -1,37 +0,0 @@ -package entities - -import ( - t "kloudlite.io/apps/iam/types" - "kloudlite.io/pkg/repos" -) - -type RoleBinding struct { - repos.BaseEntity `json:",inline" bson:",inline"` - UserId string `json:"user_id" bson:"user_id"` - ResourceType t.ResourceType `json:"resource_type" bson:"resource_type"` - ResourceRef string `json:"resource_ref" bson:"resource_ref"` - Role t.Role `json:"role" bson:"role"` - Accepted bool `json:"accepted" bson:"accepted"` -} - -// var RoleBindingIndexes = []string{"id", "user_id", "resource_id", "role"} -var RoleBindingIndices = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: "id", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "user_id", Value: repos.IndexDesc}, - {Key: "resource_ref", Value: repos.IndexDesc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "role", Value: repos.IndexAsc}, - }, - }, -} diff --git a/apps/iam/internal/domain/errors.go b/apps/iam/internal/domain/errors.go new file mode 100644 index 000000000..12e39ef9c --- /dev/null +++ b/apps/iam/internal/domain/errors.go @@ -0,0 +1,15 @@ +package domain + +import "encoding/json" + +type UnAuthorizedError struct { + parentErr error + debugMsg string +} + +func (e UnAuthorizedError) Error() string { + b, _ := json.Marshal(map[string]any{ + "error": "unauthorized", + }) + return string(b) +} diff --git a/apps/iam/internal/domain/suite_test.go b/apps/iam/internal/domain/suite_test.go new file mode 100644 index 000000000..355cf790b --- /dev/null +++ b/apps/iam/internal/domain/suite_test.go @@ -0,0 +1,15 @@ +package domain_test + +import ( + "testing" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +func TestDomain(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "Domain Suite") +} + +var _ = BeforeEach(func() {}) diff --git a/apps/iam/internal/entities/role-binding.go b/apps/iam/internal/entities/role-binding.go new file mode 100644 index 000000000..81dfbfa68 --- /dev/null +++ b/apps/iam/internal/entities/role-binding.go @@ -0,0 +1,60 @@ +package entities + +import ( + t "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/repos" +) + +type RoleBinding struct { + repos.BaseEntity `json:",inline" bson:",inline"` + UserId string `json:"user_id"` + ResourceType t.ResourceType `json:"resource_type"` + ResourceRef string `json:"resource_ref"` + Role t.Role `json:"role"` +} + +func (rb *RoleBinding) Validate() error { + verr := common.ValidationError{Label: "role_binding"} + + if rb.UserId == "" { + verr.Errors = append(verr.Errors, "user_id is required") + } + if rb.ResourceType == "" { + verr.Errors = append(verr.Errors, "resource_type is required") + } + if rb.ResourceRef == "" { + verr.Errors = append(verr.Errors, "resource_ref is required") + } + if rb.Role == "" { + verr.Errors = append(verr.Errors, "role is required") + } + + if len(verr.Errors) > 0 { + return verr + } + + return nil +} + +var RoleBindingIndices = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: "id", Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: "user_id", Value: repos.IndexDesc}, + {Key: "resource_ref", Value: repos.IndexDesc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: "role", Value: repos.IndexAsc}, + {Key: "resource_type", Value: repos.IndexAsc}, + }, + }, +} diff --git a/apps/iam/internal/env/env.go b/apps/iam/internal/env/env.go index ad6743fba..b4be0651e 100644 --- a/apps/iam/internal/env/env.go +++ b/apps/iam/internal/env/env.go @@ -1,24 +1,22 @@ package env -import "github.com/codingconcepts/env" +import ( + "github.com/codingconcepts/env" + "github.com/kloudlite/api/pkg/errors" +) type Env struct { GrpcPort uint16 `env:"GRPC_PORT" required:"true"` MongoDbUri string `env:"MONGO_DB_URI" required:"true"` MongoDbName string `env:"MONGO_DB_NAME" required:"true"` - RedisHosts string `env:"REDIS_HOSTS" required:"true"` - RedisUsername string `env:"REDIS_USERNAME" required:"true"` - RedisPassword string `env:"REDIS_PASSWORD" required:"true"` - RedisPrefix string `env:"REDIS_PREFIX" required:"true"` - ActionRoleMapFile string `env:"ACTION_ROLE_MAP_FILE" required:"false"` } func LoadEnv() (*Env, error) { var e Env if err := env.Set(&e); err != nil { - return nil, err + return nil, errors.NewE(err) } return &e, nil } diff --git a/apps/iam/internal/framework/main.go b/apps/iam/internal/framework/main.go index 99d32c51d..e4fa73135 100644 --- a/apps/iam/internal/framework/main.go +++ b/apps/iam/internal/framework/main.go @@ -1,22 +1,22 @@ package framework import ( + "context" + "fmt" + "github.com/kloudlite/api/apps/iam/internal/app" + "github.com/kloudlite/api/apps/iam/internal/env" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/grpc" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/api/pkg/repos" "go.uber.org/fx" - "kloudlite.io/apps/iam/internal/application" - "kloudlite.io/apps/iam/internal/env" - "kloudlite.io/pkg/cache" - rpc "kloudlite.io/pkg/grpc" - "kloudlite.io/pkg/repos" + "time" ) type fm struct { *env.Env } -func (f *fm) RedisOptions() (hosts, username, password, basePrefix string) { - return f.RedisHosts, f.RedisUsername, f.RedisPassword, f.RedisPrefix -} - func (f *fm) GetMongoConfig() (url, dbName string) { return f.MongoDbUri, f.MongoDbName } @@ -31,7 +31,39 @@ var Module fx.Option = fx.Module( return &fm{Env: ev} }), repos.NewMongoClientFx[*fm](), - cache.NewRedisFx[*fm](), - rpc.NewGrpcServerFx[*fm](), - application.Module, + + fx.Provide(func(logger logging.Logger) (app.IAMGrpcServer, error) { + return grpc.NewGrpcServer(grpc.ServerOpts{ + Logger: logger, + }) + }), + + app.Module, + + fx.Invoke(func(lf fx.Lifecycle, server app.IAMGrpcServer, ev *env.Env) { + lf.Append(fx.Hook{ + OnStart: func(ctx context.Context) error { + timeout, cf := context.WithTimeout(ctx, 2*time.Second) + defer cf() + errCh := make(chan error, 1) + go func() { + if err := server.Listen(fmt.Sprintf(":%d", ev.GrpcPort)); err != nil { + errCh <- err + } + }() + + select { + case <-timeout.Done(): + case err := <-errCh: + return errors.NewE(err) + } + return nil + }, + + OnStop: func(ctx context.Context) error { + server.Stop() + return nil + }, + }) + }), ) diff --git a/apps/iam/main.go b/apps/iam/main.go index 4aa69ddd8..b6594807e 100644 --- a/apps/iam/main.go +++ b/apps/iam/main.go @@ -1,12 +1,16 @@ package main import ( + "context" "flag" + "os" + "time" + "github.com/kloudlite/api/apps/iam/internal/env" + "github.com/kloudlite/api/apps/iam/internal/framework" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/logging" "go.uber.org/fx" - "kloudlite.io/apps/iam/internal/env" - "kloudlite.io/apps/iam/internal/framework" - "kloudlite.io/pkg/logging" ) func main() { @@ -14,15 +18,32 @@ func main() { flag.BoolVar(&isDev, "dev", false, "--dev") flag.Parse() - fx.New( + logger, err := logging.New(&logging.Options{Name: "iam", Dev: isDev}) + if err != nil { + panic(err) + } + + app := fx.New( + fx.NopLogger, + fx.Provide(func() logging.Logger { + return logger + }), fx.Provide(func() (*env.Env, error) { return env.LoadEnv() }), + framework.Module, - fx.Provide( - func() (logging.Logger, error) { - return logging.New(&logging.Options{Name: "iam", Dev: isDev}) - }, - ), - ).Run() + ) + + ctx, cancelFunc := context.WithTimeout(context.Background(), 5*time.Second) + defer cancelFunc() + if err := app.Start(ctx); err != nil { + logger.Errorf(err, "IAM api startup errors") + logger.Infof("EXITING as errors encountered during startup") + os.Exit(1) + } + + common.PrintReadyBanner() + <-app.Done() + } diff --git a/apps/iam/types/types.go b/apps/iam/types/types.go index 5e19194f7..1a15a4cea 100644 --- a/apps/iam/types/types.go +++ b/apps/iam/types/types.go @@ -7,17 +7,23 @@ type ResourceType string const ( ResourceAccount ResourceType = "account" ResourceProject ResourceType = "project" + + ResourceEnvironment ResourceType = "environment" + ResourceConsoleVPNDevice ResourceType = "console_vpn_device" + ResourceInfraVPNDevice ResourceType = "infra_vpn_device" ) type Role string const ( - RoleAccountOwner Role = "account-owner" - RoleAccountAdmin Role = "account-admin" - RoleAccountMember Role = "account-member" + RoleResourceOwner Role = "resource_owner" + + RoleAccountOwner Role = "account_owner" + RoleAccountAdmin Role = "account_admin" + RoleAccountMember Role = "account_member" - RoleProjectAdmin Role = "project-admin" - RoleProjectMember Role = "project-member" + RoleProjectAdmin Role = "project_admin" + RoleProjectMember Role = "project_member" ) type Action string @@ -29,32 +35,114 @@ const ( UpdateAccount Action = "update-account" DeleteAccount Action = "delete-account" + CreateSecretsInAccount Action = "create-secrets-in-account" + ReadSecretsFromAccount Action = "read-secrets-from-account" + InviteAccountMember Action = "invite-account-member" InviteAccountAdmin Action = "invite-account-admin" - UpdateAccountMember Action = "update-account-member" + ListAccountInvitations Action = "list-account-invitations" + GetAccountInvitation Action = "get-account-invitation" + + ListProjectInvitations Action = "list-project-invitations" + GetProjectInvitation Action = "get-project-invitation" + + DeleteAccountInvitation Action = "delete-account-invitation" + DeleteProjectInvitation Action = "delete-project-invitation" + + ListMembershipsForAccount Action = "list-memberships-for-account" + + RemoveAccountMembership Action = "remove-account-membership" + UpdateAccountMembership Action = "update-account-membership" ActivateAccount Action = "activate-account" DeactivateAccount Action = "deactivate-account" + // clusters + CreateCluster Action = "create-cluster" + DeleteCluster Action = "delete-cluster" + ListClusters Action = "list-clusters" + GetCluster Action = "get-cluster" + UpdateCluster Action = "update-cluster" + + // cluster managed services + CreateClusterManagedService Action = "create-cluster-managed-service" + DeleteClusterManagedService Action = "delete-cluster-managed-service" + ListClusterManagedServices Action = "list-cluster-managed-services" + GetClusterManagedService Action = "get-cluster-managed-service" + UpdateClusterManagedService Action = "update-cluster-managed-service" + + // project managed services + CreateProjectManagedService Action = "create-project-managed-service" + DeleteProjectManagedService Action = "delete-project-managed-service" + ListProjectManagedServices Action = "list-project-managed-services" + GetProjectManagedService Action = "get-project-managed-service" + UpdateProjectManagedService Action = "update-project-managed-service" + + // helm releases + CreateHelmRelease Action = "create-helm-release" + DeleteHelmRelease Action = "delete-helm-release" + ListHelmReleases Action = "list-helm-releases" + GetHelmRelease Action = "get-helm-release" + UpdateHelmRelease Action = "update-helm-release" + + // nodepools + CreateNodepool Action = "create-nodepool" + DeleteNodepool Action = "delete-nodepool" + ListNodepools Action = "list-nodepools" + GetNodepool Action = "get-nodepool" + UpdateNodepool Action = "update-nodepool" + + CreateCloudProviderSecret Action = "create-cloud-provider-secret" + UpdateCloudProviderSecret Action = "update-cloud-provider-secret" + DeleteCloudProviderSecret Action = "delete-cloud-provider-secret" + + ListCloudProviderSecrets Action = "list-cloud-provider-secrets" + GetCloudProviderSecret Action = "get-cloud-provider-secret" + CreateProject Action = "create-project" ListProjects Action = "list-projects" GetProject Action = "get-project" UpdateProject Action = "update-project" DeleteProject Action = "delete-project" - // environments + // invite + InviteProjectAdmin Action = "invite-project-admin" + InviteProjectMember Action = "invite-project-member" + + MutateResourcesInProject Action = "mutate-resources-in-project" + + ListMembershipsForProject Action = "list-memberships-for-project" + UpdateProjectMembership Action = "update-project-membership" + RemoveProjectMembership Action = "remove-project-membership" + CreateEnvironment Action = "create-environment" UpdateEnvironment Action = "update-environment" DeleteEnvironment Action = "delete-environment" GetEnvironment Action = "get-environment" ListEnvironments Action = "list-environments" - // invite - InviteProjectAdmin Action = "invite-project-admin" - InviteProjectMember Action = "invite-project-member" + MutateResourcesInEnvironment Action = "mutate-resources-in-environment" + ReadResourcesInEnvironment Action = "read-resources-in-environment" - MutateResourcesInProject Action = "mutate-resources-in-project" + ListVPNDevices Action = "list-vpn-devices" + GetVPNDevice Action = "get-vpn-device" + + GetVPNDeviceConnectConfig Action = "get-vpn-device-connect-config" + + CreateVPNDevice Action = "create-vpn-device" + UpdateVPNDevice Action = "update-vpn-device" + DeleteVPNDevice Action = "delete-vpn-device" + + CreateDomainEntry Action = "create-domain-entry" + UpdateDomainEntry Action = "update-domain-entry" + DeleteDomainEntry Action = "delete-domain-entry" + + ListDomainEntries Action = "list-domain-entries" + GetDomainEntry Action = "get-domain-entry" + + ReadLogs Action = "read-logs" + ReadMetrics Action = "read-metrics" ) func NewResourceRef(accountName string, resourceType ResourceType, resourceName string) string { diff --git a/apps/infra/Containerfile.local b/apps/infra/Containerfile.local new file mode 100644 index 000000000..67ad05bb3 --- /dev/null +++ b/apps/infra/Containerfile.local @@ -0,0 +1,6 @@ +#syntax=docker/dockerfile:1 +FROM gcr.io/distroless/static-debian11:nonroot +WORKDIR /app +ARG APP +COPY --from=builder --chown=1001 $APP ./infra +ENTRYPOINT ["./infra"] diff --git a/apps/infra/Dockerfile b/apps/infra/Dockerfile index a4a3b86ab..555bd1798 100644 --- a/apps/infra/Dockerfile +++ b/apps/infra/Dockerfile @@ -16,8 +16,8 @@ COPY --chown=1001 ./ ./ RUN CGO_ENABLED=0 go build -tags musl -o /tmp/bin/$APP ./main.go RUN chmod +x /tmp/bin/$APP -#FROM gcr.io/distroless/static-debian11 -FROM alpine -WORKDIR /tmp/app -COPY --from=base --chown=1001 /tmp/bin/{APP} ./infra-api -CMD ["./infra-api"] +FROM gcr.io/distroless/static-debian11:nonroot +LABEL org.opencontainers.image.source=https://github.com/kloudlite/api +ARG APP +COPY --from=base /tmp/bin/${APP} ./infra +CMD ["./infra"] diff --git a/apps/infra/Taskfile.yml b/apps/infra/Taskfile.yml index 0cfc453d2..7e6be6c01 100644 --- a/apps/infra/Taskfile.yml +++ b/apps/infra/Taskfile.yml @@ -3,51 +3,60 @@ version: "3" dotenv: - .secrets/env +vars: + ImagePrefix: "ghcr.io/kloudlite/api" + tasks: gql: dir: ./internal/app cmds: - - go run -tags dynamic github.com/99designs/gqlgen generate - - rm ./graph/scalars.resolvers.go + - go run github.com/99designs/gqlgen generate + - gofmt -w -d -r '"errors" -> "github.com/kloudlite/api/pkg/errors"' graph/*.resolvers.go build: env: CGO_ENABLED: 0 + GOOS: linux + GOARCH: amd64 + vars: + BuiltAt: + sh: date | sed 's/\s/_/g' preconditions: - sh: '[ -n "{{.Out}}" ]' msg: var Out must have a value cmds: - - go build -ldflags="-s -w" -o {{.Out}} + - go build -ldflags="-s -w -X github.com/kloudlite/api/common.BuiltAt=\"{{.BuiltAt}}\"" -o {{.Out}} - upx {{.Out}} k8s-schema: cmds: - - mkdir -p "./internal/app/graph/crd-to-gql" - - go run ../../cmd/crd-to-gql --dev - --output "./internal/app/graph/crd-to-gql" - --crd CloudProvider=cloudproviders.infra.kloudlite.io - --crd Edge=edges.infra.kloudlite.io - --crd NodePool=nodepools.infra.kloudlite.io - --crd WorkerNode=workernodes.infra.kloudlite.io - --crd NodePool=nodepools.infra.kloudlite.io - --crd MasterNode=masternodes.cmgr.kloudlite.io - --crd Secret=secrets.crds.kloudlite.io - --crd Cluster=clusters.cmgr.kloudlite.io - --crd BYOCCluster=byocs.clusters.kloudlite.io - # --crd Account=accounts.wg.kloudlite.io + - mkdir -p "./internal/app/_struct-to-graphql" + - go run ../../cmd/struct-to-graphql + --struct github.com/kloudlite/api/apps/infra/internal/entities.Cluster + --struct github.com/kloudlite/api/apps/infra/internal/entities.MsvcTemplate + --struct github.com/kloudlite/api/apps/infra/internal/entities.Node + --struct github.com/kloudlite/api/apps/infra/internal/entities.NodePool + --struct github.com/kloudlite/api/apps/infra/internal/entities.CloudProviderSecret + --struct github.com/kloudlite/api/apps/infra/internal/entities.DomainEntry + --struct github.com/kloudlite/api/apps/infra/internal/entities.HelmRelease + --struct github.com/kloudlite/api/apps/infra/internal/entities.ClusterManagedService + --struct github.com/kloudlite/api/apps/infra/internal/entities.PersistentVolumeClaim + --struct github.com/kloudlite/api/apps/infra/internal/entities.PersistentVolume + --struct github.com/kloudlite/api/apps/infra/internal/entities.Namespace + --struct github.com/kloudlite/api/apps/infra/internal/entities.VolumeAttachment + --struct github.com/kloudlite/api/pkg/repos.MatchFilter + --struct github.com/kloudlite/api/pkg/repos.CursorPagination + > ./internal/app/_struct-to-graphql/main.go + - |+ + pushd ./internal/app/_struct-to-graphql + go run main.go --dev --out-dir ../graph/struct-to-graphql --with-pagination Cluster,Node,NodePool,CloudProviderSecret,DomainEntry,PersistentVolumeClaim,ClusterManagedService,HelmRelease,Namespace,VolumeAttachment,PersistentVolume + popd + - rm -rf ./internal/app/_struct-to-graphql run: - # sources: - # - ./internal/**/*.go - # - ./main.go - interactive: true cmds: - # - go run -tags dynamic main.go --dev - - nodemon -e go --signal SIGKILL --exec 'go run main.go --dev || exit 1' - # - CGO_BUILD=0 go build -o /tmp/infra - # - /tmp/infra --dev - - + - go run main.go --dev + # - go build -o bin/infra . && ./bin/infra --dev docker-build: vars: APP: infra @@ -55,9 +64,6 @@ tasks: preconditions: - sh: '[[ -n "{{.Tag}}" ]]' msg: 'var Tag must have a value' - - - sh: '[[ "{{.EnvName}}" == "development" ]] || [[ "{{.EnvName}}" == "staging" ]] || [[ "{{.EnvName}}" == "production" ]]' - msg: 'var EnvName must have one of [development, staging, production] as its value' cmds: - docker buildx build -f ./Dockerfile -t {{.IMAGE}} . --build-arg APP={{.APP}} --platform linux/amd64 --build-context project-root=../.. - docker push {{.IMAGE}} @@ -65,36 +71,21 @@ tasks: local-build: preconditions: - - sh: '[ -n "{{.EnvName}}" ]' - msg: 'var EnvName must have a value' - sh: '[ -n "{{.Tag}}" ]' msg: 'var Tag must have a value' vars: - APP: infra-api - IMAGE: registry.kloudlite.io/kloudlite/{{.EnvName}}/{{.APP}}:{{.Tag}} - env: - CGO_ENABLED: 0 - GOOS: linux - GOARCH: amd64 + APP: infra + IMAGE: "{{.ImagePrefix}}/{{.APP}}:{{.Tag}}" silent: true cmds: - |+ - lineNumbers=$(cat Dockerfile | grep -i '^FROM' -n | tail +2 | awk -F: '{print $1}') + tdir=$(mktemp -d) + task build Out=$tdir/{{.APP}} - startLineNo=$(echo "$lineNumbers" | head -n+1) - finalLineNo=$(echo "$lineNumbers" | tail -1) + podman buildx build -f ./Containerfile.local -t {{.IMAGE}} . --build-context builder=${tdir} --build-arg APP="{{.APP}}" + podman push {{.IMAGE}} + rm -rf $tdir - tDir=$(mktemp -d) - - nDockerfile=$(cat Dockerfile | tail --lines=+$startLineNo | grep -i --invert-match 'from=base') - echo "$nDockerfile" | sed "1 i # syntax=docker/dockerfile:1.4" > $tDir/Dockerfile.base - - cat $tDir/Dockerfile.base | sed "4 i COPY --from=local-builder ./{{.APP}} ./{{.APP}}" > $tDir/Dockerfile - cat $tDir/Dockerfile - - echo "building application ..." - task build Out=$tDir/{{.APP}} - - docker buildx build -f $tDir/Dockerfile -t {{.IMAGE}} . --build-context local-builder=${tDir} - docker push {{.IMAGE}} - rm -rf $tDir + test: + cmds: + - go test -v ./internal/domain diff --git a/apps/infra/internal/app/adapter-accounts-svc.go b/apps/infra/internal/app/adapter-accounts-svc.go new file mode 100644 index 000000000..3f6d4e66b --- /dev/null +++ b/apps/infra/internal/app/adapter-accounts-svc.go @@ -0,0 +1,39 @@ +package app + +import ( + "context" + "errors" + errors2 "github.com/kloudlite/operator/pkg/errors" + "time" + + "github.com/kloudlite/api/apps/infra/internal/domain" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/accounts" +) + +type accountsSvc struct { + accountsClient accounts.AccountsClient +} + +// GetAccount implements domain.AccountsSvc. +func (as *accountsSvc) GetAccount(ctx context.Context, userId string, accountName string) (*accounts.GetAccountOut, error) { + ctx2, cf := context.WithTimeout(ctx, 2*time.Second) + defer cf() + out, err := as.accountsClient.GetAccount(ctx2, &accounts.GetAccountIn{ + UserId: userId, + AccountName: accountName, + }) + if err != nil { + if errors.Is(err, context.DeadlineExceeded) { + return nil, domain.ErrGRPCCall{Err: err} + } + return nil, errors2.NewE(err) + } + + return out, nil +} + +func NewAccountsSvc(accountsClient accounts.AccountsClient) domain.AccountsSvc { + return &accountsSvc{ + accountsClient: accountsClient, + } +} diff --git a/apps/infra/internal/app/adapter-resource-apply.go b/apps/infra/internal/app/adapter-resource-apply.go new file mode 100644 index 000000000..d4e3bcd8d --- /dev/null +++ b/apps/infra/internal/app/adapter-resource-apply.go @@ -0,0 +1,83 @@ +package app + +import ( + "encoding/json" + "fmt" + + "github.com/kloudlite/api/apps/infra/internal/domain" + t "github.com/kloudlite/api/apps/tenant-agent/types" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/errors" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/messaging" + msgTypes "github.com/kloudlite/api/pkg/messaging/types" + "github.com/kloudlite/operator/pkg/constants" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +type SendTargetClusterMessagesProducer messaging.Producer + +type resourceDispatcherImpl struct { + producer messaging.Producer +} + +func NewResourceDispatcher(producer SendTargetClusterMessagesProducer) domain.ResourceDispatcher { + return &resourceDispatcherImpl{ + producer, + } +} + +func (a *resourceDispatcherImpl) ApplyToTargetCluster(ctx domain.InfraContext, clusterName string, obj client.Object, recordVersion int) error { + ann := obj.GetAnnotations() + if ann == nil { + ann = make(map[string]string, 1) + } + ann[constants.RecordVersionKey] = fmt.Sprintf("%d", recordVersion) + obj.SetAnnotations(ann) + + m, err := fn.K8sObjToMap(obj) + if err != nil { + return errors.NewE(err) + } + + b, err := json.Marshal(t.AgentMessage{ + AccountName: ctx.AccountName, + ClusterName: clusterName, + Action: t.ActionApply, + Object: m, + }) + if err != nil { + return errors.NewE(err) + } + + err = a.producer.Produce(ctx, msgTypes.ProduceMsg{ + Subject: common.GetTenantClusterMessagingTopic(ctx.AccountName, clusterName), + Payload: b, + }) + + return errors.NewE(err) +} + +func (d *resourceDispatcherImpl) DeleteFromTargetCluster(ctx domain.InfraContext, clusterName string, obj client.Object) error { + m, err := fn.K8sObjToMap(obj) + if err != nil { + return errors.NewE(err) + } + + b, err := json.Marshal(t.AgentMessage{ + AccountName: ctx.AccountName, + ClusterName: clusterName, + Action: t.ActionDelete, + Object: m, + }) + if err != nil { + return errors.NewE(err) + } + + err = d.producer.Produce(ctx, msgTypes.ProduceMsg{ + Subject: common.GetTenantClusterMessagingTopic(ctx.AccountName, clusterName), + Payload: b, + }) + + return errors.NewE(err) +} diff --git a/apps/infra/internal/app/adapter-resource-update-publish.go b/apps/infra/internal/app/adapter-resource-update-publish.go new file mode 100644 index 000000000..7b54f6acd --- /dev/null +++ b/apps/infra/internal/app/adapter-resource-update-publish.go @@ -0,0 +1,44 @@ +package app + +import ( + "fmt" + "github.com/kloudlite/api/apps/infra/internal/domain" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/api/pkg/nats" +) + +type ResourceEventPublisherImpl struct { + cli *nats.Client + logger logging.Logger +} + +func (r *ResourceEventPublisherImpl) PublishInfraEvent(ctx domain.InfraContext, resourceType domain.ResourceType, resName string, update domain.PublishMsg) { + subject := fmt.Sprintf( + "res-updates.account.%s.resourceType.%s.%s", + ctx.AccountName, resourceType, resName, + ) + + r.publish(subject, update) +} + +func (r *ResourceEventPublisherImpl) PublishResourceEvent(ctx domain.InfraContext, clusterName string, resourceType domain.ResourceType, resName string, update domain.PublishMsg) { + subject := fmt.Sprintf( + "res-updates.account.%s.cluster.%s.%s.%s", + ctx.AccountName, clusterName, resourceType, resName, + ) + + r.publish(subject, update) +} + +func (r *ResourceEventPublisherImpl) publish(subject string, msg domain.PublishMsg) { + if err := r.cli.Conn.Publish(subject, []byte(msg)); err != nil { + r.logger.Errorf(err, "failed to publish message to subject %q", subject) + } +} + +func NewResourceEventPublisher(cli *nats.Client, logger logging.Logger) domain.ResourceEventPublisher { + return &ResourceEventPublisherImpl{ + cli, + logger, + } +} diff --git a/apps/infra/internal/app/app.go b/apps/infra/internal/app/app.go index 5422b8e3b..1a2cd00e9 100644 --- a/apps/infra/internal/app/app.go +++ b/apps/infra/internal/app/app.go @@ -2,95 +2,165 @@ package app import ( "context" - "fmt" + + "github.com/kloudlite/api/apps/infra/internal/entities" + "github.com/kloudlite/api/pkg/errors" "github.com/99designs/gqlgen/graphql" "github.com/gofiber/fiber/v2" + "github.com/kloudlite/api/apps/infra/internal/app/graph" + "github.com/kloudlite/api/apps/infra/internal/app/graph/generated" + "github.com/kloudlite/api/apps/infra/internal/domain" + "github.com/kloudlite/api/apps/infra/internal/env" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/constants" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/accounts" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/infra" + message_office_internal "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/message-office-internal" + "github.com/kloudlite/api/pkg/grpc" + httpServer "github.com/kloudlite/api/pkg/http-server" + "github.com/kloudlite/api/pkg/kv" + "github.com/kloudlite/api/pkg/logging" + msg_nats "github.com/kloudlite/api/pkg/messaging/nats" + "github.com/kloudlite/api/pkg/nats" + "github.com/kloudlite/api/pkg/repos" "go.uber.org/fx" - "google.golang.org/grpc" - "kloudlite.io/apps/infra/internal/app/graph" - "kloudlite.io/apps/infra/internal/app/graph/generated" - "kloudlite.io/apps/infra/internal/domain" - "kloudlite.io/apps/infra/internal/domain/entities" - "kloudlite.io/apps/infra/internal/env" - "kloudlite.io/common" - "kloudlite.io/constants" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/finance" - "kloudlite.io/pkg/cache" - httpServer "kloudlite.io/pkg/http-server" - "kloudlite.io/pkg/logging" - "kloudlite.io/pkg/redpanda" - "kloudlite.io/pkg/repos" - - fWebsocket "github.com/gofiber/websocket/v2" ) -type AuthCacheClient cache.Client -type FinanceClientConnection *grpc.ClientConn +type AuthCacheClient kv.Client + +type ( + IAMGrpcClient grpc.Client + AccountGrpcClient grpc.Client + MessageOfficeInternalGrpcClient grpc.Client +) + +type ( + InfraGrpcServer grpc.Server +) var Module = fx.Module( "app", - repos.NewFxMongoRepo[*entities.CloudProvider]("cloud_providers", "cprovider", entities.CloudProviderIndices), - repos.NewFxMongoRepo[*entities.Edge]("edges", "edge", entities.EdgeIndices), repos.NewFxMongoRepo[*entities.Cluster]("clusters", "clus", entities.ClusterIndices), - repos.NewFxMongoRepo[*entities.BYOCCluster]("byoc_clusters", "byoc", entities.BYOCClusterIndices), - repos.NewFxMongoRepo[*entities.MasterNode]("master_nodes", "mnode", entities.MasterNodeIndices), - repos.NewFxMongoRepo[*entities.WorkerNode]("worker_nodes", "wnode", entities.WorkerNodeIndices), + repos.NewFxMongoRepo[*entities.ClusterManagedService]("cmsvcs", "cmsvcs", entities.ClusterManagedServiceIndices), + repos.NewFxMongoRepo[*entities.DomainEntry]("domain_entries", "de", entities.DomainEntryIndices), repos.NewFxMongoRepo[*entities.NodePool]("node_pools", "npool", entities.NodePoolIndices), - repos.NewFxMongoRepo[*entities.Secret]("secrets", "scrt", entities.SecretIndices), + repos.NewFxMongoRepo[*entities.Node]("node", "node", entities.NodePoolIndices), + repos.NewFxMongoRepo[*entities.CloudProviderSecret]("cloud_provider_secrets", "cps", entities.CloudProviderSecretIndices), + repos.NewFxMongoRepo[*entities.HelmRelease]("helm_releases", "hr", entities.HelmReleaseIndices), + + // kubernetes native resources, not managed by kloudlite + repos.NewFxMongoRepo[*entities.PersistentVolumeClaim]("pvcs", "pvc", entities.PersistentVolumeClaimIndices), + repos.NewFxMongoRepo[*entities.Namespace]("namespaces", "ns", entities.NamespaceIndices), + repos.NewFxMongoRepo[*entities.PersistentVolume]("pv", "pv", entities.PersistentVolumeIndices), + repos.NewFxMongoRepo[*entities.VolumeAttachment]("volume_attachments", "volatt", entities.VolumeAttachmentIndices), fx.Provide( - func(conn FinanceClientConnection) finance.FinanceClient { - return finance.NewFinanceClient((*grpc.ClientConn)(conn)) + func(conn IAMGrpcClient) iam.IAMClient { + return iam.NewIAMClient(conn) }, ), - redpanda.NewProducerFx[redpanda.Client](), + fx.Provide(func(conn AccountGrpcClient) (domain.AccountsSvc, error) { + ac := accounts.NewAccountsClient(conn) + return NewAccountsSvc(ac), nil + }), + + fx.Provide(func(client MessageOfficeInternalGrpcClient) message_office_internal.MessageOfficeInternalClient { + return message_office_internal.NewMessageOfficeInternalClient(client) + }), + + fx.Provide(func(jsc *nats.JetstreamClient, logger logging.Logger) SendTargetClusterMessagesProducer { + return msg_nats.NewJetstreamProducer(jsc) + }), + + fx.Provide(func(p SendTargetClusterMessagesProducer) domain.ResourceDispatcher { + return NewResourceDispatcher(p) + }), + + fx.Invoke(func(lf fx.Lifecycle, producer SendTargetClusterMessagesProducer) { + lf.Append(fx.Hook{ + OnStop: func(ctx context.Context) error { + return producer.Stop(ctx) + }, + }) + }), + + fx.Provide(func(cli *nats.Client, logger logging.Logger) domain.ResourceEventPublisher { + return NewResourceEventPublisher(cli, logger) + }), domain.Module, - fx.Provide(func(cli redpanda.Client, ev *env.Env, logger logging.Logger) (ByocClientUpdatesConsumer, error) { - return redpanda.NewConsumer(cli.GetBrokerHosts(), ev.KafkaConsumerGroupId, redpanda.ConsumerOpts{ - SASLAuth: cli.GetKafkaSASLAuth(), - Logger: logger.WithName("byoc-client-updates"), - }, []string{ev.KafkaTopicByocClientUpdates}) + fx.Provide(func(d domain.Domain) infra.InfraServer { + return newGrpcServer(d) }), - fx.Invoke(processByocClientUpdates), + fx.Invoke(func(gserver InfraGrpcServer, srv infra.InfraServer) { + infra.RegisterInfraServer(gserver, srv) + }), - fx.Provide(func(cli redpanda.Client, ev *env.Env, logger logging.Logger) (InfraUpdatesConsumer, error) { - return redpanda.NewConsumer(cli.GetBrokerHosts(), ev.KafkaConsumerGroupId, redpanda.ConsumerOpts{ - SASLAuth: cli.GetKafkaSASLAuth(), - Logger: logger.WithName("infra-updates"), - }, []string{ev.KafkaTopicByocClientUpdates}) + fx.Provide(func(jsc *nats.JetstreamClient, ev *env.Env) (ReceiveResourceUpdatesConsumer, error) { + topic := common.GetPlatformClusterMessagingTopic("*", "*", common.InfraReceiver, common.EventResourceUpdate) + + consumerName := "infra:resource-updates" + return msg_nats.NewJetstreamConsumer(context.TODO(), jsc, msg_nats.JetstreamConsumerArgs{ + Stream: ev.NatsStream, + ConsumerConfig: msg_nats.ConsumerConfig{ + Name: consumerName, + Durable: consumerName, + Description: "this consumer receives infra resource updates, processes them, and keeps our Database updated about things happening in the cluster", + FilterSubjects: []string{topic}, + }, + }) }), - fx.Invoke(processInfraUpdates), + fx.Invoke(func(lf fx.Lifecycle, consumer ReceiveResourceUpdatesConsumer, d domain.Domain, logger logging.Logger) { + lf.Append(fx.Hook{ + OnStart: func(context.Context) error { + go processResourceUpdates(consumer, d, logger) + return nil + }, + OnStop: func(ctx context.Context) error { + return consumer.Stop(ctx) + }, + }) + }), - fx.Invoke(func(server *fiber.App, logger logging.Logger) { - server.Use("/ws", func(ctx *fiber.Ctx) error { - if fWebsocket.IsWebSocketUpgrade(ctx) { - return ctx.Next() - } - return fiber.ErrUpgradeRequired + fx.Provide(func(jsc *nats.JetstreamClient, ev *env.Env) (ErrorOnApplyConsumer, error) { + topic := common.GetPlatformClusterMessagingTopic("*", "*", common.ConsoleReceiver, common.EventErrorOnApply) + + consumerName := "infra:error-on-apply" + + return msg_nats.NewJetstreamConsumer(context.TODO(), jsc, msg_nats.JetstreamConsumerArgs{ + Stream: ev.NatsStream, + ConsumerConfig: msg_nats.ConsumerConfig{ + Name: consumerName, + Durable: consumerName, + Description: "this consumer receives infra resource apply error on agent, processes them, and keeps our Database updated about why the resource apply failed at agent", + FilterSubjects: []string{topic}, + }, }) + }), - server.Get("/ws/status-updates", fWebsocket.New(func(conn *fWebsocket.Conn) { - logger.Infof("new socket request received ...") - defer conn.Close() - conn.WriteJSON(map[string]any{"hello": "world"}) - })) + fx.Invoke(func(lf fx.Lifecycle, consumer ErrorOnApplyConsumer, d domain.Domain, logger logging.Logger) { + lf.Append(fx.Hook{ + OnStart: func(context.Context) error { + go ProcessErrorOnApply(consumer, logger, d) + return nil + }, + OnStop: func(ctx context.Context) error { + return consumer.Stop(ctx) + }, + }) }), fx.Invoke( - func( - server *fiber.App, - d domain.Domain, - cacheClient AuthCacheClient, - env *env.Env, - ) { + func(server httpServer.Server, d domain.Domain, sessionRepo kv.Repo[*common.AuthSession], env *env.Env) { config := generated.Config{Resolvers: &graph.Resolver{Domain: d}} - config.Directives.IsLoggedIn = func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) { + + config.Directives.IsLoggedIn = func(ctx context.Context, _ interface{}, next graphql.Resolver) (res interface{}, err error) { sess := httpServer.GetSession[*common.AuthSession](ctx) if sess == nil { return nil, fiber.ErrUnauthorized @@ -98,25 +168,47 @@ var Module = fx.Module( return next(ctx) } - config.Directives.HasAccount = func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) { + config.Directives.IsLoggedInAndVerified = func(ctx context.Context, _ interface{}, next graphql.Resolver) (res interface{}, err error) { + sess := httpServer.GetSession[*common.AuthSession](ctx) + if sess == nil { + return nil, fiber.ErrUnauthorized + } + + if sess.UserVerified { + return next(ctx) + } + + return nil, &fiber.Error{ + Code: fiber.ErrUnauthorized.Code, + Message: "user's email is not verified, yet", + } + } + + config.Directives.HasAccount = func(ctx context.Context, _ interface{}, next graphql.Resolver) (res interface{}, err error) { + sess := httpServer.GetSession[*common.AuthSession](ctx) + if sess == nil { + return nil, fiber.ErrUnauthorized + } + m := httpServer.GetHttpCookies(ctx) klAccount := m[env.AccountCookieName] if klAccount == "" { - return nil, fmt.Errorf("no cookie named '%s' present in request", "kloudlite-cluster") + return nil, errors.Newf("no cookie named '%s' present in request", env.AccountCookieName) } cc := domain.InfraContext{ Context: ctx, AccountName: klAccount, + UserId: sess.UserId, + UserName: sess.UserName, + UserEmail: sess.UserEmail, } return next(context.WithValue(ctx, "infra-ctx", cc)) } schema := generated.NewExecutableSchema(config) - httpServer.SetupGQLServer( - server, - schema, - httpServer.NewSessionMiddleware[*common.AuthSession]( - cacheClient, + server.SetupGraphqlServer(schema, + httpServer.NewSessionMiddleware( + sessionRepo, "hotspot-session", env.CookieDomain, constants.CacheSessionPrefix, diff --git a/apps/infra/internal/app/gqlgen.yml b/apps/infra/internal/app/gqlgen.yml index a44248b38..85ca0c7db 100644 --- a/apps/infra/internal/app/gqlgen.yml +++ b/apps/infra/internal/app/gqlgen.yml @@ -1,6 +1,6 @@ schema: - graph/*.graphqls - - graph/crd-to-gql/*.graphqls + - graph/struct-to-graphql/*.graphqls # Where should the generated server code go? exec: @@ -27,6 +27,8 @@ resolver: # Optional: turn on use ` + "`" + `gqlgen:"fieldName"` + "`" + ` tags in your models struct_tag: json +skip_mod_tidy: true + # Optional: turn on to use []Thing instead of []*Thing # omit_slice_element_pointers: false @@ -36,8 +38,7 @@ struct_tag: json # 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: - - "kloudlite.io/pkg/errors" - # - "kloudlite.io/apps/infra/internal/domain/entities" + - "github.com/kloudlite/api/pkg/errors" # This section declares type mapping between the GraphQL and go type systems # @@ -46,21 +47,16 @@ autobind: # your liking skip_validation: true models: - # KLFile: - # model: - # - kloudlite.io/apps/consolev2/internal/domain/entities/localenv.KLFile - ID: model: - - kloudlite.io/pkg/repos.ID + - github.com/kloudlite/api/pkg/repos.ID - Metadata: - model: - - k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta + Metadata: &metadata-model + model: k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta + MetadataIn: *metadata-model - MetadataIn: - model: - - k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta + MsvcTemplate: + model: github.com/kloudlite/api/apps/infra/internal/entities.MsvcTemplate Int: model: @@ -71,108 +67,103 @@ models: model: - github.com/99designs/gqlgen/graphql.Map - Account: - model: github.com/kloudlite/wg-operator/apis/wg/v1.Account - AccountIn: - model: github.com/kloudlite/wg-operator/apis/wg/v1.Account + Cluster: &cluster-model + model: github.com/kloudlite/api/apps/infra/internal/entities.Cluster + fields: + adminKubeconfig: + resolver: true + ClusterIn: *cluster-model - CloudProvider: - model: - - kloudlite.io/apps/infra/internal/domain/entities.CloudProvider + HelmRelease: &helmrelease-model + model: github.com/kloudlite/api/apps/infra/internal/entities.HelmRelease + HelmReleaseIn: *helmrelease-model - CloudProviderIn: - model: - - kloudlite.io/apps/infra/internal/domain/entities.CloudProvider + CloudProviderSecret: &provider-secret-model + model: github.com/kloudlite/api/apps/infra/internal/entities.CloudProviderSecret + CloudProviderSecretIn: *provider-secret-model - BYOCCluster: - model: kloudlite.io/apps/infra/internal/domain/entities.BYOCCluster - BYOCClusterIn: - model: kloudlite.io/apps/infra/internal/domain/entities.BYOCCluster + NodePool: &nodepool-model + model: github.com/kloudlite/api/apps/infra/internal/entities.NodePool + fields: + nodes: + resolver: true - Cluster: - model: - - kloudlite.io/apps/infra/internal/domain/entities.Cluster - ClusterIn: - model: - - kloudlite.io/apps/infra/internal/domain/entities.Cluster + NodePoolIn: *nodepool-model - Edge: - model: - - kloudlite.io/apps/infra/internal/domain/entities.Edge - EdgeIn: - model: - - kloudlite.io/apps/infra/internal/domain/entities.Edge + DomainEntry: &domain-entry-model + model: github.com/kloudlite/api/apps/infra/internal/entities.DomainEntry + DomainEntryIn: *domain-entry-model - ProviderSecret: - model: - - kloudlite.io/apps/infra/internal/domain/entities.Secret + ClusterManagedService: &cluster-managed-service + model: github.com/kloudlite/api/apps/infra/internal/entities.ClusterManagedService + ClusterManagedServiceIn: *cluster-managed-service - ProviderSecretIn: - model: - - kloudlite.io/apps/infra/internal/domain/entities.Secret + PersistentVolumeClaim: &pvc-model + model: github.com/kloudlite/api/apps/infra/internal/entities.PersistentVolumeClaim + PersistentVolumeClaimIn: *pvc-model - MasterNode: - model: - - kloudlite.io/apps/infra/internal/domain/entities.MasterNode - MasterNodeIn: - model: - - kloudlite.io/apps/infra/internal/domain/entities.MasterNode + Namespace: &namespace-model + model: github.com/kloudlite/api/apps/infra/internal/entities.Namespace + NamespaceIn: *namespace-model - WorkerNode: - model: - - kloudlite.io/apps/infra/internal/domain/entities.WorkerNode - WorkerNodeIn: - model: - - kloudlite.io/apps/infra/internal/domain/entities.WorkerNode + PersistentVolume: &pv-model + model: github.com/kloudlite/api/apps/infra/internal/entities.PersistentVolume + PersistentVolumeIn: *pv-model - NodePool: - model: - - kloudlite.io/apps/infra/internal/domain/entities.NodePool - NodePoolIn: - model: - - kloudlite.io/apps/infra/internal/domain/entities.NodePool + VolumeAttachment: &volume-attachment-model + model: github.com/kloudlite/api/apps/infra/internal/entities.VolumeAttachment + VolumeAttachmentIn: *volume-attachment-model - Secret: - model: - - kloudlite.io/apps/infra/internal/domain/entities.Secret - SecretIn: - model: - - kloudlite.io/apps/infra/internal/domain/entities.Secret + Node: &node-model + model: github.com/kloudlite/api/apps/infra/internal/entities.Node + ResType: + model: github.com/kloudlite/api/apps/infra/internal/domain.ResType - Overrides: - model: - - github.com/kloudlite/operator/apis/crds/v1.JsonPatch + Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry: + model: github.com/kloudlite/api/apps/infra/internal/entities.MsvcTemplateEntry - OverridesIn: - model: - - github.com/kloudlite/operator/apis/crds/v1.JsonPatch + CheckNameAvailabilityOutput: + model: github.com/kloudlite/api/apps/infra/internal/domain.CheckNameAvailabilityOutput + + MatchFilter: &match-filter-model + model: github.com/kloudlite/api/pkg/repos.MatchFilter + MatchFilterIn: *match-filter-model - Status: - model: github.com/kloudlite/operator/pkg/operator.Status + MatchFilterMatchType: + model: github.com/kloudlite/api/pkg/repos.MatchType - Patch: - model: - - github.com/kloudlite/operator/pkg/json-patch.PatchOperation + CursorPagination: &cursor-pagination-model + model: github.com/kloudlite/api/pkg/repos.CursorPagination + CursorPaginationIn: *cursor-pagination-model - PatchIn: - model: - - github.com/kloudlite/operator/pkg/json-patch.PatchOperation + CursorPaginationSortDirection: &cursor-pagination-sort-direction-model + model: github.com/kloudlite/api/pkg/repos.SortDirection + CursorPaginationSortDirectionIn: *cursor-pagination-sort-direction-model - Check: - model: - - github.com/kloudlite/operator/pkg/operator.Check + Github__com___kloudlite___api___common__CreatedOrUpdatedBy: + model: github.com/kloudlite/api/common.CreatedOrUpdatedBy - SyncStatus: - model: kloudlite.io/pkg/types.SyncStatus + Github__com___kloudlite___api___apps___infra___internal___entities__CloudProviderName: &cloudprovider-name + model: github.com/kloudlite/api/apps/infra/internal/entities.CloudProviderName + Github__com___kloudlite___api___apps___infra___internal___entities__CloudProviderNameIn: *cloudprovider-name - SyncState: - model: kloudlite.io/pkg/types.SyncState + Github__com___kloudlite___operator___pkg___operator__Status: + model: github.com/kloudlite/operator/pkg/operator.Status - SyncAction: - model: kloudlite.io/pkg/types.SyncAction + Github__com___kloudlite___operator___pkg___operator__Check: + model: github.com/kloudlite/operator/pkg/operator.Check + Github__com___kloudlite___operator___pkg___operator__ResourceRef: + model: github.com/kloudlite/operator/pkg/operator.ResourceRef - ResType: - model: kloudlite.io/apps/infra/internal/domain.ResType + Github__com___kloudlite___api___pkg___types__SyncStatus: &sync-status-model + model: github.com/kloudlite/api/pkg/types.SyncStatus - CheckNameAvailabilityOutput: - model: kloudlite.io/apps/infra/internal/domain.CheckNameAvailabilityOutput + Github__com___kloudlite___api___pkg___types__SyncAction: + model: github.com/kloudlite/api/pkg/types.SyncAction + + Github__com___kloudlite___api___pkg___types__SyncState: + model: github.com/kloudlite/api/pkg/types.SyncState + + + # CheckAwsAccessOutput: + # model: github.com/kloudlite/api/apps/infra/internal/domain.AWSAccessValidationOutput diff --git a/apps/infra/internal/app/graph/byoccluster.resolvers.go b/apps/infra/internal/app/graph/byoccluster.resolvers.go deleted file mode 100644 index 19da044d4..000000000 --- a/apps/infra/internal/app/graph/byoccluster.resolvers.go +++ /dev/null @@ -1,41 +0,0 @@ -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.28 - -import ( - "context" - - "kloudlite.io/apps/infra/internal/app/graph/generated" - "kloudlite.io/apps/infra/internal/app/graph/model" - "kloudlite.io/apps/infra/internal/domain/entities" - fn "kloudlite.io/pkg/functions" -) - -// Spec is the resolver for the spec field. -func (r *bYOCClusterResolver) Spec(ctx context.Context, obj *entities.BYOCCluster) (*model.BYOCClusterSpec, error) { - var m model.BYOCClusterSpec - if err := fn.JsonConversion(obj.Spec, &m); err != nil { - return nil, err - } - return &m, nil -} - -// Spec is the resolver for the spec field. -func (r *bYOCClusterInResolver) Spec(ctx context.Context, obj *entities.BYOCCluster, data *model.BYOCClusterSpecIn) error { - if obj == nil { - return nil - } - - return fn.JsonConversion(data, &obj.Spec) -} - -// BYOCCluster returns generated.BYOCClusterResolver implementation. -func (r *Resolver) BYOCCluster() generated.BYOCClusterResolver { return &bYOCClusterResolver{r} } - -// BYOCClusterIn returns generated.BYOCClusterInResolver implementation. -func (r *Resolver) BYOCClusterIn() generated.BYOCClusterInResolver { return &bYOCClusterInResolver{r} } - -type bYOCClusterResolver struct{ *Resolver } -type bYOCClusterInResolver struct{ *Resolver } diff --git a/apps/infra/internal/app/graph/cloudprovider.resolvers.go b/apps/infra/internal/app/graph/cloudprovider.resolvers.go deleted file mode 100644 index 9c70554cc..000000000 --- a/apps/infra/internal/app/graph/cloudprovider.resolvers.go +++ /dev/null @@ -1,55 +0,0 @@ -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.28 - -import ( - "context" - - "github.com/kloudlite/operator/pkg/operator" - "kloudlite.io/apps/infra/internal/app/graph/generated" - "kloudlite.io/apps/infra/internal/app/graph/model" - "kloudlite.io/apps/infra/internal/domain/entities" - fn "kloudlite.io/pkg/functions" -) - -// Spec is the resolver for the spec field. -func (r *cloudProviderResolver) Spec(ctx context.Context, obj *entities.CloudProvider) (*model.CloudProviderSpec, error) { - var m model.CloudProviderSpec - if err := fn.JsonConversion(obj.Spec, &m); err != nil { - return nil, err - } - return &m, nil -} - -// Status is the resolver for the status field. -func (r *cloudProviderResolver) Status(ctx context.Context, obj *entities.CloudProvider) (*operator.Status, error) { - if obj == nil { - return nil, nil - } - var op operator.Status - if err := fn.JsonConversion(obj.Status, &op); err != nil { - return nil, err - } - return &op, nil -} - -// Spec is the resolver for the spec field. -func (r *cloudProviderInResolver) Spec(ctx context.Context, obj *entities.CloudProvider, data *model.CloudProviderSpecIn) error { - if obj == nil { - return nil - } - return fn.JsonConversion(data, &obj.Spec) -} - -// CloudProvider returns generated.CloudProviderResolver implementation. -func (r *Resolver) CloudProvider() generated.CloudProviderResolver { return &cloudProviderResolver{r} } - -// CloudProviderIn returns generated.CloudProviderInResolver implementation. -func (r *Resolver) CloudProviderIn() generated.CloudProviderInResolver { - return &cloudProviderInResolver{r} -} - -type cloudProviderResolver struct{ *Resolver } -type cloudProviderInResolver struct{ *Resolver } diff --git a/apps/infra/internal/app/graph/cloudprovidersecret.resolvers.go b/apps/infra/internal/app/graph/cloudprovidersecret.resolvers.go new file mode 100644 index 000000000..e342d4a2d --- /dev/null +++ b/apps/infra/internal/app/graph/cloudprovidersecret.resolvers.go @@ -0,0 +1,99 @@ +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.28 + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + "time" + + "github.com/kloudlite/api/apps/infra/internal/app/graph/generated" + "github.com/kloudlite/api/apps/infra/internal/app/graph/model" + "github.com/kloudlite/api/apps/infra/internal/entities" + "github.com/kloudlite/api/cmd/struct-to-graphql/pkg/parser" + fn "github.com/kloudlite/api/pkg/functions" + ct "github.com/kloudlite/operator/apis/common-types" + "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// Aws is the resolver for the aws field. +func (r *cloudProviderSecretResolver) Aws(ctx context.Context, obj *entities.CloudProviderSecret) (*model.GithubComKloudliteAPIAppsInfraInternalEntitiesAWSSecretCredentials, error) { + if obj == nil || obj.CreationTime.IsZero() { + return nil, errors.Newf("CloudProviderSecret object is nil") + } + return &model.GithubComKloudliteAPIAppsInfraInternalEntitiesAWSSecretCredentials{ + AccessKey: obj.AWS.AccessKey, + AwsAccountID: obj.AWS.AWSAccountId, + CfParamExternalID: &obj.AWS.CfParamExternalID, + CfParamInstanceProfileName: &obj.AWS.CfParamInstanceProfileName, + CfParamRoleName: &obj.AWS.CfParamRoleName, + CfParamStackName: &obj.AWS.CfParamStackName, + CfParamTrustedArn: &obj.AWS.CfParamTrustedARN, + SecretKey: obj.AWS.SecretKey, + }, nil +} + +// CloudProviderName is the resolver for the cloudProviderName field. +func (r *cloudProviderSecretResolver) CloudProviderName(ctx context.Context, obj *entities.CloudProviderSecret) (model.GithubComKloudliteOperatorApisCommonTypesCloudProvider, error) { + return model.GithubComKloudliteOperatorApisCommonTypesCloudProvider(obj.CloudProviderName), nil +} + +// CreationTime is the resolver for the creationTime field. +func (r *cloudProviderSecretResolver) CreationTime(ctx context.Context, obj *entities.CloudProviderSecret) (string, error) { + if obj == nil || obj.CreationTime.IsZero() { + return "", errors.Newf("CloudProviderSecret object is nil") + } + return obj.CreationTime.Format(time.RFC3339), nil +} + +// ID is the resolver for the id field. +func (r *cloudProviderSecretResolver) ID(ctx context.Context, obj *entities.CloudProviderSecret) (string, error) { + if obj == nil { + return "", errors.Newf("CloudProviderSecret object is nil") + } + + return string(obj.Id), nil +} + +// UpdateTime is the resolver for the updateTime field. +func (r *cloudProviderSecretResolver) UpdateTime(ctx context.Context, obj *entities.CloudProviderSecret) (string, error) { + if obj == nil || obj.UpdateTime.IsZero() { + return "", errors.Newf("CloudProviderSecret object is nil") + } + + return obj.UpdateTime.Format(time.RFC3339), nil +} + +// Aws is the resolver for the aws field. +func (r *cloudProviderSecretInResolver) Aws(ctx context.Context, obj *entities.CloudProviderSecret, data *model.GithubComKloudliteAPIAppsInfraInternalEntitiesAWSSecretCredentialsIn) error { + return fn.JsonConversion(data, &obj.AWS) +} + +// CloudProviderName is the resolver for the cloudProviderName field. +func (r *cloudProviderSecretInResolver) CloudProviderName(ctx context.Context, obj *entities.CloudProviderSecret, data model.GithubComKloudliteOperatorApisCommonTypesCloudProvider) error { + if !data.IsValid() { + return errors.Newf("invalid cloud provider name") + } + obj.CloudProviderName = ct.CloudProvider(parser.RestoreSanitizedPackagePath(data.String())) + return nil +} + +// Metadata is the resolver for the metadata field. +func (r *cloudProviderSecretInResolver) Metadata(ctx context.Context, obj *entities.CloudProviderSecret, data *v1.ObjectMeta) error { + return fn.JsonConversion(data, &obj.ObjectMeta) +} + +// CloudProviderSecret returns generated.CloudProviderSecretResolver implementation. +func (r *Resolver) CloudProviderSecret() generated.CloudProviderSecretResolver { + return &cloudProviderSecretResolver{r} +} + +// CloudProviderSecretIn returns generated.CloudProviderSecretInResolver implementation. +func (r *Resolver) CloudProviderSecretIn() generated.CloudProviderSecretInResolver { + return &cloudProviderSecretInResolver{r} +} + +type cloudProviderSecretResolver struct{ *Resolver } +type cloudProviderSecretInResolver struct{ *Resolver } diff --git a/apps/infra/internal/app/graph/cluster.resolvers.go b/apps/infra/internal/app/graph/cluster.resolvers.go index 5ef443d9a..631071396 100644 --- a/apps/infra/internal/app/graph/cluster.resolvers.go +++ b/apps/infra/internal/app/graph/cluster.resolvers.go @@ -6,39 +6,65 @@ package graph import ( "context" + "github.com/kloudlite/api/pkg/errors" + "time" - "github.com/kloudlite/operator/pkg/operator" - "kloudlite.io/apps/infra/internal/app/graph/generated" - "kloudlite.io/apps/infra/internal/app/graph/model" - "kloudlite.io/apps/infra/internal/domain/entities" - fn "kloudlite.io/pkg/functions" + "github.com/kloudlite/api/apps/infra/internal/app/graph/generated" + "github.com/kloudlite/api/apps/infra/internal/app/graph/model" + "github.com/kloudlite/api/apps/infra/internal/entities" + fn "github.com/kloudlite/api/pkg/functions" + "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// CreationTime is the resolver for the creationTime field. +func (r *clusterResolver) CreationTime(ctx context.Context, obj *entities.Cluster) (string, error) { + if obj == nil { + return "", errors.Newf("cluster obj is nil") + } + return obj.CreationTime.Format(time.RFC3339), nil +} + +// ID is the resolver for the id field. +func (r *clusterResolver) ID(ctx context.Context, obj *entities.Cluster) (string, error) { + if obj == nil { + return "", errors.Newf("cluster obj is nil") + } + return string(obj.Id), nil +} + // Spec is the resolver for the spec field. -func (r *clusterResolver) Spec(ctx context.Context, obj *entities.Cluster) (*model.ClusterSpec, error) { - var m model.ClusterSpec - if err := fn.JsonConversion(obj.Spec, &m); err != nil { - return nil, err +func (r *clusterResolver) Spec(ctx context.Context, obj *entities.Cluster) (*model.GithubComKloudliteOperatorApisClustersV1ClusterSpec, error) { + if obj == nil { + return nil, errors.Newf("cluster is nil") + } + + var spec model.GithubComKloudliteOperatorApisClustersV1ClusterSpec + if err := fn.JsonConversion(&obj.Spec, &spec); err != nil { + return nil, errors.NewE(err) } - return &m, nil + return &spec, nil } -// Status is the resolver for the status field. -func (r *clusterResolver) Status(ctx context.Context, obj *entities.Cluster) (*operator.Status, error) { +// UpdateTime is the resolver for the updateTime field. +func (r *clusterResolver) UpdateTime(ctx context.Context, obj *entities.Cluster) (string, error) { if obj == nil { - return nil, nil + return "", errors.Newf("cluster is nil") } - var op operator.Status - if err := fn.JsonConversion(obj.Status, &op); err != nil { - return nil, err + return obj.UpdateTime.Format(time.RFC3339), nil +} + +// Metadata is the resolver for the metadata field. +func (r *clusterInResolver) Metadata(ctx context.Context, obj *entities.Cluster, data *v1.ObjectMeta) error { + if obj == nil { + return errors.Newf("cluster is nil") } - return &op, nil + return fn.JsonConversion(data, &obj.ObjectMeta) } // Spec is the resolver for the spec field. -func (r *clusterInResolver) Spec(ctx context.Context, obj *entities.Cluster, data *model.ClusterSpecIn) error { +func (r *clusterInResolver) Spec(ctx context.Context, obj *entities.Cluster, data *model.GithubComKloudliteOperatorApisClustersV1ClusterSpecIn) error { if obj == nil { - return nil + return errors.Newf("cluster is nil") } return fn.JsonConversion(data, &obj.Spec) } diff --git a/apps/infra/internal/app/graph/clustermanagedservice.resolvers.go b/apps/infra/internal/app/graph/clustermanagedservice.resolvers.go new file mode 100644 index 000000000..20b44b17a --- /dev/null +++ b/apps/infra/internal/app/graph/clustermanagedservice.resolvers.go @@ -0,0 +1,90 @@ +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.28 + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + "time" + + "github.com/kloudlite/api/apps/infra/internal/app/graph/generated" + "github.com/kloudlite/api/apps/infra/internal/app/graph/model" + "github.com/kloudlite/api/apps/infra/internal/entities" + fn "github.com/kloudlite/api/pkg/functions" + "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// CreationTime is the resolver for the creationTime field. +func (r *clusterManagedServiceResolver) CreationTime(ctx context.Context, obj *entities.ClusterManagedService) (string, error) { + if obj == nil { + return "", errors.Newf("clusterManagedService obj is nil") + } + + return obj.CreationTime.Format(time.RFC3339), nil +} + +// ID is the resolver for the id field. +func (r *clusterManagedServiceResolver) ID(ctx context.Context, obj *entities.ClusterManagedService) (string, error) { + if obj == nil { + return "", errors.Newf("clusterManagedService obj is nil") + } + + return string(obj.Id), nil +} + +// Spec is the resolver for the spec field. +func (r *clusterManagedServiceResolver) Spec(ctx context.Context, obj *entities.ClusterManagedService) (*model.GithubComKloudliteOperatorApisCrdsV1ClusterManagedServiceSpec, error) { + if obj == nil { + return nil, errors.Newf("clusterManagedService is nil") + } + + var spec model.GithubComKloudliteOperatorApisCrdsV1ClusterManagedServiceSpec + + if err := fn.JsonConversion(&obj.Spec, &spec); err != nil { + return nil, errors.NewE(err) + } + + return &spec, nil +} + +// UpdateTime is the resolver for the updateTime field. +func (r *clusterManagedServiceResolver) UpdateTime(ctx context.Context, obj *entities.ClusterManagedService) (string, error) { + if obj == nil { + return "", errors.Newf("clusterManagedService is nil") + } + + return obj.UpdateTime.Format(time.RFC3339), nil +} + +// Metadata is the resolver for the metadata field. +func (r *clusterManagedServiceInResolver) Metadata(ctx context.Context, obj *entities.ClusterManagedService, data *v1.ObjectMeta) error { + if obj == nil { + return errors.Newf("clusterManagedService is nil") + } + + return fn.JsonConversion(data, &obj.ObjectMeta) +} + +// Spec is the resolver for the spec field. +func (r *clusterManagedServiceInResolver) Spec(ctx context.Context, obj *entities.ClusterManagedService, data *model.GithubComKloudliteOperatorApisCrdsV1ClusterManagedServiceSpecIn) error { + if obj == nil { + return errors.Newf("clusterManagedService is nil") + } + + return fn.JsonConversion(data, &obj.Spec) +} + +// ClusterManagedService returns generated.ClusterManagedServiceResolver implementation. +func (r *Resolver) ClusterManagedService() generated.ClusterManagedServiceResolver { + return &clusterManagedServiceResolver{r} +} + +// ClusterManagedServiceIn returns generated.ClusterManagedServiceInResolver implementation. +func (r *Resolver) ClusterManagedServiceIn() generated.ClusterManagedServiceInResolver { + return &clusterManagedServiceInResolver{r} +} + +type clusterManagedServiceResolver struct{ *Resolver } +type clusterManagedServiceInResolver struct{ *Resolver } diff --git a/apps/infra/internal/app/graph/common-types.resolvers.go b/apps/infra/internal/app/graph/common-types.resolvers.go new file mode 100644 index 000000000..a3ac74a7c --- /dev/null +++ b/apps/infra/internal/app/graph/common-types.resolvers.go @@ -0,0 +1,214 @@ +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.28 + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + "time" + + "github.com/kloudlite/api/apps/infra/internal/app/graph/generated" + "github.com/kloudlite/api/apps/infra/internal/app/graph/model" + "github.com/kloudlite/api/apps/infra/internal/entities" + "github.com/kloudlite/api/common" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/types" + "github.com/kloudlite/operator/pkg/operator" + "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// Fields is the resolver for the fields field. +func (r *github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntryResolver) Fields(ctx context.Context, obj *entities.MsvcTemplateEntry) ([]*model.GithubComKloudliteAPIAppsInfraInternalEntitiesInputField, error) { + if obj == nil { + return nil, errors.Newf("msvcTemplateEntry is nil") + } + if obj.Fields == nil { + return nil, nil + } + var res []*model.GithubComKloudliteAPIAppsInfraInternalEntitiesInputField + if err := fn.JsonConversion(obj.Fields, &res); err != nil { + return nil, errors.NewE(err) + } + return res, nil +} + +// Outputs is the resolver for the outputs field. +func (r *github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntryResolver) Outputs(ctx context.Context, obj *entities.MsvcTemplateEntry) ([]*model.GithubComKloudliteAPIAppsInfraInternalEntitiesOutputField, error) { + if obj == nil { + return nil, errors.Newf("msvcTemplateEntry is nil") + } + if obj.Outputs == nil { + return nil, nil + } + var res []*model.GithubComKloudliteAPIAppsInfraInternalEntitiesOutputField + if err := fn.JsonConversion(obj.Outputs, &res); err != nil { + return nil, errors.NewE(err) + } + return res, nil +} + +// Resources is the resolver for the resources field. +func (r *github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntryResolver) Resources(ctx context.Context, obj *entities.MsvcTemplateEntry) ([]*model.GithubComKloudliteAPIAppsInfraInternalEntitiesMresTemplate, error) { + if obj == nil { + return nil, errors.Newf("msvcTemplateEntry is nil") + } + if obj.Resources == nil { + return nil, nil + } + var res []*model.GithubComKloudliteAPIAppsInfraInternalEntitiesMresTemplate + if err := fn.JsonConversion(obj.Resources, &res); err != nil { + return nil, errors.NewE(err) + } + return res, nil +} + +// UserID is the resolver for the userId field. +func (r *github__com___kloudlite___api___common__CreatedOrUpdatedByResolver) UserID(ctx context.Context, obj *common.CreatedOrUpdatedBy) (string, error) { + if obj == nil { + return "", errors.Newf("createdOrUpdatedBy is nil") + } + return string(obj.UserId), nil +} + +// LastSyncedAt is the resolver for the lastSyncedAt field. +func (r *github__com___kloudlite___api___pkg___types__SyncStatusResolver) LastSyncedAt(ctx context.Context, obj *types.SyncStatus) (*string, error) { + if obj == nil { + return nil, errors.Newf("syncStatus is nil") + } + return fn.New(obj.LastSyncedAt.Format(time.RFC3339)), nil +} + +// SyncScheduledAt is the resolver for the syncScheduledAt field. +func (r *github__com___kloudlite___api___pkg___types__SyncStatusResolver) SyncScheduledAt(ctx context.Context, obj *types.SyncStatus) (*string, error) { + if obj == nil { + return nil, errors.Newf("syncStatus is nil") + } + return fn.New(obj.SyncScheduledAt.Format(time.RFC3339)), nil +} + +// Checks is the resolver for the checks field. +func (r *github__com___kloudlite___operator___pkg___operator__StatusResolver) Checks(ctx context.Context, obj *operator.Status) (map[string]interface{}, error) { + var m map[string]any + if err := fn.JsonConversion(obj.Checks, &m); err != nil { + return nil, errors.NewE(err) + } + return m, nil +} + +// LastReconcileTime is the resolver for the lastReconcileTime field. +func (r *github__com___kloudlite___operator___pkg___operator__StatusResolver) LastReconcileTime(ctx context.Context, obj *operator.Status) (*string, error) { + if obj == nil { + return nil, errors.Newf("syncStatus is nil") + } + if obj.LastReconcileTime == nil { + return fn.New(time.Now().Format(time.RFC3339)), nil + } + return fn.New(obj.LastReconcileTime.Format(time.RFC3339)), nil +} + +// Message is the resolver for the message field. +func (r *github__com___kloudlite___operator___pkg___operator__StatusResolver) Message(ctx context.Context, obj *operator.Status) (*model.GithubComKloudliteOperatorPkgRawJSONRawJSON, error) { + if obj == nil { + return nil, errors.Newf("syncStatus is nil") + } + if obj.Message == nil { + return nil, nil + } + return &model.GithubComKloudliteOperatorPkgRawJSONRawJSON{ + RawMessage: obj.Message.RawMessage, + }, nil +} + +// Annotations is the resolver for the annotations field. +func (r *metadataResolver) Annotations(ctx context.Context, obj *v1.ObjectMeta) (map[string]interface{}, error) { + var m map[string]any + if err := fn.JsonConversion(obj.Annotations, &m); err != nil { + return nil, errors.NewE(err) + } + return m, nil +} + +// CreationTimestamp is the resolver for the creationTimestamp field. +func (r *metadataResolver) CreationTimestamp(ctx context.Context, obj *v1.ObjectMeta) (string, error) { + if obj == nil { + return "", errors.Newf("metadata is nil") + } + return obj.CreationTimestamp.Format(time.RFC3339), nil +} + +// DeletionTimestamp is the resolver for the deletionTimestamp field. +func (r *metadataResolver) DeletionTimestamp(ctx context.Context, obj *v1.ObjectMeta) (*string, error) { + if obj == nil { + return nil, errors.Newf("metadata is nil") + } + + if obj.DeletionTimestamp == nil { + return nil, nil + } + + return fn.New(obj.DeletionTimestamp.Format(time.RFC3339)), nil +} + +// Labels is the resolver for the labels field. +func (r *metadataResolver) Labels(ctx context.Context, obj *v1.ObjectMeta) (map[string]interface{}, error) { + var m map[string]any + if err := fn.JsonConversion(obj.Labels, &m); err != nil { + return nil, errors.NewE(err) + } + return m, nil +} + +// Annotations is the resolver for the annotations field. +func (r *metadataInResolver) Annotations(ctx context.Context, obj *v1.ObjectMeta, data map[string]interface{}) error { + var m map[string]string + if err := fn.JsonConversion(data, &m); err != nil { + return errors.NewE(err) + } + obj.SetAnnotations(m) + return nil +} + +// Labels is the resolver for the labels field. +func (r *metadataInResolver) Labels(ctx context.Context, obj *v1.ObjectMeta, data map[string]interface{}) error { + var m map[string]string + if err := fn.JsonConversion(data, &m); err != nil { + return errors.NewE(err) + } + obj.SetLabels(m) + return nil +} + +// Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry returns generated.Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntryResolver implementation. +func (r *Resolver) Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry() generated.Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntryResolver { + return &github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntryResolver{r} +} + +// Github__com___kloudlite___api___common__CreatedOrUpdatedBy returns generated.Github__com___kloudlite___api___common__CreatedOrUpdatedByResolver implementation. +func (r *Resolver) Github__com___kloudlite___api___common__CreatedOrUpdatedBy() generated.Github__com___kloudlite___api___common__CreatedOrUpdatedByResolver { + return &github__com___kloudlite___api___common__CreatedOrUpdatedByResolver{r} +} + +// Github__com___kloudlite___api___pkg___types__SyncStatus returns generated.Github__com___kloudlite___api___pkg___types__SyncStatusResolver implementation. +func (r *Resolver) Github__com___kloudlite___api___pkg___types__SyncStatus() generated.Github__com___kloudlite___api___pkg___types__SyncStatusResolver { + return &github__com___kloudlite___api___pkg___types__SyncStatusResolver{r} +} + +// Github__com___kloudlite___operator___pkg___operator__Status returns generated.Github__com___kloudlite___operator___pkg___operator__StatusResolver implementation. +func (r *Resolver) Github__com___kloudlite___operator___pkg___operator__Status() generated.Github__com___kloudlite___operator___pkg___operator__StatusResolver { + return &github__com___kloudlite___operator___pkg___operator__StatusResolver{r} +} + +// Metadata returns generated.MetadataResolver implementation. +func (r *Resolver) Metadata() generated.MetadataResolver { return &metadataResolver{r} } + +// MetadataIn returns generated.MetadataInResolver implementation. +func (r *Resolver) MetadataIn() generated.MetadataInResolver { return &metadataInResolver{r} } + +type github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntryResolver struct{ *Resolver } +type github__com___kloudlite___api___common__CreatedOrUpdatedByResolver struct{ *Resolver } +type github__com___kloudlite___api___pkg___types__SyncStatusResolver struct{ *Resolver } +type github__com___kloudlite___operator___pkg___operator__StatusResolver struct{ *Resolver } +type metadataResolver struct{ *Resolver } +type metadataInResolver struct{ *Resolver } diff --git a/apps/infra/internal/app/graph/crd-to-gql/byoccluster.graphqls b/apps/infra/internal/app/graph/crd-to-gql/byoccluster.graphqls deleted file mode 100644 index 8ebc9a70a..000000000 --- a/apps/infra/internal/app/graph/crd-to-gql/byoccluster.graphqls +++ /dev/null @@ -1,38 +0,0 @@ -type BYOCClusterSpec @shareable { - provider: String! - publicIps: [String] - region: String! - storageClasses: [String] - accountName: String! - displayName: String - incomingKafkaTopic: String! - ingressClasses: [String] -} - -input BYOCClusterSpecIn { - provider: String! - publicIps: [String] - region: String! - storageClasses: [String] - accountName: String! - displayName: String - incomingKafkaTopic: String! - ingressClasses: [String] -} - -type BYOCCluster @shareable { - metadata: Metadata! @goField(name: "objectMeta") - syncStatus: SyncStatus - spec: BYOCClusterSpec - status: Status - apiVersion: String - kind: String -} - -input BYOCClusterIn { - metadata: MetadataIn! @goField(name: "objectMeta") - spec: BYOCClusterSpecIn - apiVersion: String - kind: String -} - diff --git a/apps/infra/internal/app/graph/crd-to-gql/cloudprovider.graphqls b/apps/infra/internal/app/graph/crd-to-gql/cloudprovider.graphqls deleted file mode 100644 index f3860ba63..000000000 --- a/apps/infra/internal/app/graph/crd-to-gql/cloudprovider.graphqls +++ /dev/null @@ -1,40 +0,0 @@ -input CloudProviderSpecProviderSecretIn { - name: String! - namespace: String! -} - -type CloudProviderSpec @shareable { - display_name: String! - provider: String! - providerSecret: CloudProviderSpecProviderSecret! - accountName: String! -} - -input CloudProviderSpecIn { - display_name: String! - provider: String! - providerSecret: CloudProviderSpecProviderSecretIn! - accountName: String! -} - -type CloudProvider @shareable { - apiVersion: String - kind: String - metadata: Metadata! @goField(name: "objectMeta") - syncStatus: SyncStatus - spec: CloudProviderSpec - status: Status -} - -input CloudProviderIn { - apiVersion: String - kind: String - metadata: MetadataIn! @goField(name: "objectMeta") - spec: CloudProviderSpecIn -} - -type CloudProviderSpecProviderSecret @shareable { - name: String! - namespace: String! -} - diff --git a/apps/infra/internal/app/graph/crd-to-gql/cluster.graphqls b/apps/infra/internal/app/graph/crd-to-gql/cluster.graphqls deleted file mode 100644 index 6f3de63bf..000000000 --- a/apps/infra/internal/app/graph/crd-to-gql/cluster.graphqls +++ /dev/null @@ -1,34 +0,0 @@ -type ClusterSpec @shareable { - provider: String! - providerName: String! - region: String! - accountName: String! - config: String! - count: Int! -} - -input ClusterSpecIn { - provider: String! - providerName: String! - region: String! - accountName: String! - config: String! - count: Int! -} - -type Cluster @shareable { - apiVersion: String - kind: String - metadata: Metadata! @goField(name: "objectMeta") - syncStatus: SyncStatus - spec: ClusterSpec - status: Status -} - -input ClusterIn { - apiVersion: String - kind: String - metadata: MetadataIn! @goField(name: "objectMeta") - spec: ClusterSpecIn -} - diff --git a/apps/infra/internal/app/graph/crd-to-gql/edge.graphqls b/apps/infra/internal/app/graph/crd-to-gql/edge.graphqls deleted file mode 100644 index 59da94d0d..000000000 --- a/apps/infra/internal/app/graph/crd-to-gql/edge.graphqls +++ /dev/null @@ -1,48 +0,0 @@ -type EdgeSpecPools @shareable { - name: String! - config: String! - max: Int - min: Int -} - -input EdgeSpecPoolsIn { - name: String! - config: String! - max: Int - min: Int -} - -type EdgeSpec @shareable { - accountName: String! - clusterName: String! - pools: [EdgeSpecPools] - provider: String - providerName: String! - region: String! -} - -input EdgeSpecIn { - accountName: String! - clusterName: String! - pools: [EdgeSpecPoolsIn] - provider: String - providerName: String! - region: String! -} - -type Edge @shareable { - apiVersion: String - kind: String - metadata: Metadata! @goField(name: "objectMeta") - syncStatus: SyncStatus - spec: EdgeSpec - status: Status -} - -input EdgeIn { - apiVersion: String - kind: String - metadata: MetadataIn! @goField(name: "objectMeta") - spec: EdgeSpecIn -} - diff --git a/apps/infra/internal/app/graph/crd-to-gql/masternode.graphqls b/apps/infra/internal/app/graph/crd-to-gql/masternode.graphqls deleted file mode 100644 index 80d0a86d8..000000000 --- a/apps/infra/internal/app/graph/crd-to-gql/masternode.graphqls +++ /dev/null @@ -1,34 +0,0 @@ -type MasterNode @shareable { - status: Status - apiVersion: String - kind: String - metadata: Metadata! @goField(name: "objectMeta") - syncStatus: SyncStatus - spec: MasterNodeSpec -} - -input MasterNodeIn { - apiVersion: String - kind: String - metadata: MetadataIn! @goField(name: "objectMeta") - spec: MasterNodeSpecIn -} - -type MasterNodeSpec @shareable { - region: String! - accountName: String! - clusterName: String! - config: String! - provider: String! - providerName: String! -} - -input MasterNodeSpecIn { - region: String! - accountName: String! - clusterName: String! - config: String! - provider: String! - providerName: String! -} - diff --git a/apps/infra/internal/app/graph/crd-to-gql/nodepool.graphqls b/apps/infra/internal/app/graph/crd-to-gql/nodepool.graphqls deleted file mode 100644 index b365ecb7a..000000000 --- a/apps/infra/internal/app/graph/crd-to-gql/nodepool.graphqls +++ /dev/null @@ -1,40 +0,0 @@ -type NodePool @shareable { - apiVersion: String - kind: String - metadata: Metadata! @goField(name: "objectMeta") - syncStatus: SyncStatus - spec: NodePoolSpec - status: Status -} - -input NodePoolIn { - apiVersion: String - kind: String - metadata: MetadataIn! @goField(name: "objectMeta") - spec: NodePoolSpecIn -} - -type NodePoolSpec @shareable { - accountName: String! - config: String! - max: Int - providerName: String! - region: String! - clusterName: String! - edgeName: String! - min: Int - provider: String! -} - -input NodePoolSpecIn { - accountName: String! - config: String! - max: Int - providerName: String! - region: String! - clusterName: String! - edgeName: String! - min: Int - provider: String! -} - diff --git a/apps/infra/internal/app/graph/crd-to-gql/scalars.graphqls b/apps/infra/internal/app/graph/crd-to-gql/scalars.graphqls deleted file mode 100644 index 5a803012e..000000000 --- a/apps/infra/internal/app/graph/crd-to-gql/scalars.graphqls +++ /dev/null @@ -1,76 +0,0 @@ - -scalar Any -scalar Json -scalar Map -scalar Date - -type Metadata @shareable { - name: String! - namespace: String - labels: Json - annotations: Json - creationTimestamp: Date! - deletionTimestamp: Date - generation: Int! -} - -input MetadataIn { - name: String! - namespace: String - labels: Json - annotations: Json -} - -type Status @shareable { - isReady: Boolean! - checks: Map - displayVars: Json -} - -type Check @shareable { - status: Boolean - message: String - generation: Int -} - -type Patch @shareable { - op: String! - path: String! - value: Any -} - -type Overrides @shareable{ - applied: Boolean - patches: [Patch!] -} - -input PatchIn { - op: String! - path: String! - value: Any -} - -input OverridesIn{ - patches: [PatchIn!] -} - -enum SyncAction { - APPLY - DELETE -} - -enum SyncState { - IDLE - IN_PROGRESS - READY - NOT_READY -} - -type SyncStatus @shareable{ - syncScheduledAt: Date! - lastSyncedAt: Date - action: SyncAction! - generation: Int! - state: SyncState! - error: String -} diff --git a/apps/infra/internal/app/graph/crd-to-gql/secret.graphqls b/apps/infra/internal/app/graph/crd-to-gql/secret.graphqls deleted file mode 100644 index 541240391..000000000 --- a/apps/infra/internal/app/graph/crd-to-gql/secret.graphqls +++ /dev/null @@ -1,26 +0,0 @@ -type Secret @shareable { - syncStatus: SyncStatus - stringData: Map - apiVersion: String - data: Map - enabled: Boolean - kind: String - metadata: Metadata! @goField(name: "objectMeta") - overrides: Overrides - projectName: String - type: String - status: Status -} - -input SecretIn { - stringData: Map - apiVersion: String - data: Map - enabled: Boolean - kind: String - metadata: MetadataIn! @goField(name: "objectMeta") - overrides: OverridesIn - projectName: String - type: String -} - diff --git a/apps/infra/internal/app/graph/crd-to-gql/workernode.graphqls b/apps/infra/internal/app/graph/crd-to-gql/workernode.graphqls deleted file mode 100644 index c378c3fb6..000000000 --- a/apps/infra/internal/app/graph/crd-to-gql/workernode.graphqls +++ /dev/null @@ -1,42 +0,0 @@ -type WorkerNodeSpec @shareable { - clusterName: String! - config: String! - nodeIndex: Int - pool: String! - provider: String! - accountName: String! - edgeName: String! - providerName: String! - region: String! - stateful: Boolean -} - -input WorkerNodeSpecIn { - clusterName: String! - config: String! - nodeIndex: Int - pool: String! - provider: String! - accountName: String! - edgeName: String! - providerName: String! - region: String! - stateful: Boolean -} - -type WorkerNode @shareable { - metadata: Metadata! @goField(name: "objectMeta") - syncStatus: SyncStatus - spec: WorkerNodeSpec - status: Status - apiVersion: String - kind: String -} - -input WorkerNodeIn { - metadata: MetadataIn! @goField(name: "objectMeta") - spec: WorkerNodeSpecIn - apiVersion: String - kind: String -} - diff --git a/apps/infra/internal/app/graph/domainentry.resolvers.go b/apps/infra/internal/app/graph/domainentry.resolvers.go new file mode 100644 index 000000000..b5ac7074f --- /dev/null +++ b/apps/infra/internal/app/graph/domainentry.resolvers.go @@ -0,0 +1,44 @@ +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.28 + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + "time" + + "github.com/kloudlite/api/apps/infra/internal/app/graph/generated" + "github.com/kloudlite/api/apps/infra/internal/entities" +) + +// CreationTime is the resolver for the creationTime field. +func (r *domainEntryResolver) CreationTime(ctx context.Context, obj *entities.DomainEntry) (string, error) { + if obj == nil { + return "", errors.Newf("domainEntry is nil") + } + return obj.CreationTime.Format(time.RFC3339), nil +} + +// ID is the resolver for the id field. +func (r *domainEntryResolver) ID(ctx context.Context, obj *entities.DomainEntry) (string, error) { + if obj == nil { + return "", errors.Newf("domainEntry is nil") + } + return string(obj.Id), nil +} + +// UpdateTime is the resolver for the updateTime field. +func (r *domainEntryResolver) UpdateTime(ctx context.Context, obj *entities.DomainEntry) (string, error) { + if obj == nil { + return "", errors.Newf("domainEntry is nil") + } + + return obj.UpdateTime.Format(time.RFC3339), nil +} + +// DomainEntry returns generated.DomainEntryResolver implementation. +func (r *Resolver) DomainEntry() generated.DomainEntryResolver { return &domainEntryResolver{r} } + +type domainEntryResolver struct{ *Resolver } diff --git a/apps/infra/internal/app/graph/edge.resolvers.go b/apps/infra/internal/app/graph/edge.resolvers.go deleted file mode 100644 index 1a4c8c8f7..000000000 --- a/apps/infra/internal/app/graph/edge.resolvers.go +++ /dev/null @@ -1,53 +0,0 @@ -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.28 - -import ( - "context" - - "github.com/kloudlite/operator/pkg/operator" - "kloudlite.io/apps/infra/internal/app/graph/generated" - "kloudlite.io/apps/infra/internal/app/graph/model" - "kloudlite.io/apps/infra/internal/domain/entities" - fn "kloudlite.io/pkg/functions" -) - -// Spec is the resolver for the spec field. -func (r *edgeResolver) Spec(ctx context.Context, obj *entities.Edge) (*model.EdgeSpec, error) { - var m model.EdgeSpec - if err := fn.JsonConversion(obj.Spec, &m); err != nil { - return nil, err - } - return &m, nil -} - -// Status is the resolver for the status field. -func (r *edgeResolver) Status(ctx context.Context, obj *entities.Edge) (*operator.Status, error) { - if obj == nil { - return nil, nil - } - var op operator.Status - if err := fn.JsonConversion(obj.Status, &op); err != nil { - return nil, err - } - return &op, nil -} - -// Spec is the resolver for the spec field. -func (r *edgeInResolver) Spec(ctx context.Context, obj *entities.Edge, data *model.EdgeSpecIn) error { - if obj == nil { - return nil - } - return fn.JsonConversion(data, &obj.Spec) -} - -// Edge returns generated.EdgeResolver implementation. -func (r *Resolver) Edge() generated.EdgeResolver { return &edgeResolver{r} } - -// EdgeIn returns generated.EdgeInResolver implementation. -func (r *Resolver) EdgeIn() generated.EdgeInResolver { return &edgeInResolver{r} } - -type edgeResolver struct{ *Resolver } -type edgeInResolver struct{ *Resolver } diff --git a/apps/infra/internal/app/graph/generated/generated.go b/apps/infra/internal/app/graph/generated/generated.go index e24c3e95e..fa3596a7e 100644 --- a/apps/infra/internal/app/graph/generated/generated.go +++ b/apps/infra/internal/app/graph/generated/generated.go @@ -14,16 +14,16 @@ import ( "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/introspection" "github.com/99designs/gqlgen/plugin/federation/fedruntime" - v11 "github.com/kloudlite/operator/apis/crds/v1" - json_patch "github.com/kloudlite/operator/pkg/json-patch" + "github.com/kloudlite/api/apps/infra/internal/app/graph/model" + "github.com/kloudlite/api/apps/infra/internal/domain" + "github.com/kloudlite/api/apps/infra/internal/entities" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/repos" + "github.com/kloudlite/api/pkg/types" "github.com/kloudlite/operator/pkg/operator" gqlparser "github.com/vektah/gqlparser/v2" "github.com/vektah/gqlparser/v2/ast" "k8s.io/apimachinery/pkg/apis/meta/v1" - "kloudlite.io/apps/infra/internal/app/graph/model" - "kloudlite.io/apps/infra/internal/domain" - "kloudlite.io/apps/infra/internal/domain/entities" - "kloudlite.io/pkg/types" ) // region ************************** generated!.gotpl ************************** @@ -44,62 +44,45 @@ type Config struct { } type ResolverRoot interface { - BYOCCluster() BYOCClusterResolver - CloudProvider() CloudProviderResolver + CloudProviderSecret() CloudProviderSecretResolver Cluster() ClusterResolver - Edge() EdgeResolver - MasterNode() MasterNodeResolver + ClusterManagedService() ClusterManagedServiceResolver + DomainEntry() DomainEntryResolver + Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry() Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntryResolver + Github__com___kloudlite___api___common__CreatedOrUpdatedBy() Github__com___kloudlite___api___common__CreatedOrUpdatedByResolver + Github__com___kloudlite___api___pkg___types__SyncStatus() Github__com___kloudlite___api___pkg___types__SyncStatusResolver + Github__com___kloudlite___operator___pkg___operator__Status() Github__com___kloudlite___operator___pkg___operator__StatusResolver + HelmRelease() HelmReleaseResolver Metadata() MetadataResolver Mutation() MutationResolver + Namespace() NamespaceResolver + Node() NodeResolver NodePool() NodePoolResolver - Patch() PatchResolver + PersistentVolume() PersistentVolumeResolver + PersistentVolumeClaim() PersistentVolumeClaimResolver Query() QueryResolver - Secret() SecretResolver - Status() StatusResolver - SyncStatus() SyncStatusResolver - WorkerNode() WorkerNodeResolver - BYOCClusterIn() BYOCClusterInResolver - CloudProviderIn() CloudProviderInResolver + VolumeAttachment() VolumeAttachmentResolver + CloudProviderSecretIn() CloudProviderSecretInResolver ClusterIn() ClusterInResolver - EdgeIn() EdgeInResolver - MasterNodeIn() MasterNodeInResolver + ClusterManagedServiceIn() ClusterManagedServiceInResolver + HelmReleaseIn() HelmReleaseInResolver MetadataIn() MetadataInResolver + NamespaceIn() NamespaceInResolver NodePoolIn() NodePoolInResolver - PatchIn() PatchInResolver - SecretIn() SecretInResolver - WorkerNodeIn() WorkerNodeInResolver + PersistentVolumeIn() PersistentVolumeInResolver + VolumeAttachmentIn() VolumeAttachmentInResolver } type DirectiveRoot struct { - HasAccount func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) - IsLoggedIn func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) + HasAccount func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) + IsLoggedIn func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) + IsLoggedInAndVerified func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) } type ComplexityRoot struct { - BYOCCluster struct { - APIVersion func(childComplexity int) int - Kind func(childComplexity int) int - ObjectMeta func(childComplexity int) int - Spec func(childComplexity int) int - Status func(childComplexity int) int - SyncStatus func(childComplexity int) int - } - - BYOCClusterSpec struct { - AccountName func(childComplexity int) int - DisplayName func(childComplexity int) int - IncomingKafkaTopic func(childComplexity int) int - IngressClasses func(childComplexity int) int - Provider func(childComplexity int) int - PublicIps func(childComplexity int) int - Region func(childComplexity int) int - StorageClasses func(childComplexity int) int - } - - Check struct { - Generation func(childComplexity int) int - Message func(childComplexity int) int - Status func(childComplexity int) int + CheckAwsAccessOutput struct { + InstallationURL func(childComplexity int) int + Result func(childComplexity int) int } CheckNameAvailabilityOutput struct { @@ -107,14240 +90,58871 @@ type ComplexityRoot struct { SuggestedNames func(childComplexity int) int } - CloudProvider struct { - APIVersion func(childComplexity int) int - Kind func(childComplexity int) int - ObjectMeta func(childComplexity int) int - Spec func(childComplexity int) int - Status func(childComplexity int) int - SyncStatus func(childComplexity int) int + CloudProviderSecret struct { + AccountName func(childComplexity int) int + Aws func(childComplexity int) int + CloudProviderName func(childComplexity int) int + CreatedBy func(childComplexity int) int + CreationTime func(childComplexity int) int + DisplayName func(childComplexity int) int + ID func(childComplexity int) int + LastUpdatedBy func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + ObjectMeta func(childComplexity int) int + RecordVersion func(childComplexity int) int + UpdateTime func(childComplexity int) int } - CloudProviderSpec struct { - AccountName func(childComplexity int) int - DisplayName func(childComplexity int) int - Provider func(childComplexity int) int - ProviderSecret func(childComplexity int) int + CloudProviderSecretEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int } - CloudProviderSpecProviderSecret struct { - Name func(childComplexity int) int - Namespace func(childComplexity int) int + CloudProviderSecretPaginatedRecords struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int } Cluster struct { - APIVersion func(childComplexity int) int - Kind func(childComplexity int) int - ObjectMeta func(childComplexity int) int - Spec func(childComplexity int) int - Status func(childComplexity int) int - SyncStatus func(childComplexity int) int + APIVersion func(childComplexity int) int + AccountName func(childComplexity int) int + AdminKubeconfig func(childComplexity int) int + CreatedBy func(childComplexity int) int + CreationTime func(childComplexity int) int + DisplayName func(childComplexity int) int + ID func(childComplexity int) int + Kind func(childComplexity int) int + LastUpdatedBy func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + ObjectMeta func(childComplexity int) int + RecordVersion func(childComplexity int) int + Spec func(childComplexity int) int + Status func(childComplexity int) int + SyncStatus func(childComplexity int) int + UpdateTime func(childComplexity int) int + } + + ClusterEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + ClusterManagedService struct { + APIVersion func(childComplexity int) int + AccountName func(childComplexity int) int + ClusterName func(childComplexity int) int + CreatedBy func(childComplexity int) int + CreationTime func(childComplexity int) int + DisplayName func(childComplexity int) int + ID func(childComplexity int) int + Kind func(childComplexity int) int + LastUpdatedBy func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + ObjectMeta func(childComplexity int) int + RecordVersion func(childComplexity int) int + Spec func(childComplexity int) int + Status func(childComplexity int) int + SyncStatus func(childComplexity int) int + UpdateTime func(childComplexity int) int + } + + ClusterManagedServiceEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + ClusterManagedServicePaginatedRecords struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + ClusterPaginatedRecords struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + CursorPagination struct { + After func(childComplexity int) int + Before func(childComplexity int) int + First func(childComplexity int) int + Last func(childComplexity int) int + OrderBy func(childComplexity int) int + SortDirection func(childComplexity int) int + } + + DomainEntry struct { + AccountName func(childComplexity int) int + ClusterName func(childComplexity int) int + CreatedBy func(childComplexity int) int + CreationTime func(childComplexity int) int + DisplayName func(childComplexity int) int + DomainName func(childComplexity int) int + ID func(childComplexity int) int + LastUpdatedBy func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + RecordVersion func(childComplexity int) int + UpdateTime func(childComplexity int) int + } + + DomainEntryEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + DomainEntryPaginatedRecords struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + EncodedValue struct { + Encoding func(childComplexity int) int + Value func(childComplexity int) int + } + + Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials struct { + AccessKey func(childComplexity int) int + AwsAccountID func(childComplexity int) int + CfParamExternalID func(childComplexity int) int + CfParamInstanceProfileName func(childComplexity int) int + CfParamRoleName func(childComplexity int) int + CfParamStackName func(childComplexity int) int + CfParamTrustedArn func(childComplexity int) int + SecretKey func(childComplexity int) int + } + + Github__com___kloudlite___api___apps___infra___internal___entities__InputField struct { + DefaultValue func(childComplexity int) int + DisplayUnit func(childComplexity int) int + InputType func(childComplexity int) int + Label func(childComplexity int) int + Max func(childComplexity int) int + Min func(childComplexity int) int + Multiplier func(childComplexity int) int + Name func(childComplexity int) int + Required func(childComplexity int) int + Unit func(childComplexity int) int } - ClusterSpec struct { - AccountName func(childComplexity int) int - Config func(childComplexity int) int - Count func(childComplexity int) int - Provider func(childComplexity int) int - ProviderName func(childComplexity int) int - Region func(childComplexity int) int + Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate struct { + APIVersion func(childComplexity int) int + Description func(childComplexity int) int + DisplayName func(childComplexity int) int + Fields func(childComplexity int) int + Kind func(childComplexity int) int + Name func(childComplexity int) int + Outputs func(childComplexity int) int } - Edge struct { - APIVersion func(childComplexity int) int - Kind func(childComplexity int) int - ObjectMeta func(childComplexity int) int - Spec func(childComplexity int) int - Status func(childComplexity int) int - SyncStatus func(childComplexity int) int + Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry struct { + Active func(childComplexity int) int + ApiVersion func(childComplexity int) int + Description func(childComplexity int) int + DisplayName func(childComplexity int) int + Fields func(childComplexity int) int + Kind func(childComplexity int) int + LogoUrl func(childComplexity int) int + Name func(childComplexity int) int + Outputs func(childComplexity int) int + Resources func(childComplexity int) int } - EdgeSpec struct { - AccountName func(childComplexity int) int - ClusterName func(childComplexity int) int - Pools func(childComplexity int) int - Provider func(childComplexity int) int - ProviderName func(childComplexity int) int - Region func(childComplexity int) int + Github__com___kloudlite___api___apps___infra___internal___entities__OutputField struct { + Description func(childComplexity int) int + Label func(childComplexity int) int + Name func(childComplexity int) int } - EdgeSpecPools struct { - Config func(childComplexity int) int - Max func(childComplexity int) int - Min func(childComplexity int) int - Name func(childComplexity int) int + Github__com___kloudlite___api___common__CreatedOrUpdatedBy struct { + UserEmail func(childComplexity int) int + UserID func(childComplexity int) int + UserName func(childComplexity int) int } - MasterNode struct { - APIVersion func(childComplexity int) int - Kind func(childComplexity int) int - ObjectMeta func(childComplexity int) int - Spec func(childComplexity int) int - Status func(childComplexity int) int - SyncStatus func(childComplexity int) int + Github__com___kloudlite___api___pkg___types__SyncStatus struct { + Action func(childComplexity int) int + Error func(childComplexity int) int + LastSyncedAt func(childComplexity int) int + RecordVersion func(childComplexity int) int + State func(childComplexity int) int + SyncScheduledAt func(childComplexity int) int } - MasterNodeSpec struct { - AccountName func(childComplexity int) int - ClusterName func(childComplexity int) int - Config func(childComplexity int) int - Provider func(childComplexity int) int - ProviderName func(childComplexity int) int - Region func(childComplexity int) int + Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig struct { + K3sMasters func(childComplexity int) int + NodePools func(childComplexity int) int + Region func(childComplexity int) int + SpotNodePools func(childComplexity int) int + } + + Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig struct { + IamInstanceProfileRole func(childComplexity int) int + ImageID func(childComplexity int) int + ImageSSHUsername func(childComplexity int) int + InstanceType func(childComplexity int) int + Nodes func(childComplexity int) int + NvidiaGpuEnabled func(childComplexity int) int + RootVolumeSize func(childComplexity int) int + RootVolumeType func(childComplexity int) int + } + + Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig struct { + AvailabilityZone func(childComplexity int) int + Ec2Pool func(childComplexity int) int + IamInstanceProfileRole func(childComplexity int) int + ImageID func(childComplexity int) int + ImageSSHUsername func(childComplexity int) int + NvidiaGpuEnabled func(childComplexity int) int + PoolType func(childComplexity int) int + RootVolumeSize func(childComplexity int) int + RootVolumeType func(childComplexity int) int + SpotPool func(childComplexity int) int } - Metadata struct { - Annotations func(childComplexity int) int - CreationTimestamp func(childComplexity int) int - DeletionTimestamp func(childComplexity int) int - Generation func(childComplexity int) int - Labels func(childComplexity int) int - Name func(childComplexity int) int - Namespace func(childComplexity int) int + Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig struct { + InstanceType func(childComplexity int) int + Nodes func(childComplexity int) int } - Mutation struct { - InfraCreateBYOCCluster func(childComplexity int, cluster entities.BYOCCluster) int - InfraCreateCloudProvider func(childComplexity int, cloudProvider entities.CloudProvider, providerSecret entities.Secret) int - InfraCreateCluster func(childComplexity int, cluster entities.Cluster) int - InfraCreateEdge func(childComplexity int, edge entities.Edge) int - InfraDeleteBYOCCluster func(childComplexity int, name string) int - InfraDeleteCloudProvider func(childComplexity int, name string) int - InfraDeleteCluster func(childComplexity int, name string) int - InfraDeleteEdge func(childComplexity int, clusterName string, name string) int - InfraDeleteWorkerNode func(childComplexity int, clusterName string, edgeName string, name string) int - InfraUpdateBYOCCluster func(childComplexity int, cluster entities.BYOCCluster) int - InfraUpdateCloudProvider func(childComplexity int, cloudProvider entities.CloudProvider, providerSecret *entities.Secret) int - InfraUpdateCluster func(childComplexity int, cluster entities.Cluster) int - InfraUpdateEdge func(childComplexity int, edge entities.Edge) int + Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode struct { + MemoryPerVcpu func(childComplexity int) int + Vcpu func(childComplexity int) int } - NodePool struct { - APIVersion func(childComplexity int) int - Kind func(childComplexity int) int - ObjectMeta func(childComplexity int) int - Spec func(childComplexity int) int - Status func(childComplexity int) int - SyncStatus func(childComplexity int) int + Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNode struct { + InstanceTypes func(childComplexity int) int } - NodePoolSpec struct { - AccountName func(childComplexity int) int - ClusterName func(childComplexity int) int - Config func(childComplexity int) int - EdgeName func(childComplexity int) int - Max func(childComplexity int) int - Min func(childComplexity int) int - Provider func(childComplexity int) int - ProviderName func(childComplexity int) int - Region func(childComplexity int) int + Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig struct { + CPUNode func(childComplexity int) int + GpuNode func(childComplexity int) int + Nodes func(childComplexity int) int + SpotFleetTaggingRoleName func(childComplexity int) int } - Overrides struct { - Applied func(childComplexity int) int - Patches func(childComplexity int) int + Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys struct { + KeyAWSAccountID func(childComplexity int) int + KeyAWSAssumeRoleExternalID func(childComplexity int) int + KeyAWSAssumeRoleRoleArn func(childComplexity int) int + KeyAccessKey func(childComplexity int) int + KeyIAMInstanceProfileRole func(childComplexity int) int + KeySecretKey func(childComplexity int) int } - Patch struct { - Op func(childComplexity int) int - Path func(childComplexity int) int - Value func(childComplexity int) int + Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput struct { + JobName func(childComplexity int) int + JobNamespace func(childComplexity int) int + KeyK3sAgentJoinToken func(childComplexity int) int + KeyK3sServerJoinToken func(childComplexity int) int + KeyKubeconfig func(childComplexity int) int + SecretName func(childComplexity int) int } - Query struct { - InfraCheckNameAvailability func(childComplexity int, resType domain.ResType, name string) int - InfraGetBYOCCluster func(childComplexity int, name string) int - InfraGetCloudProvider func(childComplexity int, name string) int - InfraGetCluster func(childComplexity int, name string) int - InfraGetEdge func(childComplexity int, clusterName string, name string) int - InfraGetMasterNodes func(childComplexity int, clusterName string) int - InfraGetNodePools func(childComplexity int, clusterName string, edgeName string) int - InfraGetWorkerNodes func(childComplexity int, clusterName string, edgeName string) int - InfraListBYOCClusters func(childComplexity int) int - InfraListCloudProviders func(childComplexity int) int - InfraListClusters func(childComplexity int) int - InfraListEdges func(childComplexity int, clusterName string, providerName *string) int - __resolve__service func(childComplexity int) int - } - - Secret struct { - APIVersion func(childComplexity int) int - Data func(childComplexity int) int - Enabled func(childComplexity int) int - Kind func(childComplexity int) int - ObjectMeta func(childComplexity int) int - Overrides func(childComplexity int) int - ProjectName func(childComplexity int) int - Status func(childComplexity int) int - StringData func(childComplexity int) int - SyncStatus func(childComplexity int) int - Type func(childComplexity int) int + Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec struct { + AccountID func(childComplexity int) int + AccountName func(childComplexity int) int + AvailabilityMode func(childComplexity int) int + Aws func(childComplexity int) int + BackupToS3Enabled func(childComplexity int) int + CloudProvider func(childComplexity int) int + CloudflareEnabled func(childComplexity int) int + ClusterInternalDNSHost func(childComplexity int) int + ClusterTokenRef func(childComplexity int) int + CredentialKeys func(childComplexity int) int + CredentialsRef func(childComplexity int) int + KloudliteRelease func(childComplexity int) int + MessageQueueTopicName func(childComplexity int) int + Output func(childComplexity int) int + PublicDNSHost func(childComplexity int) int + TaintMasterNodes func(childComplexity int) int } - Status struct { - Checks func(childComplexity int) int - DisplayVars func(childComplexity int) int - IsReady func(childComplexity int) int + Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode struct { + CloudProviderAccessKey func(childComplexity int) int + CloudProviderSecretKey func(childComplexity int) int + JobName func(childComplexity int) int + JobNamespace func(childComplexity int) int + StateS3BucketFilePath func(childComplexity int) int + StateS3BucketName func(childComplexity int) int + StateS3BucketRegion func(childComplexity int) int } - SyncStatus struct { - Action func(childComplexity int) int - Error func(childComplexity int) int - Generation func(childComplexity int) int - LastSyncedAt func(childComplexity int) int - State func(childComplexity int) int - SyncScheduledAt func(childComplexity int) int + Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps struct { + AvailabilityZone func(childComplexity int) int + LastRecreatedAt func(childComplexity int) int + Role func(childComplexity int) int } - WorkerNode struct { - APIVersion func(childComplexity int) int - Kind func(childComplexity int) int - ObjectMeta func(childComplexity int) int - Spec func(childComplexity int) int - Status func(childComplexity int) int - SyncStatus func(childComplexity int) int + Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec struct { + Aws func(childComplexity int) int + CloudProvider func(childComplexity int) int + Iac func(childComplexity int) int + MaxCount func(childComplexity int) int + MinCount func(childComplexity int) int + NodeLabels func(childComplexity int) int + NodeTaints func(childComplexity int) int } - WorkerNodeSpec struct { - AccountName func(childComplexity int) int - ClusterName func(childComplexity int) int - Config func(childComplexity int) int - EdgeName func(childComplexity int) int - NodeIndex func(childComplexity int) int - Pool func(childComplexity int) int - Provider func(childComplexity int) int - ProviderName func(childComplexity int) int - Region func(childComplexity int) int - Stateful func(childComplexity int) int + Github__com___kloudlite___operator___apis___clusters___v1__NodeProps struct { + LastRecreatedAt func(childComplexity int) int } - _Service struct { - SDL func(childComplexity int) int + Github__com___kloudlite___operator___apis___clusters___v1__NodeSpec struct { + NodepoolName func(childComplexity int) int } -} -type BYOCClusterResolver interface { - Spec(ctx context.Context, obj *entities.BYOCCluster) (*model.BYOCClusterSpec, error) -} -type CloudProviderResolver interface { - Spec(ctx context.Context, obj *entities.CloudProvider) (*model.CloudProviderSpec, error) - Status(ctx context.Context, obj *entities.CloudProvider) (*operator.Status, error) -} -type ClusterResolver interface { - Spec(ctx context.Context, obj *entities.Cluster) (*model.ClusterSpec, error) - Status(ctx context.Context, obj *entities.Cluster) (*operator.Status, error) -} -type EdgeResolver interface { - Spec(ctx context.Context, obj *entities.Edge) (*model.EdgeSpec, error) - Status(ctx context.Context, obj *entities.Edge) (*operator.Status, error) -} -type MasterNodeResolver interface { - Status(ctx context.Context, obj *entities.MasterNode) (*operator.Status, error) + Github__com___kloudlite___operator___apis___common____types__MinMaxFloat struct { + Max func(childComplexity int) int + Min func(childComplexity int) int + } - Spec(ctx context.Context, obj *entities.MasterNode) (*model.MasterNodeSpec, error) -} -type MetadataResolver interface { - Labels(ctx context.Context, obj *v1.ObjectMeta) (map[string]interface{}, error) - Annotations(ctx context.Context, obj *v1.ObjectMeta) (map[string]interface{}, error) - CreationTimestamp(ctx context.Context, obj *v1.ObjectMeta) (string, error) - DeletionTimestamp(ctx context.Context, obj *v1.ObjectMeta) (*string, error) -} -type MutationResolver interface { - InfraCreateBYOCCluster(ctx context.Context, cluster entities.BYOCCluster) (*entities.BYOCCluster, error) - InfraUpdateBYOCCluster(ctx context.Context, cluster entities.BYOCCluster) (*entities.BYOCCluster, error) - InfraDeleteBYOCCluster(ctx context.Context, name string) (bool, error) - InfraCreateCluster(ctx context.Context, cluster entities.Cluster) (*entities.Cluster, error) - InfraUpdateCluster(ctx context.Context, cluster entities.Cluster) (*entities.Cluster, error) - InfraDeleteCluster(ctx context.Context, name string) (bool, error) - InfraCreateCloudProvider(ctx context.Context, cloudProvider entities.CloudProvider, providerSecret entities.Secret) (*entities.CloudProvider, error) - InfraUpdateCloudProvider(ctx context.Context, cloudProvider entities.CloudProvider, providerSecret *entities.Secret) (*entities.CloudProvider, error) - InfraDeleteCloudProvider(ctx context.Context, name string) (bool, error) - InfraCreateEdge(ctx context.Context, edge entities.Edge) (*entities.Edge, error) - InfraUpdateEdge(ctx context.Context, edge entities.Edge) (*entities.Edge, error) - InfraDeleteEdge(ctx context.Context, clusterName string, name string) (bool, error) - InfraDeleteWorkerNode(ctx context.Context, clusterName string, edgeName string, name string) (bool, error) -} -type NodePoolResolver interface { - Spec(ctx context.Context, obj *entities.NodePool) (*model.NodePoolSpec, error) - Status(ctx context.Context, obj *entities.NodePool) (*operator.Status, error) -} -type PatchResolver interface { - Value(ctx context.Context, obj *json_patch.PatchOperation) (interface{}, error) -} -type QueryResolver interface { - InfraCheckNameAvailability(ctx context.Context, resType domain.ResType, name string) (*domain.CheckNameAvailabilityOutput, error) - InfraListBYOCClusters(ctx context.Context) ([]*entities.BYOCCluster, error) - InfraGetBYOCCluster(ctx context.Context, name string) (*entities.BYOCCluster, error) - InfraListClusters(ctx context.Context) ([]*entities.Cluster, error) - InfraGetCluster(ctx context.Context, name string) (*entities.Cluster, error) - InfraListCloudProviders(ctx context.Context) ([]*entities.CloudProvider, error) - InfraGetCloudProvider(ctx context.Context, name string) (*entities.CloudProvider, error) - InfraListEdges(ctx context.Context, clusterName string, providerName *string) ([]*entities.Edge, error) - InfraGetEdge(ctx context.Context, clusterName string, name string) (*entities.Edge, error) - InfraGetMasterNodes(ctx context.Context, clusterName string) ([]*entities.MasterNode, error) - InfraGetWorkerNodes(ctx context.Context, clusterName string, edgeName string) ([]*entities.WorkerNode, error) - InfraGetNodePools(ctx context.Context, clusterName string, edgeName string) ([]*entities.NodePool, error) -} -type SecretResolver interface { - StringData(ctx context.Context, obj *entities.Secret) (map[string]interface{}, error) + Github__com___kloudlite___operator___apis___common____types__SecretKeyRef struct { + Key func(childComplexity int) int + Name func(childComplexity int) int + Namespace func(childComplexity int) int + } - Data(ctx context.Context, obj *entities.Secret) (map[string]interface{}, error) + Github__com___kloudlite___operator___apis___common____types__SecretRef struct { + Name func(childComplexity int) int + Namespace func(childComplexity int) int + } - Type(ctx context.Context, obj *entities.Secret) (*string, error) -} -type StatusResolver interface { - Checks(ctx context.Context, obj *operator.Status) (map[string]interface{}, error) - DisplayVars(ctx context.Context, obj *operator.Status) (map[string]interface{}, error) -} -type SyncStatusResolver interface { - SyncScheduledAt(ctx context.Context, obj *types.SyncStatus) (string, error) - LastSyncedAt(ctx context.Context, obj *types.SyncStatus) (*string, error) -} -type WorkerNodeResolver interface { - Spec(ctx context.Context, obj *entities.WorkerNode) (*model.WorkerNodeSpec, error) - Status(ctx context.Context, obj *entities.WorkerNode) (*operator.Status, error) -} + Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec struct { + MsvcSpec func(childComplexity int) int + TargetNamespace func(childComplexity int) int + } -type BYOCClusterInResolver interface { - Spec(ctx context.Context, obj *entities.BYOCCluster, data *model.BYOCClusterSpecIn) error -} -type CloudProviderInResolver interface { - Spec(ctx context.Context, obj *entities.CloudProvider, data *model.CloudProviderSpecIn) error -} -type ClusterInResolver interface { - Spec(ctx context.Context, obj *entities.Cluster, data *model.ClusterSpecIn) error -} -type EdgeInResolver interface { - Spec(ctx context.Context, obj *entities.Edge, data *model.EdgeSpecIn) error -} -type MasterNodeInResolver interface { - Spec(ctx context.Context, obj *entities.MasterNode, data *model.MasterNodeSpecIn) error -} -type MetadataInResolver interface { - Labels(ctx context.Context, obj *v1.ObjectMeta, data map[string]interface{}) error - Annotations(ctx context.Context, obj *v1.ObjectMeta, data map[string]interface{}) error -} -type NodePoolInResolver interface { - Spec(ctx context.Context, obj *entities.NodePool, data *model.NodePoolSpecIn) error -} -type PatchInResolver interface { - Value(ctx context.Context, obj *json_patch.PatchOperation, data interface{}) error -} -type SecretInResolver interface { - StringData(ctx context.Context, obj *entities.Secret, data map[string]interface{}) error + Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec struct { + ChartName func(childComplexity int) int + ChartRepoURL func(childComplexity int) int + ChartVersion func(childComplexity int) int + JobVars func(childComplexity int) int + PostInstall func(childComplexity int) int + PostUninstall func(childComplexity int) int + PreInstall func(childComplexity int) int + PreUninstall func(childComplexity int) int + Values func(childComplexity int) int + } - Data(ctx context.Context, obj *entities.Secret, data map[string]interface{}) error + Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus struct { + Checks func(childComplexity int) int + IsReady func(childComplexity int) int + LastReadyGeneration func(childComplexity int) int + LastReconcileTime func(childComplexity int) int + Message func(childComplexity int) int + ReleaseNotes func(childComplexity int) int + ReleaseStatus func(childComplexity int) int + Resources func(childComplexity int) int + } - Type(ctx context.Context, obj *entities.Secret, data *string) error -} -type WorkerNodeInResolver interface { - Spec(ctx context.Context, obj *entities.WorkerNode, data *model.WorkerNodeSpecIn) error -} + Github__com___kloudlite___operator___apis___crds___v1__JobVars struct { + Affinity func(childComplexity int) int + BackOffLimit func(childComplexity int) int + NodeSelector func(childComplexity int) int + Tolerations func(childComplexity int) int + } -type executableSchema struct { - resolvers ResolverRoot - directives DirectiveRoot - complexity ComplexityRoot -} + Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec struct { + ServiceTemplate func(childComplexity int) int + } -func (e *executableSchema) Schema() *ast.Schema { - return parsedSchema -} + Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate struct { + APIVersion func(childComplexity int) int + Kind func(childComplexity int) int + Spec func(childComplexity int) int + } -func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) { - ec := executionContext{nil, e} - _ = ec - switch typeName + "." + field { + Github__com___kloudlite___operator___pkg___operator__Check struct { + Generation func(childComplexity int) int + Message func(childComplexity int) int + Status func(childComplexity int) int + } - case "BYOCCluster.apiVersion": - if e.complexity.BYOCCluster.APIVersion == nil { - break - } + Github__com___kloudlite___operator___pkg___operator__ResourceRef struct { + APIVersion func(childComplexity int) int + Kind func(childComplexity int) int + Name func(childComplexity int) int + Namespace func(childComplexity int) int + } - return e.complexity.BYOCCluster.APIVersion(childComplexity), true + Github__com___kloudlite___operator___pkg___operator__Status struct { + Checks func(childComplexity int) int + IsReady func(childComplexity int) int + LastReadyGeneration func(childComplexity int) int + LastReconcileTime func(childComplexity int) int + Message func(childComplexity int) int + Resources func(childComplexity int) int + } - case "BYOCCluster.kind": - if e.complexity.BYOCCluster.Kind == nil { - break - } + Github__com___kloudlite___operator___pkg___raw____json__RawJson struct { + RawMessage func(childComplexity int) int + } - return e.complexity.BYOCCluster.Kind(childComplexity), true + HelmRelease struct { + APIVersion func(childComplexity int) int + AccountName func(childComplexity int) int + ClusterName func(childComplexity int) int + CreatedBy func(childComplexity int) int + CreationTime func(childComplexity int) int + DisplayName func(childComplexity int) int + ID func(childComplexity int) int + Kind func(childComplexity int) int + LastUpdatedBy func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + ObjectMeta func(childComplexity int) int + RecordVersion func(childComplexity int) int + Spec func(childComplexity int) int + Status func(childComplexity int) int + SyncStatus func(childComplexity int) int + UpdateTime func(childComplexity int) int + } - case "BYOCCluster.metadata": - if e.complexity.BYOCCluster.ObjectMeta == nil { - break - } + HelmReleaseEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } - return e.complexity.BYOCCluster.ObjectMeta(childComplexity), true + HelmReleasePaginatedRecords struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } - case "BYOCCluster.spec": - if e.complexity.BYOCCluster.Spec == nil { - break - } + K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource struct { + FsType func(childComplexity int) int + Partition func(childComplexity int) int + ReadOnly func(childComplexity int) int + VolumeID func(childComplexity int) int + } - return e.complexity.BYOCCluster.Spec(childComplexity), true + K8s__io___api___core___v1__Affinity struct { + NodeAffinity func(childComplexity int) int + PodAffinity func(childComplexity int) int + PodAntiAffinity func(childComplexity int) int + } - case "BYOCCluster.status": - if e.complexity.BYOCCluster.Status == nil { - break - } + K8s__io___api___core___v1__AzureDiskVolumeSource struct { + CachingMode func(childComplexity int) int + DiskName func(childComplexity int) int + DiskURI func(childComplexity int) int + FsType func(childComplexity int) int + Kind func(childComplexity int) int + ReadOnly func(childComplexity int) int + } - return e.complexity.BYOCCluster.Status(childComplexity), true + K8s__io___api___core___v1__AzureFilePersistentVolumeSource struct { + ReadOnly func(childComplexity int) int + SecretName func(childComplexity int) int + SecretNamespace func(childComplexity int) int + ShareName func(childComplexity int) int + } - case "BYOCCluster.syncStatus": - if e.complexity.BYOCCluster.SyncStatus == nil { - break - } + K8s__io___api___core___v1__CSIPersistentVolumeSource struct { + ControllerExpandSecretRef func(childComplexity int) int + ControllerPublishSecretRef func(childComplexity int) int + Driver func(childComplexity int) int + FsType func(childComplexity int) int + NodeExpandSecretRef func(childComplexity int) int + NodePublishSecretRef func(childComplexity int) int + NodeStageSecretRef func(childComplexity int) int + ReadOnly func(childComplexity int) int + VolumeAttributes func(childComplexity int) int + VolumeHandle func(childComplexity int) int + } - return e.complexity.BYOCCluster.SyncStatus(childComplexity), true + K8s__io___api___core___v1__CephFSPersistentVolumeSource struct { + Monitors func(childComplexity int) int + Path func(childComplexity int) int + ReadOnly func(childComplexity int) int + SecretFile func(childComplexity int) int + SecretRef func(childComplexity int) int + User func(childComplexity int) int + } - case "BYOCClusterSpec.accountName": - if e.complexity.BYOCClusterSpec.AccountName == nil { - break - } + K8s__io___api___core___v1__CinderPersistentVolumeSource struct { + FsType func(childComplexity int) int + ReadOnly func(childComplexity int) int + SecretRef func(childComplexity int) int + VolumeID func(childComplexity int) int + } - return e.complexity.BYOCClusterSpec.AccountName(childComplexity), true + K8s__io___api___core___v1__FCVolumeSource struct { + FsType func(childComplexity int) int + Lun func(childComplexity int) int + ReadOnly func(childComplexity int) int + TargetWWNs func(childComplexity int) int + Wwids func(childComplexity int) int + } - case "BYOCClusterSpec.displayName": - if e.complexity.BYOCClusterSpec.DisplayName == nil { - break - } + K8s__io___api___core___v1__FlexPersistentVolumeSource struct { + Driver func(childComplexity int) int + FsType func(childComplexity int) int + Options func(childComplexity int) int + ReadOnly func(childComplexity int) int + SecretRef func(childComplexity int) int + } - return e.complexity.BYOCClusterSpec.DisplayName(childComplexity), true + K8s__io___api___core___v1__FlockerVolumeSource struct { + DatasetName func(childComplexity int) int + DatasetUUID func(childComplexity int) int + } - case "BYOCClusterSpec.incomingKafkaTopic": - if e.complexity.BYOCClusterSpec.IncomingKafkaTopic == nil { - break - } + K8s__io___api___core___v1__GCEPersistentDiskVolumeSource struct { + FsType func(childComplexity int) int + Partition func(childComplexity int) int + PdName func(childComplexity int) int + ReadOnly func(childComplexity int) int + } - return e.complexity.BYOCClusterSpec.IncomingKafkaTopic(childComplexity), true + K8s__io___api___core___v1__GlusterfsPersistentVolumeSource struct { + Endpoints func(childComplexity int) int + EndpointsNamespace func(childComplexity int) int + Path func(childComplexity int) int + ReadOnly func(childComplexity int) int + } - case "BYOCClusterSpec.ingressClasses": - if e.complexity.BYOCClusterSpec.IngressClasses == nil { - break - } + K8s__io___api___core___v1__HostPathVolumeSource struct { + Path func(childComplexity int) int + Type func(childComplexity int) int + } - return e.complexity.BYOCClusterSpec.IngressClasses(childComplexity), true + K8s__io___api___core___v1__ISCSIPersistentVolumeSource struct { + ChapAuthDiscovery func(childComplexity int) int + ChapAuthSession func(childComplexity int) int + FsType func(childComplexity int) int + InitiatorName func(childComplexity int) int + Iqn func(childComplexity int) int + IscsiInterface func(childComplexity int) int + Lun func(childComplexity int) int + Portals func(childComplexity int) int + ReadOnly func(childComplexity int) int + SecretRef func(childComplexity int) int + TargetPortal func(childComplexity int) int + } - case "BYOCClusterSpec.provider": - if e.complexity.BYOCClusterSpec.Provider == nil { - break - } + K8s__io___api___core___v1__LocalVolumeSource struct { + FsType func(childComplexity int) int + Path func(childComplexity int) int + } - return e.complexity.BYOCClusterSpec.Provider(childComplexity), true + K8s__io___api___core___v1__NFSVolumeSource struct { + Path func(childComplexity int) int + ReadOnly func(childComplexity int) int + Server func(childComplexity int) int + } + + K8s__io___api___core___v1__NamespaceCondition 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 + } + + K8s__io___api___core___v1__NamespaceSpec struct { + Finalizers func(childComplexity int) int + } + + K8s__io___api___core___v1__NamespaceStatus struct { + Conditions func(childComplexity int) int + Phase func(childComplexity int) int + } - case "BYOCClusterSpec.publicIps": - if e.complexity.BYOCClusterSpec.PublicIps == nil { - break - } + K8s__io___api___core___v1__NodeAffinity struct { + PreferredDuringSchedulingIgnoredDuringExecution func(childComplexity int) int + RequiredDuringSchedulingIgnoredDuringExecution func(childComplexity int) int + } - return e.complexity.BYOCClusterSpec.PublicIps(childComplexity), true + K8s__io___api___core___v1__NodeSelector struct { + NodeSelectorTerms func(childComplexity int) int + } - case "BYOCClusterSpec.region": - if e.complexity.BYOCClusterSpec.Region == nil { - break - } + K8s__io___api___core___v1__NodeSelectorRequirement struct { + Key func(childComplexity int) int + Operator func(childComplexity int) int + Values func(childComplexity int) int + } - return e.complexity.BYOCClusterSpec.Region(childComplexity), true + K8s__io___api___core___v1__NodeSelectorTerm struct { + MatchExpressions func(childComplexity int) int + MatchFields func(childComplexity int) int + } - case "BYOCClusterSpec.storageClasses": - if e.complexity.BYOCClusterSpec.StorageClasses == nil { - break - } + K8s__io___api___core___v1__ObjectReference struct { + APIVersion func(childComplexity int) int + FieldPath func(childComplexity int) int + Kind func(childComplexity int) int + Name func(childComplexity int) int + Namespace func(childComplexity int) int + ResourceVersion func(childComplexity int) int + UID func(childComplexity int) int + } - return e.complexity.BYOCClusterSpec.StorageClasses(childComplexity), true + K8s__io___api___core___v1__PersistentVolumeClaimCondition struct { + LastProbeTime func(childComplexity int) int + 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 + } - case "Check.generation": - if e.complexity.Check.Generation == nil { - break - } + K8s__io___api___core___v1__PersistentVolumeClaimSpec struct { + AccessModes func(childComplexity int) int + DataSource func(childComplexity int) int + DataSourceRef func(childComplexity int) int + Resources func(childComplexity int) int + Selector func(childComplexity int) int + StorageClassName func(childComplexity int) int + VolumeMode func(childComplexity int) int + VolumeName func(childComplexity int) int + } - return e.complexity.Check.Generation(childComplexity), true + K8s__io___api___core___v1__PersistentVolumeClaimStatus struct { + AccessModes func(childComplexity int) int + AllocatedResourceStatuses func(childComplexity int) int + AllocatedResources func(childComplexity int) int + Capacity func(childComplexity int) int + Conditions func(childComplexity int) int + Phase func(childComplexity int) int + } - case "Check.message": - if e.complexity.Check.Message == nil { - break - } + K8s__io___api___core___v1__PersistentVolumeSpec struct { + AccessModes func(childComplexity int) int + AwsElasticBlockStore func(childComplexity int) int + AzureDisk func(childComplexity int) int + AzureFile func(childComplexity int) int + Capacity func(childComplexity int) int + Cephfs func(childComplexity int) int + Cinder func(childComplexity int) int + ClaimRef func(childComplexity int) int + Csi func(childComplexity int) int + Fc func(childComplexity int) int + FlexVolume func(childComplexity int) int + Flocker func(childComplexity int) int + GcePersistentDisk func(childComplexity int) int + Glusterfs func(childComplexity int) int + HostPath func(childComplexity int) int + Iscsi func(childComplexity int) int + Local func(childComplexity int) int + MountOptions func(childComplexity int) int + Nfs func(childComplexity int) int + NodeAffinity func(childComplexity int) int + PersistentVolumeReclaimPolicy func(childComplexity int) int + PhotonPersistentDisk func(childComplexity int) int + PortworxVolume func(childComplexity int) int + Quobyte func(childComplexity int) int + Rbd func(childComplexity int) int + ScaleIo func(childComplexity int) int + StorageClassName func(childComplexity int) int + Storageos func(childComplexity int) int + VolumeMode func(childComplexity int) int + VsphereVolume func(childComplexity int) int + } - return e.complexity.Check.Message(childComplexity), true + K8s__io___api___core___v1__PersistentVolumeStatus struct { + LastPhaseTransitionTime func(childComplexity int) int + Message func(childComplexity int) int + Phase func(childComplexity int) int + Reason func(childComplexity int) int + } - case "Check.status": - if e.complexity.Check.Status == nil { - break - } + K8s__io___api___core___v1__PhotonPersistentDiskVolumeSource struct { + FsType func(childComplexity int) int + PdID func(childComplexity int) int + } + + K8s__io___api___core___v1__PodAffinity struct { + PreferredDuringSchedulingIgnoredDuringExecution func(childComplexity int) int + RequiredDuringSchedulingIgnoredDuringExecution func(childComplexity int) int + } + + K8s__io___api___core___v1__PodAffinityTerm struct { + LabelSelector func(childComplexity int) int + NamespaceSelector func(childComplexity int) int + Namespaces func(childComplexity int) int + TopologyKey func(childComplexity int) int + } + + K8s__io___api___core___v1__PodAntiAffinity struct { + PreferredDuringSchedulingIgnoredDuringExecution func(childComplexity int) int + RequiredDuringSchedulingIgnoredDuringExecution func(childComplexity int) int + } + + K8s__io___api___core___v1__PortworxVolumeSource struct { + FsType func(childComplexity int) int + ReadOnly func(childComplexity int) int + VolumeID func(childComplexity int) int + } + + K8s__io___api___core___v1__PreferredSchedulingTerm struct { + Preference func(childComplexity int) int + Weight func(childComplexity int) int + } + + K8s__io___api___core___v1__QuobyteVolumeSource struct { + Group func(childComplexity int) int + ReadOnly func(childComplexity int) int + Registry func(childComplexity int) int + Tenant func(childComplexity int) int + User func(childComplexity int) int + Volume func(childComplexity int) int + } + + K8s__io___api___core___v1__RBDPersistentVolumeSource struct { + FsType func(childComplexity int) int + Image func(childComplexity int) int + Keyring func(childComplexity int) int + Monitors func(childComplexity int) int + Pool func(childComplexity int) int + ReadOnly func(childComplexity int) int + SecretRef func(childComplexity int) int + User func(childComplexity int) int + } + + K8s__io___api___core___v1__ResourceClaim struct { + Name func(childComplexity int) int + } + + K8s__io___api___core___v1__ResourceRequirements struct { + Claims func(childComplexity int) int + Limits func(childComplexity int) int + Requests func(childComplexity int) int + } + + K8s__io___api___core___v1__ScaleIOPersistentVolumeSource struct { + FsType func(childComplexity int) int + Gateway func(childComplexity int) int + ProtectionDomain func(childComplexity int) int + ReadOnly func(childComplexity int) int + SecretRef func(childComplexity int) int + SslEnabled func(childComplexity int) int + StorageMode func(childComplexity int) int + StoragePool func(childComplexity int) int + System func(childComplexity int) int + VolumeName func(childComplexity int) int + } - return e.complexity.Check.Status(childComplexity), true + K8s__io___api___core___v1__SecretReference struct { + Name func(childComplexity int) int + Namespace func(childComplexity int) int + } - case "CheckNameAvailabilityOutput.result": - if e.complexity.CheckNameAvailabilityOutput.Result == nil { - break - } + K8s__io___api___core___v1__StorageOSPersistentVolumeSource struct { + FsType func(childComplexity int) int + ReadOnly func(childComplexity int) int + SecretRef func(childComplexity int) int + VolumeName func(childComplexity int) int + VolumeNamespace func(childComplexity int) int + } - return e.complexity.CheckNameAvailabilityOutput.Result(childComplexity), true + K8s__io___api___core___v1__Taint struct { + Effect func(childComplexity int) int + Key func(childComplexity int) int + TimeAdded func(childComplexity int) int + Value func(childComplexity int) int + } - case "CheckNameAvailabilityOutput.suggestedNames": - if e.complexity.CheckNameAvailabilityOutput.SuggestedNames == nil { - break - } + K8s__io___api___core___v1__Toleration struct { + Effect func(childComplexity int) int + Key func(childComplexity int) int + Operator func(childComplexity int) int + TolerationSeconds func(childComplexity int) int + Value func(childComplexity int) int + } - return e.complexity.CheckNameAvailabilityOutput.SuggestedNames(childComplexity), true + K8s__io___api___core___v1__TypedLocalObjectReference struct { + APIGroup func(childComplexity int) int + Kind func(childComplexity int) int + Name func(childComplexity int) int + } - case "CloudProvider.apiVersion": - if e.complexity.CloudProvider.APIVersion == nil { - break - } + K8s__io___api___core___v1__TypedObjectReference struct { + APIGroup func(childComplexity int) int + Kind func(childComplexity int) int + Name func(childComplexity int) int + Namespace func(childComplexity int) int + } - return e.complexity.CloudProvider.APIVersion(childComplexity), true + K8s__io___api___core___v1__VolumeNodeAffinity struct { + Required func(childComplexity int) int + } - case "CloudProvider.kind": - if e.complexity.CloudProvider.Kind == nil { - break - } + K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource struct { + FsType func(childComplexity int) int + StoragePolicyID func(childComplexity int) int + StoragePolicyName func(childComplexity int) int + VolumePath func(childComplexity int) int + } - return e.complexity.CloudProvider.Kind(childComplexity), true + K8s__io___api___core___v1__WeightedPodAffinityTerm struct { + PodAffinityTerm func(childComplexity int) int + Weight func(childComplexity int) int + } - case "CloudProvider.metadata": - if e.complexity.CloudProvider.ObjectMeta == nil { - break - } + K8s__io___api___storage___v1__VolumeAttachmentSource struct { + InlineVolumeSpec func(childComplexity int) int + PersistentVolumeName func(childComplexity int) int + } - return e.complexity.CloudProvider.ObjectMeta(childComplexity), true + K8s__io___api___storage___v1__VolumeAttachmentSpec struct { + Attacher func(childComplexity int) int + NodeName func(childComplexity int) int + Source func(childComplexity int) int + } - case "CloudProvider.spec": - if e.complexity.CloudProvider.Spec == nil { - break - } + K8s__io___api___storage___v1__VolumeAttachmentStatus struct { + AttachError func(childComplexity int) int + Attached func(childComplexity int) int + AttachmentMetadata func(childComplexity int) int + DetachError func(childComplexity int) int + } - return e.complexity.CloudProvider.Spec(childComplexity), true + K8s__io___api___storage___v1__VolumeError struct { + Message func(childComplexity int) int + Time func(childComplexity int) int + } - case "CloudProvider.status": - if e.complexity.CloudProvider.Status == nil { - break - } + K8s__io___apimachinery___pkg___api___resource__Quantity struct { + Format func(childComplexity int) int + } - return e.complexity.CloudProvider.Status(childComplexity), true + K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector struct { + MatchExpressions func(childComplexity int) int + MatchLabels func(childComplexity int) int + } - case "CloudProvider.syncStatus": - if e.complexity.CloudProvider.SyncStatus == nil { - break - } + K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement struct { + Key func(childComplexity int) int + Operator func(childComplexity int) int + Values func(childComplexity int) int + } + + MatchFilter struct { + Array func(childComplexity int) int + Exact func(childComplexity int) int + MatchType func(childComplexity int) int + Regex func(childComplexity int) int + } + + Metadata struct { + Annotations func(childComplexity int) int + CreationTimestamp func(childComplexity int) int + DeletionTimestamp func(childComplexity int) int + Generation func(childComplexity int) int + Labels func(childComplexity int) int + Name func(childComplexity int) int + Namespace func(childComplexity int) int + } + + MsvcTemplate struct { + Category func(childComplexity int) int + DisplayName func(childComplexity int) int + Items func(childComplexity int) int + } + + Mutation struct { + InfraCreateCluster func(childComplexity int, cluster entities.Cluster) int + InfraCreateClusterManagedService func(childComplexity int, clusterName string, service entities.ClusterManagedService) int + InfraCreateDomainEntry func(childComplexity int, domainEntry entities.DomainEntry) int + InfraCreateHelmRelease func(childComplexity int, clusterName string, release entities.HelmRelease) int + InfraCreateNodePool func(childComplexity int, clusterName string, pool entities.NodePool) int + InfraCreateProviderSecret func(childComplexity int, secret entities.CloudProviderSecret) int + InfraDeleteCluster func(childComplexity int, name string) int + InfraDeleteClusterManagedService func(childComplexity int, clusterName string, serviceName string) int + InfraDeleteDomainEntry func(childComplexity int, domainName string) int + InfraDeleteHelmRelease func(childComplexity int, clusterName string, releaseName string) int + InfraDeleteNodePool func(childComplexity int, clusterName string, poolName string) int + InfraDeleteProviderSecret func(childComplexity int, secretName string) int + InfraUpdateCluster func(childComplexity int, cluster entities.Cluster) int + InfraUpdateClusterManagedService func(childComplexity int, clusterName string, service entities.ClusterManagedService) int + InfraUpdateDomainEntry func(childComplexity int, domainEntry entities.DomainEntry) int + InfraUpdateHelmRelease func(childComplexity int, clusterName string, release entities.HelmRelease) int + InfraUpdateNodePool func(childComplexity int, clusterName string, pool entities.NodePool) int + InfraUpdateProviderSecret func(childComplexity int, secret entities.CloudProviderSecret) int + } + + Namespace struct { + APIVersion func(childComplexity int) int + AccountName func(childComplexity int) int + ClusterName func(childComplexity int) int + CreatedBy func(childComplexity int) int + CreationTime func(childComplexity int) int + DisplayName func(childComplexity int) int + ID func(childComplexity int) int + Kind func(childComplexity int) int + LastUpdatedBy func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + ObjectMeta func(childComplexity int) int + RecordVersion func(childComplexity int) int + Spec func(childComplexity int) int + Status func(childComplexity int) int + SyncStatus func(childComplexity int) int + UpdateTime func(childComplexity int) int + } + + NamespaceEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + NamespacePaginatedRecords struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + Node struct { + APIVersion func(childComplexity int) int + AccountName func(childComplexity int) int + ClusterName func(childComplexity int) int + CreationTime func(childComplexity int) int + ID func(childComplexity int) int + Kind func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + ObjectMeta func(childComplexity int) int + RecordVersion func(childComplexity int) int + Spec func(childComplexity int) int + Status func(childComplexity int) int + SyncStatus func(childComplexity int) int + UpdateTime func(childComplexity int) int + } + + NodeEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + NodePaginatedRecords struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + NodePool struct { + APIVersion func(childComplexity int) int + AccountName func(childComplexity int) int + ClusterName func(childComplexity int) int + CreatedBy func(childComplexity int) int + CreationTime func(childComplexity int) int + DisplayName func(childComplexity int) int + ID func(childComplexity int) int + Kind func(childComplexity int) int + LastUpdatedBy func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + ObjectMeta func(childComplexity int) int + RecordVersion func(childComplexity int) int + Spec func(childComplexity int) int + Status func(childComplexity int) int + SyncStatus func(childComplexity int) int + UpdateTime func(childComplexity int) int + } + + NodePoolEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + NodePoolPaginatedRecords struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + PageInfo struct { + EndCursor func(childComplexity int) int + HasNextPage func(childComplexity int) int + HasPreviousPage func(childComplexity int) int + StartCursor func(childComplexity int) int + } + + PersistentVolume struct { + APIVersion func(childComplexity int) int + AccountName func(childComplexity int) int + ClusterName func(childComplexity int) int + CreatedBy func(childComplexity int) int + CreationTime func(childComplexity int) int + DisplayName func(childComplexity int) int + ID func(childComplexity int) int + Kind func(childComplexity int) int + LastUpdatedBy func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + ObjectMeta func(childComplexity int) int + RecordVersion func(childComplexity int) int + Spec func(childComplexity int) int + Status func(childComplexity int) int + SyncStatus func(childComplexity int) int + UpdateTime func(childComplexity int) int + } + + PersistentVolumeClaim struct { + APIVersion func(childComplexity int) int + AccountName func(childComplexity int) int + ClusterName func(childComplexity int) int + CreatedBy func(childComplexity int) int + CreationTime func(childComplexity int) int + DisplayName func(childComplexity int) int + ID func(childComplexity int) int + Kind func(childComplexity int) int + LastUpdatedBy func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + ObjectMeta func(childComplexity int) int + RecordVersion func(childComplexity int) int + Spec func(childComplexity int) int + Status func(childComplexity int) int + SyncStatus func(childComplexity int) int + UpdateTime func(childComplexity int) int + } + + PersistentVolumeClaimEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + PersistentVolumeClaimPaginatedRecords struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + PersistentVolumeEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + PersistentVolumePaginatedRecords struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + Query struct { + InfraCheckAwsAccess func(childComplexity int, cloudproviderName string) int + InfraCheckNameAvailability func(childComplexity int, resType domain.ResType, clusterName *string, name string) int + InfraGetCluster func(childComplexity int, name string) int + InfraGetClusterManagedService func(childComplexity int, clusterName string, name string) int + InfraGetDomainEntry func(childComplexity int, domainName string) int + InfraGetHelmRelease func(childComplexity int, clusterName string, name string) int + InfraGetManagedServiceTemplate func(childComplexity int, category string, name string) int + InfraGetNamespace func(childComplexity int, clusterName string, name string) int + InfraGetNodePool func(childComplexity int, clusterName string, poolName string) int + InfraGetProviderSecret func(childComplexity int, name string) int + InfraGetPv func(childComplexity int, clusterName string, name string) int + InfraGetPvc func(childComplexity int, clusterName string, name string) int + InfraGetVolumeAttachment func(childComplexity int, clusterName string, name string) int + InfraListClusterManagedServices func(childComplexity int, clusterName string, search *model.SearchClusterManagedService, pagination *repos.CursorPagination) int + InfraListClusters func(childComplexity int, search *model.SearchCluster, pagination *repos.CursorPagination) int + InfraListDomainEntries func(childComplexity int, search *model.SearchDomainEntry, pagination *repos.CursorPagination) int + InfraListHelmReleases func(childComplexity int, clusterName string, search *model.SearchHelmRelease, pagination *repos.CursorPagination) int + InfraListManagedServiceTemplates func(childComplexity int) int + InfraListNamespaces func(childComplexity int, clusterName string, search *model.SearchNamespaces, pq *repos.CursorPagination) int + InfraListNodePools func(childComplexity int, clusterName string, search *model.SearchNodepool, pagination *repos.CursorPagination) int + InfraListPVCs func(childComplexity int, clusterName string, search *model.SearchPersistentVolumeClaims, pq *repos.CursorPagination) int + InfraListPVs func(childComplexity int, clusterName string, search *model.SearchPersistentVolumes, pq *repos.CursorPagination) int + InfraListProviderSecrets func(childComplexity int, search *model.SearchProviderSecret, pagination *repos.CursorPagination) int + InfraListVolumeAttachments func(childComplexity int, clusterName string, search *model.SearchVolumeAttachments, pq *repos.CursorPagination) int + __resolve__service func(childComplexity int) int + } + + VolumeAttachment struct { + APIVersion func(childComplexity int) int + AccountName func(childComplexity int) int + ClusterName func(childComplexity int) int + CreatedBy func(childComplexity int) int + CreationTime func(childComplexity int) int + DisplayName func(childComplexity int) int + ID func(childComplexity int) int + Kind func(childComplexity int) int + LastUpdatedBy func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + ObjectMeta func(childComplexity int) int + RecordVersion func(childComplexity int) int + Spec func(childComplexity int) int + Status func(childComplexity int) int + SyncStatus func(childComplexity int) int + UpdateTime func(childComplexity int) int + } + + VolumeAttachmentEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + VolumeAttachmentPaginatedRecords struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + _Service struct { + SDL func(childComplexity int) int + } +} + +type CloudProviderSecretResolver interface { + Aws(ctx context.Context, obj *entities.CloudProviderSecret) (*model.GithubComKloudliteAPIAppsInfraInternalEntitiesAWSSecretCredentials, error) + CloudProviderName(ctx context.Context, obj *entities.CloudProviderSecret) (model.GithubComKloudliteOperatorApisCommonTypesCloudProvider, error) + + CreationTime(ctx context.Context, obj *entities.CloudProviderSecret) (string, error) + + ID(ctx context.Context, obj *entities.CloudProviderSecret) (string, error) + + UpdateTime(ctx context.Context, obj *entities.CloudProviderSecret) (string, error) +} +type ClusterResolver interface { + CreationTime(ctx context.Context, obj *entities.Cluster) (string, error) + + ID(ctx context.Context, obj *entities.Cluster) (string, error) + + Spec(ctx context.Context, obj *entities.Cluster) (*model.GithubComKloudliteOperatorApisClustersV1ClusterSpec, error) + + UpdateTime(ctx context.Context, obj *entities.Cluster) (string, error) + AdminKubeconfig(ctx context.Context, obj *entities.Cluster) (*model.EncodedValue, error) +} +type ClusterManagedServiceResolver interface { + CreationTime(ctx context.Context, obj *entities.ClusterManagedService) (string, error) + + ID(ctx context.Context, obj *entities.ClusterManagedService) (string, error) + + Spec(ctx context.Context, obj *entities.ClusterManagedService) (*model.GithubComKloudliteOperatorApisCrdsV1ClusterManagedServiceSpec, error) + + UpdateTime(ctx context.Context, obj *entities.ClusterManagedService) (string, error) +} +type DomainEntryResolver interface { + CreationTime(ctx context.Context, obj *entities.DomainEntry) (string, error) + + ID(ctx context.Context, obj *entities.DomainEntry) (string, error) + + UpdateTime(ctx context.Context, obj *entities.DomainEntry) (string, error) +} +type Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntryResolver interface { + Fields(ctx context.Context, obj *entities.MsvcTemplateEntry) ([]*model.GithubComKloudliteAPIAppsInfraInternalEntitiesInputField, error) + + Outputs(ctx context.Context, obj *entities.MsvcTemplateEntry) ([]*model.GithubComKloudliteAPIAppsInfraInternalEntitiesOutputField, error) + Resources(ctx context.Context, obj *entities.MsvcTemplateEntry) ([]*model.GithubComKloudliteAPIAppsInfraInternalEntitiesMresTemplate, error) +} +type Github__com___kloudlite___api___common__CreatedOrUpdatedByResolver interface { + UserID(ctx context.Context, obj *common.CreatedOrUpdatedBy) (string, error) +} +type Github__com___kloudlite___api___pkg___types__SyncStatusResolver interface { + LastSyncedAt(ctx context.Context, obj *types.SyncStatus) (*string, error) + + SyncScheduledAt(ctx context.Context, obj *types.SyncStatus) (*string, error) +} +type Github__com___kloudlite___operator___pkg___operator__StatusResolver interface { + Checks(ctx context.Context, obj *operator.Status) (map[string]interface{}, error) + + LastReconcileTime(ctx context.Context, obj *operator.Status) (*string, error) + Message(ctx context.Context, obj *operator.Status) (*model.GithubComKloudliteOperatorPkgRawJSONRawJSON, error) +} +type HelmReleaseResolver interface { + CreationTime(ctx context.Context, obj *entities.HelmRelease) (string, error) + + ID(ctx context.Context, obj *entities.HelmRelease) (string, error) + + Spec(ctx context.Context, obj *entities.HelmRelease) (*model.GithubComKloudliteOperatorApisCrdsV1HelmChartSpec, error) + Status(ctx context.Context, obj *entities.HelmRelease) (*model.GithubComKloudliteOperatorApisCrdsV1HelmChartStatus, error) + + UpdateTime(ctx context.Context, obj *entities.HelmRelease) (string, error) +} +type MetadataResolver interface { + Annotations(ctx context.Context, obj *v1.ObjectMeta) (map[string]interface{}, error) + CreationTimestamp(ctx context.Context, obj *v1.ObjectMeta) (string, error) + DeletionTimestamp(ctx context.Context, obj *v1.ObjectMeta) (*string, error) - return e.complexity.CloudProvider.SyncStatus(childComplexity), true + Labels(ctx context.Context, obj *v1.ObjectMeta) (map[string]interface{}, error) +} +type MutationResolver interface { + InfraCreateCluster(ctx context.Context, cluster entities.Cluster) (*entities.Cluster, error) + InfraUpdateCluster(ctx context.Context, cluster entities.Cluster) (*entities.Cluster, error) + InfraDeleteCluster(ctx context.Context, name string) (bool, error) + InfraCreateProviderSecret(ctx context.Context, secret entities.CloudProviderSecret) (*entities.CloudProviderSecret, error) + InfraUpdateProviderSecret(ctx context.Context, secret entities.CloudProviderSecret) (*entities.CloudProviderSecret, error) + InfraDeleteProviderSecret(ctx context.Context, secretName string) (bool, error) + InfraCreateDomainEntry(ctx context.Context, domainEntry entities.DomainEntry) (*entities.DomainEntry, error) + InfraUpdateDomainEntry(ctx context.Context, domainEntry entities.DomainEntry) (*entities.DomainEntry, error) + InfraDeleteDomainEntry(ctx context.Context, domainName string) (bool, error) + InfraCreateNodePool(ctx context.Context, clusterName string, pool entities.NodePool) (*entities.NodePool, error) + InfraUpdateNodePool(ctx context.Context, clusterName string, pool entities.NodePool) (*entities.NodePool, error) + InfraDeleteNodePool(ctx context.Context, clusterName string, poolName string) (bool, error) + InfraCreateClusterManagedService(ctx context.Context, clusterName string, service entities.ClusterManagedService) (*entities.ClusterManagedService, error) + InfraUpdateClusterManagedService(ctx context.Context, clusterName string, service entities.ClusterManagedService) (*entities.ClusterManagedService, error) + InfraDeleteClusterManagedService(ctx context.Context, clusterName string, serviceName string) (bool, error) + InfraCreateHelmRelease(ctx context.Context, clusterName string, release entities.HelmRelease) (*entities.HelmRelease, error) + InfraUpdateHelmRelease(ctx context.Context, clusterName string, release entities.HelmRelease) (*entities.HelmRelease, error) + InfraDeleteHelmRelease(ctx context.Context, clusterName string, releaseName string) (bool, error) +} +type NamespaceResolver interface { + CreationTime(ctx context.Context, obj *entities.Namespace) (string, error) + + ID(ctx context.Context, obj *entities.Namespace) (string, error) + + Spec(ctx context.Context, obj *entities.Namespace) (*model.K8sIoAPICoreV1NamespaceSpec, error) + Status(ctx context.Context, obj *entities.Namespace) (*model.K8sIoAPICoreV1NamespaceStatus, error) + + UpdateTime(ctx context.Context, obj *entities.Namespace) (string, error) +} +type NodeResolver interface { + CreationTime(ctx context.Context, obj *entities.Node) (string, error) + ID(ctx context.Context, obj *entities.Node) (string, error) + + Spec(ctx context.Context, obj *entities.Node) (*model.GithubComKloudliteOperatorApisClustersV1NodeSpec, error) + + UpdateTime(ctx context.Context, obj *entities.Node) (string, error) +} +type NodePoolResolver interface { + CreationTime(ctx context.Context, obj *entities.NodePool) (string, error) + + ID(ctx context.Context, obj *entities.NodePool) (string, error) + + Spec(ctx context.Context, obj *entities.NodePool) (*model.GithubComKloudliteOperatorApisClustersV1NodePoolSpec, error) + + UpdateTime(ctx context.Context, obj *entities.NodePool) (string, error) +} +type PersistentVolumeResolver interface { + CreationTime(ctx context.Context, obj *entities.PersistentVolume) (string, error) + + ID(ctx context.Context, obj *entities.PersistentVolume) (string, error) + + Spec(ctx context.Context, obj *entities.PersistentVolume) (*model.K8sIoAPICoreV1PersistentVolumeSpec, error) + Status(ctx context.Context, obj *entities.PersistentVolume) (*model.K8sIoAPICoreV1PersistentVolumeStatus, error) + + UpdateTime(ctx context.Context, obj *entities.PersistentVolume) (string, error) +} +type PersistentVolumeClaimResolver interface { + CreationTime(ctx context.Context, obj *entities.PersistentVolumeClaim) (string, error) + + ID(ctx context.Context, obj *entities.PersistentVolumeClaim) (string, error) + + Spec(ctx context.Context, obj *entities.PersistentVolumeClaim) (*model.K8sIoAPICoreV1PersistentVolumeClaimSpec, error) + Status(ctx context.Context, obj *entities.PersistentVolumeClaim) (*model.K8sIoAPICoreV1PersistentVolumeClaimStatus, error) + + UpdateTime(ctx context.Context, obj *entities.PersistentVolumeClaim) (string, error) +} +type QueryResolver interface { + InfraCheckNameAvailability(ctx context.Context, resType domain.ResType, clusterName *string, name string) (*domain.CheckNameAvailabilityOutput, error) + InfraListClusters(ctx context.Context, search *model.SearchCluster, pagination *repos.CursorPagination) (*model.ClusterPaginatedRecords, error) + InfraGetCluster(ctx context.Context, name string) (*entities.Cluster, error) + InfraListNodePools(ctx context.Context, clusterName string, search *model.SearchNodepool, pagination *repos.CursorPagination) (*model.NodePoolPaginatedRecords, error) + InfraGetNodePool(ctx context.Context, clusterName string, poolName string) (*entities.NodePool, error) + InfraListProviderSecrets(ctx context.Context, search *model.SearchProviderSecret, pagination *repos.CursorPagination) (*model.CloudProviderSecretPaginatedRecords, error) + InfraGetProviderSecret(ctx context.Context, name string) (*entities.CloudProviderSecret, error) + InfraListDomainEntries(ctx context.Context, search *model.SearchDomainEntry, pagination *repos.CursorPagination) (*model.DomainEntryPaginatedRecords, error) + InfraGetDomainEntry(ctx context.Context, domainName string) (*entities.DomainEntry, error) + InfraCheckAwsAccess(ctx context.Context, cloudproviderName string) (*model.CheckAwsAccessOutput, error) + InfraListClusterManagedServices(ctx context.Context, clusterName string, search *model.SearchClusterManagedService, pagination *repos.CursorPagination) (*model.ClusterManagedServicePaginatedRecords, error) + InfraGetClusterManagedService(ctx context.Context, clusterName string, name string) (*entities.ClusterManagedService, error) + InfraListHelmReleases(ctx context.Context, clusterName string, search *model.SearchHelmRelease, pagination *repos.CursorPagination) (*model.HelmReleasePaginatedRecords, error) + InfraGetHelmRelease(ctx context.Context, clusterName string, name string) (*entities.HelmRelease, error) + InfraListManagedServiceTemplates(ctx context.Context) ([]*entities.MsvcTemplate, error) + InfraGetManagedServiceTemplate(ctx context.Context, category string, name string) (*entities.MsvcTemplateEntry, error) + InfraListPVCs(ctx context.Context, clusterName string, search *model.SearchPersistentVolumeClaims, pq *repos.CursorPagination) (*model.PersistentVolumeClaimPaginatedRecords, error) + InfraGetPvc(ctx context.Context, clusterName string, name string) (*entities.PersistentVolumeClaim, error) + InfraListNamespaces(ctx context.Context, clusterName string, search *model.SearchNamespaces, pq *repos.CursorPagination) (*model.NamespacePaginatedRecords, error) + InfraGetNamespace(ctx context.Context, clusterName string, name string) (*entities.Namespace, error) + InfraListPVs(ctx context.Context, clusterName string, search *model.SearchPersistentVolumes, pq *repos.CursorPagination) (*model.PersistentVolumePaginatedRecords, error) + InfraGetPv(ctx context.Context, clusterName string, name string) (*entities.PersistentVolume, error) + InfraListVolumeAttachments(ctx context.Context, clusterName string, search *model.SearchVolumeAttachments, pq *repos.CursorPagination) (*model.VolumeAttachmentPaginatedRecords, error) + InfraGetVolumeAttachment(ctx context.Context, clusterName string, name string) (*entities.VolumeAttachment, error) +} +type VolumeAttachmentResolver interface { + CreationTime(ctx context.Context, obj *entities.VolumeAttachment) (string, error) + + ID(ctx context.Context, obj *entities.VolumeAttachment) (string, error) + + Spec(ctx context.Context, obj *entities.VolumeAttachment) (*model.K8sIoAPIStorageV1VolumeAttachmentSpec, error) + Status(ctx context.Context, obj *entities.VolumeAttachment) (*model.K8sIoAPIStorageV1VolumeAttachmentStatus, error) + + UpdateTime(ctx context.Context, obj *entities.VolumeAttachment) (string, error) +} + +type CloudProviderSecretInResolver interface { + Aws(ctx context.Context, obj *entities.CloudProviderSecret, data *model.GithubComKloudliteAPIAppsInfraInternalEntitiesAWSSecretCredentialsIn) error + CloudProviderName(ctx context.Context, obj *entities.CloudProviderSecret, data model.GithubComKloudliteOperatorApisCommonTypesCloudProvider) error + + Metadata(ctx context.Context, obj *entities.CloudProviderSecret, data *v1.ObjectMeta) error +} +type ClusterInResolver interface { + Metadata(ctx context.Context, obj *entities.Cluster, data *v1.ObjectMeta) error + Spec(ctx context.Context, obj *entities.Cluster, data *model.GithubComKloudliteOperatorApisClustersV1ClusterSpecIn) error +} +type ClusterManagedServiceInResolver interface { + Metadata(ctx context.Context, obj *entities.ClusterManagedService, data *v1.ObjectMeta) error + Spec(ctx context.Context, obj *entities.ClusterManagedService, data *model.GithubComKloudliteOperatorApisCrdsV1ClusterManagedServiceSpecIn) error +} +type HelmReleaseInResolver interface { + Metadata(ctx context.Context, obj *entities.HelmRelease, data *v1.ObjectMeta) error + Spec(ctx context.Context, obj *entities.HelmRelease, data *model.GithubComKloudliteOperatorApisCrdsV1HelmChartSpecIn) error +} +type MetadataInResolver interface { + Annotations(ctx context.Context, obj *v1.ObjectMeta, data map[string]interface{}) error + Labels(ctx context.Context, obj *v1.ObjectMeta, data map[string]interface{}) error +} +type NamespaceInResolver interface { + Metadata(ctx context.Context, obj *entities.Namespace, data *v1.ObjectMeta) error + Spec(ctx context.Context, obj *entities.Namespace, data *model.K8sIoAPICoreV1NamespaceSpecIn) error + Status(ctx context.Context, obj *entities.Namespace, data *model.K8sIoAPICoreV1NamespaceStatusIn) error +} +type NodePoolInResolver interface { + Metadata(ctx context.Context, obj *entities.NodePool, data *v1.ObjectMeta) error + Spec(ctx context.Context, obj *entities.NodePool, data *model.GithubComKloudliteOperatorApisClustersV1NodePoolSpecIn) error +} +type PersistentVolumeInResolver interface { + Metadata(ctx context.Context, obj *entities.PersistentVolume, data *v1.ObjectMeta) error + Spec(ctx context.Context, obj *entities.PersistentVolume, data *model.K8sIoAPICoreV1PersistentVolumeSpecIn) error + Status(ctx context.Context, obj *entities.PersistentVolume, data *model.K8sIoAPICoreV1PersistentVolumeStatusIn) error +} +type VolumeAttachmentInResolver interface { + Metadata(ctx context.Context, obj *entities.VolumeAttachment, data *v1.ObjectMeta) error + Spec(ctx context.Context, obj *entities.VolumeAttachment, data *model.K8sIoAPIStorageV1VolumeAttachmentSpecIn) error + Status(ctx context.Context, obj *entities.VolumeAttachment, data *model.K8sIoAPIStorageV1VolumeAttachmentStatusIn) error +} + +type executableSchema struct { + resolvers ResolverRoot + directives DirectiveRoot + complexity ComplexityRoot +} + +func (e *executableSchema) Schema() *ast.Schema { + return parsedSchema +} + +func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) { + ec := executionContext{nil, e} + _ = ec + switch typeName + "." + field { - case "CloudProviderSpec.accountName": - if e.complexity.CloudProviderSpec.AccountName == nil { + case "CheckAwsAccessOutput.installationUrl": + if e.complexity.CheckAwsAccessOutput.InstallationURL == nil { break } - return e.complexity.CloudProviderSpec.AccountName(childComplexity), true + return e.complexity.CheckAwsAccessOutput.InstallationURL(childComplexity), true - case "CloudProviderSpec.display_name": - if e.complexity.CloudProviderSpec.DisplayName == nil { + case "CheckAwsAccessOutput.result": + if e.complexity.CheckAwsAccessOutput.Result == nil { break } - return e.complexity.CloudProviderSpec.DisplayName(childComplexity), true + return e.complexity.CheckAwsAccessOutput.Result(childComplexity), true - case "CloudProviderSpec.provider": - if e.complexity.CloudProviderSpec.Provider == nil { + case "CheckNameAvailabilityOutput.result": + if e.complexity.CheckNameAvailabilityOutput.Result == nil { break } - return e.complexity.CloudProviderSpec.Provider(childComplexity), true + return e.complexity.CheckNameAvailabilityOutput.Result(childComplexity), true - case "CloudProviderSpec.providerSecret": - if e.complexity.CloudProviderSpec.ProviderSecret == nil { + case "CheckNameAvailabilityOutput.suggestedNames": + if e.complexity.CheckNameAvailabilityOutput.SuggestedNames == nil { break } - return e.complexity.CloudProviderSpec.ProviderSecret(childComplexity), true + return e.complexity.CheckNameAvailabilityOutput.SuggestedNames(childComplexity), true - case "CloudProviderSpecProviderSecret.name": - if e.complexity.CloudProviderSpecProviderSecret.Name == nil { + case "CloudProviderSecret.accountName": + if e.complexity.CloudProviderSecret.AccountName == nil { break } - return e.complexity.CloudProviderSpecProviderSecret.Name(childComplexity), true + return e.complexity.CloudProviderSecret.AccountName(childComplexity), true - case "CloudProviderSpecProviderSecret.namespace": - if e.complexity.CloudProviderSpecProviderSecret.Namespace == nil { + case "CloudProviderSecret.aws": + if e.complexity.CloudProviderSecret.Aws == nil { break } - return e.complexity.CloudProviderSpecProviderSecret.Namespace(childComplexity), true + return e.complexity.CloudProviderSecret.Aws(childComplexity), true - case "Cluster.apiVersion": - if e.complexity.Cluster.APIVersion == nil { + case "CloudProviderSecret.cloudProviderName": + if e.complexity.CloudProviderSecret.CloudProviderName == nil { break } - return e.complexity.Cluster.APIVersion(childComplexity), true + return e.complexity.CloudProviderSecret.CloudProviderName(childComplexity), true - case "Cluster.kind": - if e.complexity.Cluster.Kind == nil { + case "CloudProviderSecret.createdBy": + if e.complexity.CloudProviderSecret.CreatedBy == nil { break } - return e.complexity.Cluster.Kind(childComplexity), true + return e.complexity.CloudProviderSecret.CreatedBy(childComplexity), true - case "Cluster.metadata": - if e.complexity.Cluster.ObjectMeta == nil { + case "CloudProviderSecret.creationTime": + if e.complexity.CloudProviderSecret.CreationTime == nil { break } - return e.complexity.Cluster.ObjectMeta(childComplexity), true + return e.complexity.CloudProviderSecret.CreationTime(childComplexity), true - case "Cluster.spec": - if e.complexity.Cluster.Spec == nil { + case "CloudProviderSecret.displayName": + if e.complexity.CloudProviderSecret.DisplayName == nil { break } - return e.complexity.Cluster.Spec(childComplexity), true + return e.complexity.CloudProviderSecret.DisplayName(childComplexity), true - case "Cluster.status": - if e.complexity.Cluster.Status == nil { + case "CloudProviderSecret.id": + if e.complexity.CloudProviderSecret.ID == nil { break } - return e.complexity.Cluster.Status(childComplexity), true + return e.complexity.CloudProviderSecret.ID(childComplexity), true - case "Cluster.syncStatus": - if e.complexity.Cluster.SyncStatus == nil { + case "CloudProviderSecret.lastUpdatedBy": + if e.complexity.CloudProviderSecret.LastUpdatedBy == nil { break } - return e.complexity.Cluster.SyncStatus(childComplexity), true + return e.complexity.CloudProviderSecret.LastUpdatedBy(childComplexity), true - case "ClusterSpec.accountName": - if e.complexity.ClusterSpec.AccountName == nil { + case "CloudProviderSecret.markedForDeletion": + if e.complexity.CloudProviderSecret.MarkedForDeletion == nil { break } - return e.complexity.ClusterSpec.AccountName(childComplexity), true + return e.complexity.CloudProviderSecret.MarkedForDeletion(childComplexity), true - case "ClusterSpec.config": - if e.complexity.ClusterSpec.Config == nil { + case "CloudProviderSecret.metadata": + if e.complexity.CloudProviderSecret.ObjectMeta == nil { break } - return e.complexity.ClusterSpec.Config(childComplexity), true + return e.complexity.CloudProviderSecret.ObjectMeta(childComplexity), true - case "ClusterSpec.count": - if e.complexity.ClusterSpec.Count == nil { + case "CloudProviderSecret.recordVersion": + if e.complexity.CloudProviderSecret.RecordVersion == nil { break } - return e.complexity.ClusterSpec.Count(childComplexity), true + return e.complexity.CloudProviderSecret.RecordVersion(childComplexity), true - case "ClusterSpec.provider": - if e.complexity.ClusterSpec.Provider == nil { + case "CloudProviderSecret.updateTime": + if e.complexity.CloudProviderSecret.UpdateTime == nil { break } - return e.complexity.ClusterSpec.Provider(childComplexity), true + return e.complexity.CloudProviderSecret.UpdateTime(childComplexity), true - case "ClusterSpec.providerName": - if e.complexity.ClusterSpec.ProviderName == nil { + case "CloudProviderSecretEdge.cursor": + if e.complexity.CloudProviderSecretEdge.Cursor == nil { break } - return e.complexity.ClusterSpec.ProviderName(childComplexity), true + return e.complexity.CloudProviderSecretEdge.Cursor(childComplexity), true - case "ClusterSpec.region": - if e.complexity.ClusterSpec.Region == nil { + case "CloudProviderSecretEdge.node": + if e.complexity.CloudProviderSecretEdge.Node == nil { break } - return e.complexity.ClusterSpec.Region(childComplexity), true + return e.complexity.CloudProviderSecretEdge.Node(childComplexity), true - case "Edge.apiVersion": - if e.complexity.Edge.APIVersion == nil { + case "CloudProviderSecretPaginatedRecords.edges": + if e.complexity.CloudProviderSecretPaginatedRecords.Edges == nil { break } - return e.complexity.Edge.APIVersion(childComplexity), true + return e.complexity.CloudProviderSecretPaginatedRecords.Edges(childComplexity), true - case "Edge.kind": - if e.complexity.Edge.Kind == nil { + case "CloudProviderSecretPaginatedRecords.pageInfo": + if e.complexity.CloudProviderSecretPaginatedRecords.PageInfo == nil { break } - return e.complexity.Edge.Kind(childComplexity), true + return e.complexity.CloudProviderSecretPaginatedRecords.PageInfo(childComplexity), true - case "Edge.metadata": - if e.complexity.Edge.ObjectMeta == nil { + case "CloudProviderSecretPaginatedRecords.totalCount": + if e.complexity.CloudProviderSecretPaginatedRecords.TotalCount == nil { break } - return e.complexity.Edge.ObjectMeta(childComplexity), true + return e.complexity.CloudProviderSecretPaginatedRecords.TotalCount(childComplexity), true - case "Edge.spec": - if e.complexity.Edge.Spec == nil { + case "Cluster.apiVersion": + if e.complexity.Cluster.APIVersion == nil { break } - return e.complexity.Edge.Spec(childComplexity), true + return e.complexity.Cluster.APIVersion(childComplexity), true - case "Edge.status": - if e.complexity.Edge.Status == nil { + case "Cluster.accountName": + if e.complexity.Cluster.AccountName == nil { break } - return e.complexity.Edge.Status(childComplexity), true + return e.complexity.Cluster.AccountName(childComplexity), true - case "Edge.syncStatus": - if e.complexity.Edge.SyncStatus == nil { + case "Cluster.adminKubeconfig": + if e.complexity.Cluster.AdminKubeconfig == nil { break } - return e.complexity.Edge.SyncStatus(childComplexity), true + return e.complexity.Cluster.AdminKubeconfig(childComplexity), true - case "EdgeSpec.accountName": - if e.complexity.EdgeSpec.AccountName == nil { + case "Cluster.createdBy": + if e.complexity.Cluster.CreatedBy == nil { break } - return e.complexity.EdgeSpec.AccountName(childComplexity), true + return e.complexity.Cluster.CreatedBy(childComplexity), true - case "EdgeSpec.clusterName": - if e.complexity.EdgeSpec.ClusterName == nil { + case "Cluster.creationTime": + if e.complexity.Cluster.CreationTime == nil { break } - return e.complexity.EdgeSpec.ClusterName(childComplexity), true + return e.complexity.Cluster.CreationTime(childComplexity), true - case "EdgeSpec.pools": - if e.complexity.EdgeSpec.Pools == nil { + case "Cluster.displayName": + if e.complexity.Cluster.DisplayName == nil { break } - return e.complexity.EdgeSpec.Pools(childComplexity), true + return e.complexity.Cluster.DisplayName(childComplexity), true - case "EdgeSpec.provider": - if e.complexity.EdgeSpec.Provider == nil { + case "Cluster.id": + if e.complexity.Cluster.ID == nil { break } - return e.complexity.EdgeSpec.Provider(childComplexity), true + return e.complexity.Cluster.ID(childComplexity), true - case "EdgeSpec.providerName": - if e.complexity.EdgeSpec.ProviderName == nil { + case "Cluster.kind": + if e.complexity.Cluster.Kind == nil { break } - return e.complexity.EdgeSpec.ProviderName(childComplexity), true + return e.complexity.Cluster.Kind(childComplexity), true - case "EdgeSpec.region": - if e.complexity.EdgeSpec.Region == nil { + case "Cluster.lastUpdatedBy": + if e.complexity.Cluster.LastUpdatedBy == nil { break } - return e.complexity.EdgeSpec.Region(childComplexity), true + return e.complexity.Cluster.LastUpdatedBy(childComplexity), true - case "EdgeSpecPools.config": - if e.complexity.EdgeSpecPools.Config == nil { + case "Cluster.markedForDeletion": + if e.complexity.Cluster.MarkedForDeletion == nil { break } - return e.complexity.EdgeSpecPools.Config(childComplexity), true + return e.complexity.Cluster.MarkedForDeletion(childComplexity), true - case "EdgeSpecPools.max": - if e.complexity.EdgeSpecPools.Max == nil { + case "Cluster.metadata": + if e.complexity.Cluster.ObjectMeta == nil { break } - return e.complexity.EdgeSpecPools.Max(childComplexity), true + return e.complexity.Cluster.ObjectMeta(childComplexity), true - case "EdgeSpecPools.min": - if e.complexity.EdgeSpecPools.Min == nil { + case "Cluster.recordVersion": + if e.complexity.Cluster.RecordVersion == nil { break } - return e.complexity.EdgeSpecPools.Min(childComplexity), true + return e.complexity.Cluster.RecordVersion(childComplexity), true - case "EdgeSpecPools.name": - if e.complexity.EdgeSpecPools.Name == nil { + case "Cluster.spec": + if e.complexity.Cluster.Spec == nil { break } - return e.complexity.EdgeSpecPools.Name(childComplexity), true + return e.complexity.Cluster.Spec(childComplexity), true - case "MasterNode.apiVersion": - if e.complexity.MasterNode.APIVersion == nil { + case "Cluster.status": + if e.complexity.Cluster.Status == nil { break } - return e.complexity.MasterNode.APIVersion(childComplexity), true + return e.complexity.Cluster.Status(childComplexity), true - case "MasterNode.kind": - if e.complexity.MasterNode.Kind == nil { + case "Cluster.syncStatus": + if e.complexity.Cluster.SyncStatus == nil { break } - return e.complexity.MasterNode.Kind(childComplexity), true + return e.complexity.Cluster.SyncStatus(childComplexity), true - case "MasterNode.metadata": - if e.complexity.MasterNode.ObjectMeta == nil { + case "Cluster.updateTime": + if e.complexity.Cluster.UpdateTime == nil { break } - return e.complexity.MasterNode.ObjectMeta(childComplexity), true + return e.complexity.Cluster.UpdateTime(childComplexity), true - case "MasterNode.spec": - if e.complexity.MasterNode.Spec == nil { + case "ClusterEdge.cursor": + if e.complexity.ClusterEdge.Cursor == nil { break } - return e.complexity.MasterNode.Spec(childComplexity), true + return e.complexity.ClusterEdge.Cursor(childComplexity), true - case "MasterNode.status": - if e.complexity.MasterNode.Status == nil { + case "ClusterEdge.node": + if e.complexity.ClusterEdge.Node == nil { break } - return e.complexity.MasterNode.Status(childComplexity), true + return e.complexity.ClusterEdge.Node(childComplexity), true - case "MasterNode.syncStatus": - if e.complexity.MasterNode.SyncStatus == nil { + case "ClusterManagedService.apiVersion": + if e.complexity.ClusterManagedService.APIVersion == nil { break } - return e.complexity.MasterNode.SyncStatus(childComplexity), true + return e.complexity.ClusterManagedService.APIVersion(childComplexity), true - case "MasterNodeSpec.accountName": - if e.complexity.MasterNodeSpec.AccountName == nil { + case "ClusterManagedService.accountName": + if e.complexity.ClusterManagedService.AccountName == nil { break } - return e.complexity.MasterNodeSpec.AccountName(childComplexity), true + return e.complexity.ClusterManagedService.AccountName(childComplexity), true - case "MasterNodeSpec.clusterName": - if e.complexity.MasterNodeSpec.ClusterName == nil { + case "ClusterManagedService.clusterName": + if e.complexity.ClusterManagedService.ClusterName == nil { break } - return e.complexity.MasterNodeSpec.ClusterName(childComplexity), true + return e.complexity.ClusterManagedService.ClusterName(childComplexity), true - case "MasterNodeSpec.config": - if e.complexity.MasterNodeSpec.Config == nil { + case "ClusterManagedService.createdBy": + if e.complexity.ClusterManagedService.CreatedBy == nil { break } - return e.complexity.MasterNodeSpec.Config(childComplexity), true + return e.complexity.ClusterManagedService.CreatedBy(childComplexity), true - case "MasterNodeSpec.provider": - if e.complexity.MasterNodeSpec.Provider == nil { + case "ClusterManagedService.creationTime": + if e.complexity.ClusterManagedService.CreationTime == nil { break } - return e.complexity.MasterNodeSpec.Provider(childComplexity), true + return e.complexity.ClusterManagedService.CreationTime(childComplexity), true - case "MasterNodeSpec.providerName": - if e.complexity.MasterNodeSpec.ProviderName == nil { + case "ClusterManagedService.displayName": + if e.complexity.ClusterManagedService.DisplayName == nil { break } - return e.complexity.MasterNodeSpec.ProviderName(childComplexity), true + return e.complexity.ClusterManagedService.DisplayName(childComplexity), true - case "MasterNodeSpec.region": - if e.complexity.MasterNodeSpec.Region == nil { + case "ClusterManagedService.id": + if e.complexity.ClusterManagedService.ID == nil { break } - return e.complexity.MasterNodeSpec.Region(childComplexity), true + return e.complexity.ClusterManagedService.ID(childComplexity), true - case "Metadata.annotations": - if e.complexity.Metadata.Annotations == nil { + case "ClusterManagedService.kind": + if e.complexity.ClusterManagedService.Kind == nil { break } - return e.complexity.Metadata.Annotations(childComplexity), true + return e.complexity.ClusterManagedService.Kind(childComplexity), true - case "Metadata.creationTimestamp": - if e.complexity.Metadata.CreationTimestamp == nil { + case "ClusterManagedService.lastUpdatedBy": + if e.complexity.ClusterManagedService.LastUpdatedBy == nil { break } - return e.complexity.Metadata.CreationTimestamp(childComplexity), true + return e.complexity.ClusterManagedService.LastUpdatedBy(childComplexity), true - case "Metadata.deletionTimestamp": - if e.complexity.Metadata.DeletionTimestamp == nil { + case "ClusterManagedService.markedForDeletion": + if e.complexity.ClusterManagedService.MarkedForDeletion == nil { break } - return e.complexity.Metadata.DeletionTimestamp(childComplexity), true + return e.complexity.ClusterManagedService.MarkedForDeletion(childComplexity), true - case "Metadata.generation": - if e.complexity.Metadata.Generation == nil { + case "ClusterManagedService.metadata": + if e.complexity.ClusterManagedService.ObjectMeta == nil { break } - return e.complexity.Metadata.Generation(childComplexity), true + return e.complexity.ClusterManagedService.ObjectMeta(childComplexity), true - case "Metadata.labels": - if e.complexity.Metadata.Labels == nil { + case "ClusterManagedService.recordVersion": + if e.complexity.ClusterManagedService.RecordVersion == nil { break } - return e.complexity.Metadata.Labels(childComplexity), true + return e.complexity.ClusterManagedService.RecordVersion(childComplexity), true - case "Metadata.name": - if e.complexity.Metadata.Name == nil { + case "ClusterManagedService.spec": + if e.complexity.ClusterManagedService.Spec == nil { break } - return e.complexity.Metadata.Name(childComplexity), true + return e.complexity.ClusterManagedService.Spec(childComplexity), true - case "Metadata.namespace": - if e.complexity.Metadata.Namespace == nil { + case "ClusterManagedService.status": + if e.complexity.ClusterManagedService.Status == nil { break } - return e.complexity.Metadata.Namespace(childComplexity), true + return e.complexity.ClusterManagedService.Status(childComplexity), true - case "Mutation.infra_createBYOCCluster": - if e.complexity.Mutation.InfraCreateBYOCCluster == nil { + case "ClusterManagedService.syncStatus": + if e.complexity.ClusterManagedService.SyncStatus == nil { break } - args, err := ec.field_Mutation_infra_createBYOCCluster_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.ClusterManagedService.SyncStatus(childComplexity), true + + case "ClusterManagedService.updateTime": + if e.complexity.ClusterManagedService.UpdateTime == nil { + break } - return e.complexity.Mutation.InfraCreateBYOCCluster(childComplexity, args["cluster"].(entities.BYOCCluster)), true + return e.complexity.ClusterManagedService.UpdateTime(childComplexity), true - case "Mutation.infra_createCloudProvider": - if e.complexity.Mutation.InfraCreateCloudProvider == nil { + case "ClusterManagedServiceEdge.cursor": + if e.complexity.ClusterManagedServiceEdge.Cursor == nil { break } - args, err := ec.field_Mutation_infra_createCloudProvider_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.ClusterManagedServiceEdge.Cursor(childComplexity), true + + case "ClusterManagedServiceEdge.node": + if e.complexity.ClusterManagedServiceEdge.Node == nil { + break } - return e.complexity.Mutation.InfraCreateCloudProvider(childComplexity, args["cloudProvider"].(entities.CloudProvider), args["providerSecret"].(entities.Secret)), true + return e.complexity.ClusterManagedServiceEdge.Node(childComplexity), true - case "Mutation.infra_createCluster": - if e.complexity.Mutation.InfraCreateCluster == nil { + case "ClusterManagedServicePaginatedRecords.edges": + if e.complexity.ClusterManagedServicePaginatedRecords.Edges == nil { break } - args, err := ec.field_Mutation_infra_createCluster_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.ClusterManagedServicePaginatedRecords.Edges(childComplexity), true + + case "ClusterManagedServicePaginatedRecords.pageInfo": + if e.complexity.ClusterManagedServicePaginatedRecords.PageInfo == nil { + break } - return e.complexity.Mutation.InfraCreateCluster(childComplexity, args["cluster"].(entities.Cluster)), true + return e.complexity.ClusterManagedServicePaginatedRecords.PageInfo(childComplexity), true - case "Mutation.infra_createEdge": - if e.complexity.Mutation.InfraCreateEdge == nil { + case "ClusterManagedServicePaginatedRecords.totalCount": + if e.complexity.ClusterManagedServicePaginatedRecords.TotalCount == nil { break } - args, err := ec.field_Mutation_infra_createEdge_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.ClusterManagedServicePaginatedRecords.TotalCount(childComplexity), true + + case "ClusterPaginatedRecords.edges": + if e.complexity.ClusterPaginatedRecords.Edges == nil { + break } - return e.complexity.Mutation.InfraCreateEdge(childComplexity, args["edge"].(entities.Edge)), true + return e.complexity.ClusterPaginatedRecords.Edges(childComplexity), true - case "Mutation.infra_deleteBYOCCluster": - if e.complexity.Mutation.InfraDeleteBYOCCluster == nil { + case "ClusterPaginatedRecords.pageInfo": + if e.complexity.ClusterPaginatedRecords.PageInfo == nil { break } - args, err := ec.field_Mutation_infra_deleteBYOCCluster_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.ClusterPaginatedRecords.PageInfo(childComplexity), true + + case "ClusterPaginatedRecords.totalCount": + if e.complexity.ClusterPaginatedRecords.TotalCount == nil { + break } - return e.complexity.Mutation.InfraDeleteBYOCCluster(childComplexity, args["name"].(string)), true + return e.complexity.ClusterPaginatedRecords.TotalCount(childComplexity), true - case "Mutation.infra_deleteCloudProvider": - if e.complexity.Mutation.InfraDeleteCloudProvider == nil { + case "CursorPagination.after": + if e.complexity.CursorPagination.After == nil { break } - args, err := ec.field_Mutation_infra_deleteCloudProvider_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.CursorPagination.After(childComplexity), true + + case "CursorPagination.before": + if e.complexity.CursorPagination.Before == nil { + break } - return e.complexity.Mutation.InfraDeleteCloudProvider(childComplexity, args["name"].(string)), true + return e.complexity.CursorPagination.Before(childComplexity), true - case "Mutation.infra_deleteCluster": - if e.complexity.Mutation.InfraDeleteCluster == nil { + case "CursorPagination.first": + if e.complexity.CursorPagination.First == nil { break } - args, err := ec.field_Mutation_infra_deleteCluster_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.CursorPagination.First(childComplexity), true + + case "CursorPagination.last": + if e.complexity.CursorPagination.Last == nil { + break } - return e.complexity.Mutation.InfraDeleteCluster(childComplexity, args["name"].(string)), true + return e.complexity.CursorPagination.Last(childComplexity), true - case "Mutation.infra_deleteEdge": - if e.complexity.Mutation.InfraDeleteEdge == nil { + case "CursorPagination.orderBy": + if e.complexity.CursorPagination.OrderBy == nil { break } - args, err := ec.field_Mutation_infra_deleteEdge_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.CursorPagination.OrderBy(childComplexity), true + + case "CursorPagination.sortDirection": + if e.complexity.CursorPagination.SortDirection == nil { + break } - return e.complexity.Mutation.InfraDeleteEdge(childComplexity, args["clusterName"].(string), args["name"].(string)), true + return e.complexity.CursorPagination.SortDirection(childComplexity), true - case "Mutation.infra_deleteWorkerNode": - if e.complexity.Mutation.InfraDeleteWorkerNode == nil { + case "DomainEntry.accountName": + if e.complexity.DomainEntry.AccountName == nil { break } - args, err := ec.field_Mutation_infra_deleteWorkerNode_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.DomainEntry.AccountName(childComplexity), true + + case "DomainEntry.clusterName": + if e.complexity.DomainEntry.ClusterName == nil { + break } - return e.complexity.Mutation.InfraDeleteWorkerNode(childComplexity, args["clusterName"].(string), args["edgeName"].(string), args["name"].(string)), true + return e.complexity.DomainEntry.ClusterName(childComplexity), true - case "Mutation.infra_updateBYOCCluster": - if e.complexity.Mutation.InfraUpdateBYOCCluster == nil { + case "DomainEntry.createdBy": + if e.complexity.DomainEntry.CreatedBy == nil { break } - args, err := ec.field_Mutation_infra_updateBYOCCluster_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.DomainEntry.CreatedBy(childComplexity), true + + case "DomainEntry.creationTime": + if e.complexity.DomainEntry.CreationTime == nil { + break } - return e.complexity.Mutation.InfraUpdateBYOCCluster(childComplexity, args["cluster"].(entities.BYOCCluster)), true + return e.complexity.DomainEntry.CreationTime(childComplexity), true - case "Mutation.infra_updateCloudProvider": - if e.complexity.Mutation.InfraUpdateCloudProvider == nil { + case "DomainEntry.displayName": + if e.complexity.DomainEntry.DisplayName == nil { break } - args, err := ec.field_Mutation_infra_updateCloudProvider_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.DomainEntry.DisplayName(childComplexity), true + + case "DomainEntry.domainName": + if e.complexity.DomainEntry.DomainName == nil { + break } - return e.complexity.Mutation.InfraUpdateCloudProvider(childComplexity, args["cloudProvider"].(entities.CloudProvider), args["providerSecret"].(*entities.Secret)), true + return e.complexity.DomainEntry.DomainName(childComplexity), true - case "Mutation.infra_updateCluster": - if e.complexity.Mutation.InfraUpdateCluster == nil { + case "DomainEntry.id": + if e.complexity.DomainEntry.ID == nil { break } - args, err := ec.field_Mutation_infra_updateCluster_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.DomainEntry.ID(childComplexity), true + + case "DomainEntry.lastUpdatedBy": + if e.complexity.DomainEntry.LastUpdatedBy == nil { + break } - return e.complexity.Mutation.InfraUpdateCluster(childComplexity, args["cluster"].(entities.Cluster)), true + return e.complexity.DomainEntry.LastUpdatedBy(childComplexity), true - case "Mutation.infra_updateEdge": - if e.complexity.Mutation.InfraUpdateEdge == nil { + case "DomainEntry.markedForDeletion": + if e.complexity.DomainEntry.MarkedForDeletion == nil { break } - args, err := ec.field_Mutation_infra_updateEdge_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.DomainEntry.MarkedForDeletion(childComplexity), true + + case "DomainEntry.recordVersion": + if e.complexity.DomainEntry.RecordVersion == nil { + break } - return e.complexity.Mutation.InfraUpdateEdge(childComplexity, args["edge"].(entities.Edge)), true + return e.complexity.DomainEntry.RecordVersion(childComplexity), true - case "NodePool.apiVersion": - if e.complexity.NodePool.APIVersion == nil { + case "DomainEntry.updateTime": + if e.complexity.DomainEntry.UpdateTime == nil { break } - return e.complexity.NodePool.APIVersion(childComplexity), true + return e.complexity.DomainEntry.UpdateTime(childComplexity), true - case "NodePool.kind": - if e.complexity.NodePool.Kind == nil { + case "DomainEntryEdge.cursor": + if e.complexity.DomainEntryEdge.Cursor == nil { break } - return e.complexity.NodePool.Kind(childComplexity), true + return e.complexity.DomainEntryEdge.Cursor(childComplexity), true - case "NodePool.metadata": - if e.complexity.NodePool.ObjectMeta == nil { + case "DomainEntryEdge.node": + if e.complexity.DomainEntryEdge.Node == nil { break } - return e.complexity.NodePool.ObjectMeta(childComplexity), true + return e.complexity.DomainEntryEdge.Node(childComplexity), true - case "NodePool.spec": - if e.complexity.NodePool.Spec == nil { + case "DomainEntryPaginatedRecords.edges": + if e.complexity.DomainEntryPaginatedRecords.Edges == nil { break } - return e.complexity.NodePool.Spec(childComplexity), true + return e.complexity.DomainEntryPaginatedRecords.Edges(childComplexity), true - case "NodePool.status": - if e.complexity.NodePool.Status == nil { + case "DomainEntryPaginatedRecords.pageInfo": + if e.complexity.DomainEntryPaginatedRecords.PageInfo == nil { break } - return e.complexity.NodePool.Status(childComplexity), true + return e.complexity.DomainEntryPaginatedRecords.PageInfo(childComplexity), true - case "NodePool.syncStatus": - if e.complexity.NodePool.SyncStatus == nil { + case "DomainEntryPaginatedRecords.totalCount": + if e.complexity.DomainEntryPaginatedRecords.TotalCount == nil { break } - return e.complexity.NodePool.SyncStatus(childComplexity), true + return e.complexity.DomainEntryPaginatedRecords.TotalCount(childComplexity), true - case "NodePoolSpec.accountName": - if e.complexity.NodePoolSpec.AccountName == nil { + case "EncodedValue.encoding": + if e.complexity.EncodedValue.Encoding == nil { break } - return e.complexity.NodePoolSpec.AccountName(childComplexity), true + return e.complexity.EncodedValue.Encoding(childComplexity), true - case "NodePoolSpec.clusterName": - if e.complexity.NodePoolSpec.ClusterName == nil { + case "EncodedValue.value": + if e.complexity.EncodedValue.Value == nil { break } - return e.complexity.NodePoolSpec.ClusterName(childComplexity), true + return e.complexity.EncodedValue.Value(childComplexity), true - case "NodePoolSpec.config": - if e.complexity.NodePoolSpec.Config == nil { + case "Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials.accessKey": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials.AccessKey == nil { break } - return e.complexity.NodePoolSpec.Config(childComplexity), true + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials.AccessKey(childComplexity), true - case "NodePoolSpec.edgeName": - if e.complexity.NodePoolSpec.EdgeName == nil { + case "Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials.awsAccountId": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials.AwsAccountID == nil { break } - return e.complexity.NodePoolSpec.EdgeName(childComplexity), true + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials.AwsAccountID(childComplexity), true - case "NodePoolSpec.max": - if e.complexity.NodePoolSpec.Max == nil { + case "Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials.cfParamExternalID": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials.CfParamExternalID == nil { break } - return e.complexity.NodePoolSpec.Max(childComplexity), true + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials.CfParamExternalID(childComplexity), true - case "NodePoolSpec.min": - if e.complexity.NodePoolSpec.Min == nil { + case "Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials.cfParamInstanceProfileName": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials.CfParamInstanceProfileName == nil { break } - return e.complexity.NodePoolSpec.Min(childComplexity), true + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials.CfParamInstanceProfileName(childComplexity), true - case "NodePoolSpec.provider": - if e.complexity.NodePoolSpec.Provider == nil { + case "Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials.cfParamRoleName": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials.CfParamRoleName == nil { break } - return e.complexity.NodePoolSpec.Provider(childComplexity), true + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials.CfParamRoleName(childComplexity), true - case "NodePoolSpec.providerName": - if e.complexity.NodePoolSpec.ProviderName == nil { + case "Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials.cfParamStackName": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials.CfParamStackName == nil { break } - return e.complexity.NodePoolSpec.ProviderName(childComplexity), true + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials.CfParamStackName(childComplexity), true - case "NodePoolSpec.region": - if e.complexity.NodePoolSpec.Region == nil { + case "Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials.cfParamTrustedARN": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials.CfParamTrustedArn == nil { break } - return e.complexity.NodePoolSpec.Region(childComplexity), true + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials.CfParamTrustedArn(childComplexity), true - case "Overrides.applied": - if e.complexity.Overrides.Applied == nil { + case "Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials.secretKey": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials.SecretKey == nil { break } - return e.complexity.Overrides.Applied(childComplexity), true + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials.SecretKey(childComplexity), true - case "Overrides.patches": - if e.complexity.Overrides.Patches == nil { + case "Github__com___kloudlite___api___apps___infra___internal___entities__InputField.defaultValue": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__InputField.DefaultValue == nil { break } - return e.complexity.Overrides.Patches(childComplexity), true + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__InputField.DefaultValue(childComplexity), true - case "Patch.op": - if e.complexity.Patch.Op == nil { + case "Github__com___kloudlite___api___apps___infra___internal___entities__InputField.displayUnit": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__InputField.DisplayUnit == nil { break } - return e.complexity.Patch.Op(childComplexity), true + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__InputField.DisplayUnit(childComplexity), true - case "Patch.path": - if e.complexity.Patch.Path == nil { + case "Github__com___kloudlite___api___apps___infra___internal___entities__InputField.inputType": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__InputField.InputType == nil { break } - return e.complexity.Patch.Path(childComplexity), true + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__InputField.InputType(childComplexity), true - case "Patch.value": - if e.complexity.Patch.Value == nil { + case "Github__com___kloudlite___api___apps___infra___internal___entities__InputField.label": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__InputField.Label == nil { break } - return e.complexity.Patch.Value(childComplexity), true + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__InputField.Label(childComplexity), true - case "Query.infra_checkNameAvailability": - if e.complexity.Query.InfraCheckNameAvailability == nil { + case "Github__com___kloudlite___api___apps___infra___internal___entities__InputField.max": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__InputField.Max == nil { break } - args, err := ec.field_Query_infra_checkNameAvailability_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__InputField.Max(childComplexity), true + + case "Github__com___kloudlite___api___apps___infra___internal___entities__InputField.min": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__InputField.Min == nil { + break } - return e.complexity.Query.InfraCheckNameAvailability(childComplexity, args["resType"].(domain.ResType), args["name"].(string)), true + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__InputField.Min(childComplexity), true - case "Query.infra_getBYOCCluster": - if e.complexity.Query.InfraGetBYOCCluster == nil { + case "Github__com___kloudlite___api___apps___infra___internal___entities__InputField.multiplier": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__InputField.Multiplier == nil { break } - args, err := ec.field_Query_infra_getBYOCCluster_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__InputField.Multiplier(childComplexity), true + + case "Github__com___kloudlite___api___apps___infra___internal___entities__InputField.name": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__InputField.Name == nil { + break } - return e.complexity.Query.InfraGetBYOCCluster(childComplexity, args["name"].(string)), true + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__InputField.Name(childComplexity), true - case "Query.infra_getCloudProvider": - if e.complexity.Query.InfraGetCloudProvider == nil { + case "Github__com___kloudlite___api___apps___infra___internal___entities__InputField.required": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__InputField.Required == nil { break } - args, err := ec.field_Query_infra_getCloudProvider_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__InputField.Required(childComplexity), true + + case "Github__com___kloudlite___api___apps___infra___internal___entities__InputField.unit": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__InputField.Unit == nil { + break } - return e.complexity.Query.InfraGetCloudProvider(childComplexity, args["name"].(string)), true + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__InputField.Unit(childComplexity), true - case "Query.infra_getCluster": - if e.complexity.Query.InfraGetCluster == nil { + case "Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate.apiVersion": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate.APIVersion == nil { break } - args, err := ec.field_Query_infra_getCluster_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate.APIVersion(childComplexity), true + + case "Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate.description": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate.Description == nil { + break } - return e.complexity.Query.InfraGetCluster(childComplexity, args["name"].(string)), true + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate.Description(childComplexity), true - case "Query.infra_getEdge": - if e.complexity.Query.InfraGetEdge == nil { + case "Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate.displayName": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate.DisplayName == nil { break } - args, err := ec.field_Query_infra_getEdge_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate.DisplayName(childComplexity), true + + case "Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate.fields": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate.Fields == nil { + break } - return e.complexity.Query.InfraGetEdge(childComplexity, args["clusterName"].(string), args["name"].(string)), true + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate.Fields(childComplexity), true - case "Query.infra_getMasterNodes": - if e.complexity.Query.InfraGetMasterNodes == nil { + case "Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate.kind": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate.Kind == nil { break } - args, err := ec.field_Query_infra_getMasterNodes_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate.Kind(childComplexity), true + + case "Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate.name": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate.Name == nil { + break } - return e.complexity.Query.InfraGetMasterNodes(childComplexity, args["clusterName"].(string)), true + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate.Name(childComplexity), true - case "Query.infra_getNodePools": - if e.complexity.Query.InfraGetNodePools == nil { + case "Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate.outputs": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate.Outputs == nil { break } - args, err := ec.field_Query_infra_getNodePools_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate.Outputs(childComplexity), true + + case "Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.active": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.Active == nil { + break } - return e.complexity.Query.InfraGetNodePools(childComplexity, args["clusterName"].(string), args["edgeName"].(string)), true + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.Active(childComplexity), true - case "Query.infra_getWorkerNodes": - if e.complexity.Query.InfraGetWorkerNodes == nil { + case "Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.apiVersion": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.ApiVersion == nil { break } - args, err := ec.field_Query_infra_getWorkerNodes_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.ApiVersion(childComplexity), true + + case "Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.description": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.Description == nil { + break } - return e.complexity.Query.InfraGetWorkerNodes(childComplexity, args["clusterName"].(string), args["edgeName"].(string)), true + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.Description(childComplexity), true - case "Query.infra_listBYOCClusters": - if e.complexity.Query.InfraListBYOCClusters == nil { + case "Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.displayName": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.DisplayName == nil { break } - return e.complexity.Query.InfraListBYOCClusters(childComplexity), true + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.DisplayName(childComplexity), true - case "Query.infra_listCloudProviders": - if e.complexity.Query.InfraListCloudProviders == nil { + case "Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.fields": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.Fields == nil { break } - return e.complexity.Query.InfraListCloudProviders(childComplexity), true + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.Fields(childComplexity), true - case "Query.infra_listClusters": - if e.complexity.Query.InfraListClusters == nil { + case "Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.kind": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.Kind == nil { break } - return e.complexity.Query.InfraListClusters(childComplexity), true + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.Kind(childComplexity), true - case "Query.infra_listEdges": - if e.complexity.Query.InfraListEdges == nil { + case "Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.logoUrl": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.LogoUrl == nil { break } - args, err := ec.field_Query_infra_listEdges_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.LogoUrl(childComplexity), true + + case "Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.name": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.Name == nil { + break } - return e.complexity.Query.InfraListEdges(childComplexity, args["clusterName"].(string), args["providerName"].(*string)), true + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.Name(childComplexity), true - case "Query._service": - if e.complexity.Query.__resolve__service == nil { + case "Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.outputs": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.Outputs == nil { break } - return e.complexity.Query.__resolve__service(childComplexity), true + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.Outputs(childComplexity), true - case "Secret.apiVersion": - if e.complexity.Secret.APIVersion == nil { + case "Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.resources": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.Resources == nil { break } - return e.complexity.Secret.APIVersion(childComplexity), true + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry.Resources(childComplexity), true - case "Secret.data": - if e.complexity.Secret.Data == nil { + case "Github__com___kloudlite___api___apps___infra___internal___entities__OutputField.description": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__OutputField.Description == nil { break } - return e.complexity.Secret.Data(childComplexity), true + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__OutputField.Description(childComplexity), true - case "Secret.enabled": - if e.complexity.Secret.Enabled == nil { + case "Github__com___kloudlite___api___apps___infra___internal___entities__OutputField.label": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__OutputField.Label == nil { break } - return e.complexity.Secret.Enabled(childComplexity), true + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__OutputField.Label(childComplexity), true - case "Secret.kind": - if e.complexity.Secret.Kind == nil { + case "Github__com___kloudlite___api___apps___infra___internal___entities__OutputField.name": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__OutputField.Name == nil { break } - return e.complexity.Secret.Kind(childComplexity), true + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__OutputField.Name(childComplexity), true - case "Secret.metadata": - if e.complexity.Secret.ObjectMeta == nil { + case "Github__com___kloudlite___api___common__CreatedOrUpdatedBy.userEmail": + if e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserEmail == nil { break } - return e.complexity.Secret.ObjectMeta(childComplexity), true + return e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserEmail(childComplexity), true - case "Secret.overrides": - if e.complexity.Secret.Overrides == nil { + case "Github__com___kloudlite___api___common__CreatedOrUpdatedBy.userId": + if e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserID == nil { break } - return e.complexity.Secret.Overrides(childComplexity), true + return e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserID(childComplexity), true - case "Secret.projectName": - if e.complexity.Secret.ProjectName == nil { + case "Github__com___kloudlite___api___common__CreatedOrUpdatedBy.userName": + if e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserName == nil { break } - return e.complexity.Secret.ProjectName(childComplexity), true + return e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserName(childComplexity), true - case "Secret.status": - if e.complexity.Secret.Status == nil { + case "Github__com___kloudlite___api___pkg___types__SyncStatus.action": + if e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.Action == nil { break } - return e.complexity.Secret.Status(childComplexity), true + return e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.Action(childComplexity), true - case "Secret.stringData": - if e.complexity.Secret.StringData == nil { + case "Github__com___kloudlite___api___pkg___types__SyncStatus.error": + if e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.Error == nil { break } - return e.complexity.Secret.StringData(childComplexity), true + return e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.Error(childComplexity), true - case "Secret.syncStatus": - if e.complexity.Secret.SyncStatus == nil { + case "Github__com___kloudlite___api___pkg___types__SyncStatus.lastSyncedAt": + if e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.LastSyncedAt == nil { break } - return e.complexity.Secret.SyncStatus(childComplexity), true + return e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.LastSyncedAt(childComplexity), true - case "Secret.type": - if e.complexity.Secret.Type == nil { + case "Github__com___kloudlite___api___pkg___types__SyncStatus.recordVersion": + if e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.RecordVersion == nil { break } - return e.complexity.Secret.Type(childComplexity), true + return e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.RecordVersion(childComplexity), true - case "Status.checks": - if e.complexity.Status.Checks == nil { + case "Github__com___kloudlite___api___pkg___types__SyncStatus.state": + if e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.State == nil { break } - return e.complexity.Status.Checks(childComplexity), true + return e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.State(childComplexity), true - case "Status.displayVars": - if e.complexity.Status.DisplayVars == nil { + case "Github__com___kloudlite___api___pkg___types__SyncStatus.syncScheduledAt": + if e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.SyncScheduledAt == nil { break } - return e.complexity.Status.DisplayVars(childComplexity), true + return e.complexity.Github__com___kloudlite___api___pkg___types__SyncStatus.SyncScheduledAt(childComplexity), true - case "Status.isReady": - if e.complexity.Status.IsReady == nil { + case "Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig.k3sMasters": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig.K3sMasters == nil { break } - return e.complexity.Status.IsReady(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig.K3sMasters(childComplexity), true - case "SyncStatus.action": - if e.complexity.SyncStatus.Action == nil { + case "Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig.nodePools": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig.NodePools == nil { break } - return e.complexity.SyncStatus.Action(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig.NodePools(childComplexity), true - case "SyncStatus.error": - if e.complexity.SyncStatus.Error == nil { + case "Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig.region": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig.Region == nil { break } - return e.complexity.SyncStatus.Error(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig.Region(childComplexity), true - case "SyncStatus.generation": - if e.complexity.SyncStatus.Generation == nil { + case "Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig.spotNodePools": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig.SpotNodePools == nil { break } - return e.complexity.SyncStatus.Generation(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig.SpotNodePools(childComplexity), true - case "SyncStatus.lastSyncedAt": - if e.complexity.SyncStatus.LastSyncedAt == nil { + case "Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig.iamInstanceProfileRole": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig.IamInstanceProfileRole == nil { break } - return e.complexity.SyncStatus.LastSyncedAt(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig.IamInstanceProfileRole(childComplexity), true - case "SyncStatus.state": - if e.complexity.SyncStatus.State == nil { + case "Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig.imageId": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig.ImageID == nil { break } - return e.complexity.SyncStatus.State(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig.ImageID(childComplexity), true - case "SyncStatus.syncScheduledAt": - if e.complexity.SyncStatus.SyncScheduledAt == nil { + case "Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig.imageSSHUsername": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig.ImageSSHUsername == nil { break } - return e.complexity.SyncStatus.SyncScheduledAt(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig.ImageSSHUsername(childComplexity), true - case "WorkerNode.apiVersion": - if e.complexity.WorkerNode.APIVersion == nil { + case "Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig.instanceType": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig.InstanceType == nil { break } - return e.complexity.WorkerNode.APIVersion(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig.InstanceType(childComplexity), true - case "WorkerNode.kind": - if e.complexity.WorkerNode.Kind == nil { + case "Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig.nodes": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig.Nodes == nil { break } - return e.complexity.WorkerNode.Kind(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig.Nodes(childComplexity), true - case "WorkerNode.metadata": - if e.complexity.WorkerNode.ObjectMeta == nil { + case "Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig.nvidiaGpuEnabled": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig.NvidiaGpuEnabled == nil { break } - return e.complexity.WorkerNode.ObjectMeta(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig.NvidiaGpuEnabled(childComplexity), true - case "WorkerNode.spec": - if e.complexity.WorkerNode.Spec == nil { + case "Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig.rootVolumeSize": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig.RootVolumeSize == nil { break } - return e.complexity.WorkerNode.Spec(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig.RootVolumeSize(childComplexity), true - case "WorkerNode.status": - if e.complexity.WorkerNode.Status == nil { + case "Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig.rootVolumeType": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig.RootVolumeType == nil { break } - return e.complexity.WorkerNode.Status(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig.RootVolumeType(childComplexity), true - case "WorkerNode.syncStatus": - if e.complexity.WorkerNode.SyncStatus == nil { + case "Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.availabilityZone": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.AvailabilityZone == nil { break } - return e.complexity.WorkerNode.SyncStatus(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.AvailabilityZone(childComplexity), true - case "WorkerNodeSpec.accountName": - if e.complexity.WorkerNodeSpec.AccountName == nil { + case "Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.ec2Pool": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.Ec2Pool == nil { break } - return e.complexity.WorkerNodeSpec.AccountName(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.Ec2Pool(childComplexity), true - case "WorkerNodeSpec.clusterName": - if e.complexity.WorkerNodeSpec.ClusterName == nil { + case "Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.iamInstanceProfileRole": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.IamInstanceProfileRole == nil { break } - return e.complexity.WorkerNodeSpec.ClusterName(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.IamInstanceProfileRole(childComplexity), true - case "WorkerNodeSpec.config": - if e.complexity.WorkerNodeSpec.Config == nil { + case "Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.imageId": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.ImageID == nil { break } - return e.complexity.WorkerNodeSpec.Config(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.ImageID(childComplexity), true - case "WorkerNodeSpec.edgeName": - if e.complexity.WorkerNodeSpec.EdgeName == nil { + case "Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.imageSSHUsername": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.ImageSSHUsername == nil { break } - return e.complexity.WorkerNodeSpec.EdgeName(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.ImageSSHUsername(childComplexity), true - case "WorkerNodeSpec.nodeIndex": - if e.complexity.WorkerNodeSpec.NodeIndex == nil { + case "Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.nvidiaGpuEnabled": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.NvidiaGpuEnabled == nil { break } - return e.complexity.WorkerNodeSpec.NodeIndex(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.NvidiaGpuEnabled(childComplexity), true - case "WorkerNodeSpec.pool": - if e.complexity.WorkerNodeSpec.Pool == nil { + case "Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.poolType": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.PoolType == nil { break } - return e.complexity.WorkerNodeSpec.Pool(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.PoolType(childComplexity), true - case "WorkerNodeSpec.provider": - if e.complexity.WorkerNodeSpec.Provider == nil { + case "Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.rootVolumeSize": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.RootVolumeSize == nil { break } - return e.complexity.WorkerNodeSpec.Provider(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.RootVolumeSize(childComplexity), true - case "WorkerNodeSpec.providerName": - if e.complexity.WorkerNodeSpec.ProviderName == nil { + case "Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.rootVolumeType": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.RootVolumeType == nil { break } - return e.complexity.WorkerNodeSpec.ProviderName(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.RootVolumeType(childComplexity), true - case "WorkerNodeSpec.region": - if e.complexity.WorkerNodeSpec.Region == nil { + case "Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.spotPool": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.SpotPool == nil { break } - return e.complexity.WorkerNodeSpec.Region(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig.SpotPool(childComplexity), true - case "WorkerNodeSpec.stateful": - if e.complexity.WorkerNodeSpec.Stateful == nil { + case "Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig.instanceType": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig.InstanceType == nil { break } - return e.complexity.WorkerNodeSpec.Stateful(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig.InstanceType(childComplexity), true - case "_Service.sdl": - if e.complexity._Service.SDL == nil { + case "Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig.nodes": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig.Nodes == nil { break } - return e.complexity._Service.SDL(childComplexity), true + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig.Nodes(childComplexity), true - } - return 0, false -} + case "Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode.memoryPerVcpu": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode.MemoryPerVcpu == nil { + break + } -func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { - rc := graphql.GetOperationContext(ctx) - ec := executionContext{rc, e} - inputUnmarshalMap := graphql.BuildUnmarshalerMap( - ec.unmarshalInputBYOCClusterIn, - ec.unmarshalInputBYOCClusterSpecIn, - ec.unmarshalInputCloudProviderIn, - ec.unmarshalInputCloudProviderSpecIn, - ec.unmarshalInputCloudProviderSpecProviderSecretIn, - ec.unmarshalInputClusterIn, - ec.unmarshalInputClusterSpecIn, - ec.unmarshalInputEdgeIn, - ec.unmarshalInputEdgeSpecIn, - ec.unmarshalInputEdgeSpecPoolsIn, - ec.unmarshalInputMasterNodeIn, - ec.unmarshalInputMasterNodeSpecIn, - ec.unmarshalInputMetadataIn, - ec.unmarshalInputNodePoolIn, - ec.unmarshalInputNodePoolSpecIn, - ec.unmarshalInputOverridesIn, - ec.unmarshalInputPatchIn, - ec.unmarshalInputSecretIn, - ec.unmarshalInputWorkerNodeIn, - ec.unmarshalInputWorkerNodeSpecIn, - ) - first := true + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode.MemoryPerVcpu(childComplexity), true - switch rc.Operation.Operation { - case ast.Query: - return func(ctx context.Context) *graphql.Response { - if !first { - return nil - } - first = false - ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) - data := ec._Query(ctx, rc.Operation.SelectionSet) - var buf bytes.Buffer - data.MarshalGQL(&buf) + case "Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode.vcpu": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode.Vcpu == nil { + break + } - return &graphql.Response{ - Data: buf.Bytes(), - } + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode.Vcpu(childComplexity), true + + case "Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNode.instanceTypes": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNode.InstanceTypes == nil { + break } - 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(), - } + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNode.InstanceTypes(childComplexity), true + + case "Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig.cpuNode": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig.CPUNode == nil { + break } - default: - return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation")) - } -} + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig.CPUNode(childComplexity), true -type executionContext struct { - *graphql.OperationContext - *executableSchema -} + case "Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig.gpuNode": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig.GpuNode == nil { + break + } -func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { - if ec.DisableIntrospection { - return nil, errors.New("introspection disabled") - } - return introspection.WrapSchema(parsedSchema), nil -} + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig.GpuNode(childComplexity), true -func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { - if ec.DisableIntrospection { - return nil, errors.New("introspection disabled") - } - return introspection.WrapTypeFromDef(parsedSchema, parsedSchema.Types[name]), nil -} + case "Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig.nodes": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig.Nodes == nil { + break + } -var sources = []*ast.Source{ - {Name: "../schema.graphqls", Input: `directive @isLoggedIn on FIELD_DEFINITION -directive @hasAccount on FIELD_DEFINITION + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig.Nodes(childComplexity), true -enum ResType { - byoc - cluster - cloudprovider - providersecret - edge -} + case "Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig.spotFleetTaggingRoleName": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig.SpotFleetTaggingRoleName == nil { + break + } -type CheckNameAvailabilityOutput { - result: Boolean! - suggestedNames: [String!]! -} + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig.SpotFleetTaggingRoleName(childComplexity), true -type Query { - # unique name suggestions - infra_checkNameAvailability(resType: ResType!, name: String!): CheckNameAvailabilityOutput! @isLoggedIn @hasAccount + case "Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys.keyAWSAccountId": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys.KeyAWSAccountID == nil { + break + } - # BYOC clusters - infra_listBYOCClusters: [BYOCCluster!] @isLoggedIn @hasAccount - infra_getBYOCCluster(name: String!): BYOCCluster @isLoggedIn @hasAccount + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys.KeyAWSAccountID(childComplexity), true - # clusters - infra_listClusters: [Cluster!] @isLoggedIn @hasAccount - infra_getCluster(name: String!): Cluster @isLoggedIn @hasAccount + case "Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys.keyAWSAssumeRoleExternalID": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys.KeyAWSAssumeRoleExternalID == nil { + break + } - # cloud providers - infra_listCloudProviders: [CloudProvider!] @isLoggedIn @hasAccount - infra_getCloudProvider(name: String!): CloudProvider @isLoggedIn @hasAccount + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys.KeyAWSAssumeRoleExternalID(childComplexity), true - # list edges - infra_listEdges(clusterName: String!, providerName: String): [Edge!] @isLoggedIn @hasAccount - infra_getEdge(clusterName: String!, name: String!): Edge @isLoggedIn @hasAccount + case "Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys.keyAWSAssumeRoleRoleARN": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys.KeyAWSAssumeRoleRoleArn == nil { + break + } - # get master nodes - infra_getMasterNodes(clusterName: String!): [MasterNode!] @isLoggedIn @hasAccount - infra_getWorkerNodes(clusterName: String!, edgeName: String!): [WorkerNode!] @isLoggedIn @hasAccount + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys.KeyAWSAssumeRoleRoleArn(childComplexity), true - # get node pools - infra_getNodePools(clusterName: String!, edgeName: String!): [NodePool!] @isLoggedIn @hasAccount -} + case "Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys.keyAccessKey": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys.KeyAccessKey == nil { + break + } -type Mutation { - # BYOC clusters - infra_createBYOCCluster(cluster: BYOCClusterIn!): BYOCCluster @isLoggedIn @hasAccount - infra_updateBYOCCluster(cluster: BYOCClusterIn!): BYOCCluster @isLoggedIn @hasAccount - infra_deleteBYOCCluster(name: String!): Boolean! @isLoggedIn @hasAccount + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys.KeyAccessKey(childComplexity), true - # clusters - infra_createCluster(cluster: ClusterIn!): Cluster @isLoggedIn @hasAccount - infra_updateCluster(cluster: ClusterIn!): Cluster @isLoggedIn @hasAccount - infra_deleteCluster(name: String!): Boolean! @isLoggedIn @hasAccount + case "Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys.keyIAMInstanceProfileRole": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys.KeyIAMInstanceProfileRole == nil { + break + } - # cloud provider - infra_createCloudProvider(cloudProvider: CloudProviderIn!, providerSecret: SecretIn!): CloudProvider @isLoggedIn @hasAccount - infra_updateCloudProvider(cloudProvider: CloudProviderIn!, providerSecret: SecretIn): CloudProvider @isLoggedIn @hasAccount - infra_deleteCloudProvider(name: String!): Boolean! @isLoggedIn @hasAccount + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys.KeyIAMInstanceProfileRole(childComplexity), true - # Edge Regions - infra_createEdge(edge: EdgeIn!): Edge @isLoggedIn @hasAccount - infra_updateEdge(edge: EdgeIn!): Edge @isLoggedIn @hasAccount - infra_deleteEdge(clusterName: String!, name: String!): Boolean! @isLoggedIn @hasAccount + case "Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys.keySecretKey": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys.KeySecretKey == nil { + break + } - # Nodes - infra_deleteWorkerNode(clusterName: String!, edgeName: String!, name: String!): Boolean! @isLoggedIn @hasAccount -} -`, BuiltIn: false}, - {Name: "../crd-to-gql/byoccluster.graphqls", Input: `type BYOCClusterSpec @shareable { - provider: String! - publicIps: [String] - region: String! - storageClasses: [String] - accountName: String! - displayName: String - incomingKafkaTopic: String! - ingressClasses: [String] -} - -input BYOCClusterSpecIn { - provider: String! - publicIps: [String] - region: String! - storageClasses: [String] - accountName: String! - displayName: String - incomingKafkaTopic: String! - ingressClasses: [String] -} - -type BYOCCluster @shareable { - metadata: Metadata! @goField(name: "objectMeta") - syncStatus: SyncStatus - spec: BYOCClusterSpec - status: Status - apiVersion: String - kind: String -} - -input BYOCClusterIn { - metadata: MetadataIn! @goField(name: "objectMeta") - spec: BYOCClusterSpecIn - apiVersion: String - kind: String -} + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys.KeySecretKey(childComplexity), true -`, BuiltIn: false}, - {Name: "../crd-to-gql/cloudprovider.graphqls", Input: `input CloudProviderSpecProviderSecretIn { - name: String! - namespace: String! -} + case "Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput.jobName": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput.JobName == nil { + break + } -type CloudProviderSpec @shareable { - display_name: String! - provider: String! - providerSecret: CloudProviderSpecProviderSecret! - accountName: String! -} + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput.JobName(childComplexity), true -input CloudProviderSpecIn { - display_name: String! - provider: String! - providerSecret: CloudProviderSpecProviderSecretIn! - accountName: String! -} + case "Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput.jobNamespace": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput.JobNamespace == nil { + break + } -type CloudProvider @shareable { - apiVersion: String - kind: String - metadata: Metadata! @goField(name: "objectMeta") - syncStatus: SyncStatus - spec: CloudProviderSpec - status: Status -} + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput.JobNamespace(childComplexity), true -input CloudProviderIn { - apiVersion: String - kind: String - metadata: MetadataIn! @goField(name: "objectMeta") - spec: CloudProviderSpecIn -} + case "Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput.keyK3sAgentJoinToken": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput.KeyK3sAgentJoinToken == nil { + break + } -type CloudProviderSpecProviderSecret @shareable { - name: String! - namespace: String! -} + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput.KeyK3sAgentJoinToken(childComplexity), true -`, BuiltIn: false}, - {Name: "../crd-to-gql/cluster.graphqls", Input: `type ClusterSpec @shareable { - provider: String! - providerName: String! - region: String! - accountName: String! - config: String! - count: Int! -} + case "Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput.keyK3sServerJoinToken": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput.KeyK3sServerJoinToken == nil { + break + } -input ClusterSpecIn { - provider: String! - providerName: String! - region: String! - accountName: String! - config: String! - count: Int! -} + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput.KeyK3sServerJoinToken(childComplexity), true -type Cluster @shareable { - apiVersion: String - kind: String - metadata: Metadata! @goField(name: "objectMeta") - syncStatus: SyncStatus - spec: ClusterSpec - status: Status -} + case "Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput.keyKubeconfig": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput.KeyKubeconfig == nil { + break + } -input ClusterIn { - apiVersion: String - kind: String - metadata: MetadataIn! @goField(name: "objectMeta") - spec: ClusterSpecIn -} + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput.KeyKubeconfig(childComplexity), true -`, BuiltIn: false}, - {Name: "../crd-to-gql/directives.graphqls", Input: ` -extend schema @link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@key", "@shareable"]) + case "Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput.secretName": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput.SecretName == nil { + break + } -directive @goField( - forceResolver: Boolean - name: String -) on INPUT_FIELD_DEFINITION | FIELD_DEFINITION -`, BuiltIn: false}, - {Name: "../crd-to-gql/edge.graphqls", Input: `type EdgeSpecPools @shareable { - name: String! - config: String! - max: Int - min: Int -} + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput.SecretName(childComplexity), true -input EdgeSpecPoolsIn { - name: String! - config: String! - max: Int - min: Int -} + case "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.accountId": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.AccountID == nil { + break + } -type EdgeSpec @shareable { - accountName: String! - clusterName: String! - pools: [EdgeSpecPools] - provider: String - providerName: String! - region: String! -} + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.AccountID(childComplexity), true -input EdgeSpecIn { - accountName: String! - clusterName: String! - pools: [EdgeSpecPoolsIn] - provider: String - providerName: String! - region: String! -} + case "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.accountName": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.AccountName == nil { + break + } -type Edge @shareable { - apiVersion: String - kind: String - metadata: Metadata! @goField(name: "objectMeta") - syncStatus: SyncStatus - spec: EdgeSpec - status: Status -} + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.AccountName(childComplexity), true -input EdgeIn { - apiVersion: String - kind: String - metadata: MetadataIn! @goField(name: "objectMeta") - spec: EdgeSpecIn -} + case "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.availabilityMode": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.AvailabilityMode == nil { + break + } -`, BuiltIn: false}, - {Name: "../crd-to-gql/masternode.graphqls", Input: `type MasterNode @shareable { - status: Status - apiVersion: String - kind: String - metadata: Metadata! @goField(name: "objectMeta") - syncStatus: SyncStatus - spec: MasterNodeSpec -} + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.AvailabilityMode(childComplexity), true -input MasterNodeIn { - apiVersion: String - kind: String - metadata: MetadataIn! @goField(name: "objectMeta") - spec: MasterNodeSpecIn -} + case "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.aws": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.Aws == nil { + break + } -type MasterNodeSpec @shareable { - region: String! - accountName: String! - clusterName: String! - config: String! - provider: String! - providerName: String! -} + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.Aws(childComplexity), true -input MasterNodeSpecIn { - region: String! - accountName: String! - clusterName: String! - config: String! - provider: String! - providerName: String! -} + case "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.backupToS3Enabled": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.BackupToS3Enabled == nil { + break + } -`, BuiltIn: false}, - {Name: "../crd-to-gql/nodepool.graphqls", Input: `type NodePool @shareable { - apiVersion: String - kind: String - metadata: Metadata! @goField(name: "objectMeta") - syncStatus: SyncStatus - spec: NodePoolSpec - status: Status -} + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.BackupToS3Enabled(childComplexity), true -input NodePoolIn { - apiVersion: String - kind: String - metadata: MetadataIn! @goField(name: "objectMeta") - spec: NodePoolSpecIn -} - -type NodePoolSpec @shareable { - accountName: String! - config: String! - max: Int - providerName: String! - region: String! - clusterName: String! - edgeName: String! - min: Int - provider: String! -} - -input NodePoolSpecIn { - accountName: String! - config: String! - max: Int - providerName: String! - region: String! - clusterName: String! - edgeName: String! - min: Int - provider: String! -} + case "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.cloudProvider": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.CloudProvider == nil { + break + } -`, BuiltIn: false}, - {Name: "../crd-to-gql/scalars.graphqls", Input: ` -scalar Any -scalar Json -scalar Map -scalar Date + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.CloudProvider(childComplexity), true -type Metadata @shareable { - name: String! - namespace: String - labels: Json - annotations: Json - creationTimestamp: Date! - deletionTimestamp: Date - generation: Int! -} + case "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.cloudflareEnabled": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.CloudflareEnabled == nil { + break + } -input MetadataIn { - name: String! - namespace: String - labels: Json - annotations: Json -} + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.CloudflareEnabled(childComplexity), true -type Status @shareable { - isReady: Boolean! - checks: Map - displayVars: Json -} + case "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.clusterInternalDnsHost": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.ClusterInternalDNSHost == nil { + break + } -type Check @shareable { - status: Boolean - message: String - generation: Int -} + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.ClusterInternalDNSHost(childComplexity), true -type Patch @shareable { - op: String! - path: String! - value: Any -} + case "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.clusterTokenRef": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.ClusterTokenRef == nil { + break + } -type Overrides @shareable{ - applied: Boolean - patches: [Patch!] -} + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.ClusterTokenRef(childComplexity), true -input PatchIn { - op: String! - path: String! - value: Any -} + case "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.credentialKeys": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.CredentialKeys == nil { + break + } -input OverridesIn{ - patches: [PatchIn!] -} + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.CredentialKeys(childComplexity), true -enum SyncAction { - APPLY - DELETE -} + case "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.credentialsRef": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.CredentialsRef == nil { + break + } -enum SyncState { - IDLE - IN_PROGRESS - READY - NOT_READY -} + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.CredentialsRef(childComplexity), true -type SyncStatus @shareable{ - syncScheduledAt: Date! - lastSyncedAt: Date - action: SyncAction! - generation: Int! - state: SyncState! - error: String -} -`, BuiltIn: false}, - {Name: "../crd-to-gql/secret.graphqls", Input: `type Secret @shareable { - syncStatus: SyncStatus - stringData: Map - apiVersion: String - data: Map - enabled: Boolean - kind: String - metadata: Metadata! @goField(name: "objectMeta") - overrides: Overrides - projectName: String - type: String - status: Status -} - -input SecretIn { - stringData: Map - apiVersion: String - data: Map - enabled: Boolean - kind: String - metadata: MetadataIn! @goField(name: "objectMeta") - overrides: OverridesIn - projectName: String - type: String -} + case "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.kloudliteRelease": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.KloudliteRelease == nil { + break + } -`, BuiltIn: false}, - {Name: "../crd-to-gql/workernode.graphqls", Input: `type WorkerNodeSpec @shareable { - clusterName: String! - config: String! - nodeIndex: Int - pool: String! - provider: String! - accountName: String! - edgeName: String! - providerName: String! - region: String! - stateful: Boolean -} - -input WorkerNodeSpecIn { - clusterName: String! - config: String! - nodeIndex: Int - pool: String! - provider: String! - accountName: String! - edgeName: String! - providerName: String! - region: String! - stateful: Boolean -} - -type WorkerNode @shareable { - metadata: Metadata! @goField(name: "objectMeta") - syncStatus: SyncStatus - spec: WorkerNodeSpec - status: Status - apiVersion: String - kind: String -} - -input WorkerNodeIn { - metadata: MetadataIn! @goField(name: "objectMeta") - spec: WorkerNodeSpecIn - apiVersion: String - kind: String -} + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.KloudliteRelease(childComplexity), true -`, BuiltIn: false}, - {Name: "../../federation/directives.graphql", Input: ` - scalar _Any - scalar _FieldSet - directive @requires(fields: _FieldSet!) on FIELD_DEFINITION - directive @provides(fields: _FieldSet!) on FIELD_DEFINITION - directive @extends on OBJECT | INTERFACE + case "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.messageQueueTopicName": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.MessageQueueTopicName == nil { + break + } - directive @key(fields: _FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE - directive @external on FIELD_DEFINITION | OBJECT - directive @link(import: [String!], url: String!) repeatable on SCHEMA - directive @shareable on OBJECT | FIELD_DEFINITION - directive @tag(name: String!) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION - directive @override(from: String!) on FIELD_DEFINITION - directive @inaccessible on SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION -`, BuiltIn: true}, - {Name: "../../federation/entity.graphql", Input: ` -type _Service { - sdl: String -} + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.MessageQueueTopicName(childComplexity), true -extend type Query { - _service: _Service! -} -`, BuiltIn: true}, -} -var parsedSchema = gqlparser.MustLoadSchema(sources...) + case "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.output": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.Output == nil { + break + } -// endregion ************************** generated!.gotpl ************************** + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.Output(childComplexity), true -// region ***************************** args.gotpl ***************************** + case "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.publicDNSHost": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.PublicDNSHost == nil { + break + } -func (ec *executionContext) field_Mutation_infra_createBYOCCluster_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 entities.BYOCCluster - if tmp, ok := rawArgs["cluster"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cluster")) - arg0, err = ec.unmarshalNBYOCClusterIn2kloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐBYOCCluster(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.PublicDNSHost(childComplexity), true + + case "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.taintMasterNodes": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.TaintMasterNodes == nil { + break } - } - args["cluster"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_infra_createCloudProvider_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 entities.CloudProvider - if tmp, ok := rawArgs["cloudProvider"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cloudProvider")) - arg0, err = ec.unmarshalNCloudProviderIn2kloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐCloudProvider(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.TaintMasterNodes(childComplexity), true + + case "Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode.cloudProviderAccessKey": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode.CloudProviderAccessKey == nil { + break } - } - args["cloudProvider"] = arg0 - var arg1 entities.Secret - if tmp, ok := rawArgs["providerSecret"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("providerSecret")) - arg1, err = ec.unmarshalNSecretIn2kloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐSecret(ctx, tmp) - if err != nil { - return nil, err + + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode.CloudProviderAccessKey(childComplexity), true + + case "Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode.cloudProviderSecretKey": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode.CloudProviderSecretKey == nil { + break } - } - args["providerSecret"] = arg1 - return args, nil -} -func (ec *executionContext) field_Mutation_infra_createCluster_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 entities.Cluster - if tmp, ok := rawArgs["cluster"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cluster")) - arg0, err = ec.unmarshalNClusterIn2kloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐCluster(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode.CloudProviderSecretKey(childComplexity), true + + case "Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode.jobName": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode.JobName == nil { + break } - } - args["cluster"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_infra_createEdge_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 entities.Edge - if tmp, ok := rawArgs["edge"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("edge")) - arg0, err = ec.unmarshalNEdgeIn2kloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐEdge(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode.JobName(childComplexity), true + + case "Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode.jobNamespace": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode.JobNamespace == nil { + break } - } - args["edge"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_infra_deleteBYOCCluster_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 + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode.JobNamespace(childComplexity), true + + case "Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode.stateS3BucketFilePath": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode.StateS3BucketFilePath == nil { + break } - } - args["name"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_infra_deleteCloudProvider_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 + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode.StateS3BucketFilePath(childComplexity), true + + case "Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode.stateS3BucketName": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode.StateS3BucketName == nil { + break } - } - args["name"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_infra_deleteCluster_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 + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode.StateS3BucketName(childComplexity), true + + case "Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode.stateS3BucketRegion": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode.StateS3BucketRegion == nil { + break } - } - args["name"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_infra_deleteEdge_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["clusterName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode.StateS3BucketRegion(childComplexity), true + + case "Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps.availabilityZone": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps.AvailabilityZone == nil { + break } - } - args["clusterName"] = arg0 - var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err + + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps.AvailabilityZone(childComplexity), true + + case "Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps.lastRecreatedAt": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps.LastRecreatedAt == nil { + break } - } - args["name"] = arg1 - return args, nil -} -func (ec *executionContext) field_Mutation_infra_deleteWorkerNode_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["clusterName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps.LastRecreatedAt(childComplexity), true + + case "Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps.role": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps.Role == nil { + break } - } - args["clusterName"] = arg0 - var arg1 string - if tmp, ok := rawArgs["edgeName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("edgeName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err + + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps.Role(childComplexity), true + + case "Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec.aws": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec.Aws == nil { + break } - } - args["edgeName"] = arg1 - var arg2 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err + + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec.Aws(childComplexity), true + + case "Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec.cloudProvider": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec.CloudProvider == nil { + break } - } - args["name"] = arg2 - return args, nil -} -func (ec *executionContext) field_Mutation_infra_updateBYOCCluster_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 entities.BYOCCluster - if tmp, ok := rawArgs["cluster"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cluster")) - arg0, err = ec.unmarshalNBYOCClusterIn2kloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐBYOCCluster(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec.CloudProvider(childComplexity), true + + case "Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec.iac": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec.Iac == nil { + break } - } - args["cluster"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_infra_updateCloudProvider_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 entities.CloudProvider - if tmp, ok := rawArgs["cloudProvider"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cloudProvider")) - arg0, err = ec.unmarshalNCloudProviderIn2kloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐCloudProvider(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec.Iac(childComplexity), true + + case "Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec.maxCount": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec.MaxCount == nil { + break } - } - args["cloudProvider"] = arg0 - var arg1 *entities.Secret - if tmp, ok := rawArgs["providerSecret"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("providerSecret")) - arg1, err = ec.unmarshalOSecretIn2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐSecret(ctx, tmp) - if err != nil { - return nil, err + + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec.MaxCount(childComplexity), true + + case "Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec.minCount": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec.MinCount == nil { + break } - } - args["providerSecret"] = arg1 - return args, nil -} -func (ec *executionContext) field_Mutation_infra_updateCluster_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 entities.Cluster - if tmp, ok := rawArgs["cluster"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cluster")) - arg0, err = ec.unmarshalNClusterIn2kloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐCluster(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec.MinCount(childComplexity), true + + case "Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec.nodeLabels": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec.NodeLabels == nil { + break } - } - args["cluster"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_infra_updateEdge_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 entities.Edge - if tmp, ok := rawArgs["edge"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("edge")) - arg0, err = ec.unmarshalNEdgeIn2kloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐEdge(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec.NodeLabels(childComplexity), true + + case "Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec.nodeTaints": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec.NodeTaints == nil { + break } - } - args["edge"] = arg0 - 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 + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec.NodeTaints(childComplexity), true + + case "Github__com___kloudlite___operator___apis___clusters___v1__NodeProps.lastRecreatedAt": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__NodeProps.LastRecreatedAt == nil { + break } - } - args["name"] = arg0 - return args, nil -} -func (ec *executionContext) field_Query_infra_checkNameAvailability_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 domain.ResType - if tmp, ok := rawArgs["resType"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("resType")) - arg0, err = ec.unmarshalNResType2kloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚐResType(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__NodeProps.LastRecreatedAt(childComplexity), true + + case "Github__com___kloudlite___operator___apis___clusters___v1__NodeSpec.nodepoolName": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__NodeSpec.NodepoolName == nil { + break } - } - args["resType"] = arg0 - var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err + + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__NodeSpec.NodepoolName(childComplexity), true + + case "Github__com___kloudlite___operator___apis___common____types__MinMaxFloat.max": + if e.complexity.Github__com___kloudlite___operator___apis___common____types__MinMaxFloat.Max == nil { + break } - } - args["name"] = arg1 - return args, nil -} -func (ec *executionContext) field_Query_infra_getBYOCCluster_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 + return e.complexity.Github__com___kloudlite___operator___apis___common____types__MinMaxFloat.Max(childComplexity), true + + case "Github__com___kloudlite___operator___apis___common____types__MinMaxFloat.min": + if e.complexity.Github__com___kloudlite___operator___apis___common____types__MinMaxFloat.Min == nil { + break } - } - args["name"] = arg0 - return args, nil -} -func (ec *executionContext) field_Query_infra_getCloudProvider_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 + return e.complexity.Github__com___kloudlite___operator___apis___common____types__MinMaxFloat.Min(childComplexity), true + + case "Github__com___kloudlite___operator___apis___common____types__SecretKeyRef.key": + if e.complexity.Github__com___kloudlite___operator___apis___common____types__SecretKeyRef.Key == nil { + break } - } - args["name"] = arg0 - return args, nil -} -func (ec *executionContext) field_Query_infra_getCluster_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 + return e.complexity.Github__com___kloudlite___operator___apis___common____types__SecretKeyRef.Key(childComplexity), true + + case "Github__com___kloudlite___operator___apis___common____types__SecretKeyRef.name": + if e.complexity.Github__com___kloudlite___operator___apis___common____types__SecretKeyRef.Name == nil { + break } - } - args["name"] = arg0 - return args, nil -} -func (ec *executionContext) field_Query_infra_getEdge_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["clusterName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.Github__com___kloudlite___operator___apis___common____types__SecretKeyRef.Name(childComplexity), true + + case "Github__com___kloudlite___operator___apis___common____types__SecretKeyRef.namespace": + if e.complexity.Github__com___kloudlite___operator___apis___common____types__SecretKeyRef.Namespace == nil { + break } - } - args["clusterName"] = arg0 - var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err + + return e.complexity.Github__com___kloudlite___operator___apis___common____types__SecretKeyRef.Namespace(childComplexity), true + + case "Github__com___kloudlite___operator___apis___common____types__SecretRef.name": + if e.complexity.Github__com___kloudlite___operator___apis___common____types__SecretRef.Name == nil { + break } - } - args["name"] = arg1 - return args, nil -} -func (ec *executionContext) field_Query_infra_getMasterNodes_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["clusterName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.Github__com___kloudlite___operator___apis___common____types__SecretRef.Name(childComplexity), true + + case "Github__com___kloudlite___operator___apis___common____types__SecretRef.namespace": + if e.complexity.Github__com___kloudlite___operator___apis___common____types__SecretRef.Namespace == nil { + break } - } - args["clusterName"] = arg0 - return args, nil -} -func (ec *executionContext) field_Query_infra_getNodePools_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["clusterName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.Github__com___kloudlite___operator___apis___common____types__SecretRef.Namespace(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec.msvcSpec": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec.MsvcSpec == nil { + break } - } - args["clusterName"] = arg0 - var arg1 string - if tmp, ok := rawArgs["edgeName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("edgeName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err + + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec.MsvcSpec(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec.targetNamespace": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec.TargetNamespace == nil { + break } - } - args["edgeName"] = arg1 - return args, nil -} -func (ec *executionContext) field_Query_infra_getWorkerNodes_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["clusterName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec.TargetNamespace(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec.chartName": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec.ChartName == nil { + break } - } - args["clusterName"] = arg0 - var arg1 string - if tmp, ok := rawArgs["edgeName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("edgeName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err + + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec.ChartName(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec.chartRepoURL": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec.ChartRepoURL == nil { + break } - } - args["edgeName"] = arg1 - return args, nil -} -func (ec *executionContext) field_Query_infra_listEdges_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["clusterName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec.ChartRepoURL(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec.chartVersion": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec.ChartVersion == nil { + break } - } - args["clusterName"] = arg0 - var arg1 *string - if tmp, ok := rawArgs["providerName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("providerName")) - arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err + + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec.ChartVersion(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec.jobVars": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec.JobVars == nil { + break } - } - args["providerName"] = arg1 - 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 + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec.JobVars(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec.postInstall": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec.PostInstall == nil { + break } - } - 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 + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec.PostInstall(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec.postUninstall": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec.PostUninstall == nil { + break } - } - args["includeDeprecated"] = arg0 - return args, nil -} -// endregion ***************************** args.gotpl ***************************** + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec.PostUninstall(childComplexity), true -// region ************************** directives.gotpl ************************** + case "Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec.preInstall": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec.PreInstall == nil { + break + } -// endregion ************************** directives.gotpl ************************** + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec.PreInstall(childComplexity), true -// region **************************** field.gotpl ***************************** + case "Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec.preUninstall": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec.PreUninstall == nil { + break + } -func (ec *executionContext) _BYOCCluster_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.BYOCCluster) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_BYOCCluster_metadata(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec.PreUninstall(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec.values": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec.Values == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ObjectMeta, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec.Values(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus.checks": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus.Checks == nil { + break } - return graphql.Null - } - res := resTmp.(v1.ObjectMeta) - fc.Result = res - return ec.marshalNMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_BYOCCluster_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "BYOCCluster", - 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_Metadata_name(ctx, field) - case "namespace": - return ec.fieldContext_Metadata_namespace(ctx, field) - case "labels": - return ec.fieldContext_Metadata_labels(ctx, field) - case "annotations": - return ec.fieldContext_Metadata_annotations(ctx, field) - case "creationTimestamp": - return ec.fieldContext_Metadata_creationTimestamp(ctx, field) - case "deletionTimestamp": - return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) - case "generation": - return ec.fieldContext_Metadata_generation(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus.Checks(childComplexity), true -func (ec *executionContext) _BYOCCluster_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.BYOCCluster) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_BYOCCluster_syncStatus(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus.isReady": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus.IsReady == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SyncStatus, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(types.SyncStatus) - fc.Result = res - return ec.marshalOSyncStatus2kloudliteᚗioᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_BYOCCluster_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "BYOCCluster", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "syncScheduledAt": - return ec.fieldContext_SyncStatus_syncScheduledAt(ctx, field) - case "lastSyncedAt": - return ec.fieldContext_SyncStatus_lastSyncedAt(ctx, field) - case "action": - return ec.fieldContext_SyncStatus_action(ctx, field) - case "generation": - return ec.fieldContext_SyncStatus_generation(ctx, field) - case "state": - return ec.fieldContext_SyncStatus_state(ctx, field) - case "error": - return ec.fieldContext_SyncStatus_error(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type SyncStatus", field.Name) - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus.IsReady(childComplexity), true -func (ec *executionContext) _BYOCCluster_spec(ctx context.Context, field graphql.CollectedField, obj *entities.BYOCCluster) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_BYOCCluster_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 + case "Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus.lastReadyGeneration": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus.LastReadyGeneration == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.BYOCCluster().Spec(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.BYOCClusterSpec) - fc.Result = res - return ec.marshalOBYOCClusterSpec2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐBYOCClusterSpec(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_BYOCCluster_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "BYOCCluster", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "provider": - return ec.fieldContext_BYOCClusterSpec_provider(ctx, field) - case "publicIps": - return ec.fieldContext_BYOCClusterSpec_publicIps(ctx, field) - case "region": - return ec.fieldContext_BYOCClusterSpec_region(ctx, field) - case "storageClasses": - return ec.fieldContext_BYOCClusterSpec_storageClasses(ctx, field) - case "accountName": - return ec.fieldContext_BYOCClusterSpec_accountName(ctx, field) - case "displayName": - return ec.fieldContext_BYOCClusterSpec_displayName(ctx, field) - case "incomingKafkaTopic": - return ec.fieldContext_BYOCClusterSpec_incomingKafkaTopic(ctx, field) - case "ingressClasses": - return ec.fieldContext_BYOCClusterSpec_ingressClasses(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type BYOCClusterSpec", field.Name) - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus.LastReadyGeneration(childComplexity), true -func (ec *executionContext) _BYOCCluster_status(ctx context.Context, field graphql.CollectedField, obj *entities.BYOCCluster) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_BYOCCluster_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 + case "Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus.lastReconcileTime": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus.LastReconcileTime == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Status, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(operator.Status) - fc.Result = res - return ec.marshalOStatus2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_BYOCCluster_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "BYOCCluster", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "isReady": - return ec.fieldContext_Status_isReady(ctx, field) - case "checks": - return ec.fieldContext_Status_checks(ctx, field) - case "displayVars": - return ec.fieldContext_Status_displayVars(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Status", field.Name) - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus.LastReconcileTime(childComplexity), true -func (ec *executionContext) _BYOCCluster_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.BYOCCluster) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_BYOCCluster_apiVersion(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus.message": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus.Message == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.APIVersion, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_BYOCCluster_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "BYOCCluster", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus.Message(childComplexity), true -func (ec *executionContext) _BYOCCluster_kind(ctx context.Context, field graphql.CollectedField, obj *entities.BYOCCluster) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_BYOCCluster_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 + case "Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus.releaseNotes": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus.ReleaseNotes == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_BYOCCluster_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "BYOCCluster", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus.ReleaseNotes(childComplexity), true -func (ec *executionContext) _BYOCClusterSpec_provider(ctx context.Context, field graphql.CollectedField, obj *model.BYOCClusterSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_BYOCClusterSpec_provider(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus.releaseStatus": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus.ReleaseStatus == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Provider, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus.ReleaseStatus(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus.resources": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus.Resources == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_BYOCClusterSpec_provider(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "BYOCClusterSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus.Resources(childComplexity), true -func (ec *executionContext) _BYOCClusterSpec_publicIps(ctx context.Context, field graphql.CollectedField, obj *model.BYOCClusterSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_BYOCClusterSpec_publicIps(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Github__com___kloudlite___operator___apis___crds___v1__JobVars.affinity": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__JobVars.Affinity == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.PublicIps, nil - }) - 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_BYOCClusterSpec_publicIps(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "BYOCClusterSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__JobVars.Affinity(childComplexity), true -func (ec *executionContext) _BYOCClusterSpec_region(ctx context.Context, field graphql.CollectedField, obj *model.BYOCClusterSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_BYOCClusterSpec_region(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Github__com___kloudlite___operator___apis___crds___v1__JobVars.backOffLimit": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__JobVars.BackOffLimit == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Region, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__JobVars.BackOffLimit(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__JobVars.nodeSelector": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__JobVars.NodeSelector == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_BYOCClusterSpec_region(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "BYOCClusterSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__JobVars.NodeSelector(childComplexity), true -func (ec *executionContext) _BYOCClusterSpec_storageClasses(ctx context.Context, field graphql.CollectedField, obj *model.BYOCClusterSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_BYOCClusterSpec_storageClasses(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Github__com___kloudlite___operator___apis___crds___v1__JobVars.tolerations": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__JobVars.Tolerations == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.StorageClasses, nil - }) - 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_BYOCClusterSpec_storageClasses(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "BYOCClusterSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__JobVars.Tolerations(childComplexity), true -func (ec *executionContext) _BYOCClusterSpec_accountName(ctx context.Context, field graphql.CollectedField, obj *model.BYOCClusterSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_BYOCClusterSpec_accountName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec.serviceTemplate": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec.ServiceTemplate == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.AccountName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec.ServiceTemplate(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate.apiVersion": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate.APIVersion == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_BYOCClusterSpec_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "BYOCClusterSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate.APIVersion(childComplexity), true -func (ec *executionContext) _BYOCClusterSpec_displayName(ctx context.Context, field graphql.CollectedField, obj *model.BYOCClusterSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_BYOCClusterSpec_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 + case "Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate.kind": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate.Kind == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DisplayName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_BYOCClusterSpec_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "BYOCClusterSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate.Kind(childComplexity), true -func (ec *executionContext) _BYOCClusterSpec_incomingKafkaTopic(ctx context.Context, field graphql.CollectedField, obj *model.BYOCClusterSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_BYOCClusterSpec_incomingKafkaTopic(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate.spec": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate.Spec == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.IncomingKafkaTopic, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate.Spec(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__Check.generation": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Generation == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_BYOCClusterSpec_incomingKafkaTopic(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "BYOCClusterSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Generation(childComplexity), true -func (ec *executionContext) _BYOCClusterSpec_ingressClasses(ctx context.Context, field graphql.CollectedField, obj *model.BYOCClusterSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_BYOCClusterSpec_ingressClasses(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Github__com___kloudlite___operator___pkg___operator__Check.message": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Message == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.IngressClasses, nil - }) - 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_BYOCClusterSpec_ingressClasses(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "BYOCClusterSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Message(childComplexity), true -func (ec *executionContext) _Check_status(ctx context.Context, field graphql.CollectedField, obj *operator.Check) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Check_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 + case "Github__com___kloudlite___operator___pkg___operator__Check.status": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Status == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Status, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalOBoolean2bool(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Check_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Check", - 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 -} + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Status(childComplexity), true -func (ec *executionContext) _Check_message(ctx context.Context, field graphql.CollectedField, obj *operator.Check) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Check_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 + case "Github__com___kloudlite___operator___pkg___operator__ResourceRef.apiVersion": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.APIVersion == nil { + break } - }() - 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.marshalOString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Check_message(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Check", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.APIVersion(childComplexity), true -func (ec *executionContext) _Check_generation(ctx context.Context, field graphql.CollectedField, obj *operator.Check) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Check_generation(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Github__com___kloudlite___operator___pkg___operator__ResourceRef.kind": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.Kind == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Generation, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(int64) - fc.Result = res - return ec.marshalOInt2int64(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Check_generation(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Check", - 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 -} + return e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.Kind(childComplexity), true -func (ec *executionContext) _CheckNameAvailabilityOutput_result(ctx context.Context, field graphql.CollectedField, obj *domain.CheckNameAvailabilityOutput) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_CheckNameAvailabilityOutput_result(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Github__com___kloudlite___operator___pkg___operator__ResourceRef.name": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.Name == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Result, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.Name(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__ResourceRef.namespace": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.Namespace == nil { + break } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_CheckNameAvailabilityOutput_result(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "CheckNameAvailabilityOutput", - 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 -} + return e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.Namespace(childComplexity), true -func (ec *executionContext) _CheckNameAvailabilityOutput_suggestedNames(ctx context.Context, field graphql.CollectedField, obj *domain.CheckNameAvailabilityOutput) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_CheckNameAvailabilityOutput_suggestedNames(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Github__com___kloudlite___operator___pkg___operator__Status.checks": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.Checks == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SuggestedNames, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.Checks(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__Status.isReady": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.IsReady == nil { + break } - return graphql.Null - } - res := resTmp.([]string) - fc.Result = res - return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_CheckNameAvailabilityOutput_suggestedNames(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "CheckNameAvailabilityOutput", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.IsReady(childComplexity), true -func (ec *executionContext) _CloudProvider_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.CloudProvider) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_CloudProvider_apiVersion(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Github__com___kloudlite___operator___pkg___operator__Status.lastReadyGeneration": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.LastReadyGeneration == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.APIVersion, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_CloudProvider_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "CloudProvider", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.LastReadyGeneration(childComplexity), true -func (ec *executionContext) _CloudProvider_kind(ctx context.Context, field graphql.CollectedField, obj *entities.CloudProvider) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_CloudProvider_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 + case "Github__com___kloudlite___operator___pkg___operator__Status.lastReconcileTime": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.LastReconcileTime == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_CloudProvider_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "CloudProvider", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.LastReconcileTime(childComplexity), true -func (ec *executionContext) _CloudProvider_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.CloudProvider) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_CloudProvider_metadata(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Github__com___kloudlite___operator___pkg___operator__Status.message": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.Message == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ObjectMeta, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.Message(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__Status.resources": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.Resources == nil { + break } - return graphql.Null - } - res := resTmp.(v1.ObjectMeta) - fc.Result = res - return ec.marshalNMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_CloudProvider_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "CloudProvider", - 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_Metadata_name(ctx, field) - case "namespace": - return ec.fieldContext_Metadata_namespace(ctx, field) - case "labels": - return ec.fieldContext_Metadata_labels(ctx, field) - case "annotations": - return ec.fieldContext_Metadata_annotations(ctx, field) - case "creationTimestamp": - return ec.fieldContext_Metadata_creationTimestamp(ctx, field) - case "deletionTimestamp": - return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) - case "generation": - return ec.fieldContext_Metadata_generation(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.Resources(childComplexity), true -func (ec *executionContext) _CloudProvider_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.CloudProvider) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_CloudProvider_syncStatus(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Github__com___kloudlite___operator___pkg___raw____json__RawJson.RawMessage": + if e.complexity.Github__com___kloudlite___operator___pkg___raw____json__RawJson.RawMessage == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SyncStatus, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(types.SyncStatus) - fc.Result = res - return ec.marshalOSyncStatus2kloudliteᚗioᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_CloudProvider_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "CloudProvider", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "syncScheduledAt": - return ec.fieldContext_SyncStatus_syncScheduledAt(ctx, field) - case "lastSyncedAt": - return ec.fieldContext_SyncStatus_lastSyncedAt(ctx, field) - case "action": - return ec.fieldContext_SyncStatus_action(ctx, field) - case "generation": - return ec.fieldContext_SyncStatus_generation(ctx, field) - case "state": - return ec.fieldContext_SyncStatus_state(ctx, field) - case "error": - return ec.fieldContext_SyncStatus_error(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type SyncStatus", field.Name) - }, - } - return fc, nil -} + return e.complexity.Github__com___kloudlite___operator___pkg___raw____json__RawJson.RawMessage(childComplexity), true -func (ec *executionContext) _CloudProvider_spec(ctx context.Context, field graphql.CollectedField, obj *entities.CloudProvider) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_CloudProvider_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 + case "HelmRelease.apiVersion": + if e.complexity.HelmRelease.APIVersion == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.CloudProvider().Spec(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.CloudProviderSpec) - fc.Result = res - return ec.marshalOCloudProviderSpec2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐCloudProviderSpec(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_CloudProvider_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "CloudProvider", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "display_name": - return ec.fieldContext_CloudProviderSpec_display_name(ctx, field) - case "provider": - return ec.fieldContext_CloudProviderSpec_provider(ctx, field) - case "providerSecret": - return ec.fieldContext_CloudProviderSpec_providerSecret(ctx, field) - case "accountName": - return ec.fieldContext_CloudProviderSpec_accountName(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type CloudProviderSpec", field.Name) - }, - } - return fc, nil -} + return e.complexity.HelmRelease.APIVersion(childComplexity), true -func (ec *executionContext) _CloudProvider_status(ctx context.Context, field graphql.CollectedField, obj *entities.CloudProvider) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_CloudProvider_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 + case "HelmRelease.accountName": + if e.complexity.HelmRelease.AccountName == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.CloudProvider().Status(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*operator.Status) - fc.Result = res - return ec.marshalOStatus2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_CloudProvider_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "CloudProvider", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "isReady": - return ec.fieldContext_Status_isReady(ctx, field) - case "checks": - return ec.fieldContext_Status_checks(ctx, field) - case "displayVars": - return ec.fieldContext_Status_displayVars(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Status", field.Name) - }, - } - return fc, nil -} + return e.complexity.HelmRelease.AccountName(childComplexity), true -func (ec *executionContext) _CloudProviderSpec_display_name(ctx context.Context, field graphql.CollectedField, obj *model.CloudProviderSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_CloudProviderSpec_display_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 + case "HelmRelease.clusterName": + if e.complexity.HelmRelease.ClusterName == nil { + break } - }() - 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 e.complexity.HelmRelease.ClusterName(childComplexity), true + + case "HelmRelease.createdBy": + if e.complexity.HelmRelease.CreatedBy == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_CloudProviderSpec_display_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "CloudProviderSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.HelmRelease.CreatedBy(childComplexity), true -func (ec *executionContext) _CloudProviderSpec_provider(ctx context.Context, field graphql.CollectedField, obj *model.CloudProviderSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_CloudProviderSpec_provider(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "HelmRelease.creationTime": + if e.complexity.HelmRelease.CreationTime == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Provider, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.HelmRelease.CreationTime(childComplexity), true + + case "HelmRelease.displayName": + if e.complexity.HelmRelease.DisplayName == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_CloudProviderSpec_provider(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "CloudProviderSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.HelmRelease.DisplayName(childComplexity), true -func (ec *executionContext) _CloudProviderSpec_providerSecret(ctx context.Context, field graphql.CollectedField, obj *model.CloudProviderSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_CloudProviderSpec_providerSecret(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "HelmRelease.id": + if e.complexity.HelmRelease.ID == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ProviderSecret, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.HelmRelease.ID(childComplexity), true + + case "HelmRelease.kind": + if e.complexity.HelmRelease.Kind == nil { + break } - return graphql.Null - } - res := resTmp.(*model.CloudProviderSpecProviderSecret) - fc.Result = res - return ec.marshalNCloudProviderSpecProviderSecret2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐCloudProviderSpecProviderSecret(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_CloudProviderSpec_providerSecret(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "CloudProviderSpec", - 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_CloudProviderSpecProviderSecret_name(ctx, field) - case "namespace": - return ec.fieldContext_CloudProviderSpecProviderSecret_namespace(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type CloudProviderSpecProviderSecret", field.Name) - }, - } - return fc, nil -} + return e.complexity.HelmRelease.Kind(childComplexity), true -func (ec *executionContext) _CloudProviderSpec_accountName(ctx context.Context, field graphql.CollectedField, obj *model.CloudProviderSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_CloudProviderSpec_accountName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "HelmRelease.lastUpdatedBy": + if e.complexity.HelmRelease.LastUpdatedBy == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.AccountName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.HelmRelease.LastUpdatedBy(childComplexity), true + + case "HelmRelease.markedForDeletion": + if e.complexity.HelmRelease.MarkedForDeletion == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_CloudProviderSpec_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "CloudProviderSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.HelmRelease.MarkedForDeletion(childComplexity), true -func (ec *executionContext) _CloudProviderSpecProviderSecret_name(ctx context.Context, field graphql.CollectedField, obj *model.CloudProviderSpecProviderSecret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_CloudProviderSpecProviderSecret_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 + case "HelmRelease.metadata": + if e.complexity.HelmRelease.ObjectMeta == nil { + break } - }() - 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 e.complexity.HelmRelease.ObjectMeta(childComplexity), true + + case "HelmRelease.recordVersion": + if e.complexity.HelmRelease.RecordVersion == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_CloudProviderSpecProviderSecret_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "CloudProviderSpecProviderSecret", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.HelmRelease.RecordVersion(childComplexity), true -func (ec *executionContext) _CloudProviderSpecProviderSecret_namespace(ctx context.Context, field graphql.CollectedField, obj *model.CloudProviderSpecProviderSecret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_CloudProviderSpecProviderSecret_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 + case "HelmRelease.spec": + if e.complexity.HelmRelease.Spec == nil { + break } - }() - 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 e.complexity.HelmRelease.Spec(childComplexity), true + + case "HelmRelease.status": + if e.complexity.HelmRelease.Status == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_CloudProviderSpecProviderSecret_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "CloudProviderSpecProviderSecret", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.HelmRelease.Status(childComplexity), true -func (ec *executionContext) _Cluster_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Cluster) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Cluster_apiVersion(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "HelmRelease.syncStatus": + if e.complexity.HelmRelease.SyncStatus == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.APIVersion, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Cluster_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Cluster", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.HelmRelease.SyncStatus(childComplexity), true -func (ec *executionContext) _Cluster_kind(ctx context.Context, field graphql.CollectedField, obj *entities.Cluster) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Cluster_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 + case "HelmRelease.updateTime": + if e.complexity.HelmRelease.UpdateTime == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Cluster_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Cluster", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.HelmRelease.UpdateTime(childComplexity), true -func (ec *executionContext) _Cluster_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.Cluster) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Cluster_metadata(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "HelmReleaseEdge.cursor": + if e.complexity.HelmReleaseEdge.Cursor == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ObjectMeta, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.HelmReleaseEdge.Cursor(childComplexity), true + + case "HelmReleaseEdge.node": + if e.complexity.HelmReleaseEdge.Node == nil { + break } - return graphql.Null - } - res := resTmp.(v1.ObjectMeta) - fc.Result = res - return ec.marshalNMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Cluster_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Cluster", - 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_Metadata_name(ctx, field) - case "namespace": - return ec.fieldContext_Metadata_namespace(ctx, field) - case "labels": - return ec.fieldContext_Metadata_labels(ctx, field) - case "annotations": - return ec.fieldContext_Metadata_annotations(ctx, field) - case "creationTimestamp": - return ec.fieldContext_Metadata_creationTimestamp(ctx, field) - case "deletionTimestamp": - return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) - case "generation": - return ec.fieldContext_Metadata_generation(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) - }, - } - return fc, nil -} + return e.complexity.HelmReleaseEdge.Node(childComplexity), true -func (ec *executionContext) _Cluster_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.Cluster) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Cluster_syncStatus(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "HelmReleasePaginatedRecords.edges": + if e.complexity.HelmReleasePaginatedRecords.Edges == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SyncStatus, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(types.SyncStatus) - fc.Result = res - return ec.marshalOSyncStatus2kloudliteᚗioᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Cluster_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Cluster", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "syncScheduledAt": - return ec.fieldContext_SyncStatus_syncScheduledAt(ctx, field) - case "lastSyncedAt": - return ec.fieldContext_SyncStatus_lastSyncedAt(ctx, field) - case "action": - return ec.fieldContext_SyncStatus_action(ctx, field) - case "generation": - return ec.fieldContext_SyncStatus_generation(ctx, field) - case "state": - return ec.fieldContext_SyncStatus_state(ctx, field) - case "error": - return ec.fieldContext_SyncStatus_error(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type SyncStatus", field.Name) - }, - } - return fc, nil -} + return e.complexity.HelmReleasePaginatedRecords.Edges(childComplexity), true -func (ec *executionContext) _Cluster_spec(ctx context.Context, field graphql.CollectedField, obj *entities.Cluster) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Cluster_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 + case "HelmReleasePaginatedRecords.pageInfo": + if e.complexity.HelmReleasePaginatedRecords.PageInfo == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Cluster().Spec(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.ClusterSpec) - fc.Result = res - return ec.marshalOClusterSpec2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐClusterSpec(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Cluster_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Cluster", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "provider": - return ec.fieldContext_ClusterSpec_provider(ctx, field) - case "providerName": - return ec.fieldContext_ClusterSpec_providerName(ctx, field) - case "region": - return ec.fieldContext_ClusterSpec_region(ctx, field) - case "accountName": - return ec.fieldContext_ClusterSpec_accountName(ctx, field) - case "config": - return ec.fieldContext_ClusterSpec_config(ctx, field) - case "count": - return ec.fieldContext_ClusterSpec_count(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ClusterSpec", field.Name) - }, - } - return fc, nil -} + return e.complexity.HelmReleasePaginatedRecords.PageInfo(childComplexity), true -func (ec *executionContext) _Cluster_status(ctx context.Context, field graphql.CollectedField, obj *entities.Cluster) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Cluster_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 + case "HelmReleasePaginatedRecords.totalCount": + if e.complexity.HelmReleasePaginatedRecords.TotalCount == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Cluster().Status(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*operator.Status) - fc.Result = res - return ec.marshalOStatus2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Cluster_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Cluster", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "isReady": - return ec.fieldContext_Status_isReady(ctx, field) - case "checks": - return ec.fieldContext_Status_checks(ctx, field) - case "displayVars": - return ec.fieldContext_Status_displayVars(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Status", field.Name) - }, - } - return fc, nil -} + return e.complexity.HelmReleasePaginatedRecords.TotalCount(childComplexity), true -func (ec *executionContext) _ClusterSpec_provider(ctx context.Context, field graphql.CollectedField, obj *model.ClusterSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ClusterSpec_provider(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource.fsType": + if e.complexity.K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource.FsType == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Provider, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource.FsType(childComplexity), true + + case "K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource.partition": + if e.complexity.K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource.Partition == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_ClusterSpec_provider(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ClusterSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource.Partition(childComplexity), true -func (ec *executionContext) _ClusterSpec_providerName(ctx context.Context, field graphql.CollectedField, obj *model.ClusterSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ClusterSpec_providerName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource.readOnly": + if e.complexity.K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource.ReadOnly == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ProviderName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource.ReadOnly(childComplexity), true + + case "K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource.volumeID": + if e.complexity.K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource.VolumeID == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_ClusterSpec_providerName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ClusterSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource.VolumeID(childComplexity), true -func (ec *executionContext) _ClusterSpec_region(ctx context.Context, field graphql.CollectedField, obj *model.ClusterSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ClusterSpec_region(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__Affinity.nodeAffinity": + if e.complexity.K8s__io___api___core___v1__Affinity.NodeAffinity == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Region, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__Affinity.NodeAffinity(childComplexity), true + + case "K8s__io___api___core___v1__Affinity.podAffinity": + if e.complexity.K8s__io___api___core___v1__Affinity.PodAffinity == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_ClusterSpec_region(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ClusterSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__Affinity.PodAffinity(childComplexity), true -func (ec *executionContext) _ClusterSpec_accountName(ctx context.Context, field graphql.CollectedField, obj *model.ClusterSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ClusterSpec_accountName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__Affinity.podAntiAffinity": + if e.complexity.K8s__io___api___core___v1__Affinity.PodAntiAffinity == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.AccountName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__Affinity.PodAntiAffinity(childComplexity), true + + case "K8s__io___api___core___v1__AzureDiskVolumeSource.cachingMode": + if e.complexity.K8s__io___api___core___v1__AzureDiskVolumeSource.CachingMode == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_ClusterSpec_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ClusterSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__AzureDiskVolumeSource.CachingMode(childComplexity), true -func (ec *executionContext) _ClusterSpec_config(ctx context.Context, field graphql.CollectedField, obj *model.ClusterSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ClusterSpec_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 + case "K8s__io___api___core___v1__AzureDiskVolumeSource.diskName": + if e.complexity.K8s__io___api___core___v1__AzureDiskVolumeSource.DiskName == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Config, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__AzureDiskVolumeSource.DiskName(childComplexity), true + + case "K8s__io___api___core___v1__AzureDiskVolumeSource.diskURI": + if e.complexity.K8s__io___api___core___v1__AzureDiskVolumeSource.DiskURI == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_ClusterSpec_config(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ClusterSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__AzureDiskVolumeSource.DiskURI(childComplexity), true -func (ec *executionContext) _ClusterSpec_count(ctx context.Context, field graphql.CollectedField, obj *model.ClusterSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ClusterSpec_count(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__AzureDiskVolumeSource.fsType": + if e.complexity.K8s__io___api___core___v1__AzureDiskVolumeSource.FsType == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Count, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__AzureDiskVolumeSource.FsType(childComplexity), true + + case "K8s__io___api___core___v1__AzureDiskVolumeSource.kind": + if e.complexity.K8s__io___api___core___v1__AzureDiskVolumeSource.Kind == nil { + break } - return graphql.Null - } - res := resTmp.(int) - fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_ClusterSpec_count(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ClusterSpec", - 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 -} + return e.complexity.K8s__io___api___core___v1__AzureDiskVolumeSource.Kind(childComplexity), true -func (ec *executionContext) _Edge_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Edge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Edge_apiVersion(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__AzureDiskVolumeSource.readOnly": + if e.complexity.K8s__io___api___core___v1__AzureDiskVolumeSource.ReadOnly == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.APIVersion, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Edge_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Edge", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__AzureDiskVolumeSource.ReadOnly(childComplexity), true -func (ec *executionContext) _Edge_kind(ctx context.Context, field graphql.CollectedField, obj *entities.Edge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Edge_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 + case "K8s__io___api___core___v1__AzureFilePersistentVolumeSource.readOnly": + if e.complexity.K8s__io___api___core___v1__AzureFilePersistentVolumeSource.ReadOnly == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Edge_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Edge", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__AzureFilePersistentVolumeSource.ReadOnly(childComplexity), true -func (ec *executionContext) _Edge_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.Edge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Edge_metadata(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__AzureFilePersistentVolumeSource.secretName": + if e.complexity.K8s__io___api___core___v1__AzureFilePersistentVolumeSource.SecretName == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ObjectMeta, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__AzureFilePersistentVolumeSource.SecretName(childComplexity), true + + case "K8s__io___api___core___v1__AzureFilePersistentVolumeSource.secretNamespace": + if e.complexity.K8s__io___api___core___v1__AzureFilePersistentVolumeSource.SecretNamespace == nil { + break } - return graphql.Null - } - res := resTmp.(v1.ObjectMeta) - fc.Result = res - return ec.marshalNMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Edge_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Edge", - 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_Metadata_name(ctx, field) - case "namespace": - return ec.fieldContext_Metadata_namespace(ctx, field) - case "labels": - return ec.fieldContext_Metadata_labels(ctx, field) - case "annotations": - return ec.fieldContext_Metadata_annotations(ctx, field) - case "creationTimestamp": - return ec.fieldContext_Metadata_creationTimestamp(ctx, field) - case "deletionTimestamp": - return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) - case "generation": - return ec.fieldContext_Metadata_generation(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__AzureFilePersistentVolumeSource.SecretNamespace(childComplexity), true -func (ec *executionContext) _Edge_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.Edge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Edge_syncStatus(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__AzureFilePersistentVolumeSource.shareName": + if e.complexity.K8s__io___api___core___v1__AzureFilePersistentVolumeSource.ShareName == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SyncStatus, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(types.SyncStatus) - fc.Result = res - return ec.marshalOSyncStatus2kloudliteᚗioᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Edge_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Edge", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "syncScheduledAt": - return ec.fieldContext_SyncStatus_syncScheduledAt(ctx, field) - case "lastSyncedAt": - return ec.fieldContext_SyncStatus_lastSyncedAt(ctx, field) - case "action": - return ec.fieldContext_SyncStatus_action(ctx, field) - case "generation": - return ec.fieldContext_SyncStatus_generation(ctx, field) - case "state": - return ec.fieldContext_SyncStatus_state(ctx, field) - case "error": - return ec.fieldContext_SyncStatus_error(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type SyncStatus", field.Name) - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__AzureFilePersistentVolumeSource.ShareName(childComplexity), true -func (ec *executionContext) _Edge_spec(ctx context.Context, field graphql.CollectedField, obj *entities.Edge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Edge_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 + case "K8s__io___api___core___v1__CSIPersistentVolumeSource.controllerExpandSecretRef": + if e.complexity.K8s__io___api___core___v1__CSIPersistentVolumeSource.ControllerExpandSecretRef == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Edge().Spec(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.EdgeSpec) - fc.Result = res - return ec.marshalOEdgeSpec2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐEdgeSpec(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Edge_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Edge", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "accountName": - return ec.fieldContext_EdgeSpec_accountName(ctx, field) - case "clusterName": - return ec.fieldContext_EdgeSpec_clusterName(ctx, field) - case "pools": - return ec.fieldContext_EdgeSpec_pools(ctx, field) - case "provider": - return ec.fieldContext_EdgeSpec_provider(ctx, field) - case "providerName": - return ec.fieldContext_EdgeSpec_providerName(ctx, field) - case "region": - return ec.fieldContext_EdgeSpec_region(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type EdgeSpec", field.Name) - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__CSIPersistentVolumeSource.ControllerExpandSecretRef(childComplexity), true -func (ec *executionContext) _Edge_status(ctx context.Context, field graphql.CollectedField, obj *entities.Edge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Edge_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 + case "K8s__io___api___core___v1__CSIPersistentVolumeSource.controllerPublishSecretRef": + if e.complexity.K8s__io___api___core___v1__CSIPersistentVolumeSource.ControllerPublishSecretRef == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Edge().Status(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*operator.Status) - fc.Result = res - return ec.marshalOStatus2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Edge_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Edge", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "isReady": - return ec.fieldContext_Status_isReady(ctx, field) - case "checks": - return ec.fieldContext_Status_checks(ctx, field) - case "displayVars": - return ec.fieldContext_Status_displayVars(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Status", field.Name) - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__CSIPersistentVolumeSource.ControllerPublishSecretRef(childComplexity), true -func (ec *executionContext) _EdgeSpec_accountName(ctx context.Context, field graphql.CollectedField, obj *model.EdgeSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_EdgeSpec_accountName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.AccountName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + case "K8s__io___api___core___v1__CSIPersistentVolumeSource.driver": + if e.complexity.K8s__io___api___core___v1__CSIPersistentVolumeSource.Driver == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_EdgeSpec_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "EdgeSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__CSIPersistentVolumeSource.Driver(childComplexity), true -func (ec *executionContext) _EdgeSpec_clusterName(ctx context.Context, field graphql.CollectedField, obj *model.EdgeSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_EdgeSpec_clusterName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__CSIPersistentVolumeSource.fsType": + if e.complexity.K8s__io___api___core___v1__CSIPersistentVolumeSource.FsType == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__CSIPersistentVolumeSource.FsType(childComplexity), true + + case "K8s__io___api___core___v1__CSIPersistentVolumeSource.nodeExpandSecretRef": + if e.complexity.K8s__io___api___core___v1__CSIPersistentVolumeSource.NodeExpandSecretRef == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_EdgeSpec_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "EdgeSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__CSIPersistentVolumeSource.NodeExpandSecretRef(childComplexity), true -func (ec *executionContext) _EdgeSpec_pools(ctx context.Context, field graphql.CollectedField, obj *model.EdgeSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_EdgeSpec_pools(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__CSIPersistentVolumeSource.nodePublishSecretRef": + if e.complexity.K8s__io___api___core___v1__CSIPersistentVolumeSource.NodePublishSecretRef == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Pools, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*model.EdgeSpecPools) - fc.Result = res - return ec.marshalOEdgeSpecPools2ᚕᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐEdgeSpecPools(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_EdgeSpec_pools(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "EdgeSpec", - 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_EdgeSpecPools_name(ctx, field) - case "config": - return ec.fieldContext_EdgeSpecPools_config(ctx, field) - case "max": - return ec.fieldContext_EdgeSpecPools_max(ctx, field) - case "min": - return ec.fieldContext_EdgeSpecPools_min(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type EdgeSpecPools", field.Name) - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__CSIPersistentVolumeSource.NodePublishSecretRef(childComplexity), true -func (ec *executionContext) _EdgeSpec_provider(ctx context.Context, field graphql.CollectedField, obj *model.EdgeSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_EdgeSpec_provider(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__CSIPersistentVolumeSource.nodeStageSecretRef": + if e.complexity.K8s__io___api___core___v1__CSIPersistentVolumeSource.NodeStageSecretRef == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Provider, nil - }) - 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_EdgeSpec_provider(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "EdgeSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__CSIPersistentVolumeSource.NodeStageSecretRef(childComplexity), true -func (ec *executionContext) _EdgeSpec_providerName(ctx context.Context, field graphql.CollectedField, obj *model.EdgeSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_EdgeSpec_providerName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__CSIPersistentVolumeSource.readOnly": + if e.complexity.K8s__io___api___core___v1__CSIPersistentVolumeSource.ReadOnly == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ProviderName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__CSIPersistentVolumeSource.ReadOnly(childComplexity), true + + case "K8s__io___api___core___v1__CSIPersistentVolumeSource.volumeAttributes": + if e.complexity.K8s__io___api___core___v1__CSIPersistentVolumeSource.VolumeAttributes == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_EdgeSpec_providerName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "EdgeSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__CSIPersistentVolumeSource.VolumeAttributes(childComplexity), true -func (ec *executionContext) _EdgeSpec_region(ctx context.Context, field graphql.CollectedField, obj *model.EdgeSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_EdgeSpec_region(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__CSIPersistentVolumeSource.volumeHandle": + if e.complexity.K8s__io___api___core___v1__CSIPersistentVolumeSource.VolumeHandle == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Region, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__CSIPersistentVolumeSource.VolumeHandle(childComplexity), true + + case "K8s__io___api___core___v1__CephFSPersistentVolumeSource.monitors": + if e.complexity.K8s__io___api___core___v1__CephFSPersistentVolumeSource.Monitors == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_EdgeSpec_region(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "EdgeSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__CephFSPersistentVolumeSource.Monitors(childComplexity), true -func (ec *executionContext) _EdgeSpecPools_name(ctx context.Context, field graphql.CollectedField, obj *model.EdgeSpecPools) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_EdgeSpecPools_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 + case "K8s__io___api___core___v1__CephFSPersistentVolumeSource.path": + if e.complexity.K8s__io___api___core___v1__CephFSPersistentVolumeSource.Path == nil { + break } - }() - 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 e.complexity.K8s__io___api___core___v1__CephFSPersistentVolumeSource.Path(childComplexity), true + + case "K8s__io___api___core___v1__CephFSPersistentVolumeSource.readOnly": + if e.complexity.K8s__io___api___core___v1__CephFSPersistentVolumeSource.ReadOnly == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_EdgeSpecPools_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "EdgeSpecPools", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__CephFSPersistentVolumeSource.ReadOnly(childComplexity), true -func (ec *executionContext) _EdgeSpecPools_config(ctx context.Context, field graphql.CollectedField, obj *model.EdgeSpecPools) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_EdgeSpecPools_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 + case "K8s__io___api___core___v1__CephFSPersistentVolumeSource.secretFile": + if e.complexity.K8s__io___api___core___v1__CephFSPersistentVolumeSource.SecretFile == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Config, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__CephFSPersistentVolumeSource.SecretFile(childComplexity), true + + case "K8s__io___api___core___v1__CephFSPersistentVolumeSource.secretRef": + if e.complexity.K8s__io___api___core___v1__CephFSPersistentVolumeSource.SecretRef == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_EdgeSpecPools_config(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "EdgeSpecPools", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__CephFSPersistentVolumeSource.SecretRef(childComplexity), true -func (ec *executionContext) _EdgeSpecPools_max(ctx context.Context, field graphql.CollectedField, obj *model.EdgeSpecPools) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_EdgeSpecPools_max(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__CephFSPersistentVolumeSource.user": + if e.complexity.K8s__io___api___core___v1__CephFSPersistentVolumeSource.User == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Max, 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_EdgeSpecPools_max(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "EdgeSpecPools", - 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 -} + return e.complexity.K8s__io___api___core___v1__CephFSPersistentVolumeSource.User(childComplexity), true -func (ec *executionContext) _EdgeSpecPools_min(ctx context.Context, field graphql.CollectedField, obj *model.EdgeSpecPools) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_EdgeSpecPools_min(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__CinderPersistentVolumeSource.fsType": + if e.complexity.K8s__io___api___core___v1__CinderPersistentVolumeSource.FsType == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Min, 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_EdgeSpecPools_min(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "EdgeSpecPools", - 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 -} + return e.complexity.K8s__io___api___core___v1__CinderPersistentVolumeSource.FsType(childComplexity), true -func (ec *executionContext) _MasterNode_status(ctx context.Context, field graphql.CollectedField, obj *entities.MasterNode) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_MasterNode_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 + case "K8s__io___api___core___v1__CinderPersistentVolumeSource.readOnly": + if e.complexity.K8s__io___api___core___v1__CinderPersistentVolumeSource.ReadOnly == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.MasterNode().Status(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*operator.Status) - fc.Result = res - return ec.marshalOStatus2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_MasterNode_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MasterNode", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "isReady": - return ec.fieldContext_Status_isReady(ctx, field) - case "checks": - return ec.fieldContext_Status_checks(ctx, field) - case "displayVars": - return ec.fieldContext_Status_displayVars(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Status", field.Name) - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__CinderPersistentVolumeSource.ReadOnly(childComplexity), true -func (ec *executionContext) _MasterNode_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.MasterNode) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_MasterNode_apiVersion(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__CinderPersistentVolumeSource.secretRef": + if e.complexity.K8s__io___api___core___v1__CinderPersistentVolumeSource.SecretRef == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.APIVersion, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_MasterNode_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MasterNode", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__CinderPersistentVolumeSource.SecretRef(childComplexity), true -func (ec *executionContext) _MasterNode_kind(ctx context.Context, field graphql.CollectedField, obj *entities.MasterNode) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_MasterNode_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 + case "K8s__io___api___core___v1__CinderPersistentVolumeSource.volumeID": + if e.complexity.K8s__io___api___core___v1__CinderPersistentVolumeSource.VolumeID == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_MasterNode_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MasterNode", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__CinderPersistentVolumeSource.VolumeID(childComplexity), true -func (ec *executionContext) _MasterNode_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.MasterNode) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_MasterNode_metadata(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__FCVolumeSource.fsType": + if e.complexity.K8s__io___api___core___v1__FCVolumeSource.FsType == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ObjectMeta, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__FCVolumeSource.FsType(childComplexity), true + + case "K8s__io___api___core___v1__FCVolumeSource.lun": + if e.complexity.K8s__io___api___core___v1__FCVolumeSource.Lun == nil { + break } - return graphql.Null - } - res := resTmp.(v1.ObjectMeta) - fc.Result = res - return ec.marshalNMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_MasterNode_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MasterNode", - 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_Metadata_name(ctx, field) - case "namespace": - return ec.fieldContext_Metadata_namespace(ctx, field) - case "labels": - return ec.fieldContext_Metadata_labels(ctx, field) - case "annotations": - return ec.fieldContext_Metadata_annotations(ctx, field) - case "creationTimestamp": - return ec.fieldContext_Metadata_creationTimestamp(ctx, field) - case "deletionTimestamp": - return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) - case "generation": - return ec.fieldContext_Metadata_generation(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__FCVolumeSource.Lun(childComplexity), true -func (ec *executionContext) _MasterNode_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.MasterNode) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_MasterNode_syncStatus(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__FCVolumeSource.readOnly": + if e.complexity.K8s__io___api___core___v1__FCVolumeSource.ReadOnly == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SyncStatus, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(types.SyncStatus) - fc.Result = res - return ec.marshalOSyncStatus2kloudliteᚗioᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_MasterNode_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MasterNode", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "syncScheduledAt": - return ec.fieldContext_SyncStatus_syncScheduledAt(ctx, field) - case "lastSyncedAt": - return ec.fieldContext_SyncStatus_lastSyncedAt(ctx, field) - case "action": - return ec.fieldContext_SyncStatus_action(ctx, field) - case "generation": - return ec.fieldContext_SyncStatus_generation(ctx, field) - case "state": - return ec.fieldContext_SyncStatus_state(ctx, field) - case "error": - return ec.fieldContext_SyncStatus_error(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type SyncStatus", field.Name) - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__FCVolumeSource.ReadOnly(childComplexity), true -func (ec *executionContext) _MasterNode_spec(ctx context.Context, field graphql.CollectedField, obj *entities.MasterNode) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_MasterNode_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 + case "K8s__io___api___core___v1__FCVolumeSource.targetWWNs": + if e.complexity.K8s__io___api___core___v1__FCVolumeSource.TargetWWNs == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.MasterNode().Spec(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.MasterNodeSpec) - fc.Result = res - return ec.marshalOMasterNodeSpec2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐMasterNodeSpec(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_MasterNode_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MasterNode", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "region": - return ec.fieldContext_MasterNodeSpec_region(ctx, field) - case "accountName": - return ec.fieldContext_MasterNodeSpec_accountName(ctx, field) - case "clusterName": - return ec.fieldContext_MasterNodeSpec_clusterName(ctx, field) - case "config": - return ec.fieldContext_MasterNodeSpec_config(ctx, field) - case "provider": - return ec.fieldContext_MasterNodeSpec_provider(ctx, field) - case "providerName": - return ec.fieldContext_MasterNodeSpec_providerName(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type MasterNodeSpec", field.Name) - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__FCVolumeSource.TargetWWNs(childComplexity), true -func (ec *executionContext) _MasterNodeSpec_region(ctx context.Context, field graphql.CollectedField, obj *model.MasterNodeSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_MasterNodeSpec_region(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__FCVolumeSource.wwids": + if e.complexity.K8s__io___api___core___v1__FCVolumeSource.Wwids == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Region, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__FCVolumeSource.Wwids(childComplexity), true + + case "K8s__io___api___core___v1__FlexPersistentVolumeSource.driver": + if e.complexity.K8s__io___api___core___v1__FlexPersistentVolumeSource.Driver == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_MasterNodeSpec_region(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MasterNodeSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__FlexPersistentVolumeSource.Driver(childComplexity), true -func (ec *executionContext) _MasterNodeSpec_accountName(ctx context.Context, field graphql.CollectedField, obj *model.MasterNodeSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_MasterNodeSpec_accountName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__FlexPersistentVolumeSource.fsType": + if e.complexity.K8s__io___api___core___v1__FlexPersistentVolumeSource.FsType == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.AccountName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__FlexPersistentVolumeSource.FsType(childComplexity), true + + case "K8s__io___api___core___v1__FlexPersistentVolumeSource.options": + if e.complexity.K8s__io___api___core___v1__FlexPersistentVolumeSource.Options == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_MasterNodeSpec_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MasterNodeSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__FlexPersistentVolumeSource.Options(childComplexity), true -func (ec *executionContext) _MasterNodeSpec_clusterName(ctx context.Context, field graphql.CollectedField, obj *model.MasterNodeSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_MasterNodeSpec_clusterName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__FlexPersistentVolumeSource.readOnly": + if e.complexity.K8s__io___api___core___v1__FlexPersistentVolumeSource.ReadOnly == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__FlexPersistentVolumeSource.ReadOnly(childComplexity), true + + case "K8s__io___api___core___v1__FlexPersistentVolumeSource.secretRef": + if e.complexity.K8s__io___api___core___v1__FlexPersistentVolumeSource.SecretRef == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_MasterNodeSpec_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MasterNodeSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__FlexPersistentVolumeSource.SecretRef(childComplexity), true -func (ec *executionContext) _MasterNodeSpec_config(ctx context.Context, field graphql.CollectedField, obj *model.MasterNodeSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_MasterNodeSpec_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 + case "K8s__io___api___core___v1__FlockerVolumeSource.datasetName": + if e.complexity.K8s__io___api___core___v1__FlockerVolumeSource.DatasetName == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Config, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__FlockerVolumeSource.DatasetName(childComplexity), true + + case "K8s__io___api___core___v1__FlockerVolumeSource.datasetUUID": + if e.complexity.K8s__io___api___core___v1__FlockerVolumeSource.DatasetUUID == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_MasterNodeSpec_config(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MasterNodeSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__FlockerVolumeSource.DatasetUUID(childComplexity), true -func (ec *executionContext) _MasterNodeSpec_provider(ctx context.Context, field graphql.CollectedField, obj *model.MasterNodeSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_MasterNodeSpec_provider(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__GCEPersistentDiskVolumeSource.fsType": + if e.complexity.K8s__io___api___core___v1__GCEPersistentDiskVolumeSource.FsType == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Provider, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__GCEPersistentDiskVolumeSource.FsType(childComplexity), true + + case "K8s__io___api___core___v1__GCEPersistentDiskVolumeSource.partition": + if e.complexity.K8s__io___api___core___v1__GCEPersistentDiskVolumeSource.Partition == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_MasterNodeSpec_provider(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MasterNodeSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__GCEPersistentDiskVolumeSource.Partition(childComplexity), true -func (ec *executionContext) _MasterNodeSpec_providerName(ctx context.Context, field graphql.CollectedField, obj *model.MasterNodeSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_MasterNodeSpec_providerName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__GCEPersistentDiskVolumeSource.pdName": + if e.complexity.K8s__io___api___core___v1__GCEPersistentDiskVolumeSource.PdName == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ProviderName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__GCEPersistentDiskVolumeSource.PdName(childComplexity), true + + case "K8s__io___api___core___v1__GCEPersistentDiskVolumeSource.readOnly": + if e.complexity.K8s__io___api___core___v1__GCEPersistentDiskVolumeSource.ReadOnly == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_MasterNodeSpec_providerName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MasterNodeSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__GCEPersistentDiskVolumeSource.ReadOnly(childComplexity), true -func (ec *executionContext) _Metadata_name(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Metadata_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 + case "K8s__io___api___core___v1__GlusterfsPersistentVolumeSource.endpoints": + if e.complexity.K8s__io___api___core___v1__GlusterfsPersistentVolumeSource.Endpoints == nil { + break } - }() - 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 e.complexity.K8s__io___api___core___v1__GlusterfsPersistentVolumeSource.Endpoints(childComplexity), true + + case "K8s__io___api___core___v1__GlusterfsPersistentVolumeSource.endpointsNamespace": + if e.complexity.K8s__io___api___core___v1__GlusterfsPersistentVolumeSource.EndpointsNamespace == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Metadata_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Metadata", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__GlusterfsPersistentVolumeSource.EndpointsNamespace(childComplexity), true -func (ec *executionContext) _Metadata_namespace(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Metadata_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 + case "K8s__io___api___core___v1__GlusterfsPersistentVolumeSource.path": + if e.complexity.K8s__io___api___core___v1__GlusterfsPersistentVolumeSource.Path == nil { + break } - }() - 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 { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Metadata_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Metadata", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__GlusterfsPersistentVolumeSource.Path(childComplexity), true -func (ec *executionContext) _Metadata_labels(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Metadata_labels(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__GlusterfsPersistentVolumeSource.readOnly": + if e.complexity.K8s__io___api___core___v1__GlusterfsPersistentVolumeSource.ReadOnly == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Metadata().Labels(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOJson2map(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Metadata_labels(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Metadata", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Json does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__GlusterfsPersistentVolumeSource.ReadOnly(childComplexity), true -func (ec *executionContext) _Metadata_annotations(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Metadata_annotations(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__HostPathVolumeSource.path": + if e.complexity.K8s__io___api___core___v1__HostPathVolumeSource.Path == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Metadata().Annotations(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOJson2map(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Metadata_annotations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Metadata", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Json does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__HostPathVolumeSource.Path(childComplexity), true -func (ec *executionContext) _Metadata_creationTimestamp(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Metadata_creationTimestamp(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__HostPathVolumeSource.type": + if e.complexity.K8s__io___api___core___v1__HostPathVolumeSource.Type == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Metadata().CreationTimestamp(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 e.complexity.K8s__io___api___core___v1__HostPathVolumeSource.Type(childComplexity), true + + case "K8s__io___api___core___v1__ISCSIPersistentVolumeSource.chapAuthDiscovery": + if e.complexity.K8s__io___api___core___v1__ISCSIPersistentVolumeSource.ChapAuthDiscovery == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNDate2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Metadata_creationTimestamp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Metadata", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Date does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__ISCSIPersistentVolumeSource.ChapAuthDiscovery(childComplexity), true -func (ec *executionContext) _Metadata_deletionTimestamp(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Metadata_deletionTimestamp(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__ISCSIPersistentVolumeSource.chapAuthSession": + if e.complexity.K8s__io___api___core___v1__ISCSIPersistentVolumeSource.ChapAuthSession == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Metadata().DeletionTimestamp(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalODate2ᚖstring(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Metadata_deletionTimestamp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Metadata", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Date does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__ISCSIPersistentVolumeSource.ChapAuthSession(childComplexity), true -func (ec *executionContext) _Metadata_generation(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Metadata_generation(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__ISCSIPersistentVolumeSource.fsType": + if e.complexity.K8s__io___api___core___v1__ISCSIPersistentVolumeSource.FsType == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Generation, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__ISCSIPersistentVolumeSource.FsType(childComplexity), true + + case "K8s__io___api___core___v1__ISCSIPersistentVolumeSource.initiatorName": + if e.complexity.K8s__io___api___core___v1__ISCSIPersistentVolumeSource.InitiatorName == nil { + break } - return graphql.Null - } - res := resTmp.(int64) - fc.Result = res - return ec.marshalNInt2int64(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Metadata_generation(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Metadata", - 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 -} + return e.complexity.K8s__io___api___core___v1__ISCSIPersistentVolumeSource.InitiatorName(childComplexity), true -func (ec *executionContext) _Mutation_infra_createBYOCCluster(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_infra_createBYOCCluster(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__ISCSIPersistentVolumeSource.iqn": + if e.complexity.K8s__io___api___core___v1__ISCSIPersistentVolumeSource.Iqn == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().InfraCreateBYOCCluster(rctx, fc.Args["cluster"].(entities.BYOCCluster)) + + return e.complexity.K8s__io___api___core___v1__ISCSIPersistentVolumeSource.Iqn(childComplexity), true + + case "K8s__io___api___core___v1__ISCSIPersistentVolumeSource.iscsiInterface": + if e.complexity.K8s__io___api___core___v1__ISCSIPersistentVolumeSource.IscsiInterface == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) + + return e.complexity.K8s__io___api___core___v1__ISCSIPersistentVolumeSource.IscsiInterface(childComplexity), true + + case "K8s__io___api___core___v1__ISCSIPersistentVolumeSource.lun": + if e.complexity.K8s__io___api___core___v1__ISCSIPersistentVolumeSource.Lun == nil { + break } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) + + return e.complexity.K8s__io___api___core___v1__ISCSIPersistentVolumeSource.Lun(childComplexity), true + + case "K8s__io___api___core___v1__ISCSIPersistentVolumeSource.portals": + if e.complexity.K8s__io___api___core___v1__ISCSIPersistentVolumeSource.Portals == nil { + break } - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return e.complexity.K8s__io___api___core___v1__ISCSIPersistentVolumeSource.Portals(childComplexity), true + + case "K8s__io___api___core___v1__ISCSIPersistentVolumeSource.readOnly": + if e.complexity.K8s__io___api___core___v1__ISCSIPersistentVolumeSource.ReadOnly == nil { + break } - if tmp == nil { - return nil, nil + + return e.complexity.K8s__io___api___core___v1__ISCSIPersistentVolumeSource.ReadOnly(childComplexity), true + + case "K8s__io___api___core___v1__ISCSIPersistentVolumeSource.secretRef": + if e.complexity.K8s__io___api___core___v1__ISCSIPersistentVolumeSource.SecretRef == nil { + break } - if data, ok := tmp.(*entities.BYOCCluster); ok { - return data, nil + + return e.complexity.K8s__io___api___core___v1__ISCSIPersistentVolumeSource.SecretRef(childComplexity), true + + case "K8s__io___api___core___v1__ISCSIPersistentVolumeSource.targetPortal": + if e.complexity.K8s__io___api___core___v1__ISCSIPersistentVolumeSource.TargetPortal == nil { + break } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/infra/internal/domain/entities.BYOCCluster`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*entities.BYOCCluster) - fc.Result = res - return ec.marshalOBYOCCluster2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐBYOCCluster(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Mutation_infra_createBYOCCluster(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 "metadata": - return ec.fieldContext_BYOCCluster_metadata(ctx, field) - case "syncStatus": - return ec.fieldContext_BYOCCluster_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_BYOCCluster_spec(ctx, field) - case "status": - return ec.fieldContext_BYOCCluster_status(ctx, field) - case "apiVersion": - return ec.fieldContext_BYOCCluster_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_BYOCCluster_kind(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type BYOCCluster", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + return e.complexity.K8s__io___api___core___v1__ISCSIPersistentVolumeSource.TargetPortal(childComplexity), true + + case "K8s__io___api___core___v1__LocalVolumeSource.fsType": + if e.complexity.K8s__io___api___core___v1__LocalVolumeSource.FsType == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_infra_createBYOCCluster_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _Mutation_infra_updateBYOCCluster(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_infra_updateBYOCCluster(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.K8s__io___api___core___v1__LocalVolumeSource.FsType(childComplexity), true + + case "K8s__io___api___core___v1__LocalVolumeSource.path": + if e.complexity.K8s__io___api___core___v1__LocalVolumeSource.Path == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().InfraUpdateBYOCCluster(rctx, fc.Args["cluster"].(entities.BYOCCluster)) + + return e.complexity.K8s__io___api___core___v1__LocalVolumeSource.Path(childComplexity), true + + case "K8s__io___api___core___v1__NFSVolumeSource.path": + if e.complexity.K8s__io___api___core___v1__NFSVolumeSource.Path == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) + + return e.complexity.K8s__io___api___core___v1__NFSVolumeSource.Path(childComplexity), true + + case "K8s__io___api___core___v1__NFSVolumeSource.readOnly": + if e.complexity.K8s__io___api___core___v1__NFSVolumeSource.ReadOnly == nil { + break } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) + + return e.complexity.K8s__io___api___core___v1__NFSVolumeSource.ReadOnly(childComplexity), true + + case "K8s__io___api___core___v1__NFSVolumeSource.server": + if e.complexity.K8s__io___api___core___v1__NFSVolumeSource.Server == nil { + break } - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return e.complexity.K8s__io___api___core___v1__NFSVolumeSource.Server(childComplexity), true + + case "K8s__io___api___core___v1__NamespaceCondition.lastTransitionTime": + if e.complexity.K8s__io___api___core___v1__NamespaceCondition.LastTransitionTime == nil { + break } - if tmp == nil { - return nil, nil + + return e.complexity.K8s__io___api___core___v1__NamespaceCondition.LastTransitionTime(childComplexity), true + + case "K8s__io___api___core___v1__NamespaceCondition.message": + if e.complexity.K8s__io___api___core___v1__NamespaceCondition.Message == nil { + break } - if data, ok := tmp.(*entities.BYOCCluster); ok { - return data, nil + + return e.complexity.K8s__io___api___core___v1__NamespaceCondition.Message(childComplexity), true + + case "K8s__io___api___core___v1__NamespaceCondition.reason": + if e.complexity.K8s__io___api___core___v1__NamespaceCondition.Reason == nil { + break } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/infra/internal/domain/entities.BYOCCluster`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*entities.BYOCCluster) - fc.Result = res - return ec.marshalOBYOCCluster2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐBYOCCluster(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Mutation_infra_updateBYOCCluster(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 "metadata": - return ec.fieldContext_BYOCCluster_metadata(ctx, field) - case "syncStatus": - return ec.fieldContext_BYOCCluster_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_BYOCCluster_spec(ctx, field) - case "status": - return ec.fieldContext_BYOCCluster_status(ctx, field) - case "apiVersion": - return ec.fieldContext_BYOCCluster_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_BYOCCluster_kind(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type BYOCCluster", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + return e.complexity.K8s__io___api___core___v1__NamespaceCondition.Reason(childComplexity), true + + case "K8s__io___api___core___v1__NamespaceCondition.status": + if e.complexity.K8s__io___api___core___v1__NamespaceCondition.Status == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_infra_updateBYOCCluster_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _Mutation_infra_deleteBYOCCluster(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_infra_deleteBYOCCluster(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.K8s__io___api___core___v1__NamespaceCondition.Status(childComplexity), true + + case "K8s__io___api___core___v1__NamespaceCondition.type": + if e.complexity.K8s__io___api___core___v1__NamespaceCondition.Type == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().InfraDeleteBYOCCluster(rctx, fc.Args["name"].(string)) + + return e.complexity.K8s__io___api___core___v1__NamespaceCondition.Type(childComplexity), true + + case "K8s__io___api___core___v1__NamespaceSpec.finalizers": + if e.complexity.K8s__io___api___core___v1__NamespaceSpec.Finalizers == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) + + return e.complexity.K8s__io___api___core___v1__NamespaceSpec.Finalizers(childComplexity), true + + case "K8s__io___api___core___v1__NamespaceStatus.conditions": + if e.complexity.K8s__io___api___core___v1__NamespaceStatus.Conditions == nil { + break } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) + + return e.complexity.K8s__io___api___core___v1__NamespaceStatus.Conditions(childComplexity), true + + case "K8s__io___api___core___v1__NamespaceStatus.phase": + if e.complexity.K8s__io___api___core___v1__NamespaceStatus.Phase == nil { + break } - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return e.complexity.K8s__io___api___core___v1__NamespaceStatus.Phase(childComplexity), true + + case "K8s__io___api___core___v1__NodeAffinity.preferredDuringSchedulingIgnoredDuringExecution": + if e.complexity.K8s__io___api___core___v1__NodeAffinity.PreferredDuringSchedulingIgnoredDuringExecution == nil { + break } - if tmp == nil { - return nil, nil + + return e.complexity.K8s__io___api___core___v1__NodeAffinity.PreferredDuringSchedulingIgnoredDuringExecution(childComplexity), true + + case "K8s__io___api___core___v1__NodeAffinity.requiredDuringSchedulingIgnoredDuringExecution": + if e.complexity.K8s__io___api___core___v1__NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution == nil { + break } - if data, ok := tmp.(bool); ok { - return data, nil + + return e.complexity.K8s__io___api___core___v1__NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution(childComplexity), true + + case "K8s__io___api___core___v1__NodeSelector.nodeSelectorTerms": + if e.complexity.K8s__io___api___core___v1__NodeSelector.NodeSelectorTerms == nil { + break } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__NodeSelector.NodeSelectorTerms(childComplexity), true + + case "K8s__io___api___core___v1__NodeSelectorRequirement.key": + if e.complexity.K8s__io___api___core___v1__NodeSelectorRequirement.Key == nil { + break } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Mutation_infra_deleteBYOCCluster(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) + return e.complexity.K8s__io___api___core___v1__NodeSelectorRequirement.Key(childComplexity), true + + case "K8s__io___api___core___v1__NodeSelectorRequirement.operator": + if e.complexity.K8s__io___api___core___v1__NodeSelectorRequirement.Operator == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_infra_deleteBYOCCluster_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _Mutation_infra_createCluster(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_infra_createCluster(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.K8s__io___api___core___v1__NodeSelectorRequirement.Operator(childComplexity), true + + case "K8s__io___api___core___v1__NodeSelectorRequirement.values": + if e.complexity.K8s__io___api___core___v1__NodeSelectorRequirement.Values == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().InfraCreateCluster(rctx, fc.Args["cluster"].(entities.Cluster)) + + return e.complexity.K8s__io___api___core___v1__NodeSelectorRequirement.Values(childComplexity), true + + case "K8s__io___api___core___v1__NodeSelectorTerm.matchExpressions": + if e.complexity.K8s__io___api___core___v1__NodeSelectorTerm.MatchExpressions == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) + + return e.complexity.K8s__io___api___core___v1__NodeSelectorTerm.MatchExpressions(childComplexity), true + + case "K8s__io___api___core___v1__NodeSelectorTerm.matchFields": + if e.complexity.K8s__io___api___core___v1__NodeSelectorTerm.MatchFields == nil { + break } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) + + return e.complexity.K8s__io___api___core___v1__NodeSelectorTerm.MatchFields(childComplexity), true + + case "K8s__io___api___core___v1__ObjectReference.apiVersion": + if e.complexity.K8s__io___api___core___v1__ObjectReference.APIVersion == nil { + break } - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return e.complexity.K8s__io___api___core___v1__ObjectReference.APIVersion(childComplexity), true + + case "K8s__io___api___core___v1__ObjectReference.fieldPath": + if e.complexity.K8s__io___api___core___v1__ObjectReference.FieldPath == nil { + break } - if tmp == nil { - return nil, nil + + return e.complexity.K8s__io___api___core___v1__ObjectReference.FieldPath(childComplexity), true + + case "K8s__io___api___core___v1__ObjectReference.kind": + if e.complexity.K8s__io___api___core___v1__ObjectReference.Kind == nil { + break } - if data, ok := tmp.(*entities.Cluster); ok { - return data, nil + + return e.complexity.K8s__io___api___core___v1__ObjectReference.Kind(childComplexity), true + + case "K8s__io___api___core___v1__ObjectReference.name": + if e.complexity.K8s__io___api___core___v1__ObjectReference.Name == nil { + break } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/infra/internal/domain/entities.Cluster`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*entities.Cluster) - fc.Result = res - return ec.marshalOCluster2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐCluster(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Mutation_infra_createCluster(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 "apiVersion": - return ec.fieldContext_Cluster_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_Cluster_kind(ctx, field) - case "metadata": - return ec.fieldContext_Cluster_metadata(ctx, field) - case "syncStatus": - return ec.fieldContext_Cluster_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_Cluster_spec(ctx, field) - case "status": - return ec.fieldContext_Cluster_status(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Cluster", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + return e.complexity.K8s__io___api___core___v1__ObjectReference.Name(childComplexity), true + + case "K8s__io___api___core___v1__ObjectReference.namespace": + if e.complexity.K8s__io___api___core___v1__ObjectReference.Namespace == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_infra_createCluster_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _Mutation_infra_updateCluster(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_infra_updateCluster(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.K8s__io___api___core___v1__ObjectReference.Namespace(childComplexity), true + + case "K8s__io___api___core___v1__ObjectReference.resourceVersion": + if e.complexity.K8s__io___api___core___v1__ObjectReference.ResourceVersion == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().InfraUpdateCluster(rctx, fc.Args["cluster"].(entities.Cluster)) + + return e.complexity.K8s__io___api___core___v1__ObjectReference.ResourceVersion(childComplexity), true + + case "K8s__io___api___core___v1__ObjectReference.uid": + if e.complexity.K8s__io___api___core___v1__ObjectReference.UID == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) + + return e.complexity.K8s__io___api___core___v1__ObjectReference.UID(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeClaimCondition.lastProbeTime": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimCondition.LastProbeTime == nil { + break } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimCondition.LastProbeTime(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeClaimCondition.lastTransitionTime": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimCondition.LastTransitionTime == nil { + break } - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimCondition.LastTransitionTime(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeClaimCondition.message": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimCondition.Message == nil { + break } - if tmp == nil { - return nil, nil + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimCondition.Message(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeClaimCondition.reason": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimCondition.Reason == nil { + break } - if data, ok := tmp.(*entities.Cluster); ok { - return data, nil + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimCondition.Reason(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeClaimCondition.status": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimCondition.Status == nil { + break } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/infra/internal/domain/entities.Cluster`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*entities.Cluster) - fc.Result = res - return ec.marshalOCluster2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐCluster(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Mutation_infra_updateCluster(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 "apiVersion": - return ec.fieldContext_Cluster_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_Cluster_kind(ctx, field) - case "metadata": - return ec.fieldContext_Cluster_metadata(ctx, field) - case "syncStatus": - return ec.fieldContext_Cluster_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_Cluster_spec(ctx, field) - case "status": - return ec.fieldContext_Cluster_status(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Cluster", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + return e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimCondition.Status(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeClaimCondition.type": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimCondition.Type == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_infra_updateCluster_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _Mutation_infra_deleteCluster(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_infra_deleteCluster(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimCondition.Type(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeClaimSpec.accessModes": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimSpec.AccessModes == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().InfraDeleteCluster(rctx, fc.Args["name"].(string)) + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimSpec.AccessModes(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeClaimSpec.dataSource": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimSpec.DataSource == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimSpec.DataSource(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeClaimSpec.dataSourceRef": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimSpec.DataSourceRef == nil { + break } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimSpec.DataSourceRef(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeClaimSpec.resources": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimSpec.Resources == nil { + break } - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimSpec.Resources(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeClaimSpec.selector": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimSpec.Selector == nil { + break } - if tmp == nil { - return nil, nil + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimSpec.Selector(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeClaimSpec.storageClassName": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimSpec.StorageClassName == nil { + break } - if data, ok := tmp.(bool); ok { - return data, nil + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimSpec.StorageClassName(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeClaimSpec.volumeMode": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimSpec.VolumeMode == nil { + break } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimSpec.VolumeMode(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeClaimSpec.volumeName": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimSpec.VolumeName == nil { + break } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Mutation_infra_deleteCluster(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) + return e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimSpec.VolumeName(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeClaimStatus.accessModes": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimStatus.AccessModes == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_infra_deleteCluster_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _Mutation_infra_createCloudProvider(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_infra_createCloudProvider(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimStatus.AccessModes(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeClaimStatus.allocatedResourceStatuses": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimStatus.AllocatedResourceStatuses == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().InfraCreateCloudProvider(rctx, fc.Args["cloudProvider"].(entities.CloudProvider), fc.Args["providerSecret"].(entities.Secret)) + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimStatus.AllocatedResourceStatuses(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeClaimStatus.allocatedResources": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimStatus.AllocatedResources == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimStatus.AllocatedResources(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeClaimStatus.capacity": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimStatus.Capacity == nil { + break } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimStatus.Capacity(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeClaimStatus.conditions": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimStatus.Conditions == nil { + break } - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimStatus.Conditions(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeClaimStatus.phase": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimStatus.Phase == nil { + break } - if tmp == nil { - return nil, nil + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimStatus.Phase(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.accessModes": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.AccessModes == nil { + break } - if data, ok := tmp.(*entities.CloudProvider); ok { - return data, nil + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.AccessModes(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.awsElasticBlockStore": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.AwsElasticBlockStore == nil { + break } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/infra/internal/domain/entities.CloudProvider`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*entities.CloudProvider) - fc.Result = res - return ec.marshalOCloudProvider2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐCloudProvider(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Mutation_infra_createCloudProvider(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 "apiVersion": - return ec.fieldContext_CloudProvider_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_CloudProvider_kind(ctx, field) - case "metadata": - return ec.fieldContext_CloudProvider_metadata(ctx, field) - case "syncStatus": - return ec.fieldContext_CloudProvider_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_CloudProvider_spec(ctx, field) - case "status": - return ec.fieldContext_CloudProvider_status(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type CloudProvider", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.AwsElasticBlockStore(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.azureDisk": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.AzureDisk == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_infra_createCloudProvider_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _Mutation_infra_updateCloudProvider(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_infra_updateCloudProvider(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.AzureDisk(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.azureFile": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.AzureFile == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().InfraUpdateCloudProvider(rctx, fc.Args["cloudProvider"].(entities.CloudProvider), fc.Args["providerSecret"].(*entities.Secret)) + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.AzureFile(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.capacity": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.Capacity == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.Capacity(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.cephfs": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.Cephfs == nil { + break } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.Cephfs(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.cinder": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.Cinder == nil { + break } - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.Cinder(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.claimRef": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.ClaimRef == nil { + break } - if tmp == nil { - return nil, nil + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.ClaimRef(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.csi": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.Csi == nil { + break } - if data, ok := tmp.(*entities.CloudProvider); ok { - return data, nil + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.Csi(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.fc": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.Fc == nil { + break } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/infra/internal/domain/entities.CloudProvider`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*entities.CloudProvider) - fc.Result = res - return ec.marshalOCloudProvider2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐCloudProvider(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Mutation_infra_updateCloudProvider(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 "apiVersion": - return ec.fieldContext_CloudProvider_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_CloudProvider_kind(ctx, field) - case "metadata": - return ec.fieldContext_CloudProvider_metadata(ctx, field) - case "syncStatus": - return ec.fieldContext_CloudProvider_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_CloudProvider_spec(ctx, field) - case "status": - return ec.fieldContext_CloudProvider_status(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type CloudProvider", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.Fc(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.flexVolume": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.FlexVolume == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_infra_updateCloudProvider_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _Mutation_infra_deleteCloudProvider(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_infra_deleteCloudProvider(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.FlexVolume(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.flocker": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.Flocker == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().InfraDeleteCloudProvider(rctx, fc.Args["name"].(string)) + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.Flocker(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.gcePersistentDisk": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.GcePersistentDisk == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.GcePersistentDisk(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.glusterfs": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.Glusterfs == nil { + break } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.Glusterfs(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.hostPath": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.HostPath == nil { + break } - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.HostPath(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.iscsi": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.Iscsi == nil { + break } - if tmp == nil { - return nil, nil + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.Iscsi(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.local": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.Local == nil { + break } - if data, ok := tmp.(bool); ok { - return data, nil + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.Local(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.mountOptions": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.MountOptions == nil { + break } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.MountOptions(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.nfs": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.Nfs == nil { + break } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Mutation_infra_deleteCloudProvider(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) + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.Nfs(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.nodeAffinity": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.NodeAffinity == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_infra_deleteCloudProvider_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _Mutation_infra_createEdge(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_infra_createEdge(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.NodeAffinity(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.persistentVolumeReclaimPolicy": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.PersistentVolumeReclaimPolicy == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().InfraCreateEdge(rctx, fc.Args["edge"].(entities.Edge)) + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.PersistentVolumeReclaimPolicy(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.photonPersistentDisk": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.PhotonPersistentDisk == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.PhotonPersistentDisk(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.portworxVolume": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.PortworxVolume == nil { + break } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.PortworxVolume(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.quobyte": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.Quobyte == nil { + break } - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.Quobyte(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.rbd": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.Rbd == nil { + break } - if tmp == nil { - return nil, nil + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.Rbd(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.scaleIO": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.ScaleIo == nil { + break } - if data, ok := tmp.(*entities.Edge); ok { - return data, nil + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.ScaleIo(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.storageClassName": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.StorageClassName == nil { + break } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/infra/internal/domain/entities.Edge`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*entities.Edge) - fc.Result = res - return ec.marshalOEdge2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐEdge(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Mutation_infra_createEdge(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 "apiVersion": - return ec.fieldContext_Edge_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_Edge_kind(ctx, field) - case "metadata": - return ec.fieldContext_Edge_metadata(ctx, field) - case "syncStatus": - return ec.fieldContext_Edge_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_Edge_spec(ctx, field) - case "status": - return ec.fieldContext_Edge_status(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Edge", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.StorageClassName(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.storageos": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.Storageos == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_infra_createEdge_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _Mutation_infra_updateEdge(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_infra_updateEdge(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.Storageos(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.volumeMode": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.VolumeMode == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().InfraUpdateEdge(rctx, fc.Args["edge"].(entities.Edge)) + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.VolumeMode(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeSpec.vsphereVolume": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.VsphereVolume == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.VsphereVolume(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeStatus.lastPhaseTransitionTime": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeStatus.LastPhaseTransitionTime == nil { + break } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeStatus.LastPhaseTransitionTime(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeStatus.message": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeStatus.Message == nil { + break } - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return e.complexity.K8s__io___api___core___v1__PersistentVolumeStatus.Message(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeStatus.phase": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeStatus.Phase == nil { + break } - if tmp == nil { - return nil, nil + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeStatus.Phase(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeStatus.reason": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeStatus.Reason == nil { + break } - if data, ok := tmp.(*entities.Edge); ok { - return data, nil + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeStatus.Reason(childComplexity), true + + case "K8s__io___api___core___v1__PhotonPersistentDiskVolumeSource.fsType": + if e.complexity.K8s__io___api___core___v1__PhotonPersistentDiskVolumeSource.FsType == nil { + break } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/infra/internal/domain/entities.Edge`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*entities.Edge) - fc.Result = res - return ec.marshalOEdge2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐEdge(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Mutation_infra_updateEdge(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 "apiVersion": - return ec.fieldContext_Edge_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_Edge_kind(ctx, field) - case "metadata": - return ec.fieldContext_Edge_metadata(ctx, field) - case "syncStatus": - return ec.fieldContext_Edge_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_Edge_spec(ctx, field) - case "status": - return ec.fieldContext_Edge_status(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Edge", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + return e.complexity.K8s__io___api___core___v1__PhotonPersistentDiskVolumeSource.FsType(childComplexity), true + + case "K8s__io___api___core___v1__PhotonPersistentDiskVolumeSource.pdID": + if e.complexity.K8s__io___api___core___v1__PhotonPersistentDiskVolumeSource.PdID == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_infra_updateEdge_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _Mutation_infra_deleteEdge(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_infra_deleteEdge(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.K8s__io___api___core___v1__PhotonPersistentDiskVolumeSource.PdID(childComplexity), true + + case "K8s__io___api___core___v1__PodAffinity.preferredDuringSchedulingIgnoredDuringExecution": + if e.complexity.K8s__io___api___core___v1__PodAffinity.PreferredDuringSchedulingIgnoredDuringExecution == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().InfraDeleteEdge(rctx, fc.Args["clusterName"].(string), fc.Args["name"].(string)) + + return e.complexity.K8s__io___api___core___v1__PodAffinity.PreferredDuringSchedulingIgnoredDuringExecution(childComplexity), true + + case "K8s__io___api___core___v1__PodAffinity.requiredDuringSchedulingIgnoredDuringExecution": + if e.complexity.K8s__io___api___core___v1__PodAffinity.RequiredDuringSchedulingIgnoredDuringExecution == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) + + return e.complexity.K8s__io___api___core___v1__PodAffinity.RequiredDuringSchedulingIgnoredDuringExecution(childComplexity), true + + case "K8s__io___api___core___v1__PodAffinityTerm.labelSelector": + if e.complexity.K8s__io___api___core___v1__PodAffinityTerm.LabelSelector == nil { + break } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) + + return e.complexity.K8s__io___api___core___v1__PodAffinityTerm.LabelSelector(childComplexity), true + + case "K8s__io___api___core___v1__PodAffinityTerm.namespaceSelector": + if e.complexity.K8s__io___api___core___v1__PodAffinityTerm.NamespaceSelector == nil { + break } - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return e.complexity.K8s__io___api___core___v1__PodAffinityTerm.NamespaceSelector(childComplexity), true + + case "K8s__io___api___core___v1__PodAffinityTerm.namespaces": + if e.complexity.K8s__io___api___core___v1__PodAffinityTerm.Namespaces == nil { + break } - if tmp == nil { - return nil, nil + + return e.complexity.K8s__io___api___core___v1__PodAffinityTerm.Namespaces(childComplexity), true + + case "K8s__io___api___core___v1__PodAffinityTerm.topologyKey": + if e.complexity.K8s__io___api___core___v1__PodAffinityTerm.TopologyKey == nil { + break } - if data, ok := tmp.(bool); ok { - return data, nil + + return e.complexity.K8s__io___api___core___v1__PodAffinityTerm.TopologyKey(childComplexity), true + + case "K8s__io___api___core___v1__PodAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution": + if e.complexity.K8s__io___api___core___v1__PodAntiAffinity.PreferredDuringSchedulingIgnoredDuringExecution == nil { + break } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__PodAntiAffinity.PreferredDuringSchedulingIgnoredDuringExecution(childComplexity), true + + case "K8s__io___api___core___v1__PodAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution": + if e.complexity.K8s__io___api___core___v1__PodAntiAffinity.RequiredDuringSchedulingIgnoredDuringExecution == nil { + break } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Mutation_infra_deleteEdge(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) + return e.complexity.K8s__io___api___core___v1__PodAntiAffinity.RequiredDuringSchedulingIgnoredDuringExecution(childComplexity), true + + case "K8s__io___api___core___v1__PortworxVolumeSource.fsType": + if e.complexity.K8s__io___api___core___v1__PortworxVolumeSource.FsType == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_infra_deleteEdge_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _Mutation_infra_deleteWorkerNode(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_infra_deleteWorkerNode(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.K8s__io___api___core___v1__PortworxVolumeSource.FsType(childComplexity), true + + case "K8s__io___api___core___v1__PortworxVolumeSource.readOnly": + if e.complexity.K8s__io___api___core___v1__PortworxVolumeSource.ReadOnly == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().InfraDeleteWorkerNode(rctx, fc.Args["clusterName"].(string), fc.Args["edgeName"].(string), fc.Args["name"].(string)) + + return e.complexity.K8s__io___api___core___v1__PortworxVolumeSource.ReadOnly(childComplexity), true + + case "K8s__io___api___core___v1__PortworxVolumeSource.volumeID": + if e.complexity.K8s__io___api___core___v1__PortworxVolumeSource.VolumeID == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) + + return e.complexity.K8s__io___api___core___v1__PortworxVolumeSource.VolumeID(childComplexity), true + + case "K8s__io___api___core___v1__PreferredSchedulingTerm.preference": + if e.complexity.K8s__io___api___core___v1__PreferredSchedulingTerm.Preference == nil { + break } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) + + return e.complexity.K8s__io___api___core___v1__PreferredSchedulingTerm.Preference(childComplexity), true + + case "K8s__io___api___core___v1__PreferredSchedulingTerm.weight": + if e.complexity.K8s__io___api___core___v1__PreferredSchedulingTerm.Weight == nil { + break } - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return e.complexity.K8s__io___api___core___v1__PreferredSchedulingTerm.Weight(childComplexity), true + + case "K8s__io___api___core___v1__QuobyteVolumeSource.group": + if e.complexity.K8s__io___api___core___v1__QuobyteVolumeSource.Group == nil { + break } - if tmp == nil { - return nil, nil + + return e.complexity.K8s__io___api___core___v1__QuobyteVolumeSource.Group(childComplexity), true + + case "K8s__io___api___core___v1__QuobyteVolumeSource.readOnly": + if e.complexity.K8s__io___api___core___v1__QuobyteVolumeSource.ReadOnly == nil { + break } - if data, ok := tmp.(bool); ok { - return data, nil + + return e.complexity.K8s__io___api___core___v1__QuobyteVolumeSource.ReadOnly(childComplexity), true + + case "K8s__io___api___core___v1__QuobyteVolumeSource.registry": + if e.complexity.K8s__io___api___core___v1__QuobyteVolumeSource.Registry == nil { + break } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__QuobyteVolumeSource.Registry(childComplexity), true + + case "K8s__io___api___core___v1__QuobyteVolumeSource.tenant": + if e.complexity.K8s__io___api___core___v1__QuobyteVolumeSource.Tenant == nil { + break } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Mutation_infra_deleteWorkerNode(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) + return e.complexity.K8s__io___api___core___v1__QuobyteVolumeSource.Tenant(childComplexity), true + + case "K8s__io___api___core___v1__QuobyteVolumeSource.user": + if e.complexity.K8s__io___api___core___v1__QuobyteVolumeSource.User == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_infra_deleteWorkerNode_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _NodePool_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.NodePool) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NodePool_apiVersion(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.K8s__io___api___core___v1__QuobyteVolumeSource.User(childComplexity), true + + case "K8s__io___api___core___v1__QuobyteVolumeSource.volume": + if e.complexity.K8s__io___api___core___v1__QuobyteVolumeSource.Volume == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.APIVersion, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_NodePool_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "NodePool", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__QuobyteVolumeSource.Volume(childComplexity), true -func (ec *executionContext) _NodePool_kind(ctx context.Context, field graphql.CollectedField, obj *entities.NodePool) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NodePool_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 + case "K8s__io___api___core___v1__RBDPersistentVolumeSource.fsType": + if e.complexity.K8s__io___api___core___v1__RBDPersistentVolumeSource.FsType == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_NodePool_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "NodePool", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__RBDPersistentVolumeSource.FsType(childComplexity), true -func (ec *executionContext) _NodePool_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.NodePool) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NodePool_metadata(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__RBDPersistentVolumeSource.image": + if e.complexity.K8s__io___api___core___v1__RBDPersistentVolumeSource.Image == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ObjectMeta, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__RBDPersistentVolumeSource.Image(childComplexity), true + + case "K8s__io___api___core___v1__RBDPersistentVolumeSource.keyring": + if e.complexity.K8s__io___api___core___v1__RBDPersistentVolumeSource.Keyring == nil { + break } - return graphql.Null - } - res := resTmp.(v1.ObjectMeta) - fc.Result = res - return ec.marshalNMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_NodePool_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "NodePool", - 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_Metadata_name(ctx, field) - case "namespace": - return ec.fieldContext_Metadata_namespace(ctx, field) - case "labels": - return ec.fieldContext_Metadata_labels(ctx, field) - case "annotations": - return ec.fieldContext_Metadata_annotations(ctx, field) - case "creationTimestamp": - return ec.fieldContext_Metadata_creationTimestamp(ctx, field) - case "deletionTimestamp": - return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) - case "generation": - return ec.fieldContext_Metadata_generation(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__RBDPersistentVolumeSource.Keyring(childComplexity), true -func (ec *executionContext) _NodePool_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.NodePool) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NodePool_syncStatus(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__RBDPersistentVolumeSource.monitors": + if e.complexity.K8s__io___api___core___v1__RBDPersistentVolumeSource.Monitors == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SyncStatus, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(types.SyncStatus) - fc.Result = res - return ec.marshalOSyncStatus2kloudliteᚗioᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_NodePool_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "NodePool", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "syncScheduledAt": - return ec.fieldContext_SyncStatus_syncScheduledAt(ctx, field) - case "lastSyncedAt": - return ec.fieldContext_SyncStatus_lastSyncedAt(ctx, field) - case "action": - return ec.fieldContext_SyncStatus_action(ctx, field) - case "generation": - return ec.fieldContext_SyncStatus_generation(ctx, field) - case "state": - return ec.fieldContext_SyncStatus_state(ctx, field) - case "error": - return ec.fieldContext_SyncStatus_error(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type SyncStatus", field.Name) - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__RBDPersistentVolumeSource.Monitors(childComplexity), true -func (ec *executionContext) _NodePool_spec(ctx context.Context, field graphql.CollectedField, obj *entities.NodePool) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NodePool_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 + case "K8s__io___api___core___v1__RBDPersistentVolumeSource.pool": + if e.complexity.K8s__io___api___core___v1__RBDPersistentVolumeSource.Pool == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.NodePool().Spec(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.NodePoolSpec) - fc.Result = res - return ec.marshalONodePoolSpec2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐNodePoolSpec(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_NodePool_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "NodePool", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "accountName": - return ec.fieldContext_NodePoolSpec_accountName(ctx, field) - case "config": - return ec.fieldContext_NodePoolSpec_config(ctx, field) - case "max": - return ec.fieldContext_NodePoolSpec_max(ctx, field) - case "providerName": - return ec.fieldContext_NodePoolSpec_providerName(ctx, field) - case "region": - return ec.fieldContext_NodePoolSpec_region(ctx, field) - case "clusterName": - return ec.fieldContext_NodePoolSpec_clusterName(ctx, field) - case "edgeName": - return ec.fieldContext_NodePoolSpec_edgeName(ctx, field) - case "min": - return ec.fieldContext_NodePoolSpec_min(ctx, field) - case "provider": - return ec.fieldContext_NodePoolSpec_provider(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type NodePoolSpec", field.Name) - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__RBDPersistentVolumeSource.Pool(childComplexity), true -func (ec *executionContext) _NodePool_status(ctx context.Context, field graphql.CollectedField, obj *entities.NodePool) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NodePool_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 + case "K8s__io___api___core___v1__RBDPersistentVolumeSource.readOnly": + if e.complexity.K8s__io___api___core___v1__RBDPersistentVolumeSource.ReadOnly == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.NodePool().Status(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*operator.Status) - fc.Result = res - return ec.marshalOStatus2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_NodePool_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "NodePool", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "isReady": - return ec.fieldContext_Status_isReady(ctx, field) - case "checks": - return ec.fieldContext_Status_checks(ctx, field) - case "displayVars": - return ec.fieldContext_Status_displayVars(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Status", field.Name) - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__RBDPersistentVolumeSource.ReadOnly(childComplexity), true -func (ec *executionContext) _NodePoolSpec_accountName(ctx context.Context, field graphql.CollectedField, obj *model.NodePoolSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NodePoolSpec_accountName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__RBDPersistentVolumeSource.secretRef": + if e.complexity.K8s__io___api___core___v1__RBDPersistentVolumeSource.SecretRef == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.AccountName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__RBDPersistentVolumeSource.SecretRef(childComplexity), true + + case "K8s__io___api___core___v1__RBDPersistentVolumeSource.user": + if e.complexity.K8s__io___api___core___v1__RBDPersistentVolumeSource.User == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_NodePoolSpec_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "NodePoolSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__RBDPersistentVolumeSource.User(childComplexity), true -func (ec *executionContext) _NodePoolSpec_config(ctx context.Context, field graphql.CollectedField, obj *model.NodePoolSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NodePoolSpec_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 + case "K8s__io___api___core___v1__ResourceClaim.name": + if e.complexity.K8s__io___api___core___v1__ResourceClaim.Name == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Config, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__ResourceClaim.Name(childComplexity), true + + case "K8s__io___api___core___v1__ResourceRequirements.claims": + if e.complexity.K8s__io___api___core___v1__ResourceRequirements.Claims == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_NodePoolSpec_config(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "NodePoolSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__ResourceRequirements.Claims(childComplexity), true -func (ec *executionContext) _NodePoolSpec_max(ctx context.Context, field graphql.CollectedField, obj *model.NodePoolSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NodePoolSpec_max(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__ResourceRequirements.limits": + if e.complexity.K8s__io___api___core___v1__ResourceRequirements.Limits == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Max, 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_NodePoolSpec_max(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "NodePoolSpec", - 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 -} + return e.complexity.K8s__io___api___core___v1__ResourceRequirements.Limits(childComplexity), true -func (ec *executionContext) _NodePoolSpec_providerName(ctx context.Context, field graphql.CollectedField, obj *model.NodePoolSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NodePoolSpec_providerName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__ResourceRequirements.requests": + if e.complexity.K8s__io___api___core___v1__ResourceRequirements.Requests == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ProviderName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__ResourceRequirements.Requests(childComplexity), true + + case "K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.fsType": + if e.complexity.K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.FsType == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_NodePoolSpec_providerName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "NodePoolSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.FsType(childComplexity), true -func (ec *executionContext) _NodePoolSpec_region(ctx context.Context, field graphql.CollectedField, obj *model.NodePoolSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NodePoolSpec_region(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.gateway": + if e.complexity.K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.Gateway == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Region, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.Gateway(childComplexity), true + + case "K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.protectionDomain": + if e.complexity.K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.ProtectionDomain == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_NodePoolSpec_region(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "NodePoolSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.ProtectionDomain(childComplexity), true -func (ec *executionContext) _NodePoolSpec_clusterName(ctx context.Context, field graphql.CollectedField, obj *model.NodePoolSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NodePoolSpec_clusterName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.readOnly": + if e.complexity.K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.ReadOnly == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.ReadOnly(childComplexity), true + + case "K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.secretRef": + if e.complexity.K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.SecretRef == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_NodePoolSpec_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "NodePoolSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.SecretRef(childComplexity), true -func (ec *executionContext) _NodePoolSpec_edgeName(ctx context.Context, field graphql.CollectedField, obj *model.NodePoolSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NodePoolSpec_edgeName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.sslEnabled": + if e.complexity.K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.SslEnabled == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.EdgeName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.SslEnabled(childComplexity), true + + case "K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.storageMode": + if e.complexity.K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.StorageMode == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_NodePoolSpec_edgeName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "NodePoolSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.StorageMode(childComplexity), true -func (ec *executionContext) _NodePoolSpec_min(ctx context.Context, field graphql.CollectedField, obj *model.NodePoolSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NodePoolSpec_min(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.storagePool": + if e.complexity.K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.StoragePool == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Min, 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_NodePoolSpec_min(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "NodePoolSpec", - 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 -} + return e.complexity.K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.StoragePool(childComplexity), true -func (ec *executionContext) _NodePoolSpec_provider(ctx context.Context, field graphql.CollectedField, obj *model.NodePoolSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NodePoolSpec_provider(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.system": + if e.complexity.K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.System == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Provider, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.System(childComplexity), true + + case "K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.volumeName": + if e.complexity.K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.VolumeName == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_NodePoolSpec_provider(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "NodePoolSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.VolumeName(childComplexity), true -func (ec *executionContext) _Overrides_applied(ctx context.Context, field graphql.CollectedField, obj *v11.JsonPatch) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Overrides_applied(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__SecretReference.name": + if e.complexity.K8s__io___api___core___v1__SecretReference.Name == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Applied, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalOBoolean2bool(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Overrides_applied(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Overrides", - 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 -} + return e.complexity.K8s__io___api___core___v1__SecretReference.Name(childComplexity), true -func (ec *executionContext) _Overrides_patches(ctx context.Context, field graphql.CollectedField, obj *v11.JsonPatch) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Overrides_patches(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__SecretReference.namespace": + if e.complexity.K8s__io___api___core___v1__SecretReference.Namespace == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Patches, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]json_patch.PatchOperation) - fc.Result = res - return ec.marshalOPatch2ᚕgithubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋjsonᚑpatchᚐPatchOperationᚄ(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Overrides_patches(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Overrides", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "op": - return ec.fieldContext_Patch_op(ctx, field) - case "path": - return ec.fieldContext_Patch_path(ctx, field) - case "value": - return ec.fieldContext_Patch_value(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Patch", field.Name) - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__SecretReference.Namespace(childComplexity), true -func (ec *executionContext) _Patch_op(ctx context.Context, field graphql.CollectedField, obj *json_patch.PatchOperation) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Patch_op(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__StorageOSPersistentVolumeSource.fsType": + if e.complexity.K8s__io___api___core___v1__StorageOSPersistentVolumeSource.FsType == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Op, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__StorageOSPersistentVolumeSource.FsType(childComplexity), true + + case "K8s__io___api___core___v1__StorageOSPersistentVolumeSource.readOnly": + if e.complexity.K8s__io___api___core___v1__StorageOSPersistentVolumeSource.ReadOnly == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Patch_op(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Patch", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__StorageOSPersistentVolumeSource.ReadOnly(childComplexity), true -func (ec *executionContext) _Patch_path(ctx context.Context, field graphql.CollectedField, obj *json_patch.PatchOperation) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Patch_path(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__StorageOSPersistentVolumeSource.secretRef": + if e.complexity.K8s__io___api___core___v1__StorageOSPersistentVolumeSource.SecretRef == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Path, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__StorageOSPersistentVolumeSource.SecretRef(childComplexity), true + + case "K8s__io___api___core___v1__StorageOSPersistentVolumeSource.volumeName": + if e.complexity.K8s__io___api___core___v1__StorageOSPersistentVolumeSource.VolumeName == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Patch_path(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Patch", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__StorageOSPersistentVolumeSource.VolumeName(childComplexity), true -func (ec *executionContext) _Patch_value(ctx context.Context, field graphql.CollectedField, obj *json_patch.PatchOperation) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Patch_value(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__StorageOSPersistentVolumeSource.volumeNamespace": + if e.complexity.K8s__io___api___core___v1__StorageOSPersistentVolumeSource.VolumeNamespace == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Patch().Value(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(interface{}) - fc.Result = res - return ec.marshalOAny2interface(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Patch_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Patch", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Any does not have child fields") - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__StorageOSPersistentVolumeSource.VolumeNamespace(childComplexity), true -func (ec *executionContext) _Query_infra_checkNameAvailability(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_infra_checkNameAvailability(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__Taint.effect": + if e.complexity.K8s__io___api___core___v1__Taint.Effect == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().InfraCheckNameAvailability(rctx, fc.Args["resType"].(domain.ResType), fc.Args["name"].(string)) + + return e.complexity.K8s__io___api___core___v1__Taint.Effect(childComplexity), true + + case "K8s__io___api___core___v1__Taint.key": + if e.complexity.K8s__io___api___core___v1__Taint.Key == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) + + return e.complexity.K8s__io___api___core___v1__Taint.Key(childComplexity), true + + case "K8s__io___api___core___v1__Taint.timeAdded": + if e.complexity.K8s__io___api___core___v1__Taint.TimeAdded == nil { + break } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) + + return e.complexity.K8s__io___api___core___v1__Taint.TimeAdded(childComplexity), true + + case "K8s__io___api___core___v1__Taint.value": + if e.complexity.K8s__io___api___core___v1__Taint.Value == nil { + break } - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return e.complexity.K8s__io___api___core___v1__Taint.Value(childComplexity), true + + case "K8s__io___api___core___v1__Toleration.effect": + if e.complexity.K8s__io___api___core___v1__Toleration.Effect == nil { + break } - if tmp == nil { - return nil, nil + + return e.complexity.K8s__io___api___core___v1__Toleration.Effect(childComplexity), true + + case "K8s__io___api___core___v1__Toleration.key": + if e.complexity.K8s__io___api___core___v1__Toleration.Key == nil { + break } - if data, ok := tmp.(*domain.CheckNameAvailabilityOutput); ok { - return data, nil + + return e.complexity.K8s__io___api___core___v1__Toleration.Key(childComplexity), true + + case "K8s__io___api___core___v1__Toleration.operator": + if e.complexity.K8s__io___api___core___v1__Toleration.Operator == nil { + break } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/infra/internal/domain.CheckNameAvailabilityOutput`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.K8s__io___api___core___v1__Toleration.Operator(childComplexity), true + + case "K8s__io___api___core___v1__Toleration.tolerationSeconds": + if e.complexity.K8s__io___api___core___v1__Toleration.TolerationSeconds == nil { + break } - return graphql.Null - } - res := resTmp.(*domain.CheckNameAvailabilityOutput) - fc.Result = res - return ec.marshalNCheckNameAvailabilityOutput2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚐCheckNameAvailabilityOutput(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Query_infra_checkNameAvailability(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 "result": - return ec.fieldContext_CheckNameAvailabilityOutput_result(ctx, field) - case "suggestedNames": - return ec.fieldContext_CheckNameAvailabilityOutput_suggestedNames(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type CheckNameAvailabilityOutput", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + return e.complexity.K8s__io___api___core___v1__Toleration.TolerationSeconds(childComplexity), true + + case "K8s__io___api___core___v1__Toleration.value": + if e.complexity.K8s__io___api___core___v1__Toleration.Value == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_infra_checkNameAvailability_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _Query_infra_listBYOCClusters(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_infra_listBYOCClusters(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.K8s__io___api___core___v1__Toleration.Value(childComplexity), true + + case "K8s__io___api___core___v1__TypedLocalObjectReference.apiGroup": + if e.complexity.K8s__io___api___core___v1__TypedLocalObjectReference.APIGroup == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().InfraListBYOCClusters(rctx) + + return e.complexity.K8s__io___api___core___v1__TypedLocalObjectReference.APIGroup(childComplexity), true + + case "K8s__io___api___core___v1__TypedLocalObjectReference.kind": + if e.complexity.K8s__io___api___core___v1__TypedLocalObjectReference.Kind == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) + + return e.complexity.K8s__io___api___core___v1__TypedLocalObjectReference.Kind(childComplexity), true + + case "K8s__io___api___core___v1__TypedLocalObjectReference.name": + if e.complexity.K8s__io___api___core___v1__TypedLocalObjectReference.Name == nil { + break } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) + + return e.complexity.K8s__io___api___core___v1__TypedLocalObjectReference.Name(childComplexity), true + + case "K8s__io___api___core___v1__TypedObjectReference.apiGroup": + if e.complexity.K8s__io___api___core___v1__TypedObjectReference.APIGroup == nil { + break } - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return e.complexity.K8s__io___api___core___v1__TypedObjectReference.APIGroup(childComplexity), true + + case "K8s__io___api___core___v1__TypedObjectReference.kind": + if e.complexity.K8s__io___api___core___v1__TypedObjectReference.Kind == nil { + break } - if tmp == nil { - return nil, nil + + return e.complexity.K8s__io___api___core___v1__TypedObjectReference.Kind(childComplexity), true + + case "K8s__io___api___core___v1__TypedObjectReference.name": + if e.complexity.K8s__io___api___core___v1__TypedObjectReference.Name == nil { + break } - if data, ok := tmp.([]*entities.BYOCCluster); ok { - return data, nil + + return e.complexity.K8s__io___api___core___v1__TypedObjectReference.Name(childComplexity), true + + case "K8s__io___api___core___v1__TypedObjectReference.namespace": + if e.complexity.K8s__io___api___core___v1__TypedObjectReference.Namespace == nil { + break } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*kloudlite.io/apps/infra/internal/domain/entities.BYOCCluster`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*entities.BYOCCluster) - fc.Result = res - return ec.marshalOBYOCCluster2ᚕᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐBYOCClusterᚄ(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Query_infra_listBYOCClusters(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 "metadata": - return ec.fieldContext_BYOCCluster_metadata(ctx, field) - case "syncStatus": - return ec.fieldContext_BYOCCluster_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_BYOCCluster_spec(ctx, field) - case "status": - return ec.fieldContext_BYOCCluster_status(ctx, field) - case "apiVersion": - return ec.fieldContext_BYOCCluster_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_BYOCCluster_kind(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type BYOCCluster", field.Name) - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___core___v1__TypedObjectReference.Namespace(childComplexity), true -func (ec *executionContext) _Query_infra_getBYOCCluster(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_infra_getBYOCCluster(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___core___v1__VolumeNodeAffinity.required": + if e.complexity.K8s__io___api___core___v1__VolumeNodeAffinity.Required == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().InfraGetBYOCCluster(rctx, fc.Args["name"].(string)) + + return e.complexity.K8s__io___api___core___v1__VolumeNodeAffinity.Required(childComplexity), true + + case "K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource.fsType": + if e.complexity.K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource.FsType == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) + + return e.complexity.K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource.FsType(childComplexity), true + + case "K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource.storagePolicyID": + if e.complexity.K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource.StoragePolicyID == nil { + break } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) + + return e.complexity.K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource.StoragePolicyID(childComplexity), true + + case "K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource.storagePolicyName": + if e.complexity.K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource.StoragePolicyName == nil { + break } - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return e.complexity.K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource.StoragePolicyName(childComplexity), true + + case "K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource.volumePath": + if e.complexity.K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource.VolumePath == nil { + break } - if tmp == nil { - return nil, nil + + return e.complexity.K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource.VolumePath(childComplexity), true + + case "K8s__io___api___core___v1__WeightedPodAffinityTerm.podAffinityTerm": + if e.complexity.K8s__io___api___core___v1__WeightedPodAffinityTerm.PodAffinityTerm == nil { + break } - if data, ok := tmp.(*entities.BYOCCluster); ok { - return data, nil + + return e.complexity.K8s__io___api___core___v1__WeightedPodAffinityTerm.PodAffinityTerm(childComplexity), true + + case "K8s__io___api___core___v1__WeightedPodAffinityTerm.weight": + if e.complexity.K8s__io___api___core___v1__WeightedPodAffinityTerm.Weight == nil { + break } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/infra/internal/domain/entities.BYOCCluster`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*entities.BYOCCluster) - fc.Result = res - return ec.marshalOBYOCCluster2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐBYOCCluster(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Query_infra_getBYOCCluster(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 "metadata": - return ec.fieldContext_BYOCCluster_metadata(ctx, field) - case "syncStatus": - return ec.fieldContext_BYOCCluster_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_BYOCCluster_spec(ctx, field) - case "status": - return ec.fieldContext_BYOCCluster_status(ctx, field) - case "apiVersion": - return ec.fieldContext_BYOCCluster_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_BYOCCluster_kind(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type BYOCCluster", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + return e.complexity.K8s__io___api___core___v1__WeightedPodAffinityTerm.Weight(childComplexity), true + + case "K8s__io___api___storage___v1__VolumeAttachmentSource.inlineVolumeSpec": + if e.complexity.K8s__io___api___storage___v1__VolumeAttachmentSource.InlineVolumeSpec == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_infra_getBYOCCluster_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _Query_infra_listClusters(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_infra_listClusters(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.K8s__io___api___storage___v1__VolumeAttachmentSource.InlineVolumeSpec(childComplexity), true + + case "K8s__io___api___storage___v1__VolumeAttachmentSource.persistentVolumeName": + if e.complexity.K8s__io___api___storage___v1__VolumeAttachmentSource.PersistentVolumeName == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().InfraListClusters(rctx) + + return e.complexity.K8s__io___api___storage___v1__VolumeAttachmentSource.PersistentVolumeName(childComplexity), true + + case "K8s__io___api___storage___v1__VolumeAttachmentSpec.attacher": + if e.complexity.K8s__io___api___storage___v1__VolumeAttachmentSpec.Attacher == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) + + return e.complexity.K8s__io___api___storage___v1__VolumeAttachmentSpec.Attacher(childComplexity), true + + case "K8s__io___api___storage___v1__VolumeAttachmentSpec.nodeName": + if e.complexity.K8s__io___api___storage___v1__VolumeAttachmentSpec.NodeName == nil { + break } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) + + return e.complexity.K8s__io___api___storage___v1__VolumeAttachmentSpec.NodeName(childComplexity), true + + case "K8s__io___api___storage___v1__VolumeAttachmentSpec.source": + if e.complexity.K8s__io___api___storage___v1__VolumeAttachmentSpec.Source == nil { + break } - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return e.complexity.K8s__io___api___storage___v1__VolumeAttachmentSpec.Source(childComplexity), true + + case "K8s__io___api___storage___v1__VolumeAttachmentStatus.attachError": + if e.complexity.K8s__io___api___storage___v1__VolumeAttachmentStatus.AttachError == nil { + break } - if tmp == nil { - return nil, nil + + return e.complexity.K8s__io___api___storage___v1__VolumeAttachmentStatus.AttachError(childComplexity), true + + case "K8s__io___api___storage___v1__VolumeAttachmentStatus.attached": + if e.complexity.K8s__io___api___storage___v1__VolumeAttachmentStatus.Attached == nil { + break } - if data, ok := tmp.([]*entities.Cluster); ok { - return data, nil + + return e.complexity.K8s__io___api___storage___v1__VolumeAttachmentStatus.Attached(childComplexity), true + + case "K8s__io___api___storage___v1__VolumeAttachmentStatus.attachmentMetadata": + if e.complexity.K8s__io___api___storage___v1__VolumeAttachmentStatus.AttachmentMetadata == nil { + break } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*kloudlite.io/apps/infra/internal/domain/entities.Cluster`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*entities.Cluster) - fc.Result = res - return ec.marshalOCluster2ᚕᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐClusterᚄ(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Query_infra_listClusters(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 "apiVersion": - return ec.fieldContext_Cluster_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_Cluster_kind(ctx, field) - case "metadata": - return ec.fieldContext_Cluster_metadata(ctx, field) - case "syncStatus": - return ec.fieldContext_Cluster_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_Cluster_spec(ctx, field) - case "status": - return ec.fieldContext_Cluster_status(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Cluster", field.Name) - }, - } - return fc, nil -} + return e.complexity.K8s__io___api___storage___v1__VolumeAttachmentStatus.AttachmentMetadata(childComplexity), true -func (ec *executionContext) _Query_infra_getCluster(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_infra_getCluster(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___api___storage___v1__VolumeAttachmentStatus.detachError": + if e.complexity.K8s__io___api___storage___v1__VolumeAttachmentStatus.DetachError == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().InfraGetCluster(rctx, fc.Args["name"].(string)) + + return e.complexity.K8s__io___api___storage___v1__VolumeAttachmentStatus.DetachError(childComplexity), true + + case "K8s__io___api___storage___v1__VolumeError.message": + if e.complexity.K8s__io___api___storage___v1__VolumeError.Message == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) + + return e.complexity.K8s__io___api___storage___v1__VolumeError.Message(childComplexity), true + + case "K8s__io___api___storage___v1__VolumeError.time": + if e.complexity.K8s__io___api___storage___v1__VolumeError.Time == nil { + break } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) + + return e.complexity.K8s__io___api___storage___v1__VolumeError.Time(childComplexity), true + + case "K8s__io___apimachinery___pkg___api___resource__Quantity.Format": + if e.complexity.K8s__io___apimachinery___pkg___api___resource__Quantity.Format == nil { + break } - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return e.complexity.K8s__io___apimachinery___pkg___api___resource__Quantity.Format(childComplexity), true + + case "K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector.matchExpressions": + if e.complexity.K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector.MatchExpressions == nil { + break } - if tmp == nil { - return nil, nil + + return e.complexity.K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector.MatchExpressions(childComplexity), true + + case "K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector.matchLabels": + if e.complexity.K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector.MatchLabels == nil { + break } - if data, ok := tmp.(*entities.Cluster); ok { - return data, nil + + return e.complexity.K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector.MatchLabels(childComplexity), true + + case "K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement.key": + if e.complexity.K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement.Key == nil { + break } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/infra/internal/domain/entities.Cluster`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*entities.Cluster) - fc.Result = res - return ec.marshalOCluster2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐCluster(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Query_infra_getCluster(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 "apiVersion": - return ec.fieldContext_Cluster_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_Cluster_kind(ctx, field) - case "metadata": - return ec.fieldContext_Cluster_metadata(ctx, field) - case "syncStatus": - return ec.fieldContext_Cluster_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_Cluster_spec(ctx, field) - case "status": - return ec.fieldContext_Cluster_status(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Cluster", field.Name) - }, - } - defer func() { - if 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_infra_getCluster_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} + return e.complexity.K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement.Key(childComplexity), true -func (ec *executionContext) _Query_infra_listCloudProviders(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_infra_listCloudProviders(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement.operator": + if e.complexity.K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement.Operator == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().InfraListCloudProviders(rctx) + + return e.complexity.K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement.Operator(childComplexity), true + + case "K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement.values": + if e.complexity.K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement.Values == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) + + return e.complexity.K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement.Values(childComplexity), true + + case "MatchFilter.array": + if e.complexity.MatchFilter.Array == nil { + break } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) + + return e.complexity.MatchFilter.Array(childComplexity), true + + case "MatchFilter.exact": + if e.complexity.MatchFilter.Exact == nil { + break } - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return e.complexity.MatchFilter.Exact(childComplexity), true + + case "MatchFilter.matchType": + if e.complexity.MatchFilter.MatchType == nil { + break } - if tmp == nil { - return nil, nil + + return e.complexity.MatchFilter.MatchType(childComplexity), true + + case "MatchFilter.regex": + if e.complexity.MatchFilter.Regex == nil { + break } - if data, ok := tmp.([]*entities.CloudProvider); ok { - return data, nil + + return e.complexity.MatchFilter.Regex(childComplexity), true + + case "Metadata.annotations": + if e.complexity.Metadata.Annotations == nil { + break } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*kloudlite.io/apps/infra/internal/domain/entities.CloudProvider`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*entities.CloudProvider) - fc.Result = res - return ec.marshalOCloudProvider2ᚕᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐCloudProviderᚄ(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Query_infra_listCloudProviders(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 "apiVersion": - return ec.fieldContext_CloudProvider_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_CloudProvider_kind(ctx, field) - case "metadata": - return ec.fieldContext_CloudProvider_metadata(ctx, field) - case "syncStatus": - return ec.fieldContext_CloudProvider_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_CloudProvider_spec(ctx, field) - case "status": - return ec.fieldContext_CloudProvider_status(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type CloudProvider", field.Name) - }, - } - return fc, nil -} + return e.complexity.Metadata.Annotations(childComplexity), true -func (ec *executionContext) _Query_infra_getCloudProvider(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_infra_getCloudProvider(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Metadata.creationTimestamp": + if e.complexity.Metadata.CreationTimestamp == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().InfraGetCloudProvider(rctx, fc.Args["name"].(string)) + + return e.complexity.Metadata.CreationTimestamp(childComplexity), true + + case "Metadata.deletionTimestamp": + if e.complexity.Metadata.DeletionTimestamp == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) + + return e.complexity.Metadata.DeletionTimestamp(childComplexity), true + + case "Metadata.generation": + if e.complexity.Metadata.Generation == nil { + break } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) + + return e.complexity.Metadata.Generation(childComplexity), true + + case "Metadata.labels": + if e.complexity.Metadata.Labels == nil { + break } - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return e.complexity.Metadata.Labels(childComplexity), true + + case "Metadata.name": + if e.complexity.Metadata.Name == nil { + break } - if tmp == nil { - return nil, nil + + return e.complexity.Metadata.Name(childComplexity), true + + case "Metadata.namespace": + if e.complexity.Metadata.Namespace == nil { + break } - if data, ok := tmp.(*entities.CloudProvider); ok { - return data, nil + + return e.complexity.Metadata.Namespace(childComplexity), true + + case "MsvcTemplate.category": + if e.complexity.MsvcTemplate.Category == nil { + break } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/infra/internal/domain/entities.CloudProvider`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*entities.CloudProvider) - fc.Result = res - return ec.marshalOCloudProvider2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐCloudProvider(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Query_infra_getCloudProvider(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 "apiVersion": - return ec.fieldContext_CloudProvider_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_CloudProvider_kind(ctx, field) - case "metadata": - return ec.fieldContext_CloudProvider_metadata(ctx, field) - case "syncStatus": - return ec.fieldContext_CloudProvider_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_CloudProvider_spec(ctx, field) - case "status": - return ec.fieldContext_CloudProvider_status(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type CloudProvider", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + return e.complexity.MsvcTemplate.Category(childComplexity), true + + case "MsvcTemplate.displayName": + if e.complexity.MsvcTemplate.DisplayName == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_infra_getCloudProvider_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _Query_infra_listEdges(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_infra_listEdges(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.MsvcTemplate.DisplayName(childComplexity), true + + case "MsvcTemplate.items": + if e.complexity.MsvcTemplate.Items == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().InfraListEdges(rctx, fc.Args["clusterName"].(string), fc.Args["providerName"].(*string)) + + return e.complexity.MsvcTemplate.Items(childComplexity), true + + case "Mutation.infra_createCluster": + if e.complexity.Mutation.InfraCreateCluster == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) + + args, err := ec.field_Mutation_infra_createCluster_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) + + return e.complexity.Mutation.InfraCreateCluster(childComplexity, args["cluster"].(entities.Cluster)), true + + case "Mutation.infra_createClusterManagedService": + if e.complexity.Mutation.InfraCreateClusterManagedService == nil { + break } - tmp, err := directive2(rctx) + args, err := ec.field_Mutation_infra_createClusterManagedService_args(context.TODO(), rawArgs) if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return 0, false } - if tmp == nil { - return nil, nil + + return e.complexity.Mutation.InfraCreateClusterManagedService(childComplexity, args["clusterName"].(string), args["service"].(entities.ClusterManagedService)), true + + case "Mutation.infra_createDomainEntry": + if e.complexity.Mutation.InfraCreateDomainEntry == nil { + break } - if data, ok := tmp.([]*entities.Edge); ok { - return data, nil + + args, err := ec.field_Mutation_infra_createDomainEntry_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*kloudlite.io/apps/infra/internal/domain/entities.Edge`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*entities.Edge) - fc.Result = res - return ec.marshalOEdge2ᚕᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐEdgeᚄ(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Query_infra_listEdges(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 "apiVersion": - return ec.fieldContext_Edge_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_Edge_kind(ctx, field) - case "metadata": - return ec.fieldContext_Edge_metadata(ctx, field) - case "syncStatus": - return ec.fieldContext_Edge_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_Edge_spec(ctx, field) - case "status": - return ec.fieldContext_Edge_status(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Edge", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + return e.complexity.Mutation.InfraCreateDomainEntry(childComplexity, args["domainEntry"].(entities.DomainEntry)), true + + case "Mutation.infra_createHelmRelease": + if e.complexity.Mutation.InfraCreateHelmRelease == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_infra_listEdges_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _Query_infra_getEdge(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_infra_getEdge(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + args, err := ec.field_Mutation_infra_createHelmRelease_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().InfraGetEdge(rctx, fc.Args["clusterName"].(string), fc.Args["name"].(string)) + + return e.complexity.Mutation.InfraCreateHelmRelease(childComplexity, args["clusterName"].(string), args["release"].(entities.HelmRelease)), true + + case "Mutation.infra_createNodePool": + if e.complexity.Mutation.InfraCreateNodePool == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) + + args, err := ec.field_Mutation_infra_createNodePool_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) + + return e.complexity.Mutation.InfraCreateNodePool(childComplexity, args["clusterName"].(string), args["pool"].(entities.NodePool)), true + + case "Mutation.infra_createProviderSecret": + if e.complexity.Mutation.InfraCreateProviderSecret == nil { + break } - tmp, err := directive2(rctx) + args, err := ec.field_Mutation_infra_createProviderSecret_args(context.TODO(), rawArgs) if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return 0, false } - if tmp == nil { - return nil, nil + + return e.complexity.Mutation.InfraCreateProviderSecret(childComplexity, args["secret"].(entities.CloudProviderSecret)), true + + case "Mutation.infra_deleteCluster": + if e.complexity.Mutation.InfraDeleteCluster == nil { + break } - if data, ok := tmp.(*entities.Edge); ok { - return data, nil + + args, err := ec.field_Mutation_infra_deleteCluster_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *kloudlite.io/apps/infra/internal/domain/entities.Edge`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*entities.Edge) - fc.Result = res - return ec.marshalOEdge2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐEdge(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Query_infra_getEdge(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 "apiVersion": - return ec.fieldContext_Edge_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_Edge_kind(ctx, field) - case "metadata": - return ec.fieldContext_Edge_metadata(ctx, field) - case "syncStatus": - return ec.fieldContext_Edge_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_Edge_spec(ctx, field) - case "status": - return ec.fieldContext_Edge_status(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Edge", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + return e.complexity.Mutation.InfraDeleteCluster(childComplexity, args["name"].(string)), true + + case "Mutation.infra_deleteClusterManagedService": + if e.complexity.Mutation.InfraDeleteClusterManagedService == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_infra_getEdge_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _Query_infra_getMasterNodes(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_infra_getMasterNodes(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + args, err := ec.field_Mutation_infra_deleteClusterManagedService_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().InfraGetMasterNodes(rctx, fc.Args["clusterName"].(string)) + + return e.complexity.Mutation.InfraDeleteClusterManagedService(childComplexity, args["clusterName"].(string), args["serviceName"].(string)), true + + case "Mutation.infra_deleteDomainEntry": + if e.complexity.Mutation.InfraDeleteDomainEntry == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) + + args, err := ec.field_Mutation_infra_deleteDomainEntry_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) + + return e.complexity.Mutation.InfraDeleteDomainEntry(childComplexity, args["domainName"].(string)), true + + case "Mutation.infra_deleteHelmRelease": + if e.complexity.Mutation.InfraDeleteHelmRelease == nil { + break } - tmp, err := directive2(rctx) + args, err := ec.field_Mutation_infra_deleteHelmRelease_args(context.TODO(), rawArgs) if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return 0, false } - if tmp == nil { - return nil, nil + + return e.complexity.Mutation.InfraDeleteHelmRelease(childComplexity, args["clusterName"].(string), args["releaseName"].(string)), true + + case "Mutation.infra_deleteNodePool": + if e.complexity.Mutation.InfraDeleteNodePool == nil { + break } - if data, ok := tmp.([]*entities.MasterNode); ok { - return data, nil + + args, err := ec.field_Mutation_infra_deleteNodePool_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*kloudlite.io/apps/infra/internal/domain/entities.MasterNode`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*entities.MasterNode) - fc.Result = res - return ec.marshalOMasterNode2ᚕᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐMasterNodeᚄ(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Query_infra_getMasterNodes(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 "status": - return ec.fieldContext_MasterNode_status(ctx, field) - case "apiVersion": - return ec.fieldContext_MasterNode_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_MasterNode_kind(ctx, field) - case "metadata": - return ec.fieldContext_MasterNode_metadata(ctx, field) - case "syncStatus": - return ec.fieldContext_MasterNode_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_MasterNode_spec(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type MasterNode", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + return e.complexity.Mutation.InfraDeleteNodePool(childComplexity, args["clusterName"].(string), args["poolName"].(string)), true + + case "Mutation.infra_deleteProviderSecret": + if e.complexity.Mutation.InfraDeleteProviderSecret == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_infra_getMasterNodes_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _Query_infra_getWorkerNodes(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_infra_getWorkerNodes(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + args, err := ec.field_Mutation_infra_deleteProviderSecret_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().InfraGetWorkerNodes(rctx, fc.Args["clusterName"].(string), fc.Args["edgeName"].(string)) + + return e.complexity.Mutation.InfraDeleteProviderSecret(childComplexity, args["secretName"].(string)), true + + case "Mutation.infra_updateCluster": + if e.complexity.Mutation.InfraUpdateCluster == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) + + args, err := ec.field_Mutation_infra_updateCluster_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) + + return e.complexity.Mutation.InfraUpdateCluster(childComplexity, args["cluster"].(entities.Cluster)), true + + case "Mutation.infra_updateClusterManagedService": + if e.complexity.Mutation.InfraUpdateClusterManagedService == nil { + break } - tmp, err := directive2(rctx) + args, err := ec.field_Mutation_infra_updateClusterManagedService_args(context.TODO(), rawArgs) if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return 0, false } - if tmp == nil { - return nil, nil + + return e.complexity.Mutation.InfraUpdateClusterManagedService(childComplexity, args["clusterName"].(string), args["service"].(entities.ClusterManagedService)), true + + case "Mutation.infra_updateDomainEntry": + if e.complexity.Mutation.InfraUpdateDomainEntry == nil { + break } - if data, ok := tmp.([]*entities.WorkerNode); ok { - return data, nil + + args, err := ec.field_Mutation_infra_updateDomainEntry_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*kloudlite.io/apps/infra/internal/domain/entities.WorkerNode`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*entities.WorkerNode) - fc.Result = res - return ec.marshalOWorkerNode2ᚕᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐWorkerNodeᚄ(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Query_infra_getWorkerNodes(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 "metadata": - return ec.fieldContext_WorkerNode_metadata(ctx, field) - case "syncStatus": - return ec.fieldContext_WorkerNode_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_WorkerNode_spec(ctx, field) - case "status": - return ec.fieldContext_WorkerNode_status(ctx, field) - case "apiVersion": - return ec.fieldContext_WorkerNode_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_WorkerNode_kind(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type WorkerNode", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + return e.complexity.Mutation.InfraUpdateDomainEntry(childComplexity, args["domainEntry"].(entities.DomainEntry)), true + + case "Mutation.infra_updateHelmRelease": + if e.complexity.Mutation.InfraUpdateHelmRelease == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_infra_getWorkerNodes_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _Query_infra_getNodePools(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_infra_getNodePools(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + args, err := ec.field_Mutation_infra_updateHelmRelease_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().InfraGetNodePools(rctx, fc.Args["clusterName"].(string), fc.Args["edgeName"].(string)) + + return e.complexity.Mutation.InfraUpdateHelmRelease(childComplexity, args["clusterName"].(string), args["release"].(entities.HelmRelease)), true + + case "Mutation.infra_updateNodePool": + if e.complexity.Mutation.InfraUpdateNodePool == nil { + break } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) + + args, err := ec.field_Mutation_infra_updateNodePool_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) + + return e.complexity.Mutation.InfraUpdateNodePool(childComplexity, args["clusterName"].(string), args["pool"].(entities.NodePool)), true + + case "Mutation.infra_updateProviderSecret": + if e.complexity.Mutation.InfraUpdateProviderSecret == nil { + break } - tmp, err := directive2(rctx) + args, err := ec.field_Mutation_infra_updateProviderSecret_args(context.TODO(), rawArgs) if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) + return 0, false } - if tmp == nil { - return nil, nil + + return e.complexity.Mutation.InfraUpdateProviderSecret(childComplexity, args["secret"].(entities.CloudProviderSecret)), true + + case "Namespace.apiVersion": + if e.complexity.Namespace.APIVersion == nil { + break } - if data, ok := tmp.([]*entities.NodePool); ok { - return data, nil + + return e.complexity.Namespace.APIVersion(childComplexity), true + + case "Namespace.accountName": + if e.complexity.Namespace.AccountName == nil { + break } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*kloudlite.io/apps/infra/internal/domain/entities.NodePool`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*entities.NodePool) - fc.Result = res - return ec.marshalONodePool2ᚕᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐNodePoolᚄ(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Query_infra_getNodePools(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 "apiVersion": - return ec.fieldContext_NodePool_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_NodePool_kind(ctx, field) - case "metadata": - return ec.fieldContext_NodePool_metadata(ctx, field) - case "syncStatus": - return ec.fieldContext_NodePool_syncStatus(ctx, field) - case "spec": - return ec.fieldContext_NodePool_spec(ctx, field) - case "status": - return ec.fieldContext_NodePool_status(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type NodePool", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + return e.complexity.Namespace.AccountName(childComplexity), true + + case "Namespace.clusterName": + if e.complexity.Namespace.ClusterName == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_infra_getNodePools_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _Query__service(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query__service(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.Namespace.ClusterName(childComplexity), true + + case "Namespace.createdBy": + if e.complexity.Namespace.CreatedBy == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.__resolve__service(ctx) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.Namespace.CreatedBy(childComplexity), true + + case "Namespace.creationTime": + if e.complexity.Namespace.CreationTime == nil { + break } - return graphql.Null - } - res := resTmp.(fedruntime.Service) - fc.Result = res - return ec.marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Query__service(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 "sdl": - return ec.fieldContext__Service_sdl(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type _Service", field.Name) - }, - } - return fc, nil -} + return e.complexity.Namespace.CreationTime(childComplexity), true -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 + case "Namespace.displayName": + if e.complexity.Namespace.DisplayName == nil { + break } - }() - 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) + return e.complexity.Namespace.DisplayName(childComplexity), true + + case "Namespace.id": + if e.complexity.Namespace.ID == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query___schema(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return e.complexity.Namespace.ID(childComplexity), true + + case "Namespace.kind": + if e.complexity.Namespace.Kind == nil { + break } - }() - 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(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 "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 -} + return e.complexity.Namespace.Kind(childComplexity), true -func (ec *executionContext) _Secret_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_syncStatus(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Namespace.lastUpdatedBy": + if e.complexity.Namespace.LastUpdatedBy == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SyncStatus, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(types.SyncStatus) - fc.Result = res - return ec.marshalOSyncStatus2kloudliteᚗioᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Secret_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Secret", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "syncScheduledAt": - return ec.fieldContext_SyncStatus_syncScheduledAt(ctx, field) - case "lastSyncedAt": - return ec.fieldContext_SyncStatus_lastSyncedAt(ctx, field) - case "action": - return ec.fieldContext_SyncStatus_action(ctx, field) - case "generation": - return ec.fieldContext_SyncStatus_generation(ctx, field) - case "state": - return ec.fieldContext_SyncStatus_state(ctx, field) - case "error": - return ec.fieldContext_SyncStatus_error(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type SyncStatus", field.Name) - }, - } - return fc, nil -} + return e.complexity.Namespace.LastUpdatedBy(childComplexity), true -func (ec *executionContext) _Secret_stringData(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_stringData(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Namespace.markedForDeletion": + if e.complexity.Namespace.MarkedForDeletion == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Secret().StringData(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Secret_stringData(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Secret", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Namespace.MarkedForDeletion(childComplexity), true -func (ec *executionContext) _Secret_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_apiVersion(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Namespace.metadata": + if e.complexity.Namespace.ObjectMeta == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.APIVersion, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Secret_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Secret", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Namespace.ObjectMeta(childComplexity), true -func (ec *executionContext) _Secret_data(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_data(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Namespace.recordVersion": + if e.complexity.Namespace.RecordVersion == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Secret().Data(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Secret_data(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Secret", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Namespace.RecordVersion(childComplexity), true -func (ec *executionContext) _Secret_enabled(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_enabled(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Namespace.spec": + if e.complexity.Namespace.Spec == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Enabled, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalOBoolean2bool(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Secret_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Secret", - 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 -} + return e.complexity.Namespace.Spec(childComplexity), true -func (ec *executionContext) _Secret_kind(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_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 + case "Namespace.status": + if e.complexity.Namespace.Status == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Secret_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Secret", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Namespace.Status(childComplexity), true -func (ec *executionContext) _Secret_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_metadata(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Namespace.syncStatus": + if e.complexity.Namespace.SyncStatus == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ObjectMeta, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.Namespace.SyncStatus(childComplexity), true + + case "Namespace.updateTime": + if e.complexity.Namespace.UpdateTime == nil { + break } - return graphql.Null - } - res := resTmp.(v1.ObjectMeta) - fc.Result = res - return ec.marshalNMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Secret_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Secret", - 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_Metadata_name(ctx, field) - case "namespace": - return ec.fieldContext_Metadata_namespace(ctx, field) - case "labels": - return ec.fieldContext_Metadata_labels(ctx, field) - case "annotations": - return ec.fieldContext_Metadata_annotations(ctx, field) - case "creationTimestamp": - return ec.fieldContext_Metadata_creationTimestamp(ctx, field) - case "deletionTimestamp": - return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) - case "generation": - return ec.fieldContext_Metadata_generation(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) - }, - } - return fc, nil -} + return e.complexity.Namespace.UpdateTime(childComplexity), true -func (ec *executionContext) _Secret_overrides(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_overrides(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "NamespaceEdge.cursor": + if e.complexity.NamespaceEdge.Cursor == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Overrides, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*v11.JsonPatch) - fc.Result = res - return ec.marshalOOverrides2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋapisᚋcrdsᚋv1ᚐJsonPatch(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Secret_overrides(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Secret", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "applied": - return ec.fieldContext_Overrides_applied(ctx, field) - case "patches": - return ec.fieldContext_Overrides_patches(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Overrides", field.Name) - }, - } - return fc, nil -} + return e.complexity.NamespaceEdge.Cursor(childComplexity), true -func (ec *executionContext) _Secret_projectName(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_projectName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "NamespaceEdge.node": + if e.complexity.NamespaceEdge.Node == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ProjectName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Secret_projectName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Secret", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.NamespaceEdge.Node(childComplexity), true -func (ec *executionContext) _Secret_type(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_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 + case "NamespacePaginatedRecords.edges": + if e.complexity.NamespacePaginatedRecords.Edges == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Secret().Type(rctx, obj) - }) - 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_Secret_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Secret", - 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 -} + return e.complexity.NamespacePaginatedRecords.Edges(childComplexity), true -func (ec *executionContext) _Secret_status(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_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 + case "NamespacePaginatedRecords.pageInfo": + if e.complexity.NamespacePaginatedRecords.PageInfo == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Status, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(operator.Status) - fc.Result = res - return ec.marshalOStatus2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Secret_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Secret", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "isReady": - return ec.fieldContext_Status_isReady(ctx, field) - case "checks": - return ec.fieldContext_Status_checks(ctx, field) - case "displayVars": - return ec.fieldContext_Status_displayVars(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Status", field.Name) - }, - } - return fc, nil -} + return e.complexity.NamespacePaginatedRecords.PageInfo(childComplexity), true -func (ec *executionContext) _Status_isReady(ctx context.Context, field graphql.CollectedField, obj *operator.Status) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Status_isReady(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "NamespacePaginatedRecords.totalCount": + if e.complexity.NamespacePaginatedRecords.TotalCount == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.IsReady, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.NamespacePaginatedRecords.TotalCount(childComplexity), true + + case "Node.apiVersion": + if e.complexity.Node.APIVersion == nil { + break } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Status_isReady(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Status", - 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 -} + return e.complexity.Node.APIVersion(childComplexity), true -func (ec *executionContext) _Status_checks(ctx context.Context, field graphql.CollectedField, obj *operator.Status) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Status_checks(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Node.accountName": + if e.complexity.Node.AccountName == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Status().Checks(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Status_checks(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Status", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Node.AccountName(childComplexity), true -func (ec *executionContext) _Status_displayVars(ctx context.Context, field graphql.CollectedField, obj *operator.Status) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Status_displayVars(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Node.clusterName": + if e.complexity.Node.ClusterName == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Status().DisplayVars(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOJson2map(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Status_displayVars(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Status", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Json does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Node.ClusterName(childComplexity), true -func (ec *executionContext) _SyncStatus_syncScheduledAt(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SyncStatus_syncScheduledAt(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Node.creationTime": + if e.complexity.Node.CreationTime == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.SyncStatus().SyncScheduledAt(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 e.complexity.Node.CreationTime(childComplexity), true + + case "Node.id": + if e.complexity.Node.ID == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNDate2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_SyncStatus_syncScheduledAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "SyncStatus", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Date does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Node.ID(childComplexity), true -func (ec *executionContext) _SyncStatus_lastSyncedAt(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SyncStatus_lastSyncedAt(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Node.kind": + if e.complexity.Node.Kind == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.SyncStatus().LastSyncedAt(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalODate2ᚖstring(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_SyncStatus_lastSyncedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "SyncStatus", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Date does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Node.Kind(childComplexity), true -func (ec *executionContext) _SyncStatus_action(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SyncStatus_action(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Node.markedForDeletion": + if e.complexity.Node.MarkedForDeletion == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Action, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.Node.MarkedForDeletion(childComplexity), true + + case "Node.metadata": + if e.complexity.Node.ObjectMeta == nil { + break } - return graphql.Null - } - res := resTmp.(types.SyncAction) - fc.Result = res - return ec.marshalNSyncAction2kloudliteᚗioᚋpkgᚋtypesᚐSyncAction(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_SyncStatus_action(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "SyncStatus", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type SyncAction does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Node.ObjectMeta(childComplexity), true -func (ec *executionContext) _SyncStatus_generation(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SyncStatus_generation(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Node.recordVersion": + if e.complexity.Node.RecordVersion == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Generation, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.Node.RecordVersion(childComplexity), true + + case "Node.spec": + if e.complexity.Node.Spec == nil { + break } - return graphql.Null - } - res := resTmp.(int64) - fc.Result = res - return ec.marshalNInt2int64(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_SyncStatus_generation(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "SyncStatus", - 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 -} + return e.complexity.Node.Spec(childComplexity), true -func (ec *executionContext) _SyncStatus_state(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SyncStatus_state(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Node.status": + if e.complexity.Node.Status == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.State, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.Node.Status(childComplexity), true + + case "Node.syncStatus": + if e.complexity.Node.SyncStatus == nil { + break } - return graphql.Null - } - res := resTmp.(types.SyncState) - fc.Result = res - return ec.marshalNSyncState2kloudliteᚗioᚋpkgᚋtypesᚐSyncState(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_SyncStatus_state(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "SyncStatus", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type SyncState does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Node.SyncStatus(childComplexity), true -func (ec *executionContext) _SyncStatus_error(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SyncStatus_error(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "Node.updateTime": + if e.complexity.Node.UpdateTime == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Error, nil - }) - 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_SyncStatus_error(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "SyncStatus", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.Node.UpdateTime(childComplexity), true -func (ec *executionContext) _WorkerNode_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.WorkerNode) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_WorkerNode_metadata(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "NodeEdge.cursor": + if e.complexity.NodeEdge.Cursor == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ObjectMeta, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.NodeEdge.Cursor(childComplexity), true + + case "NodeEdge.node": + if e.complexity.NodeEdge.Node == nil { + break } - return graphql.Null - } - res := resTmp.(v1.ObjectMeta) - fc.Result = res - return ec.marshalNMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_WorkerNode_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "WorkerNode", - 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_Metadata_name(ctx, field) - case "namespace": - return ec.fieldContext_Metadata_namespace(ctx, field) - case "labels": - return ec.fieldContext_Metadata_labels(ctx, field) - case "annotations": - return ec.fieldContext_Metadata_annotations(ctx, field) - case "creationTimestamp": - return ec.fieldContext_Metadata_creationTimestamp(ctx, field) - case "deletionTimestamp": - return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) - case "generation": - return ec.fieldContext_Metadata_generation(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) - }, - } - return fc, nil -} + return e.complexity.NodeEdge.Node(childComplexity), true -func (ec *executionContext) _WorkerNode_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.WorkerNode) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_WorkerNode_syncStatus(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "NodePaginatedRecords.edges": + if e.complexity.NodePaginatedRecords.Edges == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SyncStatus, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(types.SyncStatus) - fc.Result = res - return ec.marshalOSyncStatus2kloudliteᚗioᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_WorkerNode_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "WorkerNode", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "syncScheduledAt": - return ec.fieldContext_SyncStatus_syncScheduledAt(ctx, field) - case "lastSyncedAt": - return ec.fieldContext_SyncStatus_lastSyncedAt(ctx, field) - case "action": - return ec.fieldContext_SyncStatus_action(ctx, field) - case "generation": - return ec.fieldContext_SyncStatus_generation(ctx, field) - case "state": - return ec.fieldContext_SyncStatus_state(ctx, field) - case "error": - return ec.fieldContext_SyncStatus_error(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type SyncStatus", field.Name) - }, - } - return fc, nil -} + return e.complexity.NodePaginatedRecords.Edges(childComplexity), true -func (ec *executionContext) _WorkerNode_spec(ctx context.Context, field graphql.CollectedField, obj *entities.WorkerNode) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_WorkerNode_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 + case "NodePaginatedRecords.pageInfo": + if e.complexity.NodePaginatedRecords.PageInfo == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.WorkerNode().Spec(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.WorkerNodeSpec) - fc.Result = res - return ec.marshalOWorkerNodeSpec2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐWorkerNodeSpec(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_WorkerNode_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "WorkerNode", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "clusterName": - return ec.fieldContext_WorkerNodeSpec_clusterName(ctx, field) - case "config": - return ec.fieldContext_WorkerNodeSpec_config(ctx, field) - case "nodeIndex": - return ec.fieldContext_WorkerNodeSpec_nodeIndex(ctx, field) - case "pool": - return ec.fieldContext_WorkerNodeSpec_pool(ctx, field) - case "provider": - return ec.fieldContext_WorkerNodeSpec_provider(ctx, field) - case "accountName": - return ec.fieldContext_WorkerNodeSpec_accountName(ctx, field) - case "edgeName": - return ec.fieldContext_WorkerNodeSpec_edgeName(ctx, field) - case "providerName": - return ec.fieldContext_WorkerNodeSpec_providerName(ctx, field) - case "region": - return ec.fieldContext_WorkerNodeSpec_region(ctx, field) - case "stateful": - return ec.fieldContext_WorkerNodeSpec_stateful(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type WorkerNodeSpec", field.Name) - }, - } - return fc, nil -} + return e.complexity.NodePaginatedRecords.PageInfo(childComplexity), true -func (ec *executionContext) _WorkerNode_status(ctx context.Context, field graphql.CollectedField, obj *entities.WorkerNode) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_WorkerNode_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 + case "NodePaginatedRecords.totalCount": + if e.complexity.NodePaginatedRecords.TotalCount == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.WorkerNode().Status(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*operator.Status) - fc.Result = res - return ec.marshalOStatus2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_WorkerNode_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "WorkerNode", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "isReady": - return ec.fieldContext_Status_isReady(ctx, field) - case "checks": - return ec.fieldContext_Status_checks(ctx, field) - case "displayVars": - return ec.fieldContext_Status_displayVars(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Status", field.Name) - }, - } - return fc, nil -} + return e.complexity.NodePaginatedRecords.TotalCount(childComplexity), true -func (ec *executionContext) _WorkerNode_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.WorkerNode) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_WorkerNode_apiVersion(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "NodePool.apiVersion": + if e.complexity.NodePool.APIVersion == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.APIVersion, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_WorkerNode_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "WorkerNode", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.NodePool.APIVersion(childComplexity), true -func (ec *executionContext) _WorkerNode_kind(ctx context.Context, field graphql.CollectedField, obj *entities.WorkerNode) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_WorkerNode_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 + case "NodePool.accountName": + if e.complexity.NodePool.AccountName == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_WorkerNode_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "WorkerNode", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.NodePool.AccountName(childComplexity), true -func (ec *executionContext) _WorkerNodeSpec_clusterName(ctx context.Context, field graphql.CollectedField, obj *model.WorkerNodeSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_WorkerNodeSpec_clusterName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + case "NodePool.clusterName": + if e.complexity.NodePool.ClusterName == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_WorkerNodeSpec_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "WorkerNodeSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.NodePool.ClusterName(childComplexity), true -func (ec *executionContext) _WorkerNodeSpec_config(ctx context.Context, field graphql.CollectedField, obj *model.WorkerNodeSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_WorkerNodeSpec_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 + case "NodePool.createdBy": + if e.complexity.NodePool.CreatedBy == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Config, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.NodePool.CreatedBy(childComplexity), true + + case "NodePool.creationTime": + if e.complexity.NodePool.CreationTime == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_WorkerNodeSpec_config(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "WorkerNodeSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.NodePool.CreationTime(childComplexity), true -func (ec *executionContext) _WorkerNodeSpec_nodeIndex(ctx context.Context, field graphql.CollectedField, obj *model.WorkerNodeSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_WorkerNodeSpec_nodeIndex(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "NodePool.displayName": + if e.complexity.NodePool.DisplayName == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.NodeIndex, 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_WorkerNodeSpec_nodeIndex(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "WorkerNodeSpec", - 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 -} + return e.complexity.NodePool.DisplayName(childComplexity), true -func (ec *executionContext) _WorkerNodeSpec_pool(ctx context.Context, field graphql.CollectedField, obj *model.WorkerNodeSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_WorkerNodeSpec_pool(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "NodePool.id": + if e.complexity.NodePool.ID == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Pool, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.NodePool.ID(childComplexity), true + + case "NodePool.kind": + if e.complexity.NodePool.Kind == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_WorkerNodeSpec_pool(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "WorkerNodeSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.NodePool.Kind(childComplexity), true -func (ec *executionContext) _WorkerNodeSpec_provider(ctx context.Context, field graphql.CollectedField, obj *model.WorkerNodeSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_WorkerNodeSpec_provider(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "NodePool.lastUpdatedBy": + if e.complexity.NodePool.LastUpdatedBy == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Provider, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.NodePool.LastUpdatedBy(childComplexity), true + + case "NodePool.markedForDeletion": + if e.complexity.NodePool.MarkedForDeletion == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_WorkerNodeSpec_provider(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "WorkerNodeSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.NodePool.MarkedForDeletion(childComplexity), true -func (ec *executionContext) _WorkerNodeSpec_accountName(ctx context.Context, field graphql.CollectedField, obj *model.WorkerNodeSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_WorkerNodeSpec_accountName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "NodePool.metadata": + if e.complexity.NodePool.ObjectMeta == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.AccountName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.NodePool.ObjectMeta(childComplexity), true + + case "NodePool.recordVersion": + if e.complexity.NodePool.RecordVersion == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_WorkerNodeSpec_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "WorkerNodeSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.NodePool.RecordVersion(childComplexity), true -func (ec *executionContext) _WorkerNodeSpec_edgeName(ctx context.Context, field graphql.CollectedField, obj *model.WorkerNodeSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_WorkerNodeSpec_edgeName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "NodePool.spec": + if e.complexity.NodePool.Spec == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.EdgeName, nil - }) - if err != nil { - ec.Error(ctx, err) - 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_WorkerNodeSpec_edgeName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "WorkerNodeSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.NodePool.Spec(childComplexity), true -func (ec *executionContext) _WorkerNodeSpec_providerName(ctx context.Context, field graphql.CollectedField, obj *model.WorkerNodeSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_WorkerNodeSpec_providerName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "NodePool.status": + if e.complexity.NodePool.Status == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ProviderName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.NodePool.Status(childComplexity), true + + case "NodePool.syncStatus": + if e.complexity.NodePool.SyncStatus == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_WorkerNodeSpec_providerName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "WorkerNodeSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.NodePool.SyncStatus(childComplexity), true -func (ec *executionContext) _WorkerNodeSpec_region(ctx context.Context, field graphql.CollectedField, obj *model.WorkerNodeSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_WorkerNodeSpec_region(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "NodePool.updateTime": + if e.complexity.NodePool.UpdateTime == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Region, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + + return e.complexity.NodePool.UpdateTime(childComplexity), true + + case "NodePoolEdge.cursor": + if e.complexity.NodePoolEdge.Cursor == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_WorkerNodeSpec_region(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "WorkerNodeSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.NodePoolEdge.Cursor(childComplexity), true -func (ec *executionContext) _WorkerNodeSpec_stateful(ctx context.Context, field graphql.CollectedField, obj *model.WorkerNodeSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_WorkerNodeSpec_stateful(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "NodePoolEdge.node": + if e.complexity.NodePoolEdge.Node == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Stateful, 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_WorkerNodeSpec_stateful(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "WorkerNodeSpec", - 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 -} + return e.complexity.NodePoolEdge.Node(childComplexity), true -func (ec *executionContext) __Service_sdl(ctx context.Context, field graphql.CollectedField, obj *fedruntime.Service) (ret graphql.Marshaler) { - fc, err := ec.fieldContext__Service_sdl(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + case "NodePoolPaginatedRecords.edges": + if e.complexity.NodePoolPaginatedRecords.Edges == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SDL, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext__Service_sdl(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "_Service", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.NodePoolPaginatedRecords.Edges(childComplexity), true -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 + case "NodePoolPaginatedRecords.pageInfo": + if e.complexity.NodePoolPaginatedRecords.PageInfo == nil { + break } - }() - 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 e.complexity.NodePoolPaginatedRecords.PageInfo(childComplexity), true + + case "NodePoolPaginatedRecords.totalCount": + if e.complexity.NodePoolPaginatedRecords.TotalCount == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___Directive_name(ctx 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 -} + return e.complexity.NodePoolPaginatedRecords.TotalCount(childComplexity), true -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 + case "PageInfo.endCursor": + if e.complexity.PageInfo.EndCursor == nil { + break } - }() - 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(ctx 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 -} + return e.complexity.PageInfo.EndCursor(childComplexity), true -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 + case "PageInfo.hasNextPage": + if e.complexity.PageInfo.HasNextPage == nil { + break } - }() - 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 e.complexity.PageInfo.HasNextPage(childComplexity), true + + case "PageInfo.hasPreviousPage": + if e.complexity.PageInfo.HasPreviousPage == nil { + break } - return graphql.Null - } - res := resTmp.([]string) - fc.Result = res - return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___Directive_locations(ctx 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 -} + return e.complexity.PageInfo.HasPreviousPage(childComplexity), true -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 + case "PageInfo.startCursor": + if e.complexity.PageInfo.StartCursor == nil { + break } - }() - 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 e.complexity.PageInfo.StartCursor(childComplexity), true + + case "PersistentVolume.apiVersion": + if e.complexity.PersistentVolume.APIVersion == nil { + break } - 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(ctx 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 -} + return e.complexity.PersistentVolume.APIVersion(childComplexity), true -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 + case "PersistentVolume.accountName": + if e.complexity.PersistentVolume.AccountName == nil { + break } - }() - 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 e.complexity.PersistentVolume.AccountName(childComplexity), true + + case "PersistentVolume.clusterName": + if e.complexity.PersistentVolume.ClusterName == nil { + break } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___Directive_isRepeatable(ctx 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 -} + return e.complexity.PersistentVolume.ClusterName(childComplexity), true -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 + case "PersistentVolume.createdBy": + if e.complexity.PersistentVolume.CreatedBy == nil { + break } - }() - 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 e.complexity.PersistentVolume.CreatedBy(childComplexity), true + + case "PersistentVolume.creationTime": + if e.complexity.PersistentVolume.CreationTime == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___EnumValue_name(ctx 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 -} + return e.complexity.PersistentVolume.CreationTime(childComplexity), true -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 + case "PersistentVolume.displayName": + if e.complexity.PersistentVolume.DisplayName == nil { + break } - }() - 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(ctx 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 -} + return e.complexity.PersistentVolume.DisplayName(childComplexity), true -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 + case "PersistentVolume.id": + if e.complexity.PersistentVolume.ID == nil { + break } - }() - 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 e.complexity.PersistentVolume.ID(childComplexity), true + + case "PersistentVolume.kind": + if e.complexity.PersistentVolume.Kind == nil { + break } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___EnumValue_isDeprecated(ctx 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 -} + return e.complexity.PersistentVolume.Kind(childComplexity), true -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 + case "PersistentVolume.lastUpdatedBy": + if e.complexity.PersistentVolume.LastUpdatedBy == nil { + break } - }() - 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(ctx 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 -} + return e.complexity.PersistentVolume.LastUpdatedBy(childComplexity), true -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 + case "PersistentVolume.markedForDeletion": + if e.complexity.PersistentVolume.MarkedForDeletion == nil { + break } - }() - 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 e.complexity.PersistentVolume.MarkedForDeletion(childComplexity), true + + case "PersistentVolume.metadata": + if e.complexity.PersistentVolume.ObjectMeta == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___Field_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.PersistentVolume.ObjectMeta(childComplexity), true -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 + case "PersistentVolume.recordVersion": + if e.complexity.PersistentVolume.RecordVersion == nil { + break } - }() - 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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.PersistentVolume.RecordVersion(childComplexity), true -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 + case "PersistentVolume.spec": + if e.complexity.PersistentVolume.Spec == nil { + break } - }() - 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 e.complexity.PersistentVolume.Spec(childComplexity), true + + case "PersistentVolume.status": + if e.complexity.PersistentVolume.Status == nil { + break } - 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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "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 -} + return e.complexity.PersistentVolume.Status(childComplexity), true -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 + case "PersistentVolume.syncStatus": + if e.complexity.PersistentVolume.SyncStatus == nil { + break } - }() - 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 e.complexity.PersistentVolume.SyncStatus(childComplexity), true + + case "PersistentVolume.updateTime": + if e.complexity.PersistentVolume.UpdateTime == nil { + break } - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___Field_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} + return e.complexity.PersistentVolume.UpdateTime(childComplexity), true -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 + case "PersistentVolumeClaim.apiVersion": + if e.complexity.PersistentVolumeClaim.APIVersion == nil { + break } - }() - 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 e.complexity.PersistentVolumeClaim.APIVersion(childComplexity), true + + case "PersistentVolumeClaim.accountName": + if e.complexity.PersistentVolumeClaim.AccountName == nil { + break } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___Field_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") - }, - } - return fc, nil -} + return e.complexity.PersistentVolumeClaim.AccountName(childComplexity), true -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 + case "PersistentVolumeClaim.clusterName": + if e.complexity.PersistentVolumeClaim.ClusterName == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DeprecationReason(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___Field_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.PersistentVolumeClaim.ClusterName(childComplexity), true -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 + case "PersistentVolumeClaim.createdBy": + if e.complexity.PersistentVolumeClaim.CreatedBy == nil { + break } - }() - 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 e.complexity.PersistentVolumeClaim.CreatedBy(childComplexity), true + + case "PersistentVolumeClaim.creationTime": + if e.complexity.PersistentVolumeClaim.CreationTime == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___InputValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.PersistentVolumeClaim.CreationTime(childComplexity), true -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 + case "PersistentVolumeClaim.displayName": + if e.complexity.PersistentVolumeClaim.DisplayName == nil { + break } - }() - 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(ctx 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 -} + return e.complexity.PersistentVolumeClaim.DisplayName(childComplexity), true -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 + case "PersistentVolumeClaim.id": + if e.complexity.PersistentVolumeClaim.ID == nil { + break } - }() - 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 e.complexity.PersistentVolumeClaim.ID(childComplexity), true + + case "PersistentVolumeClaim.kind": + if e.complexity.PersistentVolumeClaim.Kind == nil { + break } - 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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - 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 -} + return e.complexity.PersistentVolumeClaim.Kind(childComplexity), true -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 + case "PersistentVolumeClaim.lastUpdatedBy": + if e.complexity.PersistentVolumeClaim.LastUpdatedBy == nil { + break } - }() - 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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.PersistentVolumeClaim.LastUpdatedBy(childComplexity), true -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 + case "PersistentVolumeClaim.markedForDeletion": + if e.complexity.PersistentVolumeClaim.MarkedForDeletion == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___Schema_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + return e.complexity.PersistentVolumeClaim.MarkedForDeletion(childComplexity), true -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") + case "PersistentVolumeClaim.metadata": + if e.complexity.PersistentVolumeClaim.ObjectMeta == nil { + break } - return graphql.Null - } - res := resTmp.([]introspection.Type) - fc.Result = res - return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___Schema_types(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} + return e.complexity.PersistentVolumeClaim.ObjectMeta(childComplexity), true -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 + case "PersistentVolumeClaim.recordVersion": + if e.complexity.PersistentVolumeClaim.RecordVersion == nil { + break } - }() - 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 e.complexity.PersistentVolumeClaim.RecordVersion(childComplexity), true + + case "PersistentVolumeClaim.spec": + if e.complexity.PersistentVolumeClaim.Spec == nil { + break } - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___Schema_queryType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} + return e.complexity.PersistentVolumeClaim.Spec(childComplexity), true -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 + case "PersistentVolumeClaim.status": + if e.complexity.PersistentVolumeClaim.Status == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MutationType(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext___Schema_mutationType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} + return e.complexity.PersistentVolumeClaim.Status(childComplexity), true + + case "PersistentVolumeClaim.syncStatus": + if e.complexity.PersistentVolumeClaim.SyncStatus == nil { + break + } + + return e.complexity.PersistentVolumeClaim.SyncStatus(childComplexity), true + + case "PersistentVolumeClaim.updateTime": + if e.complexity.PersistentVolumeClaim.UpdateTime == nil { + break + } + + return e.complexity.PersistentVolumeClaim.UpdateTime(childComplexity), true + + case "PersistentVolumeClaimEdge.cursor": + if e.complexity.PersistentVolumeClaimEdge.Cursor == nil { + break + } + + return e.complexity.PersistentVolumeClaimEdge.Cursor(childComplexity), true + + case "PersistentVolumeClaimEdge.node": + if e.complexity.PersistentVolumeClaimEdge.Node == nil { + break + } + + return e.complexity.PersistentVolumeClaimEdge.Node(childComplexity), true + + case "PersistentVolumeClaimPaginatedRecords.edges": + if e.complexity.PersistentVolumeClaimPaginatedRecords.Edges == nil { + break + } + + return e.complexity.PersistentVolumeClaimPaginatedRecords.Edges(childComplexity), true + + case "PersistentVolumeClaimPaginatedRecords.pageInfo": + if e.complexity.PersistentVolumeClaimPaginatedRecords.PageInfo == nil { + break + } + + return e.complexity.PersistentVolumeClaimPaginatedRecords.PageInfo(childComplexity), true + + case "PersistentVolumeClaimPaginatedRecords.totalCount": + if e.complexity.PersistentVolumeClaimPaginatedRecords.TotalCount == nil { + break + } + + return e.complexity.PersistentVolumeClaimPaginatedRecords.TotalCount(childComplexity), true + + case "PersistentVolumeEdge.cursor": + if e.complexity.PersistentVolumeEdge.Cursor == nil { + break + } + + return e.complexity.PersistentVolumeEdge.Cursor(childComplexity), true + + case "PersistentVolumeEdge.node": + if e.complexity.PersistentVolumeEdge.Node == nil { + break + } + + return e.complexity.PersistentVolumeEdge.Node(childComplexity), true + + case "PersistentVolumePaginatedRecords.edges": + if e.complexity.PersistentVolumePaginatedRecords.Edges == nil { + break + } + + return e.complexity.PersistentVolumePaginatedRecords.Edges(childComplexity), true + + case "PersistentVolumePaginatedRecords.pageInfo": + if e.complexity.PersistentVolumePaginatedRecords.PageInfo == nil { + break + } + + return e.complexity.PersistentVolumePaginatedRecords.PageInfo(childComplexity), true + + case "PersistentVolumePaginatedRecords.totalCount": + if e.complexity.PersistentVolumePaginatedRecords.TotalCount == nil { + break + } + + return e.complexity.PersistentVolumePaginatedRecords.TotalCount(childComplexity), true + + case "Query.infra_checkAwsAccess": + if e.complexity.Query.InfraCheckAwsAccess == nil { + break + } + + args, err := ec.field_Query_infra_checkAwsAccess_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.InfraCheckAwsAccess(childComplexity, args["cloudproviderName"].(string)), true + + case "Query.infra_checkNameAvailability": + if e.complexity.Query.InfraCheckNameAvailability == nil { + break + } + + args, err := ec.field_Query_infra_checkNameAvailability_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.InfraCheckNameAvailability(childComplexity, args["resType"].(domain.ResType), args["clusterName"].(*string), args["name"].(string)), true + + case "Query.infra_getCluster": + if e.complexity.Query.InfraGetCluster == nil { + break + } + + args, err := ec.field_Query_infra_getCluster_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.InfraGetCluster(childComplexity, args["name"].(string)), true + + case "Query.infra_getClusterManagedService": + if e.complexity.Query.InfraGetClusterManagedService == nil { + break + } + + args, err := ec.field_Query_infra_getClusterManagedService_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.InfraGetClusterManagedService(childComplexity, args["clusterName"].(string), args["name"].(string)), true + + case "Query.infra_getDomainEntry": + if e.complexity.Query.InfraGetDomainEntry == nil { + break + } + + args, err := ec.field_Query_infra_getDomainEntry_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.InfraGetDomainEntry(childComplexity, args["domainName"].(string)), true + + case "Query.infra_getHelmRelease": + if e.complexity.Query.InfraGetHelmRelease == nil { + break + } + + args, err := ec.field_Query_infra_getHelmRelease_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.InfraGetHelmRelease(childComplexity, args["clusterName"].(string), args["name"].(string)), true + + case "Query.infra_getManagedServiceTemplate": + if e.complexity.Query.InfraGetManagedServiceTemplate == nil { + break + } + + args, err := ec.field_Query_infra_getManagedServiceTemplate_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.InfraGetManagedServiceTemplate(childComplexity, args["category"].(string), args["name"].(string)), true + + case "Query.infra_getNamespace": + if e.complexity.Query.InfraGetNamespace == nil { + break + } + + args, err := ec.field_Query_infra_getNamespace_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.InfraGetNamespace(childComplexity, args["clusterName"].(string), args["name"].(string)), true + + case "Query.infra_getNodePool": + if e.complexity.Query.InfraGetNodePool == nil { + break + } + + args, err := ec.field_Query_infra_getNodePool_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.InfraGetNodePool(childComplexity, args["clusterName"].(string), args["poolName"].(string)), true + + case "Query.infra_getProviderSecret": + if e.complexity.Query.InfraGetProviderSecret == nil { + break + } + + args, err := ec.field_Query_infra_getProviderSecret_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.InfraGetProviderSecret(childComplexity, args["name"].(string)), true + + case "Query.infra_getPV": + if e.complexity.Query.InfraGetPv == nil { + break + } + + args, err := ec.field_Query_infra_getPV_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.InfraGetPv(childComplexity, args["clusterName"].(string), args["name"].(string)), true + + case "Query.infra_getPVC": + if e.complexity.Query.InfraGetPvc == nil { + break + } + + args, err := ec.field_Query_infra_getPVC_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.InfraGetPvc(childComplexity, args["clusterName"].(string), args["name"].(string)), true + + case "Query.infra_getVolumeAttachment": + if e.complexity.Query.InfraGetVolumeAttachment == nil { + break + } + + args, err := ec.field_Query_infra_getVolumeAttachment_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.InfraGetVolumeAttachment(childComplexity, args["clusterName"].(string), args["name"].(string)), true + + case "Query.infra_listClusterManagedServices": + if e.complexity.Query.InfraListClusterManagedServices == nil { + break + } + + args, err := ec.field_Query_infra_listClusterManagedServices_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.InfraListClusterManagedServices(childComplexity, args["clusterName"].(string), args["search"].(*model.SearchClusterManagedService), args["pagination"].(*repos.CursorPagination)), true + + case "Query.infra_listClusters": + if e.complexity.Query.InfraListClusters == nil { + break + } + + args, err := ec.field_Query_infra_listClusters_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.InfraListClusters(childComplexity, args["search"].(*model.SearchCluster), args["pagination"].(*repos.CursorPagination)), true + + case "Query.infra_listDomainEntries": + if e.complexity.Query.InfraListDomainEntries == nil { + break + } + + args, err := ec.field_Query_infra_listDomainEntries_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.InfraListDomainEntries(childComplexity, args["search"].(*model.SearchDomainEntry), args["pagination"].(*repos.CursorPagination)), true + + case "Query.infra_listHelmReleases": + if e.complexity.Query.InfraListHelmReleases == nil { + break + } + + args, err := ec.field_Query_infra_listHelmReleases_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.InfraListHelmReleases(childComplexity, args["clusterName"].(string), args["search"].(*model.SearchHelmRelease), args["pagination"].(*repos.CursorPagination)), true + + case "Query.infra_listManagedServiceTemplates": + if e.complexity.Query.InfraListManagedServiceTemplates == nil { + break + } + + return e.complexity.Query.InfraListManagedServiceTemplates(childComplexity), true + + case "Query.infra_listNamespaces": + if e.complexity.Query.InfraListNamespaces == nil { + break + } + + args, err := ec.field_Query_infra_listNamespaces_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.InfraListNamespaces(childComplexity, args["clusterName"].(string), args["search"].(*model.SearchNamespaces), args["pq"].(*repos.CursorPagination)), true + + case "Query.infra_listNodePools": + if e.complexity.Query.InfraListNodePools == nil { + break + } + + args, err := ec.field_Query_infra_listNodePools_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.InfraListNodePools(childComplexity, args["clusterName"].(string), args["search"].(*model.SearchNodepool), args["pagination"].(*repos.CursorPagination)), true + + case "Query.infra_listPVCs": + if e.complexity.Query.InfraListPVCs == nil { + break + } + + args, err := ec.field_Query_infra_listPVCs_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.InfraListPVCs(childComplexity, args["clusterName"].(string), args["search"].(*model.SearchPersistentVolumeClaims), args["pq"].(*repos.CursorPagination)), true + + case "Query.infra_listPVs": + if e.complexity.Query.InfraListPVs == nil { + break + } + + args, err := ec.field_Query_infra_listPVs_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.InfraListPVs(childComplexity, args["clusterName"].(string), args["search"].(*model.SearchPersistentVolumes), args["pq"].(*repos.CursorPagination)), true + + case "Query.infra_listProviderSecrets": + if e.complexity.Query.InfraListProviderSecrets == nil { + break + } + + args, err := ec.field_Query_infra_listProviderSecrets_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.InfraListProviderSecrets(childComplexity, args["search"].(*model.SearchProviderSecret), args["pagination"].(*repos.CursorPagination)), true + + case "Query.infra_listVolumeAttachments": + if e.complexity.Query.InfraListVolumeAttachments == nil { + break + } + + args, err := ec.field_Query_infra_listVolumeAttachments_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.InfraListVolumeAttachments(childComplexity, args["clusterName"].(string), args["search"].(*model.SearchVolumeAttachments), args["pq"].(*repos.CursorPagination)), true + + case "Query._service": + if e.complexity.Query.__resolve__service == nil { + break + } + + return e.complexity.Query.__resolve__service(childComplexity), true + + case "VolumeAttachment.apiVersion": + if e.complexity.VolumeAttachment.APIVersion == nil { + break + } + + return e.complexity.VolumeAttachment.APIVersion(childComplexity), true + + case "VolumeAttachment.accountName": + if e.complexity.VolumeAttachment.AccountName == nil { + break + } + + return e.complexity.VolumeAttachment.AccountName(childComplexity), true + + case "VolumeAttachment.clusterName": + if e.complexity.VolumeAttachment.ClusterName == nil { + break + } + + return e.complexity.VolumeAttachment.ClusterName(childComplexity), true + + case "VolumeAttachment.createdBy": + if e.complexity.VolumeAttachment.CreatedBy == nil { + break + } + + return e.complexity.VolumeAttachment.CreatedBy(childComplexity), true + + case "VolumeAttachment.creationTime": + if e.complexity.VolumeAttachment.CreationTime == nil { + break + } + + return e.complexity.VolumeAttachment.CreationTime(childComplexity), true + + case "VolumeAttachment.displayName": + if e.complexity.VolumeAttachment.DisplayName == nil { + break + } + + return e.complexity.VolumeAttachment.DisplayName(childComplexity), true + + case "VolumeAttachment.id": + if e.complexity.VolumeAttachment.ID == nil { + break + } + + return e.complexity.VolumeAttachment.ID(childComplexity), true + + case "VolumeAttachment.kind": + if e.complexity.VolumeAttachment.Kind == nil { + break + } + + return e.complexity.VolumeAttachment.Kind(childComplexity), true + + case "VolumeAttachment.lastUpdatedBy": + if e.complexity.VolumeAttachment.LastUpdatedBy == nil { + break + } + + return e.complexity.VolumeAttachment.LastUpdatedBy(childComplexity), true + + case "VolumeAttachment.markedForDeletion": + if e.complexity.VolumeAttachment.MarkedForDeletion == nil { + break + } + + return e.complexity.VolumeAttachment.MarkedForDeletion(childComplexity), true + + case "VolumeAttachment.metadata": + if e.complexity.VolumeAttachment.ObjectMeta == nil { + break + } + + return e.complexity.VolumeAttachment.ObjectMeta(childComplexity), true + + case "VolumeAttachment.recordVersion": + if e.complexity.VolumeAttachment.RecordVersion == nil { + break + } + + return e.complexity.VolumeAttachment.RecordVersion(childComplexity), true + + case "VolumeAttachment.spec": + if e.complexity.VolumeAttachment.Spec == nil { + break + } + + return e.complexity.VolumeAttachment.Spec(childComplexity), true + + case "VolumeAttachment.status": + if e.complexity.VolumeAttachment.Status == nil { + break + } + + return e.complexity.VolumeAttachment.Status(childComplexity), true + + case "VolumeAttachment.syncStatus": + if e.complexity.VolumeAttachment.SyncStatus == nil { + break + } + + return e.complexity.VolumeAttachment.SyncStatus(childComplexity), true + + case "VolumeAttachment.updateTime": + if e.complexity.VolumeAttachment.UpdateTime == nil { + break + } + + return e.complexity.VolumeAttachment.UpdateTime(childComplexity), true + + case "VolumeAttachmentEdge.cursor": + if e.complexity.VolumeAttachmentEdge.Cursor == nil { + break + } + + return e.complexity.VolumeAttachmentEdge.Cursor(childComplexity), true + + case "VolumeAttachmentEdge.node": + if e.complexity.VolumeAttachmentEdge.Node == nil { + break + } + + return e.complexity.VolumeAttachmentEdge.Node(childComplexity), true + + case "VolumeAttachmentPaginatedRecords.edges": + if e.complexity.VolumeAttachmentPaginatedRecords.Edges == nil { + break + } + + return e.complexity.VolumeAttachmentPaginatedRecords.Edges(childComplexity), true + + case "VolumeAttachmentPaginatedRecords.pageInfo": + if e.complexity.VolumeAttachmentPaginatedRecords.PageInfo == nil { + break + } + + return e.complexity.VolumeAttachmentPaginatedRecords.PageInfo(childComplexity), true + + case "VolumeAttachmentPaginatedRecords.totalCount": + if e.complexity.VolumeAttachmentPaginatedRecords.TotalCount == nil { + break + } + + return e.complexity.VolumeAttachmentPaginatedRecords.TotalCount(childComplexity), true + + case "_Service.sdl": + if e.complexity._Service.SDL == nil { + break + } + + return e.complexity._Service.SDL(childComplexity), true + + } + return 0, false +} + +func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { + rc := graphql.GetOperationContext(ctx) + ec := executionContext{rc, e} + inputUnmarshalMap := graphql.BuildUnmarshalerMap( + ec.unmarshalInputCloudProviderSecretIn, + ec.unmarshalInputClusterIn, + ec.unmarshalInputClusterManagedServiceIn, + ec.unmarshalInputCursorPaginationIn, + ec.unmarshalInputDomainEntryIn, + ec.unmarshalInputGithub__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentialsIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfigIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfigIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfigIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfigIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNodeIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNodeIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfigIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__ClusterSpecIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__NodePoolSpecIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__NodePropsIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__NodeSpecIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___common____types__MinMaxFloatIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___common____types__SecretRefIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpecIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__HelmChartSpecIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__JobVarsIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn, + ec.unmarshalInputHelmReleaseIn, + ec.unmarshalInputK8s__io___api___core___v1__AWSElasticBlockStoreVolumeSourceIn, + ec.unmarshalInputK8s__io___api___core___v1__AffinityIn, + ec.unmarshalInputK8s__io___api___core___v1__AzureDiskVolumeSourceIn, + ec.unmarshalInputK8s__io___api___core___v1__AzureFilePersistentVolumeSourceIn, + ec.unmarshalInputK8s__io___api___core___v1__CSIPersistentVolumeSourceIn, + ec.unmarshalInputK8s__io___api___core___v1__CephFSPersistentVolumeSourceIn, + ec.unmarshalInputK8s__io___api___core___v1__CinderPersistentVolumeSourceIn, + ec.unmarshalInputK8s__io___api___core___v1__FCVolumeSourceIn, + ec.unmarshalInputK8s__io___api___core___v1__FlexPersistentVolumeSourceIn, + ec.unmarshalInputK8s__io___api___core___v1__FlockerVolumeSourceIn, + ec.unmarshalInputK8s__io___api___core___v1__GCEPersistentDiskVolumeSourceIn, + ec.unmarshalInputK8s__io___api___core___v1__GlusterfsPersistentVolumeSourceIn, + ec.unmarshalInputK8s__io___api___core___v1__HostPathVolumeSourceIn, + ec.unmarshalInputK8s__io___api___core___v1__ISCSIPersistentVolumeSourceIn, + ec.unmarshalInputK8s__io___api___core___v1__LocalVolumeSourceIn, + ec.unmarshalInputK8s__io___api___core___v1__NFSVolumeSourceIn, + ec.unmarshalInputK8s__io___api___core___v1__NamespaceConditionIn, + ec.unmarshalInputK8s__io___api___core___v1__NamespaceSpecIn, + ec.unmarshalInputK8s__io___api___core___v1__NamespaceStatusIn, + ec.unmarshalInputK8s__io___api___core___v1__NodeAffinityIn, + ec.unmarshalInputK8s__io___api___core___v1__NodeSelectorIn, + ec.unmarshalInputK8s__io___api___core___v1__NodeSelectorRequirementIn, + ec.unmarshalInputK8s__io___api___core___v1__NodeSelectorTermIn, + ec.unmarshalInputK8s__io___api___core___v1__ObjectReferenceIn, + ec.unmarshalInputK8s__io___api___core___v1__PersistentVolumeClaimConditionIn, + ec.unmarshalInputK8s__io___api___core___v1__PersistentVolumeClaimSpecIn, + ec.unmarshalInputK8s__io___api___core___v1__PersistentVolumeClaimStatusIn, + ec.unmarshalInputK8s__io___api___core___v1__PersistentVolumeSpecIn, + ec.unmarshalInputK8s__io___api___core___v1__PersistentVolumeStatusIn, + ec.unmarshalInputK8s__io___api___core___v1__PhotonPersistentDiskVolumeSourceIn, + ec.unmarshalInputK8s__io___api___core___v1__PodAffinityIn, + ec.unmarshalInputK8s__io___api___core___v1__PodAffinityTermIn, + ec.unmarshalInputK8s__io___api___core___v1__PodAntiAffinityIn, + ec.unmarshalInputK8s__io___api___core___v1__PortworxVolumeSourceIn, + ec.unmarshalInputK8s__io___api___core___v1__PreferredSchedulingTermIn, + ec.unmarshalInputK8s__io___api___core___v1__QuobyteVolumeSourceIn, + ec.unmarshalInputK8s__io___api___core___v1__RBDPersistentVolumeSourceIn, + ec.unmarshalInputK8s__io___api___core___v1__ResourceClaimIn, + ec.unmarshalInputK8s__io___api___core___v1__ResourceRequirementsIn, + ec.unmarshalInputK8s__io___api___core___v1__ScaleIOPersistentVolumeSourceIn, + ec.unmarshalInputK8s__io___api___core___v1__SecretReferenceIn, + ec.unmarshalInputK8s__io___api___core___v1__StorageOSPersistentVolumeSourceIn, + ec.unmarshalInputK8s__io___api___core___v1__TaintIn, + ec.unmarshalInputK8s__io___api___core___v1__TolerationIn, + ec.unmarshalInputK8s__io___api___core___v1__TypedLocalObjectReferenceIn, + ec.unmarshalInputK8s__io___api___core___v1__TypedObjectReferenceIn, + ec.unmarshalInputK8s__io___api___core___v1__VolumeNodeAffinityIn, + ec.unmarshalInputK8s__io___api___core___v1__VsphereVirtualDiskVolumeSourceIn, + ec.unmarshalInputK8s__io___api___core___v1__WeightedPodAffinityTermIn, + ec.unmarshalInputK8s__io___api___storage___v1__VolumeAttachmentSourceIn, + ec.unmarshalInputK8s__io___api___storage___v1__VolumeAttachmentSpecIn, + ec.unmarshalInputK8s__io___api___storage___v1__VolumeAttachmentStatusIn, + ec.unmarshalInputK8s__io___api___storage___v1__VolumeErrorIn, + ec.unmarshalInputK8s__io___apimachinery___pkg___api___resource__QuantityIn, + ec.unmarshalInputK8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorIn, + ec.unmarshalInputK8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirementIn, + ec.unmarshalInputMatchFilterIn, + ec.unmarshalInputMetadataIn, + ec.unmarshalInputNamespaceIn, + ec.unmarshalInputNodeIn, + ec.unmarshalInputNodePoolIn, + ec.unmarshalInputPersistentVolumeIn, + ec.unmarshalInputSearchCluster, + ec.unmarshalInputSearchClusterManagedService, + ec.unmarshalInputSearchDomainEntry, + ec.unmarshalInputSearchHelmRelease, + ec.unmarshalInputSearchNamespaces, + ec.unmarshalInputSearchNodepool, + ec.unmarshalInputSearchPersistentVolumeClaims, + ec.unmarshalInputSearchPersistentVolumes, + ec.unmarshalInputSearchProviderSecret, + ec.unmarshalInputSearchVolumeAttachments, + ec.unmarshalInputVolumeAttachmentIn, + ) + first := true + + switch rc.Operation.Operation { + case ast.Query: + return func(ctx context.Context) *graphql.Response { + if !first { + return nil + } + first = false + ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) + data := ec._Query(ctx, rc.Operation.SelectionSet) + var buf bytes.Buffer + data.MarshalGQL(&buf) + + return &graphql.Response{ + Data: buf.Bytes(), + } + } + 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 +} + +func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapSchema(parsedSchema), nil +} + +func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapTypeFromDef(parsedSchema, parsedSchema.Types[name]), nil +} + +var sources = []*ast.Source{ + {Name: "../schema.graphqls", Input: `directive @isLoggedIn on FIELD_DEFINITION +directive @isLoggedInAndVerified on FIELD_DEFINITION +directive @hasAccount on FIELD_DEFINITION + +enum ResType { + cluster + # cloudprovider + providersecret + # edge + nodepool + helm_release +} + +type CheckNameAvailabilityOutput { + result: Boolean! + suggestedNames: [String!]! +} + +input SearchCluster { + cloudProviderName: MatchFilterIn + isReady: MatchFilterIn + region: MatchFilterIn + text: MatchFilterIn +} + +input SearchClusterManagedService { + isReady: MatchFilterIn + text: MatchFilterIn +} + +input SearchNodepool { + text: MatchFilterIn +} + +input SearchHelmRelease { + text: MatchFilterIn + isReady: MatchFilterIn +} + +input SearchProviderSecret { + cloudProviderName: MatchFilterIn + text: MatchFilterIn +} + +input SearchDomainEntry { + clusterName: MatchFilterIn + text: MatchFilterIn +} + +input SearchPersistentVolumeClaims { + text: MatchFilterIn +} + +input SearchPersistentVolumes { + text: MatchFilterIn +} + +input SearchNamespaces { + text: MatchFilterIn +} + +input SearchVolumeAttachments { + text: MatchFilterIn +} + +type CheckAwsAccessOutput { + result: Boolean! + installationUrl: String +} + +type Query { + # unique name suggestions + infra_checkNameAvailability(resType: ResType!, clusterName: String, name: String!): CheckNameAvailabilityOutput! @isLoggedIn @hasAccount + + # clusters + infra_listClusters(search: SearchCluster, pagination: CursorPaginationIn): ClusterPaginatedRecords @isLoggedInAndVerified @hasAccount + infra_getCluster(name: String!): Cluster @isLoggedInAndVerified @hasAccount + + # get node pools + infra_listNodePools(clusterName: String!, search: SearchNodepool, pagination: CursorPaginationIn): NodePoolPaginatedRecords @isLoggedInAndVerified @hasAccount + infra_getNodePool(clusterName: String!, poolName: String!): NodePool @isLoggedInAndVerified @hasAccount + + infra_listProviderSecrets(search: SearchProviderSecret, pagination: CursorPaginationIn): CloudProviderSecretPaginatedRecords @isLoggedInAndVerified @hasAccount + infra_getProviderSecret(name: String!): CloudProviderSecret @isLoggedInAndVerified @hasAccount + + infra_listDomainEntries(search: SearchDomainEntry, pagination: CursorPaginationIn): DomainEntryPaginatedRecords @isLoggedInAndVerified @hasAccount + infra_getDomainEntry(domainName: String!): DomainEntry @isLoggedInAndVerified @hasAccount + + infra_checkAwsAccess(cloudproviderName: String!): CheckAwsAccessOutput! @isLoggedInAndVerified @hasAccount + + infra_listClusterManagedServices(clusterName: String!, search: SearchClusterManagedService, pagination: CursorPaginationIn): ClusterManagedServicePaginatedRecords @isLoggedInAndVerified @hasAccount + infra_getClusterManagedService(clusterName: String!, name: String!): ClusterManagedService @isLoggedInAndVerified @hasAccount + + infra_listHelmReleases(clusterName: String!, search: SearchHelmRelease, pagination: CursorPaginationIn): HelmReleasePaginatedRecords @isLoggedInAndVerified @hasAccount + infra_getHelmRelease(clusterName: String!, name: String!): HelmRelease @isLoggedInAndVerified @hasAccount + + infra_listManagedServiceTemplates: [MsvcTemplate!] + infra_getManagedServiceTemplate(category: String!, name: String!): Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry + + # kubernetes native resources + infra_listPVCs(clusterName: String!, search: SearchPersistentVolumeClaims, pq: CursorPaginationIn): PersistentVolumeClaimPaginatedRecords @isLoggedInAndVerified @hasAccount + infra_getPVC(clusterName: String!, name: String!): PersistentVolumeClaim @isLoggedInAndVerified @hasAccount + + infra_listNamespaces(clusterName: String!, search: SearchNamespaces, pq: CursorPaginationIn): NamespacePaginatedRecords @isLoggedInAndVerified @hasAccount + infra_getNamespace(clusterName: String!, name: String!): Namespace @isLoggedInAndVerified @hasAccount + + infra_listPVs(clusterName: String!, search: SearchPersistentVolumes, pq: CursorPaginationIn): PersistentVolumePaginatedRecords @isLoggedInAndVerified @hasAccount + infra_getPV(clusterName: String!, name: String!): PersistentVolume @isLoggedInAndVerified @hasAccount + + infra_listVolumeAttachments(clusterName: String!, search: SearchVolumeAttachments, pq: CursorPaginationIn): VolumeAttachmentPaginatedRecords @isLoggedInAndVerified @hasAccount + infra_getVolumeAttachment(clusterName: String!, name: String!): VolumeAttachment @isLoggedInAndVerified @hasAccount +} + +type Mutation { + # clusters + infra_createCluster(cluster: ClusterIn!): Cluster @isLoggedInAndVerified @hasAccount + infra_updateCluster(cluster: ClusterIn!): Cluster @isLoggedInAndVerified @hasAccount + infra_deleteCluster(name: String!): Boolean! @isLoggedInAndVerified @hasAccount + # infra_resyncCluster(name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + infra_createProviderSecret(secret: CloudProviderSecretIn!): CloudProviderSecret @isLoggedInAndVerified @hasAccount + infra_updateProviderSecret(secret: CloudProviderSecretIn!): CloudProviderSecret @isLoggedInAndVerified @hasAccount + infra_deleteProviderSecret(secretName: String!): Boolean! @isLoggedInAndVerified @hasAccount + + infra_createDomainEntry(domainEntry: DomainEntryIn!): DomainEntry @isLoggedInAndVerified @hasAccount + infra_updateDomainEntry(domainEntry: DomainEntryIn!): DomainEntry @isLoggedInAndVerified @hasAccount + infra_deleteDomainEntry(domainName: String!): Boolean! @isLoggedInAndVerified @hasAccount + + infra_createNodePool(clusterName: String!, pool: NodePoolIn!): NodePool @isLoggedInAndVerified @hasAccount + infra_updateNodePool(clusterName: String!, pool: NodePoolIn!): NodePool @isLoggedInAndVerified @hasAccount + infra_deleteNodePool(clusterName: String!, poolName: String!): Boolean! @isLoggedInAndVerified @hasAccount + + infra_createClusterManagedService(clusterName: String!, service: ClusterManagedServiceIn!): ClusterManagedService @isLoggedInAndVerified @hasAccount + infra_updateClusterManagedService(clusterName: String!, service: ClusterManagedServiceIn!): ClusterManagedService @isLoggedInAndVerified @hasAccount + infra_deleteClusterManagedService(clusterName: String!, serviceName: String!): Boolean! @isLoggedInAndVerified @hasAccount + + infra_createHelmRelease(clusterName: String!, release: HelmReleaseIn!): HelmRelease @isLoggedInAndVerified @hasAccount + infra_updateHelmRelease(clusterName: String!, release: HelmReleaseIn!): HelmRelease @isLoggedInAndVerified @hasAccount + infra_deleteHelmRelease(clusterName: String!, releaseName: String!): Boolean! @isLoggedInAndVerified @hasAccount +} + +type EncodedValue { + value: String! + encoding: String! +} + +extend type Cluster { + adminKubeconfig: EncodedValue +} +`, BuiltIn: false}, + {Name: "../struct-to-graphql/cloudprovidersecret.graphqls", Input: `type CloudProviderSecret @shareable { + accountName: String! + aws: Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials + cloudProviderName: Github__com___kloudlite___operator___apis___common____types__CloudProvider! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + id: String! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata! @goField(name: "objectMeta") + recordVersion: Int! + updateTime: Date! +} + +type CloudProviderSecretEdge @shareable { + cursor: String! + node: CloudProviderSecret! +} + +type CloudProviderSecretPaginatedRecords @shareable { + edges: [CloudProviderSecretEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input CloudProviderSecretIn { + aws: Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentialsIn + cloudProviderName: Github__com___kloudlite___operator___apis___common____types__CloudProvider! + displayName: String! + metadata: MetadataIn! +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/cluster.graphqls", Input: `type Cluster @shareable { + accountName: String! + apiVersion: String + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata! @goField(name: "objectMeta") + recordVersion: Int! + spec: Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec! + status: Github__com___kloudlite___operator___pkg___operator__Status + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type ClusterEdge @shareable { + cursor: String! + node: Cluster! +} + +type ClusterPaginatedRecords @shareable { + edges: [ClusterEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input ClusterIn { + apiVersion: String + displayName: String! + kind: String + metadata: MetadataIn! + spec: Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpecIn! +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/clustermanagedservice.graphqls", Input: `type ClusterManagedService @shareable { + accountName: String! + apiVersion: String + clusterName: String! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + recordVersion: Int! + spec: Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec + status: Github__com___kloudlite___operator___pkg___operator__Status + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type ClusterManagedServiceEdge @shareable { + cursor: String! + node: ClusterManagedService! +} + +type ClusterManagedServicePaginatedRecords @shareable { + edges: [ClusterManagedServiceEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input ClusterManagedServiceIn { + apiVersion: String + displayName: String! + kind: String + metadata: MetadataIn + spec: Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpecIn +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/common-types.graphqls", Input: `type Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials @shareable { + accessKey: String + awsAccountId: String + cfParamExternalID: String + cfParamInstanceProfileName: String + cfParamRoleName: String + cfParamStackName: String + cfParamTrustedARN: String + secretKey: String +} + +type Github__com___kloudlite___api___apps___infra___internal___entities__InputField @shareable { + defaultValue: Any + displayUnit: String + inputType: String! + label: String! + max: Float + min: Float + multiplier: Float + name: String! + required: Boolean + unit: String +} + +type Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate @shareable { + apiVersion: String + description: String! + displayName: String! + fields: [Github__com___kloudlite___api___apps___infra___internal___entities__InputField!]! + kind: String + name: String! + outputs: [Github__com___kloudlite___api___apps___infra___internal___entities__OutputField!]! +} + +type Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry @shareable { + active: Boolean! + apiVersion: String + description: String! + displayName: String! + fields: [Github__com___kloudlite___api___apps___infra___internal___entities__InputField!]! + kind: String + logoUrl: String! + name: String! + outputs: [Github__com___kloudlite___api___apps___infra___internal___entities__OutputField!]! + resources: [Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate!]! +} + +type Github__com___kloudlite___api___apps___infra___internal___entities__OutputField @shareable { + description: String! + label: String! + name: String! +} + +type Github__com___kloudlite___api___common__CreatedOrUpdatedBy @shareable { + userEmail: String! + userId: String! + userName: String! +} + +type Github__com___kloudlite___api___pkg___types__SyncStatus @shareable { + action: Github__com___kloudlite___api___pkg___types__SyncAction! + error: String + lastSyncedAt: Date + recordVersion: Int! + state: Github__com___kloudlite___api___pkg___types__SyncState! + syncScheduledAt: Date +} + +type Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig @shareable { + k3sMasters: Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig + nodePools: Map + region: String! + spotNodePools: Map +} + +type Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig @shareable { + iamInstanceProfileRole: String + imageId: String! + imageSSHUsername: String! + instanceType: String! + nodes: Map + nvidiaGpuEnabled: Boolean! + rootVolumeSize: Int! + rootVolumeType: String! +} + +type Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig @shareable { + availabilityZone: String! + ec2Pool: Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig + iamInstanceProfileRole: String + imageId: String! + imageSSHUsername: String! + nvidiaGpuEnabled: Boolean! + poolType: Github__com___kloudlite___operator___apis___clusters___v1__AWSPoolType! + rootVolumeSize: Int! + rootVolumeType: String! + spotPool: Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig +} + +type Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig @shareable { + instanceType: String! + nodes: Map +} + +type Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode @shareable { + memoryPerVcpu: Github__com___kloudlite___operator___apis___common____types__MinMaxFloat + vcpu: Github__com___kloudlite___operator___apis___common____types__MinMaxFloat! +} + +type Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNode @shareable { + instanceTypes: [String!]! +} + +type Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig @shareable { + cpuNode: Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode + gpuNode: Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNode + nodes: Map + spotFleetTaggingRoleName: String! +} + +type Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys @shareable { + keyAccessKey: String! + keyAWSAccountId: String! + keyAWSAssumeRoleExternalID: String! + keyAWSAssumeRoleRoleARN: String! + keyIAMInstanceProfileRole: String! + keySecretKey: String! +} + +type Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput @shareable { + jobName: String! + jobNamespace: String! + keyK3sAgentJoinToken: String! + keyK3sServerJoinToken: String! + keyKubeconfig: String! + secretName: String! +} + +type Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec @shareable { + accountId: String! + accountName: String! + availabilityMode: Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpecAvailabilityMode! + aws: Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig + backupToS3Enabled: Boolean! + cloudflareEnabled: Boolean + cloudProvider: Github__com___kloudlite___operator___apis___common____types__CloudProvider! + clusterInternalDnsHost: String + clusterTokenRef: Github__com___kloudlite___operator___apis___common____types__SecretKeyRef + credentialKeys: Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys + credentialsRef: Github__com___kloudlite___operator___apis___common____types__SecretRef! + kloudliteRelease: String! + messageQueueTopicName: String! + output: Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput + publicDNSHost: String! + taintMasterNodes: Boolean! +} + +type Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode @shareable { + cloudProviderAccessKey: Github__com___kloudlite___operator___apis___common____types__SecretKeyRef! + cloudProviderSecretKey: Github__com___kloudlite___operator___apis___common____types__SecretKeyRef! + jobName: String + jobNamespace: String + stateS3BucketFilePath: String! + stateS3BucketName: String! + stateS3BucketRegion: String! +} + +type Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps @shareable { + availabilityZone: String! + lastRecreatedAt: Date + role: String! +} + +type Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec @shareable { + aws: Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig + cloudProvider: Github__com___kloudlite___operator___apis___common____types__CloudProvider! + iac: Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode! + maxCount: Int! + minCount: Int! + nodeLabels: Map + nodeTaints: [K8s__io___api___core___v1__Taint!] +} + +type Github__com___kloudlite___operator___apis___clusters___v1__NodeProps @shareable { + lastRecreatedAt: Date +} + +type Github__com___kloudlite___operator___apis___clusters___v1__NodeSpec @shareable { + nodepoolName: String! +} + +type Github__com___kloudlite___operator___apis___common____types__MinMaxFloat @shareable { + max: String! + min: String! +} + +type Github__com___kloudlite___operator___apis___common____types__SecretKeyRef @shareable { + key: String! + name: String! + namespace: String +} + +type Github__com___kloudlite___operator___apis___common____types__SecretRef @shareable { + name: String! + namespace: String +} + +type Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec @shareable { + msvcSpec: Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec! + targetNamespace: String! +} + +type Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec @shareable { + chartName: String! + chartRepoURL: String! + chartVersion: String! + jobVars: Github__com___kloudlite___operator___apis___crds___v1__JobVars + postInstall: String + postUninstall: String + preInstall: String + preUninstall: String + values: Map! +} + +type Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus @shareable { + checks: Map + isReady: Boolean! + lastReadyGeneration: Int + lastReconcileTime: Date + message: Github__com___kloudlite___operator___pkg___raw____json__RawJson + releaseNotes: String! + releaseStatus: String! + resources: [Github__com___kloudlite___operator___pkg___operator__ResourceRef!] +} + +type Github__com___kloudlite___operator___apis___crds___v1__JobVars @shareable { + affinity: K8s__io___api___core___v1__Affinity + backOffLimit: Int + nodeSelector: Map + tolerations: [K8s__io___api___core___v1__Toleration!] +} + +type Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec @shareable { + serviceTemplate: Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate! +} + +type Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate @shareable { + apiVersion: String! + kind: String! + spec: Map! +} + +type Github__com___kloudlite___operator___pkg___operator__Check @shareable { + generation: Int + message: String + status: Boolean! +} + +type Github__com___kloudlite___operator___pkg___operator__ResourceRef @shareable { + apiVersion: String! + kind: String! + name: String! + namespace: String! +} + +type Github__com___kloudlite___operator___pkg___operator__Status @shareable { + checks: Map + isReady: Boolean! + lastReadyGeneration: Int + lastReconcileTime: Date + message: Github__com___kloudlite___operator___pkg___raw____json__RawJson + resources: [Github__com___kloudlite___operator___pkg___operator__ResourceRef!] +} + +type Github__com___kloudlite___operator___pkg___raw____json__RawJson @shareable { + RawMessage: Any +} + +type K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource @shareable { + fsType: String + partition: Int + readOnly: Boolean + volumeID: String! +} + +type K8s__io___api___core___v1__Affinity @shareable { + nodeAffinity: K8s__io___api___core___v1__NodeAffinity + podAffinity: K8s__io___api___core___v1__PodAffinity + podAntiAffinity: K8s__io___api___core___v1__PodAntiAffinity +} + +type K8s__io___api___core___v1__AzureDiskVolumeSource @shareable { + cachingMode: String + diskName: String! + diskURI: String! + fsType: String + kind: String + readOnly: Boolean +} + +type K8s__io___api___core___v1__AzureFilePersistentVolumeSource @shareable { + readOnly: Boolean + secretName: String! + secretNamespace: String + shareName: String! +} + +type K8s__io___api___core___v1__CSIPersistentVolumeSource @shareable { + controllerExpandSecretRef: K8s__io___api___core___v1__SecretReference + controllerPublishSecretRef: K8s__io___api___core___v1__SecretReference + driver: String! + fsType: String + nodeExpandSecretRef: K8s__io___api___core___v1__SecretReference + nodePublishSecretRef: K8s__io___api___core___v1__SecretReference + nodeStageSecretRef: K8s__io___api___core___v1__SecretReference + readOnly: Boolean + volumeAttributes: Map + volumeHandle: String! +} + +type K8s__io___api___core___v1__CephFSPersistentVolumeSource @shareable { + monitors: [String!]! + path: String + readOnly: Boolean + secretFile: String + secretRef: K8s__io___api___core___v1__SecretReference + user: String +} + +type K8s__io___api___core___v1__CinderPersistentVolumeSource @shareable { + fsType: String + readOnly: Boolean + secretRef: K8s__io___api___core___v1__SecretReference + volumeID: String! +} + +type K8s__io___api___core___v1__FCVolumeSource @shareable { + fsType: String + lun: Int + readOnly: Boolean + targetWWNs: [String!] + wwids: [String!] +} + +type K8s__io___api___core___v1__FlexPersistentVolumeSource @shareable { + driver: String! + fsType: String + options: Map + readOnly: Boolean + secretRef: K8s__io___api___core___v1__SecretReference +} + +type K8s__io___api___core___v1__FlockerVolumeSource @shareable { + datasetName: String + datasetUUID: String +} + +type K8s__io___api___core___v1__GCEPersistentDiskVolumeSource @shareable { + fsType: String + partition: Int + pdName: String! + readOnly: Boolean +} + +type K8s__io___api___core___v1__GlusterfsPersistentVolumeSource @shareable { + endpoints: String! + endpointsNamespace: String + path: String! + readOnly: Boolean +} + +type K8s__io___api___core___v1__HostPathVolumeSource @shareable { + path: String! + type: String +} + +type K8s__io___api___core___v1__ISCSIPersistentVolumeSource @shareable { + chapAuthDiscovery: Boolean + chapAuthSession: Boolean + fsType: String + initiatorName: String + iqn: String! + iscsiInterface: String + lun: Int! + portals: [String!] + readOnly: Boolean + secretRef: K8s__io___api___core___v1__SecretReference + targetPortal: String! +} + +type K8s__io___api___core___v1__LocalVolumeSource @shareable { + fsType: String + path: String! +} + +type K8s__io___api___core___v1__NFSVolumeSource @shareable { + path: String! + readOnly: Boolean + server: String! +} + +type K8s__io___api___core___v1__NamespaceCondition @shareable { + lastTransitionTime: Date + message: String + reason: String + status: K8s__io___api___core___v1__ConditionStatus! + type: K8s__io___api___core___v1__NamespaceConditionType! +} + +type K8s__io___api___core___v1__NamespaceSpec @shareable { + finalizers: [String!] +} + +type K8s__io___api___core___v1__NamespaceStatus @shareable { + conditions: [K8s__io___api___core___v1__NamespaceCondition!] + phase: K8s__io___api___core___v1__NamespacePhase +} + +type K8s__io___api___core___v1__NodeAffinity @shareable { + preferredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__PreferredSchedulingTerm!] + requiredDuringSchedulingIgnoredDuringExecution: K8s__io___api___core___v1__NodeSelector +} + +type K8s__io___api___core___v1__NodeSelector @shareable { + nodeSelectorTerms: [K8s__io___api___core___v1__NodeSelectorTerm!]! +} + +type K8s__io___api___core___v1__NodeSelectorRequirement @shareable { + key: String! + operator: K8s__io___api___core___v1__NodeSelectorOperator! + values: [String!] +} + +type K8s__io___api___core___v1__NodeSelectorTerm @shareable { + matchExpressions: [K8s__io___api___core___v1__NodeSelectorRequirement!] + matchFields: [K8s__io___api___core___v1__NodeSelectorRequirement!] +} + +type K8s__io___api___core___v1__ObjectReference @shareable { + apiVersion: String + fieldPath: String + kind: String + name: String + namespace: String + resourceVersion: String + uid: String +} + +type K8s__io___api___core___v1__PersistentVolumeClaimCondition @shareable { + lastProbeTime: Date + lastTransitionTime: Date + message: String + reason: String + status: K8s__io___api___core___v1__ConditionStatus! + type: K8s__io___api___core___v1__PersistentVolumeClaimConditionType! +} + +type K8s__io___api___core___v1__PersistentVolumeClaimSpec @shareable { + accessModes: [String!] + dataSource: K8s__io___api___core___v1__TypedLocalObjectReference + dataSourceRef: K8s__io___api___core___v1__TypedObjectReference + resources: K8s__io___api___core___v1__ResourceRequirements + selector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector + storageClassName: String + volumeMode: String + volumeName: String +} + +type K8s__io___api___core___v1__PersistentVolumeClaimStatus @shareable { + accessModes: [String!] + allocatedResources: Map + allocatedResourceStatuses: Map + capacity: Map + conditions: [K8s__io___api___core___v1__PersistentVolumeClaimCondition!] + phase: K8s__io___api___core___v1__PersistentVolumeClaimPhase +} + +type K8s__io___api___core___v1__PersistentVolumeSpec @shareable { + accessModes: [String!] + awsElasticBlockStore: K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource + azureDisk: K8s__io___api___core___v1__AzureDiskVolumeSource + azureFile: K8s__io___api___core___v1__AzureFilePersistentVolumeSource + capacity: Map + cephfs: K8s__io___api___core___v1__CephFSPersistentVolumeSource + cinder: K8s__io___api___core___v1__CinderPersistentVolumeSource + claimRef: K8s__io___api___core___v1__ObjectReference + csi: K8s__io___api___core___v1__CSIPersistentVolumeSource + fc: K8s__io___api___core___v1__FCVolumeSource + flexVolume: K8s__io___api___core___v1__FlexPersistentVolumeSource + flocker: K8s__io___api___core___v1__FlockerVolumeSource + gcePersistentDisk: K8s__io___api___core___v1__GCEPersistentDiskVolumeSource + glusterfs: K8s__io___api___core___v1__GlusterfsPersistentVolumeSource + hostPath: K8s__io___api___core___v1__HostPathVolumeSource + iscsi: K8s__io___api___core___v1__ISCSIPersistentVolumeSource + local: K8s__io___api___core___v1__LocalVolumeSource + mountOptions: [String!] + nfs: K8s__io___api___core___v1__NFSVolumeSource + nodeAffinity: K8s__io___api___core___v1__VolumeNodeAffinity + persistentVolumeReclaimPolicy: K8s__io___api___core___v1__PersistentVolumeReclaimPolicy + photonPersistentDisk: K8s__io___api___core___v1__PhotonPersistentDiskVolumeSource + portworxVolume: K8s__io___api___core___v1__PortworxVolumeSource + quobyte: K8s__io___api___core___v1__QuobyteVolumeSource + rbd: K8s__io___api___core___v1__RBDPersistentVolumeSource + scaleIO: K8s__io___api___core___v1__ScaleIOPersistentVolumeSource + storageClassName: String + storageos: K8s__io___api___core___v1__StorageOSPersistentVolumeSource + volumeMode: String + vsphereVolume: K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource +} + +type K8s__io___api___core___v1__PersistentVolumeStatus @shareable { + lastPhaseTransitionTime: Date + message: String + phase: K8s__io___api___core___v1__PersistentVolumePhase + reason: String +} + +type K8s__io___api___core___v1__PhotonPersistentDiskVolumeSource @shareable { + fsType: String + pdID: String! +} + +type K8s__io___api___core___v1__PodAffinity @shareable { + preferredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__WeightedPodAffinityTerm!] + requiredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__PodAffinityTerm!] +} + +type K8s__io___api___core___v1__PodAffinityTerm @shareable { + labelSelector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector + namespaces: [String!] + namespaceSelector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector + topologyKey: String! +} + +type K8s__io___api___core___v1__PodAntiAffinity @shareable { + preferredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__WeightedPodAffinityTerm!] + requiredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__PodAffinityTerm!] +} + +type K8s__io___api___core___v1__PortworxVolumeSource @shareable { + fsType: String + readOnly: Boolean + volumeID: String! +} + +type K8s__io___api___core___v1__PreferredSchedulingTerm @shareable { + preference: K8s__io___api___core___v1__NodeSelectorTerm! + weight: Int! +} + +type K8s__io___api___core___v1__QuobyteVolumeSource @shareable { + group: String + readOnly: Boolean + registry: String! + tenant: String + user: String + volume: String! +} + +type K8s__io___api___core___v1__RBDPersistentVolumeSource @shareable { + fsType: String + image: String! + keyring: String + monitors: [String!]! + pool: String + readOnly: Boolean + secretRef: K8s__io___api___core___v1__SecretReference + user: String +} + +type K8s__io___api___core___v1__ResourceClaim @shareable { + name: String! +} + +type K8s__io___api___core___v1__ResourceRequirements @shareable { + claims: [K8s__io___api___core___v1__ResourceClaim!] + limits: Map + requests: Map +} + +type K8s__io___api___core___v1__ScaleIOPersistentVolumeSource @shareable { + fsType: String + gateway: String! + protectionDomain: String + readOnly: Boolean + secretRef: K8s__io___api___core___v1__SecretReference + sslEnabled: Boolean + storageMode: String + storagePool: String + system: String! + volumeName: String +} + +type K8s__io___api___core___v1__SecretReference @shareable { + name: String + namespace: String +} + +type K8s__io___api___core___v1__StorageOSPersistentVolumeSource @shareable { + fsType: String + readOnly: Boolean + secretRef: K8s__io___api___core___v1__ObjectReference + volumeName: String + volumeNamespace: String +} + +type K8s__io___api___core___v1__Taint @shareable { + effect: K8s__io___api___core___v1__TaintEffect! + key: String! + timeAdded: Date + value: String +} + +type K8s__io___api___core___v1__Toleration @shareable { + effect: K8s__io___api___core___v1__TaintEffect + key: String + operator: K8s__io___api___core___v1__TolerationOperator + tolerationSeconds: Int + value: String +} + +type K8s__io___api___core___v1__TypedLocalObjectReference @shareable { + apiGroup: String + kind: String! + name: String! +} + +type K8s__io___api___core___v1__TypedObjectReference @shareable { + apiGroup: String + kind: String! + name: String! + namespace: String +} + +type K8s__io___api___core___v1__VolumeNodeAffinity @shareable { + required: K8s__io___api___core___v1__NodeSelector +} + +type K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource @shareable { + fsType: String + storagePolicyID: String + storagePolicyName: String + volumePath: String! +} + +type K8s__io___api___core___v1__WeightedPodAffinityTerm @shareable { + podAffinityTerm: K8s__io___api___core___v1__PodAffinityTerm! + weight: Int! +} + +type K8s__io___api___storage___v1__VolumeAttachmentSource @shareable { + inlineVolumeSpec: K8s__io___api___core___v1__PersistentVolumeSpec + persistentVolumeName: String +} + +type K8s__io___api___storage___v1__VolumeAttachmentSpec @shareable { + attacher: String! + nodeName: String! + source: K8s__io___api___storage___v1__VolumeAttachmentSource! +} + +type K8s__io___api___storage___v1__VolumeAttachmentStatus @shareable { + attached: Boolean! + attachError: K8s__io___api___storage___v1__VolumeError + attachmentMetadata: Map + detachError: K8s__io___api___storage___v1__VolumeError +} + +type K8s__io___api___storage___v1__VolumeError @shareable { + message: String + time: Date +} + +type K8s__io___apimachinery___pkg___api___resource__Quantity @shareable { + Format: K8s__io___apimachinery___pkg___api___resource__Format! +} + +type K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector @shareable { + matchExpressions: [K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement!] + matchLabels: Map +} + +type K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement @shareable { + key: String! + operator: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorOperator! + values: [String!] +} + +type Metadata @shareable { + annotations: Map + creationTimestamp: Date! + deletionTimestamp: Date + generation: Int! + labels: Map + name: String! + namespace: String +} + +type PageInfo @shareable { + endCursor: String + hasNextPage: Boolean + hasPreviousPage: Boolean + startCursor: String +} + +input Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentialsIn { + accessKey: String + awsAccountId: String + secretKey: String +} + +input Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfigIn { + k3sMasters: Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfigIn + region: String! +} + +input Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfigIn { + instanceType: String! + nvidiaGpuEnabled: Boolean! +} + +input Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfigIn { + availabilityZone: String! + ec2Pool: Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfigIn + nvidiaGpuEnabled: Boolean! + poolType: Github__com___kloudlite___operator___apis___clusters___v1__AWSPoolType! + spotPool: Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfigIn +} + +input Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfigIn { + instanceType: String! + nodes: Map +} + +input Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNodeIn { + memoryPerVcpu: Github__com___kloudlite___operator___apis___common____types__MinMaxFloatIn + vcpu: Github__com___kloudlite___operator___apis___common____types__MinMaxFloatIn! +} + +input Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNodeIn { + instanceTypes: [String!]! +} + +input Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfigIn { + cpuNode: Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNodeIn + gpuNode: Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNodeIn + nodes: Map +} + +input Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpecIn { + availabilityMode: Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpecAvailabilityMode! + aws: Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfigIn + cloudflareEnabled: Boolean + cloudProvider: Github__com___kloudlite___operator___apis___common____types__CloudProvider! + credentialsRef: Github__com___kloudlite___operator___apis___common____types__SecretRefIn! +} + +input Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpecIn { + aws: Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfigIn + cloudProvider: Github__com___kloudlite___operator___apis___common____types__CloudProvider! + maxCount: Int! + minCount: Int! + nodeLabels: Map + nodeTaints: [K8s__io___api___core___v1__TaintIn!] +} + +input Github__com___kloudlite___operator___apis___clusters___v1__NodePropsIn { + lastRecreatedAt: Date +} + +input Github__com___kloudlite___operator___apis___clusters___v1__NodeSpecIn { + nodepoolName: String! +} + +input Github__com___kloudlite___operator___apis___common____types__MinMaxFloatIn { + max: String! + min: String! +} + +input Github__com___kloudlite___operator___apis___common____types__SecretRefIn { + name: String! + namespace: String +} + +input Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpecIn { + msvcSpec: Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn! + targetNamespace: String! +} + +input Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpecIn { + chartName: String! + chartRepoURL: String! + chartVersion: String! + jobVars: Github__com___kloudlite___operator___apis___crds___v1__JobVarsIn + postInstall: String + postUninstall: String + preInstall: String + preUninstall: String + values: Map! +} + +input Github__com___kloudlite___operator___apis___crds___v1__JobVarsIn { + affinity: K8s__io___api___core___v1__AffinityIn + backOffLimit: Int + nodeSelector: Map + tolerations: [K8s__io___api___core___v1__TolerationIn!] +} + +input Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn { + serviceTemplate: Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn! +} + +input Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn { + apiVersion: String! + kind: String! + spec: Map! +} + +input K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSourceIn { + fsType: String + partition: Int + readOnly: Boolean + volumeID: String! +} + +input K8s__io___api___core___v1__AffinityIn { + nodeAffinity: K8s__io___api___core___v1__NodeAffinityIn + podAffinity: K8s__io___api___core___v1__PodAffinityIn + podAntiAffinity: K8s__io___api___core___v1__PodAntiAffinityIn +} + +input K8s__io___api___core___v1__AzureDiskVolumeSourceIn { + cachingMode: String + diskName: String! + diskURI: String! + fsType: String + kind: String + readOnly: Boolean +} + +input K8s__io___api___core___v1__AzureFilePersistentVolumeSourceIn { + readOnly: Boolean + secretName: String! + secretNamespace: String + shareName: String! +} + +input K8s__io___api___core___v1__CSIPersistentVolumeSourceIn { + controllerExpandSecretRef: K8s__io___api___core___v1__SecretReferenceIn + controllerPublishSecretRef: K8s__io___api___core___v1__SecretReferenceIn + driver: String! + fsType: String + nodeExpandSecretRef: K8s__io___api___core___v1__SecretReferenceIn + nodePublishSecretRef: K8s__io___api___core___v1__SecretReferenceIn + nodeStageSecretRef: K8s__io___api___core___v1__SecretReferenceIn + readOnly: Boolean + volumeAttributes: Map + volumeHandle: String! +} + +input K8s__io___api___core___v1__CephFSPersistentVolumeSourceIn { + monitors: [String!]! + path: String + readOnly: Boolean + secretFile: String + secretRef: K8s__io___api___core___v1__SecretReferenceIn + user: String +} + +input K8s__io___api___core___v1__CinderPersistentVolumeSourceIn { + fsType: String + readOnly: Boolean + secretRef: K8s__io___api___core___v1__SecretReferenceIn + volumeID: String! +} + +input K8s__io___api___core___v1__FCVolumeSourceIn { + fsType: String + lun: Int + readOnly: Boolean + targetWWNs: [String!] + wwids: [String!] +} + +input K8s__io___api___core___v1__FlexPersistentVolumeSourceIn { + driver: String! + fsType: String + options: Map + readOnly: Boolean + secretRef: K8s__io___api___core___v1__SecretReferenceIn +} + +input K8s__io___api___core___v1__FlockerVolumeSourceIn { + datasetName: String + datasetUUID: String +} + +input K8s__io___api___core___v1__GCEPersistentDiskVolumeSourceIn { + fsType: String + partition: Int + pdName: String! + readOnly: Boolean +} + +input K8s__io___api___core___v1__GlusterfsPersistentVolumeSourceIn { + endpoints: String! + endpointsNamespace: String + path: String! + readOnly: Boolean +} + +input K8s__io___api___core___v1__HostPathVolumeSourceIn { + path: String! + type: String +} + +input K8s__io___api___core___v1__ISCSIPersistentVolumeSourceIn { + chapAuthDiscovery: Boolean + chapAuthSession: Boolean + fsType: String + initiatorName: String + iqn: String! + iscsiInterface: String + lun: Int! + portals: [String!] + readOnly: Boolean + secretRef: K8s__io___api___core___v1__SecretReferenceIn + targetPortal: String! +} + +input K8s__io___api___core___v1__LocalVolumeSourceIn { + fsType: String + path: String! +} + +input K8s__io___api___core___v1__NFSVolumeSourceIn { + path: String! + readOnly: Boolean + server: String! +} + +input K8s__io___api___core___v1__NamespaceConditionIn { + lastTransitionTime: Date + message: String + reason: String + status: K8s__io___api___core___v1__ConditionStatus! + type: K8s__io___api___core___v1__NamespaceConditionType! +} + +input K8s__io___api___core___v1__NamespaceSpecIn { + finalizers: [String!] +} + +input K8s__io___api___core___v1__NamespaceStatusIn { + conditions: [K8s__io___api___core___v1__NamespaceConditionIn!] + phase: K8s__io___api___core___v1__NamespacePhase +} + +input K8s__io___api___core___v1__NodeAffinityIn { + preferredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__PreferredSchedulingTermIn!] + requiredDuringSchedulingIgnoredDuringExecution: K8s__io___api___core___v1__NodeSelectorIn +} + +input K8s__io___api___core___v1__NodeSelectorIn { + nodeSelectorTerms: [K8s__io___api___core___v1__NodeSelectorTermIn!]! +} + +input K8s__io___api___core___v1__NodeSelectorRequirementIn { + key: String! + operator: K8s__io___api___core___v1__NodeSelectorOperator! + values: [String!] +} + +input K8s__io___api___core___v1__NodeSelectorTermIn { + matchExpressions: [K8s__io___api___core___v1__NodeSelectorRequirementIn!] + matchFields: [K8s__io___api___core___v1__NodeSelectorRequirementIn!] +} + +input K8s__io___api___core___v1__ObjectReferenceIn { + apiVersion: String + fieldPath: String + kind: String + name: String + namespace: String + resourceVersion: String + uid: String +} + +input K8s__io___api___core___v1__PersistentVolumeClaimConditionIn { + lastProbeTime: Date + lastTransitionTime: Date + message: String + reason: String + status: K8s__io___api___core___v1__ConditionStatus! + type: K8s__io___api___core___v1__PersistentVolumeClaimConditionType! +} + +input K8s__io___api___core___v1__PersistentVolumeClaimSpecIn { + accessModes: [String!] + dataSource: K8s__io___api___core___v1__TypedLocalObjectReferenceIn + dataSourceRef: K8s__io___api___core___v1__TypedObjectReferenceIn + resources: K8s__io___api___core___v1__ResourceRequirementsIn + selector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorIn + storageClassName: String + volumeMode: String + volumeName: String +} + +input K8s__io___api___core___v1__PersistentVolumeClaimStatusIn { + accessModes: [String!] + allocatedResources: Map + allocatedResourceStatuses: Map + capacity: Map + conditions: [K8s__io___api___core___v1__PersistentVolumeClaimConditionIn!] + phase: K8s__io___api___core___v1__PersistentVolumeClaimPhase +} + +input K8s__io___api___core___v1__PersistentVolumeSpecIn { + accessModes: [String!] + awsElasticBlockStore: K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSourceIn + azureDisk: K8s__io___api___core___v1__AzureDiskVolumeSourceIn + azureFile: K8s__io___api___core___v1__AzureFilePersistentVolumeSourceIn + capacity: Map + cephfs: K8s__io___api___core___v1__CephFSPersistentVolumeSourceIn + cinder: K8s__io___api___core___v1__CinderPersistentVolumeSourceIn + claimRef: K8s__io___api___core___v1__ObjectReferenceIn + csi: K8s__io___api___core___v1__CSIPersistentVolumeSourceIn + fc: K8s__io___api___core___v1__FCVolumeSourceIn + flexVolume: K8s__io___api___core___v1__FlexPersistentVolumeSourceIn + flocker: K8s__io___api___core___v1__FlockerVolumeSourceIn + gcePersistentDisk: K8s__io___api___core___v1__GCEPersistentDiskVolumeSourceIn + glusterfs: K8s__io___api___core___v1__GlusterfsPersistentVolumeSourceIn + hostPath: K8s__io___api___core___v1__HostPathVolumeSourceIn + iscsi: K8s__io___api___core___v1__ISCSIPersistentVolumeSourceIn + local: K8s__io___api___core___v1__LocalVolumeSourceIn + mountOptions: [String!] + nfs: K8s__io___api___core___v1__NFSVolumeSourceIn + nodeAffinity: K8s__io___api___core___v1__VolumeNodeAffinityIn + persistentVolumeReclaimPolicy: K8s__io___api___core___v1__PersistentVolumeReclaimPolicy + photonPersistentDisk: K8s__io___api___core___v1__PhotonPersistentDiskVolumeSourceIn + portworxVolume: K8s__io___api___core___v1__PortworxVolumeSourceIn + quobyte: K8s__io___api___core___v1__QuobyteVolumeSourceIn + rbd: K8s__io___api___core___v1__RBDPersistentVolumeSourceIn + scaleIO: K8s__io___api___core___v1__ScaleIOPersistentVolumeSourceIn + storageClassName: String + storageos: K8s__io___api___core___v1__StorageOSPersistentVolumeSourceIn + volumeMode: String + vsphereVolume: K8s__io___api___core___v1__VsphereVirtualDiskVolumeSourceIn +} + +input K8s__io___api___core___v1__PersistentVolumeStatusIn { + lastPhaseTransitionTime: Date + message: String + phase: K8s__io___api___core___v1__PersistentVolumePhase + reason: String +} + +input K8s__io___api___core___v1__PhotonPersistentDiskVolumeSourceIn { + fsType: String + pdID: String! +} + +input K8s__io___api___core___v1__PodAffinityIn { + preferredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__WeightedPodAffinityTermIn!] + requiredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__PodAffinityTermIn!] +} + +input K8s__io___api___core___v1__PodAffinityTermIn { + labelSelector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorIn + namespaces: [String!] + namespaceSelector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorIn + topologyKey: String! +} + +input K8s__io___api___core___v1__PodAntiAffinityIn { + preferredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__WeightedPodAffinityTermIn!] + requiredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__PodAffinityTermIn!] +} + +input K8s__io___api___core___v1__PortworxVolumeSourceIn { + fsType: String + readOnly: Boolean + volumeID: String! +} + +input K8s__io___api___core___v1__PreferredSchedulingTermIn { + preference: K8s__io___api___core___v1__NodeSelectorTermIn! + weight: Int! +} + +input K8s__io___api___core___v1__QuobyteVolumeSourceIn { + group: String + readOnly: Boolean + registry: String! + tenant: String + user: String + volume: String! +} + +input K8s__io___api___core___v1__RBDPersistentVolumeSourceIn { + fsType: String + image: String! + keyring: String + monitors: [String!]! + pool: String + readOnly: Boolean + secretRef: K8s__io___api___core___v1__SecretReferenceIn + user: String +} + +input K8s__io___api___core___v1__ResourceClaimIn { + name: String! +} + +input K8s__io___api___core___v1__ResourceRequirementsIn { + claims: [K8s__io___api___core___v1__ResourceClaimIn!] + limits: Map + requests: Map +} + +input K8s__io___api___core___v1__ScaleIOPersistentVolumeSourceIn { + fsType: String + gateway: String! + protectionDomain: String + readOnly: Boolean + secretRef: K8s__io___api___core___v1__SecretReferenceIn + sslEnabled: Boolean + storageMode: String + storagePool: String + system: String! + volumeName: String +} + +input K8s__io___api___core___v1__SecretReferenceIn { + name: String + namespace: String +} + +input K8s__io___api___core___v1__StorageOSPersistentVolumeSourceIn { + fsType: String + readOnly: Boolean + secretRef: K8s__io___api___core___v1__ObjectReferenceIn + volumeName: String + volumeNamespace: String +} + +input K8s__io___api___core___v1__TaintIn { + effect: K8s__io___api___core___v1__TaintEffect! + key: String! + timeAdded: Date + value: String +} + +input K8s__io___api___core___v1__TolerationIn { + effect: K8s__io___api___core___v1__TaintEffect + key: String + operator: K8s__io___api___core___v1__TolerationOperator + tolerationSeconds: Int + value: String +} + +input K8s__io___api___core___v1__TypedLocalObjectReferenceIn { + apiGroup: String + kind: String! + name: String! +} + +input K8s__io___api___core___v1__TypedObjectReferenceIn { + apiGroup: String + kind: String! + name: String! + namespace: String +} + +input K8s__io___api___core___v1__VolumeNodeAffinityIn { + required: K8s__io___api___core___v1__NodeSelectorIn +} + +input K8s__io___api___core___v1__VsphereVirtualDiskVolumeSourceIn { + fsType: String + storagePolicyID: String + storagePolicyName: String + volumePath: String! +} + +input K8s__io___api___core___v1__WeightedPodAffinityTermIn { + podAffinityTerm: K8s__io___api___core___v1__PodAffinityTermIn! + weight: Int! +} + +input K8s__io___api___storage___v1__VolumeAttachmentSourceIn { + inlineVolumeSpec: K8s__io___api___core___v1__PersistentVolumeSpecIn + persistentVolumeName: String +} + +input K8s__io___api___storage___v1__VolumeAttachmentSpecIn { + attacher: String! + nodeName: String! + source: K8s__io___api___storage___v1__VolumeAttachmentSourceIn! +} + +input K8s__io___api___storage___v1__VolumeAttachmentStatusIn { + attached: Boolean! + attachError: K8s__io___api___storage___v1__VolumeErrorIn + attachmentMetadata: Map + detachError: K8s__io___api___storage___v1__VolumeErrorIn +} + +input K8s__io___api___storage___v1__VolumeErrorIn { + message: String + time: Date +} + +input K8s__io___apimachinery___pkg___api___resource__QuantityIn { + Format: K8s__io___apimachinery___pkg___api___resource__Format! +} + +input K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorIn { + matchExpressions: [K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirementIn!] + matchLabels: Map +} + +input K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirementIn { + key: String! + operator: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorOperator! + values: [String!] +} + +input MetadataIn { + annotations: Map + labels: Map + name: String! + namespace: String +} + +enum Github__com___kloudlite___api___pkg___types__SyncAction { + APPLY + DELETE +} + +enum Github__com___kloudlite___api___pkg___types__SyncState { + APPLIED_AT_AGENT + DELETED_AT_AGENT + DELETING_AT_AGENT + ERRORED_AT_AGENT + IDLE + IN_QUEUE + UPDATED_AT_AGENT +} + +enum Github__com___kloudlite___operator___apis___clusters___v1__AWSPoolType { + ec2 + spot +} + +enum Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpecAvailabilityMode { + dev + HA +} + +enum Github__com___kloudlite___operator___apis___common____types__CloudProvider { + aws + azure + do + gcp +} + +enum K8s__io___api___core___v1__ConditionStatus { + False + True + Unknown +} + +enum K8s__io___api___core___v1__NamespaceConditionType { + NamespaceContentRemaining + NamespaceDeletionContentFailure + NamespaceDeletionDiscoveryFailure + NamespaceDeletionGroupVersionParsingFailure + NamespaceFinalizersRemaining +} + +enum K8s__io___api___core___v1__NamespacePhase { + Active + Terminating +} + +enum K8s__io___api___core___v1__NodeSelectorOperator { + DoesNotExist + Exists + Gt + In + Lt + NotIn +} + +enum K8s__io___api___core___v1__PersistentVolumeClaimConditionType { + FileSystemResizePending + Resizing +} + +enum K8s__io___api___core___v1__PersistentVolumeClaimPhase { + Bound + Lost + Pending +} + +enum K8s__io___api___core___v1__PersistentVolumePhase { + Available + Bound + Failed + Pending + Released +} + +enum K8s__io___api___core___v1__PersistentVolumeReclaimPolicy { + Delete + Recycle + Retain +} + +enum K8s__io___api___core___v1__TaintEffect { + NoExecute + NoSchedule + PreferNoSchedule +} + +enum K8s__io___api___core___v1__TolerationOperator { + Equal + Exists +} + +enum K8s__io___apimachinery___pkg___api___resource__Format { + BinarySI + DecimalExponent + DecimalSI +} + +enum K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorOperator { + DoesNotExist + Exists + In + NotIn +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/cursorpagination.graphqls", Input: `type CursorPagination @shareable { + after: String + before: String + first: Int + last: Int + orderBy: String + sortDirection: CursorPaginationSortDirection +} + +input CursorPaginationIn { + after: String + before: String + first: Int + last: Int + orderBy: String = "_id" + sortDirection: CursorPaginationSortDirection = "ASC" +} + +enum CursorPaginationSortDirection { + ASC + DESC +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/directives.graphqls", Input: `extend schema @link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@key", "@shareable", "@external"]) + +directive @goField( + forceResolver: Boolean + name: String +) on INPUT_FIELD_DEFINITION | FIELD_DEFINITION +`, BuiltIn: false}, + {Name: "../struct-to-graphql/domainentry.graphqls", Input: `type DomainEntry @shareable { + accountName: String! + clusterName: String! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + domainName: String! + id: String! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + recordVersion: Int! + updateTime: Date! +} + +type DomainEntryEdge @shareable { + cursor: String! + node: DomainEntry! +} + +type DomainEntryPaginatedRecords @shareable { + edges: [DomainEntryEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input DomainEntryIn { + clusterName: String! + displayName: String! + domainName: String! +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/helmrelease.graphqls", Input: `type HelmRelease @shareable { + accountName: String! + apiVersion: String + clusterName: String! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + recordVersion: Int! + spec: Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec + status: Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type HelmReleaseEdge @shareable { + cursor: String! + node: HelmRelease! +} + +type HelmReleasePaginatedRecords @shareable { + edges: [HelmReleaseEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input HelmReleaseIn { + apiVersion: String + displayName: String! + kind: String + metadata: MetadataIn + spec: Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpecIn +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/matchfilter.graphqls", Input: `type MatchFilter @shareable { + array: [Any!] + exact: Any + matchType: MatchFilterMatchType! + regex: String +} + +input MatchFilterIn { + array: [Any!] + exact: Any + matchType: MatchFilterMatchType! + regex: String +} + +enum MatchFilterMatchType { + array + exact + regex +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/msvctemplate.graphqls", Input: `type MsvcTemplate @shareable { + category: String! + displayName: String! + items: [Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry!]! +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/namespace.graphqls", Input: `type Namespace @shareable { + accountName: String! + apiVersion: String + clusterName: String! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + recordVersion: Int! + spec: K8s__io___api___core___v1__NamespaceSpec + status: K8s__io___api___core___v1__NamespaceStatus + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type NamespaceEdge @shareable { + cursor: String! + node: Namespace! +} + +type NamespacePaginatedRecords @shareable { + edges: [NamespaceEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input NamespaceIn { + apiVersion: String + kind: String + metadata: MetadataIn + spec: K8s__io___api___core___v1__NamespaceSpecIn + status: K8s__io___api___core___v1__NamespaceStatusIn +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/node.graphqls", Input: `type Node @shareable { + accountName: String! + apiVersion: String + clusterName: String! + creationTime: Date! + id: String! + kind: String + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + recordVersion: Int! + spec: Github__com___kloudlite___operator___apis___clusters___v1__NodeSpec! + status: Github__com___kloudlite___operator___pkg___operator__Status + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type NodeEdge @shareable { + cursor: String! + node: Node! +} + +type NodePaginatedRecords @shareable { + edges: [NodeEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input NodeIn { + apiVersion: String + kind: String + metadata: MetadataIn + spec: Github__com___kloudlite___operator___apis___clusters___v1__NodeSpecIn! +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/nodepool.graphqls", Input: `type NodePool @shareable { + accountName: String! + apiVersion: String + clusterName: String! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + recordVersion: Int! + spec: Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec! + status: Github__com___kloudlite___operator___pkg___operator__Status + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type NodePoolEdge @shareable { + cursor: String! + node: NodePool! +} + +type NodePoolPaginatedRecords @shareable { + edges: [NodePoolEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input NodePoolIn { + apiVersion: String + displayName: String! + kind: String + metadata: MetadataIn + spec: Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpecIn! +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/persistentvolume.graphqls", Input: `type PersistentVolume @shareable { + accountName: String! + apiVersion: String + clusterName: String! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + recordVersion: Int! + spec: K8s__io___api___core___v1__PersistentVolumeSpec + status: K8s__io___api___core___v1__PersistentVolumeStatus + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type PersistentVolumeEdge @shareable { + cursor: String! + node: PersistentVolume! +} + +type PersistentVolumePaginatedRecords @shareable { + edges: [PersistentVolumeEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input PersistentVolumeIn { + apiVersion: String + kind: String + metadata: MetadataIn + spec: K8s__io___api___core___v1__PersistentVolumeSpecIn + status: K8s__io___api___core___v1__PersistentVolumeStatusIn +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/persistentvolumeclaim.graphqls", Input: `type PersistentVolumeClaim @shareable { + accountName: String! + apiVersion: String + clusterName: String! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + recordVersion: Int! + spec: K8s__io___api___core___v1__PersistentVolumeClaimSpec + status: K8s__io___api___core___v1__PersistentVolumeClaimStatus + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type PersistentVolumeClaimEdge @shareable { + cursor: String! + node: PersistentVolumeClaim! +} + +type PersistentVolumeClaimPaginatedRecords @shareable { + edges: [PersistentVolumeClaimEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/scalars.graphqls", Input: `scalar Any +scalar Json +scalar Map +scalar Date +`, BuiltIn: false}, + {Name: "../struct-to-graphql/volumeattachment.graphqls", Input: `type VolumeAttachment @shareable { + accountName: String! + apiVersion: String + clusterName: String! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + recordVersion: Int! + spec: K8s__io___api___storage___v1__VolumeAttachmentSpec! + status: K8s__io___api___storage___v1__VolumeAttachmentStatus + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type VolumeAttachmentEdge @shareable { + cursor: String! + node: VolumeAttachment! +} + +type VolumeAttachmentPaginatedRecords @shareable { + edges: [VolumeAttachmentEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input VolumeAttachmentIn { + apiVersion: String + kind: String + metadata: MetadataIn + spec: K8s__io___api___storage___v1__VolumeAttachmentSpecIn! + status: K8s__io___api___storage___v1__VolumeAttachmentStatusIn +} + +`, BuiltIn: false}, + {Name: "../../federation/directives.graphql", Input: ` + scalar _Any + scalar _FieldSet + directive @requires(fields: _FieldSet!) on FIELD_DEFINITION + directive @provides(fields: _FieldSet!) on FIELD_DEFINITION + directive @extends on OBJECT | INTERFACE + + directive @key(fields: _FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE + directive @external on FIELD_DEFINITION | OBJECT + directive @link(import: [String!], url: String!) repeatable on SCHEMA + directive @shareable on OBJECT | FIELD_DEFINITION + directive @tag(name: String!) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION + directive @override(from: String!) on FIELD_DEFINITION + directive @inaccessible on SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION +`, BuiltIn: true}, + {Name: "../../federation/entity.graphql", Input: ` +type _Service { + sdl: String +} + +extend type Query { + _service: _Service! +} +`, BuiltIn: true}, +} +var parsedSchema = gqlparser.MustLoadSchema(sources...) + +// endregion ************************** generated!.gotpl ************************** + +// region ***************************** args.gotpl ***************************** + +func (ec *executionContext) field_Mutation_infra_createClusterManagedService_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["clusterName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["clusterName"] = arg0 + var arg1 entities.ClusterManagedService + if tmp, ok := rawArgs["service"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("service")) + arg1, err = ec.unmarshalNClusterManagedServiceIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐClusterManagedService(ctx, tmp) + if err != nil { + return nil, err + } + } + args["service"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_infra_createCluster_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 entities.Cluster + if tmp, ok := rawArgs["cluster"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cluster")) + arg0, err = ec.unmarshalNClusterIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐCluster(ctx, tmp) + if err != nil { + return nil, err + } + } + args["cluster"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_infra_createDomainEntry_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 entities.DomainEntry + if tmp, ok := rawArgs["domainEntry"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("domainEntry")) + arg0, err = ec.unmarshalNDomainEntryIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐDomainEntry(ctx, tmp) + if err != nil { + return nil, err + } + } + args["domainEntry"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_infra_createHelmRelease_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["clusterName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["clusterName"] = arg0 + var arg1 entities.HelmRelease + if tmp, ok := rawArgs["release"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("release")) + arg1, err = ec.unmarshalNHelmReleaseIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐHelmRelease(ctx, tmp) + if err != nil { + return nil, err + } + } + args["release"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_infra_createNodePool_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["clusterName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["clusterName"] = arg0 + var arg1 entities.NodePool + if tmp, ok := rawArgs["pool"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pool")) + arg1, err = ec.unmarshalNNodePoolIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐNodePool(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pool"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_infra_createProviderSecret_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 entities.CloudProviderSecret + if tmp, ok := rawArgs["secret"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secret")) + arg0, err = ec.unmarshalNCloudProviderSecretIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐCloudProviderSecret(ctx, tmp) + if err != nil { + return nil, err + } + } + args["secret"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_infra_deleteClusterManagedService_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["clusterName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["clusterName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["serviceName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("serviceName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["serviceName"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_infra_deleteCluster_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_Mutation_infra_deleteDomainEntry_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["domainName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("domainName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["domainName"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_infra_deleteHelmRelease_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["clusterName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["clusterName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["releaseName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("releaseName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["releaseName"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_infra_deleteNodePool_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["clusterName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["clusterName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["poolName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("poolName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["poolName"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_infra_deleteProviderSecret_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["secretName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["secretName"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_infra_updateClusterManagedService_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["clusterName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["clusterName"] = arg0 + var arg1 entities.ClusterManagedService + if tmp, ok := rawArgs["service"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("service")) + arg1, err = ec.unmarshalNClusterManagedServiceIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐClusterManagedService(ctx, tmp) + if err != nil { + return nil, err + } + } + args["service"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_infra_updateCluster_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 entities.Cluster + if tmp, ok := rawArgs["cluster"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cluster")) + arg0, err = ec.unmarshalNClusterIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐCluster(ctx, tmp) + if err != nil { + return nil, err + } + } + args["cluster"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_infra_updateDomainEntry_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 entities.DomainEntry + if tmp, ok := rawArgs["domainEntry"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("domainEntry")) + arg0, err = ec.unmarshalNDomainEntryIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐDomainEntry(ctx, tmp) + if err != nil { + return nil, err + } + } + args["domainEntry"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_infra_updateHelmRelease_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["clusterName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["clusterName"] = arg0 + var arg1 entities.HelmRelease + if tmp, ok := rawArgs["release"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("release")) + arg1, err = ec.unmarshalNHelmReleaseIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐHelmRelease(ctx, tmp) + if err != nil { + return nil, err + } + } + args["release"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_infra_updateNodePool_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["clusterName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["clusterName"] = arg0 + var arg1 entities.NodePool + if tmp, ok := rawArgs["pool"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pool")) + arg1, err = ec.unmarshalNNodePoolIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐNodePool(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pool"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_infra_updateProviderSecret_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 entities.CloudProviderSecret + if tmp, ok := rawArgs["secret"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secret")) + arg0, err = ec.unmarshalNCloudProviderSecretIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐCloudProviderSecret(ctx, tmp) + if err != nil { + return nil, err + } + } + args["secret"] = arg0 + 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_infra_checkAwsAccess_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["cloudproviderName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cloudproviderName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["cloudproviderName"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_infra_checkNameAvailability_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 domain.ResType + if tmp, ok := rawArgs["resType"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("resType")) + arg0, err = ec.unmarshalNResType2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋdomainᚐResType(ctx, tmp) + if err != nil { + return nil, err + } + } + args["resType"] = arg0 + var arg1 *string + if tmp, ok := rawArgs["clusterName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) + if err != nil { + return nil, err + } + } + args["clusterName"] = arg1 + var arg2 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg2, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg2 + return args, nil +} + +func (ec *executionContext) field_Query_infra_getClusterManagedService_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["clusterName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["clusterName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Query_infra_getCluster_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_infra_getDomainEntry_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["domainName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("domainName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["domainName"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_infra_getHelmRelease_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["clusterName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["clusterName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Query_infra_getManagedServiceTemplate_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["category"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("category")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["category"] = arg0 + var arg1 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Query_infra_getNamespace_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["clusterName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["clusterName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Query_infra_getNodePool_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["clusterName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["clusterName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["poolName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("poolName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["poolName"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Query_infra_getPVC_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["clusterName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["clusterName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Query_infra_getPV_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["clusterName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["clusterName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Query_infra_getProviderSecret_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_infra_getVolumeAttachment_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["clusterName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["clusterName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Query_infra_listClusterManagedServices_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["clusterName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["clusterName"] = arg0 + var arg1 *model.SearchClusterManagedService + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg1, err = ec.unmarshalOSearchClusterManagedService2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐSearchClusterManagedService(ctx, tmp) + if err != nil { + return nil, err + } + } + args["search"] = arg1 + var arg2 *repos.CursorPagination + if tmp, ok := rawArgs["pagination"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pagination")) + arg2, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pagination"] = arg2 + return args, nil +} + +func (ec *executionContext) field_Query_infra_listClusters_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *model.SearchCluster + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg0, err = ec.unmarshalOSearchCluster2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐSearchCluster(ctx, tmp) + if err != nil { + return nil, err + } + } + args["search"] = arg0 + var arg1 *repos.CursorPagination + if tmp, ok := rawArgs["pagination"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pagination")) + arg1, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pagination"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Query_infra_listDomainEntries_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *model.SearchDomainEntry + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg0, err = ec.unmarshalOSearchDomainEntry2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐSearchDomainEntry(ctx, tmp) + if err != nil { + return nil, err + } + } + args["search"] = arg0 + var arg1 *repos.CursorPagination + if tmp, ok := rawArgs["pagination"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pagination")) + arg1, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pagination"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Query_infra_listHelmReleases_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["clusterName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["clusterName"] = arg0 + var arg1 *model.SearchHelmRelease + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg1, err = ec.unmarshalOSearchHelmRelease2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐSearchHelmRelease(ctx, tmp) + if err != nil { + return nil, err + } + } + args["search"] = arg1 + var arg2 *repos.CursorPagination + if tmp, ok := rawArgs["pagination"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pagination")) + arg2, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pagination"] = arg2 + return args, nil +} + +func (ec *executionContext) field_Query_infra_listNamespaces_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["clusterName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["clusterName"] = arg0 + var arg1 *model.SearchNamespaces + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg1, err = ec.unmarshalOSearchNamespaces2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐSearchNamespaces(ctx, tmp) + if err != nil { + return nil, err + } + } + args["search"] = arg1 + var arg2 *repos.CursorPagination + if tmp, ok := rawArgs["pq"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) + arg2, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pq"] = arg2 + return args, nil +} + +func (ec *executionContext) field_Query_infra_listNodePools_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["clusterName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["clusterName"] = arg0 + var arg1 *model.SearchNodepool + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg1, err = ec.unmarshalOSearchNodepool2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐSearchNodepool(ctx, tmp) + if err != nil { + return nil, err + } + } + args["search"] = arg1 + var arg2 *repos.CursorPagination + if tmp, ok := rawArgs["pagination"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pagination")) + arg2, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pagination"] = arg2 + return args, nil +} + +func (ec *executionContext) field_Query_infra_listPVCs_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["clusterName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["clusterName"] = arg0 + var arg1 *model.SearchPersistentVolumeClaims + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg1, err = ec.unmarshalOSearchPersistentVolumeClaims2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐSearchPersistentVolumeClaims(ctx, tmp) + if err != nil { + return nil, err + } + } + args["search"] = arg1 + var arg2 *repos.CursorPagination + if tmp, ok := rawArgs["pq"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) + arg2, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pq"] = arg2 + return args, nil +} + +func (ec *executionContext) field_Query_infra_listPVs_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["clusterName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["clusterName"] = arg0 + var arg1 *model.SearchPersistentVolumes + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg1, err = ec.unmarshalOSearchPersistentVolumes2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐSearchPersistentVolumes(ctx, tmp) + if err != nil { + return nil, err + } + } + args["search"] = arg1 + var arg2 *repos.CursorPagination + if tmp, ok := rawArgs["pq"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) + arg2, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pq"] = arg2 + return args, nil +} + +func (ec *executionContext) field_Query_infra_listProviderSecrets_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *model.SearchProviderSecret + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg0, err = ec.unmarshalOSearchProviderSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐSearchProviderSecret(ctx, tmp) + if err != nil { + return nil, err + } + } + args["search"] = arg0 + var arg1 *repos.CursorPagination + if tmp, ok := rawArgs["pagination"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pagination")) + arg1, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pagination"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Query_infra_listVolumeAttachments_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["clusterName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["clusterName"] = arg0 + var arg1 *model.SearchVolumeAttachments + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg1, err = ec.unmarshalOSearchVolumeAttachments2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐSearchVolumeAttachments(ctx, tmp) + if err != nil { + return nil, err + } + } + args["search"] = arg1 + var arg2 *repos.CursorPagination + if tmp, ok := rawArgs["pq"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) + arg2, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pq"] = arg2 + 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) _CheckAwsAccessOutput_result(ctx context.Context, field graphql.CollectedField, obj *model.CheckAwsAccessOutput) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CheckAwsAccessOutput_result(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Result, nil + }) + if err != nil { + ec.Error(ctx, 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_CheckAwsAccessOutput_result(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CheckAwsAccessOutput", + 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) _CheckAwsAccessOutput_installationUrl(ctx context.Context, field graphql.CollectedField, obj *model.CheckAwsAccessOutput) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CheckAwsAccessOutput_installationUrl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.InstallationURL, nil + }) + 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_CheckAwsAccessOutput_installationUrl(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CheckAwsAccessOutput", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _CheckNameAvailabilityOutput_result(ctx context.Context, field graphql.CollectedField, obj *domain.CheckNameAvailabilityOutput) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CheckNameAvailabilityOutput_result(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Result, nil + }) + if err != nil { + ec.Error(ctx, 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_CheckNameAvailabilityOutput_result(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CheckNameAvailabilityOutput", + 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) _CheckNameAvailabilityOutput_suggestedNames(ctx context.Context, field graphql.CollectedField, obj *domain.CheckNameAvailabilityOutput) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CheckNameAvailabilityOutput_suggestedNames(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SuggestedNames, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_CheckNameAvailabilityOutput_suggestedNames(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CheckNameAvailabilityOutput", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _CloudProviderSecret_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.CloudProviderSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CloudProviderSecret_accountName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_CloudProviderSecret_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CloudProviderSecret", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _CloudProviderSecret_aws(ctx context.Context, field graphql.CollectedField, obj *entities.CloudProviderSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CloudProviderSecret_aws(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.CloudProviderSecret().Aws(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteAPIAppsInfraInternalEntitiesAWSSecretCredentials) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsInfraInternalEntitiesAWSSecretCredentials(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_CloudProviderSecret_aws(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CloudProviderSecret", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accessKey": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_accessKey(ctx, field) + case "awsAccountId": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_awsAccountId(ctx, field) + case "cfParamExternalID": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_cfParamExternalID(ctx, field) + case "cfParamInstanceProfileName": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_cfParamInstanceProfileName(ctx, field) + case "cfParamRoleName": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_cfParamRoleName(ctx, field) + case "cfParamStackName": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_cfParamStackName(ctx, field) + case "cfParamTrustedARN": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_cfParamTrustedARN(ctx, field) + case "secretKey": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_secretKey(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _CloudProviderSecret_cloudProviderName(ctx context.Context, field graphql.CollectedField, obj *entities.CloudProviderSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CloudProviderSecret_cloudProviderName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.CloudProviderSecret().CloudProviderName(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.GithubComKloudliteOperatorApisCommonTypesCloudProvider) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___operator___apis___common____types__CloudProvider2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCommonTypesCloudProvider(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_CloudProviderSecret_cloudProviderName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CloudProviderSecret", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Github__com___kloudlite___operator___apis___common____types__CloudProvider does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _CloudProviderSecret_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.CloudProviderSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CloudProviderSecret_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_CloudProviderSecret_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CloudProviderSecret", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _CloudProviderSecret_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.CloudProviderSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CloudProviderSecret_creationTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.CloudProviderSecret().CreationTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_CloudProviderSecret_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CloudProviderSecret", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _CloudProviderSecret_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.CloudProviderSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CloudProviderSecret_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_CloudProviderSecret_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CloudProviderSecret", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _CloudProviderSecret_id(ctx context.Context, field graphql.CollectedField, obj *entities.CloudProviderSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CloudProviderSecret_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 ec.resolvers.CloudProviderSecret().ID(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_CloudProviderSecret_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CloudProviderSecret", + 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) _CloudProviderSecret_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.CloudProviderSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CloudProviderSecret_lastUpdatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastUpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_CloudProviderSecret_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CloudProviderSecret", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _CloudProviderSecret_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.CloudProviderSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CloudProviderSecret_markedForDeletion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MarkedForDeletion, 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_CloudProviderSecret_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CloudProviderSecret", + 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) _CloudProviderSecret_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.CloudProviderSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CloudProviderSecret_metadata(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ObjectMeta, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(v1.ObjectMeta) + fc.Result = res + return ec.marshalNMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_CloudProviderSecret_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CloudProviderSecret", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "annotations": + return ec.fieldContext_Metadata_annotations(ctx, field) + case "creationTimestamp": + return ec.fieldContext_Metadata_creationTimestamp(ctx, field) + case "deletionTimestamp": + return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) + case "generation": + return ec.fieldContext_Metadata_generation(ctx, field) + case "labels": + return ec.fieldContext_Metadata_labels(ctx, field) + case "name": + return ec.fieldContext_Metadata_name(ctx, field) + case "namespace": + return ec.fieldContext_Metadata_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _CloudProviderSecret_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.CloudProviderSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CloudProviderSecret_recordVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RecordVersion, nil + }) + if err != nil { + ec.Error(ctx, 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_CloudProviderSecret_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CloudProviderSecret", + 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) _CloudProviderSecret_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.CloudProviderSecret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CloudProviderSecret_updateTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.CloudProviderSecret().UpdateTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_CloudProviderSecret_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CloudProviderSecret", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _CloudProviderSecretEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.CloudProviderSecretEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CloudProviderSecretEdge_cursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_CloudProviderSecretEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CloudProviderSecretEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _CloudProviderSecretEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.CloudProviderSecretEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CloudProviderSecretEdge_node(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*entities.CloudProviderSecret) + fc.Result = res + return ec.marshalNCloudProviderSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐCloudProviderSecret(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_CloudProviderSecretEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CloudProviderSecretEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accountName": + return ec.fieldContext_CloudProviderSecret_accountName(ctx, field) + case "aws": + return ec.fieldContext_CloudProviderSecret_aws(ctx, field) + case "cloudProviderName": + return ec.fieldContext_CloudProviderSecret_cloudProviderName(ctx, field) + case "createdBy": + return ec.fieldContext_CloudProviderSecret_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_CloudProviderSecret_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_CloudProviderSecret_displayName(ctx, field) + case "id": + return ec.fieldContext_CloudProviderSecret_id(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_CloudProviderSecret_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_CloudProviderSecret_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_CloudProviderSecret_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_CloudProviderSecret_recordVersion(ctx, field) + case "updateTime": + return ec.fieldContext_CloudProviderSecret_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type CloudProviderSecret", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _CloudProviderSecretPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.CloudProviderSecretPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CloudProviderSecretPaginatedRecords_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.CloudProviderSecretEdge) + fc.Result = res + return ec.marshalNCloudProviderSecretEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐCloudProviderSecretEdgeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_CloudProviderSecretPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CloudProviderSecretPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cursor": + return ec.fieldContext_CloudProviderSecretEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_CloudProviderSecretEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type CloudProviderSecretEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _CloudProviderSecretPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.CloudProviderSecretPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CloudProviderSecretPaginatedRecords_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.PageInfo) + fc.Result = res + return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_CloudProviderSecretPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CloudProviderSecretPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _CloudProviderSecretPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.CloudProviderSecretPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CloudProviderSecretPaginatedRecords_totalCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalCount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_CloudProviderSecretPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CloudProviderSecretPaginatedRecords", + 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) _Cluster_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.Cluster) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Cluster_accountName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Cluster_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Cluster", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Cluster_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Cluster) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Cluster_apiVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.APIVersion, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Cluster_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Cluster", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Cluster_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.Cluster) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Cluster_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Cluster_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Cluster", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Cluster_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.Cluster) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Cluster_creationTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Cluster().CreationTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Cluster_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Cluster", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Cluster_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.Cluster) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Cluster_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_Cluster_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Cluster", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Cluster_id(ctx context.Context, field graphql.CollectedField, obj *entities.Cluster) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Cluster_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 ec.resolvers.Cluster().ID(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_Cluster_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Cluster", + 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) _Cluster_kind(ctx context.Context, field graphql.CollectedField, obj *entities.Cluster) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Cluster_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Cluster_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Cluster", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Cluster_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.Cluster) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Cluster_lastUpdatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastUpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Cluster_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Cluster", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Cluster_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.Cluster) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Cluster_markedForDeletion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MarkedForDeletion, 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_Cluster_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Cluster", + 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) _Cluster_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.Cluster) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Cluster_metadata(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ObjectMeta, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(v1.ObjectMeta) + fc.Result = res + return ec.marshalNMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Cluster_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Cluster", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "annotations": + return ec.fieldContext_Metadata_annotations(ctx, field) + case "creationTimestamp": + return ec.fieldContext_Metadata_creationTimestamp(ctx, field) + case "deletionTimestamp": + return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) + case "generation": + return ec.fieldContext_Metadata_generation(ctx, field) + case "labels": + return ec.fieldContext_Metadata_labels(ctx, field) + case "name": + return ec.fieldContext_Metadata_name(ctx, field) + case "namespace": + return ec.fieldContext_Metadata_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Cluster_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Cluster) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Cluster_recordVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RecordVersion, nil + }) + if err != nil { + ec.Error(ctx, 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_Cluster_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Cluster", + 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) _Cluster_spec(ctx context.Context, field graphql.CollectedField, obj *entities.Cluster) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Cluster_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 ec.resolvers.Cluster().Spec(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.GithubComKloudliteOperatorApisClustersV1ClusterSpec) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___operator___apis___clusters___v1__ClusterSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1ClusterSpec(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Cluster_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Cluster", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accountId": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_accountId(ctx, field) + case "accountName": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_accountName(ctx, field) + case "availabilityMode": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_availabilityMode(ctx, field) + case "aws": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_aws(ctx, field) + case "backupToS3Enabled": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_backupToS3Enabled(ctx, field) + case "cloudflareEnabled": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_cloudflareEnabled(ctx, field) + case "cloudProvider": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_cloudProvider(ctx, field) + case "clusterInternalDnsHost": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_clusterInternalDnsHost(ctx, field) + case "clusterTokenRef": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_clusterTokenRef(ctx, field) + case "credentialKeys": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_credentialKeys(ctx, field) + case "credentialsRef": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_credentialsRef(ctx, field) + case "kloudliteRelease": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_kloudliteRelease(ctx, field) + case "messageQueueTopicName": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_messageQueueTopicName(ctx, field) + case "output": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_output(ctx, field) + case "publicDNSHost": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_publicDNSHost(ctx, field) + case "taintMasterNodes": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_taintMasterNodes(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Cluster_status(ctx context.Context, field graphql.CollectedField, obj *entities.Cluster) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Cluster_status(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Status, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(operator.Status) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___pkg___operator__Status2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Cluster_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Cluster", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "checks": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx, field) + case "isReady": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_isReady(ctx, field) + case "lastReadyGeneration": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReadyGeneration(ctx, field) + case "lastReconcileTime": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReconcileTime(ctx, field) + case "message": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_message(ctx, field) + case "resources": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_resources(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___pkg___operator__Status", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Cluster_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.Cluster) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Cluster_syncStatus(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SyncStatus, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(types.SyncStatus) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___pkg___types__SyncStatus2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Cluster_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Cluster", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "action": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx, field) + case "error": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx, field) + case "lastSyncedAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx, field) + case "recordVersion": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx, field) + case "state": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx, field) + case "syncScheduledAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___pkg___types__SyncStatus", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Cluster_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.Cluster) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Cluster_updateTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Cluster().UpdateTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Cluster_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Cluster", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Cluster_adminKubeconfig(ctx context.Context, field graphql.CollectedField, obj *entities.Cluster) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Cluster_adminKubeconfig(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Cluster().AdminKubeconfig(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.EncodedValue) + fc.Result = res + return ec.marshalOEncodedValue2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐEncodedValue(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Cluster_adminKubeconfig(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Cluster", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "value": + return ec.fieldContext_EncodedValue_value(ctx, field) + case "encoding": + return ec.fieldContext_EncodedValue_encoding(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EncodedValue", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ClusterEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.ClusterEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ClusterEdge_cursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ClusterEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ClusterEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ClusterEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.ClusterEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ClusterEdge_node(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*entities.Cluster) + fc.Result = res + return ec.marshalNCluster2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐCluster(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ClusterEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ClusterEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accountName": + return ec.fieldContext_Cluster_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Cluster_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_Cluster_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Cluster_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_Cluster_displayName(ctx, field) + case "id": + return ec.fieldContext_Cluster_id(ctx, field) + case "kind": + return ec.fieldContext_Cluster_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Cluster_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Cluster_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Cluster_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_Cluster_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_Cluster_spec(ctx, field) + case "status": + return ec.fieldContext_Cluster_status(ctx, field) + case "syncStatus": + return ec.fieldContext_Cluster_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_Cluster_updateTime(ctx, field) + case "adminKubeconfig": + return ec.fieldContext_Cluster_adminKubeconfig(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Cluster", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ClusterManagedService_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.ClusterManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ClusterManagedService_accountName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_ClusterManagedService_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ClusterManagedService", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ClusterManagedService_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.ClusterManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ClusterManagedService_apiVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.APIVersion, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ClusterManagedService_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ClusterManagedService", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ClusterManagedService_clusterName(ctx context.Context, field graphql.CollectedField, obj *entities.ClusterManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ClusterManagedService_clusterName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ClusterName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_ClusterManagedService_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ClusterManagedService", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ClusterManagedService_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.ClusterManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ClusterManagedService_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ClusterManagedService_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ClusterManagedService", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ClusterManagedService_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.ClusterManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ClusterManagedService_creationTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.ClusterManagedService().CreationTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ClusterManagedService_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ClusterManagedService", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ClusterManagedService_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.ClusterManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ClusterManagedService_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_ClusterManagedService_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ClusterManagedService", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ClusterManagedService_id(ctx context.Context, field graphql.CollectedField, obj *entities.ClusterManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ClusterManagedService_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 ec.resolvers.ClusterManagedService().ID(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_ClusterManagedService_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ClusterManagedService", + 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) _ClusterManagedService_kind(ctx context.Context, field graphql.CollectedField, obj *entities.ClusterManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ClusterManagedService_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ClusterManagedService_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ClusterManagedService", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ClusterManagedService_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.ClusterManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ClusterManagedService_lastUpdatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastUpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ClusterManagedService_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ClusterManagedService", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ClusterManagedService_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.ClusterManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ClusterManagedService_markedForDeletion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MarkedForDeletion, 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_ClusterManagedService_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ClusterManagedService", + 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) _ClusterManagedService_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.ClusterManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ClusterManagedService_metadata(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ObjectMeta, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(v1.ObjectMeta) + fc.Result = res + return ec.marshalOMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ClusterManagedService_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ClusterManagedService", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "annotations": + return ec.fieldContext_Metadata_annotations(ctx, field) + case "creationTimestamp": + return ec.fieldContext_Metadata_creationTimestamp(ctx, field) + case "deletionTimestamp": + return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) + case "generation": + return ec.fieldContext_Metadata_generation(ctx, field) + case "labels": + return ec.fieldContext_Metadata_labels(ctx, field) + case "name": + return ec.fieldContext_Metadata_name(ctx, field) + case "namespace": + return ec.fieldContext_Metadata_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ClusterManagedService_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.ClusterManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ClusterManagedService_recordVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RecordVersion, nil + }) + if err != nil { + ec.Error(ctx, 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_ClusterManagedService_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ClusterManagedService", + 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) _ClusterManagedService_spec(ctx context.Context, field graphql.CollectedField, obj *entities.ClusterManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ClusterManagedService_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 ec.resolvers.ClusterManagedService().Spec(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorApisCrdsV1ClusterManagedServiceSpec) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ClusterManagedServiceSpec(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ClusterManagedService_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ClusterManagedService", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "msvcSpec": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec_msvcSpec(ctx, field) + case "targetNamespace": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec_targetNamespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ClusterManagedService_status(ctx context.Context, field graphql.CollectedField, obj *entities.ClusterManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ClusterManagedService_status(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Status, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(operator.Status) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___pkg___operator__Status2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ClusterManagedService_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ClusterManagedService", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "checks": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx, field) + case "isReady": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_isReady(ctx, field) + case "lastReadyGeneration": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReadyGeneration(ctx, field) + case "lastReconcileTime": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReconcileTime(ctx, field) + case "message": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_message(ctx, field) + case "resources": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_resources(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___pkg___operator__Status", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ClusterManagedService_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.ClusterManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ClusterManagedService_syncStatus(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SyncStatus, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(types.SyncStatus) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___pkg___types__SyncStatus2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ClusterManagedService_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ClusterManagedService", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "action": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx, field) + case "error": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx, field) + case "lastSyncedAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx, field) + case "recordVersion": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx, field) + case "state": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx, field) + case "syncScheduledAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___pkg___types__SyncStatus", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ClusterManagedService_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.ClusterManagedService) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ClusterManagedService_updateTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.ClusterManagedService().UpdateTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ClusterManagedService_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ClusterManagedService", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ClusterManagedServiceEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.ClusterManagedServiceEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ClusterManagedServiceEdge_cursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ClusterManagedServiceEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ClusterManagedServiceEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ClusterManagedServiceEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.ClusterManagedServiceEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ClusterManagedServiceEdge_node(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*entities.ClusterManagedService) + fc.Result = res + return ec.marshalNClusterManagedService2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐClusterManagedService(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ClusterManagedServiceEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ClusterManagedServiceEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accountName": + return ec.fieldContext_ClusterManagedService_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_ClusterManagedService_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_ClusterManagedService_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_ClusterManagedService_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_ClusterManagedService_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_ClusterManagedService_displayName(ctx, field) + case "id": + return ec.fieldContext_ClusterManagedService_id(ctx, field) + case "kind": + return ec.fieldContext_ClusterManagedService_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_ClusterManagedService_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_ClusterManagedService_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_ClusterManagedService_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_ClusterManagedService_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_ClusterManagedService_spec(ctx, field) + case "status": + return ec.fieldContext_ClusterManagedService_status(ctx, field) + case "syncStatus": + return ec.fieldContext_ClusterManagedService_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_ClusterManagedService_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ClusterManagedService", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ClusterManagedServicePaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.ClusterManagedServicePaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ClusterManagedServicePaginatedRecords_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.ClusterManagedServiceEdge) + fc.Result = res + return ec.marshalNClusterManagedServiceEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐClusterManagedServiceEdgeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ClusterManagedServicePaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ClusterManagedServicePaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cursor": + return ec.fieldContext_ClusterManagedServiceEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_ClusterManagedServiceEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ClusterManagedServiceEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ClusterManagedServicePaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.ClusterManagedServicePaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ClusterManagedServicePaginatedRecords_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.PageInfo) + fc.Result = res + return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ClusterManagedServicePaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ClusterManagedServicePaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ClusterManagedServicePaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.ClusterManagedServicePaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ClusterManagedServicePaginatedRecords_totalCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalCount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ClusterManagedServicePaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ClusterManagedServicePaginatedRecords", + 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) _ClusterPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.ClusterPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ClusterPaginatedRecords_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.ClusterEdge) + fc.Result = res + return ec.marshalNClusterEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐClusterEdgeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ClusterPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ClusterPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cursor": + return ec.fieldContext_ClusterEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_ClusterEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ClusterEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ClusterPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.ClusterPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ClusterPaginatedRecords_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.PageInfo) + fc.Result = res + return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ClusterPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ClusterPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ClusterPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.ClusterPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ClusterPaginatedRecords_totalCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalCount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ClusterPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ClusterPaginatedRecords", + 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) _CursorPagination_after(ctx context.Context, field graphql.CollectedField, obj *repos.CursorPagination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CursorPagination_after(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.After, nil + }) + 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_CursorPagination_after(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CursorPagination", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _CursorPagination_before(ctx context.Context, field graphql.CollectedField, obj *repos.CursorPagination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CursorPagination_before(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Before, nil + }) + 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_CursorPagination_before(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CursorPagination", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _CursorPagination_first(ctx context.Context, field graphql.CollectedField, obj *repos.CursorPagination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CursorPagination_first(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.First, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int64) + fc.Result = res + return ec.marshalOInt2ᚖint64(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_CursorPagination_first(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CursorPagination", + 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) _CursorPagination_last(ctx context.Context, field graphql.CollectedField, obj *repos.CursorPagination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CursorPagination_last(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Last, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int64) + fc.Result = res + return ec.marshalOInt2ᚖint64(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_CursorPagination_last(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CursorPagination", + 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) _CursorPagination_orderBy(ctx context.Context, field graphql.CollectedField, obj *repos.CursorPagination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CursorPagination_orderBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OrderBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_CursorPagination_orderBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CursorPagination", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _CursorPagination_sortDirection(ctx context.Context, field graphql.CollectedField, obj *repos.CursorPagination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_CursorPagination_sortDirection(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SortDirection, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(repos.SortDirection) + fc.Result = res + return ec.marshalOCursorPaginationSortDirection2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐSortDirection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_CursorPagination_sortDirection(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "CursorPagination", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type CursorPaginationSortDirection does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DomainEntry_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.DomainEntry) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DomainEntry_accountName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_DomainEntry_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DomainEntry", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DomainEntry_clusterName(ctx context.Context, field graphql.CollectedField, obj *entities.DomainEntry) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DomainEntry_clusterName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ClusterName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_DomainEntry_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DomainEntry", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DomainEntry_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.DomainEntry) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DomainEntry_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DomainEntry_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DomainEntry", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DomainEntry_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.DomainEntry) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DomainEntry_creationTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.DomainEntry().CreationTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DomainEntry_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DomainEntry", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DomainEntry_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.DomainEntry) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DomainEntry_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_DomainEntry_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DomainEntry", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DomainEntry_domainName(ctx context.Context, field graphql.CollectedField, obj *entities.DomainEntry) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DomainEntry_domainName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DomainName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_DomainEntry_domainName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DomainEntry", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DomainEntry_id(ctx context.Context, field graphql.CollectedField, obj *entities.DomainEntry) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DomainEntry_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 ec.resolvers.DomainEntry().ID(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_DomainEntry_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DomainEntry", + 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) _DomainEntry_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.DomainEntry) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DomainEntry_lastUpdatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastUpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DomainEntry_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DomainEntry", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DomainEntry_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.DomainEntry) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DomainEntry_markedForDeletion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MarkedForDeletion, 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_DomainEntry_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DomainEntry", + 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) _DomainEntry_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.DomainEntry) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DomainEntry_recordVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RecordVersion, nil + }) + if err != nil { + ec.Error(ctx, 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_DomainEntry_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DomainEntry", + 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) _DomainEntry_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.DomainEntry) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DomainEntry_updateTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.DomainEntry().UpdateTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DomainEntry_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DomainEntry", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DomainEntryEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.DomainEntryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DomainEntryEdge_cursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DomainEntryEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DomainEntryEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DomainEntryEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.DomainEntryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DomainEntryEdge_node(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*entities.DomainEntry) + fc.Result = res + return ec.marshalNDomainEntry2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐDomainEntry(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DomainEntryEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DomainEntryEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accountName": + return ec.fieldContext_DomainEntry_accountName(ctx, field) + case "clusterName": + return ec.fieldContext_DomainEntry_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_DomainEntry_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_DomainEntry_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_DomainEntry_displayName(ctx, field) + case "domainName": + return ec.fieldContext_DomainEntry_domainName(ctx, field) + case "id": + return ec.fieldContext_DomainEntry_id(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_DomainEntry_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_DomainEntry_markedForDeletion(ctx, field) + case "recordVersion": + return ec.fieldContext_DomainEntry_recordVersion(ctx, field) + case "updateTime": + return ec.fieldContext_DomainEntry_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DomainEntry", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DomainEntryPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.DomainEntryPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DomainEntryPaginatedRecords_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.DomainEntryEdge) + fc.Result = res + return ec.marshalNDomainEntryEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐDomainEntryEdgeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DomainEntryPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DomainEntryPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cursor": + return ec.fieldContext_DomainEntryEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_DomainEntryEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DomainEntryEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DomainEntryPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.DomainEntryPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DomainEntryPaginatedRecords_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.PageInfo) + fc.Result = res + return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DomainEntryPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DomainEntryPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DomainEntryPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.DomainEntryPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DomainEntryPaginatedRecords_totalCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalCount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DomainEntryPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DomainEntryPaginatedRecords", + 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) _EncodedValue_value(ctx context.Context, field graphql.CollectedField, obj *model.EncodedValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EncodedValue_value(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EncodedValue_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EncodedValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EncodedValue_encoding(ctx context.Context, field graphql.CollectedField, obj *model.EncodedValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EncodedValue_encoding(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Encoding, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_EncodedValue_encoding(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EncodedValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_accessKey(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesAWSSecretCredentials) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_accessKey(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccessKey, nil + }) + 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_Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_accessKey(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_awsAccountId(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesAWSSecretCredentials) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_awsAccountId(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AwsAccountID, nil + }) + 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_Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_awsAccountId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_cfParamExternalID(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesAWSSecretCredentials) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_cfParamExternalID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CfParamExternalID, nil + }) + 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_Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_cfParamExternalID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_cfParamInstanceProfileName(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesAWSSecretCredentials) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_cfParamInstanceProfileName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CfParamInstanceProfileName, nil + }) + 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_Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_cfParamInstanceProfileName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_cfParamRoleName(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesAWSSecretCredentials) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_cfParamRoleName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CfParamRoleName, nil + }) + 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_Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_cfParamRoleName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_cfParamStackName(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesAWSSecretCredentials) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_cfParamStackName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CfParamStackName, nil + }) + 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_Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_cfParamStackName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_cfParamTrustedARN(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesAWSSecretCredentials) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_cfParamTrustedARN(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CfParamTrustedArn, nil + }) + 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_Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_cfParamTrustedARN(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_secretKey(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesAWSSecretCredentials) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_secretKey(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SecretKey, nil + }) + 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_Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_secretKey(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__InputField_defaultValue(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesInputField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_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.(interface{}) + fc.Result = res + return ec.marshalOAny2interface(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_defaultValue(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__InputField", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Any does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__InputField_displayUnit(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesInputField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_displayUnit(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DisplayUnit, nil + }) + 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_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_displayUnit(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__InputField", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__InputField_inputType(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesInputField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_inputType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.InputType, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_inputType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__InputField", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__InputField_label(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesInputField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_label(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Label, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_label(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__InputField", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__InputField_max(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesInputField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_max(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Max, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*float64) + fc.Result = res + return ec.marshalOFloat2ᚖfloat64(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_max(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__InputField", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Float does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__InputField_min(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesInputField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_min(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Min, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*float64) + fc.Result = res + return ec.marshalOFloat2ᚖfloat64(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_min(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__InputField", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Float does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__InputField_multiplier(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesInputField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_multiplier(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Multiplier, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*float64) + fc.Result = res + return ec.marshalOFloat2ᚖfloat64(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_multiplier(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__InputField", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Float does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__InputField_name(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesInputField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_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_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__InputField", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__InputField_required(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesInputField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_required(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Required, 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_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_required(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__InputField", + 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) _Github__com___kloudlite___api___apps___infra___internal___entities__InputField_unit(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesInputField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_unit(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Unit, nil + }) + 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_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_unit(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__InputField", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_apiVersion(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesMresTemplate) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_apiVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.APIVersion, nil + }) + 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_Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_description(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesMresTemplate) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_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 { + 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_Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_displayName(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesMresTemplate) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_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_Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_fields(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesMresTemplate) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_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.GithubComKloudliteAPIAppsInfraInternalEntitiesInputField) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___apps___infra___internal___entities__InputField2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsInfraInternalEntitiesInputFieldᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "defaultValue": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_defaultValue(ctx, field) + case "displayUnit": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_displayUnit(ctx, field) + case "inputType": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_inputType(ctx, field) + case "label": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_label(ctx, field) + case "max": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_max(ctx, field) + case "min": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_min(ctx, field) + case "multiplier": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_multiplier(ctx, field) + case "name": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_name(ctx, field) + case "required": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_required(ctx, field) + case "unit": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_unit(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___apps___infra___internal___entities__InputField", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_kind(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesMresTemplate) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_name(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesMresTemplate) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_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_Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_outputs(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesMresTemplate) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_outputs(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Outputs, nil + }) + if err != nil { + ec.Error(ctx, 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.GithubComKloudliteAPIAppsInfraInternalEntitiesOutputField) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___apps___infra___internal___entities__OutputField2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsInfraInternalEntitiesOutputFieldᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_outputs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "description": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__OutputField_description(ctx, field) + case "label": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__OutputField_label(ctx, field) + case "name": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__OutputField_name(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___apps___infra___internal___entities__OutputField", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_active(ctx context.Context, field graphql.CollectedField, obj *entities.MsvcTemplateEntry) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_active(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Active, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_active(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry", + 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) _Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.MsvcTemplateEntry) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_apiVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ApiVersion, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_description(ctx context.Context, field graphql.CollectedField, obj *entities.MsvcTemplateEntry) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_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 { + 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_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.MsvcTemplateEntry) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_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_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_fields(ctx context.Context, field graphql.CollectedField, obj *entities.MsvcTemplateEntry) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_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 ec.resolvers.Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry().Fields(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.GithubComKloudliteAPIAppsInfraInternalEntitiesInputField) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___apps___infra___internal___entities__InputField2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsInfraInternalEntitiesInputFieldᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "defaultValue": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_defaultValue(ctx, field) + case "displayUnit": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_displayUnit(ctx, field) + case "inputType": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_inputType(ctx, field) + case "label": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_label(ctx, field) + case "max": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_max(ctx, field) + case "min": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_min(ctx, field) + case "multiplier": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_multiplier(ctx, field) + case "name": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_name(ctx, field) + case "required": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_required(ctx, field) + case "unit": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__InputField_unit(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___apps___infra___internal___entities__InputField", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_kind(ctx context.Context, field graphql.CollectedField, obj *entities.MsvcTemplateEntry) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_logoUrl(ctx context.Context, field graphql.CollectedField, obj *entities.MsvcTemplateEntry) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_logoUrl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LogoUrl, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + 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_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_logoUrl(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_name(ctx context.Context, field graphql.CollectedField, obj *entities.MsvcTemplateEntry) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_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_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_outputs(ctx context.Context, field graphql.CollectedField, obj *entities.MsvcTemplateEntry) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_outputs(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry().Outputs(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.GithubComKloudliteAPIAppsInfraInternalEntitiesOutputField) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___apps___infra___internal___entities__OutputField2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsInfraInternalEntitiesOutputFieldᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_outputs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "description": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__OutputField_description(ctx, field) + case "label": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__OutputField_label(ctx, field) + case "name": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__OutputField_name(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___apps___infra___internal___entities__OutputField", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_resources(ctx context.Context, field graphql.CollectedField, obj *entities.MsvcTemplateEntry) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_resources(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry().Resources(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.GithubComKloudliteAPIAppsInfraInternalEntitiesMresTemplate) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___apps___infra___internal___entities__MresTemplate2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsInfraInternalEntitiesMresTemplateᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_resources(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "apiVersion": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_apiVersion(ctx, field) + case "description": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_description(ctx, field) + case "displayName": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_displayName(ctx, field) + case "fields": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_fields(ctx, field) + case "kind": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_kind(ctx, field) + case "name": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_name(ctx, field) + case "outputs": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_outputs(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__OutputField_description(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesOutputField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__OutputField_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 { + 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_Github__com___kloudlite___api___apps___infra___internal___entities__OutputField_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__OutputField", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__OutputField_label(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesOutputField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__OutputField_label(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Label, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___api___apps___infra___internal___entities__OutputField_label(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__OutputField", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__OutputField_name(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesOutputField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__OutputField_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_Github__com___kloudlite___api___apps___infra___internal___entities__OutputField_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__OutputField", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx context.Context, field graphql.CollectedField, obj *common.CreatedOrUpdatedBy) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UserEmail, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___common__CreatedOrUpdatedBy", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx context.Context, field graphql.CollectedField, obj *common.CreatedOrUpdatedBy) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Github__com___kloudlite___api___common__CreatedOrUpdatedBy().UserID(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_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___common__CreatedOrUpdatedBy", + 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) _Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx context.Context, field graphql.CollectedField, obj *common.CreatedOrUpdatedBy) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UserName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___common__CreatedOrUpdatedBy", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Action, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(types.SyncAction) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___pkg___types__SyncAction2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncAction(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___pkg___types__SyncStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Github__com___kloudlite___api___pkg___types__SyncAction does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Error, nil + }) + 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_Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___pkg___types__SyncStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Github__com___kloudlite___api___pkg___types__SyncStatus().LastSyncedAt(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalODate2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___pkg___types__SyncStatus", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RecordVersion, nil + }) + if err != nil { + ec.Error(ctx, 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_Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___pkg___types__SyncStatus", + 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) _Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.State, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(types.SyncState) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___pkg___types__SyncState2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncState(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___pkg___types__SyncStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Github__com___kloudlite___api___pkg___types__SyncState does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx context.Context, field graphql.CollectedField, obj *types.SyncStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Github__com___kloudlite___api___pkg___types__SyncStatus().SyncScheduledAt(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalODate2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___pkg___types__SyncStatus", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig_k3sMasters(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AWSClusterConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig_k3sMasters(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.K3sMasters, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorApisClustersV1AWSK3sMastersConfig) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AWSK3sMastersConfig(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig_k3sMasters(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "iamInstanceProfileRole": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_iamInstanceProfileRole(ctx, field) + case "imageId": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_imageId(ctx, field) + case "imageSSHUsername": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_imageSSHUsername(ctx, field) + case "instanceType": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_instanceType(ctx, field) + case "nodes": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_nodes(ctx, field) + case "nvidiaGpuEnabled": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_nvidiaGpuEnabled(ctx, field) + case "rootVolumeSize": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_rootVolumeSize(ctx, field) + case "rootVolumeType": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_rootVolumeType(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig_nodePools(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AWSClusterConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig_nodePools(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.NodePools, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig_nodePools(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig_region(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AWSClusterConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig_region(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Region, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig_region(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig_spotNodePools(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AWSClusterConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig_spotNodePools(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SpotNodePools, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig_spotNodePools(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_iamInstanceProfileRole(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AWSK3sMastersConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_iamInstanceProfileRole(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IamInstanceProfileRole, nil + }) + 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_Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_iamInstanceProfileRole(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_imageId(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AWSK3sMastersConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_imageId(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ImageID, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_imageId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_imageSSHUsername(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AWSK3sMastersConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_imageSSHUsername(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ImageSSHUsername, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_imageSSHUsername(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_instanceType(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AWSK3sMastersConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_instanceType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.InstanceType, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_instanceType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_nodes(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AWSK3sMastersConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_nodes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Nodes, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_nodes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_nvidiaGpuEnabled(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AWSK3sMastersConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_nvidiaGpuEnabled(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.NvidiaGpuEnabled, nil + }) + if err != nil { + ec.Error(ctx, 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_Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_nvidiaGpuEnabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig", + 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) _Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_rootVolumeSize(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AWSK3sMastersConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_rootVolumeSize(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RootVolumeSize, nil + }) + if err != nil { + ec.Error(ctx, 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_Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_rootVolumeSize(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig", + 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) _Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_rootVolumeType(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AWSK3sMastersConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_rootVolumeType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RootVolumeType, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_rootVolumeType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_availabilityZone(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AWSNodePoolConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_availabilityZone(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AvailabilityZone, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_availabilityZone(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_ec2Pool(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AWSNodePoolConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_ec2Pool(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Ec2Pool, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorApisClustersV1AwsEC2PoolConfig) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AwsEC2PoolConfig(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_ec2Pool(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "instanceType": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig_instanceType(ctx, field) + case "nodes": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig_nodes(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_iamInstanceProfileRole(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AWSNodePoolConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_iamInstanceProfileRole(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IamInstanceProfileRole, nil + }) + 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_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_iamInstanceProfileRole(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_imageId(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AWSNodePoolConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_imageId(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ImageID, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_imageId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_imageSSHUsername(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AWSNodePoolConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_imageSSHUsername(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ImageSSHUsername, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_imageSSHUsername(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_nvidiaGpuEnabled(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AWSNodePoolConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_nvidiaGpuEnabled(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.NvidiaGpuEnabled, nil + }) + if err != nil { + ec.Error(ctx, 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_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_nvidiaGpuEnabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig", + 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) _Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_poolType(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AWSNodePoolConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_poolType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PoolType, nil + }) + if err != nil { + ec.Error(ctx, 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.GithubComKloudliteOperatorApisClustersV1AWSPoolType) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___operator___apis___clusters___v1__AWSPoolType2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AWSPoolType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_poolType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Github__com___kloudlite___operator___apis___clusters___v1__AWSPoolType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_rootVolumeSize(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AWSNodePoolConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_rootVolumeSize(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RootVolumeSize, nil + }) + if err != nil { + ec.Error(ctx, 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_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_rootVolumeSize(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig", + 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) _Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_rootVolumeType(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AWSNodePoolConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_rootVolumeType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RootVolumeType, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_rootVolumeType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_spotPool(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AWSNodePoolConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_spotPool(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SpotPool, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorApisClustersV1AwsSpotPoolConfig) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AwsSpotPoolConfig(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_spotPool(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cpuNode": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig_cpuNode(ctx, field) + case "gpuNode": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig_gpuNode(ctx, field) + case "nodes": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig_nodes(ctx, field) + case "spotFleetTaggingRoleName": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig_spotFleetTaggingRoleName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig_instanceType(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AwsEC2PoolConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig_instanceType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.InstanceType, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig_instanceType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig_nodes(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AwsEC2PoolConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig_nodes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Nodes, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig_nodes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode_memoryPerVcpu(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AwsSpotCPUNode) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode_memoryPerVcpu(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MemoryPerVcpu, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorApisCommonTypesMinMaxFloat) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___common____types__MinMaxFloat2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCommonTypesMinMaxFloat(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode_memoryPerVcpu(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "max": + return ec.fieldContext_Github__com___kloudlite___operator___apis___common____types__MinMaxFloat_max(ctx, field) + case "min": + return ec.fieldContext_Github__com___kloudlite___operator___apis___common____types__MinMaxFloat_min(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___common____types__MinMaxFloat", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode_vcpu(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AwsSpotCPUNode) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode_vcpu(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Vcpu, nil + }) + if err != nil { + ec.Error(ctx, 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.GithubComKloudliteOperatorApisCommonTypesMinMaxFloat) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___operator___apis___common____types__MinMaxFloat2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCommonTypesMinMaxFloat(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode_vcpu(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "max": + return ec.fieldContext_Github__com___kloudlite___operator___apis___common____types__MinMaxFloat_max(ctx, field) + case "min": + return ec.fieldContext_Github__com___kloudlite___operator___apis___common____types__MinMaxFloat_min(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___common____types__MinMaxFloat", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNode_instanceTypes(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AwsSpotGpuNode) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNode_instanceTypes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.InstanceTypes, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNode_instanceTypes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNode", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig_cpuNode(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AwsSpotPoolConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig_cpuNode(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CPUNode, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorApisClustersV1AwsSpotCPUNode) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AwsSpotCPUNode(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig_cpuNode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "memoryPerVcpu": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode_memoryPerVcpu(ctx, field) + case "vcpu": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode_vcpu(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig_gpuNode(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AwsSpotPoolConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig_gpuNode(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.GpuNode, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorApisClustersV1AwsSpotGpuNode) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNode2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AwsSpotGpuNode(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig_gpuNode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "instanceTypes": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNode_instanceTypes(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNode", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig_nodes(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AwsSpotPoolConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig_nodes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Nodes, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig_nodes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig_spotFleetTaggingRoleName(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1AwsSpotPoolConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig_spotFleetTaggingRoleName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SpotFleetTaggingRoleName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig_spotFleetTaggingRoleName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keyAccessKey(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1CloudProviderCredentialKeys) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keyAccessKey(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.KeyAccessKey, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keyAccessKey(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keyAWSAccountId(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1CloudProviderCredentialKeys) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keyAWSAccountId(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.KeyAWSAccountID, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keyAWSAccountId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keyAWSAssumeRoleExternalID(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1CloudProviderCredentialKeys) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keyAWSAssumeRoleExternalID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.KeyAWSAssumeRoleExternalID, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keyAWSAssumeRoleExternalID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keyAWSAssumeRoleRoleARN(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1CloudProviderCredentialKeys) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keyAWSAssumeRoleRoleARN(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.KeyAWSAssumeRoleRoleArn, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keyAWSAssumeRoleRoleARN(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keyIAMInstanceProfileRole(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1CloudProviderCredentialKeys) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keyIAMInstanceProfileRole(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.KeyIAMInstanceProfileRole, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keyIAMInstanceProfileRole(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keySecretKey(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1CloudProviderCredentialKeys) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keySecretKey(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.KeySecretKey, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keySecretKey(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_jobName(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1ClusterOutput) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_jobName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.JobName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_jobName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_jobNamespace(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1ClusterOutput) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_jobNamespace(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.JobNamespace, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_jobNamespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_keyK3sAgentJoinToken(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1ClusterOutput) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_keyK3sAgentJoinToken(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.KeyK3sAgentJoinToken, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_keyK3sAgentJoinToken(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_keyK3sServerJoinToken(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1ClusterOutput) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_keyK3sServerJoinToken(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.KeyK3sServerJoinToken, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_keyK3sServerJoinToken(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_keyKubeconfig(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1ClusterOutput) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_keyKubeconfig(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.KeyKubeconfig, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_keyKubeconfig(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_secretName(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1ClusterOutput) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_secretName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SecretName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + 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_Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_secretName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_accountId(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1ClusterSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_accountId(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccountID, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_accountId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_accountName(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1ClusterSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_accountName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_availabilityMode(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1ClusterSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_availabilityMode(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AvailabilityMode, nil + }) + if err != nil { + ec.Error(ctx, 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.GithubComKloudliteOperatorApisClustersV1ClusterSpecAvailabilityMode) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___operator___apis___clusters___v1__ClusterSpecAvailabilityMode2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1ClusterSpecAvailabilityMode(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_availabilityMode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpecAvailabilityMode does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_aws(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1ClusterSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_aws(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Aws, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorApisClustersV1AWSClusterConfig) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AWSClusterConfig(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_aws(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "k3sMasters": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig_k3sMasters(ctx, field) + case "nodePools": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig_nodePools(ctx, field) + case "region": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig_region(ctx, field) + case "spotNodePools": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig_spotNodePools(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_backupToS3Enabled(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1ClusterSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_backupToS3Enabled(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.BackupToS3Enabled, nil + }) + if err != nil { + ec.Error(ctx, 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_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_backupToS3Enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec", + 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) _Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_cloudflareEnabled(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1ClusterSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_cloudflareEnabled(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CloudflareEnabled, 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_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_cloudflareEnabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec", + 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) _Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_cloudProvider(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1ClusterSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_cloudProvider(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CloudProvider, nil + }) + if err != nil { + ec.Error(ctx, 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.GithubComKloudliteOperatorApisCommonTypesCloudProvider) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___operator___apis___common____types__CloudProvider2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCommonTypesCloudProvider(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_cloudProvider(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Github__com___kloudlite___operator___apis___common____types__CloudProvider does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_clusterInternalDnsHost(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1ClusterSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_clusterInternalDnsHost(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ClusterInternalDNSHost, nil + }) + 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_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_clusterInternalDnsHost(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_clusterTokenRef(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1ClusterSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_clusterTokenRef(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ClusterTokenRef, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorApisCommonTypesSecretKeyRef) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___common____types__SecretKeyRef2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCommonTypesSecretKeyRef(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_clusterTokenRef(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "key": + return ec.fieldContext_Github__com___kloudlite___operator___apis___common____types__SecretKeyRef_key(ctx, field) + case "name": + return ec.fieldContext_Github__com___kloudlite___operator___apis___common____types__SecretKeyRef_name(ctx, field) + case "namespace": + return ec.fieldContext_Github__com___kloudlite___operator___apis___common____types__SecretKeyRef_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___common____types__SecretKeyRef", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_credentialKeys(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1ClusterSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_credentialKeys(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CredentialKeys, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorApisClustersV1CloudProviderCredentialKeys) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1CloudProviderCredentialKeys(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_credentialKeys(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "keyAccessKey": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keyAccessKey(ctx, field) + case "keyAWSAccountId": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keyAWSAccountId(ctx, field) + case "keyAWSAssumeRoleExternalID": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keyAWSAssumeRoleExternalID(ctx, field) + case "keyAWSAssumeRoleRoleARN": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keyAWSAssumeRoleRoleARN(ctx, field) + case "keyIAMInstanceProfileRole": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keyIAMInstanceProfileRole(ctx, field) + case "keySecretKey": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keySecretKey(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_credentialsRef(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1ClusterSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_credentialsRef(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CredentialsRef, nil + }) + if err != nil { + ec.Error(ctx, 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.GithubComKloudliteOperatorApisCommonTypesSecretRef) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___operator___apis___common____types__SecretRef2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCommonTypesSecretRef(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_credentialsRef(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec", + 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_Github__com___kloudlite___operator___apis___common____types__SecretRef_name(ctx, field) + case "namespace": + return ec.fieldContext_Github__com___kloudlite___operator___apis___common____types__SecretRef_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___common____types__SecretRef", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_kloudliteRelease(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1ClusterSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_kloudliteRelease(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.KloudliteRelease, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_kloudliteRelease(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_messageQueueTopicName(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1ClusterSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_messageQueueTopicName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MessageQueueTopicName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_messageQueueTopicName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_output(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1ClusterSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_output(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Output, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorApisClustersV1ClusterOutput) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___clusters___v1__ClusterOutput2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1ClusterOutput(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_output(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "jobName": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_jobName(ctx, field) + case "jobNamespace": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_jobNamespace(ctx, field) + case "keyK3sAgentJoinToken": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_keyK3sAgentJoinToken(ctx, field) + case "keyK3sServerJoinToken": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_keyK3sServerJoinToken(ctx, field) + case "keyKubeconfig": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_keyKubeconfig(ctx, field) + case "secretName": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_secretName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_publicDNSHost(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1ClusterSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_publicDNSHost(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PublicDNSHost, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_publicDNSHost(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_taintMasterNodes(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1ClusterSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_taintMasterNodes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TaintMasterNodes, nil + }) + if err != nil { + ec.Error(ctx, 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_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_taintMasterNodes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec", + 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) _Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_cloudProviderAccessKey(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1InfrastuctureAsCode) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_cloudProviderAccessKey(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CloudProviderAccessKey, nil + }) + if err != nil { + ec.Error(ctx, 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.GithubComKloudliteOperatorApisCommonTypesSecretKeyRef) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___operator___apis___common____types__SecretKeyRef2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCommonTypesSecretKeyRef(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_cloudProviderAccessKey(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "key": + return ec.fieldContext_Github__com___kloudlite___operator___apis___common____types__SecretKeyRef_key(ctx, field) + case "name": + return ec.fieldContext_Github__com___kloudlite___operator___apis___common____types__SecretKeyRef_name(ctx, field) + case "namespace": + return ec.fieldContext_Github__com___kloudlite___operator___apis___common____types__SecretKeyRef_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___common____types__SecretKeyRef", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_cloudProviderSecretKey(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1InfrastuctureAsCode) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_cloudProviderSecretKey(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CloudProviderSecretKey, nil + }) + if err != nil { + ec.Error(ctx, 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.GithubComKloudliteOperatorApisCommonTypesSecretKeyRef) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___operator___apis___common____types__SecretKeyRef2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCommonTypesSecretKeyRef(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_cloudProviderSecretKey(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "key": + return ec.fieldContext_Github__com___kloudlite___operator___apis___common____types__SecretKeyRef_key(ctx, field) + case "name": + return ec.fieldContext_Github__com___kloudlite___operator___apis___common____types__SecretKeyRef_name(ctx, field) + case "namespace": + return ec.fieldContext_Github__com___kloudlite___operator___apis___common____types__SecretKeyRef_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___common____types__SecretKeyRef", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_jobName(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1InfrastuctureAsCode) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_jobName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.JobName, nil + }) + 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_Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_jobName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_jobNamespace(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1InfrastuctureAsCode) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_jobNamespace(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.JobNamespace, nil + }) + 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_Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_jobNamespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_stateS3BucketFilePath(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1InfrastuctureAsCode) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_stateS3BucketFilePath(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.StateS3BucketFilePath, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_stateS3BucketFilePath(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_stateS3BucketName(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1InfrastuctureAsCode) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_stateS3BucketName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.StateS3BucketName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_stateS3BucketName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_stateS3BucketRegion(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1InfrastuctureAsCode) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_stateS3BucketRegion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.StateS3BucketRegion, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_stateS3BucketRegion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps_availabilityZone(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1MasterNodeProps) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps_availabilityZone(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AvailabilityZone, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps_availabilityZone(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps_lastRecreatedAt(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1MasterNodeProps) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps_lastRecreatedAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastRecreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalODate2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps_lastRecreatedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps_role(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1MasterNodeProps) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps_role(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Role, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps_role(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_aws(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1NodePoolSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_aws(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Aws, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorApisClustersV1AWSNodePoolConfig) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AWSNodePoolConfig(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_aws(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "availabilityZone": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_availabilityZone(ctx, field) + case "ec2Pool": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_ec2Pool(ctx, field) + case "iamInstanceProfileRole": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_iamInstanceProfileRole(ctx, field) + case "imageId": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_imageId(ctx, field) + case "imageSSHUsername": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_imageSSHUsername(ctx, field) + case "nvidiaGpuEnabled": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_nvidiaGpuEnabled(ctx, field) + case "poolType": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_poolType(ctx, field) + case "rootVolumeSize": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_rootVolumeSize(ctx, field) + case "rootVolumeType": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_rootVolumeType(ctx, field) + case "spotPool": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_spotPool(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_cloudProvider(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1NodePoolSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_cloudProvider(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CloudProvider, nil + }) + if err != nil { + ec.Error(ctx, 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.GithubComKloudliteOperatorApisCommonTypesCloudProvider) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___operator___apis___common____types__CloudProvider2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCommonTypesCloudProvider(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_cloudProvider(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Github__com___kloudlite___operator___apis___common____types__CloudProvider does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_iac(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1NodePoolSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_iac(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Iac, nil + }) + if err != nil { + ec.Error(ctx, 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.GithubComKloudliteOperatorApisClustersV1InfrastuctureAsCode) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1InfrastuctureAsCode(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_iac(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cloudProviderAccessKey": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_cloudProviderAccessKey(ctx, field) + case "cloudProviderSecretKey": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_cloudProviderSecretKey(ctx, field) + case "jobName": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_jobName(ctx, field) + case "jobNamespace": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_jobNamespace(ctx, field) + case "stateS3BucketFilePath": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_stateS3BucketFilePath(ctx, field) + case "stateS3BucketName": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_stateS3BucketName(ctx, field) + case "stateS3BucketRegion": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_stateS3BucketRegion(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_maxCount(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1NodePoolSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_maxCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MaxCount, nil + }) + if err != nil { + ec.Error(ctx, 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_Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_maxCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec", + 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) _Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_minCount(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1NodePoolSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_minCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MinCount, nil + }) + if err != nil { + ec.Error(ctx, 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_Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_minCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec", + 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) _Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_nodeLabels(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1NodePoolSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_nodeLabels(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.NodeLabels, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_nodeLabels(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_nodeTaints(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1NodePoolSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_nodeTaints(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.NodeTaints, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.K8sIoAPICoreV1Taint) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__Taint2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1Taintᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_nodeTaints(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "effect": + return ec.fieldContext_K8s__io___api___core___v1__Taint_effect(ctx, field) + case "key": + return ec.fieldContext_K8s__io___api___core___v1__Taint_key(ctx, field) + case "timeAdded": + return ec.fieldContext_K8s__io___api___core___v1__Taint_timeAdded(ctx, field) + case "value": + return ec.fieldContext_K8s__io___api___core___v1__Taint_value(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__Taint", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__NodeProps_lastRecreatedAt(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1NodeProps) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__NodeProps_lastRecreatedAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastRecreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalODate2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__NodeProps_lastRecreatedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__NodeProps", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__NodeSpec_nodepoolName(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1NodeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__NodeSpec_nodepoolName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.NodepoolName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__NodeSpec_nodepoolName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__NodeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___common____types__MinMaxFloat_max(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCommonTypesMinMaxFloat) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___common____types__MinMaxFloat_max(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Max, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___common____types__MinMaxFloat_max(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___common____types__MinMaxFloat", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___common____types__MinMaxFloat_min(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCommonTypesMinMaxFloat) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___common____types__MinMaxFloat_min(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Min, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___common____types__MinMaxFloat_min(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___common____types__MinMaxFloat", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___common____types__SecretKeyRef_key(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCommonTypesSecretKeyRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___common____types__SecretKeyRef_key(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Key, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___common____types__SecretKeyRef_key(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___common____types__SecretKeyRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___common____types__SecretKeyRef_name(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCommonTypesSecretKeyRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___common____types__SecretKeyRef_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_Github__com___kloudlite___operator___apis___common____types__SecretKeyRef_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___common____types__SecretKeyRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___common____types__SecretKeyRef_namespace(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCommonTypesSecretKeyRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___common____types__SecretKeyRef_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 { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___common____types__SecretKeyRef_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___common____types__SecretKeyRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___common____types__SecretRef_name(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCommonTypesSecretRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___common____types__SecretRef_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_Github__com___kloudlite___operator___apis___common____types__SecretRef_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___common____types__SecretRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___common____types__SecretRef_namespace(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCommonTypesSecretRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___common____types__SecretRef_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 { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___common____types__SecretRef_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___common____types__SecretRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec_msvcSpec(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ClusterManagedServiceSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec_msvcSpec(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MsvcSpec, nil + }) + if err != nil { + ec.Error(ctx, 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.GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpec) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ManagedServiceSpec(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec_msvcSpec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "serviceTemplate": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec_serviceTemplate(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec_targetNamespace(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ClusterManagedServiceSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec_targetNamespace(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TargetNamespace, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec_targetNamespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_chartName(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1HelmChartSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_chartName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ChartName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_chartName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_chartRepoURL(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1HelmChartSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_chartRepoURL(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ChartRepoURL, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_chartRepoURL(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_chartVersion(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1HelmChartSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_chartVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ChartVersion, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_chartVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_jobVars(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1HelmChartSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_jobVars(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.JobVars, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorApisCrdsV1JobVars) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__JobVars2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1JobVars(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_jobVars(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "affinity": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__JobVars_affinity(ctx, field) + case "backOffLimit": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__JobVars_backOffLimit(ctx, field) + case "nodeSelector": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__JobVars_nodeSelector(ctx, field) + case "tolerations": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__JobVars_tolerations(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__JobVars", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_postInstall(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1HelmChartSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_postInstall(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PostInstall, nil + }) + 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_Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_postInstall(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_postUninstall(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1HelmChartSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_postUninstall(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PostUninstall, nil + }) + 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_Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_postUninstall(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_preInstall(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1HelmChartSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_preInstall(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PreInstall, nil + }) + 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_Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_preInstall(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_preUninstall(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1HelmChartSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_preUninstall(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PreUninstall, nil + }) + 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_Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_preUninstall(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_values(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1HelmChartSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_values(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Values, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalNMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_values(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_checks(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1HelmChartStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_checks(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Checks, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_checks(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_isReady(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1HelmChartStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_isReady(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsReady, nil + }) + if err != nil { + ec.Error(ctx, 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_Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_isReady(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus", + 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) _Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_lastReadyGeneration(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1HelmChartStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_lastReadyGeneration(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastReadyGeneration, 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_Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_lastReadyGeneration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus", + 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) _Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_lastReconcileTime(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1HelmChartStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_lastReconcileTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastReconcileTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalODate2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_lastReconcileTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_message(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1HelmChartStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_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.(*model.GithubComKloudliteOperatorPkgRawJSONRawJSON) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___pkg___raw____json__RawJson2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgRawJSONRawJSON(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_message(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "RawMessage": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___raw____json__RawJson_RawMessage(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___pkg___raw____json__RawJson", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_releaseNotes(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1HelmChartStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_releaseNotes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ReleaseNotes, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_releaseNotes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_releaseStatus(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1HelmChartStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_releaseStatus(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ReleaseStatus, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_releaseStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_resources(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1HelmChartStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_resources(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Resources, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*operator.ResourceRef) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___pkg___operator__ResourceRef2ᚕᚖgithubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐResourceRefᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_resources(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "apiVersion": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_apiVersion(ctx, field) + case "kind": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_kind(ctx, field) + case "name": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_name(ctx, field) + case "namespace": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___pkg___operator__ResourceRef", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__JobVars_affinity(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1JobVars) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__JobVars_affinity(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Affinity, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1Affinity) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__Affinity2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1Affinity(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__JobVars_affinity(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__JobVars", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "nodeAffinity": + return ec.fieldContext_K8s__io___api___core___v1__Affinity_nodeAffinity(ctx, field) + case "podAffinity": + return ec.fieldContext_K8s__io___api___core___v1__Affinity_podAffinity(ctx, field) + case "podAntiAffinity": + return ec.fieldContext_K8s__io___api___core___v1__Affinity_podAntiAffinity(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__Affinity", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__JobVars_backOffLimit(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1JobVars) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__JobVars_backOffLimit(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.BackOffLimit, 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_Github__com___kloudlite___operator___apis___crds___v1__JobVars_backOffLimit(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__JobVars", + 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) _Github__com___kloudlite___operator___apis___crds___v1__JobVars_nodeSelector(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1JobVars) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__JobVars_nodeSelector(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.NodeSelector, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__JobVars_nodeSelector(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__JobVars", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__JobVars_tolerations(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1JobVars) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__JobVars_tolerations(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Tolerations, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.K8sIoAPICoreV1Toleration) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__Toleration2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1Tolerationᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__JobVars_tolerations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__JobVars", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "effect": + return ec.fieldContext_K8s__io___api___core___v1__Toleration_effect(ctx, field) + case "key": + return ec.fieldContext_K8s__io___api___core___v1__Toleration_key(ctx, field) + case "operator": + return ec.fieldContext_K8s__io___api___core___v1__Toleration_operator(ctx, field) + case "tolerationSeconds": + return ec.fieldContext_K8s__io___api___core___v1__Toleration_tolerationSeconds(ctx, field) + case "value": + return ec.fieldContext_K8s__io___api___core___v1__Toleration_value(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__Toleration", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec_serviceTemplate(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec_serviceTemplate(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ServiceTemplate, nil + }) + if err != nil { + ec.Error(ctx, 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.GithubComKloudliteOperatorApisCrdsV1ServiceTemplate) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___operator___apis___crds___v1__ServiceTemplate2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ServiceTemplate(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec_serviceTemplate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "apiVersion": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_apiVersion(ctx, field) + case "kind": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_kind(ctx, field) + case "spec": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_spec(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_apiVersion(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ServiceTemplate) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_apiVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.APIVersion, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_kind(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ServiceTemplate) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_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_Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_spec(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ServiceTemplate) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_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.(map[string]interface{}) + fc.Result = res + return ec.marshalNMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Check_generation(ctx context.Context, field graphql.CollectedField, obj *operator.Check) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_generation(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Generation, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int64) + fc.Result = res + return ec.marshalOInt2int64(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_generation(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Check", + 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) _Github__com___kloudlite___operator___pkg___operator__Check_message(ctx context.Context, field graphql.CollectedField, obj *operator.Check) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_message(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Check", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Check_status(ctx context.Context, field graphql.CollectedField, obj *operator.Check) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_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.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Check", + 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) _Github__com___kloudlite___operator___pkg___operator__ResourceRef_apiVersion(ctx context.Context, field graphql.CollectedField, obj *operator.ResourceRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_apiVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.APIVersion, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___pkg___operator__ResourceRef_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__ResourceRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__ResourceRef_kind(ctx context.Context, field graphql.CollectedField, obj *operator.ResourceRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_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_Github__com___kloudlite___operator___pkg___operator__ResourceRef_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__ResourceRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__ResourceRef_name(ctx context.Context, field graphql.CollectedField, obj *operator.ResourceRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_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_Github__com___kloudlite___operator___pkg___operator__ResourceRef_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__ResourceRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__ResourceRef_namespace(ctx context.Context, field graphql.CollectedField, obj *operator.ResourceRef) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_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_Github__com___kloudlite___operator___pkg___operator__ResourceRef_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__ResourceRef", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx context.Context, field graphql.CollectedField, obj *operator.Status) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Github__com___kloudlite___operator___pkg___operator__Status().Checks(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Status", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Status_isReady(ctx context.Context, field graphql.CollectedField, obj *operator.Status) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_isReady(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsReady, nil + }) + if err != nil { + ec.Error(ctx, 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_Github__com___kloudlite___operator___pkg___operator__Status_isReady(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Status", + 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) _Github__com___kloudlite___operator___pkg___operator__Status_lastReadyGeneration(ctx context.Context, field graphql.CollectedField, obj *operator.Status) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReadyGeneration(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastReadyGeneration, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int64) + fc.Result = res + return ec.marshalOInt2int64(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReadyGeneration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Status", + 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) _Github__com___kloudlite___operator___pkg___operator__Status_lastReconcileTime(ctx context.Context, field graphql.CollectedField, obj *operator.Status) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReconcileTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Github__com___kloudlite___operator___pkg___operator__Status().LastReconcileTime(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalODate2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReconcileTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Status", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Status_message(ctx context.Context, field graphql.CollectedField, obj *operator.Status) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_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 ec.resolvers.Github__com___kloudlite___operator___pkg___operator__Status().Message(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorPkgRawJSONRawJSON) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___pkg___raw____json__RawJson2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgRawJSONRawJSON(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_message(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Status", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "RawMessage": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___raw____json__RawJson_RawMessage(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___pkg___raw____json__RawJson", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Status_resources(ctx context.Context, field graphql.CollectedField, obj *operator.Status) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_resources(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Resources, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]operator.ResourceRef) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___pkg___operator__ResourceRef2ᚕgithubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐResourceRefᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_resources(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Status", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "apiVersion": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_apiVersion(ctx, field) + case "kind": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_kind(ctx, field) + case "name": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_name(ctx, field) + case "namespace": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___pkg___operator__ResourceRef", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___raw____json__RawJson_RawMessage(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgRawJSONRawJSON) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___raw____json__RawJson_RawMessage(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RawMessage, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(interface{}) + fc.Result = res + return ec.marshalOAny2interface(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___raw____json__RawJson_RawMessage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___raw____json__RawJson", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Any does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _HelmRelease_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.HelmRelease) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HelmRelease_accountName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_HelmRelease_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HelmRelease", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _HelmRelease_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.HelmRelease) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HelmRelease_apiVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.APIVersion, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HelmRelease_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HelmRelease", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _HelmRelease_clusterName(ctx context.Context, field graphql.CollectedField, obj *entities.HelmRelease) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HelmRelease_clusterName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ClusterName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_HelmRelease_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HelmRelease", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _HelmRelease_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.HelmRelease) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HelmRelease_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HelmRelease_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HelmRelease", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _HelmRelease_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.HelmRelease) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HelmRelease_creationTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.HelmRelease().CreationTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HelmRelease_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HelmRelease", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _HelmRelease_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.HelmRelease) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HelmRelease_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_HelmRelease_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HelmRelease", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _HelmRelease_id(ctx context.Context, field graphql.CollectedField, obj *entities.HelmRelease) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HelmRelease_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 ec.resolvers.HelmRelease().ID(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_HelmRelease_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HelmRelease", + 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) _HelmRelease_kind(ctx context.Context, field graphql.CollectedField, obj *entities.HelmRelease) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HelmRelease_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HelmRelease_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HelmRelease", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _HelmRelease_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.HelmRelease) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HelmRelease_lastUpdatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastUpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HelmRelease_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HelmRelease", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _HelmRelease_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.HelmRelease) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HelmRelease_markedForDeletion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MarkedForDeletion, 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_HelmRelease_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HelmRelease", + 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) _HelmRelease_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.HelmRelease) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HelmRelease_metadata(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ObjectMeta, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(v1.ObjectMeta) + fc.Result = res + return ec.marshalOMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HelmRelease_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HelmRelease", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "annotations": + return ec.fieldContext_Metadata_annotations(ctx, field) + case "creationTimestamp": + return ec.fieldContext_Metadata_creationTimestamp(ctx, field) + case "deletionTimestamp": + return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) + case "generation": + return ec.fieldContext_Metadata_generation(ctx, field) + case "labels": + return ec.fieldContext_Metadata_labels(ctx, field) + case "name": + return ec.fieldContext_Metadata_name(ctx, field) + case "namespace": + return ec.fieldContext_Metadata_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _HelmRelease_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.HelmRelease) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HelmRelease_recordVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RecordVersion, nil + }) + if err != nil { + ec.Error(ctx, 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_HelmRelease_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HelmRelease", + 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) _HelmRelease_spec(ctx context.Context, field graphql.CollectedField, obj *entities.HelmRelease) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HelmRelease_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 ec.resolvers.HelmRelease().Spec(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorApisCrdsV1HelmChartSpec) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__HelmChartSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1HelmChartSpec(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HelmRelease_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HelmRelease", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "chartName": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_chartName(ctx, field) + case "chartRepoURL": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_chartRepoURL(ctx, field) + case "chartVersion": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_chartVersion(ctx, field) + case "jobVars": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_jobVars(ctx, field) + case "postInstall": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_postInstall(ctx, field) + case "postUninstall": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_postUninstall(ctx, field) + case "preInstall": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_preInstall(ctx, field) + case "preUninstall": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_preUninstall(ctx, field) + case "values": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_values(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _HelmRelease_status(ctx context.Context, field graphql.CollectedField, obj *entities.HelmRelease) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HelmRelease_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 ec.resolvers.HelmRelease().Status(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorApisCrdsV1HelmChartStatus) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__HelmChartStatus2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1HelmChartStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HelmRelease_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HelmRelease", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "checks": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_checks(ctx, field) + case "isReady": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_isReady(ctx, field) + case "lastReadyGeneration": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_lastReadyGeneration(ctx, field) + case "lastReconcileTime": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_lastReconcileTime(ctx, field) + case "message": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_message(ctx, field) + case "releaseNotes": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_releaseNotes(ctx, field) + case "releaseStatus": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_releaseStatus(ctx, field) + case "resources": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_resources(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _HelmRelease_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.HelmRelease) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HelmRelease_syncStatus(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SyncStatus, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(types.SyncStatus) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___pkg___types__SyncStatus2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HelmRelease_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HelmRelease", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "action": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx, field) + case "error": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx, field) + case "lastSyncedAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx, field) + case "recordVersion": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx, field) + case "state": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx, field) + case "syncScheduledAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___pkg___types__SyncStatus", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _HelmRelease_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.HelmRelease) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HelmRelease_updateTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.HelmRelease().UpdateTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HelmRelease_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HelmRelease", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _HelmReleaseEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.HelmReleaseEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HelmReleaseEdge_cursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HelmReleaseEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HelmReleaseEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _HelmReleaseEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.HelmReleaseEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HelmReleaseEdge_node(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*entities.HelmRelease) + fc.Result = res + return ec.marshalNHelmRelease2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐHelmRelease(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HelmReleaseEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HelmReleaseEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accountName": + return ec.fieldContext_HelmRelease_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_HelmRelease_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_HelmRelease_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_HelmRelease_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_HelmRelease_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_HelmRelease_displayName(ctx, field) + case "id": + return ec.fieldContext_HelmRelease_id(ctx, field) + case "kind": + return ec.fieldContext_HelmRelease_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_HelmRelease_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_HelmRelease_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_HelmRelease_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_HelmRelease_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_HelmRelease_spec(ctx, field) + case "status": + return ec.fieldContext_HelmRelease_status(ctx, field) + case "syncStatus": + return ec.fieldContext_HelmRelease_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_HelmRelease_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type HelmRelease", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _HelmReleasePaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.HelmReleasePaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HelmReleasePaginatedRecords_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.HelmReleaseEdge) + fc.Result = res + return ec.marshalNHelmReleaseEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐHelmReleaseEdgeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HelmReleasePaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HelmReleasePaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cursor": + return ec.fieldContext_HelmReleaseEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_HelmReleaseEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type HelmReleaseEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _HelmReleasePaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.HelmReleasePaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HelmReleasePaginatedRecords_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.PageInfo) + fc.Result = res + return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HelmReleasePaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HelmReleasePaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _HelmReleasePaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.HelmReleasePaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HelmReleasePaginatedRecords_totalCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalCount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HelmReleasePaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HelmReleasePaginatedRecords", + 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) _K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource_fsType(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1AWSElasticBlockStoreVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource_fsType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.FsType, nil + }) + 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_K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource_fsType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource_partition(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1AWSElasticBlockStoreVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource_partition(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Partition, 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_K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource_partition(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource", + 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) _K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1AWSElasticBlockStoreVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource_readOnly(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ReadOnly, 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_K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource", + 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) _K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource_volumeID(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1AWSElasticBlockStoreVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource_volumeID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.VolumeID, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource_volumeID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__Affinity_nodeAffinity(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1Affinity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__Affinity_nodeAffinity(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.NodeAffinity, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1NodeAffinity) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__NodeAffinity2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeAffinity(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__Affinity_nodeAffinity(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__Affinity", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "preferredDuringSchedulingIgnoredDuringExecution": + return ec.fieldContext_K8s__io___api___core___v1__NodeAffinity_preferredDuringSchedulingIgnoredDuringExecution(ctx, field) + case "requiredDuringSchedulingIgnoredDuringExecution": + return ec.fieldContext_K8s__io___api___core___v1__NodeAffinity_requiredDuringSchedulingIgnoredDuringExecution(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__NodeAffinity", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__Affinity_podAffinity(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1Affinity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__Affinity_podAffinity(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PodAffinity, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1PodAffinity) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__PodAffinity2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PodAffinity(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__Affinity_podAffinity(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__Affinity", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "preferredDuringSchedulingIgnoredDuringExecution": + return ec.fieldContext_K8s__io___api___core___v1__PodAffinity_preferredDuringSchedulingIgnoredDuringExecution(ctx, field) + case "requiredDuringSchedulingIgnoredDuringExecution": + return ec.fieldContext_K8s__io___api___core___v1__PodAffinity_requiredDuringSchedulingIgnoredDuringExecution(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__PodAffinity", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__Affinity_podAntiAffinity(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1Affinity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__Affinity_podAntiAffinity(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PodAntiAffinity, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1PodAntiAffinity) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__PodAntiAffinity2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PodAntiAffinity(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__Affinity_podAntiAffinity(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__Affinity", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "preferredDuringSchedulingIgnoredDuringExecution": + return ec.fieldContext_K8s__io___api___core___v1__PodAntiAffinity_preferredDuringSchedulingIgnoredDuringExecution(ctx, field) + case "requiredDuringSchedulingIgnoredDuringExecution": + return ec.fieldContext_K8s__io___api___core___v1__PodAntiAffinity_requiredDuringSchedulingIgnoredDuringExecution(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__PodAntiAffinity", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__AzureDiskVolumeSource_cachingMode(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1AzureDiskVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__AzureDiskVolumeSource_cachingMode(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CachingMode, nil + }) + 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_K8s__io___api___core___v1__AzureDiskVolumeSource_cachingMode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__AzureDiskVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__AzureDiskVolumeSource_diskName(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1AzureDiskVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__AzureDiskVolumeSource_diskName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DiskName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__AzureDiskVolumeSource_diskName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__AzureDiskVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__AzureDiskVolumeSource_diskURI(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1AzureDiskVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__AzureDiskVolumeSource_diskURI(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DiskURI, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__AzureDiskVolumeSource_diskURI(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__AzureDiskVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__AzureDiskVolumeSource_fsType(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1AzureDiskVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__AzureDiskVolumeSource_fsType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.FsType, nil + }) + 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_K8s__io___api___core___v1__AzureDiskVolumeSource_fsType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__AzureDiskVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__AzureDiskVolumeSource_kind(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1AzureDiskVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__AzureDiskVolumeSource_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__AzureDiskVolumeSource_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__AzureDiskVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__AzureDiskVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1AzureDiskVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__AzureDiskVolumeSource_readOnly(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ReadOnly, 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_K8s__io___api___core___v1__AzureDiskVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__AzureDiskVolumeSource", + 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) _K8s__io___api___core___v1__AzureFilePersistentVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1AzureFilePersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__AzureFilePersistentVolumeSource_readOnly(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ReadOnly, 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_K8s__io___api___core___v1__AzureFilePersistentVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__AzureFilePersistentVolumeSource", + 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) _K8s__io___api___core___v1__AzureFilePersistentVolumeSource_secretName(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1AzureFilePersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__AzureFilePersistentVolumeSource_secretName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SecretName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + 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_K8s__io___api___core___v1__AzureFilePersistentVolumeSource_secretName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__AzureFilePersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__AzureFilePersistentVolumeSource_secretNamespace(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1AzureFilePersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__AzureFilePersistentVolumeSource_secretNamespace(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SecretNamespace, nil + }) + 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_K8s__io___api___core___v1__AzureFilePersistentVolumeSource_secretNamespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__AzureFilePersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__AzureFilePersistentVolumeSource_shareName(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1AzureFilePersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__AzureFilePersistentVolumeSource_shareName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ShareName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__AzureFilePersistentVolumeSource_shareName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__AzureFilePersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__CSIPersistentVolumeSource_controllerExpandSecretRef(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1CSIPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__CSIPersistentVolumeSource_controllerExpandSecretRef(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ControllerExpandSecretRef, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1SecretReference) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__SecretReference2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1SecretReference(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__CSIPersistentVolumeSource_controllerExpandSecretRef(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__CSIPersistentVolumeSource", + 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_K8s__io___api___core___v1__SecretReference_name(ctx, field) + case "namespace": + return ec.fieldContext_K8s__io___api___core___v1__SecretReference_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__SecretReference", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__CSIPersistentVolumeSource_controllerPublishSecretRef(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1CSIPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__CSIPersistentVolumeSource_controllerPublishSecretRef(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ControllerPublishSecretRef, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1SecretReference) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__SecretReference2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1SecretReference(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__CSIPersistentVolumeSource_controllerPublishSecretRef(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__CSIPersistentVolumeSource", + 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_K8s__io___api___core___v1__SecretReference_name(ctx, field) + case "namespace": + return ec.fieldContext_K8s__io___api___core___v1__SecretReference_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__SecretReference", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__CSIPersistentVolumeSource_driver(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1CSIPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__CSIPersistentVolumeSource_driver(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Driver, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__CSIPersistentVolumeSource_driver(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__CSIPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__CSIPersistentVolumeSource_fsType(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1CSIPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__CSIPersistentVolumeSource_fsType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.FsType, nil + }) + 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_K8s__io___api___core___v1__CSIPersistentVolumeSource_fsType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__CSIPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__CSIPersistentVolumeSource_nodeExpandSecretRef(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1CSIPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__CSIPersistentVolumeSource_nodeExpandSecretRef(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.NodeExpandSecretRef, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1SecretReference) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__SecretReference2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1SecretReference(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__CSIPersistentVolumeSource_nodeExpandSecretRef(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__CSIPersistentVolumeSource", + 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_K8s__io___api___core___v1__SecretReference_name(ctx, field) + case "namespace": + return ec.fieldContext_K8s__io___api___core___v1__SecretReference_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__SecretReference", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__CSIPersistentVolumeSource_nodePublishSecretRef(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1CSIPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__CSIPersistentVolumeSource_nodePublishSecretRef(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.NodePublishSecretRef, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1SecretReference) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__SecretReference2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1SecretReference(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__CSIPersistentVolumeSource_nodePublishSecretRef(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__CSIPersistentVolumeSource", + 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_K8s__io___api___core___v1__SecretReference_name(ctx, field) + case "namespace": + return ec.fieldContext_K8s__io___api___core___v1__SecretReference_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__SecretReference", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__CSIPersistentVolumeSource_nodeStageSecretRef(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1CSIPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__CSIPersistentVolumeSource_nodeStageSecretRef(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.NodeStageSecretRef, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1SecretReference) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__SecretReference2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1SecretReference(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__CSIPersistentVolumeSource_nodeStageSecretRef(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__CSIPersistentVolumeSource", + 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_K8s__io___api___core___v1__SecretReference_name(ctx, field) + case "namespace": + return ec.fieldContext_K8s__io___api___core___v1__SecretReference_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__SecretReference", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__CSIPersistentVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1CSIPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__CSIPersistentVolumeSource_readOnly(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ReadOnly, 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_K8s__io___api___core___v1__CSIPersistentVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__CSIPersistentVolumeSource", + 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) _K8s__io___api___core___v1__CSIPersistentVolumeSource_volumeAttributes(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1CSIPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__CSIPersistentVolumeSource_volumeAttributes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.VolumeAttributes, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__CSIPersistentVolumeSource_volumeAttributes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__CSIPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__CSIPersistentVolumeSource_volumeHandle(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1CSIPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__CSIPersistentVolumeSource_volumeHandle(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.VolumeHandle, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__CSIPersistentVolumeSource_volumeHandle(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__CSIPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__CephFSPersistentVolumeSource_monitors(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1CephFSPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__CephFSPersistentVolumeSource_monitors(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Monitors, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__CephFSPersistentVolumeSource_monitors(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__CephFSPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__CephFSPersistentVolumeSource_path(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1CephFSPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__CephFSPersistentVolumeSource_path(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Path, nil + }) + 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_K8s__io___api___core___v1__CephFSPersistentVolumeSource_path(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__CephFSPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__CephFSPersistentVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1CephFSPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__CephFSPersistentVolumeSource_readOnly(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ReadOnly, 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_K8s__io___api___core___v1__CephFSPersistentVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__CephFSPersistentVolumeSource", + 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) _K8s__io___api___core___v1__CephFSPersistentVolumeSource_secretFile(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1CephFSPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__CephFSPersistentVolumeSource_secretFile(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SecretFile, nil + }) + 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_K8s__io___api___core___v1__CephFSPersistentVolumeSource_secretFile(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__CephFSPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__CephFSPersistentVolumeSource_secretRef(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1CephFSPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__CephFSPersistentVolumeSource_secretRef(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SecretRef, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1SecretReference) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__SecretReference2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1SecretReference(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__CephFSPersistentVolumeSource_secretRef(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__CephFSPersistentVolumeSource", + 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_K8s__io___api___core___v1__SecretReference_name(ctx, field) + case "namespace": + return ec.fieldContext_K8s__io___api___core___v1__SecretReference_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__SecretReference", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__CephFSPersistentVolumeSource_user(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1CephFSPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__CephFSPersistentVolumeSource_user(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.User, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__CephFSPersistentVolumeSource_user(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__CephFSPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__CinderPersistentVolumeSource_fsType(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1CinderPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__CinderPersistentVolumeSource_fsType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.FsType, nil + }) + 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_K8s__io___api___core___v1__CinderPersistentVolumeSource_fsType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__CinderPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__CinderPersistentVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1CinderPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__CinderPersistentVolumeSource_readOnly(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ReadOnly, 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_K8s__io___api___core___v1__CinderPersistentVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__CinderPersistentVolumeSource", + 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) _K8s__io___api___core___v1__CinderPersistentVolumeSource_secretRef(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1CinderPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__CinderPersistentVolumeSource_secretRef(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SecretRef, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1SecretReference) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__SecretReference2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1SecretReference(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__CinderPersistentVolumeSource_secretRef(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__CinderPersistentVolumeSource", + 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_K8s__io___api___core___v1__SecretReference_name(ctx, field) + case "namespace": + return ec.fieldContext_K8s__io___api___core___v1__SecretReference_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__SecretReference", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__CinderPersistentVolumeSource_volumeID(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1CinderPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__CinderPersistentVolumeSource_volumeID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.VolumeID, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__CinderPersistentVolumeSource_volumeID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__CinderPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__FCVolumeSource_fsType(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1FCVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__FCVolumeSource_fsType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.FsType, nil + }) + 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_K8s__io___api___core___v1__FCVolumeSource_fsType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__FCVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__FCVolumeSource_lun(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1FCVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__FCVolumeSource_lun(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Lun, 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_K8s__io___api___core___v1__FCVolumeSource_lun(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__FCVolumeSource", + 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) _K8s__io___api___core___v1__FCVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1FCVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__FCVolumeSource_readOnly(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ReadOnly, 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_K8s__io___api___core___v1__FCVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__FCVolumeSource", + 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) _K8s__io___api___core___v1__FCVolumeSource_targetWWNs(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1FCVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__FCVolumeSource_targetWWNs(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TargetWWNs, nil + }) + 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_K8s__io___api___core___v1__FCVolumeSource_targetWWNs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__FCVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__FCVolumeSource_wwids(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1FCVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__FCVolumeSource_wwids(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Wwids, nil + }) + 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_K8s__io___api___core___v1__FCVolumeSource_wwids(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__FCVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__FlexPersistentVolumeSource_driver(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1FlexPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__FlexPersistentVolumeSource_driver(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Driver, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__FlexPersistentVolumeSource_driver(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__FlexPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__FlexPersistentVolumeSource_fsType(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1FlexPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__FlexPersistentVolumeSource_fsType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.FsType, nil + }) + 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_K8s__io___api___core___v1__FlexPersistentVolumeSource_fsType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__FlexPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__FlexPersistentVolumeSource_options(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1FlexPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__FlexPersistentVolumeSource_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 { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__FlexPersistentVolumeSource_options(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__FlexPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__FlexPersistentVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1FlexPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__FlexPersistentVolumeSource_readOnly(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ReadOnly, 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_K8s__io___api___core___v1__FlexPersistentVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__FlexPersistentVolumeSource", + 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) _K8s__io___api___core___v1__FlexPersistentVolumeSource_secretRef(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1FlexPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__FlexPersistentVolumeSource_secretRef(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SecretRef, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1SecretReference) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__SecretReference2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1SecretReference(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__FlexPersistentVolumeSource_secretRef(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__FlexPersistentVolumeSource", + 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_K8s__io___api___core___v1__SecretReference_name(ctx, field) + case "namespace": + return ec.fieldContext_K8s__io___api___core___v1__SecretReference_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__SecretReference", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__FlockerVolumeSource_datasetName(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1FlockerVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__FlockerVolumeSource_datasetName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DatasetName, nil + }) + 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_K8s__io___api___core___v1__FlockerVolumeSource_datasetName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__FlockerVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__FlockerVolumeSource_datasetUUID(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1FlockerVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__FlockerVolumeSource_datasetUUID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DatasetUUID, nil + }) + 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_K8s__io___api___core___v1__FlockerVolumeSource_datasetUUID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__FlockerVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__GCEPersistentDiskVolumeSource_fsType(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1GCEPersistentDiskVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__GCEPersistentDiskVolumeSource_fsType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.FsType, nil + }) + 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_K8s__io___api___core___v1__GCEPersistentDiskVolumeSource_fsType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__GCEPersistentDiskVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__GCEPersistentDiskVolumeSource_partition(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1GCEPersistentDiskVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__GCEPersistentDiskVolumeSource_partition(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Partition, 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_K8s__io___api___core___v1__GCEPersistentDiskVolumeSource_partition(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__GCEPersistentDiskVolumeSource", + 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) _K8s__io___api___core___v1__GCEPersistentDiskVolumeSource_pdName(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1GCEPersistentDiskVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__GCEPersistentDiskVolumeSource_pdName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PdName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__GCEPersistentDiskVolumeSource_pdName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__GCEPersistentDiskVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__GCEPersistentDiskVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1GCEPersistentDiskVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__GCEPersistentDiskVolumeSource_readOnly(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ReadOnly, 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_K8s__io___api___core___v1__GCEPersistentDiskVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__GCEPersistentDiskVolumeSource", + 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) _K8s__io___api___core___v1__GlusterfsPersistentVolumeSource_endpoints(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1GlusterfsPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__GlusterfsPersistentVolumeSource_endpoints(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Endpoints, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__GlusterfsPersistentVolumeSource_endpoints(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__GlusterfsPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__GlusterfsPersistentVolumeSource_endpointsNamespace(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1GlusterfsPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__GlusterfsPersistentVolumeSource_endpointsNamespace(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.EndpointsNamespace, nil + }) + 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_K8s__io___api___core___v1__GlusterfsPersistentVolumeSource_endpointsNamespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__GlusterfsPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__GlusterfsPersistentVolumeSource_path(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1GlusterfsPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__GlusterfsPersistentVolumeSource_path(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Path, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__GlusterfsPersistentVolumeSource_path(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__GlusterfsPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__GlusterfsPersistentVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1GlusterfsPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__GlusterfsPersistentVolumeSource_readOnly(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ReadOnly, 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_K8s__io___api___core___v1__GlusterfsPersistentVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__GlusterfsPersistentVolumeSource", + 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) _K8s__io___api___core___v1__HostPathVolumeSource_path(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1HostPathVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__HostPathVolumeSource_path(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Path, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__HostPathVolumeSource_path(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__HostPathVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__HostPathVolumeSource_type(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1HostPathVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__HostPathVolumeSource_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 { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__HostPathVolumeSource_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__HostPathVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__ISCSIPersistentVolumeSource_chapAuthDiscovery(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ISCSIPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_chapAuthDiscovery(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ChapAuthDiscovery, 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_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_chapAuthDiscovery(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ISCSIPersistentVolumeSource", + 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) _K8s__io___api___core___v1__ISCSIPersistentVolumeSource_chapAuthSession(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ISCSIPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_chapAuthSession(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ChapAuthSession, 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_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_chapAuthSession(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ISCSIPersistentVolumeSource", + 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) _K8s__io___api___core___v1__ISCSIPersistentVolumeSource_fsType(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ISCSIPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_fsType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.FsType, nil + }) + 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_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_fsType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ISCSIPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__ISCSIPersistentVolumeSource_initiatorName(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ISCSIPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_initiatorName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.InitiatorName, nil + }) + 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_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_initiatorName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ISCSIPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__ISCSIPersistentVolumeSource_iqn(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ISCSIPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_iqn(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Iqn, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_iqn(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ISCSIPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__ISCSIPersistentVolumeSource_iscsiInterface(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ISCSIPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_iscsiInterface(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IscsiInterface, nil + }) + 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_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_iscsiInterface(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ISCSIPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__ISCSIPersistentVolumeSource_lun(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ISCSIPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_lun(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Lun, nil + }) + if err != nil { + ec.Error(ctx, 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_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_lun(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ISCSIPersistentVolumeSource", + 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) _K8s__io___api___core___v1__ISCSIPersistentVolumeSource_portals(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ISCSIPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_portals(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Portals, nil + }) + 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_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_portals(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ISCSIPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__ISCSIPersistentVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ISCSIPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_readOnly(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ReadOnly, 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_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ISCSIPersistentVolumeSource", + 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) _K8s__io___api___core___v1__ISCSIPersistentVolumeSource_secretRef(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ISCSIPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_secretRef(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SecretRef, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1SecretReference) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__SecretReference2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1SecretReference(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_secretRef(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ISCSIPersistentVolumeSource", + 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_K8s__io___api___core___v1__SecretReference_name(ctx, field) + case "namespace": + return ec.fieldContext_K8s__io___api___core___v1__SecretReference_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__SecretReference", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__ISCSIPersistentVolumeSource_targetPortal(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ISCSIPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_targetPortal(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TargetPortal, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_targetPortal(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ISCSIPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__LocalVolumeSource_fsType(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1LocalVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__LocalVolumeSource_fsType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.FsType, nil + }) + 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_K8s__io___api___core___v1__LocalVolumeSource_fsType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__LocalVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__LocalVolumeSource_path(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1LocalVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__LocalVolumeSource_path(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Path, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__LocalVolumeSource_path(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__LocalVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__NFSVolumeSource_path(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1NFSVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__NFSVolumeSource_path(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Path, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__NFSVolumeSource_path(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__NFSVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__NFSVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1NFSVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__NFSVolumeSource_readOnly(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ReadOnly, 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_K8s__io___api___core___v1__NFSVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__NFSVolumeSource", + 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) _K8s__io___api___core___v1__NFSVolumeSource_server(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1NFSVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__NFSVolumeSource_server(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Server, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__NFSVolumeSource_server(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__NFSVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__NamespaceCondition_lastTransitionTime(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1NamespaceCondition) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__NamespaceCondition_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.marshalODate2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__NamespaceCondition_lastTransitionTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__NamespaceCondition", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__NamespaceCondition_message(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1NamespaceCondition) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__NamespaceCondition_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_K8s__io___api___core___v1__NamespaceCondition_message(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__NamespaceCondition", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__NamespaceCondition_reason(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1NamespaceCondition) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__NamespaceCondition_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_K8s__io___api___core___v1__NamespaceCondition_reason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__NamespaceCondition", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__NamespaceCondition_status(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1NamespaceCondition) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__NamespaceCondition_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.K8sIoAPICoreV1ConditionStatus) + fc.Result = res + return ec.marshalNK8s__io___api___core___v1__ConditionStatus2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ConditionStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__NamespaceCondition_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__NamespaceCondition", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type K8s__io___api___core___v1__ConditionStatus does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__NamespaceCondition_type(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1NamespaceCondition) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__NamespaceCondition_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.(model.K8sIoAPICoreV1NamespaceConditionType) + fc.Result = res + return ec.marshalNK8s__io___api___core___v1__NamespaceConditionType2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NamespaceConditionType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__NamespaceCondition_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__NamespaceCondition", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type K8s__io___api___core___v1__NamespaceConditionType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__NamespaceSpec_finalizers(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1NamespaceSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__NamespaceSpec_finalizers(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Finalizers, nil + }) + 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_K8s__io___api___core___v1__NamespaceSpec_finalizers(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__NamespaceSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__NamespaceStatus_conditions(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1NamespaceStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__NamespaceStatus_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.K8sIoAPICoreV1NamespaceCondition) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__NamespaceCondition2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NamespaceConditionᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__NamespaceStatus_conditions(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__NamespaceStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "lastTransitionTime": + return ec.fieldContext_K8s__io___api___core___v1__NamespaceCondition_lastTransitionTime(ctx, field) + case "message": + return ec.fieldContext_K8s__io___api___core___v1__NamespaceCondition_message(ctx, field) + case "reason": + return ec.fieldContext_K8s__io___api___core___v1__NamespaceCondition_reason(ctx, field) + case "status": + return ec.fieldContext_K8s__io___api___core___v1__NamespaceCondition_status(ctx, field) + case "type": + return ec.fieldContext_K8s__io___api___core___v1__NamespaceCondition_type(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__NamespaceCondition", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__NamespaceStatus_phase(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1NamespaceStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__NamespaceStatus_phase(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Phase, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1NamespacePhase) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__NamespacePhase2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NamespacePhase(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__NamespaceStatus_phase(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__NamespaceStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type K8s__io___api___core___v1__NamespacePhase does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__NodeAffinity_preferredDuringSchedulingIgnoredDuringExecution(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1NodeAffinity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__NodeAffinity_preferredDuringSchedulingIgnoredDuringExecution(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PreferredDuringSchedulingIgnoredDuringExecution, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.K8sIoAPICoreV1PreferredSchedulingTerm) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__PreferredSchedulingTerm2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PreferredSchedulingTermᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__NodeAffinity_preferredDuringSchedulingIgnoredDuringExecution(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__NodeAffinity", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "preference": + return ec.fieldContext_K8s__io___api___core___v1__PreferredSchedulingTerm_preference(ctx, field) + case "weight": + return ec.fieldContext_K8s__io___api___core___v1__PreferredSchedulingTerm_weight(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__PreferredSchedulingTerm", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__NodeAffinity_requiredDuringSchedulingIgnoredDuringExecution(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1NodeAffinity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__NodeAffinity_requiredDuringSchedulingIgnoredDuringExecution(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RequiredDuringSchedulingIgnoredDuringExecution, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1NodeSelector) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__NodeSelector2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelector(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__NodeAffinity_requiredDuringSchedulingIgnoredDuringExecution(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__NodeAffinity", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "nodeSelectorTerms": + return ec.fieldContext_K8s__io___api___core___v1__NodeSelector_nodeSelectorTerms(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__NodeSelector", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__NodeSelector_nodeSelectorTerms(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1NodeSelector) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__NodeSelector_nodeSelectorTerms(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.NodeSelectorTerms, nil + }) + if err != nil { + ec.Error(ctx, 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.K8sIoAPICoreV1NodeSelectorTerm) + fc.Result = res + return ec.marshalNK8s__io___api___core___v1__NodeSelectorTerm2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelectorTermᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__NodeSelector_nodeSelectorTerms(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__NodeSelector", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "matchExpressions": + return ec.fieldContext_K8s__io___api___core___v1__NodeSelectorTerm_matchExpressions(ctx, field) + case "matchFields": + return ec.fieldContext_K8s__io___api___core___v1__NodeSelectorTerm_matchFields(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__NodeSelectorTerm", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__NodeSelectorRequirement_key(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1NodeSelectorRequirement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__NodeSelectorRequirement_key(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Key, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__NodeSelectorRequirement_key(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__NodeSelectorRequirement", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__NodeSelectorRequirement_operator(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1NodeSelectorRequirement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__NodeSelectorRequirement_operator(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Operator, nil + }) + if err != nil { + ec.Error(ctx, 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.K8sIoAPICoreV1NodeSelectorOperator) + fc.Result = res + return ec.marshalNK8s__io___api___core___v1__NodeSelectorOperator2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelectorOperator(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__NodeSelectorRequirement_operator(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__NodeSelectorRequirement", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type K8s__io___api___core___v1__NodeSelectorOperator does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__NodeSelectorRequirement_values(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1NodeSelectorRequirement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__NodeSelectorRequirement_values(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Values, nil + }) + 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_K8s__io___api___core___v1__NodeSelectorRequirement_values(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__NodeSelectorRequirement", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__NodeSelectorTerm_matchExpressions(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1NodeSelectorTerm) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__NodeSelectorTerm_matchExpressions(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MatchExpressions, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.K8sIoAPICoreV1NodeSelectorRequirement) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__NodeSelectorRequirement2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelectorRequirementᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__NodeSelectorTerm_matchExpressions(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__NodeSelectorTerm", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "key": + return ec.fieldContext_K8s__io___api___core___v1__NodeSelectorRequirement_key(ctx, field) + case "operator": + return ec.fieldContext_K8s__io___api___core___v1__NodeSelectorRequirement_operator(ctx, field) + case "values": + return ec.fieldContext_K8s__io___api___core___v1__NodeSelectorRequirement_values(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__NodeSelectorRequirement", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__NodeSelectorTerm_matchFields(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1NodeSelectorTerm) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__NodeSelectorTerm_matchFields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MatchFields, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.K8sIoAPICoreV1NodeSelectorRequirement) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__NodeSelectorRequirement2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelectorRequirementᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__NodeSelectorTerm_matchFields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__NodeSelectorTerm", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "key": + return ec.fieldContext_K8s__io___api___core___v1__NodeSelectorRequirement_key(ctx, field) + case "operator": + return ec.fieldContext_K8s__io___api___core___v1__NodeSelectorRequirement_operator(ctx, field) + case "values": + return ec.fieldContext_K8s__io___api___core___v1__NodeSelectorRequirement_values(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__NodeSelectorRequirement", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__ObjectReference_apiVersion(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ObjectReference) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ObjectReference_apiVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.APIVersion, nil + }) + 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_K8s__io___api___core___v1__ObjectReference_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ObjectReference", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__ObjectReference_fieldPath(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ObjectReference) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ObjectReference_fieldPath(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.FieldPath, nil + }) + 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_K8s__io___api___core___v1__ObjectReference_fieldPath(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ObjectReference", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__ObjectReference_kind(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ObjectReference) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ObjectReference_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__ObjectReference_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ObjectReference", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__ObjectReference_name(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ObjectReference) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ObjectReference_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_K8s__io___api___core___v1__ObjectReference_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ObjectReference", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__ObjectReference_namespace(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ObjectReference) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ObjectReference_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 { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__ObjectReference_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ObjectReference", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__ObjectReference_resourceVersion(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ObjectReference) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ObjectReference_resourceVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ResourceVersion, nil + }) + 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_K8s__io___api___core___v1__ObjectReference_resourceVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ObjectReference", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__ObjectReference_uid(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ObjectReference) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ObjectReference_uid(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UID, nil + }) + 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_K8s__io___api___core___v1__ObjectReference_uid(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ObjectReference", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimCondition_lastProbeTime(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeClaimCondition) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimCondition_lastProbeTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastProbeTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalODate2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimCondition_lastProbeTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeClaimCondition", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimCondition_lastTransitionTime(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeClaimCondition) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimCondition_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.marshalODate2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimCondition_lastTransitionTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeClaimCondition", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimCondition_message(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeClaimCondition) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimCondition_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_K8s__io___api___core___v1__PersistentVolumeClaimCondition_message(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeClaimCondition", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimCondition_reason(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeClaimCondition) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimCondition_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_K8s__io___api___core___v1__PersistentVolumeClaimCondition_reason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeClaimCondition", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimCondition_status(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeClaimCondition) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimCondition_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.K8sIoAPICoreV1ConditionStatus) + fc.Result = res + return ec.marshalNK8s__io___api___core___v1__ConditionStatus2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ConditionStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimCondition_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeClaimCondition", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type K8s__io___api___core___v1__ConditionStatus does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimCondition_type(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeClaimCondition) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimCondition_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.(model.K8sIoAPICoreV1PersistentVolumeClaimConditionType) + fc.Result = res + return ec.marshalNK8s__io___api___core___v1__PersistentVolumeClaimConditionType2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeClaimConditionType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimCondition_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeClaimCondition", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type K8s__io___api___core___v1__PersistentVolumeClaimConditionType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimSpec_accessModes(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeClaimSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimSpec_accessModes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccessModes, nil + }) + 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_K8s__io___api___core___v1__PersistentVolumeClaimSpec_accessModes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeClaimSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimSpec_dataSource(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeClaimSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimSpec_dataSource(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DataSource, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1TypedLocalObjectReference) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__TypedLocalObjectReference2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TypedLocalObjectReference(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimSpec_dataSource(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeClaimSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "apiGroup": + return ec.fieldContext_K8s__io___api___core___v1__TypedLocalObjectReference_apiGroup(ctx, field) + case "kind": + return ec.fieldContext_K8s__io___api___core___v1__TypedLocalObjectReference_kind(ctx, field) + case "name": + return ec.fieldContext_K8s__io___api___core___v1__TypedLocalObjectReference_name(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__TypedLocalObjectReference", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimSpec_dataSourceRef(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeClaimSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimSpec_dataSourceRef(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DataSourceRef, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1TypedObjectReference) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__TypedObjectReference2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TypedObjectReference(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimSpec_dataSourceRef(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeClaimSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "apiGroup": + return ec.fieldContext_K8s__io___api___core___v1__TypedObjectReference_apiGroup(ctx, field) + case "kind": + return ec.fieldContext_K8s__io___api___core___v1__TypedObjectReference_kind(ctx, field) + case "name": + return ec.fieldContext_K8s__io___api___core___v1__TypedObjectReference_name(ctx, field) + case "namespace": + return ec.fieldContext_K8s__io___api___core___v1__TypedObjectReference_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__TypedObjectReference", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimSpec_resources(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeClaimSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimSpec_resources(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Resources, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1ResourceRequirements) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__ResourceRequirements2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ResourceRequirements(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimSpec_resources(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeClaimSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "claims": + return ec.fieldContext_K8s__io___api___core___v1__ResourceRequirements_claims(ctx, field) + case "limits": + return ec.fieldContext_K8s__io___api___core___v1__ResourceRequirements_limits(ctx, field) + case "requests": + return ec.fieldContext_K8s__io___api___core___v1__ResourceRequirements_requests(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__ResourceRequirements", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimSpec_selector(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeClaimSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimSpec_selector(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Selector, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoApimachineryPkgApisMetaV1LabelSelector) + fc.Result = res + return ec.marshalOK8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoApimachineryPkgApisMetaV1LabelSelector(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimSpec_selector(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeClaimSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "matchExpressions": + return ec.fieldContext_K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector_matchExpressions(ctx, field) + case "matchLabels": + return ec.fieldContext_K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector_matchLabels(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimSpec_storageClassName(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeClaimSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimSpec_storageClassName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.StorageClassName, nil + }) + 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_K8s__io___api___core___v1__PersistentVolumeClaimSpec_storageClassName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeClaimSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimSpec_volumeMode(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeClaimSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimSpec_volumeMode(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.VolumeMode, nil + }) + 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_K8s__io___api___core___v1__PersistentVolumeClaimSpec_volumeMode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeClaimSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimSpec_volumeName(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeClaimSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimSpec_volumeName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.VolumeName, nil + }) + 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_K8s__io___api___core___v1__PersistentVolumeClaimSpec_volumeName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeClaimSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimStatus_accessModes(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeClaimStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimStatus_accessModes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccessModes, nil + }) + 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_K8s__io___api___core___v1__PersistentVolumeClaimStatus_accessModes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeClaimStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimStatus_allocatedResources(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeClaimStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimStatus_allocatedResources(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AllocatedResources, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimStatus_allocatedResources(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeClaimStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimStatus_allocatedResourceStatuses(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeClaimStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimStatus_allocatedResourceStatuses(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AllocatedResourceStatuses, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimStatus_allocatedResourceStatuses(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeClaimStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimStatus_capacity(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeClaimStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimStatus_capacity(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Capacity, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimStatus_capacity(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeClaimStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimStatus_conditions(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeClaimStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimStatus_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.K8sIoAPICoreV1PersistentVolumeClaimCondition) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__PersistentVolumeClaimCondition2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeClaimConditionᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimStatus_conditions(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeClaimStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "lastProbeTime": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimCondition_lastProbeTime(ctx, field) + case "lastTransitionTime": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimCondition_lastTransitionTime(ctx, field) + case "message": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimCondition_message(ctx, field) + case "reason": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimCondition_reason(ctx, field) + case "status": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimCondition_status(ctx, field) + case "type": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimCondition_type(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__PersistentVolumeClaimCondition", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimStatus_phase(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeClaimStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimStatus_phase(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Phase, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1PersistentVolumeClaimPhase) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__PersistentVolumeClaimPhase2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeClaimPhase(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimStatus_phase(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeClaimStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type K8s__io___api___core___v1__PersistentVolumeClaimPhase does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_accessModes(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_accessModes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccessModes, nil + }) + 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_K8s__io___api___core___v1__PersistentVolumeSpec_accessModes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_awsElasticBlockStore(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_awsElasticBlockStore(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AwsElasticBlockStore, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1AWSElasticBlockStoreVolumeSource) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1AWSElasticBlockStoreVolumeSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_awsElasticBlockStore(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "fsType": + return ec.fieldContext_K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource_fsType(ctx, field) + case "partition": + return ec.fieldContext_K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource_partition(ctx, field) + case "readOnly": + return ec.fieldContext_K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource_readOnly(ctx, field) + case "volumeID": + return ec.fieldContext_K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource_volumeID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_azureDisk(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_azureDisk(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AzureDisk, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1AzureDiskVolumeSource) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__AzureDiskVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1AzureDiskVolumeSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_azureDisk(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cachingMode": + return ec.fieldContext_K8s__io___api___core___v1__AzureDiskVolumeSource_cachingMode(ctx, field) + case "diskName": + return ec.fieldContext_K8s__io___api___core___v1__AzureDiskVolumeSource_diskName(ctx, field) + case "diskURI": + return ec.fieldContext_K8s__io___api___core___v1__AzureDiskVolumeSource_diskURI(ctx, field) + case "fsType": + return ec.fieldContext_K8s__io___api___core___v1__AzureDiskVolumeSource_fsType(ctx, field) + case "kind": + return ec.fieldContext_K8s__io___api___core___v1__AzureDiskVolumeSource_kind(ctx, field) + case "readOnly": + return ec.fieldContext_K8s__io___api___core___v1__AzureDiskVolumeSource_readOnly(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__AzureDiskVolumeSource", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_azureFile(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_azureFile(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AzureFile, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1AzureFilePersistentVolumeSource) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__AzureFilePersistentVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1AzureFilePersistentVolumeSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_azureFile(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "readOnly": + return ec.fieldContext_K8s__io___api___core___v1__AzureFilePersistentVolumeSource_readOnly(ctx, field) + case "secretName": + return ec.fieldContext_K8s__io___api___core___v1__AzureFilePersistentVolumeSource_secretName(ctx, field) + case "secretNamespace": + return ec.fieldContext_K8s__io___api___core___v1__AzureFilePersistentVolumeSource_secretNamespace(ctx, field) + case "shareName": + return ec.fieldContext_K8s__io___api___core___v1__AzureFilePersistentVolumeSource_shareName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__AzureFilePersistentVolumeSource", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_capacity(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_capacity(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Capacity, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_capacity(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_cephfs(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_cephfs(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Cephfs, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1CephFSPersistentVolumeSource) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__CephFSPersistentVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1CephFSPersistentVolumeSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_cephfs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "monitors": + return ec.fieldContext_K8s__io___api___core___v1__CephFSPersistentVolumeSource_monitors(ctx, field) + case "path": + return ec.fieldContext_K8s__io___api___core___v1__CephFSPersistentVolumeSource_path(ctx, field) + case "readOnly": + return ec.fieldContext_K8s__io___api___core___v1__CephFSPersistentVolumeSource_readOnly(ctx, field) + case "secretFile": + return ec.fieldContext_K8s__io___api___core___v1__CephFSPersistentVolumeSource_secretFile(ctx, field) + case "secretRef": + return ec.fieldContext_K8s__io___api___core___v1__CephFSPersistentVolumeSource_secretRef(ctx, field) + case "user": + return ec.fieldContext_K8s__io___api___core___v1__CephFSPersistentVolumeSource_user(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__CephFSPersistentVolumeSource", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_cinder(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_cinder(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Cinder, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1CinderPersistentVolumeSource) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__CinderPersistentVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1CinderPersistentVolumeSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_cinder(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "fsType": + return ec.fieldContext_K8s__io___api___core___v1__CinderPersistentVolumeSource_fsType(ctx, field) + case "readOnly": + return ec.fieldContext_K8s__io___api___core___v1__CinderPersistentVolumeSource_readOnly(ctx, field) + case "secretRef": + return ec.fieldContext_K8s__io___api___core___v1__CinderPersistentVolumeSource_secretRef(ctx, field) + case "volumeID": + return ec.fieldContext_K8s__io___api___core___v1__CinderPersistentVolumeSource_volumeID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__CinderPersistentVolumeSource", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_claimRef(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_claimRef(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ClaimRef, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1ObjectReference) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__ObjectReference2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ObjectReference(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_claimRef(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "apiVersion": + return ec.fieldContext_K8s__io___api___core___v1__ObjectReference_apiVersion(ctx, field) + case "fieldPath": + return ec.fieldContext_K8s__io___api___core___v1__ObjectReference_fieldPath(ctx, field) + case "kind": + return ec.fieldContext_K8s__io___api___core___v1__ObjectReference_kind(ctx, field) + case "name": + return ec.fieldContext_K8s__io___api___core___v1__ObjectReference_name(ctx, field) + case "namespace": + return ec.fieldContext_K8s__io___api___core___v1__ObjectReference_namespace(ctx, field) + case "resourceVersion": + return ec.fieldContext_K8s__io___api___core___v1__ObjectReference_resourceVersion(ctx, field) + case "uid": + return ec.fieldContext_K8s__io___api___core___v1__ObjectReference_uid(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__ObjectReference", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_csi(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_csi(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Csi, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1CSIPersistentVolumeSource) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__CSIPersistentVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1CSIPersistentVolumeSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_csi(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "controllerExpandSecretRef": + return ec.fieldContext_K8s__io___api___core___v1__CSIPersistentVolumeSource_controllerExpandSecretRef(ctx, field) + case "controllerPublishSecretRef": + return ec.fieldContext_K8s__io___api___core___v1__CSIPersistentVolumeSource_controllerPublishSecretRef(ctx, field) + case "driver": + return ec.fieldContext_K8s__io___api___core___v1__CSIPersistentVolumeSource_driver(ctx, field) + case "fsType": + return ec.fieldContext_K8s__io___api___core___v1__CSIPersistentVolumeSource_fsType(ctx, field) + case "nodeExpandSecretRef": + return ec.fieldContext_K8s__io___api___core___v1__CSIPersistentVolumeSource_nodeExpandSecretRef(ctx, field) + case "nodePublishSecretRef": + return ec.fieldContext_K8s__io___api___core___v1__CSIPersistentVolumeSource_nodePublishSecretRef(ctx, field) + case "nodeStageSecretRef": + return ec.fieldContext_K8s__io___api___core___v1__CSIPersistentVolumeSource_nodeStageSecretRef(ctx, field) + case "readOnly": + return ec.fieldContext_K8s__io___api___core___v1__CSIPersistentVolumeSource_readOnly(ctx, field) + case "volumeAttributes": + return ec.fieldContext_K8s__io___api___core___v1__CSIPersistentVolumeSource_volumeAttributes(ctx, field) + case "volumeHandle": + return ec.fieldContext_K8s__io___api___core___v1__CSIPersistentVolumeSource_volumeHandle(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__CSIPersistentVolumeSource", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_fc(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_fc(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fc, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1FCVolumeSource) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__FCVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1FCVolumeSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_fc(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "fsType": + return ec.fieldContext_K8s__io___api___core___v1__FCVolumeSource_fsType(ctx, field) + case "lun": + return ec.fieldContext_K8s__io___api___core___v1__FCVolumeSource_lun(ctx, field) + case "readOnly": + return ec.fieldContext_K8s__io___api___core___v1__FCVolumeSource_readOnly(ctx, field) + case "targetWWNs": + return ec.fieldContext_K8s__io___api___core___v1__FCVolumeSource_targetWWNs(ctx, field) + case "wwids": + return ec.fieldContext_K8s__io___api___core___v1__FCVolumeSource_wwids(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__FCVolumeSource", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_flexVolume(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_flexVolume(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.FlexVolume, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1FlexPersistentVolumeSource) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__FlexPersistentVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1FlexPersistentVolumeSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_flexVolume(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "driver": + return ec.fieldContext_K8s__io___api___core___v1__FlexPersistentVolumeSource_driver(ctx, field) + case "fsType": + return ec.fieldContext_K8s__io___api___core___v1__FlexPersistentVolumeSource_fsType(ctx, field) + case "options": + return ec.fieldContext_K8s__io___api___core___v1__FlexPersistentVolumeSource_options(ctx, field) + case "readOnly": + return ec.fieldContext_K8s__io___api___core___v1__FlexPersistentVolumeSource_readOnly(ctx, field) + case "secretRef": + return ec.fieldContext_K8s__io___api___core___v1__FlexPersistentVolumeSource_secretRef(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__FlexPersistentVolumeSource", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_flocker(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_flocker(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Flocker, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1FlockerVolumeSource) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__FlockerVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1FlockerVolumeSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_flocker(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "datasetName": + return ec.fieldContext_K8s__io___api___core___v1__FlockerVolumeSource_datasetName(ctx, field) + case "datasetUUID": + return ec.fieldContext_K8s__io___api___core___v1__FlockerVolumeSource_datasetUUID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__FlockerVolumeSource", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_gcePersistentDisk(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_gcePersistentDisk(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.GcePersistentDisk, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1GCEPersistentDiskVolumeSource) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__GCEPersistentDiskVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1GCEPersistentDiskVolumeSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_gcePersistentDisk(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "fsType": + return ec.fieldContext_K8s__io___api___core___v1__GCEPersistentDiskVolumeSource_fsType(ctx, field) + case "partition": + return ec.fieldContext_K8s__io___api___core___v1__GCEPersistentDiskVolumeSource_partition(ctx, field) + case "pdName": + return ec.fieldContext_K8s__io___api___core___v1__GCEPersistentDiskVolumeSource_pdName(ctx, field) + case "readOnly": + return ec.fieldContext_K8s__io___api___core___v1__GCEPersistentDiskVolumeSource_readOnly(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__GCEPersistentDiskVolumeSource", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_glusterfs(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_glusterfs(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Glusterfs, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1GlusterfsPersistentVolumeSource) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__GlusterfsPersistentVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1GlusterfsPersistentVolumeSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_glusterfs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "endpoints": + return ec.fieldContext_K8s__io___api___core___v1__GlusterfsPersistentVolumeSource_endpoints(ctx, field) + case "endpointsNamespace": + return ec.fieldContext_K8s__io___api___core___v1__GlusterfsPersistentVolumeSource_endpointsNamespace(ctx, field) + case "path": + return ec.fieldContext_K8s__io___api___core___v1__GlusterfsPersistentVolumeSource_path(ctx, field) + case "readOnly": + return ec.fieldContext_K8s__io___api___core___v1__GlusterfsPersistentVolumeSource_readOnly(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__GlusterfsPersistentVolumeSource", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_hostPath(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_hostPath(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.HostPath, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1HostPathVolumeSource) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__HostPathVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1HostPathVolumeSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_hostPath(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "path": + return ec.fieldContext_K8s__io___api___core___v1__HostPathVolumeSource_path(ctx, field) + case "type": + return ec.fieldContext_K8s__io___api___core___v1__HostPathVolumeSource_type(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__HostPathVolumeSource", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_iscsi(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_iscsi(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Iscsi, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1ISCSIPersistentVolumeSource) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__ISCSIPersistentVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ISCSIPersistentVolumeSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_iscsi(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "chapAuthDiscovery": + return ec.fieldContext_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_chapAuthDiscovery(ctx, field) + case "chapAuthSession": + return ec.fieldContext_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_chapAuthSession(ctx, field) + case "fsType": + return ec.fieldContext_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_fsType(ctx, field) + case "initiatorName": + return ec.fieldContext_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_initiatorName(ctx, field) + case "iqn": + return ec.fieldContext_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_iqn(ctx, field) + case "iscsiInterface": + return ec.fieldContext_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_iscsiInterface(ctx, field) + case "lun": + return ec.fieldContext_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_lun(ctx, field) + case "portals": + return ec.fieldContext_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_portals(ctx, field) + case "readOnly": + return ec.fieldContext_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_readOnly(ctx, field) + case "secretRef": + return ec.fieldContext_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_secretRef(ctx, field) + case "targetPortal": + return ec.fieldContext_K8s__io___api___core___v1__ISCSIPersistentVolumeSource_targetPortal(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__ISCSIPersistentVolumeSource", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_local(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_local(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Local, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1LocalVolumeSource) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__LocalVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1LocalVolumeSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_local(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "fsType": + return ec.fieldContext_K8s__io___api___core___v1__LocalVolumeSource_fsType(ctx, field) + case "path": + return ec.fieldContext_K8s__io___api___core___v1__LocalVolumeSource_path(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__LocalVolumeSource", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_mountOptions(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_mountOptions(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MountOptions, nil + }) + 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_K8s__io___api___core___v1__PersistentVolumeSpec_mountOptions(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_nfs(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_nfs(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Nfs, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1NFSVolumeSource) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__NFSVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NFSVolumeSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_nfs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "path": + return ec.fieldContext_K8s__io___api___core___v1__NFSVolumeSource_path(ctx, field) + case "readOnly": + return ec.fieldContext_K8s__io___api___core___v1__NFSVolumeSource_readOnly(ctx, field) + case "server": + return ec.fieldContext_K8s__io___api___core___v1__NFSVolumeSource_server(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__NFSVolumeSource", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_nodeAffinity(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_nodeAffinity(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.NodeAffinity, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1VolumeNodeAffinity) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__VolumeNodeAffinity2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1VolumeNodeAffinity(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_nodeAffinity(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "required": + return ec.fieldContext_K8s__io___api___core___v1__VolumeNodeAffinity_required(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__VolumeNodeAffinity", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_persistentVolumeReclaimPolicy(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_persistentVolumeReclaimPolicy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PersistentVolumeReclaimPolicy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1PersistentVolumeReclaimPolicy) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__PersistentVolumeReclaimPolicy2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeReclaimPolicy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_persistentVolumeReclaimPolicy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type K8s__io___api___core___v1__PersistentVolumeReclaimPolicy does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_photonPersistentDisk(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_photonPersistentDisk(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PhotonPersistentDisk, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1PhotonPersistentDiskVolumeSource) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__PhotonPersistentDiskVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PhotonPersistentDiskVolumeSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_photonPersistentDisk(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "fsType": + return ec.fieldContext_K8s__io___api___core___v1__PhotonPersistentDiskVolumeSource_fsType(ctx, field) + case "pdID": + return ec.fieldContext_K8s__io___api___core___v1__PhotonPersistentDiskVolumeSource_pdID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__PhotonPersistentDiskVolumeSource", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_portworxVolume(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_portworxVolume(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PortworxVolume, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1PortworxVolumeSource) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__PortworxVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PortworxVolumeSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_portworxVolume(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "fsType": + return ec.fieldContext_K8s__io___api___core___v1__PortworxVolumeSource_fsType(ctx, field) + case "readOnly": + return ec.fieldContext_K8s__io___api___core___v1__PortworxVolumeSource_readOnly(ctx, field) + case "volumeID": + return ec.fieldContext_K8s__io___api___core___v1__PortworxVolumeSource_volumeID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__PortworxVolumeSource", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_quobyte(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_quobyte(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Quobyte, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1QuobyteVolumeSource) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__QuobyteVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1QuobyteVolumeSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_quobyte(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "group": + return ec.fieldContext_K8s__io___api___core___v1__QuobyteVolumeSource_group(ctx, field) + case "readOnly": + return ec.fieldContext_K8s__io___api___core___v1__QuobyteVolumeSource_readOnly(ctx, field) + case "registry": + return ec.fieldContext_K8s__io___api___core___v1__QuobyteVolumeSource_registry(ctx, field) + case "tenant": + return ec.fieldContext_K8s__io___api___core___v1__QuobyteVolumeSource_tenant(ctx, field) + case "user": + return ec.fieldContext_K8s__io___api___core___v1__QuobyteVolumeSource_user(ctx, field) + case "volume": + return ec.fieldContext_K8s__io___api___core___v1__QuobyteVolumeSource_volume(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__QuobyteVolumeSource", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_rbd(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_rbd(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Rbd, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1RBDPersistentVolumeSource) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__RBDPersistentVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1RBDPersistentVolumeSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_rbd(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "fsType": + return ec.fieldContext_K8s__io___api___core___v1__RBDPersistentVolumeSource_fsType(ctx, field) + case "image": + return ec.fieldContext_K8s__io___api___core___v1__RBDPersistentVolumeSource_image(ctx, field) + case "keyring": + return ec.fieldContext_K8s__io___api___core___v1__RBDPersistentVolumeSource_keyring(ctx, field) + case "monitors": + return ec.fieldContext_K8s__io___api___core___v1__RBDPersistentVolumeSource_monitors(ctx, field) + case "pool": + return ec.fieldContext_K8s__io___api___core___v1__RBDPersistentVolumeSource_pool(ctx, field) + case "readOnly": + return ec.fieldContext_K8s__io___api___core___v1__RBDPersistentVolumeSource_readOnly(ctx, field) + case "secretRef": + return ec.fieldContext_K8s__io___api___core___v1__RBDPersistentVolumeSource_secretRef(ctx, field) + case "user": + return ec.fieldContext_K8s__io___api___core___v1__RBDPersistentVolumeSource_user(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__RBDPersistentVolumeSource", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_scaleIO(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_scaleIO(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ScaleIo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1ScaleIOPersistentVolumeSource) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__ScaleIOPersistentVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ScaleIOPersistentVolumeSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_scaleIO(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "fsType": + return ec.fieldContext_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_fsType(ctx, field) + case "gateway": + return ec.fieldContext_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_gateway(ctx, field) + case "protectionDomain": + return ec.fieldContext_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_protectionDomain(ctx, field) + case "readOnly": + return ec.fieldContext_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_readOnly(ctx, field) + case "secretRef": + return ec.fieldContext_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_secretRef(ctx, field) + case "sslEnabled": + return ec.fieldContext_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_sslEnabled(ctx, field) + case "storageMode": + return ec.fieldContext_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_storageMode(ctx, field) + case "storagePool": + return ec.fieldContext_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_storagePool(ctx, field) + case "system": + return ec.fieldContext_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_system(ctx, field) + case "volumeName": + return ec.fieldContext_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_volumeName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__ScaleIOPersistentVolumeSource", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_storageClassName(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_storageClassName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.StorageClassName, nil + }) + 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_K8s__io___api___core___v1__PersistentVolumeSpec_storageClassName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_storageos(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_storageos(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Storageos, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1StorageOSPersistentVolumeSource) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__StorageOSPersistentVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1StorageOSPersistentVolumeSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_storageos(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "fsType": + return ec.fieldContext_K8s__io___api___core___v1__StorageOSPersistentVolumeSource_fsType(ctx, field) + case "readOnly": + return ec.fieldContext_K8s__io___api___core___v1__StorageOSPersistentVolumeSource_readOnly(ctx, field) + case "secretRef": + return ec.fieldContext_K8s__io___api___core___v1__StorageOSPersistentVolumeSource_secretRef(ctx, field) + case "volumeName": + return ec.fieldContext_K8s__io___api___core___v1__StorageOSPersistentVolumeSource_volumeName(ctx, field) + case "volumeNamespace": + return ec.fieldContext_K8s__io___api___core___v1__StorageOSPersistentVolumeSource_volumeNamespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__StorageOSPersistentVolumeSource", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_volumeMode(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_volumeMode(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.VolumeMode, nil + }) + 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_K8s__io___api___core___v1__PersistentVolumeSpec_volumeMode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_vsphereVolume(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_vsphereVolume(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.VsphereVolume, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1VsphereVirtualDiskVolumeSource) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__VsphereVirtualDiskVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1VsphereVirtualDiskVolumeSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_vsphereVolume(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "fsType": + return ec.fieldContext_K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource_fsType(ctx, field) + case "storagePolicyID": + return ec.fieldContext_K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource_storagePolicyID(ctx, field) + case "storagePolicyName": + return ec.fieldContext_K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource_storagePolicyName(ctx, field) + case "volumePath": + return ec.fieldContext_K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource_volumePath(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeStatus_lastPhaseTransitionTime(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeStatus_lastPhaseTransitionTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastPhaseTransitionTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalODate2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeStatus_lastPhaseTransitionTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeStatus_message(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeStatus_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_K8s__io___api___core___v1__PersistentVolumeStatus_message(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeStatus_phase(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeStatus_phase(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Phase, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1PersistentVolumePhase) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__PersistentVolumePhase2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumePhase(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeStatus_phase(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type K8s__io___api___core___v1__PersistentVolumePhase does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeStatus_reason(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeStatus_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_K8s__io___api___core___v1__PersistentVolumeStatus_reason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PhotonPersistentDiskVolumeSource_fsType(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PhotonPersistentDiskVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PhotonPersistentDiskVolumeSource_fsType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.FsType, nil + }) + 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_K8s__io___api___core___v1__PhotonPersistentDiskVolumeSource_fsType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PhotonPersistentDiskVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PhotonPersistentDiskVolumeSource_pdID(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PhotonPersistentDiskVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PhotonPersistentDiskVolumeSource_pdID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PdID, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__PhotonPersistentDiskVolumeSource_pdID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PhotonPersistentDiskVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PodAffinity_preferredDuringSchedulingIgnoredDuringExecution(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PodAffinity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PodAffinity_preferredDuringSchedulingIgnoredDuringExecution(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PreferredDuringSchedulingIgnoredDuringExecution, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.K8sIoAPICoreV1WeightedPodAffinityTerm) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__WeightedPodAffinityTerm2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1WeightedPodAffinityTermᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PodAffinity_preferredDuringSchedulingIgnoredDuringExecution(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PodAffinity", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "podAffinityTerm": + return ec.fieldContext_K8s__io___api___core___v1__WeightedPodAffinityTerm_podAffinityTerm(ctx, field) + case "weight": + return ec.fieldContext_K8s__io___api___core___v1__WeightedPodAffinityTerm_weight(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__WeightedPodAffinityTerm", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PodAffinity_requiredDuringSchedulingIgnoredDuringExecution(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PodAffinity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PodAffinity_requiredDuringSchedulingIgnoredDuringExecution(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RequiredDuringSchedulingIgnoredDuringExecution, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.K8sIoAPICoreV1PodAffinityTerm) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__PodAffinityTerm2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PodAffinityTermᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PodAffinity_requiredDuringSchedulingIgnoredDuringExecution(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PodAffinity", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "labelSelector": + return ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_labelSelector(ctx, field) + case "namespaces": + return ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_namespaces(ctx, field) + case "namespaceSelector": + return ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_namespaceSelector(ctx, field) + case "topologyKey": + return ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_topologyKey(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__PodAffinityTerm", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PodAffinityTerm_labelSelector(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PodAffinityTerm) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_labelSelector(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LabelSelector, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoApimachineryPkgApisMetaV1LabelSelector) + fc.Result = res + return ec.marshalOK8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoApimachineryPkgApisMetaV1LabelSelector(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PodAffinityTerm_labelSelector(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PodAffinityTerm", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "matchExpressions": + return ec.fieldContext_K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector_matchExpressions(ctx, field) + case "matchLabels": + return ec.fieldContext_K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector_matchLabels(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PodAffinityTerm_namespaces(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PodAffinityTerm) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_namespaces(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Namespaces, nil + }) + 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_K8s__io___api___core___v1__PodAffinityTerm_namespaces(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PodAffinityTerm", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PodAffinityTerm_namespaceSelector(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PodAffinityTerm) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_namespaceSelector(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.NamespaceSelector, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoApimachineryPkgApisMetaV1LabelSelector) + fc.Result = res + return ec.marshalOK8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoApimachineryPkgApisMetaV1LabelSelector(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PodAffinityTerm_namespaceSelector(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PodAffinityTerm", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "matchExpressions": + return ec.fieldContext_K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector_matchExpressions(ctx, field) + case "matchLabels": + return ec.fieldContext_K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector_matchLabels(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PodAffinityTerm_topologyKey(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PodAffinityTerm) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_topologyKey(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TopologyKey, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__PodAffinityTerm_topologyKey(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PodAffinityTerm", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PodAntiAffinity_preferredDuringSchedulingIgnoredDuringExecution(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PodAntiAffinity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PodAntiAffinity_preferredDuringSchedulingIgnoredDuringExecution(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PreferredDuringSchedulingIgnoredDuringExecution, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.K8sIoAPICoreV1WeightedPodAffinityTerm) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__WeightedPodAffinityTerm2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1WeightedPodAffinityTermᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PodAntiAffinity_preferredDuringSchedulingIgnoredDuringExecution(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PodAntiAffinity", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "podAffinityTerm": + return ec.fieldContext_K8s__io___api___core___v1__WeightedPodAffinityTerm_podAffinityTerm(ctx, field) + case "weight": + return ec.fieldContext_K8s__io___api___core___v1__WeightedPodAffinityTerm_weight(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__WeightedPodAffinityTerm", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PodAntiAffinity_requiredDuringSchedulingIgnoredDuringExecution(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PodAntiAffinity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PodAntiAffinity_requiredDuringSchedulingIgnoredDuringExecution(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RequiredDuringSchedulingIgnoredDuringExecution, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.K8sIoAPICoreV1PodAffinityTerm) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__PodAffinityTerm2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PodAffinityTermᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PodAntiAffinity_requiredDuringSchedulingIgnoredDuringExecution(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PodAntiAffinity", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "labelSelector": + return ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_labelSelector(ctx, field) + case "namespaces": + return ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_namespaces(ctx, field) + case "namespaceSelector": + return ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_namespaceSelector(ctx, field) + case "topologyKey": + return ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_topologyKey(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__PodAffinityTerm", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PortworxVolumeSource_fsType(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PortworxVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PortworxVolumeSource_fsType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.FsType, nil + }) + 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_K8s__io___api___core___v1__PortworxVolumeSource_fsType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PortworxVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PortworxVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PortworxVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PortworxVolumeSource_readOnly(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ReadOnly, 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_K8s__io___api___core___v1__PortworxVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PortworxVolumeSource", + 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) _K8s__io___api___core___v1__PortworxVolumeSource_volumeID(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PortworxVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PortworxVolumeSource_volumeID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.VolumeID, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__PortworxVolumeSource_volumeID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PortworxVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PreferredSchedulingTerm_preference(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PreferredSchedulingTerm) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PreferredSchedulingTerm_preference(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Preference, nil + }) + if err != nil { + ec.Error(ctx, 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.K8sIoAPICoreV1NodeSelectorTerm) + fc.Result = res + return ec.marshalNK8s__io___api___core___v1__NodeSelectorTerm2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelectorTerm(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PreferredSchedulingTerm_preference(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PreferredSchedulingTerm", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "matchExpressions": + return ec.fieldContext_K8s__io___api___core___v1__NodeSelectorTerm_matchExpressions(ctx, field) + case "matchFields": + return ec.fieldContext_K8s__io___api___core___v1__NodeSelectorTerm_matchFields(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__NodeSelectorTerm", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PreferredSchedulingTerm_weight(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PreferredSchedulingTerm) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PreferredSchedulingTerm_weight(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Weight, nil + }) + if err != nil { + ec.Error(ctx, 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_K8s__io___api___core___v1__PreferredSchedulingTerm_weight(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PreferredSchedulingTerm", + 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) _K8s__io___api___core___v1__QuobyteVolumeSource_group(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1QuobyteVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__QuobyteVolumeSource_group(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Group, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__QuobyteVolumeSource_group(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__QuobyteVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__QuobyteVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1QuobyteVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__QuobyteVolumeSource_readOnly(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ReadOnly, 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_K8s__io___api___core___v1__QuobyteVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__QuobyteVolumeSource", + 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) _K8s__io___api___core___v1__QuobyteVolumeSource_registry(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1QuobyteVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__QuobyteVolumeSource_registry(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Registry, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__QuobyteVolumeSource_registry(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__QuobyteVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__QuobyteVolumeSource_tenant(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1QuobyteVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__QuobyteVolumeSource_tenant(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Tenant, nil + }) + 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_K8s__io___api___core___v1__QuobyteVolumeSource_tenant(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__QuobyteVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__QuobyteVolumeSource_user(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1QuobyteVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__QuobyteVolumeSource_user(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.User, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__QuobyteVolumeSource_user(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__QuobyteVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__QuobyteVolumeSource_volume(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1QuobyteVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__QuobyteVolumeSource_volume(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Volume, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__QuobyteVolumeSource_volume(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__QuobyteVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__RBDPersistentVolumeSource_fsType(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1RBDPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__RBDPersistentVolumeSource_fsType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.FsType, nil + }) + 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_K8s__io___api___core___v1__RBDPersistentVolumeSource_fsType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__RBDPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__RBDPersistentVolumeSource_image(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1RBDPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__RBDPersistentVolumeSource_image(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Image, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__RBDPersistentVolumeSource_image(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__RBDPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__RBDPersistentVolumeSource_keyring(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1RBDPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__RBDPersistentVolumeSource_keyring(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Keyring, nil + }) + 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_K8s__io___api___core___v1__RBDPersistentVolumeSource_keyring(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__RBDPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__RBDPersistentVolumeSource_monitors(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1RBDPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__RBDPersistentVolumeSource_monitors(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Monitors, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__RBDPersistentVolumeSource_monitors(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__RBDPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__RBDPersistentVolumeSource_pool(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1RBDPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__RBDPersistentVolumeSource_pool(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Pool, nil + }) + 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_K8s__io___api___core___v1__RBDPersistentVolumeSource_pool(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__RBDPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__RBDPersistentVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1RBDPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__RBDPersistentVolumeSource_readOnly(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ReadOnly, 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_K8s__io___api___core___v1__RBDPersistentVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__RBDPersistentVolumeSource", + 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) _K8s__io___api___core___v1__RBDPersistentVolumeSource_secretRef(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1RBDPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__RBDPersistentVolumeSource_secretRef(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SecretRef, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1SecretReference) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__SecretReference2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1SecretReference(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__RBDPersistentVolumeSource_secretRef(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__RBDPersistentVolumeSource", + 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_K8s__io___api___core___v1__SecretReference_name(ctx, field) + case "namespace": + return ec.fieldContext_K8s__io___api___core___v1__SecretReference_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__SecretReference", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__RBDPersistentVolumeSource_user(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1RBDPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__RBDPersistentVolumeSource_user(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.User, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__RBDPersistentVolumeSource_user(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__RBDPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__ResourceClaim_name(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ResourceClaim) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ResourceClaim_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_K8s__io___api___core___v1__ResourceClaim_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ResourceClaim", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__ResourceRequirements_claims(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ResourceRequirements) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ResourceRequirements_claims(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Claims, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.K8sIoAPICoreV1ResourceClaim) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__ResourceClaim2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ResourceClaimᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__ResourceRequirements_claims(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ResourceRequirements", + 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_K8s__io___api___core___v1__ResourceClaim_name(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__ResourceClaim", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__ResourceRequirements_limits(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ResourceRequirements) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ResourceRequirements_limits(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Limits, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__ResourceRequirements_limits(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ResourceRequirements", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__ResourceRequirements_requests(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ResourceRequirements) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ResourceRequirements_requests(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Requests, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__ResourceRequirements_requests(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ResourceRequirements", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_fsType(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ScaleIOPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_fsType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.FsType, nil + }) + 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_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_fsType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ScaleIOPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_gateway(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ScaleIOPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_gateway(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Gateway, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_gateway(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ScaleIOPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_protectionDomain(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ScaleIOPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_protectionDomain(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ProtectionDomain, nil + }) + 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_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_protectionDomain(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ScaleIOPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ScaleIOPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_readOnly(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ReadOnly, 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_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ScaleIOPersistentVolumeSource", + 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) _K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_secretRef(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ScaleIOPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_secretRef(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SecretRef, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1SecretReference) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__SecretReference2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1SecretReference(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_secretRef(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ScaleIOPersistentVolumeSource", + 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_K8s__io___api___core___v1__SecretReference_name(ctx, field) + case "namespace": + return ec.fieldContext_K8s__io___api___core___v1__SecretReference_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__SecretReference", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_sslEnabled(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ScaleIOPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_sslEnabled(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SslEnabled, 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_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_sslEnabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ScaleIOPersistentVolumeSource", + 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) _K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_storageMode(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ScaleIOPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_storageMode(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.StorageMode, nil + }) + 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_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_storageMode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ScaleIOPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_storagePool(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ScaleIOPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_storagePool(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.StoragePool, nil + }) + 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_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_storagePool(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ScaleIOPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_system(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ScaleIOPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_system(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.System, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_system(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ScaleIOPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_volumeName(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ScaleIOPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_volumeName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.VolumeName, nil + }) + 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_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_volumeName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ScaleIOPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__SecretReference_name(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1SecretReference) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__SecretReference_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_K8s__io___api___core___v1__SecretReference_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__SecretReference", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__SecretReference_namespace(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1SecretReference) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__SecretReference_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 { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__SecretReference_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__SecretReference", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__StorageOSPersistentVolumeSource_fsType(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1StorageOSPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__StorageOSPersistentVolumeSource_fsType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.FsType, nil + }) + 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_K8s__io___api___core___v1__StorageOSPersistentVolumeSource_fsType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__StorageOSPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__StorageOSPersistentVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1StorageOSPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__StorageOSPersistentVolumeSource_readOnly(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ReadOnly, 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_K8s__io___api___core___v1__StorageOSPersistentVolumeSource_readOnly(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__StorageOSPersistentVolumeSource", + 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) _K8s__io___api___core___v1__StorageOSPersistentVolumeSource_secretRef(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1StorageOSPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__StorageOSPersistentVolumeSource_secretRef(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SecretRef, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1ObjectReference) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__ObjectReference2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ObjectReference(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__StorageOSPersistentVolumeSource_secretRef(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__StorageOSPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "apiVersion": + return ec.fieldContext_K8s__io___api___core___v1__ObjectReference_apiVersion(ctx, field) + case "fieldPath": + return ec.fieldContext_K8s__io___api___core___v1__ObjectReference_fieldPath(ctx, field) + case "kind": + return ec.fieldContext_K8s__io___api___core___v1__ObjectReference_kind(ctx, field) + case "name": + return ec.fieldContext_K8s__io___api___core___v1__ObjectReference_name(ctx, field) + case "namespace": + return ec.fieldContext_K8s__io___api___core___v1__ObjectReference_namespace(ctx, field) + case "resourceVersion": + return ec.fieldContext_K8s__io___api___core___v1__ObjectReference_resourceVersion(ctx, field) + case "uid": + return ec.fieldContext_K8s__io___api___core___v1__ObjectReference_uid(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__ObjectReference", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__StorageOSPersistentVolumeSource_volumeName(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1StorageOSPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__StorageOSPersistentVolumeSource_volumeName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.VolumeName, nil + }) + 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_K8s__io___api___core___v1__StorageOSPersistentVolumeSource_volumeName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__StorageOSPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__StorageOSPersistentVolumeSource_volumeNamespace(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1StorageOSPersistentVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__StorageOSPersistentVolumeSource_volumeNamespace(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.VolumeNamespace, nil + }) + 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_K8s__io___api___core___v1__StorageOSPersistentVolumeSource_volumeNamespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__StorageOSPersistentVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__Taint_effect(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1Taint) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__Taint_effect(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Effect, nil + }) + if err != nil { + ec.Error(ctx, 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.K8sIoAPICoreV1TaintEffect) + fc.Result = res + return ec.marshalNK8s__io___api___core___v1__TaintEffect2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TaintEffect(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__Taint_effect(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__Taint", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type K8s__io___api___core___v1__TaintEffect does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__Taint_key(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1Taint) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__Taint_key(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Key, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__Taint_key(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__Taint", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__Taint_timeAdded(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1Taint) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__Taint_timeAdded(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TimeAdded, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalODate2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__Taint_timeAdded(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__Taint", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__Taint_value(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1Taint) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__Taint_value(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + 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_K8s__io___api___core___v1__Taint_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__Taint", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__Toleration_effect(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1Toleration) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__Toleration_effect(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Effect, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1TaintEffect) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__TaintEffect2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TaintEffect(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__Toleration_effect(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__Toleration", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type K8s__io___api___core___v1__TaintEffect does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__Toleration_key(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1Toleration) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__Toleration_key(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Key, nil + }) + 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_K8s__io___api___core___v1__Toleration_key(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__Toleration", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__Toleration_operator(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1Toleration) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__Toleration_operator(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Operator, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1TolerationOperator) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__TolerationOperator2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TolerationOperator(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__Toleration_operator(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__Toleration", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type K8s__io___api___core___v1__TolerationOperator does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__Toleration_tolerationSeconds(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1Toleration) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__Toleration_tolerationSeconds(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TolerationSeconds, 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_K8s__io___api___core___v1__Toleration_tolerationSeconds(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__Toleration", + 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) _K8s__io___api___core___v1__Toleration_value(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1Toleration) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__Toleration_value(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + 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_K8s__io___api___core___v1__Toleration_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__Toleration", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__TypedLocalObjectReference_apiGroup(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1TypedLocalObjectReference) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__TypedLocalObjectReference_apiGroup(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.APIGroup, nil + }) + 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_K8s__io___api___core___v1__TypedLocalObjectReference_apiGroup(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__TypedLocalObjectReference", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__TypedLocalObjectReference_kind(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1TypedLocalObjectReference) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__TypedLocalObjectReference_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_K8s__io___api___core___v1__TypedLocalObjectReference_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__TypedLocalObjectReference", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__TypedLocalObjectReference_name(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1TypedLocalObjectReference) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__TypedLocalObjectReference_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_K8s__io___api___core___v1__TypedLocalObjectReference_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__TypedLocalObjectReference", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__TypedObjectReference_apiGroup(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1TypedObjectReference) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__TypedObjectReference_apiGroup(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.APIGroup, nil + }) + 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_K8s__io___api___core___v1__TypedObjectReference_apiGroup(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__TypedObjectReference", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__TypedObjectReference_kind(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1TypedObjectReference) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__TypedObjectReference_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_K8s__io___api___core___v1__TypedObjectReference_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__TypedObjectReference", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__TypedObjectReference_name(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1TypedObjectReference) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__TypedObjectReference_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_K8s__io___api___core___v1__TypedObjectReference_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__TypedObjectReference", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__TypedObjectReference_namespace(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1TypedObjectReference) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__TypedObjectReference_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 { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__TypedObjectReference_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__TypedObjectReference", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__VolumeNodeAffinity_required(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1VolumeNodeAffinity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__VolumeNodeAffinity_required(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Required, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1NodeSelector) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__NodeSelector2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelector(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__VolumeNodeAffinity_required(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__VolumeNodeAffinity", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "nodeSelectorTerms": + return ec.fieldContext_K8s__io___api___core___v1__NodeSelector_nodeSelectorTerms(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__NodeSelector", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource_fsType(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1VsphereVirtualDiskVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource_fsType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.FsType, nil + }) + 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_K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource_fsType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource_storagePolicyID(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1VsphereVirtualDiskVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource_storagePolicyID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.StoragePolicyID, nil + }) + 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_K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource_storagePolicyID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource_storagePolicyName(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1VsphereVirtualDiskVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource_storagePolicyName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.StoragePolicyName, nil + }) + 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_K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource_storagePolicyName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource_volumePath(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1VsphereVirtualDiskVolumeSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource_volumePath(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.VolumePath, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource_volumePath(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__WeightedPodAffinityTerm_podAffinityTerm(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1WeightedPodAffinityTerm) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__WeightedPodAffinityTerm_podAffinityTerm(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PodAffinityTerm, nil + }) + if err != nil { + ec.Error(ctx, 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.K8sIoAPICoreV1PodAffinityTerm) + fc.Result = res + return ec.marshalNK8s__io___api___core___v1__PodAffinityTerm2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PodAffinityTerm(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__WeightedPodAffinityTerm_podAffinityTerm(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__WeightedPodAffinityTerm", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "labelSelector": + return ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_labelSelector(ctx, field) + case "namespaces": + return ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_namespaces(ctx, field) + case "namespaceSelector": + return ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_namespaceSelector(ctx, field) + case "topologyKey": + return ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_topologyKey(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__PodAffinityTerm", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__WeightedPodAffinityTerm_weight(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1WeightedPodAffinityTerm) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__WeightedPodAffinityTerm_weight(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Weight, nil + }) + if err != nil { + ec.Error(ctx, 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_K8s__io___api___core___v1__WeightedPodAffinityTerm_weight(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__WeightedPodAffinityTerm", + 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) _K8s__io___api___storage___v1__VolumeAttachmentSource_inlineVolumeSpec(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPIStorageV1VolumeAttachmentSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___storage___v1__VolumeAttachmentSource_inlineVolumeSpec(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.InlineVolumeSpec, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1PersistentVolumeSpec) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__PersistentVolumeSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeSpec(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___storage___v1__VolumeAttachmentSource_inlineVolumeSpec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___storage___v1__VolumeAttachmentSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accessModes": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_accessModes(ctx, field) + case "awsElasticBlockStore": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_awsElasticBlockStore(ctx, field) + case "azureDisk": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_azureDisk(ctx, field) + case "azureFile": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_azureFile(ctx, field) + case "capacity": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_capacity(ctx, field) + case "cephfs": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_cephfs(ctx, field) + case "cinder": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_cinder(ctx, field) + case "claimRef": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_claimRef(ctx, field) + case "csi": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_csi(ctx, field) + case "fc": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_fc(ctx, field) + case "flexVolume": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_flexVolume(ctx, field) + case "flocker": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_flocker(ctx, field) + case "gcePersistentDisk": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_gcePersistentDisk(ctx, field) + case "glusterfs": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_glusterfs(ctx, field) + case "hostPath": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_hostPath(ctx, field) + case "iscsi": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_iscsi(ctx, field) + case "local": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_local(ctx, field) + case "mountOptions": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_mountOptions(ctx, field) + case "nfs": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_nfs(ctx, field) + case "nodeAffinity": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_nodeAffinity(ctx, field) + case "persistentVolumeReclaimPolicy": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_persistentVolumeReclaimPolicy(ctx, field) + case "photonPersistentDisk": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_photonPersistentDisk(ctx, field) + case "portworxVolume": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_portworxVolume(ctx, field) + case "quobyte": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_quobyte(ctx, field) + case "rbd": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_rbd(ctx, field) + case "scaleIO": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_scaleIO(ctx, field) + case "storageClassName": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_storageClassName(ctx, field) + case "storageos": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_storageos(ctx, field) + case "volumeMode": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_volumeMode(ctx, field) + case "vsphereVolume": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_vsphereVolume(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__PersistentVolumeSpec", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___storage___v1__VolumeAttachmentSource_persistentVolumeName(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPIStorageV1VolumeAttachmentSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___storage___v1__VolumeAttachmentSource_persistentVolumeName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PersistentVolumeName, nil + }) + 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_K8s__io___api___storage___v1__VolumeAttachmentSource_persistentVolumeName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___storage___v1__VolumeAttachmentSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___storage___v1__VolumeAttachmentSpec_attacher(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPIStorageV1VolumeAttachmentSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___storage___v1__VolumeAttachmentSpec_attacher(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Attacher, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___storage___v1__VolumeAttachmentSpec_attacher(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___storage___v1__VolumeAttachmentSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___storage___v1__VolumeAttachmentSpec_nodeName(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPIStorageV1VolumeAttachmentSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___storage___v1__VolumeAttachmentSpec_nodeName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.NodeName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___api___storage___v1__VolumeAttachmentSpec_nodeName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___storage___v1__VolumeAttachmentSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___storage___v1__VolumeAttachmentSpec_source(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPIStorageV1VolumeAttachmentSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___storage___v1__VolumeAttachmentSpec_source(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Source, nil + }) + if err != nil { + ec.Error(ctx, 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.K8sIoAPIStorageV1VolumeAttachmentSource) + fc.Result = res + return ec.marshalNK8s__io___api___storage___v1__VolumeAttachmentSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPIStorageV1VolumeAttachmentSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___storage___v1__VolumeAttachmentSpec_source(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___storage___v1__VolumeAttachmentSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "inlineVolumeSpec": + return ec.fieldContext_K8s__io___api___storage___v1__VolumeAttachmentSource_inlineVolumeSpec(ctx, field) + case "persistentVolumeName": + return ec.fieldContext_K8s__io___api___storage___v1__VolumeAttachmentSource_persistentVolumeName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___storage___v1__VolumeAttachmentSource", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___storage___v1__VolumeAttachmentStatus_attached(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPIStorageV1VolumeAttachmentStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___storage___v1__VolumeAttachmentStatus_attached(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Attached, nil + }) + if err != nil { + ec.Error(ctx, 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_K8s__io___api___storage___v1__VolumeAttachmentStatus_attached(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___storage___v1__VolumeAttachmentStatus", + 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) _K8s__io___api___storage___v1__VolumeAttachmentStatus_attachError(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPIStorageV1VolumeAttachmentStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___storage___v1__VolumeAttachmentStatus_attachError(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AttachError, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPIStorageV1VolumeError) + fc.Result = res + return ec.marshalOK8s__io___api___storage___v1__VolumeError2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPIStorageV1VolumeError(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___storage___v1__VolumeAttachmentStatus_attachError(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___storage___v1__VolumeAttachmentStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "message": + return ec.fieldContext_K8s__io___api___storage___v1__VolumeError_message(ctx, field) + case "time": + return ec.fieldContext_K8s__io___api___storage___v1__VolumeError_time(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___storage___v1__VolumeError", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___storage___v1__VolumeAttachmentStatus_attachmentMetadata(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPIStorageV1VolumeAttachmentStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___storage___v1__VolumeAttachmentStatus_attachmentMetadata(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AttachmentMetadata, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___storage___v1__VolumeAttachmentStatus_attachmentMetadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___storage___v1__VolumeAttachmentStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___storage___v1__VolumeAttachmentStatus_detachError(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPIStorageV1VolumeAttachmentStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___storage___v1__VolumeAttachmentStatus_detachError(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DetachError, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPIStorageV1VolumeError) + fc.Result = res + return ec.marshalOK8s__io___api___storage___v1__VolumeError2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPIStorageV1VolumeError(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___storage___v1__VolumeAttachmentStatus_detachError(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___storage___v1__VolumeAttachmentStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "message": + return ec.fieldContext_K8s__io___api___storage___v1__VolumeError_message(ctx, field) + case "time": + return ec.fieldContext_K8s__io___api___storage___v1__VolumeError_time(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___storage___v1__VolumeError", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___storage___v1__VolumeError_message(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPIStorageV1VolumeError) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___storage___v1__VolumeError_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_K8s__io___api___storage___v1__VolumeError_message(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___storage___v1__VolumeError", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___storage___v1__VolumeError_time(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPIStorageV1VolumeError) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___storage___v1__VolumeError_time(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Time, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalODate2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___storage___v1__VolumeError_time(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___storage___v1__VolumeError", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___apimachinery___pkg___api___resource__Quantity_Format(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoApimachineryPkgAPIResourceQuantity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___apimachinery___pkg___api___resource__Quantity_Format(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Format, nil + }) + if err != nil { + ec.Error(ctx, 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.K8sIoApimachineryPkgAPIResourceFormat) + fc.Result = res + return ec.marshalNK8s__io___apimachinery___pkg___api___resource__Format2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoApimachineryPkgAPIResourceFormat(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___apimachinery___pkg___api___resource__Quantity_Format(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___apimachinery___pkg___api___resource__Quantity", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type K8s__io___apimachinery___pkg___api___resource__Format does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector_matchExpressions(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoApimachineryPkgApisMetaV1LabelSelector) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector_matchExpressions(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MatchExpressions, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.K8sIoApimachineryPkgApisMetaV1LabelSelectorRequirement) + fc.Result = res + return ec.marshalOK8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoApimachineryPkgApisMetaV1LabelSelectorRequirementᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector_matchExpressions(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "key": + return ec.fieldContext_K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement_key(ctx, field) + case "operator": + return ec.fieldContext_K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement_operator(ctx, field) + case "values": + return ec.fieldContext_K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement_values(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector_matchLabels(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoApimachineryPkgApisMetaV1LabelSelector) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector_matchLabels(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MatchLabels, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector_matchLabels(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement_key(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoApimachineryPkgApisMetaV1LabelSelectorRequirement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement_key(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Key, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement_key(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement_operator(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoApimachineryPkgApisMetaV1LabelSelectorRequirement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement_operator(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Operator, nil + }) + if err != nil { + ec.Error(ctx, 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.K8sIoApimachineryPkgApisMetaV1LabelSelectorOperator) + fc.Result = res + return ec.marshalNK8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorOperator2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoApimachineryPkgApisMetaV1LabelSelectorOperator(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement_operator(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorOperator does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement_values(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoApimachineryPkgApisMetaV1LabelSelectorRequirement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement_values(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Values, nil + }) + 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_K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement_values(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _MatchFilter_array(ctx context.Context, field graphql.CollectedField, obj *repos.MatchFilter) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_MatchFilter_array(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Array, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]any) + fc.Result = res + return ec.marshalOAny2ᚕinterfaceᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_MatchFilter_array(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "MatchFilter", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Any does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _MatchFilter_exact(ctx context.Context, field graphql.CollectedField, obj *repos.MatchFilter) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_MatchFilter_exact(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Exact, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(any) + fc.Result = res + return ec.marshalOAny2interface(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_MatchFilter_exact(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "MatchFilter", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Any does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _MatchFilter_matchType(ctx context.Context, field graphql.CollectedField, obj *repos.MatchFilter) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_MatchFilter_matchType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MatchType, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(repos.MatchType) + fc.Result = res + return ec.marshalNMatchFilterMatchType2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_MatchFilter_matchType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "MatchFilter", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type MatchFilterMatchType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _MatchFilter_regex(ctx context.Context, field graphql.CollectedField, obj *repos.MatchFilter) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_MatchFilter_regex(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Regex, nil + }) + 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_MatchFilter_regex(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "MatchFilter", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Metadata_annotations(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_annotations(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Metadata().Annotations(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Metadata_annotations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Metadata", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Metadata_creationTimestamp(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_creationTimestamp(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Metadata().CreationTimestamp(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Metadata_creationTimestamp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Metadata", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Metadata_deletionTimestamp(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_deletionTimestamp(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Metadata().DeletionTimestamp(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalODate2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Metadata_deletionTimestamp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Metadata", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Metadata_generation(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_generation(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Generation, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int64) + fc.Result = res + return ec.marshalNInt2int64(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Metadata_generation(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Metadata", + 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) _Metadata_labels(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_labels(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Metadata().Labels(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Metadata_labels(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Metadata", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Metadata_name(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_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_Metadata_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Metadata", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Metadata_namespace(ctx context.Context, field graphql.CollectedField, obj *v1.ObjectMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_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 { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Metadata_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Metadata", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _MsvcTemplate_category(ctx context.Context, field graphql.CollectedField, obj *entities.MsvcTemplate) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_MsvcTemplate_category(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Category, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + 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_MsvcTemplate_category(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "MsvcTemplate", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _MsvcTemplate_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.MsvcTemplate) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_MsvcTemplate_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_MsvcTemplate_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "MsvcTemplate", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _MsvcTemplate_items(ctx context.Context, field graphql.CollectedField, obj *entities.MsvcTemplate) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_MsvcTemplate_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.([]entities.MsvcTemplateEntry) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry2ᚕgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐMsvcTemplateEntryᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_MsvcTemplate_items(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "MsvcTemplate", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "active": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_active(ctx, field) + case "apiVersion": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_apiVersion(ctx, field) + case "description": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_description(ctx, field) + case "displayName": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_displayName(ctx, field) + case "fields": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_fields(ctx, field) + case "kind": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_kind(ctx, field) + case "logoUrl": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_logoUrl(ctx, field) + case "name": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_name(ctx, field) + case "outputs": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_outputs(ctx, field) + case "resources": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_resources(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Mutation_infra_createCluster(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_infra_createCluster(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().InfraCreateCluster(rctx, fc.Args["cluster"].(entities.Cluster)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Cluster); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/entities.Cluster`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.Cluster) + fc.Result = res + return ec.marshalOCluster2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐCluster(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_infra_createCluster(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 "accountName": + return ec.fieldContext_Cluster_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Cluster_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_Cluster_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Cluster_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_Cluster_displayName(ctx, field) + case "id": + return ec.fieldContext_Cluster_id(ctx, field) + case "kind": + return ec.fieldContext_Cluster_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Cluster_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Cluster_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Cluster_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_Cluster_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_Cluster_spec(ctx, field) + case "status": + return ec.fieldContext_Cluster_status(ctx, field) + case "syncStatus": + return ec.fieldContext_Cluster_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_Cluster_updateTime(ctx, field) + case "adminKubeconfig": + return ec.fieldContext_Cluster_adminKubeconfig(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Cluster", field.Name) + }, + } + defer func() { + if 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_infra_createCluster_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_infra_updateCluster(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_infra_updateCluster(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().InfraUpdateCluster(rctx, fc.Args["cluster"].(entities.Cluster)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Cluster); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/entities.Cluster`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.Cluster) + fc.Result = res + return ec.marshalOCluster2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐCluster(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_infra_updateCluster(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 "accountName": + return ec.fieldContext_Cluster_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Cluster_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_Cluster_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Cluster_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_Cluster_displayName(ctx, field) + case "id": + return ec.fieldContext_Cluster_id(ctx, field) + case "kind": + return ec.fieldContext_Cluster_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Cluster_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Cluster_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Cluster_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_Cluster_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_Cluster_spec(ctx, field) + case "status": + return ec.fieldContext_Cluster_status(ctx, field) + case "syncStatus": + return ec.fieldContext_Cluster_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_Cluster_updateTime(ctx, field) + case "adminKubeconfig": + return ec.fieldContext_Cluster_adminKubeconfig(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Cluster", field.Name) + }, + } + defer func() { + if 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_infra_updateCluster_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_infra_deleteCluster(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_infra_deleteCluster(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().InfraDeleteCluster(rctx, fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_infra_deleteCluster(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_infra_deleteCluster_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_infra_createProviderSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_infra_createProviderSecret(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().InfraCreateProviderSecret(rctx, fc.Args["secret"].(entities.CloudProviderSecret)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.CloudProviderSecret); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/entities.CloudProviderSecret`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.CloudProviderSecret) + fc.Result = res + return ec.marshalOCloudProviderSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐCloudProviderSecret(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_infra_createProviderSecret(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 "accountName": + return ec.fieldContext_CloudProviderSecret_accountName(ctx, field) + case "aws": + return ec.fieldContext_CloudProviderSecret_aws(ctx, field) + case "cloudProviderName": + return ec.fieldContext_CloudProviderSecret_cloudProviderName(ctx, field) + case "createdBy": + return ec.fieldContext_CloudProviderSecret_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_CloudProviderSecret_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_CloudProviderSecret_displayName(ctx, field) + case "id": + return ec.fieldContext_CloudProviderSecret_id(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_CloudProviderSecret_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_CloudProviderSecret_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_CloudProviderSecret_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_CloudProviderSecret_recordVersion(ctx, field) + case "updateTime": + return ec.fieldContext_CloudProviderSecret_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type CloudProviderSecret", field.Name) + }, + } + defer func() { + if 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_infra_createProviderSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_infra_updateProviderSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_infra_updateProviderSecret(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().InfraUpdateProviderSecret(rctx, fc.Args["secret"].(entities.CloudProviderSecret)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.CloudProviderSecret); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/entities.CloudProviderSecret`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.CloudProviderSecret) + fc.Result = res + return ec.marshalOCloudProviderSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐCloudProviderSecret(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_infra_updateProviderSecret(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 "accountName": + return ec.fieldContext_CloudProviderSecret_accountName(ctx, field) + case "aws": + return ec.fieldContext_CloudProviderSecret_aws(ctx, field) + case "cloudProviderName": + return ec.fieldContext_CloudProviderSecret_cloudProviderName(ctx, field) + case "createdBy": + return ec.fieldContext_CloudProviderSecret_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_CloudProviderSecret_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_CloudProviderSecret_displayName(ctx, field) + case "id": + return ec.fieldContext_CloudProviderSecret_id(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_CloudProviderSecret_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_CloudProviderSecret_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_CloudProviderSecret_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_CloudProviderSecret_recordVersion(ctx, field) + case "updateTime": + return ec.fieldContext_CloudProviderSecret_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type CloudProviderSecret", field.Name) + }, + } + defer func() { + if 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_infra_updateProviderSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_infra_deleteProviderSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_infra_deleteProviderSecret(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().InfraDeleteProviderSecret(rctx, fc.Args["secretName"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_infra_deleteProviderSecret(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_infra_deleteProviderSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_infra_createDomainEntry(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_infra_createDomainEntry(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().InfraCreateDomainEntry(rctx, fc.Args["domainEntry"].(entities.DomainEntry)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.DomainEntry); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/entities.DomainEntry`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.DomainEntry) + fc.Result = res + return ec.marshalODomainEntry2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐDomainEntry(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_infra_createDomainEntry(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 "accountName": + return ec.fieldContext_DomainEntry_accountName(ctx, field) + case "clusterName": + return ec.fieldContext_DomainEntry_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_DomainEntry_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_DomainEntry_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_DomainEntry_displayName(ctx, field) + case "domainName": + return ec.fieldContext_DomainEntry_domainName(ctx, field) + case "id": + return ec.fieldContext_DomainEntry_id(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_DomainEntry_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_DomainEntry_markedForDeletion(ctx, field) + case "recordVersion": + return ec.fieldContext_DomainEntry_recordVersion(ctx, field) + case "updateTime": + return ec.fieldContext_DomainEntry_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DomainEntry", field.Name) + }, + } + defer func() { + if 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_infra_createDomainEntry_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_infra_updateDomainEntry(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_infra_updateDomainEntry(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().InfraUpdateDomainEntry(rctx, fc.Args["domainEntry"].(entities.DomainEntry)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.DomainEntry); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/entities.DomainEntry`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.DomainEntry) + fc.Result = res + return ec.marshalODomainEntry2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐDomainEntry(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_infra_updateDomainEntry(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 "accountName": + return ec.fieldContext_DomainEntry_accountName(ctx, field) + case "clusterName": + return ec.fieldContext_DomainEntry_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_DomainEntry_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_DomainEntry_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_DomainEntry_displayName(ctx, field) + case "domainName": + return ec.fieldContext_DomainEntry_domainName(ctx, field) + case "id": + return ec.fieldContext_DomainEntry_id(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_DomainEntry_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_DomainEntry_markedForDeletion(ctx, field) + case "recordVersion": + return ec.fieldContext_DomainEntry_recordVersion(ctx, field) + case "updateTime": + return ec.fieldContext_DomainEntry_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DomainEntry", field.Name) + }, + } + defer func() { + if 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_infra_updateDomainEntry_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_infra_deleteDomainEntry(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_infra_deleteDomainEntry(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().InfraDeleteDomainEntry(rctx, fc.Args["domainName"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_infra_deleteDomainEntry(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_infra_deleteDomainEntry_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_infra_createNodePool(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_infra_createNodePool(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().InfraCreateNodePool(rctx, fc.Args["clusterName"].(string), fc.Args["pool"].(entities.NodePool)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.NodePool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/entities.NodePool`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.NodePool) + fc.Result = res + return ec.marshalONodePool2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐNodePool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_infra_createNodePool(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 "accountName": + return ec.fieldContext_NodePool_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_NodePool_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_NodePool_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_NodePool_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_NodePool_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_NodePool_displayName(ctx, field) + case "id": + return ec.fieldContext_NodePool_id(ctx, field) + case "kind": + return ec.fieldContext_NodePool_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_NodePool_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_NodePool_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_NodePool_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_NodePool_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_NodePool_spec(ctx, field) + case "status": + return ec.fieldContext_NodePool_status(ctx, field) + case "syncStatus": + return ec.fieldContext_NodePool_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_NodePool_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type NodePool", field.Name) + }, + } + defer func() { + if 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_infra_createNodePool_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_infra_updateNodePool(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_infra_updateNodePool(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().InfraUpdateNodePool(rctx, fc.Args["clusterName"].(string), fc.Args["pool"].(entities.NodePool)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.NodePool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/entities.NodePool`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.NodePool) + fc.Result = res + return ec.marshalONodePool2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐNodePool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_infra_updateNodePool(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 "accountName": + return ec.fieldContext_NodePool_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_NodePool_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_NodePool_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_NodePool_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_NodePool_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_NodePool_displayName(ctx, field) + case "id": + return ec.fieldContext_NodePool_id(ctx, field) + case "kind": + return ec.fieldContext_NodePool_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_NodePool_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_NodePool_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_NodePool_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_NodePool_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_NodePool_spec(ctx, field) + case "status": + return ec.fieldContext_NodePool_status(ctx, field) + case "syncStatus": + return ec.fieldContext_NodePool_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_NodePool_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type NodePool", field.Name) + }, + } + defer func() { + if 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_infra_updateNodePool_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_infra_deleteNodePool(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_infra_deleteNodePool(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().InfraDeleteNodePool(rctx, fc.Args["clusterName"].(string), fc.Args["poolName"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_infra_deleteNodePool(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_infra_deleteNodePool_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_infra_createClusterManagedService(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_infra_createClusterManagedService(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().InfraCreateClusterManagedService(rctx, fc.Args["clusterName"].(string), fc.Args["service"].(entities.ClusterManagedService)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.ClusterManagedService); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/entities.ClusterManagedService`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.ClusterManagedService) + fc.Result = res + return ec.marshalOClusterManagedService2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐClusterManagedService(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_infra_createClusterManagedService(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 "accountName": + return ec.fieldContext_ClusterManagedService_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_ClusterManagedService_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_ClusterManagedService_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_ClusterManagedService_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_ClusterManagedService_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_ClusterManagedService_displayName(ctx, field) + case "id": + return ec.fieldContext_ClusterManagedService_id(ctx, field) + case "kind": + return ec.fieldContext_ClusterManagedService_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_ClusterManagedService_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_ClusterManagedService_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_ClusterManagedService_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_ClusterManagedService_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_ClusterManagedService_spec(ctx, field) + case "status": + return ec.fieldContext_ClusterManagedService_status(ctx, field) + case "syncStatus": + return ec.fieldContext_ClusterManagedService_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_ClusterManagedService_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ClusterManagedService", field.Name) + }, + } + defer func() { + if 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_infra_createClusterManagedService_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_infra_updateClusterManagedService(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_infra_updateClusterManagedService(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().InfraUpdateClusterManagedService(rctx, fc.Args["clusterName"].(string), fc.Args["service"].(entities.ClusterManagedService)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.ClusterManagedService); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/entities.ClusterManagedService`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.ClusterManagedService) + fc.Result = res + return ec.marshalOClusterManagedService2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐClusterManagedService(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_infra_updateClusterManagedService(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 "accountName": + return ec.fieldContext_ClusterManagedService_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_ClusterManagedService_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_ClusterManagedService_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_ClusterManagedService_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_ClusterManagedService_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_ClusterManagedService_displayName(ctx, field) + case "id": + return ec.fieldContext_ClusterManagedService_id(ctx, field) + case "kind": + return ec.fieldContext_ClusterManagedService_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_ClusterManagedService_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_ClusterManagedService_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_ClusterManagedService_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_ClusterManagedService_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_ClusterManagedService_spec(ctx, field) + case "status": + return ec.fieldContext_ClusterManagedService_status(ctx, field) + case "syncStatus": + return ec.fieldContext_ClusterManagedService_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_ClusterManagedService_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ClusterManagedService", field.Name) + }, + } + defer func() { + if 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_infra_updateClusterManagedService_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_infra_deleteClusterManagedService(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_infra_deleteClusterManagedService(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().InfraDeleteClusterManagedService(rctx, fc.Args["clusterName"].(string), fc.Args["serviceName"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_infra_deleteClusterManagedService(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_infra_deleteClusterManagedService_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_infra_createHelmRelease(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_infra_createHelmRelease(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().InfraCreateHelmRelease(rctx, fc.Args["clusterName"].(string), fc.Args["release"].(entities.HelmRelease)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.HelmRelease); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/entities.HelmRelease`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.HelmRelease) + fc.Result = res + return ec.marshalOHelmRelease2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐHelmRelease(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_infra_createHelmRelease(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 "accountName": + return ec.fieldContext_HelmRelease_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_HelmRelease_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_HelmRelease_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_HelmRelease_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_HelmRelease_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_HelmRelease_displayName(ctx, field) + case "id": + return ec.fieldContext_HelmRelease_id(ctx, field) + case "kind": + return ec.fieldContext_HelmRelease_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_HelmRelease_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_HelmRelease_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_HelmRelease_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_HelmRelease_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_HelmRelease_spec(ctx, field) + case "status": + return ec.fieldContext_HelmRelease_status(ctx, field) + case "syncStatus": + return ec.fieldContext_HelmRelease_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_HelmRelease_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type HelmRelease", field.Name) + }, + } + defer func() { + if 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_infra_createHelmRelease_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_infra_updateHelmRelease(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_infra_updateHelmRelease(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().InfraUpdateHelmRelease(rctx, fc.Args["clusterName"].(string), fc.Args["release"].(entities.HelmRelease)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.HelmRelease); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/entities.HelmRelease`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.HelmRelease) + fc.Result = res + return ec.marshalOHelmRelease2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐHelmRelease(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_infra_updateHelmRelease(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 "accountName": + return ec.fieldContext_HelmRelease_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_HelmRelease_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_HelmRelease_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_HelmRelease_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_HelmRelease_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_HelmRelease_displayName(ctx, field) + case "id": + return ec.fieldContext_HelmRelease_id(ctx, field) + case "kind": + return ec.fieldContext_HelmRelease_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_HelmRelease_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_HelmRelease_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_HelmRelease_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_HelmRelease_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_HelmRelease_spec(ctx, field) + case "status": + return ec.fieldContext_HelmRelease_status(ctx, field) + case "syncStatus": + return ec.fieldContext_HelmRelease_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_HelmRelease_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type HelmRelease", field.Name) + }, + } + defer func() { + if 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_infra_updateHelmRelease_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_infra_deleteHelmRelease(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_infra_deleteHelmRelease(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().InfraDeleteHelmRelease(rctx, fc.Args["clusterName"].(string), fc.Args["releaseName"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + }) + if err != nil { + ec.Error(ctx, 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_infra_deleteHelmRelease(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_infra_deleteHelmRelease_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Namespace_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.Namespace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Namespace_accountName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Namespace_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Namespace", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Namespace_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Namespace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Namespace_apiVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.APIVersion, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Namespace_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Namespace", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Namespace_clusterName(ctx context.Context, field graphql.CollectedField, obj *entities.Namespace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Namespace_clusterName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ClusterName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Namespace_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Namespace", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Namespace_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.Namespace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Namespace_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Namespace_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Namespace", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Namespace_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.Namespace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Namespace_creationTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Namespace().CreationTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Namespace_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Namespace", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Namespace_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.Namespace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Namespace_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_Namespace_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Namespace", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Namespace_id(ctx context.Context, field graphql.CollectedField, obj *entities.Namespace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Namespace_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 ec.resolvers.Namespace().ID(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_Namespace_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Namespace", + 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) _Namespace_kind(ctx context.Context, field graphql.CollectedField, obj *entities.Namespace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Namespace_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Namespace_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Namespace", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Namespace_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.Namespace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Namespace_lastUpdatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastUpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Namespace_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Namespace", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Namespace_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.Namespace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Namespace_markedForDeletion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MarkedForDeletion, 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_Namespace_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Namespace", + 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) _Namespace_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.Namespace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Namespace_metadata(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ObjectMeta, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(v1.ObjectMeta) + fc.Result = res + return ec.marshalOMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Namespace_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Namespace", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "annotations": + return ec.fieldContext_Metadata_annotations(ctx, field) + case "creationTimestamp": + return ec.fieldContext_Metadata_creationTimestamp(ctx, field) + case "deletionTimestamp": + return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) + case "generation": + return ec.fieldContext_Metadata_generation(ctx, field) + case "labels": + return ec.fieldContext_Metadata_labels(ctx, field) + case "name": + return ec.fieldContext_Metadata_name(ctx, field) + case "namespace": + return ec.fieldContext_Metadata_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Namespace_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Namespace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Namespace_recordVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RecordVersion, nil + }) + if err != nil { + ec.Error(ctx, 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_Namespace_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Namespace", + 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) _Namespace_spec(ctx context.Context, field graphql.CollectedField, obj *entities.Namespace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Namespace_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 ec.resolvers.Namespace().Spec(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1NamespaceSpec) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__NamespaceSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NamespaceSpec(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Namespace_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Namespace", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "finalizers": + return ec.fieldContext_K8s__io___api___core___v1__NamespaceSpec_finalizers(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__NamespaceSpec", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Namespace_status(ctx context.Context, field graphql.CollectedField, obj *entities.Namespace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Namespace_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 ec.resolvers.Namespace().Status(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1NamespaceStatus) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__NamespaceStatus2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NamespaceStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Namespace_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Namespace", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "conditions": + return ec.fieldContext_K8s__io___api___core___v1__NamespaceStatus_conditions(ctx, field) + case "phase": + return ec.fieldContext_K8s__io___api___core___v1__NamespaceStatus_phase(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__NamespaceStatus", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Namespace_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.Namespace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Namespace_syncStatus(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SyncStatus, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(types.SyncStatus) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___pkg___types__SyncStatus2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Namespace_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Namespace", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "action": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx, field) + case "error": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx, field) + case "lastSyncedAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx, field) + case "recordVersion": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx, field) + case "state": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx, field) + case "syncScheduledAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___pkg___types__SyncStatus", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Namespace_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.Namespace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Namespace_updateTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Namespace().UpdateTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Namespace_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Namespace", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _NamespaceEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.NamespaceEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NamespaceEdge_cursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NamespaceEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NamespaceEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _NamespaceEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.NamespaceEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NamespaceEdge_node(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*entities.Namespace) + fc.Result = res + return ec.marshalNNamespace2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐNamespace(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NamespaceEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NamespaceEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accountName": + return ec.fieldContext_Namespace_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Namespace_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_Namespace_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_Namespace_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Namespace_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_Namespace_displayName(ctx, field) + case "id": + return ec.fieldContext_Namespace_id(ctx, field) + case "kind": + return ec.fieldContext_Namespace_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Namespace_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Namespace_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Namespace_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_Namespace_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_Namespace_spec(ctx, field) + case "status": + return ec.fieldContext_Namespace_status(ctx, field) + case "syncStatus": + return ec.fieldContext_Namespace_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_Namespace_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Namespace", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _NamespacePaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.NamespacePaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NamespacePaginatedRecords_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.NamespaceEdge) + fc.Result = res + return ec.marshalNNamespaceEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐNamespaceEdgeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NamespacePaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NamespacePaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cursor": + return ec.fieldContext_NamespaceEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_NamespaceEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type NamespaceEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _NamespacePaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.NamespacePaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NamespacePaginatedRecords_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.PageInfo) + fc.Result = res + return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NamespacePaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NamespacePaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _NamespacePaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.NamespacePaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NamespacePaginatedRecords_totalCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalCount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NamespacePaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NamespacePaginatedRecords", + 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) _Node_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.Node) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Node_accountName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Node_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Node", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Node_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Node) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Node_apiVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.APIVersion, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Node_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Node", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Node_clusterName(ctx context.Context, field graphql.CollectedField, obj *entities.Node) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Node_clusterName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ClusterName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Node_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Node", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Node_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.Node) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Node_creationTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Node().CreationTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Node_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Node", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Node_id(ctx context.Context, field graphql.CollectedField, obj *entities.Node) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Node_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 ec.resolvers.Node().ID(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_Node_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Node", + 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) _Node_kind(ctx context.Context, field graphql.CollectedField, obj *entities.Node) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Node_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Node_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Node", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Node_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.Node) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Node_markedForDeletion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MarkedForDeletion, 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_Node_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Node", + 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) _Node_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.Node) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Node_metadata(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ObjectMeta, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(v1.ObjectMeta) + fc.Result = res + return ec.marshalOMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Node_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Node", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "annotations": + return ec.fieldContext_Metadata_annotations(ctx, field) + case "creationTimestamp": + return ec.fieldContext_Metadata_creationTimestamp(ctx, field) + case "deletionTimestamp": + return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) + case "generation": + return ec.fieldContext_Metadata_generation(ctx, field) + case "labels": + return ec.fieldContext_Metadata_labels(ctx, field) + case "name": + return ec.fieldContext_Metadata_name(ctx, field) + case "namespace": + return ec.fieldContext_Metadata_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Node_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Node) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Node_recordVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RecordVersion, nil + }) + if err != nil { + ec.Error(ctx, 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_Node_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Node", + 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) _Node_spec(ctx context.Context, field graphql.CollectedField, obj *entities.Node) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Node_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 ec.resolvers.Node().Spec(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.GithubComKloudliteOperatorApisClustersV1NodeSpec) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___operator___apis___clusters___v1__NodeSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1NodeSpec(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Node_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Node", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "nodepoolName": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__NodeSpec_nodepoolName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___clusters___v1__NodeSpec", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Node_status(ctx context.Context, field graphql.CollectedField, obj *entities.Node) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Node_status(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Status, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(operator.Status) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___pkg___operator__Status2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Node_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Node", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "checks": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx, field) + case "isReady": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_isReady(ctx, field) + case "lastReadyGeneration": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReadyGeneration(ctx, field) + case "lastReconcileTime": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReconcileTime(ctx, field) + case "message": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_message(ctx, field) + case "resources": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_resources(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___pkg___operator__Status", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Node_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.Node) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Node_syncStatus(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SyncStatus, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(types.SyncStatus) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___pkg___types__SyncStatus2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Node_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Node", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "action": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx, field) + case "error": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx, field) + case "lastSyncedAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx, field) + case "recordVersion": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx, field) + case "state": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx, field) + case "syncScheduledAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___pkg___types__SyncStatus", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Node_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.Node) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Node_updateTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Node().UpdateTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Node_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Node", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _NodeEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.NodeEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodeEdge_cursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NodeEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodeEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _NodeEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.NodeEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodeEdge_node(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*entities.Node) + fc.Result = res + return ec.marshalNNode2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐNode(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NodeEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodeEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accountName": + return ec.fieldContext_Node_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Node_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_Node_clusterName(ctx, field) + case "creationTime": + return ec.fieldContext_Node_creationTime(ctx, field) + case "id": + return ec.fieldContext_Node_id(ctx, field) + case "kind": + return ec.fieldContext_Node_kind(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Node_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Node_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_Node_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_Node_spec(ctx, field) + case "status": + return ec.fieldContext_Node_status(ctx, field) + case "syncStatus": + return ec.fieldContext_Node_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_Node_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Node", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _NodePaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.NodePaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodePaginatedRecords_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.NodeEdge) + fc.Result = res + return ec.marshalNNodeEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐNodeEdgeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NodePaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodePaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cursor": + return ec.fieldContext_NodeEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_NodeEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type NodeEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _NodePaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.NodePaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodePaginatedRecords_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.PageInfo) + fc.Result = res + return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NodePaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodePaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _NodePaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.NodePaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodePaginatedRecords_totalCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalCount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NodePaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodePaginatedRecords", + 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) _NodePool_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.NodePool) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodePool_accountName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_NodePool_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodePool", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _NodePool_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.NodePool) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodePool_apiVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.APIVersion, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NodePool_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodePool", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _NodePool_clusterName(ctx context.Context, field graphql.CollectedField, obj *entities.NodePool) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodePool_clusterName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ClusterName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_NodePool_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodePool", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _NodePool_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.NodePool) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodePool_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NodePool_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodePool", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _NodePool_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.NodePool) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodePool_creationTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.NodePool().CreationTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NodePool_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodePool", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _NodePool_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.NodePool) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodePool_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_NodePool_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodePool", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _NodePool_id(ctx context.Context, field graphql.CollectedField, obj *entities.NodePool) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodePool_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 ec.resolvers.NodePool().ID(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_NodePool_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodePool", + 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) _NodePool_kind(ctx context.Context, field graphql.CollectedField, obj *entities.NodePool) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodePool_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NodePool_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodePool", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _NodePool_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.NodePool) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodePool_lastUpdatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastUpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NodePool_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodePool", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _NodePool_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.NodePool) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodePool_markedForDeletion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MarkedForDeletion, 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_NodePool_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodePool", + 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) _NodePool_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.NodePool) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodePool_metadata(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ObjectMeta, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(v1.ObjectMeta) + fc.Result = res + return ec.marshalOMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NodePool_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodePool", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "annotations": + return ec.fieldContext_Metadata_annotations(ctx, field) + case "creationTimestamp": + return ec.fieldContext_Metadata_creationTimestamp(ctx, field) + case "deletionTimestamp": + return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) + case "generation": + return ec.fieldContext_Metadata_generation(ctx, field) + case "labels": + return ec.fieldContext_Metadata_labels(ctx, field) + case "name": + return ec.fieldContext_Metadata_name(ctx, field) + case "namespace": + return ec.fieldContext_Metadata_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _NodePool_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.NodePool) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodePool_recordVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RecordVersion, nil + }) + if err != nil { + ec.Error(ctx, 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_NodePool_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodePool", + 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) _NodePool_spec(ctx context.Context, field graphql.CollectedField, obj *entities.NodePool) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodePool_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 ec.resolvers.NodePool().Spec(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.GithubComKloudliteOperatorApisClustersV1NodePoolSpec) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1NodePoolSpec(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NodePool_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodePool", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "aws": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_aws(ctx, field) + case "cloudProvider": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_cloudProvider(ctx, field) + case "iac": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_iac(ctx, field) + case "maxCount": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_maxCount(ctx, field) + case "minCount": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_minCount(ctx, field) + case "nodeLabels": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_nodeLabels(ctx, field) + case "nodeTaints": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_nodeTaints(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _NodePool_status(ctx context.Context, field graphql.CollectedField, obj *entities.NodePool) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodePool_status(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Status, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(operator.Status) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___pkg___operator__Status2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NodePool_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodePool", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "checks": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx, field) + case "isReady": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_isReady(ctx, field) + case "lastReadyGeneration": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReadyGeneration(ctx, field) + case "lastReconcileTime": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReconcileTime(ctx, field) + case "message": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_message(ctx, field) + case "resources": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_resources(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___pkg___operator__Status", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _NodePool_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.NodePool) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodePool_syncStatus(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SyncStatus, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(types.SyncStatus) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___pkg___types__SyncStatus2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NodePool_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodePool", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "action": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx, field) + case "error": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx, field) + case "lastSyncedAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx, field) + case "recordVersion": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx, field) + case "state": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx, field) + case "syncScheduledAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___pkg___types__SyncStatus", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _NodePool_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.NodePool) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodePool_updateTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.NodePool().UpdateTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NodePool_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodePool", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _NodePoolEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.NodePoolEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodePoolEdge_cursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NodePoolEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodePoolEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _NodePoolEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.NodePoolEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodePoolEdge_node(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*entities.NodePool) + fc.Result = res + return ec.marshalNNodePool2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐNodePool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NodePoolEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodePoolEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accountName": + return ec.fieldContext_NodePool_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_NodePool_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_NodePool_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_NodePool_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_NodePool_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_NodePool_displayName(ctx, field) + case "id": + return ec.fieldContext_NodePool_id(ctx, field) + case "kind": + return ec.fieldContext_NodePool_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_NodePool_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_NodePool_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_NodePool_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_NodePool_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_NodePool_spec(ctx, field) + case "status": + return ec.fieldContext_NodePool_status(ctx, field) + case "syncStatus": + return ec.fieldContext_NodePool_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_NodePool_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type NodePool", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _NodePoolPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.NodePoolPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodePoolPaginatedRecords_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.NodePoolEdge) + fc.Result = res + return ec.marshalNNodePoolEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐNodePoolEdgeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NodePoolPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodePoolPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cursor": + return ec.fieldContext_NodePoolEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_NodePoolEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type NodePoolEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _NodePoolPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.NodePoolPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodePoolPaginatedRecords_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.PageInfo) + fc.Result = res + return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NodePoolPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodePoolPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _NodePoolPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.NodePoolPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodePoolPaginatedRecords_totalCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalCount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NodePoolPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodePoolPaginatedRecords", + 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) _PageInfo_endCursor(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_endCursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.EndCursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PageInfo_endCursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PageInfo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_hasNextPage(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.HasNextPage, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*bool) + fc.Result = res + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PageInfo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.HasPreviousPage, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*bool) + fc.Result = res + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PageInfo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_startCursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.StartCursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PageInfo_startCursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PageInfo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolume_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolume) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolume_accountName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_PersistentVolume_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolume", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolume_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolume) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolume_apiVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.APIVersion, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolume_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolume", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolume_clusterName(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolume) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolume_clusterName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ClusterName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_PersistentVolume_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolume", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolume_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolume) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolume_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolume_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolume", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolume_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolume) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolume_creationTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.PersistentVolume().CreationTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolume_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolume", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolume_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolume) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolume_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_PersistentVolume_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolume", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolume_id(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolume) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolume_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 ec.resolvers.PersistentVolume().ID(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_PersistentVolume_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolume", + 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) _PersistentVolume_kind(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolume) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolume_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolume_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolume", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolume_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolume) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolume_lastUpdatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastUpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolume_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolume", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolume_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolume) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolume_markedForDeletion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MarkedForDeletion, 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_PersistentVolume_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolume", + 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) _PersistentVolume_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolume) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolume_metadata(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ObjectMeta, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(v1.ObjectMeta) + fc.Result = res + return ec.marshalOMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolume_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolume", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "annotations": + return ec.fieldContext_Metadata_annotations(ctx, field) + case "creationTimestamp": + return ec.fieldContext_Metadata_creationTimestamp(ctx, field) + case "deletionTimestamp": + return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) + case "generation": + return ec.fieldContext_Metadata_generation(ctx, field) + case "labels": + return ec.fieldContext_Metadata_labels(ctx, field) + case "name": + return ec.fieldContext_Metadata_name(ctx, field) + case "namespace": + return ec.fieldContext_Metadata_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolume_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolume) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolume_recordVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RecordVersion, nil + }) + if err != nil { + ec.Error(ctx, 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_PersistentVolume_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolume", + 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) _PersistentVolume_spec(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolume) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolume_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 ec.resolvers.PersistentVolume().Spec(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1PersistentVolumeSpec) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__PersistentVolumeSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeSpec(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolume_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolume", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accessModes": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_accessModes(ctx, field) + case "awsElasticBlockStore": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_awsElasticBlockStore(ctx, field) + case "azureDisk": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_azureDisk(ctx, field) + case "azureFile": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_azureFile(ctx, field) + case "capacity": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_capacity(ctx, field) + case "cephfs": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_cephfs(ctx, field) + case "cinder": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_cinder(ctx, field) + case "claimRef": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_claimRef(ctx, field) + case "csi": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_csi(ctx, field) + case "fc": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_fc(ctx, field) + case "flexVolume": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_flexVolume(ctx, field) + case "flocker": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_flocker(ctx, field) + case "gcePersistentDisk": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_gcePersistentDisk(ctx, field) + case "glusterfs": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_glusterfs(ctx, field) + case "hostPath": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_hostPath(ctx, field) + case "iscsi": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_iscsi(ctx, field) + case "local": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_local(ctx, field) + case "mountOptions": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_mountOptions(ctx, field) + case "nfs": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_nfs(ctx, field) + case "nodeAffinity": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_nodeAffinity(ctx, field) + case "persistentVolumeReclaimPolicy": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_persistentVolumeReclaimPolicy(ctx, field) + case "photonPersistentDisk": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_photonPersistentDisk(ctx, field) + case "portworxVolume": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_portworxVolume(ctx, field) + case "quobyte": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_quobyte(ctx, field) + case "rbd": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_rbd(ctx, field) + case "scaleIO": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_scaleIO(ctx, field) + case "storageClassName": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_storageClassName(ctx, field) + case "storageos": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_storageos(ctx, field) + case "volumeMode": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_volumeMode(ctx, field) + case "vsphereVolume": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_vsphereVolume(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__PersistentVolumeSpec", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolume_status(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolume) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolume_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 ec.resolvers.PersistentVolume().Status(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1PersistentVolumeStatus) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__PersistentVolumeStatus2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolume_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolume", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "lastPhaseTransitionTime": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeStatus_lastPhaseTransitionTime(ctx, field) + case "message": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeStatus_message(ctx, field) + case "phase": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeStatus_phase(ctx, field) + case "reason": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeStatus_reason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__PersistentVolumeStatus", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolume_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolume) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolume_syncStatus(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SyncStatus, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(types.SyncStatus) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___pkg___types__SyncStatus2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolume_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolume", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "action": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx, field) + case "error": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx, field) + case "lastSyncedAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx, field) + case "recordVersion": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx, field) + case "state": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx, field) + case "syncScheduledAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___pkg___types__SyncStatus", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolume_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolume) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolume_updateTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.PersistentVolume().UpdateTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolume_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolume", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolumeClaim_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolumeClaim) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolumeClaim_accountName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_PersistentVolumeClaim_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolumeClaim", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolumeClaim_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolumeClaim) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolumeClaim_apiVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.APIVersion, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolumeClaim_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolumeClaim", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolumeClaim_clusterName(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolumeClaim) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolumeClaim_clusterName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ClusterName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_PersistentVolumeClaim_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolumeClaim", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolumeClaim_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolumeClaim) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolumeClaim_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolumeClaim_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolumeClaim", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolumeClaim_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolumeClaim) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolumeClaim_creationTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.PersistentVolumeClaim().CreationTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolumeClaim_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolumeClaim", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolumeClaim_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolumeClaim) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolumeClaim_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_PersistentVolumeClaim_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolumeClaim", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolumeClaim_id(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolumeClaim) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolumeClaim_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 ec.resolvers.PersistentVolumeClaim().ID(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_PersistentVolumeClaim_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolumeClaim", + 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) _PersistentVolumeClaim_kind(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolumeClaim) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolumeClaim_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolumeClaim_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolumeClaim", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolumeClaim_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolumeClaim) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolumeClaim_lastUpdatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastUpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolumeClaim_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolumeClaim", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolumeClaim_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolumeClaim) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolumeClaim_markedForDeletion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MarkedForDeletion, 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_PersistentVolumeClaim_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolumeClaim", + 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) _PersistentVolumeClaim_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolumeClaim) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolumeClaim_metadata(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ObjectMeta, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(v1.ObjectMeta) + fc.Result = res + return ec.marshalOMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolumeClaim_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolumeClaim", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "annotations": + return ec.fieldContext_Metadata_annotations(ctx, field) + case "creationTimestamp": + return ec.fieldContext_Metadata_creationTimestamp(ctx, field) + case "deletionTimestamp": + return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) + case "generation": + return ec.fieldContext_Metadata_generation(ctx, field) + case "labels": + return ec.fieldContext_Metadata_labels(ctx, field) + case "name": + return ec.fieldContext_Metadata_name(ctx, field) + case "namespace": + return ec.fieldContext_Metadata_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolumeClaim_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolumeClaim) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolumeClaim_recordVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RecordVersion, nil + }) + if err != nil { + ec.Error(ctx, 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_PersistentVolumeClaim_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolumeClaim", + 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) _PersistentVolumeClaim_spec(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolumeClaim) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolumeClaim_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 ec.resolvers.PersistentVolumeClaim().Spec(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1PersistentVolumeClaimSpec) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__PersistentVolumeClaimSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeClaimSpec(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolumeClaim_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolumeClaim", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accessModes": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimSpec_accessModes(ctx, field) + case "dataSource": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimSpec_dataSource(ctx, field) + case "dataSourceRef": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimSpec_dataSourceRef(ctx, field) + case "resources": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimSpec_resources(ctx, field) + case "selector": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimSpec_selector(ctx, field) + case "storageClassName": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimSpec_storageClassName(ctx, field) + case "volumeMode": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimSpec_volumeMode(ctx, field) + case "volumeName": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimSpec_volumeName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__PersistentVolumeClaimSpec", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolumeClaim_status(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolumeClaim) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolumeClaim_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 ec.resolvers.PersistentVolumeClaim().Status(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1PersistentVolumeClaimStatus) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__PersistentVolumeClaimStatus2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeClaimStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolumeClaim_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolumeClaim", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accessModes": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimStatus_accessModes(ctx, field) + case "allocatedResources": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimStatus_allocatedResources(ctx, field) + case "allocatedResourceStatuses": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimStatus_allocatedResourceStatuses(ctx, field) + case "capacity": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimStatus_capacity(ctx, field) + case "conditions": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimStatus_conditions(ctx, field) + case "phase": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimStatus_phase(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__PersistentVolumeClaimStatus", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolumeClaim_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolumeClaim) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolumeClaim_syncStatus(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SyncStatus, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(types.SyncStatus) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___pkg___types__SyncStatus2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolumeClaim_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolumeClaim", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "action": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx, field) + case "error": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx, field) + case "lastSyncedAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx, field) + case "recordVersion": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx, field) + case "state": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx, field) + case "syncScheduledAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___pkg___types__SyncStatus", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolumeClaim_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.PersistentVolumeClaim) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolumeClaim_updateTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.PersistentVolumeClaim().UpdateTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolumeClaim_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolumeClaim", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolumeClaimEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.PersistentVolumeClaimEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolumeClaimEdge_cursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolumeClaimEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolumeClaimEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolumeClaimEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.PersistentVolumeClaimEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolumeClaimEdge_node(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*entities.PersistentVolumeClaim) + fc.Result = res + return ec.marshalNPersistentVolumeClaim2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐPersistentVolumeClaim(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolumeClaimEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolumeClaimEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accountName": + return ec.fieldContext_PersistentVolumeClaim_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_PersistentVolumeClaim_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_PersistentVolumeClaim_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_PersistentVolumeClaim_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_PersistentVolumeClaim_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_PersistentVolumeClaim_displayName(ctx, field) + case "id": + return ec.fieldContext_PersistentVolumeClaim_id(ctx, field) + case "kind": + return ec.fieldContext_PersistentVolumeClaim_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_PersistentVolumeClaim_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_PersistentVolumeClaim_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_PersistentVolumeClaim_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_PersistentVolumeClaim_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_PersistentVolumeClaim_spec(ctx, field) + case "status": + return ec.fieldContext_PersistentVolumeClaim_status(ctx, field) + case "syncStatus": + return ec.fieldContext_PersistentVolumeClaim_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_PersistentVolumeClaim_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PersistentVolumeClaim", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolumeClaimPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.PersistentVolumeClaimPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolumeClaimPaginatedRecords_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.PersistentVolumeClaimEdge) + fc.Result = res + return ec.marshalNPersistentVolumeClaimEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐPersistentVolumeClaimEdgeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolumeClaimPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolumeClaimPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cursor": + return ec.fieldContext_PersistentVolumeClaimEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_PersistentVolumeClaimEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PersistentVolumeClaimEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolumeClaimPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.PersistentVolumeClaimPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolumeClaimPaginatedRecords_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.PageInfo) + fc.Result = res + return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolumeClaimPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolumeClaimPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolumeClaimPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.PersistentVolumeClaimPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolumeClaimPaginatedRecords_totalCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalCount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolumeClaimPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolumeClaimPaginatedRecords", + 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) _PersistentVolumeEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.PersistentVolumeEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolumeEdge_cursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolumeEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolumeEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolumeEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.PersistentVolumeEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolumeEdge_node(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*entities.PersistentVolume) + fc.Result = res + return ec.marshalNPersistentVolume2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐPersistentVolume(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolumeEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolumeEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accountName": + return ec.fieldContext_PersistentVolume_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_PersistentVolume_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_PersistentVolume_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_PersistentVolume_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_PersistentVolume_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_PersistentVolume_displayName(ctx, field) + case "id": + return ec.fieldContext_PersistentVolume_id(ctx, field) + case "kind": + return ec.fieldContext_PersistentVolume_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_PersistentVolume_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_PersistentVolume_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_PersistentVolume_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_PersistentVolume_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_PersistentVolume_spec(ctx, field) + case "status": + return ec.fieldContext_PersistentVolume_status(ctx, field) + case "syncStatus": + return ec.fieldContext_PersistentVolume_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_PersistentVolume_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PersistentVolume", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolumePaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.PersistentVolumePaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolumePaginatedRecords_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.PersistentVolumeEdge) + fc.Result = res + return ec.marshalNPersistentVolumeEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐPersistentVolumeEdgeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolumePaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolumePaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cursor": + return ec.fieldContext_PersistentVolumeEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_PersistentVolumeEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PersistentVolumeEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolumePaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.PersistentVolumePaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolumePaginatedRecords_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.PageInfo) + fc.Result = res + return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolumePaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolumePaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PersistentVolumePaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.PersistentVolumePaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersistentVolumePaginatedRecords_totalCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalCount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersistentVolumePaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersistentVolumePaginatedRecords", + 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) _Query_infra_checkNameAvailability(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_infra_checkNameAvailability(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().InfraCheckNameAvailability(rctx, fc.Args["resType"].(domain.ResType), fc.Args["clusterName"].(*string), fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedIn == nil { + return nil, errors.New("directive isLoggedIn is not implemented") + } + return ec.directives.IsLoggedIn(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*domain.CheckNameAvailabilityOutput); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/domain.CheckNameAvailabilityOutput`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*domain.CheckNameAvailabilityOutput) + fc.Result = res + return ec.marshalNCheckNameAvailabilityOutput2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋdomainᚐCheckNameAvailabilityOutput(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_infra_checkNameAvailability(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 "result": + return ec.fieldContext_CheckNameAvailabilityOutput_result(ctx, field) + case "suggestedNames": + return ec.fieldContext_CheckNameAvailabilityOutput_suggestedNames(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type CheckNameAvailabilityOutput", field.Name) + }, + } + defer func() { + if 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_infra_checkNameAvailability_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_infra_listClusters(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_infra_listClusters(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().InfraListClusters(rctx, fc.Args["search"].(*model.SearchCluster), fc.Args["pagination"].(*repos.CursorPagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.ClusterPaginatedRecords); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/app/graph/model.ClusterPaginatedRecords`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.ClusterPaginatedRecords) + fc.Result = res + return ec.marshalOClusterPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐClusterPaginatedRecords(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_infra_listClusters(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_ClusterPaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_ClusterPaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_ClusterPaginatedRecords_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ClusterPaginatedRecords", field.Name) + }, + } + defer func() { + if 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_infra_listClusters_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_infra_getCluster(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_infra_getCluster(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().InfraGetCluster(rctx, fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Cluster); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/entities.Cluster`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.Cluster) + fc.Result = res + return ec.marshalOCluster2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐCluster(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_infra_getCluster(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 "accountName": + return ec.fieldContext_Cluster_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Cluster_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_Cluster_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Cluster_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_Cluster_displayName(ctx, field) + case "id": + return ec.fieldContext_Cluster_id(ctx, field) + case "kind": + return ec.fieldContext_Cluster_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Cluster_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Cluster_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Cluster_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_Cluster_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_Cluster_spec(ctx, field) + case "status": + return ec.fieldContext_Cluster_status(ctx, field) + case "syncStatus": + return ec.fieldContext_Cluster_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_Cluster_updateTime(ctx, field) + case "adminKubeconfig": + return ec.fieldContext_Cluster_adminKubeconfig(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Cluster", field.Name) + }, + } + defer func() { + if 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_infra_getCluster_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_infra_listNodePools(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_infra_listNodePools(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().InfraListNodePools(rctx, fc.Args["clusterName"].(string), fc.Args["search"].(*model.SearchNodepool), fc.Args["pagination"].(*repos.CursorPagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.NodePoolPaginatedRecords); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/app/graph/model.NodePoolPaginatedRecords`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.NodePoolPaginatedRecords) + fc.Result = res + return ec.marshalONodePoolPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐNodePoolPaginatedRecords(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_infra_listNodePools(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_NodePoolPaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_NodePoolPaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_NodePoolPaginatedRecords_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type NodePoolPaginatedRecords", field.Name) + }, + } + defer func() { + if 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_infra_listNodePools_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_infra_getNodePool(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_infra_getNodePool(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().InfraGetNodePool(rctx, fc.Args["clusterName"].(string), fc.Args["poolName"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.NodePool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/entities.NodePool`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.NodePool) + fc.Result = res + return ec.marshalONodePool2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐNodePool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_infra_getNodePool(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 "accountName": + return ec.fieldContext_NodePool_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_NodePool_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_NodePool_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_NodePool_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_NodePool_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_NodePool_displayName(ctx, field) + case "id": + return ec.fieldContext_NodePool_id(ctx, field) + case "kind": + return ec.fieldContext_NodePool_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_NodePool_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_NodePool_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_NodePool_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_NodePool_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_NodePool_spec(ctx, field) + case "status": + return ec.fieldContext_NodePool_status(ctx, field) + case "syncStatus": + return ec.fieldContext_NodePool_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_NodePool_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type NodePool", field.Name) + }, + } + defer func() { + if 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_infra_getNodePool_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_infra_listProviderSecrets(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_infra_listProviderSecrets(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().InfraListProviderSecrets(rctx, fc.Args["search"].(*model.SearchProviderSecret), fc.Args["pagination"].(*repos.CursorPagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.CloudProviderSecretPaginatedRecords); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/app/graph/model.CloudProviderSecretPaginatedRecords`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.CloudProviderSecretPaginatedRecords) + fc.Result = res + return ec.marshalOCloudProviderSecretPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐCloudProviderSecretPaginatedRecords(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_infra_listProviderSecrets(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_CloudProviderSecretPaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_CloudProviderSecretPaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_CloudProviderSecretPaginatedRecords_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type CloudProviderSecretPaginatedRecords", field.Name) + }, + } + defer func() { + if 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_infra_listProviderSecrets_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_infra_getProviderSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_infra_getProviderSecret(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().InfraGetProviderSecret(rctx, fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.CloudProviderSecret); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/entities.CloudProviderSecret`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.CloudProviderSecret) + fc.Result = res + return ec.marshalOCloudProviderSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐCloudProviderSecret(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_infra_getProviderSecret(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 "accountName": + return ec.fieldContext_CloudProviderSecret_accountName(ctx, field) + case "aws": + return ec.fieldContext_CloudProviderSecret_aws(ctx, field) + case "cloudProviderName": + return ec.fieldContext_CloudProviderSecret_cloudProviderName(ctx, field) + case "createdBy": + return ec.fieldContext_CloudProviderSecret_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_CloudProviderSecret_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_CloudProviderSecret_displayName(ctx, field) + case "id": + return ec.fieldContext_CloudProviderSecret_id(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_CloudProviderSecret_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_CloudProviderSecret_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_CloudProviderSecret_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_CloudProviderSecret_recordVersion(ctx, field) + case "updateTime": + return ec.fieldContext_CloudProviderSecret_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type CloudProviderSecret", field.Name) + }, + } + defer func() { + if 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_infra_getProviderSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_infra_listDomainEntries(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_infra_listDomainEntries(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().InfraListDomainEntries(rctx, fc.Args["search"].(*model.SearchDomainEntry), fc.Args["pagination"].(*repos.CursorPagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.DomainEntryPaginatedRecords); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/app/graph/model.DomainEntryPaginatedRecords`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.DomainEntryPaginatedRecords) + fc.Result = res + return ec.marshalODomainEntryPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐDomainEntryPaginatedRecords(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_infra_listDomainEntries(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_DomainEntryPaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_DomainEntryPaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_DomainEntryPaginatedRecords_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DomainEntryPaginatedRecords", field.Name) + }, + } + defer func() { + if 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_infra_listDomainEntries_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_infra_getDomainEntry(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_infra_getDomainEntry(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().InfraGetDomainEntry(rctx, fc.Args["domainName"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.DomainEntry); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/entities.DomainEntry`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.DomainEntry) + fc.Result = res + return ec.marshalODomainEntry2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐDomainEntry(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_infra_getDomainEntry(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 "accountName": + return ec.fieldContext_DomainEntry_accountName(ctx, field) + case "clusterName": + return ec.fieldContext_DomainEntry_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_DomainEntry_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_DomainEntry_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_DomainEntry_displayName(ctx, field) + case "domainName": + return ec.fieldContext_DomainEntry_domainName(ctx, field) + case "id": + return ec.fieldContext_DomainEntry_id(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_DomainEntry_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_DomainEntry_markedForDeletion(ctx, field) + case "recordVersion": + return ec.fieldContext_DomainEntry_recordVersion(ctx, field) + case "updateTime": + return ec.fieldContext_DomainEntry_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DomainEntry", field.Name) + }, + } + defer func() { + if 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_infra_getDomainEntry_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_infra_checkAwsAccess(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_infra_checkAwsAccess(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().InfraCheckAwsAccess(rctx, fc.Args["cloudproviderName"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.CheckAwsAccessOutput); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/app/graph/model.CheckAwsAccessOutput`, tmp) + }) + if err != nil { + ec.Error(ctx, 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.CheckAwsAccessOutput) + fc.Result = res + return ec.marshalNCheckAwsAccessOutput2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐCheckAwsAccessOutput(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_infra_checkAwsAccess(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 "result": + return ec.fieldContext_CheckAwsAccessOutput_result(ctx, field) + case "installationUrl": + return ec.fieldContext_CheckAwsAccessOutput_installationUrl(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type CheckAwsAccessOutput", field.Name) + }, + } + defer func() { + if 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_infra_checkAwsAccess_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_infra_listClusterManagedServices(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_infra_listClusterManagedServices(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().InfraListClusterManagedServices(rctx, fc.Args["clusterName"].(string), fc.Args["search"].(*model.SearchClusterManagedService), fc.Args["pagination"].(*repos.CursorPagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.ClusterManagedServicePaginatedRecords); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/app/graph/model.ClusterManagedServicePaginatedRecords`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.ClusterManagedServicePaginatedRecords) + fc.Result = res + return ec.marshalOClusterManagedServicePaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐClusterManagedServicePaginatedRecords(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_infra_listClusterManagedServices(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_ClusterManagedServicePaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_ClusterManagedServicePaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_ClusterManagedServicePaginatedRecords_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ClusterManagedServicePaginatedRecords", field.Name) + }, + } + defer func() { + if 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_infra_listClusterManagedServices_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_infra_getClusterManagedService(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_infra_getClusterManagedService(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().InfraGetClusterManagedService(rctx, fc.Args["clusterName"].(string), fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.ClusterManagedService); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/entities.ClusterManagedService`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.ClusterManagedService) + fc.Result = res + return ec.marshalOClusterManagedService2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐClusterManagedService(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_infra_getClusterManagedService(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 "accountName": + return ec.fieldContext_ClusterManagedService_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_ClusterManagedService_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_ClusterManagedService_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_ClusterManagedService_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_ClusterManagedService_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_ClusterManagedService_displayName(ctx, field) + case "id": + return ec.fieldContext_ClusterManagedService_id(ctx, field) + case "kind": + return ec.fieldContext_ClusterManagedService_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_ClusterManagedService_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_ClusterManagedService_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_ClusterManagedService_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_ClusterManagedService_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_ClusterManagedService_spec(ctx, field) + case "status": + return ec.fieldContext_ClusterManagedService_status(ctx, field) + case "syncStatus": + return ec.fieldContext_ClusterManagedService_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_ClusterManagedService_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ClusterManagedService", field.Name) + }, + } + defer func() { + if 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_infra_getClusterManagedService_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_infra_listHelmReleases(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_infra_listHelmReleases(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().InfraListHelmReleases(rctx, fc.Args["clusterName"].(string), fc.Args["search"].(*model.SearchHelmRelease), fc.Args["pagination"].(*repos.CursorPagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.HelmReleasePaginatedRecords); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/app/graph/model.HelmReleasePaginatedRecords`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.HelmReleasePaginatedRecords) + fc.Result = res + return ec.marshalOHelmReleasePaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐHelmReleasePaginatedRecords(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_infra_listHelmReleases(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_HelmReleasePaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_HelmReleasePaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_HelmReleasePaginatedRecords_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type HelmReleasePaginatedRecords", field.Name) + }, + } + defer func() { + if 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_infra_listHelmReleases_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_infra_getHelmRelease(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_infra_getHelmRelease(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().InfraGetHelmRelease(rctx, fc.Args["clusterName"].(string), fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.HelmRelease); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/entities.HelmRelease`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.HelmRelease) + fc.Result = res + return ec.marshalOHelmRelease2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐHelmRelease(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_infra_getHelmRelease(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 "accountName": + return ec.fieldContext_HelmRelease_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_HelmRelease_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_HelmRelease_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_HelmRelease_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_HelmRelease_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_HelmRelease_displayName(ctx, field) + case "id": + return ec.fieldContext_HelmRelease_id(ctx, field) + case "kind": + return ec.fieldContext_HelmRelease_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_HelmRelease_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_HelmRelease_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_HelmRelease_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_HelmRelease_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_HelmRelease_spec(ctx, field) + case "status": + return ec.fieldContext_HelmRelease_status(ctx, field) + case "syncStatus": + return ec.fieldContext_HelmRelease_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_HelmRelease_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type HelmRelease", field.Name) + }, + } + defer func() { + if 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_infra_getHelmRelease_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_infra_listManagedServiceTemplates(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_infra_listManagedServiceTemplates(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.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().InfraListManagedServiceTemplates(rctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*entities.MsvcTemplate) + fc.Result = res + return ec.marshalOMsvcTemplate2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐMsvcTemplateᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_infra_listManagedServiceTemplates(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 "category": + return ec.fieldContext_MsvcTemplate_category(ctx, field) + case "displayName": + return ec.fieldContext_MsvcTemplate_displayName(ctx, field) + case "items": + return ec.fieldContext_MsvcTemplate_items(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type MsvcTemplate", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_infra_getManagedServiceTemplate(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_infra_getManagedServiceTemplate(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.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().InfraGetManagedServiceTemplate(rctx, fc.Args["category"].(string), fc.Args["name"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.MsvcTemplateEntry) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐMsvcTemplateEntry(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_infra_getManagedServiceTemplate(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 "active": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_active(ctx, field) + case "apiVersion": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_apiVersion(ctx, field) + case "description": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_description(ctx, field) + case "displayName": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_displayName(ctx, field) + case "fields": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_fields(ctx, field) + case "kind": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_kind(ctx, field) + case "logoUrl": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_logoUrl(ctx, field) + case "name": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_name(ctx, field) + case "outputs": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_outputs(ctx, field) + case "resources": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_resources(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry", field.Name) + }, + } + defer func() { + if 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_infra_getManagedServiceTemplate_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_infra_listPVCs(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_infra_listPVCs(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().InfraListPVCs(rctx, fc.Args["clusterName"].(string), fc.Args["search"].(*model.SearchPersistentVolumeClaims), fc.Args["pq"].(*repos.CursorPagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.PersistentVolumeClaimPaginatedRecords); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/app/graph/model.PersistentVolumeClaimPaginatedRecords`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.PersistentVolumeClaimPaginatedRecords) + fc.Result = res + return ec.marshalOPersistentVolumeClaimPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐPersistentVolumeClaimPaginatedRecords(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_infra_listPVCs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_PersistentVolumeClaimPaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_PersistentVolumeClaimPaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_PersistentVolumeClaimPaginatedRecords_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PersistentVolumeClaimPaginatedRecords", field.Name) + }, + } + defer func() { + if 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_infra_listPVCs_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_infra_getPVC(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_infra_getPVC(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().InfraGetPvc(rctx, fc.Args["clusterName"].(string), fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.PersistentVolumeClaim); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/entities.PersistentVolumeClaim`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.PersistentVolumeClaim) + fc.Result = res + return ec.marshalOPersistentVolumeClaim2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐPersistentVolumeClaim(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_infra_getPVC(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 "accountName": + return ec.fieldContext_PersistentVolumeClaim_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_PersistentVolumeClaim_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_PersistentVolumeClaim_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_PersistentVolumeClaim_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_PersistentVolumeClaim_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_PersistentVolumeClaim_displayName(ctx, field) + case "id": + return ec.fieldContext_PersistentVolumeClaim_id(ctx, field) + case "kind": + return ec.fieldContext_PersistentVolumeClaim_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_PersistentVolumeClaim_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_PersistentVolumeClaim_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_PersistentVolumeClaim_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_PersistentVolumeClaim_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_PersistentVolumeClaim_spec(ctx, field) + case "status": + return ec.fieldContext_PersistentVolumeClaim_status(ctx, field) + case "syncStatus": + return ec.fieldContext_PersistentVolumeClaim_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_PersistentVolumeClaim_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PersistentVolumeClaim", field.Name) + }, + } + defer func() { + if 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_infra_getPVC_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_infra_listNamespaces(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_infra_listNamespaces(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().InfraListNamespaces(rctx, fc.Args["clusterName"].(string), fc.Args["search"].(*model.SearchNamespaces), fc.Args["pq"].(*repos.CursorPagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.NamespacePaginatedRecords); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/app/graph/model.NamespacePaginatedRecords`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.NamespacePaginatedRecords) + fc.Result = res + return ec.marshalONamespacePaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐNamespacePaginatedRecords(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_infra_listNamespaces(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_NamespacePaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_NamespacePaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_NamespacePaginatedRecords_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type NamespacePaginatedRecords", field.Name) + }, + } + defer func() { + if 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_infra_listNamespaces_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_infra_getNamespace(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_infra_getNamespace(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().InfraGetNamespace(rctx, fc.Args["clusterName"].(string), fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Namespace); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/entities.Namespace`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.Namespace) + fc.Result = res + return ec.marshalONamespace2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐNamespace(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_infra_getNamespace(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 "accountName": + return ec.fieldContext_Namespace_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Namespace_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_Namespace_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_Namespace_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Namespace_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_Namespace_displayName(ctx, field) + case "id": + return ec.fieldContext_Namespace_id(ctx, field) + case "kind": + return ec.fieldContext_Namespace_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Namespace_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Namespace_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Namespace_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_Namespace_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_Namespace_spec(ctx, field) + case "status": + return ec.fieldContext_Namespace_status(ctx, field) + case "syncStatus": + return ec.fieldContext_Namespace_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_Namespace_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Namespace", field.Name) + }, + } + defer func() { + if 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_infra_getNamespace_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_infra_listPVs(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_infra_listPVs(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().InfraListPVs(rctx, fc.Args["clusterName"].(string), fc.Args["search"].(*model.SearchPersistentVolumes), fc.Args["pq"].(*repos.CursorPagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.PersistentVolumePaginatedRecords); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/app/graph/model.PersistentVolumePaginatedRecords`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.PersistentVolumePaginatedRecords) + fc.Result = res + return ec.marshalOPersistentVolumePaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐPersistentVolumePaginatedRecords(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_infra_listPVs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_PersistentVolumePaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_PersistentVolumePaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_PersistentVolumePaginatedRecords_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PersistentVolumePaginatedRecords", field.Name) + }, + } + defer func() { + if 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_infra_listPVs_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_infra_getPV(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_infra_getPV(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().InfraGetPv(rctx, fc.Args["clusterName"].(string), fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.PersistentVolume); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/entities.PersistentVolume`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.PersistentVolume) + fc.Result = res + return ec.marshalOPersistentVolume2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐPersistentVolume(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_infra_getPV(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 "accountName": + return ec.fieldContext_PersistentVolume_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_PersistentVolume_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_PersistentVolume_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_PersistentVolume_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_PersistentVolume_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_PersistentVolume_displayName(ctx, field) + case "id": + return ec.fieldContext_PersistentVolume_id(ctx, field) + case "kind": + return ec.fieldContext_PersistentVolume_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_PersistentVolume_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_PersistentVolume_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_PersistentVolume_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_PersistentVolume_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_PersistentVolume_spec(ctx, field) + case "status": + return ec.fieldContext_PersistentVolume_status(ctx, field) + case "syncStatus": + return ec.fieldContext_PersistentVolume_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_PersistentVolume_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PersistentVolume", field.Name) + }, + } + defer func() { + if 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_infra_getPV_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_infra_listVolumeAttachments(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_infra_listVolumeAttachments(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().InfraListVolumeAttachments(rctx, fc.Args["clusterName"].(string), fc.Args["search"].(*model.SearchVolumeAttachments), fc.Args["pq"].(*repos.CursorPagination)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.VolumeAttachmentPaginatedRecords); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/app/graph/model.VolumeAttachmentPaginatedRecords`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.VolumeAttachmentPaginatedRecords) + fc.Result = res + return ec.marshalOVolumeAttachmentPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐVolumeAttachmentPaginatedRecords(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_infra_listVolumeAttachments(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_VolumeAttachmentPaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_VolumeAttachmentPaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_VolumeAttachmentPaginatedRecords_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type VolumeAttachmentPaginatedRecords", field.Name) + }, + } + defer func() { + if 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_infra_listVolumeAttachments_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_infra_getVolumeAttachment(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_infra_getVolumeAttachment(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().InfraGetVolumeAttachment(rctx, fc.Args["clusterName"].(string), fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.VolumeAttachment); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/infra/internal/entities.VolumeAttachment`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.VolumeAttachment) + fc.Result = res + return ec.marshalOVolumeAttachment2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐVolumeAttachment(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_infra_getVolumeAttachment(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 "accountName": + return ec.fieldContext_VolumeAttachment_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_VolumeAttachment_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_VolumeAttachment_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_VolumeAttachment_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_VolumeAttachment_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_VolumeAttachment_displayName(ctx, field) + case "id": + return ec.fieldContext_VolumeAttachment_id(ctx, field) + case "kind": + return ec.fieldContext_VolumeAttachment_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_VolumeAttachment_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_VolumeAttachment_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_VolumeAttachment_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_VolumeAttachment_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_VolumeAttachment_spec(ctx, field) + case "status": + return ec.fieldContext_VolumeAttachment_status(ctx, field) + case "syncStatus": + return ec.fieldContext_VolumeAttachment_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_VolumeAttachment_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type VolumeAttachment", field.Name) + }, + } + defer func() { + if 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_infra_getVolumeAttachment_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query__service(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query__service(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.__resolve__service(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(fedruntime.Service) + fc.Result = res + return ec.marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query__service(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 "sdl": + return ec.fieldContext__Service_sdl(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type _Service", 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 + } + 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(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 "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) _VolumeAttachment_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.VolumeAttachment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_VolumeAttachment_accountName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_VolumeAttachment_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "VolumeAttachment", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _VolumeAttachment_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.VolumeAttachment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_VolumeAttachment_apiVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.APIVersion, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_VolumeAttachment_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "VolumeAttachment", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _VolumeAttachment_clusterName(ctx context.Context, field graphql.CollectedField, obj *entities.VolumeAttachment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_VolumeAttachment_clusterName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ClusterName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_VolumeAttachment_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "VolumeAttachment", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _VolumeAttachment_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.VolumeAttachment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_VolumeAttachment_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_VolumeAttachment_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "VolumeAttachment", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _VolumeAttachment_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.VolumeAttachment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_VolumeAttachment_creationTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.VolumeAttachment().CreationTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_VolumeAttachment_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "VolumeAttachment", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _VolumeAttachment_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.VolumeAttachment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_VolumeAttachment_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_VolumeAttachment_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "VolumeAttachment", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _VolumeAttachment_id(ctx context.Context, field graphql.CollectedField, obj *entities.VolumeAttachment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_VolumeAttachment_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 ec.resolvers.VolumeAttachment().ID(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_VolumeAttachment_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "VolumeAttachment", + 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) _VolumeAttachment_kind(ctx context.Context, field graphql.CollectedField, obj *entities.VolumeAttachment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_VolumeAttachment_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_VolumeAttachment_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "VolumeAttachment", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _VolumeAttachment_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.VolumeAttachment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_VolumeAttachment_lastUpdatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastUpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(common.CreatedOrUpdatedBy) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_VolumeAttachment_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "VolumeAttachment", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _VolumeAttachment_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.VolumeAttachment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_VolumeAttachment_markedForDeletion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MarkedForDeletion, 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_VolumeAttachment_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "VolumeAttachment", + 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) _VolumeAttachment_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.VolumeAttachment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_VolumeAttachment_metadata(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ObjectMeta, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(v1.ObjectMeta) + fc.Result = res + return ec.marshalOMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_VolumeAttachment_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "VolumeAttachment", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "annotations": + return ec.fieldContext_Metadata_annotations(ctx, field) + case "creationTimestamp": + return ec.fieldContext_Metadata_creationTimestamp(ctx, field) + case "deletionTimestamp": + return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) + case "generation": + return ec.fieldContext_Metadata_generation(ctx, field) + case "labels": + return ec.fieldContext_Metadata_labels(ctx, field) + case "name": + return ec.fieldContext_Metadata_name(ctx, field) + case "namespace": + return ec.fieldContext_Metadata_namespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _VolumeAttachment_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.VolumeAttachment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_VolumeAttachment_recordVersion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RecordVersion, nil + }) + if err != nil { + ec.Error(ctx, 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_VolumeAttachment_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "VolumeAttachment", + 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) _VolumeAttachment_spec(ctx context.Context, field graphql.CollectedField, obj *entities.VolumeAttachment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_VolumeAttachment_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 ec.resolvers.VolumeAttachment().Spec(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.K8sIoAPIStorageV1VolumeAttachmentSpec) + fc.Result = res + return ec.marshalNK8s__io___api___storage___v1__VolumeAttachmentSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPIStorageV1VolumeAttachmentSpec(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_VolumeAttachment_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "VolumeAttachment", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "attacher": + return ec.fieldContext_K8s__io___api___storage___v1__VolumeAttachmentSpec_attacher(ctx, field) + case "nodeName": + return ec.fieldContext_K8s__io___api___storage___v1__VolumeAttachmentSpec_nodeName(ctx, field) + case "source": + return ec.fieldContext_K8s__io___api___storage___v1__VolumeAttachmentSpec_source(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___storage___v1__VolumeAttachmentSpec", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _VolumeAttachment_status(ctx context.Context, field graphql.CollectedField, obj *entities.VolumeAttachment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_VolumeAttachment_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 ec.resolvers.VolumeAttachment().Status(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPIStorageV1VolumeAttachmentStatus) + fc.Result = res + return ec.marshalOK8s__io___api___storage___v1__VolumeAttachmentStatus2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPIStorageV1VolumeAttachmentStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_VolumeAttachment_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "VolumeAttachment", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "attached": + return ec.fieldContext_K8s__io___api___storage___v1__VolumeAttachmentStatus_attached(ctx, field) + case "attachError": + return ec.fieldContext_K8s__io___api___storage___v1__VolumeAttachmentStatus_attachError(ctx, field) + case "attachmentMetadata": + return ec.fieldContext_K8s__io___api___storage___v1__VolumeAttachmentStatus_attachmentMetadata(ctx, field) + case "detachError": + return ec.fieldContext_K8s__io___api___storage___v1__VolumeAttachmentStatus_detachError(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___storage___v1__VolumeAttachmentStatus", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _VolumeAttachment_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.VolumeAttachment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_VolumeAttachment_syncStatus(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SyncStatus, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(types.SyncStatus) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___api___pkg___types__SyncStatus2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_VolumeAttachment_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "VolumeAttachment", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "action": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx, field) + case "error": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx, field) + case "lastSyncedAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx, field) + case "recordVersion": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx, field) + case "state": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx, field) + case "syncScheduledAt": + return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___pkg___types__SyncStatus", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _VolumeAttachment_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.VolumeAttachment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_VolumeAttachment_updateTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.VolumeAttachment().UpdateTime(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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_VolumeAttachment_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "VolumeAttachment", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _VolumeAttachmentEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.VolumeAttachmentEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_VolumeAttachmentEdge_cursor(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_VolumeAttachmentEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "VolumeAttachmentEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _VolumeAttachmentEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.VolumeAttachmentEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_VolumeAttachmentEdge_node(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*entities.VolumeAttachment) + fc.Result = res + return ec.marshalNVolumeAttachment2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐVolumeAttachment(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_VolumeAttachmentEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "VolumeAttachmentEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accountName": + return ec.fieldContext_VolumeAttachment_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_VolumeAttachment_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_VolumeAttachment_clusterName(ctx, field) + case "createdBy": + return ec.fieldContext_VolumeAttachment_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_VolumeAttachment_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_VolumeAttachment_displayName(ctx, field) + case "id": + return ec.fieldContext_VolumeAttachment_id(ctx, field) + case "kind": + return ec.fieldContext_VolumeAttachment_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_VolumeAttachment_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_VolumeAttachment_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_VolumeAttachment_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_VolumeAttachment_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_VolumeAttachment_spec(ctx, field) + case "status": + return ec.fieldContext_VolumeAttachment_status(ctx, field) + case "syncStatus": + return ec.fieldContext_VolumeAttachment_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_VolumeAttachment_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type VolumeAttachment", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _VolumeAttachmentPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.VolumeAttachmentPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_VolumeAttachmentPaginatedRecords_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.VolumeAttachmentEdge) + fc.Result = res + return ec.marshalNVolumeAttachmentEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐVolumeAttachmentEdgeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_VolumeAttachmentPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "VolumeAttachmentPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cursor": + return ec.fieldContext_VolumeAttachmentEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_VolumeAttachmentEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type VolumeAttachmentEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _VolumeAttachmentPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.VolumeAttachmentPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_VolumeAttachmentPaginatedRecords_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.PageInfo) + fc.Result = res + return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_VolumeAttachmentPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "VolumeAttachmentPaginatedRecords", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _VolumeAttachmentPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.VolumeAttachmentPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_VolumeAttachmentPaginatedRecords_totalCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalCount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_VolumeAttachmentPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "VolumeAttachmentPaginatedRecords", + 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) __Service_sdl(ctx context.Context, field graphql.CollectedField, obj *fedruntime.Service) (ret graphql.Marshaler) { + fc, err := ec.fieldContext__Service_sdl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SDL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext__Service_sdl(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "_Service", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field 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(ctx 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(ctx 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(ctx 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(ctx 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(ctx 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(ctx 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(ctx 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(ctx 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(ctx 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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + 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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, 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(ctx 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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + 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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, 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(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_types(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Types(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_types(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_queryType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.QueryType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_queryType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_mutationType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MutationType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_mutationType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) if err != nil { return graphql.Null } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SubscriptionType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_directives(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Directives(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Directive) + fc.Result = res + return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_directives(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Directive_name(ctx, field) + case "description": + return ec.fieldContext___Directive_description(ctx, field) + case "locations": + return ec.fieldContext___Directive_locations(ctx, field) + case "args": + return ec.fieldContext___Directive_args(ctx, field) + case "isRepeatable": + return ec.fieldContext___Directive_isRepeatable(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalN__TypeKind2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __TypeKind does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_fields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Field) + fc.Result = res + return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Field_name(ctx, field) + case "description": + return ec.fieldContext___Field_description(ctx, field) + case "args": + return ec.fieldContext___Field_args(ctx, field) + case "type": + return ec.fieldContext___Field_type(ctx, field) + case "isDeprecated": + return ec.fieldContext___Field_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___Field_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_interfaces(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Interfaces(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_interfaces(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PossibleTypes(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_possibleTypes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_enumValues(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.EnumValue) + fc.Result = res + return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___EnumValue_name(ctx, field) + case "description": + return ec.fieldContext___EnumValue_description(ctx, field) + case "isDeprecated": + return ec.fieldContext___EnumValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___EnumValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_inputFields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.InputFields(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_inputFields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_ofType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OfType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_ofType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SpecifiedByURL(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +// endregion **************************** field.gotpl ***************************** + +// region **************************** input.gotpl ***************************** + +func (ec *executionContext) unmarshalInputCloudProviderSecretIn(ctx context.Context, obj interface{}) (entities.CloudProviderSecret, error) { + var it entities.CloudProviderSecret + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"aws", "cloudProviderName", "displayName", "metadata"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "aws": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("aws")) + data, err := ec.unmarshalOGithub__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentialsIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsInfraInternalEntitiesAWSSecretCredentialsIn(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.CloudProviderSecretIn().Aws(ctx, &it, data); err != nil { + return it, err + } + case "cloudProviderName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cloudProviderName")) + data, err := ec.unmarshalNGithub__com___kloudlite___operator___apis___common____types__CloudProvider2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCommonTypesCloudProvider(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.CloudProviderSecretIn().CloudProviderName(ctx, &it, data); err != nil { + return it, err + } + case "displayName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + it.DisplayName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "metadata": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalNMetadataIn2ᚖk8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.CloudProviderSecretIn().Metadata(ctx, &it, data); err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputClusterIn(ctx context.Context, obj interface{}) (entities.Cluster, error) { + var it entities.Cluster + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"apiVersion", "displayName", "kind", "metadata", "spec"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "apiVersion": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) + it.APIVersion, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "displayName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + it.DisplayName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "kind": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + it.Kind, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "metadata": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalNMetadataIn2ᚖk8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.ClusterIn().Metadata(ctx, &it, data); err != nil { + return it, err + } + case "spec": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) + data, err := ec.unmarshalNGithub__com___kloudlite___operator___apis___clusters___v1__ClusterSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1ClusterSpecIn(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.ClusterIn().Spec(ctx, &it, data); err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputClusterManagedServiceIn(ctx context.Context, obj interface{}) (entities.ClusterManagedService, error) { + var it entities.ClusterManagedService + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"apiVersion", "displayName", "kind", "metadata", "spec"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "apiVersion": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) + it.APIVersion, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "displayName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + it.DisplayName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "kind": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + it.Kind, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "metadata": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalOMetadataIn2ᚖk8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.ClusterManagedServiceIn().Metadata(ctx, &it, data); err != nil { + return it, err + } + case "spec": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) + data, err := ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ClusterManagedServiceSpecIn(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.ClusterManagedServiceIn().Spec(ctx, &it, data); err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCursorPaginationIn(ctx context.Context, obj interface{}) (repos.CursorPagination, error) { + var it repos.CursorPagination + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + if _, present := asMap["orderBy"]; !present { + asMap["orderBy"] = "_id" + } + if _, present := asMap["sortDirection"]; !present { + asMap["sortDirection"] = "ASC" + } + + fieldsInOrder := [...]string{"after", "before", "first", "last", "orderBy", "sortDirection"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "after": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + it.After, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "before": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + it.Before, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "first": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + it.First, err = ec.unmarshalOInt2ᚖint64(ctx, v) + if err != nil { + return it, err + } + case "last": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + it.Last, err = ec.unmarshalOInt2ᚖint64(ctx, v) + if err != nil { + return it, err + } + case "orderBy": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) + it.OrderBy, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "sortDirection": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sortDirection")) + it.SortDirection, err = ec.unmarshalOCursorPaginationSortDirection2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐSortDirection(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputDomainEntryIn(ctx context.Context, obj interface{}) (entities.DomainEntry, error) { + var it entities.DomainEntry + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"clusterName", "displayName", "domainName"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "clusterName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + it.ClusterName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "displayName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + it.DisplayName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "domainName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("domainName")) + it.DomainName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentialsIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteAPIAppsInfraInternalEntitiesAWSSecretCredentialsIn, error) { + var it model.GithubComKloudliteAPIAppsInfraInternalEntitiesAWSSecretCredentialsIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"accessKey", "awsAccountId", "secretKey"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "accessKey": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("accessKey")) + it.AccessKey, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "awsAccountId": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("awsAccountId")) + it.AwsAccountID, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "secretKey": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretKey")) + it.SecretKey, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfigIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisClustersV1AWSClusterConfigIn, error) { + var it model.GithubComKloudliteOperatorApisClustersV1AWSClusterConfigIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"k3sMasters", "region"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "k3sMasters": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("k3sMasters")) + it.K3sMasters, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfigIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AWSK3sMastersConfigIn(ctx, v) + if err != nil { + return it, err + } + case "region": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("region")) + it.Region, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfigIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisClustersV1AWSK3sMastersConfigIn, error) { + var it model.GithubComKloudliteOperatorApisClustersV1AWSK3sMastersConfigIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"instanceType", "nvidiaGpuEnabled"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "instanceType": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("instanceType")) + it.InstanceType, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "nvidiaGpuEnabled": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nvidiaGpuEnabled")) + it.NvidiaGpuEnabled, err = ec.unmarshalNBoolean2bool(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfigIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisClustersV1AWSNodePoolConfigIn, error) { + var it model.GithubComKloudliteOperatorApisClustersV1AWSNodePoolConfigIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"availabilityZone", "ec2Pool", "nvidiaGpuEnabled", "poolType", "spotPool"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "availabilityZone": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("availabilityZone")) + it.AvailabilityZone, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "ec2Pool": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ec2Pool")) + it.Ec2Pool, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfigIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AwsEC2PoolConfigIn(ctx, v) + if err != nil { + return it, err + } + case "nvidiaGpuEnabled": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nvidiaGpuEnabled")) + it.NvidiaGpuEnabled, err = ec.unmarshalNBoolean2bool(ctx, v) + if err != nil { + return it, err + } + case "poolType": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("poolType")) + it.PoolType, err = ec.unmarshalNGithub__com___kloudlite___operator___apis___clusters___v1__AWSPoolType2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AWSPoolType(ctx, v) + if err != nil { + return it, err + } + case "spotPool": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spotPool")) + it.SpotPool, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfigIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AwsSpotPoolConfigIn(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfigIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisClustersV1AwsEC2PoolConfigIn, error) { + var it model.GithubComKloudliteOperatorApisClustersV1AwsEC2PoolConfigIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"instanceType", "nodes"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "instanceType": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("instanceType")) + it.InstanceType, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "nodes": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nodes")) + it.Nodes, err = ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNodeIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisClustersV1AwsSpotCPUNodeIn, error) { + var it model.GithubComKloudliteOperatorApisClustersV1AwsSpotCPUNodeIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"memoryPerVcpu", "vcpu"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "memoryPerVcpu": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("memoryPerVcpu")) + it.MemoryPerVcpu, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___common____types__MinMaxFloatIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCommonTypesMinMaxFloatIn(ctx, v) + if err != nil { + return it, err + } + case "vcpu": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("vcpu")) + it.Vcpu, err = ec.unmarshalNGithub__com___kloudlite___operator___apis___common____types__MinMaxFloatIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCommonTypesMinMaxFloatIn(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNodeIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisClustersV1AwsSpotGpuNodeIn, error) { + var it model.GithubComKloudliteOperatorApisClustersV1AwsSpotGpuNodeIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"instanceTypes"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "instanceTypes": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("instanceTypes")) + it.InstanceTypes, err = ec.unmarshalNString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfigIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisClustersV1AwsSpotPoolConfigIn, error) { + var it model.GithubComKloudliteOperatorApisClustersV1AwsSpotPoolConfigIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"cpuNode", "gpuNode", "nodes"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "cpuNode": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cpuNode")) + it.CPUNode, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNodeIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AwsSpotCPUNodeIn(ctx, v) + if err != nil { + return it, err + } + case "gpuNode": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gpuNode")) + it.GpuNode, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNodeIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AwsSpotGpuNodeIn(ctx, v) + if err != nil { + return it, err + } + case "nodes": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nodes")) + it.Nodes, err = ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__ClusterSpecIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisClustersV1ClusterSpecIn, error) { + var it model.GithubComKloudliteOperatorApisClustersV1ClusterSpecIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"availabilityMode", "aws", "cloudflareEnabled", "cloudProvider", "credentialsRef"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "availabilityMode": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("availabilityMode")) + it.AvailabilityMode, err = ec.unmarshalNGithub__com___kloudlite___operator___apis___clusters___v1__ClusterSpecAvailabilityMode2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1ClusterSpecAvailabilityMode(ctx, v) + if err != nil { + return it, err + } + case "aws": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("aws")) + it.Aws, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfigIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AWSClusterConfigIn(ctx, v) + if err != nil { + return it, err + } + case "cloudflareEnabled": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cloudflareEnabled")) + it.CloudflareEnabled, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + case "cloudProvider": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cloudProvider")) + it.CloudProvider, err = ec.unmarshalNGithub__com___kloudlite___operator___apis___common____types__CloudProvider2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCommonTypesCloudProvider(ctx, v) + if err != nil { + return it, err + } + case "credentialsRef": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("credentialsRef")) + it.CredentialsRef, err = ec.unmarshalNGithub__com___kloudlite___operator___apis___common____types__SecretRefIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCommonTypesSecretRefIn(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__NodePoolSpecIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisClustersV1NodePoolSpecIn, error) { + var it model.GithubComKloudliteOperatorApisClustersV1NodePoolSpecIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"aws", "cloudProvider", "maxCount", "minCount", "nodeLabels", "nodeTaints"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "aws": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("aws")) + it.Aws, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfigIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AWSNodePoolConfigIn(ctx, v) + if err != nil { + return it, err + } + case "cloudProvider": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cloudProvider")) + it.CloudProvider, err = ec.unmarshalNGithub__com___kloudlite___operator___apis___common____types__CloudProvider2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCommonTypesCloudProvider(ctx, v) + if err != nil { + return it, err + } + case "maxCount": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("maxCount")) + it.MaxCount, err = ec.unmarshalNInt2int(ctx, v) + if err != nil { + return it, err + } + case "minCount": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("minCount")) + it.MinCount, err = ec.unmarshalNInt2int(ctx, v) + if err != nil { + return it, err + } + case "nodeLabels": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nodeLabels")) + it.NodeLabels, err = ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + case "nodeTaints": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nodeTaints")) + it.NodeTaints, err = ec.unmarshalOK8s__io___api___core___v1__TaintIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TaintInᚄ(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__NodePropsIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisClustersV1NodePropsIn, error) { + var it model.GithubComKloudliteOperatorApisClustersV1NodePropsIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"lastRecreatedAt"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "lastRecreatedAt": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastRecreatedAt")) + it.LastRecreatedAt, err = ec.unmarshalODate2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__NodeSpecIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisClustersV1NodeSpecIn, error) { + var it model.GithubComKloudliteOperatorApisClustersV1NodeSpecIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"nodepoolName"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "nodepoolName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nodepoolName")) + it.NodepoolName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___common____types__MinMaxFloatIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCommonTypesMinMaxFloatIn, error) { + var it model.GithubComKloudliteOperatorApisCommonTypesMinMaxFloatIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"max", "min"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "max": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("max")) + it.Max, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "min": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("min")) + it.Min, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___common____types__SecretRefIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCommonTypesSecretRefIn, error) { + var it model.GithubComKloudliteOperatorApisCommonTypesSecretRefIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"name", "namespace"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "name": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + it.Name, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "namespace": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) + it.Namespace, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpecIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1ClusterManagedServiceSpecIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1ClusterManagedServiceSpecIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"msvcSpec", "targetNamespace"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "msvcSpec": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("msvcSpec")) + it.MsvcSpec, err = ec.unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ManagedServiceSpecIn(ctx, v) + if err != nil { + return it, err + } + case "targetNamespace": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetNamespace")) + it.TargetNamespace, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__HelmChartSpecIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1HelmChartSpecIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1HelmChartSpecIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"chartName", "chartRepoURL", "chartVersion", "jobVars", "postInstall", "postUninstall", "preInstall", "preUninstall", "values"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "chartName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("chartName")) + it.ChartName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "chartRepoURL": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("chartRepoURL")) + it.ChartRepoURL, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "chartVersion": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("chartVersion")) + it.ChartVersion, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "jobVars": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("jobVars")) + it.JobVars, err = ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__JobVarsIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1JobVarsIn(ctx, v) + if err != nil { + return it, err + } + case "postInstall": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("postInstall")) + it.PostInstall, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "postUninstall": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("postUninstall")) + it.PostUninstall, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "preInstall": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("preInstall")) + it.PreInstall, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "preUninstall": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("preUninstall")) + it.PreUninstall, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "values": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("values")) + it.Values, err = ec.unmarshalNMap2map(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__JobVarsIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1JobVarsIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1JobVarsIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"affinity", "backOffLimit", "nodeSelector", "tolerations"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "affinity": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("affinity")) + it.Affinity, err = ec.unmarshalOK8s__io___api___core___v1__AffinityIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1AffinityIn(ctx, v) + if err != nil { + return it, err + } + case "backOffLimit": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("backOffLimit")) + it.BackOffLimit, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + case "nodeSelector": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nodeSelector")) + it.NodeSelector, err = ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + case "tolerations": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tolerations")) + it.Tolerations, err = ec.unmarshalOK8s__io___api___core___v1__TolerationIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TolerationInᚄ(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpecIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpecIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"serviceTemplate"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "serviceTemplate": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("serviceTemplate")) + it.ServiceTemplate, err = ec.unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ServiceTemplateIn(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1ServiceTemplateIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1ServiceTemplateIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"apiVersion", "kind", "spec"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "apiVersion": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) + it.APIVersion, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "kind": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + it.Kind, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "spec": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) + it.Spec, err = ec.unmarshalNMap2map(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputHelmReleaseIn(ctx context.Context, obj interface{}) (entities.HelmRelease, error) { + var it entities.HelmRelease + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"apiVersion", "displayName", "kind", "metadata", "spec"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "apiVersion": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) + it.APIVersion, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "displayName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + it.DisplayName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "kind": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + it.Kind, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "metadata": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalOMetadataIn2ᚖk8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.HelmReleaseIn().Metadata(ctx, &it, data); err != nil { + return it, err + } + case "spec": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) + data, err := ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__HelmChartSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1HelmChartSpecIn(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.HelmReleaseIn().Spec(ctx, &it, data); err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__AWSElasticBlockStoreVolumeSourceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1AWSElasticBlockStoreVolumeSourceIn, error) { + var it model.K8sIoAPICoreV1AWSElasticBlockStoreVolumeSourceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"fsType", "partition", "readOnly", "volumeID"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "fsType": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fsType")) + it.FsType, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "partition": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("partition")) + it.Partition, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + case "readOnly": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("readOnly")) + it.ReadOnly, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + case "volumeID": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("volumeID")) + it.VolumeID, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__AffinityIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1AffinityIn, error) { + var it model.K8sIoAPICoreV1AffinityIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"nodeAffinity", "podAffinity", "podAntiAffinity"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "nodeAffinity": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nodeAffinity")) + it.NodeAffinity, err = ec.unmarshalOK8s__io___api___core___v1__NodeAffinityIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeAffinityIn(ctx, v) + if err != nil { + return it, err + } + case "podAffinity": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("podAffinity")) + it.PodAffinity, err = ec.unmarshalOK8s__io___api___core___v1__PodAffinityIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PodAffinityIn(ctx, v) + if err != nil { + return it, err + } + case "podAntiAffinity": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("podAntiAffinity")) + it.PodAntiAffinity, err = ec.unmarshalOK8s__io___api___core___v1__PodAntiAffinityIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PodAntiAffinityIn(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__AzureDiskVolumeSourceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1AzureDiskVolumeSourceIn, error) { + var it model.K8sIoAPICoreV1AzureDiskVolumeSourceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"cachingMode", "diskName", "diskURI", "fsType", "kind", "readOnly"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "cachingMode": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cachingMode")) + it.CachingMode, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "diskName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("diskName")) + it.DiskName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "diskURI": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("diskURI")) + it.DiskURI, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "fsType": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fsType")) + it.FsType, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "kind": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + it.Kind, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "readOnly": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("readOnly")) + it.ReadOnly, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__AzureFilePersistentVolumeSourceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1AzureFilePersistentVolumeSourceIn, error) { + var it model.K8sIoAPICoreV1AzureFilePersistentVolumeSourceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"readOnly", "secretName", "secretNamespace", "shareName"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "readOnly": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("readOnly")) + it.ReadOnly, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + case "secretName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretName")) + it.SecretName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "secretNamespace": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretNamespace")) + it.SecretNamespace, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "shareName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("shareName")) + it.ShareName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__CSIPersistentVolumeSourceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1CSIPersistentVolumeSourceIn, error) { + var it model.K8sIoAPICoreV1CSIPersistentVolumeSourceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"controllerExpandSecretRef", "controllerPublishSecretRef", "driver", "fsType", "nodeExpandSecretRef", "nodePublishSecretRef", "nodeStageSecretRef", "readOnly", "volumeAttributes", "volumeHandle"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "controllerExpandSecretRef": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("controllerExpandSecretRef")) + it.ControllerExpandSecretRef, err = ec.unmarshalOK8s__io___api___core___v1__SecretReferenceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1SecretReferenceIn(ctx, v) + if err != nil { + return it, err + } + case "controllerPublishSecretRef": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("controllerPublishSecretRef")) + it.ControllerPublishSecretRef, err = ec.unmarshalOK8s__io___api___core___v1__SecretReferenceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1SecretReferenceIn(ctx, v) + if err != nil { + return it, err + } + case "driver": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("driver")) + it.Driver, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "fsType": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fsType")) + it.FsType, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "nodeExpandSecretRef": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nodeExpandSecretRef")) + it.NodeExpandSecretRef, err = ec.unmarshalOK8s__io___api___core___v1__SecretReferenceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1SecretReferenceIn(ctx, v) + if err != nil { + return it, err + } + case "nodePublishSecretRef": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nodePublishSecretRef")) + it.NodePublishSecretRef, err = ec.unmarshalOK8s__io___api___core___v1__SecretReferenceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1SecretReferenceIn(ctx, v) + if err != nil { + return it, err + } + case "nodeStageSecretRef": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nodeStageSecretRef")) + it.NodeStageSecretRef, err = ec.unmarshalOK8s__io___api___core___v1__SecretReferenceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1SecretReferenceIn(ctx, v) + if err != nil { + return it, err + } + case "readOnly": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("readOnly")) + it.ReadOnly, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + case "volumeAttributes": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("volumeAttributes")) + it.VolumeAttributes, err = ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + case "volumeHandle": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("volumeHandle")) + it.VolumeHandle, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__CephFSPersistentVolumeSourceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1CephFSPersistentVolumeSourceIn, error) { + var it model.K8sIoAPICoreV1CephFSPersistentVolumeSourceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"monitors", "path", "readOnly", "secretFile", "secretRef", "user"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "monitors": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("monitors")) + it.Monitors, err = ec.unmarshalNString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + case "path": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("path")) + it.Path, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "readOnly": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("readOnly")) + it.ReadOnly, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + case "secretFile": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretFile")) + it.SecretFile, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "secretRef": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretRef")) + it.SecretRef, err = ec.unmarshalOK8s__io___api___core___v1__SecretReferenceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1SecretReferenceIn(ctx, v) + if err != nil { + return it, err + } + case "user": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("user")) + it.User, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__CinderPersistentVolumeSourceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1CinderPersistentVolumeSourceIn, error) { + var it model.K8sIoAPICoreV1CinderPersistentVolumeSourceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"fsType", "readOnly", "secretRef", "volumeID"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "fsType": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fsType")) + it.FsType, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "readOnly": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("readOnly")) + it.ReadOnly, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + case "secretRef": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretRef")) + it.SecretRef, err = ec.unmarshalOK8s__io___api___core___v1__SecretReferenceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1SecretReferenceIn(ctx, v) + if err != nil { + return it, err + } + case "volumeID": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("volumeID")) + it.VolumeID, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__FCVolumeSourceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1FCVolumeSourceIn, error) { + var it model.K8sIoAPICoreV1FCVolumeSourceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"fsType", "lun", "readOnly", "targetWWNs", "wwids"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "fsType": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fsType")) + it.FsType, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "lun": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lun")) + it.Lun, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + case "readOnly": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("readOnly")) + it.ReadOnly, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + case "targetWWNs": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetWWNs")) + it.TargetWWNs, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + case "wwids": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("wwids")) + it.Wwids, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__FlexPersistentVolumeSourceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1FlexPersistentVolumeSourceIn, error) { + var it model.K8sIoAPICoreV1FlexPersistentVolumeSourceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"driver", "fsType", "options", "readOnly", "secretRef"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "driver": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("driver")) + it.Driver, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "fsType": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fsType")) + it.FsType, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "options": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("options")) + it.Options, err = ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + case "readOnly": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("readOnly")) + it.ReadOnly, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + case "secretRef": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretRef")) + it.SecretRef, err = ec.unmarshalOK8s__io___api___core___v1__SecretReferenceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1SecretReferenceIn(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__FlockerVolumeSourceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1FlockerVolumeSourceIn, error) { + var it model.K8sIoAPICoreV1FlockerVolumeSourceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"datasetName", "datasetUUID"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "datasetName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("datasetName")) + it.DatasetName, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "datasetUUID": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("datasetUUID")) + it.DatasetUUID, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__GCEPersistentDiskVolumeSourceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1GCEPersistentDiskVolumeSourceIn, error) { + var it model.K8sIoAPICoreV1GCEPersistentDiskVolumeSourceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"fsType", "partition", "pdName", "readOnly"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "fsType": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fsType")) + it.FsType, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "partition": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("partition")) + it.Partition, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + case "pdName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pdName")) + it.PdName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "readOnly": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("readOnly")) + it.ReadOnly, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__GlusterfsPersistentVolumeSourceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1GlusterfsPersistentVolumeSourceIn, error) { + var it model.K8sIoAPICoreV1GlusterfsPersistentVolumeSourceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"endpoints", "endpointsNamespace", "path", "readOnly"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "endpoints": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("endpoints")) + it.Endpoints, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "endpointsNamespace": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("endpointsNamespace")) + it.EndpointsNamespace, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "path": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("path")) + it.Path, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "readOnly": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("readOnly")) + it.ReadOnly, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__HostPathVolumeSourceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1HostPathVolumeSourceIn, error) { + var it model.K8sIoAPICoreV1HostPathVolumeSourceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"path", "type"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "path": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("path")) + it.Path, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "type": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) + it.Type, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__ISCSIPersistentVolumeSourceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1ISCSIPersistentVolumeSourceIn, error) { + var it model.K8sIoAPICoreV1ISCSIPersistentVolumeSourceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"chapAuthDiscovery", "chapAuthSession", "fsType", "initiatorName", "iqn", "iscsiInterface", "lun", "portals", "readOnly", "secretRef", "targetPortal"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "chapAuthDiscovery": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("chapAuthDiscovery")) + it.ChapAuthDiscovery, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + case "chapAuthSession": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("chapAuthSession")) + it.ChapAuthSession, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + case "fsType": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fsType")) + it.FsType, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "initiatorName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("initiatorName")) + it.InitiatorName, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "iqn": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("iqn")) + it.Iqn, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "iscsiInterface": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("iscsiInterface")) + it.IscsiInterface, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "lun": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lun")) + it.Lun, err = ec.unmarshalNInt2int(ctx, v) + if err != nil { + return it, err + } + case "portals": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("portals")) + it.Portals, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + case "readOnly": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("readOnly")) + it.ReadOnly, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + case "secretRef": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretRef")) + it.SecretRef, err = ec.unmarshalOK8s__io___api___core___v1__SecretReferenceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1SecretReferenceIn(ctx, v) + if err != nil { + return it, err + } + case "targetPortal": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetPortal")) + it.TargetPortal, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__LocalVolumeSourceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1LocalVolumeSourceIn, error) { + var it model.K8sIoAPICoreV1LocalVolumeSourceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"fsType", "path"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "fsType": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fsType")) + it.FsType, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "path": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("path")) + it.Path, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__NFSVolumeSourceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1NFSVolumeSourceIn, error) { + var it model.K8sIoAPICoreV1NFSVolumeSourceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"path", "readOnly", "server"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "path": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("path")) + it.Path, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "readOnly": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("readOnly")) + it.ReadOnly, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + case "server": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("server")) + it.Server, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__NamespaceConditionIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1NamespaceConditionIn, error) { + var it model.K8sIoAPICoreV1NamespaceConditionIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"lastTransitionTime", "message", "reason", "status", "type"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "lastTransitionTime": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastTransitionTime")) + it.LastTransitionTime, err = ec.unmarshalODate2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "message": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("message")) + it.Message, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "reason": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("reason")) + it.Reason, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "status": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + it.Status, err = ec.unmarshalNK8s__io___api___core___v1__ConditionStatus2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ConditionStatus(ctx, v) + if err != nil { + return it, err + } + case "type": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) + it.Type, err = ec.unmarshalNK8s__io___api___core___v1__NamespaceConditionType2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NamespaceConditionType(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__NamespaceSpecIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1NamespaceSpecIn, error) { + var it model.K8sIoAPICoreV1NamespaceSpecIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"finalizers"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "finalizers": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("finalizers")) + it.Finalizers, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__NamespaceStatusIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1NamespaceStatusIn, error) { + var it model.K8sIoAPICoreV1NamespaceStatusIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"conditions", "phase"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "conditions": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("conditions")) + it.Conditions, err = ec.unmarshalOK8s__io___api___core___v1__NamespaceConditionIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NamespaceConditionInᚄ(ctx, v) + if err != nil { + return it, err + } + case "phase": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phase")) + it.Phase, err = ec.unmarshalOK8s__io___api___core___v1__NamespacePhase2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NamespacePhase(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__NodeAffinityIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1NodeAffinityIn, error) { + var it model.K8sIoAPICoreV1NodeAffinityIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"preferredDuringSchedulingIgnoredDuringExecution", "requiredDuringSchedulingIgnoredDuringExecution"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "preferredDuringSchedulingIgnoredDuringExecution": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("preferredDuringSchedulingIgnoredDuringExecution")) + it.PreferredDuringSchedulingIgnoredDuringExecution, err = ec.unmarshalOK8s__io___api___core___v1__PreferredSchedulingTermIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PreferredSchedulingTermInᚄ(ctx, v) + if err != nil { + return it, err + } + case "requiredDuringSchedulingIgnoredDuringExecution": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requiredDuringSchedulingIgnoredDuringExecution")) + it.RequiredDuringSchedulingIgnoredDuringExecution, err = ec.unmarshalOK8s__io___api___core___v1__NodeSelectorIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelectorIn(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__NodeSelectorIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1NodeSelectorIn, error) { + var it model.K8sIoAPICoreV1NodeSelectorIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"nodeSelectorTerms"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "nodeSelectorTerms": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nodeSelectorTerms")) + it.NodeSelectorTerms, err = ec.unmarshalNK8s__io___api___core___v1__NodeSelectorTermIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelectorTermInᚄ(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__NodeSelectorRequirementIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1NodeSelectorRequirementIn, error) { + var it model.K8sIoAPICoreV1NodeSelectorRequirementIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"key", "operator", "values"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "key": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + it.Key, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "operator": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operator")) + it.Operator, err = ec.unmarshalNK8s__io___api___core___v1__NodeSelectorOperator2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelectorOperator(ctx, v) + if err != nil { + return it, err + } + case "values": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("values")) + it.Values, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__NodeSelectorTermIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1NodeSelectorTermIn, error) { + var it model.K8sIoAPICoreV1NodeSelectorTermIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"matchExpressions", "matchFields"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "matchExpressions": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("matchExpressions")) + it.MatchExpressions, err = ec.unmarshalOK8s__io___api___core___v1__NodeSelectorRequirementIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelectorRequirementInᚄ(ctx, v) + if err != nil { + return it, err + } + case "matchFields": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("matchFields")) + it.MatchFields, err = ec.unmarshalOK8s__io___api___core___v1__NodeSelectorRequirementIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelectorRequirementInᚄ(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__ObjectReferenceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1ObjectReferenceIn, error) { + var it model.K8sIoAPICoreV1ObjectReferenceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"apiVersion", "fieldPath", "kind", "name", "namespace", "resourceVersion", "uid"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "apiVersion": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) + it.APIVersion, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "fieldPath": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fieldPath")) + it.FieldPath, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "kind": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + it.Kind, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "name": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + it.Name, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "namespace": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) + it.Namespace, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "resourceVersion": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("resourceVersion")) + it.ResourceVersion, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "uid": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("uid")) + it.UID, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__PersistentVolumeClaimConditionIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1PersistentVolumeClaimConditionIn, error) { + var it model.K8sIoAPICoreV1PersistentVolumeClaimConditionIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"lastProbeTime", "lastTransitionTime", "message", "reason", "status", "type"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "lastProbeTime": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastProbeTime")) + it.LastProbeTime, err = ec.unmarshalODate2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "lastTransitionTime": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastTransitionTime")) + it.LastTransitionTime, err = ec.unmarshalODate2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "message": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("message")) + it.Message, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "reason": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("reason")) + it.Reason, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "status": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + it.Status, err = ec.unmarshalNK8s__io___api___core___v1__ConditionStatus2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ConditionStatus(ctx, v) + if err != nil { + return it, err + } + case "type": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) + it.Type, err = ec.unmarshalNK8s__io___api___core___v1__PersistentVolumeClaimConditionType2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeClaimConditionType(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__PersistentVolumeClaimSpecIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1PersistentVolumeClaimSpecIn, error) { + var it model.K8sIoAPICoreV1PersistentVolumeClaimSpecIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"accessModes", "dataSource", "dataSourceRef", "resources", "selector", "storageClassName", "volumeMode", "volumeName"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "accessModes": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("accessModes")) + it.AccessModes, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + case "dataSource": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("dataSource")) + it.DataSource, err = ec.unmarshalOK8s__io___api___core___v1__TypedLocalObjectReferenceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TypedLocalObjectReferenceIn(ctx, v) + if err != nil { + return it, err + } + case "dataSourceRef": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("dataSourceRef")) + it.DataSourceRef, err = ec.unmarshalOK8s__io___api___core___v1__TypedObjectReferenceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TypedObjectReferenceIn(ctx, v) + if err != nil { + return it, err + } + case "resources": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("resources")) + it.Resources, err = ec.unmarshalOK8s__io___api___core___v1__ResourceRequirementsIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ResourceRequirementsIn(ctx, v) + if err != nil { + return it, err + } + case "selector": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("selector")) + it.Selector, err = ec.unmarshalOK8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoApimachineryPkgApisMetaV1LabelSelectorIn(ctx, v) + if err != nil { + return it, err + } + case "storageClassName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storageClassName")) + it.StorageClassName, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "volumeMode": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("volumeMode")) + it.VolumeMode, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "volumeName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("volumeName")) + it.VolumeName, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__PersistentVolumeClaimStatusIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1PersistentVolumeClaimStatusIn, error) { + var it model.K8sIoAPICoreV1PersistentVolumeClaimStatusIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"accessModes", "allocatedResources", "allocatedResourceStatuses", "capacity", "conditions", "phase"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "accessModes": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("accessModes")) + it.AccessModes, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + case "allocatedResources": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("allocatedResources")) + it.AllocatedResources, err = ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + case "allocatedResourceStatuses": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("allocatedResourceStatuses")) + it.AllocatedResourceStatuses, err = ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + case "capacity": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("capacity")) + it.Capacity, err = ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + case "conditions": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("conditions")) + it.Conditions, err = ec.unmarshalOK8s__io___api___core___v1__PersistentVolumeClaimConditionIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeClaimConditionInᚄ(ctx, v) + if err != nil { + return it, err + } + case "phase": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phase")) + it.Phase, err = ec.unmarshalOK8s__io___api___core___v1__PersistentVolumeClaimPhase2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeClaimPhase(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__PersistentVolumeSpecIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1PersistentVolumeSpecIn, error) { + var it model.K8sIoAPICoreV1PersistentVolumeSpecIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"accessModes", "awsElasticBlockStore", "azureDisk", "azureFile", "capacity", "cephfs", "cinder", "claimRef", "csi", "fc", "flexVolume", "flocker", "gcePersistentDisk", "glusterfs", "hostPath", "iscsi", "local", "mountOptions", "nfs", "nodeAffinity", "persistentVolumeReclaimPolicy", "photonPersistentDisk", "portworxVolume", "quobyte", "rbd", "scaleIO", "storageClassName", "storageos", "volumeMode", "vsphereVolume"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "accessModes": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("accessModes")) + it.AccessModes, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + case "awsElasticBlockStore": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("awsElasticBlockStore")) + it.AwsElasticBlockStore, err = ec.unmarshalOK8s__io___api___core___v1__AWSElasticBlockStoreVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1AWSElasticBlockStoreVolumeSourceIn(ctx, v) + if err != nil { + return it, err + } + case "azureDisk": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("azureDisk")) + it.AzureDisk, err = ec.unmarshalOK8s__io___api___core___v1__AzureDiskVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1AzureDiskVolumeSourceIn(ctx, v) + if err != nil { + return it, err + } + case "azureFile": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("azureFile")) + it.AzureFile, err = ec.unmarshalOK8s__io___api___core___v1__AzureFilePersistentVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1AzureFilePersistentVolumeSourceIn(ctx, v) + if err != nil { + return it, err + } + case "capacity": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("capacity")) + it.Capacity, err = ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + case "cephfs": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cephfs")) + it.Cephfs, err = ec.unmarshalOK8s__io___api___core___v1__CephFSPersistentVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1CephFSPersistentVolumeSourceIn(ctx, v) + if err != nil { + return it, err + } + case "cinder": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cinder")) + it.Cinder, err = ec.unmarshalOK8s__io___api___core___v1__CinderPersistentVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1CinderPersistentVolumeSourceIn(ctx, v) + if err != nil { + return it, err + } + case "claimRef": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimRef")) + it.ClaimRef, err = ec.unmarshalOK8s__io___api___core___v1__ObjectReferenceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ObjectReferenceIn(ctx, v) + if err != nil { + return it, err + } + case "csi": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("csi")) + it.Csi, err = ec.unmarshalOK8s__io___api___core___v1__CSIPersistentVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1CSIPersistentVolumeSourceIn(ctx, v) + if err != nil { + return it, err + } + case "fc": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fc")) + it.Fc, err = ec.unmarshalOK8s__io___api___core___v1__FCVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1FCVolumeSourceIn(ctx, v) + if err != nil { + return it, err + } + case "flexVolume": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("flexVolume")) + it.FlexVolume, err = ec.unmarshalOK8s__io___api___core___v1__FlexPersistentVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1FlexPersistentVolumeSourceIn(ctx, v) + if err != nil { + return it, err + } + case "flocker": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("flocker")) + it.Flocker, err = ec.unmarshalOK8s__io___api___core___v1__FlockerVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1FlockerVolumeSourceIn(ctx, v) + if err != nil { + return it, err + } + case "gcePersistentDisk": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gcePersistentDisk")) + it.GcePersistentDisk, err = ec.unmarshalOK8s__io___api___core___v1__GCEPersistentDiskVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1GCEPersistentDiskVolumeSourceIn(ctx, v) + if err != nil { + return it, err + } + case "glusterfs": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("glusterfs")) + it.Glusterfs, err = ec.unmarshalOK8s__io___api___core___v1__GlusterfsPersistentVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1GlusterfsPersistentVolumeSourceIn(ctx, v) + if err != nil { + return it, err + } + case "hostPath": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hostPath")) + it.HostPath, err = ec.unmarshalOK8s__io___api___core___v1__HostPathVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1HostPathVolumeSourceIn(ctx, v) + if err != nil { + return it, err + } + case "iscsi": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("iscsi")) + it.Iscsi, err = ec.unmarshalOK8s__io___api___core___v1__ISCSIPersistentVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ISCSIPersistentVolumeSourceIn(ctx, v) + if err != nil { + return it, err + } + case "local": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("local")) + it.Local, err = ec.unmarshalOK8s__io___api___core___v1__LocalVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1LocalVolumeSourceIn(ctx, v) + if err != nil { + return it, err + } + case "mountOptions": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("mountOptions")) + it.MountOptions, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + case "nfs": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nfs")) + it.Nfs, err = ec.unmarshalOK8s__io___api___core___v1__NFSVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NFSVolumeSourceIn(ctx, v) + if err != nil { + return it, err + } + case "nodeAffinity": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nodeAffinity")) + it.NodeAffinity, err = ec.unmarshalOK8s__io___api___core___v1__VolumeNodeAffinityIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1VolumeNodeAffinityIn(ctx, v) + if err != nil { + return it, err + } + case "persistentVolumeReclaimPolicy": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("persistentVolumeReclaimPolicy")) + it.PersistentVolumeReclaimPolicy, err = ec.unmarshalOK8s__io___api___core___v1__PersistentVolumeReclaimPolicy2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeReclaimPolicy(ctx, v) + if err != nil { + return it, err + } + case "photonPersistentDisk": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("photonPersistentDisk")) + it.PhotonPersistentDisk, err = ec.unmarshalOK8s__io___api___core___v1__PhotonPersistentDiskVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PhotonPersistentDiskVolumeSourceIn(ctx, v) + if err != nil { + return it, err + } + case "portworxVolume": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("portworxVolume")) + it.PortworxVolume, err = ec.unmarshalOK8s__io___api___core___v1__PortworxVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PortworxVolumeSourceIn(ctx, v) + if err != nil { + return it, err + } + case "quobyte": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quobyte")) + it.Quobyte, err = ec.unmarshalOK8s__io___api___core___v1__QuobyteVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1QuobyteVolumeSourceIn(ctx, v) + if err != nil { + return it, err + } + case "rbd": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("rbd")) + it.Rbd, err = ec.unmarshalOK8s__io___api___core___v1__RBDPersistentVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1RBDPersistentVolumeSourceIn(ctx, v) + if err != nil { + return it, err + } + case "scaleIO": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scaleIO")) + it.ScaleIo, err = ec.unmarshalOK8s__io___api___core___v1__ScaleIOPersistentVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ScaleIOPersistentVolumeSourceIn(ctx, v) + if err != nil { + return it, err + } + case "storageClassName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storageClassName")) + it.StorageClassName, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "storageos": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storageos")) + it.Storageos, err = ec.unmarshalOK8s__io___api___core___v1__StorageOSPersistentVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1StorageOSPersistentVolumeSourceIn(ctx, v) + if err != nil { + return it, err + } + case "volumeMode": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("volumeMode")) + it.VolumeMode, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "vsphereVolume": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("vsphereVolume")) + it.VsphereVolume, err = ec.unmarshalOK8s__io___api___core___v1__VsphereVirtualDiskVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1VsphereVirtualDiskVolumeSourceIn(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__PersistentVolumeStatusIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1PersistentVolumeStatusIn, error) { + var it model.K8sIoAPICoreV1PersistentVolumeStatusIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"lastPhaseTransitionTime", "message", "phase", "reason"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "lastPhaseTransitionTime": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastPhaseTransitionTime")) + it.LastPhaseTransitionTime, err = ec.unmarshalODate2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "message": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("message")) + it.Message, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "phase": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phase")) + it.Phase, err = ec.unmarshalOK8s__io___api___core___v1__PersistentVolumePhase2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumePhase(ctx, v) + if err != nil { + return it, err + } + case "reason": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("reason")) + it.Reason, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__PhotonPersistentDiskVolumeSourceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1PhotonPersistentDiskVolumeSourceIn, error) { + var it model.K8sIoAPICoreV1PhotonPersistentDiskVolumeSourceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"fsType", "pdID"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "fsType": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fsType")) + it.FsType, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "pdID": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pdID")) + it.PdID, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__PodAffinityIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1PodAffinityIn, error) { + var it model.K8sIoAPICoreV1PodAffinityIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"preferredDuringSchedulingIgnoredDuringExecution", "requiredDuringSchedulingIgnoredDuringExecution"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "preferredDuringSchedulingIgnoredDuringExecution": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("preferredDuringSchedulingIgnoredDuringExecution")) + it.PreferredDuringSchedulingIgnoredDuringExecution, err = ec.unmarshalOK8s__io___api___core___v1__WeightedPodAffinityTermIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1WeightedPodAffinityTermInᚄ(ctx, v) + if err != nil { + return it, err + } + case "requiredDuringSchedulingIgnoredDuringExecution": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requiredDuringSchedulingIgnoredDuringExecution")) + it.RequiredDuringSchedulingIgnoredDuringExecution, err = ec.unmarshalOK8s__io___api___core___v1__PodAffinityTermIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PodAffinityTermInᚄ(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__PodAffinityTermIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1PodAffinityTermIn, error) { + var it model.K8sIoAPICoreV1PodAffinityTermIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"labelSelector", "namespaces", "namespaceSelector", "topologyKey"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "labelSelector": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("labelSelector")) + it.LabelSelector, err = ec.unmarshalOK8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoApimachineryPkgApisMetaV1LabelSelectorIn(ctx, v) + if err != nil { + return it, err + } + case "namespaces": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespaces")) + it.Namespaces, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + case "namespaceSelector": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespaceSelector")) + it.NamespaceSelector, err = ec.unmarshalOK8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoApimachineryPkgApisMetaV1LabelSelectorIn(ctx, v) + if err != nil { + return it, err + } + case "topologyKey": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("topologyKey")) + it.TopologyKey, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__PodAntiAffinityIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1PodAntiAffinityIn, error) { + var it model.K8sIoAPICoreV1PodAntiAffinityIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"preferredDuringSchedulingIgnoredDuringExecution", "requiredDuringSchedulingIgnoredDuringExecution"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "preferredDuringSchedulingIgnoredDuringExecution": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("preferredDuringSchedulingIgnoredDuringExecution")) + it.PreferredDuringSchedulingIgnoredDuringExecution, err = ec.unmarshalOK8s__io___api___core___v1__WeightedPodAffinityTermIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1WeightedPodAffinityTermInᚄ(ctx, v) + if err != nil { + return it, err + } + case "requiredDuringSchedulingIgnoredDuringExecution": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requiredDuringSchedulingIgnoredDuringExecution")) + it.RequiredDuringSchedulingIgnoredDuringExecution, err = ec.unmarshalOK8s__io___api___core___v1__PodAffinityTermIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PodAffinityTermInᚄ(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__PortworxVolumeSourceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1PortworxVolumeSourceIn, error) { + var it model.K8sIoAPICoreV1PortworxVolumeSourceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"fsType", "readOnly", "volumeID"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "fsType": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fsType")) + it.FsType, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "readOnly": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("readOnly")) + it.ReadOnly, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + case "volumeID": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("volumeID")) + it.VolumeID, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__PreferredSchedulingTermIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1PreferredSchedulingTermIn, error) { + var it model.K8sIoAPICoreV1PreferredSchedulingTermIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"preference", "weight"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "preference": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("preference")) + it.Preference, err = ec.unmarshalNK8s__io___api___core___v1__NodeSelectorTermIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelectorTermIn(ctx, v) + if err != nil { + return it, err + } + case "weight": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("weight")) + it.Weight, err = ec.unmarshalNInt2int(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__QuobyteVolumeSourceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1QuobyteVolumeSourceIn, error) { + var it model.K8sIoAPICoreV1QuobyteVolumeSourceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"group", "readOnly", "registry", "tenant", "user", "volume"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "group": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("group")) + it.Group, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "readOnly": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("readOnly")) + it.ReadOnly, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + case "registry": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("registry")) + it.Registry, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "tenant": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tenant")) + it.Tenant, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "user": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("user")) + it.User, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "volume": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("volume")) + it.Volume, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__RBDPersistentVolumeSourceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1RBDPersistentVolumeSourceIn, error) { + var it model.K8sIoAPICoreV1RBDPersistentVolumeSourceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"fsType", "image", "keyring", "monitors", "pool", "readOnly", "secretRef", "user"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "fsType": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fsType")) + it.FsType, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "image": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("image")) + it.Image, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "keyring": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("keyring")) + it.Keyring, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "monitors": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("monitors")) + it.Monitors, err = ec.unmarshalNString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + case "pool": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pool")) + it.Pool, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "readOnly": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("readOnly")) + it.ReadOnly, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + case "secretRef": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretRef")) + it.SecretRef, err = ec.unmarshalOK8s__io___api___core___v1__SecretReferenceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1SecretReferenceIn(ctx, v) + if err != nil { + return it, err + } + case "user": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("user")) + it.User, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__ResourceClaimIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1ResourceClaimIn, error) { + var it model.K8sIoAPICoreV1ResourceClaimIn + 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": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + it.Name, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__ResourceRequirementsIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1ResourceRequirementsIn, error) { + var it model.K8sIoAPICoreV1ResourceRequirementsIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"claims", "limits", "requests"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "claims": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claims")) + it.Claims, err = ec.unmarshalOK8s__io___api___core___v1__ResourceClaimIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ResourceClaimInᚄ(ctx, v) + if err != nil { + return it, err + } + case "limits": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("limits")) + it.Limits, err = ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + case "requests": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requests")) + it.Requests, err = ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__ScaleIOPersistentVolumeSourceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1ScaleIOPersistentVolumeSourceIn, error) { + var it model.K8sIoAPICoreV1ScaleIOPersistentVolumeSourceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"fsType", "gateway", "protectionDomain", "readOnly", "secretRef", "sslEnabled", "storageMode", "storagePool", "system", "volumeName"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "fsType": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fsType")) + it.FsType, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "gateway": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gateway")) + it.Gateway, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "protectionDomain": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("protectionDomain")) + it.ProtectionDomain, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "readOnly": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("readOnly")) + it.ReadOnly, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + case "secretRef": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretRef")) + it.SecretRef, err = ec.unmarshalOK8s__io___api___core___v1__SecretReferenceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1SecretReferenceIn(ctx, v) + if err != nil { + return it, err + } + case "sslEnabled": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sslEnabled")) + it.SslEnabled, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + case "storageMode": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storageMode")) + it.StorageMode, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "storagePool": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storagePool")) + it.StoragePool, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "system": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("system")) + it.System, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "volumeName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("volumeName")) + it.VolumeName, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__SecretReferenceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1SecretReferenceIn, error) { + var it model.K8sIoAPICoreV1SecretReferenceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"name", "namespace"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "name": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + it.Name, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "namespace": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) + it.Namespace, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__StorageOSPersistentVolumeSourceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1StorageOSPersistentVolumeSourceIn, error) { + var it model.K8sIoAPICoreV1StorageOSPersistentVolumeSourceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"fsType", "readOnly", "secretRef", "volumeName", "volumeNamespace"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "fsType": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fsType")) + it.FsType, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "readOnly": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("readOnly")) + it.ReadOnly, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + case "secretRef": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretRef")) + it.SecretRef, err = ec.unmarshalOK8s__io___api___core___v1__ObjectReferenceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ObjectReferenceIn(ctx, v) + if err != nil { + return it, err + } + case "volumeName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("volumeName")) + it.VolumeName, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "volumeNamespace": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("volumeNamespace")) + it.VolumeNamespace, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__TaintIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1TaintIn, error) { + var it model.K8sIoAPICoreV1TaintIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"effect", "key", "timeAdded", "value"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "effect": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("effect")) + it.Effect, err = ec.unmarshalNK8s__io___api___core___v1__TaintEffect2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TaintEffect(ctx, v) + if err != nil { + return it, err + } + case "key": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + it.Key, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "timeAdded": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("timeAdded")) + it.TimeAdded, err = ec.unmarshalODate2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "value": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + it.Value, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__TolerationIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1TolerationIn, error) { + var it model.K8sIoAPICoreV1TolerationIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"effect", "key", "operator", "tolerationSeconds", "value"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "effect": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("effect")) + it.Effect, err = ec.unmarshalOK8s__io___api___core___v1__TaintEffect2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TaintEffect(ctx, v) + if err != nil { + return it, err + } + case "key": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + it.Key, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "operator": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operator")) + it.Operator, err = ec.unmarshalOK8s__io___api___core___v1__TolerationOperator2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TolerationOperator(ctx, v) + if err != nil { + return it, err + } + case "tolerationSeconds": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tolerationSeconds")) + it.TolerationSeconds, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + case "value": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + it.Value, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__TypedLocalObjectReferenceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1TypedLocalObjectReferenceIn, error) { + var it model.K8sIoAPICoreV1TypedLocalObjectReferenceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"apiGroup", "kind", "name"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "apiGroup": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiGroup")) + it.APIGroup, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "kind": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + it.Kind, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "name": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + it.Name, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__TypedObjectReferenceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1TypedObjectReferenceIn, error) { + var it model.K8sIoAPICoreV1TypedObjectReferenceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"apiGroup", "kind", "name", "namespace"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "apiGroup": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiGroup")) + it.APIGroup, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "kind": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + it.Kind, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "name": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + it.Name, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "namespace": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) + it.Namespace, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__VolumeNodeAffinityIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1VolumeNodeAffinityIn, error) { + var it model.K8sIoAPICoreV1VolumeNodeAffinityIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"required"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "required": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("required")) + it.Required, err = ec.unmarshalOK8s__io___api___core___v1__NodeSelectorIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelectorIn(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__VsphereVirtualDiskVolumeSourceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1VsphereVirtualDiskVolumeSourceIn, error) { + var it model.K8sIoAPICoreV1VsphereVirtualDiskVolumeSourceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"fsType", "storagePolicyID", "storagePolicyName", "volumePath"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "fsType": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fsType")) + it.FsType, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "storagePolicyID": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storagePolicyID")) + it.StoragePolicyID, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "storagePolicyName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storagePolicyName")) + it.StoragePolicyName, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "volumePath": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("volumePath")) + it.VolumePath, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__WeightedPodAffinityTermIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1WeightedPodAffinityTermIn, error) { + var it model.K8sIoAPICoreV1WeightedPodAffinityTermIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"podAffinityTerm", "weight"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "podAffinityTerm": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("podAffinityTerm")) + it.PodAffinityTerm, err = ec.unmarshalNK8s__io___api___core___v1__PodAffinityTermIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PodAffinityTermIn(ctx, v) + if err != nil { + return it, err + } + case "weight": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("weight")) + it.Weight, err = ec.unmarshalNInt2int(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___storage___v1__VolumeAttachmentSourceIn(ctx context.Context, obj interface{}) (model.K8sIoAPIStorageV1VolumeAttachmentSourceIn, error) { + var it model.K8sIoAPIStorageV1VolumeAttachmentSourceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"inlineVolumeSpec", "persistentVolumeName"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "inlineVolumeSpec": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("inlineVolumeSpec")) + it.InlineVolumeSpec, err = ec.unmarshalOK8s__io___api___core___v1__PersistentVolumeSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeSpecIn(ctx, v) + if err != nil { + return it, err + } + case "persistentVolumeName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("persistentVolumeName")) + it.PersistentVolumeName, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___storage___v1__VolumeAttachmentSpecIn(ctx context.Context, obj interface{}) (model.K8sIoAPIStorageV1VolumeAttachmentSpecIn, error) { + var it model.K8sIoAPIStorageV1VolumeAttachmentSpecIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"attacher", "nodeName", "source"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "attacher": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("attacher")) + it.Attacher, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "nodeName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nodeName")) + it.NodeName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "source": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("source")) + it.Source, err = ec.unmarshalNK8s__io___api___storage___v1__VolumeAttachmentSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPIStorageV1VolumeAttachmentSourceIn(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___storage___v1__VolumeAttachmentStatusIn(ctx context.Context, obj interface{}) (model.K8sIoAPIStorageV1VolumeAttachmentStatusIn, error) { + var it model.K8sIoAPIStorageV1VolumeAttachmentStatusIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"attached", "attachError", "attachmentMetadata", "detachError"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "attached": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("attached")) + it.Attached, err = ec.unmarshalNBoolean2bool(ctx, v) + if err != nil { + return it, err + } + case "attachError": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("attachError")) + it.AttachError, err = ec.unmarshalOK8s__io___api___storage___v1__VolumeErrorIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPIStorageV1VolumeErrorIn(ctx, v) + if err != nil { + return it, err + } + case "attachmentMetadata": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("attachmentMetadata")) + it.AttachmentMetadata, err = ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + case "detachError": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("detachError")) + it.DetachError, err = ec.unmarshalOK8s__io___api___storage___v1__VolumeErrorIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPIStorageV1VolumeErrorIn(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___storage___v1__VolumeErrorIn(ctx context.Context, obj interface{}) (model.K8sIoAPIStorageV1VolumeErrorIn, error) { + var it model.K8sIoAPIStorageV1VolumeErrorIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"message", "time"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "message": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("message")) + it.Message, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "time": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("time")) + it.Time, err = ec.unmarshalODate2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___apimachinery___pkg___api___resource__QuantityIn(ctx context.Context, obj interface{}) (model.K8sIoApimachineryPkgAPIResourceQuantityIn, error) { + var it model.K8sIoApimachineryPkgAPIResourceQuantityIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"Format"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "Format": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("Format")) + it.Format, err = ec.unmarshalNK8s__io___apimachinery___pkg___api___resource__Format2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoApimachineryPkgAPIResourceFormat(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorIn(ctx context.Context, obj interface{}) (model.K8sIoApimachineryPkgApisMetaV1LabelSelectorIn, error) { + var it model.K8sIoApimachineryPkgApisMetaV1LabelSelectorIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"matchExpressions", "matchLabels"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "matchExpressions": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("matchExpressions")) + it.MatchExpressions, err = ec.unmarshalOK8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirementIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoApimachineryPkgApisMetaV1LabelSelectorRequirementInᚄ(ctx, v) + if err != nil { + return it, err + } + case "matchLabels": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("matchLabels")) + it.MatchLabels, err = ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirementIn(ctx context.Context, obj interface{}) (model.K8sIoApimachineryPkgApisMetaV1LabelSelectorRequirementIn, error) { + var it model.K8sIoApimachineryPkgApisMetaV1LabelSelectorRequirementIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"key", "operator", "values"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "key": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + it.Key, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "operator": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operator")) + it.Operator, err = ec.unmarshalNK8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorOperator2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoApimachineryPkgApisMetaV1LabelSelectorOperator(ctx, v) + if err != nil { + return it, err + } + case "values": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("values")) + it.Values, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMatchFilterIn(ctx context.Context, obj interface{}) (repos.MatchFilter, error) { + var it repos.MatchFilter + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"array", "exact", "matchType", "regex"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "array": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("array")) + it.Array, err = ec.unmarshalOAny2ᚕinterfaceᚄ(ctx, v) + if err != nil { + return it, err + } + case "exact": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("exact")) + it.Exact, err = ec.unmarshalOAny2interface(ctx, v) + if err != nil { + return it, err + } + case "matchType": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("matchType")) + it.MatchType, err = ec.unmarshalNMatchFilterMatchType2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchType(ctx, v) + if err != nil { + return it, err + } + case "regex": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("regex")) + it.Regex, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMetadataIn(ctx context.Context, obj interface{}) (v1.ObjectMeta, error) { + var it v1.ObjectMeta + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"annotations", "labels", "name", "namespace"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "annotations": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotations")) + data, err := ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.MetadataIn().Annotations(ctx, &it, data); err != nil { + return it, err + } + case "labels": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("labels")) + data, err := ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.MetadataIn().Labels(ctx, &it, data); err != nil { + return it, err + } + case "name": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + it.Name, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "namespace": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) + it.Namespace, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputNamespaceIn(ctx context.Context, obj interface{}) (entities.Namespace, error) { + var it entities.Namespace + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"apiVersion", "kind", "metadata", "spec", "status"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "apiVersion": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) + it.APIVersion, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "kind": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + it.Kind, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "metadata": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalOMetadataIn2ᚖk8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.NamespaceIn().Metadata(ctx, &it, data); err != nil { + return it, err + } + case "spec": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) + data, err := ec.unmarshalOK8s__io___api___core___v1__NamespaceSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NamespaceSpecIn(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.NamespaceIn().Spec(ctx, &it, data); err != nil { + return it, err + } + case "status": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + data, err := ec.unmarshalOK8s__io___api___core___v1__NamespaceStatusIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NamespaceStatusIn(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.NamespaceIn().Status(ctx, &it, data); err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputNodeIn(ctx context.Context, obj interface{}) (model.NodeIn, error) { + var it model.NodeIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"apiVersion", "kind", "metadata", "spec"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "apiVersion": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) + it.APIVersion, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "kind": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + it.Kind, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "metadata": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + it.Metadata, err = ec.unmarshalOMetadataIn2ᚖk8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) + if err != nil { + return it, err + } + case "spec": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) + it.Spec, err = ec.unmarshalNGithub__com___kloudlite___operator___apis___clusters___v1__NodeSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1NodeSpecIn(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputNodePoolIn(ctx context.Context, obj interface{}) (entities.NodePool, error) { + var it entities.NodePool + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"apiVersion", "displayName", "kind", "metadata", "spec"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "apiVersion": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) + it.APIVersion, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "displayName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + it.DisplayName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "kind": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + it.Kind, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "metadata": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalOMetadataIn2ᚖk8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.NodePoolIn().Metadata(ctx, &it, data); err != nil { + return it, err + } + case "spec": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) + data, err := ec.unmarshalNGithub__com___kloudlite___operator___apis___clusters___v1__NodePoolSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1NodePoolSpecIn(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.NodePoolIn().Spec(ctx, &it, data); err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputPersistentVolumeIn(ctx context.Context, obj interface{}) (entities.PersistentVolume, error) { + var it entities.PersistentVolume + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"apiVersion", "kind", "metadata", "spec", "status"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "apiVersion": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) + it.APIVersion, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "kind": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + it.Kind, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "metadata": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalOMetadataIn2ᚖk8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.PersistentVolumeIn().Metadata(ctx, &it, data); err != nil { + return it, err + } + case "spec": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) + data, err := ec.unmarshalOK8s__io___api___core___v1__PersistentVolumeSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeSpecIn(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.PersistentVolumeIn().Spec(ctx, &it, data); err != nil { + return it, err + } + case "status": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + data, err := ec.unmarshalOK8s__io___api___core___v1__PersistentVolumeStatusIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeStatusIn(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.PersistentVolumeIn().Status(ctx, &it, data); err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputSearchCluster(ctx context.Context, obj interface{}) (model.SearchCluster, error) { + var it model.SearchCluster + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"cloudProviderName", "isReady", "region", "text"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "cloudProviderName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cloudProviderName")) + it.CloudProviderName, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + case "isReady": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) + it.IsReady, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + case "region": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("region")) + it.Region, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + case "text": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + it.Text, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputSearchClusterManagedService(ctx context.Context, obj interface{}) (model.SearchClusterManagedService, error) { + var it model.SearchClusterManagedService + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"isReady", "text"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "isReady": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) + it.IsReady, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + case "text": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + it.Text, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputSearchDomainEntry(ctx context.Context, obj interface{}) (model.SearchDomainEntry, error) { + var it model.SearchDomainEntry + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"clusterName", "text"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "clusterName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + it.ClusterName, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + case "text": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + it.Text, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputSearchHelmRelease(ctx context.Context, obj interface{}) (model.SearchHelmRelease, error) { + var it model.SearchHelmRelease + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"text", "isReady"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "text": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + it.Text, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + case "isReady": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) + it.IsReady, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputSearchNamespaces(ctx context.Context, obj interface{}) (model.SearchNamespaces, error) { + var it model.SearchNamespaces + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"text"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "text": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + it.Text, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputSearchNodepool(ctx context.Context, obj interface{}) (model.SearchNodepool, error) { + var it model.SearchNodepool + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"text"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "text": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + it.Text, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputSearchPersistentVolumeClaims(ctx context.Context, obj interface{}) (model.SearchPersistentVolumeClaims, error) { + var it model.SearchPersistentVolumeClaims + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"text"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "text": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + it.Text, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputSearchPersistentVolumes(ctx context.Context, obj interface{}) (model.SearchPersistentVolumes, error) { + var it model.SearchPersistentVolumes + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"text"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "text": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + it.Text, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputSearchProviderSecret(ctx context.Context, obj interface{}) (model.SearchProviderSecret, error) { + var it model.SearchProviderSecret + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"cloudProviderName", "text"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "cloudProviderName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cloudProviderName")) + it.CloudProviderName, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + case "text": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + it.Text, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputSearchVolumeAttachments(ctx context.Context, obj interface{}) (model.SearchVolumeAttachments, error) { + var it model.SearchVolumeAttachments + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"text"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "text": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + it.Text, err = ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputVolumeAttachmentIn(ctx context.Context, obj interface{}) (entities.VolumeAttachment, error) { + var it entities.VolumeAttachment + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"apiVersion", "kind", "metadata", "spec", "status"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "apiVersion": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) + it.APIVersion, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "kind": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + it.Kind, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "metadata": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalOMetadataIn2ᚖk8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.VolumeAttachmentIn().Metadata(ctx, &it, data); err != nil { + return it, err + } + case "spec": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) + data, err := ec.unmarshalNK8s__io___api___storage___v1__VolumeAttachmentSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPIStorageV1VolumeAttachmentSpecIn(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.VolumeAttachmentIn().Spec(ctx, &it, data); err != nil { + return it, err + } + case "status": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + data, err := ec.unmarshalOK8s__io___api___storage___v1__VolumeAttachmentStatusIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPIStorageV1VolumeAttachmentStatusIn(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.VolumeAttachmentIn().Status(ctx, &it, data); err != nil { + return it, err + } + } + } + + return it, nil +} + +// endregion **************************** input.gotpl ***************************** + +// region ************************** interface.gotpl *************************** + +// endregion ************************** interface.gotpl *************************** + +// region **************************** object.gotpl **************************** + +var checkAwsAccessOutputImplementors = []string{"CheckAwsAccessOutput"} + +func (ec *executionContext) _CheckAwsAccessOutput(ctx context.Context, sel ast.SelectionSet, obj *model.CheckAwsAccessOutput) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, checkAwsAccessOutputImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("CheckAwsAccessOutput") + case "result": + + out.Values[i] = ec._CheckAwsAccessOutput_result(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "installationUrl": + + out.Values[i] = ec._CheckAwsAccessOutput_installationUrl(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var checkNameAvailabilityOutputImplementors = []string{"CheckNameAvailabilityOutput"} + +func (ec *executionContext) _CheckNameAvailabilityOutput(ctx context.Context, sel ast.SelectionSet, obj *domain.CheckNameAvailabilityOutput) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, checkNameAvailabilityOutputImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("CheckNameAvailabilityOutput") + case "result": + + out.Values[i] = ec._CheckNameAvailabilityOutput_result(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "suggestedNames": + + out.Values[i] = ec._CheckNameAvailabilityOutput_suggestedNames(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var cloudProviderSecretImplementors = []string{"CloudProviderSecret"} + +func (ec *executionContext) _CloudProviderSecret(ctx context.Context, sel ast.SelectionSet, obj *entities.CloudProviderSecret) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, cloudProviderSecretImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("CloudProviderSecret") + case "accountName": + + out.Values[i] = ec._CloudProviderSecret_accountName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "aws": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._CloudProviderSecret_aws(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "cloudProviderName": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._CloudProviderSecret_cloudProviderName(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "createdBy": + + out.Values[i] = ec._CloudProviderSecret_createdBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "creationTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._CloudProviderSecret_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "displayName": + + out.Values[i] = ec._CloudProviderSecret_displayName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "id": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._CloudProviderSecret_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "lastUpdatedBy": + + out.Values[i] = ec._CloudProviderSecret_lastUpdatedBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "markedForDeletion": + + out.Values[i] = ec._CloudProviderSecret_markedForDeletion(ctx, field, obj) + + case "metadata": + + out.Values[i] = ec._CloudProviderSecret_metadata(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "recordVersion": + + out.Values[i] = ec._CloudProviderSecret_recordVersion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "updateTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._CloudProviderSecret_updateTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var cloudProviderSecretEdgeImplementors = []string{"CloudProviderSecretEdge"} + +func (ec *executionContext) _CloudProviderSecretEdge(ctx context.Context, sel ast.SelectionSet, obj *model.CloudProviderSecretEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, cloudProviderSecretEdgeImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("CloudProviderSecretEdge") + case "cursor": + + out.Values[i] = ec._CloudProviderSecretEdge_cursor(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "node": + + out.Values[i] = ec._CloudProviderSecretEdge_node(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var cloudProviderSecretPaginatedRecordsImplementors = []string{"CloudProviderSecretPaginatedRecords"} + +func (ec *executionContext) _CloudProviderSecretPaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.CloudProviderSecretPaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, cloudProviderSecretPaginatedRecordsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("CloudProviderSecretPaginatedRecords") + case "edges": + + out.Values[i] = ec._CloudProviderSecretPaginatedRecords_edges(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "pageInfo": + + out.Values[i] = ec._CloudProviderSecretPaginatedRecords_pageInfo(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "totalCount": + + out.Values[i] = ec._CloudProviderSecretPaginatedRecords_totalCount(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var clusterImplementors = []string{"Cluster"} + +func (ec *executionContext) _Cluster(ctx context.Context, sel ast.SelectionSet, obj *entities.Cluster) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, clusterImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Cluster") + case "accountName": + + out.Values[i] = ec._Cluster_accountName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "apiVersion": + + out.Values[i] = ec._Cluster_apiVersion(ctx, field, obj) + + case "createdBy": + + out.Values[i] = ec._Cluster_createdBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "creationTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Cluster_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "displayName": + + out.Values[i] = ec._Cluster_displayName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "id": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Cluster_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "kind": + + out.Values[i] = ec._Cluster_kind(ctx, field, obj) + + case "lastUpdatedBy": + + out.Values[i] = ec._Cluster_lastUpdatedBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "markedForDeletion": + + out.Values[i] = ec._Cluster_markedForDeletion(ctx, field, obj) + + case "metadata": + + out.Values[i] = ec._Cluster_metadata(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "recordVersion": + + out.Values[i] = ec._Cluster_recordVersion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "spec": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Cluster_spec(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "status": + + out.Values[i] = ec._Cluster_status(ctx, field, obj) + + case "syncStatus": + + out.Values[i] = ec._Cluster_syncStatus(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "updateTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Cluster_updateTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "adminKubeconfig": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Cluster_adminKubeconfig(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var clusterEdgeImplementors = []string{"ClusterEdge"} + +func (ec *executionContext) _ClusterEdge(ctx context.Context, sel ast.SelectionSet, obj *model.ClusterEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, clusterEdgeImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ClusterEdge") + case "cursor": + + out.Values[i] = ec._ClusterEdge_cursor(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "node": + + out.Values[i] = ec._ClusterEdge_node(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var clusterManagedServiceImplementors = []string{"ClusterManagedService"} + +func (ec *executionContext) _ClusterManagedService(ctx context.Context, sel ast.SelectionSet, obj *entities.ClusterManagedService) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, clusterManagedServiceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ClusterManagedService") + case "accountName": + + out.Values[i] = ec._ClusterManagedService_accountName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "apiVersion": + + out.Values[i] = ec._ClusterManagedService_apiVersion(ctx, field, obj) + + case "clusterName": + + out.Values[i] = ec._ClusterManagedService_clusterName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "createdBy": + + out.Values[i] = ec._ClusterManagedService_createdBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "creationTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ClusterManagedService_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "displayName": + + out.Values[i] = ec._ClusterManagedService_displayName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "id": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ClusterManagedService_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "kind": + + out.Values[i] = ec._ClusterManagedService_kind(ctx, field, obj) + + case "lastUpdatedBy": + + out.Values[i] = ec._ClusterManagedService_lastUpdatedBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "markedForDeletion": + + out.Values[i] = ec._ClusterManagedService_markedForDeletion(ctx, field, obj) + + case "metadata": + + out.Values[i] = ec._ClusterManagedService_metadata(ctx, field, obj) + + case "recordVersion": + + out.Values[i] = ec._ClusterManagedService_recordVersion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "spec": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ClusterManagedService_spec(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "status": + + out.Values[i] = ec._ClusterManagedService_status(ctx, field, obj) + + case "syncStatus": + + out.Values[i] = ec._ClusterManagedService_syncStatus(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "updateTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ClusterManagedService_updateTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var clusterManagedServiceEdgeImplementors = []string{"ClusterManagedServiceEdge"} + +func (ec *executionContext) _ClusterManagedServiceEdge(ctx context.Context, sel ast.SelectionSet, obj *model.ClusterManagedServiceEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, clusterManagedServiceEdgeImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ClusterManagedServiceEdge") + case "cursor": + + out.Values[i] = ec._ClusterManagedServiceEdge_cursor(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "node": + + out.Values[i] = ec._ClusterManagedServiceEdge_node(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var clusterManagedServicePaginatedRecordsImplementors = []string{"ClusterManagedServicePaginatedRecords"} + +func (ec *executionContext) _ClusterManagedServicePaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.ClusterManagedServicePaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, clusterManagedServicePaginatedRecordsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ClusterManagedServicePaginatedRecords") + case "edges": + + out.Values[i] = ec._ClusterManagedServicePaginatedRecords_edges(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "pageInfo": + + out.Values[i] = ec._ClusterManagedServicePaginatedRecords_pageInfo(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "totalCount": + + out.Values[i] = ec._ClusterManagedServicePaginatedRecords_totalCount(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var clusterPaginatedRecordsImplementors = []string{"ClusterPaginatedRecords"} + +func (ec *executionContext) _ClusterPaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.ClusterPaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, clusterPaginatedRecordsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ClusterPaginatedRecords") + case "edges": + + out.Values[i] = ec._ClusterPaginatedRecords_edges(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "pageInfo": + + out.Values[i] = ec._ClusterPaginatedRecords_pageInfo(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "totalCount": + + out.Values[i] = ec._ClusterPaginatedRecords_totalCount(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var cursorPaginationImplementors = []string{"CursorPagination"} + +func (ec *executionContext) _CursorPagination(ctx context.Context, sel ast.SelectionSet, obj *repos.CursorPagination) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, cursorPaginationImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("CursorPagination") + case "after": + + out.Values[i] = ec._CursorPagination_after(ctx, field, obj) + + case "before": + + out.Values[i] = ec._CursorPagination_before(ctx, field, obj) + + case "first": + + out.Values[i] = ec._CursorPagination_first(ctx, field, obj) + + case "last": + + out.Values[i] = ec._CursorPagination_last(ctx, field, obj) + + case "orderBy": + + out.Values[i] = ec._CursorPagination_orderBy(ctx, field, obj) + + case "sortDirection": + + out.Values[i] = ec._CursorPagination_sortDirection(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var domainEntryImplementors = []string{"DomainEntry"} + +func (ec *executionContext) _DomainEntry(ctx context.Context, sel ast.SelectionSet, obj *entities.DomainEntry) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, domainEntryImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("DomainEntry") + case "accountName": + + out.Values[i] = ec._DomainEntry_accountName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "clusterName": + + out.Values[i] = ec._DomainEntry_clusterName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "createdBy": + + out.Values[i] = ec._DomainEntry_createdBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "creationTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._DomainEntry_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "displayName": + + out.Values[i] = ec._DomainEntry_displayName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "domainName": + + out.Values[i] = ec._DomainEntry_domainName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "id": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._DomainEntry_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "lastUpdatedBy": + + out.Values[i] = ec._DomainEntry_lastUpdatedBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "markedForDeletion": + + out.Values[i] = ec._DomainEntry_markedForDeletion(ctx, field, obj) + + case "recordVersion": + + out.Values[i] = ec._DomainEntry_recordVersion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "updateTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._DomainEntry_updateTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var domainEntryEdgeImplementors = []string{"DomainEntryEdge"} + +func (ec *executionContext) _DomainEntryEdge(ctx context.Context, sel ast.SelectionSet, obj *model.DomainEntryEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, domainEntryEdgeImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("DomainEntryEdge") + case "cursor": + + out.Values[i] = ec._DomainEntryEdge_cursor(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "node": + + out.Values[i] = ec._DomainEntryEdge_node(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var domainEntryPaginatedRecordsImplementors = []string{"DomainEntryPaginatedRecords"} + +func (ec *executionContext) _DomainEntryPaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.DomainEntryPaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, domainEntryPaginatedRecordsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("DomainEntryPaginatedRecords") + case "edges": + + out.Values[i] = ec._DomainEntryPaginatedRecords_edges(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "pageInfo": + + out.Values[i] = ec._DomainEntryPaginatedRecords_pageInfo(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "totalCount": + + out.Values[i] = ec._DomainEntryPaginatedRecords_totalCount(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var encodedValueImplementors = []string{"EncodedValue"} + +func (ec *executionContext) _EncodedValue(ctx context.Context, sel ast.SelectionSet, obj *model.EncodedValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, encodedValueImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("EncodedValue") + case "value": + + out.Values[i] = ec._EncodedValue_value(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "encoding": + + out.Values[i] = ec._EncodedValue_encoding(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentialsImplementors = []string{"Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials"} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesAWSSecretCredentials) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentialsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials") + case "accessKey": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_accessKey(ctx, field, obj) + + case "awsAccountId": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_awsAccountId(ctx, field, obj) + + case "cfParamExternalID": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_cfParamExternalID(ctx, field, obj) + + case "cfParamInstanceProfileName": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_cfParamInstanceProfileName(ctx, field, obj) + + case "cfParamRoleName": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_cfParamRoleName(ctx, field, obj) + + case "cfParamStackName": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_cfParamStackName(ctx, field, obj) + + case "cfParamTrustedARN": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_cfParamTrustedARN(ctx, field, obj) + + case "secretKey": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials_secretKey(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___api___apps___infra___internal___entities__InputFieldImplementors = []string{"Github__com___kloudlite___api___apps___infra___internal___entities__InputField"} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__InputField(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesInputField) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___api___apps___infra___internal___entities__InputFieldImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___api___apps___infra___internal___entities__InputField") + case "defaultValue": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__InputField_defaultValue(ctx, field, obj) + + case "displayUnit": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__InputField_displayUnit(ctx, field, obj) + + case "inputType": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__InputField_inputType(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "label": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__InputField_label(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "max": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__InputField_max(ctx, field, obj) + + case "min": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__InputField_min(ctx, field, obj) + + case "multiplier": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__InputField_multiplier(ctx, field, obj) + + case "name": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__InputField_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "required": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__InputField_required(ctx, field, obj) + + case "unit": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__InputField_unit(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___api___apps___infra___internal___entities__MresTemplateImplementors = []string{"Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate"} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesMresTemplate) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___api___apps___infra___internal___entities__MresTemplateImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate") + case "apiVersion": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_apiVersion(ctx, field, obj) + + case "description": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_description(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "displayName": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_displayName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "fields": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_fields(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "kind": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_kind(ctx, field, obj) + + case "name": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "outputs": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate_outputs(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntryImplementors = []string{"Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry"} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry(ctx context.Context, sel ast.SelectionSet, obj *entities.MsvcTemplateEntry) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntryImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry") + case "active": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_active(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "apiVersion": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_apiVersion(ctx, field, obj) + + case "description": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_description(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "displayName": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_displayName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "fields": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_fields(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "kind": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_kind(ctx, field, obj) + + case "logoUrl": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_logoUrl(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "name": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "outputs": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_outputs(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "resources": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry_resources(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___api___apps___infra___internal___entities__OutputFieldImplementors = []string{"Github__com___kloudlite___api___apps___infra___internal___entities__OutputField"} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__OutputField(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesOutputField) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___api___apps___infra___internal___entities__OutputFieldImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___api___apps___infra___internal___entities__OutputField") + case "description": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__OutputField_description(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "label": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__OutputField_label(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "name": + + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__OutputField_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___api___common__CreatedOrUpdatedByImplementors = []string{"Github__com___kloudlite___api___common__CreatedOrUpdatedBy"} + +func (ec *executionContext) _Github__com___kloudlite___api___common__CreatedOrUpdatedBy(ctx context.Context, sel ast.SelectionSet, obj *common.CreatedOrUpdatedBy) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___api___common__CreatedOrUpdatedByImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___api___common__CreatedOrUpdatedBy") + case "userEmail": + + out.Values[i] = ec._Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "userId": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "userName": + + out.Values[i] = ec._Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___api___pkg___types__SyncStatusImplementors = []string{"Github__com___kloudlite___api___pkg___types__SyncStatus"} + +func (ec *executionContext) _Github__com___kloudlite___api___pkg___types__SyncStatus(ctx context.Context, sel ast.SelectionSet, obj *types.SyncStatus) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___api___pkg___types__SyncStatusImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___api___pkg___types__SyncStatus") + case "action": + + out.Values[i] = ec._Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "error": + + out.Values[i] = ec._Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx, field, obj) + + case "lastSyncedAt": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "recordVersion": + + out.Values[i] = ec._Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "state": + + out.Values[i] = ec._Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "syncScheduledAt": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfigImplementors = []string{"Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisClustersV1AWSClusterConfig) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfigImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig") + case "k3sMasters": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig_k3sMasters(ctx, field, obj) + + case "nodePools": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig_nodePools(ctx, field, obj) + + case "region": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig_region(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "spotNodePools": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig_spotNodePools(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfigImplementors = []string{"Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisClustersV1AWSK3sMastersConfig) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfigImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig") + case "iamInstanceProfileRole": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_iamInstanceProfileRole(ctx, field, obj) + + case "imageId": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_imageId(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "imageSSHUsername": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_imageSSHUsername(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "instanceType": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_instanceType(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "nodes": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_nodes(ctx, field, obj) + + case "nvidiaGpuEnabled": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_nvidiaGpuEnabled(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "rootVolumeSize": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_rootVolumeSize(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "rootVolumeType": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig_rootVolumeType(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfigImplementors = []string{"Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisClustersV1AWSNodePoolConfig) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfigImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig") + case "availabilityZone": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_availabilityZone(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "ec2Pool": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_ec2Pool(ctx, field, obj) + + case "iamInstanceProfileRole": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_iamInstanceProfileRole(ctx, field, obj) + + case "imageId": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_imageId(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "imageSSHUsername": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_imageSSHUsername(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "nvidiaGpuEnabled": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_nvidiaGpuEnabled(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "poolType": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_poolType(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "rootVolumeSize": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_rootVolumeSize(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "rootVolumeType": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_rootVolumeType(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "spotPool": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig_spotPool(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfigImplementors = []string{"Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisClustersV1AwsEC2PoolConfig) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfigImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig") + case "instanceType": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig_instanceType(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "nodes": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig_nodes(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNodeImplementors = []string{"Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisClustersV1AwsSpotCPUNode) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNodeImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode") + case "memoryPerVcpu": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode_memoryPerVcpu(ctx, field, obj) + + case "vcpu": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode_vcpu(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNodeImplementors = []string{"Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNode"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNode(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisClustersV1AwsSpotGpuNode) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNodeImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNode") + case "instanceTypes": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNode_instanceTypes(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfigImplementors = []string{"Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisClustersV1AwsSpotPoolConfig) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfigImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig") + case "cpuNode": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig_cpuNode(ctx, field, obj) + + case "gpuNode": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig_gpuNode(ctx, field, obj) + + case "nodes": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig_nodes(ctx, field, obj) + + case "spotFleetTaggingRoleName": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig_spotFleetTaggingRoleName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeysImplementors = []string{"Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisClustersV1CloudProviderCredentialKeys) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeysImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys") + case "keyAccessKey": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keyAccessKey(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "keyAWSAccountId": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keyAWSAccountId(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "keyAWSAssumeRoleExternalID": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keyAWSAssumeRoleExternalID(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "keyAWSAssumeRoleRoleARN": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keyAWSAssumeRoleRoleARN(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "keyIAMInstanceProfileRole": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keyIAMInstanceProfileRole(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "keySecretKey": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys_keySecretKey(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___apis___clusters___v1__ClusterOutputImplementors = []string{"Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisClustersV1ClusterOutput) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___clusters___v1__ClusterOutputImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput") + case "jobName": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_jobName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "jobNamespace": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_jobNamespace(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "keyK3sAgentJoinToken": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_keyK3sAgentJoinToken(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "keyK3sServerJoinToken": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_keyK3sServerJoinToken(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "keyKubeconfig": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_keyKubeconfig(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "secretName": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput_secretName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___apis___clusters___v1__ClusterSpecImplementors = []string{"Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisClustersV1ClusterSpec) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___clusters___v1__ClusterSpecImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec") + case "accountId": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_accountId(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "accountName": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_accountName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "availabilityMode": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_availabilityMode(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "aws": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_aws(ctx, field, obj) + + case "backupToS3Enabled": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_backupToS3Enabled(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "cloudflareEnabled": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_cloudflareEnabled(ctx, field, obj) + + case "cloudProvider": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_cloudProvider(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "clusterInternalDnsHost": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_clusterInternalDnsHost(ctx, field, obj) + + case "clusterTokenRef": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_clusterTokenRef(ctx, field, obj) + + case "credentialKeys": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_credentialKeys(ctx, field, obj) + + case "credentialsRef": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_credentialsRef(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "kloudliteRelease": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_kloudliteRelease(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "messageQueueTopicName": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_messageQueueTopicName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "output": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_output(ctx, field, obj) + + case "publicDNSHost": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_publicDNSHost(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "taintMasterNodes": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_taintMasterNodes(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCodeImplementors = []string{"Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisClustersV1InfrastuctureAsCode) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCodeImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode") + case "cloudProviderAccessKey": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_cloudProviderAccessKey(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "cloudProviderSecretKey": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_cloudProviderSecretKey(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "jobName": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_jobName(ctx, field, obj) + + case "jobNamespace": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_jobNamespace(ctx, field, obj) + + case "stateS3BucketFilePath": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_stateS3BucketFilePath(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "stateS3BucketName": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_stateS3BucketName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "stateS3BucketRegion": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode_stateS3BucketRegion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___apis___clusters___v1__MasterNodePropsImplementors = []string{"Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisClustersV1MasterNodeProps) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___clusters___v1__MasterNodePropsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps") + case "availabilityZone": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps_availabilityZone(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "lastRecreatedAt": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps_lastRecreatedAt(ctx, field, obj) + + case "role": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps_role(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpecImplementors = []string{"Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisClustersV1NodePoolSpec) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpecImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec") + case "aws": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_aws(ctx, field, obj) + + case "cloudProvider": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_cloudProvider(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "iac": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_iac(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "maxCount": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_maxCount(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "minCount": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_minCount(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "nodeLabels": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_nodeLabels(ctx, field, obj) + + case "nodeTaints": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec_nodeTaints(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___apis___clusters___v1__NodePropsImplementors = []string{"Github__com___kloudlite___operator___apis___clusters___v1__NodeProps"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__NodeProps(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisClustersV1NodeProps) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___clusters___v1__NodePropsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___clusters___v1__NodeProps") + case "lastRecreatedAt": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__NodeProps_lastRecreatedAt(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___apis___clusters___v1__NodeSpecImplementors = []string{"Github__com___kloudlite___operator___apis___clusters___v1__NodeSpec"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__NodeSpec(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisClustersV1NodeSpec) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___clusters___v1__NodeSpecImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___clusters___v1__NodeSpec") + case "nodepoolName": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__NodeSpec_nodepoolName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___apis___common____types__MinMaxFloatImplementors = []string{"Github__com___kloudlite___operator___apis___common____types__MinMaxFloat"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___common____types__MinMaxFloat(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCommonTypesMinMaxFloat) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___common____types__MinMaxFloatImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___common____types__MinMaxFloat") + case "max": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___common____types__MinMaxFloat_max(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "min": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___common____types__MinMaxFloat_min(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___apis___common____types__SecretKeyRefImplementors = []string{"Github__com___kloudlite___operator___apis___common____types__SecretKeyRef"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___common____types__SecretKeyRef(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCommonTypesSecretKeyRef) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___common____types__SecretKeyRefImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___common____types__SecretKeyRef") + case "key": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___common____types__SecretKeyRef_key(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "name": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___common____types__SecretKeyRef_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "namespace": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___common____types__SecretKeyRef_namespace(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___apis___common____types__SecretRefImplementors = []string{"Github__com___kloudlite___operator___apis___common____types__SecretRef"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___common____types__SecretRef(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCommonTypesSecretRef) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___common____types__SecretRefImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___common____types__SecretRef") + case "name": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___common____types__SecretRef_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "namespace": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___common____types__SecretRef_namespace(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpecImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1ClusterManagedServiceSpec) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpecImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec") + case "msvcSpec": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec_msvcSpec(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "targetNamespace": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec_targetNamespace(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___apis___crds___v1__HelmChartSpecImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1HelmChartSpec) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__HelmChartSpecImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec") + case "chartName": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_chartName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "chartRepoURL": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_chartRepoURL(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "chartVersion": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_chartVersion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "jobVars": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_jobVars(ctx, field, obj) + + case "postInstall": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_postInstall(ctx, field, obj) + + case "postUninstall": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_postUninstall(ctx, field, obj) + + case "preInstall": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_preInstall(ctx, field, obj) + + case "preUninstall": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_preUninstall(ctx, field, obj) + + case "values": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec_values(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___apis___crds___v1__HelmChartStatusImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1HelmChartStatus) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__HelmChartStatusImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus") + case "checks": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_checks(ctx, field, obj) + + case "isReady": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_isReady(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "lastReadyGeneration": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_lastReadyGeneration(ctx, field, obj) + + case "lastReconcileTime": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_lastReconcileTime(ctx, field, obj) + + case "message": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_message(ctx, field, obj) + + case "releaseNotes": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_releaseNotes(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "releaseStatus": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_releaseStatus(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "resources": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_resources(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___apis___crds___v1__JobVarsImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__JobVars"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__JobVars(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1JobVars) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__JobVarsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__JobVars") + case "affinity": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__JobVars_affinity(ctx, field, obj) + + case "backOffLimit": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__JobVars_backOffLimit(ctx, field, obj) + + case "nodeSelector": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__JobVars_nodeSelector(ctx, field, obj) + + case "tolerations": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__JobVars_tolerations(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpec) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec") + case "serviceTemplate": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec_serviceTemplate(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___apis___crds___v1__ServiceTemplateImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1ServiceTemplate) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__ServiceTemplateImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate") + case "apiVersion": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_apiVersion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "kind": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_kind(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "spec": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_spec(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___pkg___operator__CheckImplementors = []string{"Github__com___kloudlite___operator___pkg___operator__Check"} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Check(ctx context.Context, sel ast.SelectionSet, obj *operator.Check) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___pkg___operator__CheckImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___pkg___operator__Check") + case "generation": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_generation(ctx, field, obj) + + case "message": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_message(ctx, field, obj) + + case "status": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_status(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___pkg___operator__ResourceRefImplementors = []string{"Github__com___kloudlite___operator___pkg___operator__ResourceRef"} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__ResourceRef(ctx context.Context, sel ast.SelectionSet, obj *operator.ResourceRef) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___pkg___operator__ResourceRefImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___pkg___operator__ResourceRef") + case "apiVersion": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__ResourceRef_apiVersion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "kind": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__ResourceRef_kind(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "name": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__ResourceRef_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "namespace": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__ResourceRef_namespace(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___pkg___operator__StatusImplementors = []string{"Github__com___kloudlite___operator___pkg___operator__Status"} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Status(ctx context.Context, sel ast.SelectionSet, obj *operator.Status) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___pkg___operator__StatusImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___pkg___operator__Status") + case "checks": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "isReady": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Status_isReady(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "lastReadyGeneration": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Status_lastReadyGeneration(ctx, field, obj) + + case "lastReconcileTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Github__com___kloudlite___operator___pkg___operator__Status_lastReconcileTime(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "message": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Github__com___kloudlite___operator___pkg___operator__Status_message(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "resources": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Status_resources(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___pkg___raw____json__RawJsonImplementors = []string{"Github__com___kloudlite___operator___pkg___raw____json__RawJson"} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___raw____json__RawJson(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorPkgRawJSONRawJSON) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___pkg___raw____json__RawJsonImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___pkg___raw____json__RawJson") + case "RawMessage": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___raw____json__RawJson_RawMessage(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var helmReleaseImplementors = []string{"HelmRelease"} + +func (ec *executionContext) _HelmRelease(ctx context.Context, sel ast.SelectionSet, obj *entities.HelmRelease) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, helmReleaseImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("HelmRelease") + case "accountName": + + out.Values[i] = ec._HelmRelease_accountName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "apiVersion": + + out.Values[i] = ec._HelmRelease_apiVersion(ctx, field, obj) + + case "clusterName": + + out.Values[i] = ec._HelmRelease_clusterName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "createdBy": + + out.Values[i] = ec._HelmRelease_createdBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "creationTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._HelmRelease_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "displayName": + + out.Values[i] = ec._HelmRelease_displayName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "id": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._HelmRelease_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "kind": + + out.Values[i] = ec._HelmRelease_kind(ctx, field, obj) + + case "lastUpdatedBy": + + out.Values[i] = ec._HelmRelease_lastUpdatedBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "markedForDeletion": + + out.Values[i] = ec._HelmRelease_markedForDeletion(ctx, field, obj) + + case "metadata": + + out.Values[i] = ec._HelmRelease_metadata(ctx, field, obj) + + case "recordVersion": + + out.Values[i] = ec._HelmRelease_recordVersion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "spec": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._HelmRelease_spec(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "status": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._HelmRelease_status(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "syncStatus": + + out.Values[i] = ec._HelmRelease_syncStatus(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "updateTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._HelmRelease_updateTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var helmReleaseEdgeImplementors = []string{"HelmReleaseEdge"} + +func (ec *executionContext) _HelmReleaseEdge(ctx context.Context, sel ast.SelectionSet, obj *model.HelmReleaseEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, helmReleaseEdgeImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("HelmReleaseEdge") + case "cursor": + + out.Values[i] = ec._HelmReleaseEdge_cursor(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "node": + + out.Values[i] = ec._HelmReleaseEdge_node(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var helmReleasePaginatedRecordsImplementors = []string{"HelmReleasePaginatedRecords"} + +func (ec *executionContext) _HelmReleasePaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.HelmReleasePaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, helmReleasePaginatedRecordsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("HelmReleasePaginatedRecords") + case "edges": + + out.Values[i] = ec._HelmReleasePaginatedRecords_edges(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "pageInfo": + + out.Values[i] = ec._HelmReleasePaginatedRecords_pageInfo(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "totalCount": + + out.Values[i] = ec._HelmReleasePaginatedRecords_totalCount(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__AWSElasticBlockStoreVolumeSourceImplementors = []string{"K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource"} + +func (ec *executionContext) _K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1AWSElasticBlockStoreVolumeSource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__AWSElasticBlockStoreVolumeSourceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource") + case "fsType": + + out.Values[i] = ec._K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource_fsType(ctx, field, obj) + + case "partition": + + out.Values[i] = ec._K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource_partition(ctx, field, obj) + + case "readOnly": + + out.Values[i] = ec._K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource_readOnly(ctx, field, obj) + + case "volumeID": + + out.Values[i] = ec._K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource_volumeID(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__AffinityImplementors = []string{"K8s__io___api___core___v1__Affinity"} + +func (ec *executionContext) _K8s__io___api___core___v1__Affinity(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1Affinity) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__AffinityImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__Affinity") + case "nodeAffinity": + + out.Values[i] = ec._K8s__io___api___core___v1__Affinity_nodeAffinity(ctx, field, obj) + + case "podAffinity": + + out.Values[i] = ec._K8s__io___api___core___v1__Affinity_podAffinity(ctx, field, obj) + + case "podAntiAffinity": + + out.Values[i] = ec._K8s__io___api___core___v1__Affinity_podAntiAffinity(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__AzureDiskVolumeSourceImplementors = []string{"K8s__io___api___core___v1__AzureDiskVolumeSource"} + +func (ec *executionContext) _K8s__io___api___core___v1__AzureDiskVolumeSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1AzureDiskVolumeSource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__AzureDiskVolumeSourceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__AzureDiskVolumeSource") + case "cachingMode": + + out.Values[i] = ec._K8s__io___api___core___v1__AzureDiskVolumeSource_cachingMode(ctx, field, obj) + + case "diskName": + + out.Values[i] = ec._K8s__io___api___core___v1__AzureDiskVolumeSource_diskName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "diskURI": + + out.Values[i] = ec._K8s__io___api___core___v1__AzureDiskVolumeSource_diskURI(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "fsType": + + out.Values[i] = ec._K8s__io___api___core___v1__AzureDiskVolumeSource_fsType(ctx, field, obj) + + case "kind": + + out.Values[i] = ec._K8s__io___api___core___v1__AzureDiskVolumeSource_kind(ctx, field, obj) + + case "readOnly": + + out.Values[i] = ec._K8s__io___api___core___v1__AzureDiskVolumeSource_readOnly(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__AzureFilePersistentVolumeSourceImplementors = []string{"K8s__io___api___core___v1__AzureFilePersistentVolumeSource"} + +func (ec *executionContext) _K8s__io___api___core___v1__AzureFilePersistentVolumeSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1AzureFilePersistentVolumeSource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__AzureFilePersistentVolumeSourceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__AzureFilePersistentVolumeSource") + case "readOnly": + + out.Values[i] = ec._K8s__io___api___core___v1__AzureFilePersistentVolumeSource_readOnly(ctx, field, obj) + + case "secretName": + + out.Values[i] = ec._K8s__io___api___core___v1__AzureFilePersistentVolumeSource_secretName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "secretNamespace": + + out.Values[i] = ec._K8s__io___api___core___v1__AzureFilePersistentVolumeSource_secretNamespace(ctx, field, obj) + + case "shareName": + + out.Values[i] = ec._K8s__io___api___core___v1__AzureFilePersistentVolumeSource_shareName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__CSIPersistentVolumeSourceImplementors = []string{"K8s__io___api___core___v1__CSIPersistentVolumeSource"} + +func (ec *executionContext) _K8s__io___api___core___v1__CSIPersistentVolumeSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1CSIPersistentVolumeSource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__CSIPersistentVolumeSourceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__CSIPersistentVolumeSource") + case "controllerExpandSecretRef": + + out.Values[i] = ec._K8s__io___api___core___v1__CSIPersistentVolumeSource_controllerExpandSecretRef(ctx, field, obj) + + case "controllerPublishSecretRef": + + out.Values[i] = ec._K8s__io___api___core___v1__CSIPersistentVolumeSource_controllerPublishSecretRef(ctx, field, obj) + + case "driver": + + out.Values[i] = ec._K8s__io___api___core___v1__CSIPersistentVolumeSource_driver(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "fsType": + + out.Values[i] = ec._K8s__io___api___core___v1__CSIPersistentVolumeSource_fsType(ctx, field, obj) + + case "nodeExpandSecretRef": + + out.Values[i] = ec._K8s__io___api___core___v1__CSIPersistentVolumeSource_nodeExpandSecretRef(ctx, field, obj) + + case "nodePublishSecretRef": + + out.Values[i] = ec._K8s__io___api___core___v1__CSIPersistentVolumeSource_nodePublishSecretRef(ctx, field, obj) + + case "nodeStageSecretRef": + + out.Values[i] = ec._K8s__io___api___core___v1__CSIPersistentVolumeSource_nodeStageSecretRef(ctx, field, obj) + + case "readOnly": + + out.Values[i] = ec._K8s__io___api___core___v1__CSIPersistentVolumeSource_readOnly(ctx, field, obj) + + case "volumeAttributes": + + out.Values[i] = ec._K8s__io___api___core___v1__CSIPersistentVolumeSource_volumeAttributes(ctx, field, obj) + + case "volumeHandle": + + out.Values[i] = ec._K8s__io___api___core___v1__CSIPersistentVolumeSource_volumeHandle(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__CephFSPersistentVolumeSourceImplementors = []string{"K8s__io___api___core___v1__CephFSPersistentVolumeSource"} + +func (ec *executionContext) _K8s__io___api___core___v1__CephFSPersistentVolumeSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1CephFSPersistentVolumeSource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__CephFSPersistentVolumeSourceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__CephFSPersistentVolumeSource") + case "monitors": + + out.Values[i] = ec._K8s__io___api___core___v1__CephFSPersistentVolumeSource_monitors(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "path": + + out.Values[i] = ec._K8s__io___api___core___v1__CephFSPersistentVolumeSource_path(ctx, field, obj) + + case "readOnly": + + out.Values[i] = ec._K8s__io___api___core___v1__CephFSPersistentVolumeSource_readOnly(ctx, field, obj) + + case "secretFile": + + out.Values[i] = ec._K8s__io___api___core___v1__CephFSPersistentVolumeSource_secretFile(ctx, field, obj) + + case "secretRef": + + out.Values[i] = ec._K8s__io___api___core___v1__CephFSPersistentVolumeSource_secretRef(ctx, field, obj) + + case "user": + + out.Values[i] = ec._K8s__io___api___core___v1__CephFSPersistentVolumeSource_user(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__CinderPersistentVolumeSourceImplementors = []string{"K8s__io___api___core___v1__CinderPersistentVolumeSource"} + +func (ec *executionContext) _K8s__io___api___core___v1__CinderPersistentVolumeSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1CinderPersistentVolumeSource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__CinderPersistentVolumeSourceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__CinderPersistentVolumeSource") + case "fsType": + + out.Values[i] = ec._K8s__io___api___core___v1__CinderPersistentVolumeSource_fsType(ctx, field, obj) + + case "readOnly": + + out.Values[i] = ec._K8s__io___api___core___v1__CinderPersistentVolumeSource_readOnly(ctx, field, obj) + + case "secretRef": + + out.Values[i] = ec._K8s__io___api___core___v1__CinderPersistentVolumeSource_secretRef(ctx, field, obj) + + case "volumeID": + + out.Values[i] = ec._K8s__io___api___core___v1__CinderPersistentVolumeSource_volumeID(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__FCVolumeSourceImplementors = []string{"K8s__io___api___core___v1__FCVolumeSource"} + +func (ec *executionContext) _K8s__io___api___core___v1__FCVolumeSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1FCVolumeSource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__FCVolumeSourceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__FCVolumeSource") + case "fsType": + + out.Values[i] = ec._K8s__io___api___core___v1__FCVolumeSource_fsType(ctx, field, obj) + + case "lun": + + out.Values[i] = ec._K8s__io___api___core___v1__FCVolumeSource_lun(ctx, field, obj) + + case "readOnly": + + out.Values[i] = ec._K8s__io___api___core___v1__FCVolumeSource_readOnly(ctx, field, obj) + + case "targetWWNs": + + out.Values[i] = ec._K8s__io___api___core___v1__FCVolumeSource_targetWWNs(ctx, field, obj) + + case "wwids": + + out.Values[i] = ec._K8s__io___api___core___v1__FCVolumeSource_wwids(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__FlexPersistentVolumeSourceImplementors = []string{"K8s__io___api___core___v1__FlexPersistentVolumeSource"} + +func (ec *executionContext) _K8s__io___api___core___v1__FlexPersistentVolumeSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1FlexPersistentVolumeSource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__FlexPersistentVolumeSourceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__FlexPersistentVolumeSource") + case "driver": + + out.Values[i] = ec._K8s__io___api___core___v1__FlexPersistentVolumeSource_driver(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "fsType": + + out.Values[i] = ec._K8s__io___api___core___v1__FlexPersistentVolumeSource_fsType(ctx, field, obj) + + case "options": + + out.Values[i] = ec._K8s__io___api___core___v1__FlexPersistentVolumeSource_options(ctx, field, obj) + + case "readOnly": + + out.Values[i] = ec._K8s__io___api___core___v1__FlexPersistentVolumeSource_readOnly(ctx, field, obj) + + case "secretRef": + + out.Values[i] = ec._K8s__io___api___core___v1__FlexPersistentVolumeSource_secretRef(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__FlockerVolumeSourceImplementors = []string{"K8s__io___api___core___v1__FlockerVolumeSource"} + +func (ec *executionContext) _K8s__io___api___core___v1__FlockerVolumeSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1FlockerVolumeSource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__FlockerVolumeSourceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__FlockerVolumeSource") + case "datasetName": + + out.Values[i] = ec._K8s__io___api___core___v1__FlockerVolumeSource_datasetName(ctx, field, obj) + + case "datasetUUID": + + out.Values[i] = ec._K8s__io___api___core___v1__FlockerVolumeSource_datasetUUID(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__GCEPersistentDiskVolumeSourceImplementors = []string{"K8s__io___api___core___v1__GCEPersistentDiskVolumeSource"} + +func (ec *executionContext) _K8s__io___api___core___v1__GCEPersistentDiskVolumeSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1GCEPersistentDiskVolumeSource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__GCEPersistentDiskVolumeSourceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__GCEPersistentDiskVolumeSource") + case "fsType": + + out.Values[i] = ec._K8s__io___api___core___v1__GCEPersistentDiskVolumeSource_fsType(ctx, field, obj) + + case "partition": + + out.Values[i] = ec._K8s__io___api___core___v1__GCEPersistentDiskVolumeSource_partition(ctx, field, obj) + + case "pdName": + + out.Values[i] = ec._K8s__io___api___core___v1__GCEPersistentDiskVolumeSource_pdName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "readOnly": + + out.Values[i] = ec._K8s__io___api___core___v1__GCEPersistentDiskVolumeSource_readOnly(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__GlusterfsPersistentVolumeSourceImplementors = []string{"K8s__io___api___core___v1__GlusterfsPersistentVolumeSource"} + +func (ec *executionContext) _K8s__io___api___core___v1__GlusterfsPersistentVolumeSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1GlusterfsPersistentVolumeSource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__GlusterfsPersistentVolumeSourceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__GlusterfsPersistentVolumeSource") + case "endpoints": + + out.Values[i] = ec._K8s__io___api___core___v1__GlusterfsPersistentVolumeSource_endpoints(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "endpointsNamespace": + + out.Values[i] = ec._K8s__io___api___core___v1__GlusterfsPersistentVolumeSource_endpointsNamespace(ctx, field, obj) + + case "path": + + out.Values[i] = ec._K8s__io___api___core___v1__GlusterfsPersistentVolumeSource_path(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "readOnly": + + out.Values[i] = ec._K8s__io___api___core___v1__GlusterfsPersistentVolumeSource_readOnly(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__HostPathVolumeSourceImplementors = []string{"K8s__io___api___core___v1__HostPathVolumeSource"} + +func (ec *executionContext) _K8s__io___api___core___v1__HostPathVolumeSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1HostPathVolumeSource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__HostPathVolumeSourceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__HostPathVolumeSource") + case "path": + + out.Values[i] = ec._K8s__io___api___core___v1__HostPathVolumeSource_path(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "type": + + out.Values[i] = ec._K8s__io___api___core___v1__HostPathVolumeSource_type(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__ISCSIPersistentVolumeSourceImplementors = []string{"K8s__io___api___core___v1__ISCSIPersistentVolumeSource"} + +func (ec *executionContext) _K8s__io___api___core___v1__ISCSIPersistentVolumeSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1ISCSIPersistentVolumeSource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__ISCSIPersistentVolumeSourceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__ISCSIPersistentVolumeSource") + case "chapAuthDiscovery": + + out.Values[i] = ec._K8s__io___api___core___v1__ISCSIPersistentVolumeSource_chapAuthDiscovery(ctx, field, obj) + + case "chapAuthSession": + + out.Values[i] = ec._K8s__io___api___core___v1__ISCSIPersistentVolumeSource_chapAuthSession(ctx, field, obj) + + case "fsType": + + out.Values[i] = ec._K8s__io___api___core___v1__ISCSIPersistentVolumeSource_fsType(ctx, field, obj) + + case "initiatorName": + + out.Values[i] = ec._K8s__io___api___core___v1__ISCSIPersistentVolumeSource_initiatorName(ctx, field, obj) + + case "iqn": + + out.Values[i] = ec._K8s__io___api___core___v1__ISCSIPersistentVolumeSource_iqn(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "iscsiInterface": + + out.Values[i] = ec._K8s__io___api___core___v1__ISCSIPersistentVolumeSource_iscsiInterface(ctx, field, obj) + + case "lun": + + out.Values[i] = ec._K8s__io___api___core___v1__ISCSIPersistentVolumeSource_lun(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "portals": + + out.Values[i] = ec._K8s__io___api___core___v1__ISCSIPersistentVolumeSource_portals(ctx, field, obj) + + case "readOnly": + + out.Values[i] = ec._K8s__io___api___core___v1__ISCSIPersistentVolumeSource_readOnly(ctx, field, obj) + + case "secretRef": + + out.Values[i] = ec._K8s__io___api___core___v1__ISCSIPersistentVolumeSource_secretRef(ctx, field, obj) + + case "targetPortal": + + out.Values[i] = ec._K8s__io___api___core___v1__ISCSIPersistentVolumeSource_targetPortal(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__LocalVolumeSourceImplementors = []string{"K8s__io___api___core___v1__LocalVolumeSource"} + +func (ec *executionContext) _K8s__io___api___core___v1__LocalVolumeSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1LocalVolumeSource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__LocalVolumeSourceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__LocalVolumeSource") + case "fsType": + + out.Values[i] = ec._K8s__io___api___core___v1__LocalVolumeSource_fsType(ctx, field, obj) + + case "path": + + out.Values[i] = ec._K8s__io___api___core___v1__LocalVolumeSource_path(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__NFSVolumeSourceImplementors = []string{"K8s__io___api___core___v1__NFSVolumeSource"} + +func (ec *executionContext) _K8s__io___api___core___v1__NFSVolumeSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1NFSVolumeSource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__NFSVolumeSourceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__NFSVolumeSource") + case "path": + + out.Values[i] = ec._K8s__io___api___core___v1__NFSVolumeSource_path(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "readOnly": + + out.Values[i] = ec._K8s__io___api___core___v1__NFSVolumeSource_readOnly(ctx, field, obj) + + case "server": + + out.Values[i] = ec._K8s__io___api___core___v1__NFSVolumeSource_server(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__NamespaceConditionImplementors = []string{"K8s__io___api___core___v1__NamespaceCondition"} + +func (ec *executionContext) _K8s__io___api___core___v1__NamespaceCondition(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1NamespaceCondition) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__NamespaceConditionImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__NamespaceCondition") + case "lastTransitionTime": + + out.Values[i] = ec._K8s__io___api___core___v1__NamespaceCondition_lastTransitionTime(ctx, field, obj) + + case "message": + + out.Values[i] = ec._K8s__io___api___core___v1__NamespaceCondition_message(ctx, field, obj) + + case "reason": + + out.Values[i] = ec._K8s__io___api___core___v1__NamespaceCondition_reason(ctx, field, obj) + + case "status": + + out.Values[i] = ec._K8s__io___api___core___v1__NamespaceCondition_status(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "type": + + out.Values[i] = ec._K8s__io___api___core___v1__NamespaceCondition_type(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__NamespaceSpecImplementors = []string{"K8s__io___api___core___v1__NamespaceSpec"} + +func (ec *executionContext) _K8s__io___api___core___v1__NamespaceSpec(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1NamespaceSpec) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__NamespaceSpecImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__NamespaceSpec") + case "finalizers": + + out.Values[i] = ec._K8s__io___api___core___v1__NamespaceSpec_finalizers(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__NamespaceStatusImplementors = []string{"K8s__io___api___core___v1__NamespaceStatus"} + +func (ec *executionContext) _K8s__io___api___core___v1__NamespaceStatus(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1NamespaceStatus) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__NamespaceStatusImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__NamespaceStatus") + case "conditions": + + out.Values[i] = ec._K8s__io___api___core___v1__NamespaceStatus_conditions(ctx, field, obj) + + case "phase": + + out.Values[i] = ec._K8s__io___api___core___v1__NamespaceStatus_phase(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__NodeAffinityImplementors = []string{"K8s__io___api___core___v1__NodeAffinity"} + +func (ec *executionContext) _K8s__io___api___core___v1__NodeAffinity(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1NodeAffinity) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__NodeAffinityImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__NodeAffinity") + case "preferredDuringSchedulingIgnoredDuringExecution": + + out.Values[i] = ec._K8s__io___api___core___v1__NodeAffinity_preferredDuringSchedulingIgnoredDuringExecution(ctx, field, obj) + + case "requiredDuringSchedulingIgnoredDuringExecution": + + out.Values[i] = ec._K8s__io___api___core___v1__NodeAffinity_requiredDuringSchedulingIgnoredDuringExecution(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__NodeSelectorImplementors = []string{"K8s__io___api___core___v1__NodeSelector"} + +func (ec *executionContext) _K8s__io___api___core___v1__NodeSelector(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1NodeSelector) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__NodeSelectorImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__NodeSelector") + case "nodeSelectorTerms": + + out.Values[i] = ec._K8s__io___api___core___v1__NodeSelector_nodeSelectorTerms(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__NodeSelectorRequirementImplementors = []string{"K8s__io___api___core___v1__NodeSelectorRequirement"} + +func (ec *executionContext) _K8s__io___api___core___v1__NodeSelectorRequirement(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1NodeSelectorRequirement) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__NodeSelectorRequirementImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__NodeSelectorRequirement") + case "key": + + out.Values[i] = ec._K8s__io___api___core___v1__NodeSelectorRequirement_key(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "operator": + + out.Values[i] = ec._K8s__io___api___core___v1__NodeSelectorRequirement_operator(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "values": + + out.Values[i] = ec._K8s__io___api___core___v1__NodeSelectorRequirement_values(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__NodeSelectorTermImplementors = []string{"K8s__io___api___core___v1__NodeSelectorTerm"} + +func (ec *executionContext) _K8s__io___api___core___v1__NodeSelectorTerm(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1NodeSelectorTerm) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__NodeSelectorTermImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__NodeSelectorTerm") + case "matchExpressions": + + out.Values[i] = ec._K8s__io___api___core___v1__NodeSelectorTerm_matchExpressions(ctx, field, obj) + + case "matchFields": + + out.Values[i] = ec._K8s__io___api___core___v1__NodeSelectorTerm_matchFields(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__ObjectReferenceImplementors = []string{"K8s__io___api___core___v1__ObjectReference"} + +func (ec *executionContext) _K8s__io___api___core___v1__ObjectReference(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1ObjectReference) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__ObjectReferenceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__ObjectReference") + case "apiVersion": + + out.Values[i] = ec._K8s__io___api___core___v1__ObjectReference_apiVersion(ctx, field, obj) + + case "fieldPath": + + out.Values[i] = ec._K8s__io___api___core___v1__ObjectReference_fieldPath(ctx, field, obj) + + case "kind": + + out.Values[i] = ec._K8s__io___api___core___v1__ObjectReference_kind(ctx, field, obj) + + case "name": + + out.Values[i] = ec._K8s__io___api___core___v1__ObjectReference_name(ctx, field, obj) + + case "namespace": + + out.Values[i] = ec._K8s__io___api___core___v1__ObjectReference_namespace(ctx, field, obj) + + case "resourceVersion": + + out.Values[i] = ec._K8s__io___api___core___v1__ObjectReference_resourceVersion(ctx, field, obj) + + case "uid": + + out.Values[i] = ec._K8s__io___api___core___v1__ObjectReference_uid(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__PersistentVolumeClaimConditionImplementors = []string{"K8s__io___api___core___v1__PersistentVolumeClaimCondition"} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimCondition(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1PersistentVolumeClaimCondition) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__PersistentVolumeClaimConditionImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__PersistentVolumeClaimCondition") + case "lastProbeTime": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeClaimCondition_lastProbeTime(ctx, field, obj) + + case "lastTransitionTime": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeClaimCondition_lastTransitionTime(ctx, field, obj) + + case "message": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeClaimCondition_message(ctx, field, obj) + + case "reason": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeClaimCondition_reason(ctx, field, obj) + + case "status": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeClaimCondition_status(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "type": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeClaimCondition_type(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__PersistentVolumeClaimSpecImplementors = []string{"K8s__io___api___core___v1__PersistentVolumeClaimSpec"} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimSpec(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1PersistentVolumeClaimSpec) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__PersistentVolumeClaimSpecImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__PersistentVolumeClaimSpec") + case "accessModes": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeClaimSpec_accessModes(ctx, field, obj) + + case "dataSource": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeClaimSpec_dataSource(ctx, field, obj) + + case "dataSourceRef": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeClaimSpec_dataSourceRef(ctx, field, obj) + + case "resources": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeClaimSpec_resources(ctx, field, obj) + + case "selector": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeClaimSpec_selector(ctx, field, obj) + + case "storageClassName": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeClaimSpec_storageClassName(ctx, field, obj) + + case "volumeMode": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeClaimSpec_volumeMode(ctx, field, obj) + + case "volumeName": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeClaimSpec_volumeName(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__PersistentVolumeClaimStatusImplementors = []string{"K8s__io___api___core___v1__PersistentVolumeClaimStatus"} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimStatus(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1PersistentVolumeClaimStatus) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__PersistentVolumeClaimStatusImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__PersistentVolumeClaimStatus") + case "accessModes": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeClaimStatus_accessModes(ctx, field, obj) + + case "allocatedResources": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeClaimStatus_allocatedResources(ctx, field, obj) + + case "allocatedResourceStatuses": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeClaimStatus_allocatedResourceStatuses(ctx, field, obj) + + case "capacity": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeClaimStatus_capacity(ctx, field, obj) + + case "conditions": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeClaimStatus_conditions(ctx, field, obj) + + case "phase": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeClaimStatus_phase(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__PersistentVolumeSpecImplementors = []string{"K8s__io___api___core___v1__PersistentVolumeSpec"} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__PersistentVolumeSpecImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__PersistentVolumeSpec") + case "accessModes": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_accessModes(ctx, field, obj) + + case "awsElasticBlockStore": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_awsElasticBlockStore(ctx, field, obj) + + case "azureDisk": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_azureDisk(ctx, field, obj) + + case "azureFile": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_azureFile(ctx, field, obj) + + case "capacity": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_capacity(ctx, field, obj) + + case "cephfs": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_cephfs(ctx, field, obj) + + case "cinder": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_cinder(ctx, field, obj) + + case "claimRef": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_claimRef(ctx, field, obj) + + case "csi": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_csi(ctx, field, obj) + + case "fc": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_fc(ctx, field, obj) + + case "flexVolume": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_flexVolume(ctx, field, obj) + + case "flocker": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_flocker(ctx, field, obj) + + case "gcePersistentDisk": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_gcePersistentDisk(ctx, field, obj) + + case "glusterfs": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_glusterfs(ctx, field, obj) + + case "hostPath": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_hostPath(ctx, field, obj) + + case "iscsi": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_iscsi(ctx, field, obj) + + case "local": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_local(ctx, field, obj) + + case "mountOptions": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_mountOptions(ctx, field, obj) + + case "nfs": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_nfs(ctx, field, obj) + + case "nodeAffinity": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_nodeAffinity(ctx, field, obj) + + case "persistentVolumeReclaimPolicy": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_persistentVolumeReclaimPolicy(ctx, field, obj) + + case "photonPersistentDisk": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_photonPersistentDisk(ctx, field, obj) + + case "portworxVolume": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_portworxVolume(ctx, field, obj) + + case "quobyte": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_quobyte(ctx, field, obj) + + case "rbd": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_rbd(ctx, field, obj) + + case "scaleIO": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_scaleIO(ctx, field, obj) + + case "storageClassName": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_storageClassName(ctx, field, obj) + + case "storageos": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_storageos(ctx, field, obj) + + case "volumeMode": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_volumeMode(ctx, field, obj) + + case "vsphereVolume": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_vsphereVolume(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__PersistentVolumeStatusImplementors = []string{"K8s__io___api___core___v1__PersistentVolumeStatus"} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeStatus(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1PersistentVolumeStatus) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__PersistentVolumeStatusImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__PersistentVolumeStatus") + case "lastPhaseTransitionTime": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeStatus_lastPhaseTransitionTime(ctx, field, obj) + + case "message": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeStatus_message(ctx, field, obj) + + case "phase": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeStatus_phase(ctx, field, obj) + + case "reason": + + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeStatus_reason(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__PhotonPersistentDiskVolumeSourceImplementors = []string{"K8s__io___api___core___v1__PhotonPersistentDiskVolumeSource"} + +func (ec *executionContext) _K8s__io___api___core___v1__PhotonPersistentDiskVolumeSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1PhotonPersistentDiskVolumeSource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__PhotonPersistentDiskVolumeSourceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__PhotonPersistentDiskVolumeSource") + case "fsType": + + out.Values[i] = ec._K8s__io___api___core___v1__PhotonPersistentDiskVolumeSource_fsType(ctx, field, obj) + + case "pdID": + + out.Values[i] = ec._K8s__io___api___core___v1__PhotonPersistentDiskVolumeSource_pdID(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__PodAffinityImplementors = []string{"K8s__io___api___core___v1__PodAffinity"} + +func (ec *executionContext) _K8s__io___api___core___v1__PodAffinity(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1PodAffinity) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__PodAffinityImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__PodAffinity") + case "preferredDuringSchedulingIgnoredDuringExecution": + + out.Values[i] = ec._K8s__io___api___core___v1__PodAffinity_preferredDuringSchedulingIgnoredDuringExecution(ctx, field, obj) + + case "requiredDuringSchedulingIgnoredDuringExecution": + + out.Values[i] = ec._K8s__io___api___core___v1__PodAffinity_requiredDuringSchedulingIgnoredDuringExecution(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__PodAffinityTermImplementors = []string{"K8s__io___api___core___v1__PodAffinityTerm"} + +func (ec *executionContext) _K8s__io___api___core___v1__PodAffinityTerm(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1PodAffinityTerm) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__PodAffinityTermImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__PodAffinityTerm") + case "labelSelector": + + out.Values[i] = ec._K8s__io___api___core___v1__PodAffinityTerm_labelSelector(ctx, field, obj) + + case "namespaces": + + out.Values[i] = ec._K8s__io___api___core___v1__PodAffinityTerm_namespaces(ctx, field, obj) + + case "namespaceSelector": + + out.Values[i] = ec._K8s__io___api___core___v1__PodAffinityTerm_namespaceSelector(ctx, field, obj) + + case "topologyKey": + + out.Values[i] = ec._K8s__io___api___core___v1__PodAffinityTerm_topologyKey(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__PodAntiAffinityImplementors = []string{"K8s__io___api___core___v1__PodAntiAffinity"} + +func (ec *executionContext) _K8s__io___api___core___v1__PodAntiAffinity(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1PodAntiAffinity) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__PodAntiAffinityImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__PodAntiAffinity") + case "preferredDuringSchedulingIgnoredDuringExecution": + + out.Values[i] = ec._K8s__io___api___core___v1__PodAntiAffinity_preferredDuringSchedulingIgnoredDuringExecution(ctx, field, obj) + + case "requiredDuringSchedulingIgnoredDuringExecution": + + out.Values[i] = ec._K8s__io___api___core___v1__PodAntiAffinity_requiredDuringSchedulingIgnoredDuringExecution(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__PortworxVolumeSourceImplementors = []string{"K8s__io___api___core___v1__PortworxVolumeSource"} + +func (ec *executionContext) _K8s__io___api___core___v1__PortworxVolumeSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1PortworxVolumeSource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__PortworxVolumeSourceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__PortworxVolumeSource") + case "fsType": + + out.Values[i] = ec._K8s__io___api___core___v1__PortworxVolumeSource_fsType(ctx, field, obj) + + case "readOnly": + + out.Values[i] = ec._K8s__io___api___core___v1__PortworxVolumeSource_readOnly(ctx, field, obj) + + case "volumeID": + + out.Values[i] = ec._K8s__io___api___core___v1__PortworxVolumeSource_volumeID(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__PreferredSchedulingTermImplementors = []string{"K8s__io___api___core___v1__PreferredSchedulingTerm"} + +func (ec *executionContext) _K8s__io___api___core___v1__PreferredSchedulingTerm(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1PreferredSchedulingTerm) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__PreferredSchedulingTermImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__PreferredSchedulingTerm") + case "preference": + + out.Values[i] = ec._K8s__io___api___core___v1__PreferredSchedulingTerm_preference(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "weight": + + out.Values[i] = ec._K8s__io___api___core___v1__PreferredSchedulingTerm_weight(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__QuobyteVolumeSourceImplementors = []string{"K8s__io___api___core___v1__QuobyteVolumeSource"} + +func (ec *executionContext) _K8s__io___api___core___v1__QuobyteVolumeSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1QuobyteVolumeSource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__QuobyteVolumeSourceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__QuobyteVolumeSource") + case "group": + + out.Values[i] = ec._K8s__io___api___core___v1__QuobyteVolumeSource_group(ctx, field, obj) + + case "readOnly": + + out.Values[i] = ec._K8s__io___api___core___v1__QuobyteVolumeSource_readOnly(ctx, field, obj) + + case "registry": + + out.Values[i] = ec._K8s__io___api___core___v1__QuobyteVolumeSource_registry(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "tenant": + + out.Values[i] = ec._K8s__io___api___core___v1__QuobyteVolumeSource_tenant(ctx, field, obj) + + case "user": + + out.Values[i] = ec._K8s__io___api___core___v1__QuobyteVolumeSource_user(ctx, field, obj) + + case "volume": + + out.Values[i] = ec._K8s__io___api___core___v1__QuobyteVolumeSource_volume(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__RBDPersistentVolumeSourceImplementors = []string{"K8s__io___api___core___v1__RBDPersistentVolumeSource"} + +func (ec *executionContext) _K8s__io___api___core___v1__RBDPersistentVolumeSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1RBDPersistentVolumeSource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__RBDPersistentVolumeSourceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__RBDPersistentVolumeSource") + case "fsType": + + out.Values[i] = ec._K8s__io___api___core___v1__RBDPersistentVolumeSource_fsType(ctx, field, obj) + + case "image": + + out.Values[i] = ec._K8s__io___api___core___v1__RBDPersistentVolumeSource_image(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "keyring": + + out.Values[i] = ec._K8s__io___api___core___v1__RBDPersistentVolumeSource_keyring(ctx, field, obj) + + case "monitors": + + out.Values[i] = ec._K8s__io___api___core___v1__RBDPersistentVolumeSource_monitors(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "pool": + + out.Values[i] = ec._K8s__io___api___core___v1__RBDPersistentVolumeSource_pool(ctx, field, obj) + + case "readOnly": + + out.Values[i] = ec._K8s__io___api___core___v1__RBDPersistentVolumeSource_readOnly(ctx, field, obj) + + case "secretRef": + + out.Values[i] = ec._K8s__io___api___core___v1__RBDPersistentVolumeSource_secretRef(ctx, field, obj) + + case "user": + + out.Values[i] = ec._K8s__io___api___core___v1__RBDPersistentVolumeSource_user(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__ResourceClaimImplementors = []string{"K8s__io___api___core___v1__ResourceClaim"} + +func (ec *executionContext) _K8s__io___api___core___v1__ResourceClaim(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1ResourceClaim) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__ResourceClaimImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__ResourceClaim") + case "name": + + out.Values[i] = ec._K8s__io___api___core___v1__ResourceClaim_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__ResourceRequirementsImplementors = []string{"K8s__io___api___core___v1__ResourceRequirements"} + +func (ec *executionContext) _K8s__io___api___core___v1__ResourceRequirements(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1ResourceRequirements) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__ResourceRequirementsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__ResourceRequirements") + case "claims": + + out.Values[i] = ec._K8s__io___api___core___v1__ResourceRequirements_claims(ctx, field, obj) + + case "limits": + + out.Values[i] = ec._K8s__io___api___core___v1__ResourceRequirements_limits(ctx, field, obj) + + case "requests": + + out.Values[i] = ec._K8s__io___api___core___v1__ResourceRequirements_requests(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__ScaleIOPersistentVolumeSourceImplementors = []string{"K8s__io___api___core___v1__ScaleIOPersistentVolumeSource"} + +func (ec *executionContext) _K8s__io___api___core___v1__ScaleIOPersistentVolumeSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1ScaleIOPersistentVolumeSource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__ScaleIOPersistentVolumeSourceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__ScaleIOPersistentVolumeSource") + case "fsType": + + out.Values[i] = ec._K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_fsType(ctx, field, obj) + + case "gateway": + + out.Values[i] = ec._K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_gateway(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "protectionDomain": + + out.Values[i] = ec._K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_protectionDomain(ctx, field, obj) + + case "readOnly": + + out.Values[i] = ec._K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_readOnly(ctx, field, obj) + + case "secretRef": + + out.Values[i] = ec._K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_secretRef(ctx, field, obj) + + case "sslEnabled": + + out.Values[i] = ec._K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_sslEnabled(ctx, field, obj) + + case "storageMode": + + out.Values[i] = ec._K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_storageMode(ctx, field, obj) + + case "storagePool": + + out.Values[i] = ec._K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_storagePool(ctx, field, obj) + + case "system": + + out.Values[i] = ec._K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_system(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "volumeName": + + out.Values[i] = ec._K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_volumeName(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__SecretReferenceImplementors = []string{"K8s__io___api___core___v1__SecretReference"} + +func (ec *executionContext) _K8s__io___api___core___v1__SecretReference(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1SecretReference) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__SecretReferenceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__SecretReference") + case "name": + + out.Values[i] = ec._K8s__io___api___core___v1__SecretReference_name(ctx, field, obj) + + case "namespace": + + out.Values[i] = ec._K8s__io___api___core___v1__SecretReference_namespace(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__StorageOSPersistentVolumeSourceImplementors = []string{"K8s__io___api___core___v1__StorageOSPersistentVolumeSource"} + +func (ec *executionContext) _K8s__io___api___core___v1__StorageOSPersistentVolumeSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1StorageOSPersistentVolumeSource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__StorageOSPersistentVolumeSourceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__StorageOSPersistentVolumeSource") + case "fsType": + + out.Values[i] = ec._K8s__io___api___core___v1__StorageOSPersistentVolumeSource_fsType(ctx, field, obj) + + case "readOnly": + + out.Values[i] = ec._K8s__io___api___core___v1__StorageOSPersistentVolumeSource_readOnly(ctx, field, obj) + + case "secretRef": + + out.Values[i] = ec._K8s__io___api___core___v1__StorageOSPersistentVolumeSource_secretRef(ctx, field, obj) + + case "volumeName": + + out.Values[i] = ec._K8s__io___api___core___v1__StorageOSPersistentVolumeSource_volumeName(ctx, field, obj) + + case "volumeNamespace": + + out.Values[i] = ec._K8s__io___api___core___v1__StorageOSPersistentVolumeSource_volumeNamespace(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__TaintImplementors = []string{"K8s__io___api___core___v1__Taint"} + +func (ec *executionContext) _K8s__io___api___core___v1__Taint(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1Taint) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__TaintImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__Taint") + case "effect": + + out.Values[i] = ec._K8s__io___api___core___v1__Taint_effect(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "key": + + out.Values[i] = ec._K8s__io___api___core___v1__Taint_key(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "timeAdded": + + out.Values[i] = ec._K8s__io___api___core___v1__Taint_timeAdded(ctx, field, obj) + + case "value": + + out.Values[i] = ec._K8s__io___api___core___v1__Taint_value(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__TolerationImplementors = []string{"K8s__io___api___core___v1__Toleration"} + +func (ec *executionContext) _K8s__io___api___core___v1__Toleration(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1Toleration) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__TolerationImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__Toleration") + case "effect": + + out.Values[i] = ec._K8s__io___api___core___v1__Toleration_effect(ctx, field, obj) + + case "key": + + out.Values[i] = ec._K8s__io___api___core___v1__Toleration_key(ctx, field, obj) + + case "operator": + + out.Values[i] = ec._K8s__io___api___core___v1__Toleration_operator(ctx, field, obj) + + case "tolerationSeconds": + + out.Values[i] = ec._K8s__io___api___core___v1__Toleration_tolerationSeconds(ctx, field, obj) + + case "value": + + out.Values[i] = ec._K8s__io___api___core___v1__Toleration_value(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__TypedLocalObjectReferenceImplementors = []string{"K8s__io___api___core___v1__TypedLocalObjectReference"} + +func (ec *executionContext) _K8s__io___api___core___v1__TypedLocalObjectReference(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1TypedLocalObjectReference) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__TypedLocalObjectReferenceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__TypedLocalObjectReference") + case "apiGroup": + + out.Values[i] = ec._K8s__io___api___core___v1__TypedLocalObjectReference_apiGroup(ctx, field, obj) + + case "kind": + + out.Values[i] = ec._K8s__io___api___core___v1__TypedLocalObjectReference_kind(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "name": + + out.Values[i] = ec._K8s__io___api___core___v1__TypedLocalObjectReference_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__TypedObjectReferenceImplementors = []string{"K8s__io___api___core___v1__TypedObjectReference"} + +func (ec *executionContext) _K8s__io___api___core___v1__TypedObjectReference(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1TypedObjectReference) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__TypedObjectReferenceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__TypedObjectReference") + case "apiGroup": + + out.Values[i] = ec._K8s__io___api___core___v1__TypedObjectReference_apiGroup(ctx, field, obj) + + case "kind": + + out.Values[i] = ec._K8s__io___api___core___v1__TypedObjectReference_kind(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "name": + + out.Values[i] = ec._K8s__io___api___core___v1__TypedObjectReference_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "namespace": + + out.Values[i] = ec._K8s__io___api___core___v1__TypedObjectReference_namespace(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__VolumeNodeAffinityImplementors = []string{"K8s__io___api___core___v1__VolumeNodeAffinity"} + +func (ec *executionContext) _K8s__io___api___core___v1__VolumeNodeAffinity(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1VolumeNodeAffinity) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__VolumeNodeAffinityImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__VolumeNodeAffinity") + case "required": + + out.Values[i] = ec._K8s__io___api___core___v1__VolumeNodeAffinity_required(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__VsphereVirtualDiskVolumeSourceImplementors = []string{"K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource"} + +func (ec *executionContext) _K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1VsphereVirtualDiskVolumeSource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__VsphereVirtualDiskVolumeSourceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource") + case "fsType": + + out.Values[i] = ec._K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource_fsType(ctx, field, obj) + + case "storagePolicyID": + + out.Values[i] = ec._K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource_storagePolicyID(ctx, field, obj) + + case "storagePolicyName": + + out.Values[i] = ec._K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource_storagePolicyName(ctx, field, obj) + + case "volumePath": + + out.Values[i] = ec._K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource_volumePath(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___core___v1__WeightedPodAffinityTermImplementors = []string{"K8s__io___api___core___v1__WeightedPodAffinityTerm"} + +func (ec *executionContext) _K8s__io___api___core___v1__WeightedPodAffinityTerm(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1WeightedPodAffinityTerm) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__WeightedPodAffinityTermImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__WeightedPodAffinityTerm") + case "podAffinityTerm": + + out.Values[i] = ec._K8s__io___api___core___v1__WeightedPodAffinityTerm_podAffinityTerm(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "weight": + + out.Values[i] = ec._K8s__io___api___core___v1__WeightedPodAffinityTerm_weight(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___storage___v1__VolumeAttachmentSourceImplementors = []string{"K8s__io___api___storage___v1__VolumeAttachmentSource"} + +func (ec *executionContext) _K8s__io___api___storage___v1__VolumeAttachmentSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPIStorageV1VolumeAttachmentSource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___storage___v1__VolumeAttachmentSourceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___storage___v1__VolumeAttachmentSource") + case "inlineVolumeSpec": + + out.Values[i] = ec._K8s__io___api___storage___v1__VolumeAttachmentSource_inlineVolumeSpec(ctx, field, obj) + + case "persistentVolumeName": + + out.Values[i] = ec._K8s__io___api___storage___v1__VolumeAttachmentSource_persistentVolumeName(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___storage___v1__VolumeAttachmentSpecImplementors = []string{"K8s__io___api___storage___v1__VolumeAttachmentSpec"} + +func (ec *executionContext) _K8s__io___api___storage___v1__VolumeAttachmentSpec(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPIStorageV1VolumeAttachmentSpec) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___storage___v1__VolumeAttachmentSpecImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___storage___v1__VolumeAttachmentSpec") + case "attacher": + + out.Values[i] = ec._K8s__io___api___storage___v1__VolumeAttachmentSpec_attacher(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "nodeName": + + out.Values[i] = ec._K8s__io___api___storage___v1__VolumeAttachmentSpec_nodeName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "source": + + out.Values[i] = ec._K8s__io___api___storage___v1__VolumeAttachmentSpec_source(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___storage___v1__VolumeAttachmentStatusImplementors = []string{"K8s__io___api___storage___v1__VolumeAttachmentStatus"} + +func (ec *executionContext) _K8s__io___api___storage___v1__VolumeAttachmentStatus(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPIStorageV1VolumeAttachmentStatus) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___storage___v1__VolumeAttachmentStatusImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___storage___v1__VolumeAttachmentStatus") + case "attached": + + out.Values[i] = ec._K8s__io___api___storage___v1__VolumeAttachmentStatus_attached(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "attachError": + + out.Values[i] = ec._K8s__io___api___storage___v1__VolumeAttachmentStatus_attachError(ctx, field, obj) + + case "attachmentMetadata": + + out.Values[i] = ec._K8s__io___api___storage___v1__VolumeAttachmentStatus_attachmentMetadata(ctx, field, obj) + + case "detachError": + + out.Values[i] = ec._K8s__io___api___storage___v1__VolumeAttachmentStatus_detachError(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___api___storage___v1__VolumeErrorImplementors = []string{"K8s__io___api___storage___v1__VolumeError"} + +func (ec *executionContext) _K8s__io___api___storage___v1__VolumeError(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPIStorageV1VolumeError) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___storage___v1__VolumeErrorImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___storage___v1__VolumeError") + case "message": + + out.Values[i] = ec._K8s__io___api___storage___v1__VolumeError_message(ctx, field, obj) + + case "time": + + out.Values[i] = ec._K8s__io___api___storage___v1__VolumeError_time(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___apimachinery___pkg___api___resource__QuantityImplementors = []string{"K8s__io___apimachinery___pkg___api___resource__Quantity"} + +func (ec *executionContext) _K8s__io___apimachinery___pkg___api___resource__Quantity(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoApimachineryPkgAPIResourceQuantity) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___apimachinery___pkg___api___resource__QuantityImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___apimachinery___pkg___api___resource__Quantity") + case "Format": + + out.Values[i] = ec._K8s__io___apimachinery___pkg___api___resource__Quantity_Format(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorImplementors = []string{"K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector"} + +func (ec *executionContext) _K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoApimachineryPkgApisMetaV1LabelSelector) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector") + case "matchExpressions": + + out.Values[i] = ec._K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector_matchExpressions(ctx, field, obj) + + case "matchLabels": + + out.Values[i] = ec._K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector_matchLabels(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var k8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirementImplementors = []string{"K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement"} + +func (ec *executionContext) _K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoApimachineryPkgApisMetaV1LabelSelectorRequirement) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirementImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement") + case "key": + + out.Values[i] = ec._K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement_key(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "operator": + + out.Values[i] = ec._K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement_operator(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "values": + + out.Values[i] = ec._K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement_values(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) } - }() - 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) + } + out.Dispatch() + if invalids > 0 { return graphql.Null } - if resTmp == nil { + return out +} + +var matchFilterImplementors = []string{"MatchFilter"} + +func (ec *executionContext) _MatchFilter(ctx context.Context, sel ast.SelectionSet, obj *repos.MatchFilter) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, matchFilterImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("MatchFilter") + case "array": + + out.Values[i] = ec._MatchFilter_array(ctx, field, obj) + + case "exact": + + out.Values[i] = ec._MatchFilter_exact(ctx, field, obj) + + case "matchType": + + out.Values[i] = ec._MatchFilter_matchType(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "regex": + + out.Values[i] = ec._MatchFilter_regex(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { return graphql.Null } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return out +} + +var metadataImplementors = []string{"Metadata"} + +func (ec *executionContext) _Metadata(ctx context.Context, sel ast.SelectionSet, obj *v1.ObjectMeta) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, metadataImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Metadata") + case "annotations": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Metadata_annotations(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "creationTimestamp": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Metadata_creationTimestamp(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "deletionTimestamp": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Metadata_deletionTimestamp(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "generation": + + out.Values[i] = ec._Metadata_generation(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "labels": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Metadata_labels(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "name": + + out.Values[i] = ec._Metadata_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "namespace": + + out.Values[i] = ec._Metadata_namespace(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var msvcTemplateImplementors = []string{"MsvcTemplate"} + +func (ec *executionContext) _MsvcTemplate(ctx context.Context, sel ast.SelectionSet, obj *entities.MsvcTemplate) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, msvcTemplateImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("MsvcTemplate") + case "category": + + out.Values[i] = ec._MsvcTemplate_category(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "displayName": + + out.Values[i] = ec._MsvcTemplate_displayName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "items": + + out.Values[i] = ec._MsvcTemplate_items(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -func (ec *executionContext) fieldContext___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) +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) + var invalids uint32 + 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 "infra_createCluster": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_infra_createCluster(ctx, field) + }) + + case "infra_updateCluster": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_infra_updateCluster(ctx, field) + }) + + case "infra_deleteCluster": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_infra_deleteCluster(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "infra_createProviderSecret": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_infra_createProviderSecret(ctx, field) + }) + + case "infra_updateProviderSecret": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_infra_updateProviderSecret(ctx, field) + }) + + case "infra_deleteProviderSecret": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_infra_deleteProviderSecret(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} + case "infra_createDomainEntry": -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 + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_infra_createDomainEntry(ctx, field) + }) + + case "infra_updateDomainEntry": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_infra_updateDomainEntry(ctx, field) + }) + + case "infra_deleteDomainEntry": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_infra_deleteDomainEntry(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "infra_createNodePool": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_infra_createNodePool(ctx, field) + }) + + case "infra_updateNodePool": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_infra_updateNodePool(ctx, field) + }) + + case "infra_deleteNodePool": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_infra_deleteNodePool(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "infra_createClusterManagedService": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_infra_createClusterManagedService(ctx, field) + }) + + case "infra_updateClusterManagedService": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_infra_updateClusterManagedService(ctx, field) + }) + + case "infra_deleteClusterManagedService": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_infra_deleteClusterManagedService(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "infra_createHelmRelease": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_infra_createHelmRelease(ctx, field) + }) + + case "infra_updateHelmRelease": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_infra_updateHelmRelease(ctx, field) + }) + + case "infra_deleteHelmRelease": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_infra_deleteHelmRelease(ctx, field) + }) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) } - }() - 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") - } + out.Dispatch() + if invalids > 0 { 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) + return out } -func (ec *executionContext) fieldContext___Schema_directives(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___Directive_name(ctx, field) - case "description": - return ec.fieldContext___Directive_description(ctx, field) - case "locations": - return ec.fieldContext___Directive_locations(ctx, field) - case "args": - return ec.fieldContext___Directive_args(ctx, field) - case "isRepeatable": - return ec.fieldContext___Directive_isRepeatable(ctx, field) +var namespaceImplementors = []string{"Namespace"} + +func (ec *executionContext) _Namespace(ctx context.Context, sel ast.SelectionSet, obj *entities.Namespace) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, namespaceImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Namespace") + case "accountName": + + out.Values[i] = ec._Namespace_accountName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "apiVersion": + + out.Values[i] = ec._Namespace_apiVersion(ctx, field, obj) + + case "clusterName": + + out.Values[i] = ec._Namespace_clusterName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "createdBy": + + out.Values[i] = ec._Namespace_createdBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "creationTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Namespace_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "displayName": + + out.Values[i] = ec._Namespace_displayName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "id": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Namespace_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "kind": + + out.Values[i] = ec._Namespace_kind(ctx, field, obj) + + case "lastUpdatedBy": + + out.Values[i] = ec._Namespace_lastUpdatedBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "markedForDeletion": + + out.Values[i] = ec._Namespace_markedForDeletion(ctx, field, obj) + + case "metadata": + + out.Values[i] = ec._Namespace_metadata(ctx, field, obj) + + case "recordVersion": + + out.Values[i] = ec._Namespace_recordVersion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "spec": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Namespace_spec(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "status": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Namespace_status(ctx, field, obj) + return res } - 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) -} + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) -func (ec *executionContext) fieldContext___Type_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type __TypeKind does not have child fields") - }, - } - return fc, nil -} + }) + case "syncStatus": -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) -} + out.Values[i] = ec._Namespace_syncStatus(ctx, field, obj) -func (ec *executionContext) fieldContext___Type_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "updateTime": + field := field -func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = 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) -} + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Namespace_updateTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } -func (ec *executionContext) fieldContext___Type_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) -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 + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) } - }() - 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 { + out.Dispatch() + if invalids > 0 { 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) + return out } -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) +var namespaceEdgeImplementors = []string{"NamespaceEdge"} + +func (ec *executionContext) _NamespaceEdge(ctx context.Context, sel ast.SelectionSet, obj *model.NamespaceEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, namespaceEdgeImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("NamespaceEdge") + case "cursor": + + out.Values[i] = ec._NamespaceEdge_cursor(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } - return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} + case "node": -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 + out.Values[i] = ec._NamespaceEdge_node(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } } - if resTmp == nil { + out.Dispatch() + if invalids > 0 { return graphql.Null } - res := resTmp.([]introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + return out } -func (ec *executionContext) fieldContext___Type_interfaces(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) +var namespacePaginatedRecordsImplementors = []string{"NamespacePaginatedRecords"} + +func (ec *executionContext) _NamespacePaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.NamespacePaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, namespacePaginatedRecordsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("NamespacePaginatedRecords") + case "edges": + + out.Values[i] = ec._NamespacePaginatedRecords_edges(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} + case "pageInfo": -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 + out.Values[i] = ec._NamespacePaginatedRecords_pageInfo(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "totalCount": + + out.Values[i] = ec._NamespacePaginatedRecords_totalCount(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) } - }() - 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 { + out.Dispatch() + if invalids > 0 { return graphql.Null } - res := resTmp.([]introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + return out } -func (ec *executionContext) fieldContext___Type_possibleTypes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) +var nodeImplementors = []string{"Node"} + +func (ec *executionContext) _Node(ctx context.Context, sel ast.SelectionSet, obj *entities.Node) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, nodeImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Node") + case "accountName": + + out.Values[i] = ec._Node_accountName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} + case "apiVersion": -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 + out.Values[i] = ec._Node_apiVersion(ctx, field, obj) + + case "clusterName": + + out.Values[i] = ec._Node_clusterName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "creationTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Node_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "id": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Node_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "kind": + + out.Values[i] = ec._Node_kind(ctx, field, obj) + + case "markedForDeletion": + + out.Values[i] = ec._Node_markedForDeletion(ctx, field, obj) + + case "metadata": + + out.Values[i] = ec._Node_metadata(ctx, field, obj) + + case "recordVersion": + + out.Values[i] = ec._Node_recordVersion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "spec": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Node_spec(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "status": + + out.Values[i] = ec._Node_status(ctx, field, obj) + + case "syncStatus": + + out.Values[i] = ec._Node_syncStatus(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "updateTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Node_updateTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) } - }() - 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 { + out.Dispatch() + if invalids > 0 { 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) + return out } -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) +var nodeEdgeImplementors = []string{"NodeEdge"} + +func (ec *executionContext) _NodeEdge(ctx context.Context, sel ast.SelectionSet, obj *model.NodeEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, nodeEdgeImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("NodeEdge") + case "cursor": + + out.Values[i] = ec._NodeEdge_cursor(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } - 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) + case "node": + + out.Values[i] = ec._NodeEdge_node(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return } - return fc, nil -} - -func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_inputFields(ctx, field) - if err != nil { + out.Dispatch() + if invalids > 0 { return graphql.Null } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + return out +} + +var nodePaginatedRecordsImplementors = []string{"NodePaginatedRecords"} + +func (ec *executionContext) _NodePaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.NodePaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, nodePaginatedRecordsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("NodePaginatedRecords") + case "edges": + + out.Values[i] = ec._NodePaginatedRecords_edges(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "pageInfo": + + out.Values[i] = ec._NodePaginatedRecords_pageInfo(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "totalCount": + + out.Values[i] = ec._NodePaginatedRecords_totalCount(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) } - }() - 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 { + out.Dispatch() + if invalids > 0 { 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) + return out } -func (ec *executionContext) fieldContext___Type_inputFields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___InputValue_name(ctx, field) - case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) +var nodePoolImplementors = []string{"NodePool"} + +func (ec *executionContext) _NodePool(ctx context.Context, sel ast.SelectionSet, obj *entities.NodePool) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, nodePoolImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("NodePool") + case "accountName": + + out.Values[i] = ec._NodePool_accountName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "apiVersion": + + out.Values[i] = ec._NodePool_apiVersion(ctx, field, obj) + + case "clusterName": + + out.Values[i] = ec._NodePool_clusterName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "createdBy": + + out.Values[i] = ec._NodePool_createdBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "creationTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._NodePool_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "displayName": + + out.Values[i] = ec._NodePool_displayName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "id": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._NodePool_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "kind": + + out.Values[i] = ec._NodePool_kind(ctx, field, obj) + + case "lastUpdatedBy": + + out.Values[i] = ec._NodePool_lastUpdatedBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "markedForDeletion": + + out.Values[i] = ec._NodePool_markedForDeletion(ctx, field, obj) + + case "metadata": + + out.Values[i] = ec._NodePool_metadata(ctx, field, obj) + + case "recordVersion": + + out.Values[i] = ec._NodePool_recordVersion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "spec": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._NodePool_spec(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "status": + + out.Values[i] = ec._NodePool_status(ctx, field, obj) + + case "syncStatus": + + out.Values[i] = ec._NodePool_syncStatus(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "updateTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._NodePool_updateTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res } - 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 + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) } - }() - 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 { + out.Dispatch() + if invalids > 0 { return graphql.Null } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return out } -func (ec *executionContext) fieldContext___Type_ofType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) +var nodePoolEdgeImplementors = []string{"NodePoolEdge"} + +func (ec *executionContext) _NodePoolEdge(ctx context.Context, sel ast.SelectionSet, obj *model.NodePoolEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, nodePoolEdgeImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("NodePoolEdge") + case "cursor": + + out.Values[i] = ec._NodePoolEdge_cursor(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} + case "node": -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 + out.Values[i] = ec._NodePoolEdge_node(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) } - }() - 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 { + out.Dispatch() + if invalids > 0 { return graphql.Null } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil + return out } -// endregion **************************** field.gotpl ***************************** - -// region **************************** input.gotpl ***************************** +var nodePoolPaginatedRecordsImplementors = []string{"NodePoolPaginatedRecords"} -func (ec *executionContext) unmarshalInputBYOCClusterIn(ctx context.Context, obj interface{}) (entities.BYOCCluster, error) { - var it entities.BYOCCluster - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } +func (ec *executionContext) _NodePoolPaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.NodePoolPaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, nodePoolPaginatedRecordsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("NodePoolPaginatedRecords") + case "edges": - fieldsInOrder := [...]string{"metadata", "spec", "apiVersion", "kind"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "metadata": - var err error + out.Values[i] = ec._NodePoolPaginatedRecords_edges(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) - it.ObjectMeta, err = ec.unmarshalNMetadataIn2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + invalids++ } - case "spec": - var err error + case "pageInfo": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) - data, err := ec.unmarshalOBYOCClusterSpecIn2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐBYOCClusterSpecIn(ctx, v) - if err != nil { - return it, err - } - if err = ec.resolvers.BYOCClusterIn().Spec(ctx, &it, data); err != nil { - return it, err - } - case "apiVersion": - var err error + out.Values[i] = ec._NodePoolPaginatedRecords_pageInfo(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) - it.APIVersion, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + invalids++ } - case "kind": - var err error + case "totalCount": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) - it.Kind, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err + out.Values[i] = ec._NodePoolPaginatedRecords_totalCount(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -func (ec *executionContext) unmarshalInputBYOCClusterSpecIn(ctx context.Context, obj interface{}) (model.BYOCClusterSpecIn, error) { - var it model.BYOCClusterSpecIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } +var pageInfoImplementors = []string{"PageInfo"} - fieldsInOrder := [...]string{"provider", "publicIps", "region", "storageClasses", "accountName", "displayName", "incomingKafkaTopic", "ingressClasses"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "provider": - var err error +func (ec *executionContext) _PageInfo(ctx context.Context, sel ast.SelectionSet, obj *model.PageInfo) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, pageInfoImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("PageInfo") + case "endCursor": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("provider")) - it.Provider, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "publicIps": - var err error + out.Values[i] = ec._PageInfo_endCursor(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("publicIps")) - it.PublicIps, err = ec.unmarshalOString2ᚕᚖstring(ctx, v) - if err != nil { - return it, err - } - case "region": - var err error + case "hasNextPage": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("region")) - it.Region, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "storageClasses": - var err error + out.Values[i] = ec._PageInfo_hasNextPage(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storageClasses")) - it.StorageClasses, err = ec.unmarshalOString2ᚕᚖstring(ctx, v) - if err != nil { - return it, err - } - case "accountName": - var err error + case "hasPreviousPage": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("accountName")) - it.AccountName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "displayName": - var err error + out.Values[i] = ec._PageInfo_hasPreviousPage(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) - it.DisplayName, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - case "incomingKafkaTopic": - var err error + case "startCursor": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("incomingKafkaTopic")) - it.IncomingKafkaTopic, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "ingressClasses": - var err error + out.Values[i] = ec._PageInfo_startCursor(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ingressClasses")) - it.IngressClasses, err = ec.unmarshalOString2ᚕᚖstring(ctx, v) - if err != nil { - return it, err - } + default: + panic("unknown field " + strconv.Quote(field.Name)) } } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var persistentVolumeImplementors = []string{"PersistentVolume"} + +func (ec *executionContext) _PersistentVolume(ctx context.Context, sel ast.SelectionSet, obj *entities.PersistentVolume) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, persistentVolumeImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("PersistentVolume") + case "accountName": + + out.Values[i] = ec._PersistentVolume_accountName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "apiVersion": - return it, nil -} + out.Values[i] = ec._PersistentVolume_apiVersion(ctx, field, obj) -func (ec *executionContext) unmarshalInputCloudProviderIn(ctx context.Context, obj interface{}) (entities.CloudProvider, error) { - var it entities.CloudProvider - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } + case "clusterName": - fieldsInOrder := [...]string{"apiVersion", "kind", "metadata", "spec"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "apiVersion": - var err error + out.Values[i] = ec._PersistentVolume_clusterName(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) - it.APIVersion, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - case "kind": - var err error + case "createdBy": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) - it.Kind, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err - } - case "metadata": - var err error + out.Values[i] = ec._PersistentVolume_createdBy(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) - it.ObjectMeta, err = ec.unmarshalNMetadataIn2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - case "spec": - var err error + case "creationTime": + field := field - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) - data, err := ec.unmarshalOCloudProviderSpecIn2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐCloudProviderSpecIn(ctx, v) - if err != nil { - return it, err - } - if err = ec.resolvers.CloudProviderIn().Spec(ctx, &it, data); err != nil { - return it, err + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._PersistentVolume_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res } - } - } - return it, nil -} + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) -func (ec *executionContext) unmarshalInputCloudProviderSpecIn(ctx context.Context, obj interface{}) (model.CloudProviderSpecIn, error) { - var it model.CloudProviderSpecIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } + }) + case "displayName": - fieldsInOrder := [...]string{"display_name", "provider", "providerSecret", "accountName"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "display_name": - var err error + out.Values[i] = ec._PersistentVolume_displayName(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("display_name")) - it.DisplayName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - case "provider": - var err error + case "id": + field := field - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("provider")) - it.Provider, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._PersistentVolume_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res } - case "providerSecret": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("providerSecret")) - it.ProviderSecret, err = ec.unmarshalNCloudProviderSpecProviderSecretIn2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐCloudProviderSpecProviderSecretIn(ctx, v) - if err != nil { - return it, err - } - case "accountName": - var err error + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("accountName")) - it.AccountName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - } - } + }) + case "kind": - return it, nil -} + out.Values[i] = ec._PersistentVolume_kind(ctx, field, obj) -func (ec *executionContext) unmarshalInputCloudProviderSpecProviderSecretIn(ctx context.Context, obj interface{}) (model.CloudProviderSpecProviderSecretIn, error) { - var it model.CloudProviderSpecProviderSecretIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } + case "lastUpdatedBy": - fieldsInOrder := [...]string{"name", "namespace"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "name": - var err error + out.Values[i] = ec._PersistentVolume_lastUpdatedBy(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - it.Name, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - case "namespace": - var err error + case "markedForDeletion": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) - it.Namespace, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - } - } + out.Values[i] = ec._PersistentVolume_markedForDeletion(ctx, field, obj) - return it, nil -} + case "metadata": -func (ec *executionContext) unmarshalInputClusterIn(ctx context.Context, obj interface{}) (entities.Cluster, error) { - var it entities.Cluster - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } + out.Values[i] = ec._PersistentVolume_metadata(ctx, field, obj) - fieldsInOrder := [...]string{"apiVersion", "kind", "metadata", "spec"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "apiVersion": - var err error + case "recordVersion": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) - it.APIVersion, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err + out.Values[i] = ec._PersistentVolume_recordVersion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - case "kind": - var err error + case "spec": + field := field - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) - it.Kind, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._PersistentVolume_spec(ctx, field, obj) + return res } - case "metadata": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) - it.ObjectMeta, err = ec.unmarshalNMetadataIn2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) - if err != nil { - return it, err + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "status": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._PersistentVolume_status(ctx, field, obj) + return res } - case "spec": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) - data, err := ec.unmarshalOClusterSpecIn2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐClusterSpecIn(ctx, v) - if err != nil { - return it, err + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "syncStatus": + + out.Values[i] = ec._PersistentVolume_syncStatus(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - if err = ec.resolvers.ClusterIn().Spec(ctx, &it, data); err != nil { - return it, err + case "updateTime": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._PersistentVolume_updateTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -func (ec *executionContext) unmarshalInputClusterSpecIn(ctx context.Context, obj interface{}) (model.ClusterSpecIn, error) { - var it model.ClusterSpecIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } +var persistentVolumeClaimImplementors = []string{"PersistentVolumeClaim"} - fieldsInOrder := [...]string{"provider", "providerName", "region", "accountName", "config", "count"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "provider": - var err error +func (ec *executionContext) _PersistentVolumeClaim(ctx context.Context, sel ast.SelectionSet, obj *entities.PersistentVolumeClaim) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, persistentVolumeClaimImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("PersistentVolumeClaim") + case "accountName": + + out.Values[i] = ec._PersistentVolumeClaim_accountName(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("provider")) - it.Provider, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - case "providerName": - var err error + case "apiVersion": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("providerName")) - it.ProviderName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "region": - var err error + out.Values[i] = ec._PersistentVolumeClaim_apiVersion(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("region")) - it.Region, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "accountName": - var err error + case "clusterName": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("accountName")) - it.AccountName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + out.Values[i] = ec._PersistentVolumeClaim_clusterName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - case "config": - var err error + case "createdBy": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("config")) - it.Config, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + out.Values[i] = ec._PersistentVolumeClaim_createdBy(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - case "count": - var err error + case "creationTime": + field := field - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("count")) - it.Count, err = ec.unmarshalNInt2int(ctx, v) - if err != nil { - return it, err + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._PersistentVolumeClaim_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res } - } - } - return it, nil -} + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) -func (ec *executionContext) unmarshalInputEdgeIn(ctx context.Context, obj interface{}) (entities.Edge, error) { - var it entities.Edge - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } + }) + case "displayName": - fieldsInOrder := [...]string{"apiVersion", "kind", "metadata", "spec"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "apiVersion": - var err error + out.Values[i] = ec._PersistentVolumeClaim_displayName(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) - it.APIVersion, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - case "kind": - var err error + case "id": + field := field - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) - it.Kind, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._PersistentVolumeClaim_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res } - case "metadata": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) - it.ObjectMeta, err = ec.unmarshalNMetadataIn2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) - if err != nil { - return it, err - } - case "spec": - var err error + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) - data, err := ec.unmarshalOEdgeSpecIn2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐEdgeSpecIn(ctx, v) - if err != nil { - return it, err - } - if err = ec.resolvers.EdgeIn().Spec(ctx, &it, data); err != nil { - return it, err - } - } - } + }) + case "kind": - return it, nil -} + out.Values[i] = ec._PersistentVolumeClaim_kind(ctx, field, obj) -func (ec *executionContext) unmarshalInputEdgeSpecIn(ctx context.Context, obj interface{}) (model.EdgeSpecIn, error) { - var it model.EdgeSpecIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } + case "lastUpdatedBy": - fieldsInOrder := [...]string{"accountName", "clusterName", "pools", "provider", "providerName", "region"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "accountName": - var err error + out.Values[i] = ec._PersistentVolumeClaim_lastUpdatedBy(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("accountName")) - it.AccountName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - case "clusterName": - var err error + case "markedForDeletion": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - it.ClusterName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "pools": - var err error + out.Values[i] = ec._PersistentVolumeClaim_markedForDeletion(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pools")) - it.Pools, err = ec.unmarshalOEdgeSpecPoolsIn2ᚕᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐEdgeSpecPoolsIn(ctx, v) - if err != nil { - return it, err - } - case "provider": - var err error + case "metadata": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("provider")) - it.Provider, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err + out.Values[i] = ec._PersistentVolumeClaim_metadata(ctx, field, obj) + + case "recordVersion": + + out.Values[i] = ec._PersistentVolumeClaim_recordVersion(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - case "providerName": - var err error + case "spec": + field := field - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("providerName")) - it.ProviderName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._PersistentVolumeClaim_spec(ctx, field, obj) + return res } - case "region": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("region")) - it.Region, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "status": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._PersistentVolumeClaim_status(ctx, field, obj) + return res } - } - } - return it, nil -} + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) -func (ec *executionContext) unmarshalInputEdgeSpecPoolsIn(ctx context.Context, obj interface{}) (model.EdgeSpecPoolsIn, error) { - var it model.EdgeSpecPoolsIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } + }) + case "syncStatus": - fieldsInOrder := [...]string{"name", "config", "max", "min"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "name": - var err error + out.Values[i] = ec._PersistentVolumeClaim_syncStatus(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - it.Name, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - case "config": - var err error + case "updateTime": + field := field - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("config")) - it.Config, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._PersistentVolumeClaim_updateTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res } - case "max": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("max")) - it.Max, err = ec.unmarshalOInt2ᚖint(ctx, v) - if err != nil { - return it, err - } - case "min": - var err error + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("min")) - it.Min, err = ec.unmarshalOInt2ᚖint(ctx, v) - if err != nil { - return it, err - } + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil -} - -func (ec *executionContext) unmarshalInputMasterNodeIn(ctx context.Context, obj interface{}) (entities.MasterNode, error) { - var it entities.MasterNode - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v + out.Dispatch() + if invalids > 0 { + return graphql.Null } + return out +} - fieldsInOrder := [...]string{"apiVersion", "kind", "metadata", "spec"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "apiVersion": - var err error +var persistentVolumeClaimEdgeImplementors = []string{"PersistentVolumeClaimEdge"} - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) - it.APIVersion, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err - } - case "kind": - var err error +func (ec *executionContext) _PersistentVolumeClaimEdge(ctx context.Context, sel ast.SelectionSet, obj *model.PersistentVolumeClaimEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, persistentVolumeClaimEdgeImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("PersistentVolumeClaimEdge") + case "cursor": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) - it.Kind, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err - } - case "metadata": - var err error + out.Values[i] = ec._PersistentVolumeClaimEdge_cursor(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) - it.ObjectMeta, err = ec.unmarshalNMetadataIn2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + invalids++ } - case "spec": - var err error + case "node": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) - data, err := ec.unmarshalOMasterNodeSpecIn2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐMasterNodeSpecIn(ctx, v) - if err != nil { - return it, err - } - if err = ec.resolvers.MasterNodeIn().Spec(ctx, &it, data); err != nil { - return it, err + out.Values[i] = ec._PersistentVolumeClaimEdge_node(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -func (ec *executionContext) unmarshalInputMasterNodeSpecIn(ctx context.Context, obj interface{}) (model.MasterNodeSpecIn, error) { - var it model.MasterNodeSpecIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } +var persistentVolumeClaimPaginatedRecordsImplementors = []string{"PersistentVolumeClaimPaginatedRecords"} - fieldsInOrder := [...]string{"region", "accountName", "clusterName", "config", "provider", "providerName"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "region": - var err error +func (ec *executionContext) _PersistentVolumeClaimPaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.PersistentVolumeClaimPaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, persistentVolumeClaimPaginatedRecordsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("PersistentVolumeClaimPaginatedRecords") + case "edges": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("region")) - it.Region, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "accountName": - var err error + out.Values[i] = ec._PersistentVolumeClaimPaginatedRecords_edges(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("accountName")) - it.AccountName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + invalids++ } - case "clusterName": - var err error + case "pageInfo": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - it.ClusterName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "config": - var err error + out.Values[i] = ec._PersistentVolumeClaimPaginatedRecords_pageInfo(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("config")) - it.Config, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + invalids++ } - case "provider": - var err error + case "totalCount": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("provider")) - it.Provider, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "providerName": - var err error + out.Values[i] = ec._PersistentVolumeClaimPaginatedRecords_totalCount(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("providerName")) - it.ProviderName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + invalids++ } + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -func (ec *executionContext) unmarshalInputMetadataIn(ctx context.Context, obj interface{}) (v1.ObjectMeta, error) { - var it v1.ObjectMeta - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } +var persistentVolumeEdgeImplementors = []string{"PersistentVolumeEdge"} - fieldsInOrder := [...]string{"name", "namespace", "labels", "annotations"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "name": - var err error +func (ec *executionContext) _PersistentVolumeEdge(ctx context.Context, sel ast.SelectionSet, obj *model.PersistentVolumeEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, persistentVolumeEdgeImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("PersistentVolumeEdge") + case "cursor": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - it.Name, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "namespace": - var err error + out.Values[i] = ec._PersistentVolumeEdge_cursor(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) - it.Namespace, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + invalids++ } - case "labels": - var err error + case "node": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("labels")) - data, err := ec.unmarshalOJson2map(ctx, v) - if err != nil { - return it, err - } - if err = ec.resolvers.MetadataIn().Labels(ctx, &it, data); err != nil { - return it, err - } - case "annotations": - var err error + out.Values[i] = ec._PersistentVolumeEdge_node(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotations")) - data, err := ec.unmarshalOJson2map(ctx, v) - if err != nil { - return it, err - } - if err = ec.resolvers.MetadataIn().Annotations(ctx, &it, data); err != nil { - return it, err + if out.Values[i] == graphql.Null { + invalids++ } + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -func (ec *executionContext) unmarshalInputNodePoolIn(ctx context.Context, obj interface{}) (entities.NodePool, error) { - var it entities.NodePool - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } +var persistentVolumePaginatedRecordsImplementors = []string{"PersistentVolumePaginatedRecords"} - fieldsInOrder := [...]string{"apiVersion", "kind", "metadata", "spec"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "apiVersion": - var err error +func (ec *executionContext) _PersistentVolumePaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.PersistentVolumePaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, persistentVolumePaginatedRecordsImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("PersistentVolumePaginatedRecords") + case "edges": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) - it.APIVersion, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err - } - case "kind": - var err error + out.Values[i] = ec._PersistentVolumePaginatedRecords_edges(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) - it.Kind, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err + if out.Values[i] == graphql.Null { + invalids++ } - case "metadata": - var err error + case "pageInfo": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) - it.ObjectMeta, err = ec.unmarshalNMetadataIn2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) - if err != nil { - return it, err + out.Values[i] = ec._PersistentVolumePaginatedRecords_pageInfo(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } - case "spec": - var err error + case "totalCount": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) - data, err := ec.unmarshalONodePoolSpecIn2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐNodePoolSpecIn(ctx, v) - if err != nil { - return it, err + out.Values[i] = ec._PersistentVolumePaginatedRecords_totalCount(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } - if err = ec.resolvers.NodePoolIn().Spec(ctx, &it, data); err != nil { - return it, err + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + 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) + var invalids uint32 + 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 "infra_checkNameAvailability": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_infra_checkNameAvailability(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res } - } - } - - return it, nil -} -func (ec *executionContext) unmarshalInputNodePoolSpecIn(ctx context.Context, obj interface{}) (model.NodePoolSpecIn, error) { - var it model.NodePoolSpecIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } - fieldsInOrder := [...]string{"accountName", "config", "max", "providerName", "region", "clusterName", "edgeName", "min", "provider"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "accountName": - var err error + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "infra_listClusters": + field := field - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("accountName")) - it.AccountName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_infra_listClusters(ctx, field) + return res } - case "config": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("config")) - it.Config, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) } - case "max": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("max")) - it.Max, err = ec.unmarshalOInt2ᚖint(ctx, v) - if err != nil { - return it, err - } - case "providerName": - var err error + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "infra_getCluster": + field := field - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("providerName")) - it.ProviderName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_infra_getCluster(ctx, field) + return res } - case "region": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("region")) - it.Region, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) } - case "clusterName": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - it.ClusterName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "edgeName": - var err error + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "infra_listNodePools": + field := field - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("edgeName")) - it.EdgeName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_infra_listNodePools(ctx, field) + return res } - case "min": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("min")) - it.Min, err = ec.unmarshalOInt2ᚖint(ctx, v) - if err != nil { - return it, err + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) } - case "provider": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("provider")) - it.Provider, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - } - } + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "infra_getNodePool": + field := field - return it, nil -} + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_infra_getNodePool(ctx, field) + return res + } -func (ec *executionContext) unmarshalInputOverridesIn(ctx context.Context, obj interface{}) (v11.JsonPatch, error) { - var it v11.JsonPatch - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } - fieldsInOrder := [...]string{"patches"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "patches": - var err error + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "infra_listProviderSecrets": + field := field - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("patches")) - it.Patches, err = ec.unmarshalOPatchIn2ᚕgithubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋjsonᚑpatchᚐPatchOperationᚄ(ctx, v) - if err != nil { - return it, err + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_infra_listProviderSecrets(ctx, field) + return res } - } - } - - return it, nil -} -func (ec *executionContext) unmarshalInputPatchIn(ctx context.Context, obj interface{}) (json_patch.PatchOperation, error) { - var it json_patch.PatchOperation - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } - fieldsInOrder := [...]string{"op", "path", "value"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "op": - var err error + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "infra_getProviderSecret": + field := field - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("op")) - it.Op, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_infra_getProviderSecret(ctx, field) + return res } - case "path": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("path")) - it.Path, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) } - case "value": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) - data, err := ec.unmarshalOAny2interface(ctx, v) - if err != nil { - return it, err - } - if err = ec.resolvers.PatchIn().Value(ctx, &it, data); err != nil { - return it, err + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "infra_listDomainEntries": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_infra_listDomainEntries(ctx, field) + return res } - } - } - return it, nil -} + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } -func (ec *executionContext) unmarshalInputSecretIn(ctx context.Context, obj interface{}) (entities.Secret, error) { - var it entities.Secret - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "infra_getDomainEntry": + field := field - fieldsInOrder := [...]string{"stringData", "apiVersion", "data", "enabled", "kind", "metadata", "overrides", "projectName", "type"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "stringData": - var err error + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_infra_getDomainEntry(ctx, field) + return res + } - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stringData")) - data, err := ec.unmarshalOMap2map(ctx, v) - if err != nil { - return it, err + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) } - if err = ec.resolvers.SecretIn().StringData(ctx, &it, data); err != nil { - return it, err + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "infra_checkAwsAccess": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_infra_checkAwsAccess(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res } - case "apiVersion": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) - it.APIVersion, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) } - case "data": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("data")) - data, err := ec.unmarshalOMap2map(ctx, v) - if err != nil { - return it, err - } - if err = ec.resolvers.SecretIn().Data(ctx, &it, data); err != nil { - return it, err - } - case "enabled": - var err error + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "infra_listClusterManagedServices": + field := field - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) - it.Enabled, err = ec.unmarshalOBoolean2bool(ctx, v) - if err != nil { - return it, err + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_infra_listClusterManagedServices(ctx, field) + return res } - case "kind": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) - it.Kind, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) } - case "metadata": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) - it.ObjectMeta, err = ec.unmarshalNMetadataIn2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) - if err != nil { - return it, err - } - case "overrides": - var err error + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "infra_getClusterManagedService": + field := field - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("overrides")) - it.Overrides, err = ec.unmarshalOOverridesIn2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋapisᚋcrdsᚋv1ᚐJsonPatch(ctx, v) - if err != nil { - return it, err + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_infra_getClusterManagedService(ctx, field) + return res } - case "projectName": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - it.ProjectName, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) } - case "type": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - if err = ec.resolvers.SecretIn().Type(ctx, &it, data); err != nil { - return it, err - } - } - } + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "infra_listHelmReleases": + field := field - return it, nil -} + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_infra_listHelmReleases(ctx, field) + return res + } -func (ec *executionContext) unmarshalInputWorkerNodeIn(ctx context.Context, obj interface{}) (entities.WorkerNode, error) { - var it entities.WorkerNode - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } - fieldsInOrder := [...]string{"metadata", "spec", "apiVersion", "kind"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "metadata": - var err error + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "infra_getHelmRelease": + field := field - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) - it.ObjectMeta, err = ec.unmarshalNMetadataIn2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) - if err != nil { - return it, err + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_infra_getHelmRelease(ctx, field) + return res } - case "spec": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) - data, err := ec.unmarshalOWorkerNodeSpecIn2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐWorkerNodeSpecIn(ctx, v) - if err != nil { - return it, err + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) } - if err = ec.resolvers.WorkerNodeIn().Spec(ctx, &it, data); err != nil { - return it, err + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "infra_listManagedServiceTemplates": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_infra_listManagedServiceTemplates(ctx, field) + return res } - case "apiVersion": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) - it.APIVersion, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) } - case "kind": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) - it.Kind, err = ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "infra_getManagedServiceTemplate": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_infra_getManagedServiceTemplate(ctx, field) + return res } - } - } - return it, nil -} + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } -func (ec *executionContext) unmarshalInputWorkerNodeSpecIn(ctx context.Context, obj interface{}) (model.WorkerNodeSpecIn, error) { - var it model.WorkerNodeSpecIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "infra_listPVCs": + field := field - fieldsInOrder := [...]string{"clusterName", "config", "nodeIndex", "pool", "provider", "accountName", "edgeName", "providerName", "region", "stateful"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "clusterName": - var err error + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_infra_listPVCs(ctx, field) + return res + } - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - it.ClusterName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) } - case "config": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("config")) - it.Config, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "infra_getPVC": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_infra_getPVC(ctx, field) + return res } - case "nodeIndex": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nodeIndex")) - it.NodeIndex, err = ec.unmarshalOInt2ᚖint(ctx, v) - if err != nil { - return it, err + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) } - case "pool": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pool")) - it.Pool, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "infra_listNamespaces": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_infra_listNamespaces(ctx, field) + return res } - case "provider": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("provider")) - it.Provider, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) } - case "accountName": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("accountName")) - it.AccountName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "infra_getNamespace": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_infra_getNamespace(ctx, field) + return res } - case "edgeName": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("edgeName")) - it.EdgeName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) } - case "providerName": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("providerName")) - it.ProviderName, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "region": - var err error + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "infra_listPVs": + field := field - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("region")) - it.Region, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_infra_listPVs(ctx, field) + return res } - case "stateful": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stateful")) - it.Stateful, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) - if err != nil { - return it, err + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) } - } - } - - return it, nil -} -// endregion **************************** input.gotpl ***************************** + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "infra_getPV": + field := field -// region ************************** interface.gotpl *************************** + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_infra_getPV(ctx, field) + return res + } -// endregion ************************** interface.gotpl *************************** + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } -// region **************************** object.gotpl **************************** + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "infra_listVolumeAttachments": + field := field -var bYOCClusterImplementors = []string{"BYOCCluster"} + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_infra_listVolumeAttachments(ctx, field) + return res + } -func (ec *executionContext) _BYOCCluster(ctx context.Context, sel ast.SelectionSet, obj *entities.BYOCCluster) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, bYOCClusterImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("BYOCCluster") - case "metadata": + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } - out.Values[i] = ec._BYOCCluster_metadata(ctx, field, obj) + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "infra_getVolumeAttachment": + field := field - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_infra_getVolumeAttachment(ctx, field) + return res } - case "syncStatus": - out.Values[i] = ec._BYOCCluster_syncStatus(ctx, field, obj) + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } - case "spec": + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "_service": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -14349,25 +58963,31 @@ func (ec *executionContext) _BYOCCluster(ctx context.Context, sel ast.SelectionS ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._BYOCCluster_spec(ctx, field, obj) + res = ec._Query__service(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) - case "status": - - out.Values[i] = ec._BYOCCluster_status(ctx, field, obj) - - case "apiVersion": + case "__type": - out.Values[i] = ec._BYOCCluster_apiVersion(ctx, field, obj) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + }) - case "kind": + case "__schema": - out.Values[i] = ec._BYOCCluster_kind(ctx, field, obj) + 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)) @@ -14380,169 +59000,135 @@ func (ec *executionContext) _BYOCCluster(ctx context.Context, sel ast.SelectionS return out } -var bYOCClusterSpecImplementors = []string{"BYOCClusterSpec"} +var volumeAttachmentImplementors = []string{"VolumeAttachment"} -func (ec *executionContext) _BYOCClusterSpec(ctx context.Context, sel ast.SelectionSet, obj *model.BYOCClusterSpec) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, bYOCClusterSpecImplementors) +func (ec *executionContext) _VolumeAttachment(ctx context.Context, sel ast.SelectionSet, obj *entities.VolumeAttachment) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, volumeAttachmentImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("BYOCClusterSpec") - case "provider": + out.Values[i] = graphql.MarshalString("VolumeAttachment") + case "accountName": - out.Values[i] = ec._BYOCClusterSpec_provider(ctx, field, obj) + out.Values[i] = ec._VolumeAttachment_accountName(ctx, field, obj) if out.Values[i] == graphql.Null { - invalids++ + atomic.AddUint32(&invalids, 1) } - case "publicIps": + case "apiVersion": - out.Values[i] = ec._BYOCClusterSpec_publicIps(ctx, field, obj) + out.Values[i] = ec._VolumeAttachment_apiVersion(ctx, field, obj) - case "region": + case "clusterName": - out.Values[i] = ec._BYOCClusterSpec_region(ctx, field, obj) + out.Values[i] = ec._VolumeAttachment_clusterName(ctx, field, obj) if out.Values[i] == graphql.Null { - invalids++ + atomic.AddUint32(&invalids, 1) } - case "storageClasses": - - out.Values[i] = ec._BYOCClusterSpec_storageClasses(ctx, field, obj) + case "createdBy": - case "accountName": - - out.Values[i] = ec._BYOCClusterSpec_accountName(ctx, field, obj) + out.Values[i] = ec._VolumeAttachment_createdBy(ctx, field, obj) if out.Values[i] == graphql.Null { - invalids++ + atomic.AddUint32(&invalids, 1) } - case "displayName": - - out.Values[i] = ec._BYOCClusterSpec_displayName(ctx, field, obj) - - case "incomingKafkaTopic": - - out.Values[i] = ec._BYOCClusterSpec_incomingKafkaTopic(ctx, field, obj) + case "creationTime": + field := field - if out.Values[i] == graphql.Null { - invalids++ + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._VolumeAttachment_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res } - case "ingressClasses": - - out.Values[i] = ec._BYOCClusterSpec_ingressClasses(ctx, field, obj) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var checkImplementors = []string{"Check"} - -func (ec *executionContext) _Check(ctx context.Context, sel ast.SelectionSet, obj *operator.Check) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, checkImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Check") - case "status": - - out.Values[i] = ec._Check_status(ctx, field, obj) - case "message": + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) - out.Values[i] = ec._Check_message(ctx, field, obj) + }) + case "displayName": - case "generation": + out.Values[i] = ec._VolumeAttachment_displayName(ctx, field, obj) - out.Values[i] = ec._Check_generation(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "id": + field := field - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._VolumeAttachment_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } -var checkNameAvailabilityOutputImplementors = []string{"CheckNameAvailabilityOutput"} + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) -func (ec *executionContext) _CheckNameAvailabilityOutput(ctx context.Context, sel ast.SelectionSet, obj *domain.CheckNameAvailabilityOutput) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, checkNameAvailabilityOutputImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("CheckNameAvailabilityOutput") - case "result": + }) + case "kind": - out.Values[i] = ec._CheckNameAvailabilityOutput_result(ctx, field, obj) + out.Values[i] = ec._VolumeAttachment_kind(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ - } - case "suggestedNames": + case "lastUpdatedBy": - out.Values[i] = ec._CheckNameAvailabilityOutput_suggestedNames(ctx, field, obj) + out.Values[i] = ec._VolumeAttachment_lastUpdatedBy(ctx, field, obj) if out.Values[i] == graphql.Null { - invalids++ + atomic.AddUint32(&invalids, 1) } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var cloudProviderImplementors = []string{"CloudProvider"} - -func (ec *executionContext) _CloudProvider(ctx context.Context, sel ast.SelectionSet, obj *entities.CloudProvider) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, cloudProviderImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("CloudProvider") - case "apiVersion": + case "markedForDeletion": - out.Values[i] = ec._CloudProvider_apiVersion(ctx, field, obj) + out.Values[i] = ec._VolumeAttachment_markedForDeletion(ctx, field, obj) - case "kind": + case "metadata": - out.Values[i] = ec._CloudProvider_kind(ctx, field, obj) + out.Values[i] = ec._VolumeAttachment_metadata(ctx, field, obj) - case "metadata": + case "recordVersion": - out.Values[i] = ec._CloudProvider_metadata(ctx, field, obj) + out.Values[i] = ec._VolumeAttachment_recordVersion(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - case "syncStatus": + case "spec": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._VolumeAttachment_spec(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } - out.Values[i] = ec._CloudProvider_syncStatus(ctx, field, obj) + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) - case "spec": + }) + case "status": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -14551,7 +59137,7 @@ func (ec *executionContext) _CloudProvider(ctx context.Context, sel ast.Selectio ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._CloudProvider_spec(ctx, field, obj) + res = ec._VolumeAttachment_status(ctx, field, obj) return res } @@ -14559,7 +59145,14 @@ func (ec *executionContext) _CloudProvider(ctx context.Context, sel ast.Selectio return innerFunc(ctx) }) - case "status": + case "syncStatus": + + out.Values[i] = ec._VolumeAttachment_syncStatus(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "updateTime": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -14568,7 +59161,10 @@ func (ec *executionContext) _CloudProvider(ctx context.Context, sel ast.Selectio ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._CloudProvider_status(ctx, field, obj) + res = ec._VolumeAttachment_updateTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res } @@ -14587,40 +59183,26 @@ func (ec *executionContext) _CloudProvider(ctx context.Context, sel ast.Selectio return out } -var cloudProviderSpecImplementors = []string{"CloudProviderSpec"} +var volumeAttachmentEdgeImplementors = []string{"VolumeAttachmentEdge"} -func (ec *executionContext) _CloudProviderSpec(ctx context.Context, sel ast.SelectionSet, obj *model.CloudProviderSpec) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, cloudProviderSpecImplementors) +func (ec *executionContext) _VolumeAttachmentEdge(ctx context.Context, sel ast.SelectionSet, obj *model.VolumeAttachmentEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, volumeAttachmentEdgeImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("CloudProviderSpec") - case "display_name": - - out.Values[i] = ec._CloudProviderSpec_display_name(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "provider": - - out.Values[i] = ec._CloudProviderSpec_provider(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "providerSecret": + out.Values[i] = graphql.MarshalString("VolumeAttachmentEdge") + case "cursor": - out.Values[i] = ec._CloudProviderSpec_providerSecret(ctx, field, obj) + out.Values[i] = ec._VolumeAttachmentEdge_cursor(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "accountName": + case "node": - out.Values[i] = ec._CloudProviderSpec_accountName(ctx, field, obj) + out.Values[i] = ec._VolumeAttachmentEdge_node(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -14636,26 +59218,33 @@ func (ec *executionContext) _CloudProviderSpec(ctx context.Context, sel ast.Sele return out } -var cloudProviderSpecProviderSecretImplementors = []string{"CloudProviderSpecProviderSecret"} +var volumeAttachmentPaginatedRecordsImplementors = []string{"VolumeAttachmentPaginatedRecords"} -func (ec *executionContext) _CloudProviderSpecProviderSecret(ctx context.Context, sel ast.SelectionSet, obj *model.CloudProviderSpecProviderSecret) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, cloudProviderSpecProviderSecretImplementors) +func (ec *executionContext) _VolumeAttachmentPaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.VolumeAttachmentPaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, volumeAttachmentPaginatedRecordsImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("CloudProviderSpecProviderSecret") - case "name": + out.Values[i] = graphql.MarshalString("VolumeAttachmentPaginatedRecords") + case "edges": - out.Values[i] = ec._CloudProviderSpecProviderSecret_name(ctx, field, obj) + out.Values[i] = ec._VolumeAttachmentPaginatedRecords_edges(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "namespace": + case "pageInfo": + + out.Values[i] = ec._VolumeAttachmentPaginatedRecords_pageInfo(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "totalCount": - out.Values[i] = ec._CloudProviderSpecProviderSecret_namespace(ctx, field, obj) + out.Values[i] = ec._VolumeAttachmentPaginatedRecords_totalCount(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -14671,69 +59260,20 @@ func (ec *executionContext) _CloudProviderSpecProviderSecret(ctx context.Context return out } -var clusterImplementors = []string{"Cluster"} +var _ServiceImplementors = []string{"_Service"} -func (ec *executionContext) _Cluster(ctx context.Context, sel ast.SelectionSet, obj *entities.Cluster) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, clusterImplementors) +func (ec *executionContext) __Service(ctx context.Context, sel ast.SelectionSet, obj *fedruntime.Service) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, _ServiceImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Cluster") - case "apiVersion": - - out.Values[i] = ec._Cluster_apiVersion(ctx, field, obj) - - case "kind": - - out.Values[i] = ec._Cluster_kind(ctx, field, obj) - - case "metadata": - - out.Values[i] = ec._Cluster_metadata(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "syncStatus": - - out.Values[i] = ec._Cluster_syncStatus(ctx, field, obj) - - case "spec": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Cluster_spec(ctx, field, obj) - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "status": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Cluster_status(ctx, field, obj) - return res - } + out.Values[i] = graphql.MarshalString("_Service") + case "sdl": - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + out.Values[i] = ec.__Service_sdl(ctx, field, obj) - }) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -14745,58 +59285,91 @@ func (ec *executionContext) _Cluster(ctx context.Context, sel ast.SelectionSet, return out } -var clusterSpecImplementors = []string{"ClusterSpec"} +var __DirectiveImplementors = []string{"__Directive"} -func (ec *executionContext) _ClusterSpec(ctx context.Context, sel ast.SelectionSet, obj *model.ClusterSpec) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, clusterSpecImplementors) +func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("ClusterSpec") - case "provider": + out.Values[i] = graphql.MarshalString("__Directive") + case "name": - out.Values[i] = ec._ClusterSpec_provider(ctx, field, obj) + out.Values[i] = ec.___Directive_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "providerName": + case "description": + + out.Values[i] = ec.___Directive_description(ctx, field, obj) + + case "locations": - out.Values[i] = ec._ClusterSpec_providerName(ctx, field, obj) + out.Values[i] = ec.___Directive_locations(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "region": + case "args": - out.Values[i] = ec._ClusterSpec_region(ctx, field, obj) + out.Values[i] = ec.___Directive_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "accountName": + case "isRepeatable": - out.Values[i] = ec._ClusterSpec_accountName(ctx, field, obj) + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "config": + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} - out.Values[i] = ec._ClusterSpec_config(ctx, field, obj) +var __EnumValueImplementors = []string{"__EnumValue"} + +func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__EnumValue") + case "name": + + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "count": + case "description": + + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) - out.Values[i] = ec._ClusterSpec_count(ctx, field, obj) + case "isDeprecated": + + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } + case "deprecationReason": + + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -14808,69 +59381,52 @@ func (ec *executionContext) _ClusterSpec(ctx context.Context, sel ast.SelectionS return out } -var edgeImplementors = []string{"Edge"} +var __FieldImplementors = []string{"__Field"} -func (ec *executionContext) _Edge(ctx context.Context, sel ast.SelectionSet, obj *entities.Edge) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, edgeImplementors) +func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Edge") - case "apiVersion": + out.Values[i] = graphql.MarshalString("__Field") + case "name": - out.Values[i] = ec._Edge_apiVersion(ctx, field, obj) + out.Values[i] = ec.___Field_name(ctx, field, obj) - case "kind": + if out.Values[i] == graphql.Null { + invalids++ + } + case "description": - out.Values[i] = ec._Edge_kind(ctx, field, obj) + out.Values[i] = ec.___Field_description(ctx, field, obj) - case "metadata": + case "args": - out.Values[i] = ec._Edge_metadata(ctx, field, obj) + out.Values[i] = ec.___Field_args(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + invalids++ } - case "syncStatus": - - out.Values[i] = ec._Edge_syncStatus(ctx, field, obj) + case "type": - case "spec": - field := field + out.Values[i] = ec.___Field_type(ctx, field, obj) - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Edge_spec(ctx, field, obj) - return res + if out.Values[i] == graphql.Null { + invalids++ } + case "isDeprecated": - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "status": - field := field + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Edge_status(ctx, field, obj) - return res + if out.Values[i] == graphql.Null { + invalids++ } + case "deprecationReason": - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) - }) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -14882,52 +59438,38 @@ func (ec *executionContext) _Edge(ctx context.Context, sel ast.SelectionSet, obj return out } -var edgeSpecImplementors = []string{"EdgeSpec"} +var __InputValueImplementors = []string{"__InputValue"} -func (ec *executionContext) _EdgeSpec(ctx context.Context, sel ast.SelectionSet, obj *model.EdgeSpec) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, edgeSpecImplementors) +func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("EdgeSpec") - case "accountName": - - out.Values[i] = ec._EdgeSpec_accountName(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "clusterName": + out.Values[i] = graphql.MarshalString("__InputValue") + case "name": - out.Values[i] = ec._EdgeSpec_clusterName(ctx, field, obj) + out.Values[i] = ec.___InputValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "pools": - - out.Values[i] = ec._EdgeSpec_pools(ctx, field, obj) - - case "provider": + case "description": - out.Values[i] = ec._EdgeSpec_provider(ctx, field, obj) + out.Values[i] = ec.___InputValue_description(ctx, field, obj) - case "providerName": + case "type": - out.Values[i] = ec._EdgeSpec_providerName(ctx, field, obj) + out.Values[i] = ec.___InputValue_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "region": + case "defaultValue": - out.Values[i] = ec._EdgeSpec_region(ctx, field, obj) + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ - } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -14939,38 +59481,49 @@ func (ec *executionContext) _EdgeSpec(ctx context.Context, sel ast.SelectionSet, return out } -var edgeSpecPoolsImplementors = []string{"EdgeSpecPools"} +var __SchemaImplementors = []string{"__Schema"} -func (ec *executionContext) _EdgeSpecPools(ctx context.Context, sel ast.SelectionSet, obj *model.EdgeSpecPools) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, edgeSpecPoolsImplementors) +func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("EdgeSpecPools") - case "name": + out.Values[i] = graphql.MarshalString("__Schema") + case "description": + + out.Values[i] = ec.___Schema_description(ctx, field, obj) + + case "types": + + out.Values[i] = ec.___Schema_types(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "queryType": - out.Values[i] = ec._EdgeSpecPools_name(ctx, field, obj) + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "config": + case "mutationType": + + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) + + case "subscriptionType": + + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) - out.Values[i] = ec._EdgeSpecPools_config(ctx, field, obj) + case "directives": + + out.Values[i] = ec.___Schema_directives(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "max": - - out.Values[i] = ec._EdgeSpecPools_max(ctx, field, obj) - - case "min": - - out.Values[i] = ec._EdgeSpecPools_min(ctx, field, obj) - default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -14982,69 +59535,59 @@ func (ec *executionContext) _EdgeSpecPools(ctx context.Context, sel ast.Selectio return out } -var masterNodeImplementors = []string{"MasterNode"} +var __TypeImplementors = []string{"__Type"} -func (ec *executionContext) _MasterNode(ctx context.Context, sel ast.SelectionSet, obj *entities.MasterNode) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, masterNodeImplementors) +func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("MasterNode") - case "status": - field := field + out.Values[i] = graphql.MarshalString("__Type") + case "kind": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._MasterNode_status(ctx, field, obj) - return res + out.Values[i] = ec.___Type_kind(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ } + case "name": - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + out.Values[i] = ec.___Type_name(ctx, field, obj) - }) - case "apiVersion": + case "description": - out.Values[i] = ec._MasterNode_apiVersion(ctx, field, obj) + out.Values[i] = ec.___Type_description(ctx, field, obj) - case "kind": + case "fields": - out.Values[i] = ec._MasterNode_kind(ctx, field, obj) + out.Values[i] = ec.___Type_fields(ctx, field, obj) - case "metadata": + case "interfaces": - out.Values[i] = ec._MasterNode_metadata(ctx, field, obj) + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "syncStatus": + case "possibleTypes": - out.Values[i] = ec._MasterNode_syncStatus(ctx, field, obj) + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) - case "spec": - field := field + case "enumValues": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._MasterNode_spec(ctx, field, obj) - return res - } + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + 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)) } @@ -15056,1918 +59599,2849 @@ func (ec *executionContext) _MasterNode(ctx context.Context, sel ast.SelectionSe return out } -var masterNodeSpecImplementors = []string{"MasterNodeSpec"} +// endregion **************************** object.gotpl **************************** -func (ec *executionContext) _MasterNodeSpec(ctx context.Context, sel ast.SelectionSet, obj *model.MasterNodeSpec) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, masterNodeSpecImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("MasterNodeSpec") - case "region": +// region ***************************** type.gotpl ***************************** - out.Values[i] = ec._MasterNodeSpec_region(ctx, field, obj) +func (ec *executionContext) unmarshalNAny2interface(ctx context.Context, v interface{}) (any, error) { + res, err := graphql.UnmarshalAny(v) + return res, graphql.ErrorOnPath(ctx, err) +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "accountName": +func (ec *executionContext) marshalNAny2interface(ctx context.Context, sel ast.SelectionSet, v any) 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 + } + res := graphql.MarshalAny(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 +} - out.Values[i] = ec._MasterNodeSpec_accountName(ctx, field, obj) +func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "clusterName": +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 +} - out.Values[i] = ec._MasterNodeSpec_clusterName(ctx, field, obj) +func (ec *executionContext) marshalNCheckAwsAccessOutput2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐCheckAwsAccessOutput(ctx context.Context, sel ast.SelectionSet, v model.CheckAwsAccessOutput) graphql.Marshaler { + return ec._CheckAwsAccessOutput(ctx, sel, &v) +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "config": +func (ec *executionContext) marshalNCheckAwsAccessOutput2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐCheckAwsAccessOutput(ctx context.Context, sel ast.SelectionSet, v *model.CheckAwsAccessOutput) 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._CheckAwsAccessOutput(ctx, sel, v) +} - out.Values[i] = ec._MasterNodeSpec_config(ctx, field, obj) +func (ec *executionContext) marshalNCheckNameAvailabilityOutput2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋdomainᚐCheckNameAvailabilityOutput(ctx context.Context, sel ast.SelectionSet, v domain.CheckNameAvailabilityOutput) graphql.Marshaler { + return ec._CheckNameAvailabilityOutput(ctx, sel, &v) +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "provider": +func (ec *executionContext) marshalNCheckNameAvailabilityOutput2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋdomainᚐCheckNameAvailabilityOutput(ctx context.Context, sel ast.SelectionSet, v *domain.CheckNameAvailabilityOutput) 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._CheckNameAvailabilityOutput(ctx, sel, v) +} - out.Values[i] = ec._MasterNodeSpec_provider(ctx, field, obj) +func (ec *executionContext) marshalNCloudProviderSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐCloudProviderSecret(ctx context.Context, sel ast.SelectionSet, v *entities.CloudProviderSecret) 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._CloudProviderSecret(ctx, sel, v) +} - if out.Values[i] == graphql.Null { - invalids++ +func (ec *executionContext) marshalNCloudProviderSecretEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐCloudProviderSecretEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.CloudProviderSecretEdge) 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() } - case "providerName": + ret[i] = ec.marshalNCloudProviderSecretEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐCloudProviderSecretEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - out.Values[i] = ec._MasterNodeSpec_providerName(ctx, field, obj) + } + wg.Wait() - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) + for _, e := range ret { + if e == graphql.Null { + return graphql.Null } } - out.Dispatch() - if invalids > 0 { + + return ret +} + +func (ec *executionContext) marshalNCloudProviderSecretEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐCloudProviderSecretEdge(ctx context.Context, sel ast.SelectionSet, v *model.CloudProviderSecretEdge) 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 out + return ec._CloudProviderSecretEdge(ctx, sel, v) } -var metadataImplementors = []string{"Metadata"} - -func (ec *executionContext) _Metadata(ctx context.Context, sel ast.SelectionSet, obj *v1.ObjectMeta) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, metadataImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Metadata") - case "name": - - out.Values[i] = ec._Metadata_name(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "namespace": - - out.Values[i] = ec._Metadata_namespace(ctx, field, obj) +func (ec *executionContext) unmarshalNCloudProviderSecretIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐCloudProviderSecret(ctx context.Context, v interface{}) (entities.CloudProviderSecret, error) { + res, err := ec.unmarshalInputCloudProviderSecretIn(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} - case "labels": - field := field +func (ec *executionContext) marshalNCluster2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐCluster(ctx context.Context, sel ast.SelectionSet, v *entities.Cluster) 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._Cluster(ctx, sel, v) +} - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Metadata_labels(ctx, field, obj) - return res +func (ec *executionContext) marshalNClusterEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐClusterEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ClusterEdge) 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.marshalNClusterEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐClusterEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "annotations": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Metadata_annotations(ctx, field, obj) - return res - } + } + wg.Wait() - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } - }) - case "creationTimestamp": - field := field + return ret +} - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Metadata_creationTimestamp(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } +func (ec *executionContext) marshalNClusterEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐClusterEdge(ctx context.Context, sel ast.SelectionSet, v *model.ClusterEdge) 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._ClusterEdge(ctx, sel, v) +} - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) +func (ec *executionContext) unmarshalNClusterIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐCluster(ctx context.Context, v interface{}) (entities.Cluster, error) { + res, err := ec.unmarshalInputClusterIn(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} - }) - case "deletionTimestamp": - field := field +func (ec *executionContext) marshalNClusterManagedService2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐClusterManagedService(ctx context.Context, sel ast.SelectionSet, v *entities.ClusterManagedService) 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._ClusterManagedService(ctx, sel, v) +} - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Metadata_deletionTimestamp(ctx, field, obj) - return res +func (ec *executionContext) marshalNClusterManagedServiceEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐClusterManagedServiceEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ClusterManagedServiceEdge) 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.marshalNClusterManagedServiceEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐClusterManagedServiceEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + } + wg.Wait() - }) - case "generation": + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } - out.Values[i] = ec._Metadata_generation(ctx, field, obj) + return ret +} - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNClusterManagedServiceEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐClusterManagedServiceEdge(ctx context.Context, sel ast.SelectionSet, v *model.ClusterManagedServiceEdge) 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") } - } - out.Dispatch() - if invalids > 0 { return graphql.Null } - return out + return ec._ClusterManagedServiceEdge(ctx, sel, v) } -var mutationImplementors = []string{"Mutation"} +func (ec *executionContext) unmarshalNClusterManagedServiceIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐClusterManagedService(ctx context.Context, v interface{}) (entities.ClusterManagedService, error) { + res, err := ec.unmarshalInputClusterManagedServiceIn(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} -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", - }) +func (ec *executionContext) unmarshalNDate2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ - Object: field.Name, - Field: field, - }) +func (ec *executionContext) marshalNDate2string(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 +} - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Mutation") - case "infra_createBYOCCluster": +func (ec *executionContext) marshalNDomainEntry2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐDomainEntry(ctx context.Context, sel ast.SelectionSet, v *entities.DomainEntry) 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._DomainEntry(ctx, sel, v) +} - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_infra_createBYOCCluster(ctx, field) - }) +func (ec *executionContext) marshalNDomainEntryEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐDomainEntryEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.DomainEntryEdge) 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.marshalNDomainEntryEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐDomainEntryEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - case "infra_updateBYOCCluster": + } + wg.Wait() - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_infra_updateBYOCCluster(ctx, field) - }) + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } - case "infra_deleteBYOCCluster": + return ret +} - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_infra_deleteBYOCCluster(ctx, field) - }) +func (ec *executionContext) marshalNDomainEntryEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐDomainEntryEdge(ctx context.Context, sel ast.SelectionSet, v *model.DomainEntryEdge) 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._DomainEntryEdge(ctx, sel, v) +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "infra_createCluster": +func (ec *executionContext) unmarshalNDomainEntryIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐDomainEntry(ctx context.Context, v interface{}) (entities.DomainEntry, error) { + res, err := ec.unmarshalInputDomainEntryIn(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_infra_createCluster(ctx, field) - }) +func (ec *executionContext) marshalNGithub__com___kloudlite___api___apps___infra___internal___entities__InputField2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsInfraInternalEntitiesInputFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GithubComKloudliteAPIAppsInfraInternalEntitiesInputField) 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.marshalNGithub__com___kloudlite___api___apps___infra___internal___entities__InputField2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsInfraInternalEntitiesInputField(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - case "infra_updateCluster": + } + wg.Wait() - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_infra_updateCluster(ctx, field) - }) + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } - case "infra_deleteCluster": + return ret +} - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_infra_deleteCluster(ctx, field) - }) +func (ec *executionContext) marshalNGithub__com___kloudlite___api___apps___infra___internal___entities__InputField2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsInfraInternalEntitiesInputField(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteAPIAppsInfraInternalEntitiesInputField) 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._Github__com___kloudlite___api___apps___infra___internal___entities__InputField(ctx, sel, v) +} - if out.Values[i] == graphql.Null { - invalids++ +func (ec *executionContext) marshalNGithub__com___kloudlite___api___apps___infra___internal___entities__MresTemplate2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsInfraInternalEntitiesMresTemplateᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GithubComKloudliteAPIAppsInfraInternalEntitiesMresTemplate) 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() } - case "infra_createCloudProvider": + ret[i] = ec.marshalNGithub__com___kloudlite___api___apps___infra___internal___entities__MresTemplate2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsInfraInternalEntitiesMresTemplate(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_infra_createCloudProvider(ctx, field) - }) + } + wg.Wait() - case "infra_updateCloudProvider": + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_infra_updateCloudProvider(ctx, field) - }) + return ret +} - case "infra_deleteCloudProvider": +func (ec *executionContext) marshalNGithub__com___kloudlite___api___apps___infra___internal___entities__MresTemplate2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsInfraInternalEntitiesMresTemplate(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteAPIAppsInfraInternalEntitiesMresTemplate) 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._Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate(ctx, sel, v) +} - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_infra_deleteCloudProvider(ctx, field) - }) +func (ec *executionContext) marshalNGithub__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐMsvcTemplateEntry(ctx context.Context, sel ast.SelectionSet, v entities.MsvcTemplateEntry) graphql.Marshaler { + return ec._Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry(ctx, sel, &v) +} - if out.Values[i] == graphql.Null { - invalids++ +func (ec *executionContext) marshalNGithub__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry2ᚕgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐMsvcTemplateEntryᚄ(ctx context.Context, sel ast.SelectionSet, v []entities.MsvcTemplateEntry) 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() } - case "infra_createEdge": - - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_infra_createEdge(ctx, field) - }) - - case "infra_updateEdge": + ret[i] = ec.marshalNGithub__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐMsvcTemplateEntry(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_infra_updateEdge(ctx, field) - }) + } + wg.Wait() - case "infra_deleteEdge": + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_infra_deleteEdge(ctx, field) - }) + return ret +} - if out.Values[i] == graphql.Null { - invalids++ +func (ec *executionContext) marshalNGithub__com___kloudlite___api___apps___infra___internal___entities__OutputField2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsInfraInternalEntitiesOutputFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GithubComKloudliteAPIAppsInfraInternalEntitiesOutputField) 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() } - case "infra_deleteWorkerNode": + ret[i] = ec.marshalNGithub__com___kloudlite___api___apps___infra___internal___entities__OutputField2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsInfraInternalEntitiesOutputField(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_infra_deleteWorkerNode(ctx, field) - }) + } + wg.Wait() - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) + for _, e := range ret { + if e == graphql.Null { + return graphql.Null } } - out.Dispatch() - if invalids > 0 { + + return ret +} + +func (ec *executionContext) marshalNGithub__com___kloudlite___api___apps___infra___internal___entities__OutputField2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsInfraInternalEntitiesOutputField(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteAPIAppsInfraInternalEntitiesOutputField) 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 out + return ec._Github__com___kloudlite___api___apps___infra___internal___entities__OutputField(ctx, sel, v) } -var nodePoolImplementors = []string{"NodePool"} - -func (ec *executionContext) _NodePool(ctx context.Context, sel ast.SelectionSet, obj *entities.NodePool) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, nodePoolImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("NodePool") - case "apiVersion": - - out.Values[i] = ec._NodePool_apiVersion(ctx, field, obj) - - case "kind": - - out.Values[i] = ec._NodePool_kind(ctx, field, obj) - - case "metadata": - - out.Values[i] = ec._NodePool_metadata(ctx, field, obj) +func (ec *executionContext) marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx context.Context, sel ast.SelectionSet, v common.CreatedOrUpdatedBy) graphql.Marshaler { + return ec._Github__com___kloudlite___api___common__CreatedOrUpdatedBy(ctx, sel, &v) +} - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "syncStatus": +func (ec *executionContext) unmarshalNGithub__com___kloudlite___api___pkg___types__SyncAction2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncAction(ctx context.Context, v interface{}) (types.SyncAction, error) { + tmp, err := graphql.UnmarshalString(v) + res := types.SyncAction(tmp) + return res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec._NodePool_syncStatus(ctx, field, obj) +func (ec *executionContext) marshalNGithub__com___kloudlite___api___pkg___types__SyncAction2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncAction(ctx context.Context, sel ast.SelectionSet, v types.SyncAction) graphql.Marshaler { + res := graphql.MarshalString(string(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 +} - case "spec": - field := field +func (ec *executionContext) unmarshalNGithub__com___kloudlite___api___pkg___types__SyncState2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncState(ctx context.Context, v interface{}) (types.SyncState, error) { + tmp, err := graphql.UnmarshalString(v) + res := types.SyncState(tmp) + return res, graphql.ErrorOnPath(ctx, err) +} - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._NodePool_spec(ctx, field, obj) - return res - } +func (ec *executionContext) marshalNGithub__com___kloudlite___api___pkg___types__SyncState2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncState(ctx context.Context, sel ast.SelectionSet, v types.SyncState) graphql.Marshaler { + res := graphql.MarshalString(string(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 +} - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) +func (ec *executionContext) marshalNGithub__com___kloudlite___api___pkg___types__SyncStatus2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncStatus(ctx context.Context, sel ast.SelectionSet, v types.SyncStatus) graphql.Marshaler { + return ec._Github__com___kloudlite___api___pkg___types__SyncStatus(ctx, sel, &v) +} - }) - case "status": - field := field +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___clusters___v1__AWSPoolType2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AWSPoolType(ctx context.Context, v interface{}) (model.GithubComKloudliteOperatorApisClustersV1AWSPoolType, error) { + var res model.GithubComKloudliteOperatorApisClustersV1AWSPoolType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._NodePool_status(ctx, field, obj) - return res - } +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___clusters___v1__AWSPoolType2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AWSPoolType(ctx context.Context, sel ast.SelectionSet, v model.GithubComKloudliteOperatorApisClustersV1AWSPoolType) graphql.Marshaler { + return v +} - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___clusters___v1__ClusterSpec2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1ClusterSpec(ctx context.Context, sel ast.SelectionSet, v model.GithubComKloudliteOperatorApisClustersV1ClusterSpec) graphql.Marshaler { + return ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec(ctx, sel, &v) +} - }) - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___clusters___v1__ClusterSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1ClusterSpec(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisClustersV1ClusterSpec) 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") } - } - out.Dispatch() - if invalids > 0 { return graphql.Null } - return out + return ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec(ctx, sel, v) } -var nodePoolSpecImplementors = []string{"NodePoolSpec"} +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___clusters___v1__ClusterSpecAvailabilityMode2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1ClusterSpecAvailabilityMode(ctx context.Context, v interface{}) (model.GithubComKloudliteOperatorApisClustersV1ClusterSpecAvailabilityMode, error) { + var res model.GithubComKloudliteOperatorApisClustersV1ClusterSpecAvailabilityMode + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} -func (ec *executionContext) _NodePoolSpec(ctx context.Context, sel ast.SelectionSet, obj *model.NodePoolSpec) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, nodePoolSpecImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("NodePoolSpec") - case "accountName": +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___clusters___v1__ClusterSpecAvailabilityMode2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1ClusterSpecAvailabilityMode(ctx context.Context, sel ast.SelectionSet, v model.GithubComKloudliteOperatorApisClustersV1ClusterSpecAvailabilityMode) graphql.Marshaler { + return v +} - out.Values[i] = ec._NodePoolSpec_accountName(ctx, field, obj) +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___clusters___v1__ClusterSpecIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1ClusterSpecIn(ctx context.Context, v interface{}) (model.GithubComKloudliteOperatorApisClustersV1ClusterSpecIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__ClusterSpecIn(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "config": +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___clusters___v1__ClusterSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1ClusterSpecIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisClustersV1ClusterSpecIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__ClusterSpecIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec._NodePoolSpec_config(ctx, field, obj) +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1InfrastuctureAsCode(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisClustersV1InfrastuctureAsCode) 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._Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode(ctx, sel, v) +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "max": +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1NodePoolSpec(ctx context.Context, sel ast.SelectionSet, v model.GithubComKloudliteOperatorApisClustersV1NodePoolSpec) graphql.Marshaler { + return ec._Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec(ctx, sel, &v) +} - out.Values[i] = ec._NodePoolSpec_max(ctx, field, obj) +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1NodePoolSpec(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisClustersV1NodePoolSpec) 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._Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec(ctx, sel, v) +} - case "providerName": +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___clusters___v1__NodePoolSpecIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1NodePoolSpecIn(ctx context.Context, v interface{}) (model.GithubComKloudliteOperatorApisClustersV1NodePoolSpecIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__NodePoolSpecIn(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec._NodePoolSpec_providerName(ctx, field, obj) +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___clusters___v1__NodePoolSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1NodePoolSpecIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisClustersV1NodePoolSpecIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__NodePoolSpecIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "region": +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___clusters___v1__NodeSpec2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1NodeSpec(ctx context.Context, sel ast.SelectionSet, v model.GithubComKloudliteOperatorApisClustersV1NodeSpec) graphql.Marshaler { + return ec._Github__com___kloudlite___operator___apis___clusters___v1__NodeSpec(ctx, sel, &v) +} - out.Values[i] = ec._NodePoolSpec_region(ctx, field, obj) +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___clusters___v1__NodeSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1NodeSpec(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisClustersV1NodeSpec) 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._Github__com___kloudlite___operator___apis___clusters___v1__NodeSpec(ctx, sel, v) +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "clusterName": +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___clusters___v1__NodeSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1NodeSpecIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisClustersV1NodeSpecIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__NodeSpecIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec._NodePoolSpec_clusterName(ctx, field, obj) +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___common____types__CloudProvider2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCommonTypesCloudProvider(ctx context.Context, v interface{}) (model.GithubComKloudliteOperatorApisCommonTypesCloudProvider, error) { + var res model.GithubComKloudliteOperatorApisCommonTypesCloudProvider + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "edgeName": +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___common____types__CloudProvider2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCommonTypesCloudProvider(ctx context.Context, sel ast.SelectionSet, v model.GithubComKloudliteOperatorApisCommonTypesCloudProvider) graphql.Marshaler { + return v +} - out.Values[i] = ec._NodePoolSpec_edgeName(ctx, field, obj) +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___common____types__MinMaxFloat2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCommonTypesMinMaxFloat(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCommonTypesMinMaxFloat) 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._Github__com___kloudlite___operator___apis___common____types__MinMaxFloat(ctx, sel, v) +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "min": +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___common____types__MinMaxFloatIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCommonTypesMinMaxFloatIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCommonTypesMinMaxFloatIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___common____types__MinMaxFloatIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec._NodePoolSpec_min(ctx, field, obj) +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___common____types__SecretKeyRef2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCommonTypesSecretKeyRef(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCommonTypesSecretKeyRef) 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._Github__com___kloudlite___operator___apis___common____types__SecretKeyRef(ctx, sel, v) +} - case "provider": +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___common____types__SecretRef2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCommonTypesSecretRef(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCommonTypesSecretRef) 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._Github__com___kloudlite___operator___apis___common____types__SecretRef(ctx, sel, v) +} - out.Values[i] = ec._NodePoolSpec_provider(ctx, field, obj) +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___common____types__SecretRefIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCommonTypesSecretRefIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCommonTypesSecretRefIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___common____types__SecretRefIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ManagedServiceSpec(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpec) 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") } - } - out.Dispatch() - if invalids > 0 { return graphql.Null } - return out + return ec._Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec(ctx, sel, v) } -var overridesImplementors = []string{"Overrides"} - -func (ec *executionContext) _Overrides(ctx context.Context, sel ast.SelectionSet, obj *v11.JsonPatch) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, overridesImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Overrides") - case "applied": +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ManagedServiceSpecIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpecIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec._Overrides_applied(ctx, field, obj) +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__ServiceTemplate2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ServiceTemplate(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1ServiceTemplate) 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._Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate(ctx, sel, v) +} - case "patches": +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ServiceTemplateIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1ServiceTemplateIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec._Overrides_patches(ctx, field, obj) +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___pkg___operator__ResourceRef2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐResourceRef(ctx context.Context, sel ast.SelectionSet, v operator.ResourceRef) graphql.Marshaler { + return ec._Github__com___kloudlite___operator___pkg___operator__ResourceRef(ctx, sel, &v) +} - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___pkg___operator__ResourceRef2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐResourceRef(ctx context.Context, sel ast.SelectionSet, v *operator.ResourceRef) 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 } - out.Dispatch() - if invalids > 0 { + return ec._Github__com___kloudlite___operator___pkg___operator__ResourceRef(ctx, sel, v) +} + +func (ec *executionContext) marshalNHelmRelease2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐHelmRelease(ctx context.Context, sel ast.SelectionSet, v *entities.HelmRelease) 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 out + return ec._HelmRelease(ctx, sel, v) } -var patchImplementors = []string{"Patch"} +func (ec *executionContext) marshalNHelmReleaseEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐHelmReleaseEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.HelmReleaseEdge) 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.marshalNHelmReleaseEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐHelmReleaseEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } -func (ec *executionContext) _Patch(ctx context.Context, sel ast.SelectionSet, obj *json_patch.PatchOperation) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, patchImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Patch") - case "op": + } + wg.Wait() - out.Values[i] = ec._Patch_op(ctx, field, obj) + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "path": + return ret +} - out.Values[i] = ec._Patch_path(ctx, field, obj) +func (ec *executionContext) marshalNHelmReleaseEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐHelmReleaseEdge(ctx context.Context, sel ast.SelectionSet, v *model.HelmReleaseEdge) 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._HelmReleaseEdge(ctx, sel, v) +} - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "value": - field := field +func (ec *executionContext) unmarshalNHelmReleaseIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐHelmRelease(ctx context.Context, v interface{}) (entities.HelmRelease, error) { + res, err := ec.unmarshalInputHelmReleaseIn(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Patch_value(ctx, field, obj) - return res - } +func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v interface{}) (int, error) { + res, err := graphql.UnmarshalInt(v) + return res, graphql.ErrorOnPath(ctx, err) +} - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) +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 +} - }) - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) unmarshalNInt2int64(ctx context.Context, v interface{}) (int64, error) { + res, err := graphql.UnmarshalInt64(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNInt2int64(ctx context.Context, sel ast.SelectionSet, v int64) graphql.Marshaler { + res := graphql.MarshalInt64(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") } } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out + return res } -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", - }) +func (ec *executionContext) unmarshalNK8s__io___api___core___v1__ConditionStatus2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ConditionStatus(ctx context.Context, v interface{}) (model.K8sIoAPICoreV1ConditionStatus, error) { + var res model.K8sIoAPICoreV1ConditionStatus + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ - Object: field.Name, - Field: field, - }) +func (ec *executionContext) marshalNK8s__io___api___core___v1__ConditionStatus2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ConditionStatus(ctx context.Context, sel ast.SelectionSet, v model.K8sIoAPICoreV1ConditionStatus) graphql.Marshaler { + return v +} - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Query") - case "infra_checkNameAvailability": - field := field +func (ec *executionContext) marshalNK8s__io___api___core___v1__NamespaceCondition2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NamespaceCondition(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1NamespaceCondition) 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._K8s__io___api___core___v1__NamespaceCondition(ctx, sel, v) +} - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_infra_checkNameAvailability(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } +func (ec *executionContext) unmarshalNK8s__io___api___core___v1__NamespaceConditionIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NamespaceConditionIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1NamespaceConditionIn, error) { + res, err := ec.unmarshalInputK8s__io___api___core___v1__NamespaceConditionIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } +func (ec *executionContext) unmarshalNK8s__io___api___core___v1__NamespaceConditionType2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NamespaceConditionType(ctx context.Context, v interface{}) (model.K8sIoAPICoreV1NamespaceConditionType, error) { + var res model.K8sIoAPICoreV1NamespaceConditionType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "infra_listBYOCClusters": - field := field +func (ec *executionContext) marshalNK8s__io___api___core___v1__NamespaceConditionType2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NamespaceConditionType(ctx context.Context, sel ast.SelectionSet, v model.K8sIoAPICoreV1NamespaceConditionType) graphql.Marshaler { + return v +} - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_infra_listBYOCClusters(ctx, field) - return res - } +func (ec *executionContext) unmarshalNK8s__io___api___core___v1__NodeSelectorOperator2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelectorOperator(ctx context.Context, v interface{}) (model.K8sIoAPICoreV1NodeSelectorOperator, error) { + var res model.K8sIoAPICoreV1NodeSelectorOperator + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } +func (ec *executionContext) marshalNK8s__io___api___core___v1__NodeSelectorOperator2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelectorOperator(ctx context.Context, sel ast.SelectionSet, v model.K8sIoAPICoreV1NodeSelectorOperator) graphql.Marshaler { + return v +} - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "infra_getBYOCCluster": - field := field +func (ec *executionContext) marshalNK8s__io___api___core___v1__NodeSelectorRequirement2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelectorRequirement(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1NodeSelectorRequirement) 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._K8s__io___api___core___v1__NodeSelectorRequirement(ctx, sel, v) +} - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_infra_getBYOCCluster(ctx, field) - return res - } +func (ec *executionContext) unmarshalNK8s__io___api___core___v1__NodeSelectorRequirementIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelectorRequirementIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1NodeSelectorRequirementIn, error) { + res, err := ec.unmarshalInputK8s__io___api___core___v1__NodeSelectorRequirementIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) +func (ec *executionContext) marshalNK8s__io___api___core___v1__NodeSelectorTerm2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelectorTermᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.K8sIoAPICoreV1NodeSelectorTerm) 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.marshalNK8s__io___api___core___v1__NodeSelectorTerm2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelectorTerm(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "infra_listClusters": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_infra_listClusters(ctx, field) - return res - } + } + wg.Wait() - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "infra_getCluster": - field := field + return ret +} - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_infra_getCluster(ctx, field) - return res - } +func (ec *executionContext) marshalNK8s__io___api___core___v1__NodeSelectorTerm2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelectorTerm(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1NodeSelectorTerm) 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._K8s__io___api___core___v1__NodeSelectorTerm(ctx, sel, v) +} - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } +func (ec *executionContext) unmarshalNK8s__io___api___core___v1__NodeSelectorTermIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelectorTermInᚄ(ctx context.Context, v interface{}) ([]*model.K8sIoAPICoreV1NodeSelectorTermIn, error) { + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.K8sIoAPICoreV1NodeSelectorTermIn, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNK8s__io___api___core___v1__NodeSelectorTermIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelectorTermIn(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "infra_listCloudProviders": - field := field +func (ec *executionContext) unmarshalNK8s__io___api___core___v1__NodeSelectorTermIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelectorTermIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1NodeSelectorTermIn, error) { + res, err := ec.unmarshalInputK8s__io___api___core___v1__NodeSelectorTermIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_infra_listCloudProviders(ctx, field) - return res - } +func (ec *executionContext) marshalNK8s__io___api___core___v1__PersistentVolumeClaimCondition2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeClaimCondition(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1PersistentVolumeClaimCondition) 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._K8s__io___api___core___v1__PersistentVolumeClaimCondition(ctx, sel, v) +} - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } +func (ec *executionContext) unmarshalNK8s__io___api___core___v1__PersistentVolumeClaimConditionIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeClaimConditionIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1PersistentVolumeClaimConditionIn, error) { + res, err := ec.unmarshalInputK8s__io___api___core___v1__PersistentVolumeClaimConditionIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "infra_getCloudProvider": - field := field +func (ec *executionContext) unmarshalNK8s__io___api___core___v1__PersistentVolumeClaimConditionType2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeClaimConditionType(ctx context.Context, v interface{}) (model.K8sIoAPICoreV1PersistentVolumeClaimConditionType, error) { + var res model.K8sIoAPICoreV1PersistentVolumeClaimConditionType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_infra_getCloudProvider(ctx, field) - return res - } +func (ec *executionContext) marshalNK8s__io___api___core___v1__PersistentVolumeClaimConditionType2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeClaimConditionType(ctx context.Context, sel ast.SelectionSet, v model.K8sIoAPICoreV1PersistentVolumeClaimConditionType) graphql.Marshaler { + return v +} - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } +func (ec *executionContext) marshalNK8s__io___api___core___v1__PodAffinityTerm2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PodAffinityTerm(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1PodAffinityTerm) 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._K8s__io___api___core___v1__PodAffinityTerm(ctx, sel, v) +} - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "infra_listEdges": - field := field +func (ec *executionContext) unmarshalNK8s__io___api___core___v1__PodAffinityTermIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PodAffinityTermIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1PodAffinityTermIn, error) { + res, err := ec.unmarshalInputK8s__io___api___core___v1__PodAffinityTermIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_infra_listEdges(ctx, field) - return res - } +func (ec *executionContext) marshalNK8s__io___api___core___v1__PreferredSchedulingTerm2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PreferredSchedulingTerm(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1PreferredSchedulingTerm) 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._K8s__io___api___core___v1__PreferredSchedulingTerm(ctx, sel, v) +} - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } +func (ec *executionContext) unmarshalNK8s__io___api___core___v1__PreferredSchedulingTermIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PreferredSchedulingTermIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1PreferredSchedulingTermIn, error) { + res, err := ec.unmarshalInputK8s__io___api___core___v1__PreferredSchedulingTermIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "infra_getEdge": - field := field +func (ec *executionContext) marshalNK8s__io___api___core___v1__ResourceClaim2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ResourceClaim(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1ResourceClaim) 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._K8s__io___api___core___v1__ResourceClaim(ctx, sel, v) +} - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_infra_getEdge(ctx, field) - return res - } +func (ec *executionContext) unmarshalNK8s__io___api___core___v1__ResourceClaimIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ResourceClaimIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1ResourceClaimIn, error) { + res, err := ec.unmarshalInputK8s__io___api___core___v1__ResourceClaimIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } +func (ec *executionContext) marshalNK8s__io___api___core___v1__Taint2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1Taint(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1Taint) 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._K8s__io___api___core___v1__Taint(ctx, sel, v) +} - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "infra_getMasterNodes": - field := field +func (ec *executionContext) unmarshalNK8s__io___api___core___v1__TaintEffect2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TaintEffect(ctx context.Context, v interface{}) (model.K8sIoAPICoreV1TaintEffect, error) { + var res model.K8sIoAPICoreV1TaintEffect + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_infra_getMasterNodes(ctx, field) - return res - } +func (ec *executionContext) marshalNK8s__io___api___core___v1__TaintEffect2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TaintEffect(ctx context.Context, sel ast.SelectionSet, v model.K8sIoAPICoreV1TaintEffect) graphql.Marshaler { + return v +} - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } +func (ec *executionContext) unmarshalNK8s__io___api___core___v1__TaintIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TaintIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1TaintIn, error) { + res, err := ec.unmarshalInputK8s__io___api___core___v1__TaintIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "infra_getWorkerNodes": - field := field +func (ec *executionContext) marshalNK8s__io___api___core___v1__Toleration2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1Toleration(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1Toleration) 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._K8s__io___api___core___v1__Toleration(ctx, sel, v) +} - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_infra_getWorkerNodes(ctx, field) - return res - } +func (ec *executionContext) unmarshalNK8s__io___api___core___v1__TolerationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TolerationIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1TolerationIn, error) { + res, err := ec.unmarshalInputK8s__io___api___core___v1__TolerationIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } +func (ec *executionContext) marshalNK8s__io___api___core___v1__WeightedPodAffinityTerm2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1WeightedPodAffinityTerm(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1WeightedPodAffinityTerm) 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._K8s__io___api___core___v1__WeightedPodAffinityTerm(ctx, sel, v) +} - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "infra_getNodePools": - field := field +func (ec *executionContext) unmarshalNK8s__io___api___core___v1__WeightedPodAffinityTermIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1WeightedPodAffinityTermIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1WeightedPodAffinityTermIn, error) { + res, err := ec.unmarshalInputK8s__io___api___core___v1__WeightedPodAffinityTermIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_infra_getNodePools(ctx, field) - return res - } +func (ec *executionContext) marshalNK8s__io___api___storage___v1__VolumeAttachmentSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPIStorageV1VolumeAttachmentSource(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPIStorageV1VolumeAttachmentSource) 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._K8s__io___api___storage___v1__VolumeAttachmentSource(ctx, sel, v) +} - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } +func (ec *executionContext) unmarshalNK8s__io___api___storage___v1__VolumeAttachmentSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPIStorageV1VolumeAttachmentSourceIn(ctx context.Context, v interface{}) (*model.K8sIoAPIStorageV1VolumeAttachmentSourceIn, error) { + res, err := ec.unmarshalInputK8s__io___api___storage___v1__VolumeAttachmentSourceIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "_service": - field := field +func (ec *executionContext) marshalNK8s__io___api___storage___v1__VolumeAttachmentSpec2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPIStorageV1VolumeAttachmentSpec(ctx context.Context, sel ast.SelectionSet, v model.K8sIoAPIStorageV1VolumeAttachmentSpec) graphql.Marshaler { + return ec._K8s__io___api___storage___v1__VolumeAttachmentSpec(ctx, sel, &v) +} - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query__service(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } +func (ec *executionContext) marshalNK8s__io___api___storage___v1__VolumeAttachmentSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPIStorageV1VolumeAttachmentSpec(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPIStorageV1VolumeAttachmentSpec) 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._K8s__io___api___storage___v1__VolumeAttachmentSpec(ctx, sel, v) +} - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } +func (ec *executionContext) unmarshalNK8s__io___api___storage___v1__VolumeAttachmentSpecIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPIStorageV1VolumeAttachmentSpecIn(ctx context.Context, v interface{}) (model.K8sIoAPIStorageV1VolumeAttachmentSpecIn, error) { + res, err := ec.unmarshalInputK8s__io___api___storage___v1__VolumeAttachmentSpecIn(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "__type": +func (ec *executionContext) unmarshalNK8s__io___api___storage___v1__VolumeAttachmentSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPIStorageV1VolumeAttachmentSpecIn(ctx context.Context, v interface{}) (*model.K8sIoAPIStorageV1VolumeAttachmentSpecIn, error) { + res, err := ec.unmarshalInputK8s__io___api___storage___v1__VolumeAttachmentSpecIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___type(ctx, field) - }) +func (ec *executionContext) unmarshalNK8s__io___apimachinery___pkg___api___resource__Format2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoApimachineryPkgAPIResourceFormat(ctx context.Context, v interface{}) (model.K8sIoApimachineryPkgAPIResourceFormat, error) { + var res model.K8sIoApimachineryPkgAPIResourceFormat + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} - case "__schema": +func (ec *executionContext) marshalNK8s__io___apimachinery___pkg___api___resource__Format2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoApimachineryPkgAPIResourceFormat(ctx context.Context, sel ast.SelectionSet, v model.K8sIoApimachineryPkgAPIResourceFormat) graphql.Marshaler { + return v +} - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___schema(ctx, field) - }) +func (ec *executionContext) unmarshalNK8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorOperator2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoApimachineryPkgApisMetaV1LabelSelectorOperator(ctx context.Context, v interface{}) (model.K8sIoApimachineryPkgApisMetaV1LabelSelectorOperator, error) { + var res model.K8sIoApimachineryPkgApisMetaV1LabelSelectorOperator + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNK8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorOperator2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoApimachineryPkgApisMetaV1LabelSelectorOperator(ctx context.Context, sel ast.SelectionSet, v model.K8sIoApimachineryPkgApisMetaV1LabelSelectorOperator) graphql.Marshaler { + return v +} + +func (ec *executionContext) marshalNK8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoApimachineryPkgApisMetaV1LabelSelectorRequirement(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoApimachineryPkgApisMetaV1LabelSelectorRequirement) 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") } - } - out.Dispatch() - if invalids > 0 { return graphql.Null } - return out + return ec._K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement(ctx, sel, v) } -var secretImplementors = []string{"Secret"} - -func (ec *executionContext) _Secret(ctx context.Context, sel ast.SelectionSet, obj *entities.Secret) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, secretImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Secret") - case "syncStatus": +func (ec *executionContext) unmarshalNK8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirementIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoApimachineryPkgApisMetaV1LabelSelectorRequirementIn(ctx context.Context, v interface{}) (*model.K8sIoApimachineryPkgApisMetaV1LabelSelectorRequirementIn, error) { + res, err := ec.unmarshalInputK8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirementIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec._Secret_syncStatus(ctx, field, obj) +func (ec *executionContext) unmarshalNMap2map(ctx context.Context, v interface{}) (map[string]interface{}, error) { + res, err := graphql.UnmarshalMap(v) + return res, graphql.ErrorOnPath(ctx, err) +} - case "stringData": - field := field +func (ec *executionContext) marshalNMap2map(ctx context.Context, sel ast.SelectionSet, v map[string]interface{}) 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 + } + res := graphql.MarshalMap(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 +} - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Secret_stringData(ctx, field, obj) - return res - } +func (ec *executionContext) unmarshalNMatchFilterMatchType2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchType(ctx context.Context, v interface{}) (repos.MatchType, error) { + tmp, err := graphql.UnmarshalString(v) + res := repos.MatchType(tmp) + return res, graphql.ErrorOnPath(ctx, err) +} - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) +func (ec *executionContext) marshalNMatchFilterMatchType2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchType(ctx context.Context, sel ast.SelectionSet, v repos.MatchType) graphql.Marshaler { + res := graphql.MarshalString(string(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 +} - }) - case "apiVersion": +func (ec *executionContext) marshalNMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx context.Context, sel ast.SelectionSet, v v1.ObjectMeta) graphql.Marshaler { + return ec._Metadata(ctx, sel, &v) +} - out.Values[i] = ec._Secret_apiVersion(ctx, field, obj) +func (ec *executionContext) unmarshalNMetadataIn2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx context.Context, v interface{}) (v1.ObjectMeta, error) { + res, err := ec.unmarshalInputMetadataIn(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} - case "data": - field := field +func (ec *executionContext) unmarshalNMetadataIn2ᚖk8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx context.Context, v interface{}) (*v1.ObjectMeta, error) { + res, err := ec.unmarshalInputMetadataIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Secret_data(ctx, field, obj) - return res - } +func (ec *executionContext) marshalNMsvcTemplate2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐMsvcTemplate(ctx context.Context, sel ast.SelectionSet, v *entities.MsvcTemplate) 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._MsvcTemplate(ctx, sel, v) +} - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) +func (ec *executionContext) marshalNNamespace2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐNamespace(ctx context.Context, sel ast.SelectionSet, v *entities.Namespace) 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._Namespace(ctx, sel, v) +} - }) - case "enabled": +func (ec *executionContext) marshalNNamespaceEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐNamespaceEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.NamespaceEdge) 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.marshalNNamespaceEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐNamespaceEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - out.Values[i] = ec._Secret_enabled(ctx, field, obj) + } + wg.Wait() - case "kind": + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } - out.Values[i] = ec._Secret_kind(ctx, field, obj) + return ret +} - case "metadata": +func (ec *executionContext) marshalNNamespaceEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐNamespaceEdge(ctx context.Context, sel ast.SelectionSet, v *model.NamespaceEdge) 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._NamespaceEdge(ctx, sel, v) +} - out.Values[i] = ec._Secret_metadata(ctx, field, obj) +func (ec *executionContext) marshalNNode2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐNode(ctx context.Context, sel ast.SelectionSet, v *entities.Node) 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._Node(ctx, sel, v) +} - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) +func (ec *executionContext) marshalNNodeEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐNodeEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.NodeEdge) 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() } - case "overrides": + ret[i] = ec.marshalNNodeEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐNodeEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() - out.Values[i] = ec._Secret_overrides(ctx, field, obj) + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } - case "projectName": + return ret +} - out.Values[i] = ec._Secret_projectName(ctx, field, obj) +func (ec *executionContext) marshalNNodeEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐNodeEdge(ctx context.Context, sel ast.SelectionSet, v *model.NodeEdge) 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._NodeEdge(ctx, sel, v) +} - case "type": - field := field +func (ec *executionContext) marshalNNodePool2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐNodePool(ctx context.Context, sel ast.SelectionSet, v *entities.NodePool) 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._NodePool(ctx, sel, v) +} - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Secret_type(ctx, field, obj) - return res +func (ec *executionContext) marshalNNodePoolEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐNodePoolEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.NodePoolEdge) 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.marshalNNodePoolEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐNodePoolEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + } + wg.Wait() - }) - case "status": + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } - out.Values[i] = ec._Secret_status(ctx, field, obj) + return ret +} - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNNodePoolEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐNodePoolEdge(ctx context.Context, sel ast.SelectionSet, v *model.NodePoolEdge) 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") } - } - out.Dispatch() - if invalids > 0 { return graphql.Null } - return out + return ec._NodePoolEdge(ctx, sel, v) } -var statusImplementors = []string{"Status"} - -func (ec *executionContext) _Status(ctx context.Context, sel ast.SelectionSet, obj *operator.Status) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, statusImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Status") - case "isReady": - - out.Values[i] = ec._Status_isReady(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "checks": - field := field +func (ec *executionContext) unmarshalNNodePoolIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐNodePool(ctx context.Context, v interface{}) (entities.NodePool, error) { + res, err := ec.unmarshalInputNodePoolIn(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Status_checks(ctx, field, obj) - return res - } +func (ec *executionContext) marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx context.Context, sel ast.SelectionSet, v *model.PageInfo) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._PageInfo(ctx, sel, v) +} - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) +func (ec *executionContext) marshalNPersistentVolume2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐPersistentVolume(ctx context.Context, sel ast.SelectionSet, v *entities.PersistentVolume) 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._PersistentVolume(ctx, sel, v) +} - }) - case "displayVars": - field := field +func (ec *executionContext) marshalNPersistentVolumeClaim2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐPersistentVolumeClaim(ctx context.Context, sel ast.SelectionSet, v *entities.PersistentVolumeClaim) 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._PersistentVolumeClaim(ctx, sel, v) +} - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Status_displayVars(ctx, field, obj) - return res +func (ec *executionContext) marshalNPersistentVolumeClaimEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐPersistentVolumeClaimEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.PersistentVolumeClaimEdge) 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.marshalNPersistentVolumeClaimEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐPersistentVolumeClaimEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + } + wg.Wait() - }) - default: - panic("unknown field " + strconv.Quote(field.Name)) + for _, e := range ret { + if e == graphql.Null { + return graphql.Null } } - out.Dispatch() - if invalids > 0 { + + return ret +} + +func (ec *executionContext) marshalNPersistentVolumeClaimEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐPersistentVolumeClaimEdge(ctx context.Context, sel ast.SelectionSet, v *model.PersistentVolumeClaimEdge) 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 out + return ec._PersistentVolumeClaimEdge(ctx, sel, v) } -var syncStatusImplementors = []string{"SyncStatus"} - -func (ec *executionContext) _SyncStatus(ctx context.Context, sel ast.SelectionSet, obj *types.SyncStatus) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, syncStatusImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("SyncStatus") - case "syncScheduledAt": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._SyncStatus_syncScheduledAt(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) +func (ec *executionContext) marshalNPersistentVolumeEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐPersistentVolumeEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.PersistentVolumeEdge) 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 } - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "lastSyncedAt": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._SyncStatus_lastSyncedAt(ctx, field, obj) - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "action": - - out.Values[i] = ec._SyncStatus_action(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "generation": - - out.Values[i] = ec._SyncStatus_generation(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + }() + if !isLen1 { + defer wg.Done() } - case "state": + ret[i] = ec.marshalNPersistentVolumeEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐPersistentVolumeEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - out.Values[i] = ec._SyncStatus_state(ctx, field, obj) + } + wg.Wait() - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "error": + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } - out.Values[i] = ec._SyncStatus_error(ctx, field, obj) + return ret +} - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNPersistentVolumeEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐPersistentVolumeEdge(ctx context.Context, sel ast.SelectionSet, v *model.PersistentVolumeEdge) 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") } - } - out.Dispatch() - if invalids > 0 { return graphql.Null } - return out + return ec._PersistentVolumeEdge(ctx, sel, v) } -var workerNodeImplementors = []string{"WorkerNode"} +func (ec *executionContext) unmarshalNResType2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋdomainᚐResType(ctx context.Context, v interface{}) (domain.ResType, error) { + tmp, err := graphql.UnmarshalString(v) + res := domain.ResType(tmp) + return res, graphql.ErrorOnPath(ctx, err) +} -func (ec *executionContext) _WorkerNode(ctx context.Context, sel ast.SelectionSet, obj *entities.WorkerNode) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, workerNodeImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("WorkerNode") - case "metadata": +func (ec *executionContext) marshalNResType2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋdomainᚐResType(ctx context.Context, sel ast.SelectionSet, v domain.ResType) graphql.Marshaler { + res := graphql.MarshalString(string(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 +} - out.Values[i] = ec._WorkerNode_metadata(ctx, field, obj) +func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "syncStatus": +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 +} - out.Values[i] = ec._WorkerNode_syncStatus(ctx, field, obj) +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 +} - case "spec": - field := field +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]) + } - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._WorkerNode_spec(ctx, field, obj) - return res - } + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + return ret +} - }) - case "status": - field := field +func (ec *executionContext) marshalNVolumeAttachment2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐVolumeAttachment(ctx context.Context, sel ast.SelectionSet, v *entities.VolumeAttachment) 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._VolumeAttachment(ctx, sel, v) +} - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._WorkerNode_status(ctx, field, obj) - return res +func (ec *executionContext) marshalNVolumeAttachmentEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐVolumeAttachmentEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.VolumeAttachmentEdge) 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.marshalNVolumeAttachmentEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐVolumeAttachmentEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "apiVersion": - - out.Values[i] = ec._WorkerNode_apiVersion(ctx, field, obj) + } + wg.Wait() - case "kind": + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } - out.Values[i] = ec._WorkerNode_kind(ctx, field, obj) + return ret +} - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNVolumeAttachmentEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐVolumeAttachmentEdge(ctx context.Context, sel ast.SelectionSet, v *model.VolumeAttachmentEdge) 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") } - } - out.Dispatch() - if invalids > 0 { return graphql.Null } - return out + return ec._VolumeAttachmentEdge(ctx, sel, v) } -var workerNodeSpecImplementors = []string{"WorkerNodeSpec"} +func (ec *executionContext) unmarshalN_FieldSet2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} -func (ec *executionContext) _WorkerNodeSpec(ctx context.Context, sel ast.SelectionSet, obj *model.WorkerNodeSpec) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, workerNodeSpecImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("WorkerNodeSpec") - case "clusterName": +func (ec *executionContext) marshalN_FieldSet2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} - out.Values[i] = ec._WorkerNodeSpec_clusterName(ctx, field, obj) +func (ec *executionContext) marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx context.Context, sel ast.SelectionSet, v fedruntime.Service) graphql.Marshaler { + return ec.__Service(ctx, sel, &v) +} - if out.Values[i] == graphql.Null { - invalids++ +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() } - case "config": + ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - out.Values[i] = ec._WorkerNodeSpec_config(ctx, field, obj) + } + wg.Wait() - if out.Values[i] == graphql.Null { - invalids++ - } - case "nodeIndex": + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } - out.Values[i] = ec._WorkerNodeSpec_nodeIndex(ctx, field, obj) + return ret +} - case "pool": +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 +} - out.Values[i] = ec._WorkerNodeSpec_pool(ctx, field, obj) +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 +} - if out.Values[i] == graphql.Null { - invalids++ +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() } - case "provider": + ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - out.Values[i] = ec._WorkerNodeSpec_provider(ctx, field, obj) + } + wg.Wait() - if out.Values[i] == graphql.Null { - invalids++ - } - case "accountName": + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} - out.Values[i] = ec._WorkerNodeSpec_accountName(ctx, field, obj) +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) +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "edgeName": +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) +} - out.Values[i] = ec._WorkerNodeSpec_edgeName(ctx, field, obj) +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) +} - if out.Values[i] == graphql.Null { - invalids++ +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() } - case "providerName": + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - out.Values[i] = ec._WorkerNodeSpec_providerName(ctx, field, obj) + } + wg.Wait() - if out.Values[i] == graphql.Null { - invalids++ - } - case "region": + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } - out.Values[i] = ec._WorkerNodeSpec_region(ctx, field, obj) + return ret +} - if out.Values[i] == graphql.Null { - invalids++ +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() } - case "stateful": + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - out.Values[i] = ec._WorkerNodeSpec_stateful(ctx, field, obj) + } + wg.Wait() - default: - panic("unknown field " + strconv.Quote(field.Name)) + for _, e := range ret { + if e == graphql.Null { + return graphql.Null } } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var _ServiceImplementors = []string{"_Service"} - -func (ec *executionContext) __Service(ctx context.Context, sel ast.SelectionSet, obj *fedruntime.Service) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, _ServiceImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("_Service") - case "sdl": - out.Values[i] = ec.__Service_sdl(ctx, field, obj) + return ret +} - default: - panic("unknown field " + strconv.Quote(field.Name)) +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") } - } - out.Dispatch() - if invalids > 0 { return graphql.Null } - return out + return ec.___Type(ctx, sel, v) } -var __DirectiveImplementors = []string{"__Directive"} - -func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Directive") - case "name": - - out.Values[i] = ec.___Directive_name(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "description": - - out.Values[i] = ec.___Directive_description(ctx, field, obj) - - case "locations": - - out.Values[i] = ec.___Directive_locations(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "args": - - out.Values[i] = ec.___Directive_args(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "isRepeatable": - - out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) +func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) +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") } } - out.Dispatch() - if invalids > 0 { - return graphql.Null + return res +} + +func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v interface{}) (interface{}, error) { + if v == nil { + return nil, nil } - return out + res, err := graphql.UnmarshalAny(v) + return res, graphql.ErrorOnPath(ctx, err) } -var __EnumValueImplementors = []string{"__EnumValue"} +func (ec *executionContext) marshalOAny2interface(ctx context.Context, sel ast.SelectionSet, v interface{}) graphql.Marshaler { + if v == nil { + return graphql.Null + } + res := graphql.MarshalAny(v) + return res +} -func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__EnumValue") - case "name": +func (ec *executionContext) unmarshalOAny2ᚕinterfaceᚄ(ctx context.Context, v interface{}) ([]any, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]any, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNAny2interface(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} - out.Values[i] = ec.___EnumValue_name(ctx, field, obj) +func (ec *executionContext) marshalOAny2ᚕinterfaceᚄ(ctx context.Context, sel ast.SelectionSet, v []any) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNAny2interface(ctx, sel, v[i]) + } - if out.Values[i] == graphql.Null { - invalids++ - } - case "description": + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } - out.Values[i] = ec.___EnumValue_description(ctx, field, obj) + return ret +} - case "isDeprecated": +func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) +func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + res := graphql.MarshalBoolean(v) + return res +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "deprecationReason": +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) +} - out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) +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 +} - default: - panic("unknown field " + strconv.Quote(field.Name)) - } +func (ec *executionContext) marshalOCloudProviderSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐCloudProviderSecret(ctx context.Context, sel ast.SelectionSet, v *entities.CloudProviderSecret) graphql.Marshaler { + if v == nil { + return graphql.Null } - out.Dispatch() - if invalids > 0 { + return ec._CloudProviderSecret(ctx, sel, v) +} + +func (ec *executionContext) marshalOCloudProviderSecretPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐCloudProviderSecretPaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.CloudProviderSecretPaginatedRecords) graphql.Marshaler { + if v == nil { return graphql.Null } - return out + return ec._CloudProviderSecretPaginatedRecords(ctx, sel, v) } -var __FieldImplementors = []string{"__Field"} +func (ec *executionContext) marshalOCluster2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐCluster(ctx context.Context, sel ast.SelectionSet, v *entities.Cluster) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Cluster(ctx, sel, v) +} -func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Field") - case "name": +func (ec *executionContext) marshalOClusterManagedService2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐClusterManagedService(ctx context.Context, sel ast.SelectionSet, v *entities.ClusterManagedService) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._ClusterManagedService(ctx, sel, v) +} - out.Values[i] = ec.___Field_name(ctx, field, obj) +func (ec *executionContext) marshalOClusterManagedServicePaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐClusterManagedServicePaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.ClusterManagedServicePaginatedRecords) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._ClusterManagedServicePaginatedRecords(ctx, sel, v) +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "description": +func (ec *executionContext) marshalOClusterPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐClusterPaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.ClusterPaginatedRecords) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._ClusterPaginatedRecords(ctx, sel, v) +} - out.Values[i] = ec.___Field_description(ctx, field, obj) +func (ec *executionContext) unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx context.Context, v interface{}) (*repos.CursorPagination, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputCursorPaginationIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - case "args": +func (ec *executionContext) unmarshalOCursorPaginationSortDirection2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐSortDirection(ctx context.Context, v interface{}) (repos.SortDirection, error) { + tmp, err := graphql.UnmarshalString(v) + res := repos.SortDirection(tmp) + return res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___Field_args(ctx, field, obj) +func (ec *executionContext) marshalOCursorPaginationSortDirection2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐSortDirection(ctx context.Context, sel ast.SelectionSet, v repos.SortDirection) graphql.Marshaler { + res := graphql.MarshalString(string(v)) + return res +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "type": +func (ec *executionContext) unmarshalODate2ᚖ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) +} - out.Values[i] = ec.___Field_type(ctx, field, obj) +func (ec *executionContext) marshalODate2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + res := graphql.MarshalString(*v) + return res +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "isDeprecated": +func (ec *executionContext) marshalODomainEntry2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐDomainEntry(ctx context.Context, sel ast.SelectionSet, v *entities.DomainEntry) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._DomainEntry(ctx, sel, v) +} - out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) +func (ec *executionContext) marshalODomainEntryPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐDomainEntryPaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.DomainEntryPaginatedRecords) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._DomainEntryPaginatedRecords(ctx, sel, v) +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "deprecationReason": +func (ec *executionContext) marshalOEncodedValue2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐEncodedValue(ctx context.Context, sel ast.SelectionSet, v *model.EncodedValue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._EncodedValue(ctx, sel, v) +} - out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) +func (ec *executionContext) unmarshalOFloat2ᚖfloat64(ctx context.Context, v interface{}) (*float64, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalFloatContext(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - default: - panic("unknown field " + strconv.Quote(field.Name)) - } +func (ec *executionContext) marshalOFloat2ᚖfloat64(ctx context.Context, sel ast.SelectionSet, v *float64) graphql.Marshaler { + if v == nil { + return graphql.Null } - out.Dispatch() - if invalids > 0 { + res := graphql.MarshalFloatContext(*v) + return graphql.WrapContextMarshaler(ctx, res) +} + +func (ec *executionContext) marshalOGithub__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsInfraInternalEntitiesAWSSecretCredentials(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteAPIAppsInfraInternalEntitiesAWSSecretCredentials) graphql.Marshaler { + if v == nil { return graphql.Null } - return out + return ec._Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials(ctx, sel, v) } -var __InputValueImplementors = []string{"__InputValue"} +func (ec *executionContext) unmarshalOGithub__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentialsIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsInfraInternalEntitiesAWSSecretCredentialsIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteAPIAppsInfraInternalEntitiesAWSSecretCredentialsIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputGithub__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentialsIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} -func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__InputValue") - case "name": +func (ec *executionContext) marshalOGithub__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐMsvcTemplateEntry(ctx context.Context, sel ast.SelectionSet, v *entities.MsvcTemplateEntry) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry(ctx, sel, v) +} - out.Values[i] = ec.___InputValue_name(ctx, field, obj) +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AWSClusterConfig(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisClustersV1AWSClusterConfig) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig(ctx, sel, v) +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "description": +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfigIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AWSClusterConfigIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisClustersV1AWSClusterConfigIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfigIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___InputValue_description(ctx, field, obj) +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AWSK3sMastersConfig(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisClustersV1AWSK3sMastersConfig) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig(ctx, sel, v) +} - case "type": +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfigIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AWSK3sMastersConfigIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisClustersV1AWSK3sMastersConfigIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfigIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___InputValue_type(ctx, field, obj) +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AWSNodePoolConfig(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisClustersV1AWSNodePoolConfig) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig(ctx, sel, v) +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "defaultValue": +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfigIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AWSNodePoolConfigIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisClustersV1AWSNodePoolConfigIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfigIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AwsEC2PoolConfig(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisClustersV1AwsEC2PoolConfig) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig(ctx, sel, v) +} - default: - panic("unknown field " + strconv.Quote(field.Name)) - } +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfigIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AwsEC2PoolConfigIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisClustersV1AwsEC2PoolConfigIn, error) { + if v == nil { + return nil, nil } - out.Dispatch() - if invalids > 0 { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfigIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AwsSpotCPUNode(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisClustersV1AwsSpotCPUNode) graphql.Marshaler { + if v == nil { return graphql.Null } - return out + return ec._Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode(ctx, sel, v) } -var __SchemaImplementors = []string{"__Schema"} +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNodeIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AwsSpotCPUNodeIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisClustersV1AwsSpotCPUNodeIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNodeIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} -func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Schema") - case "description": +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNode2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AwsSpotGpuNode(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisClustersV1AwsSpotGpuNode) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNode(ctx, sel, v) +} - out.Values[i] = ec.___Schema_description(ctx, field, obj) +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNodeIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AwsSpotGpuNodeIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisClustersV1AwsSpotGpuNodeIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNodeIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - case "types": +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AwsSpotPoolConfig(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisClustersV1AwsSpotPoolConfig) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig(ctx, sel, v) +} - out.Values[i] = ec.___Schema_types(ctx, field, obj) +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfigIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1AwsSpotPoolConfigIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisClustersV1AwsSpotPoolConfigIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfigIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "queryType": +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1CloudProviderCredentialKeys(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisClustersV1CloudProviderCredentialKeys) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys(ctx, sel, v) +} - out.Values[i] = ec.___Schema_queryType(ctx, field, obj) +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___clusters___v1__ClusterOutput2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1ClusterOutput(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisClustersV1ClusterOutput) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput(ctx, sel, v) +} - if out.Values[i] == graphql.Null { - invalids++ - } - case "mutationType": +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___common____types__MinMaxFloat2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCommonTypesMinMaxFloat(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCommonTypesMinMaxFloat) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Github__com___kloudlite___operator___apis___common____types__MinMaxFloat(ctx, sel, v) +} - out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___common____types__MinMaxFloatIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCommonTypesMinMaxFloatIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCommonTypesMinMaxFloatIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___common____types__MinMaxFloatIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - case "subscriptionType": +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___common____types__SecretKeyRef2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCommonTypesSecretKeyRef(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCommonTypesSecretKeyRef) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Github__com___kloudlite___operator___apis___common____types__SecretKeyRef(ctx, sel, v) +} - out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ClusterManagedServiceSpec(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1ClusterManagedServiceSpec) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec(ctx, sel, v) +} - case "directives": +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ClusterManagedServiceSpecIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1ClusterManagedServiceSpecIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpecIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___Schema_directives(ctx, field, obj) +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__HelmChartSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1HelmChartSpec(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1HelmChartSpec) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec(ctx, sel, v) +} - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__HelmChartSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1HelmChartSpecIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1HelmChartSpecIn, error) { + if v == nil { + return nil, nil } - out.Dispatch() - if invalids > 0 { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__HelmChartSpecIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__HelmChartStatus2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1HelmChartStatus(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1HelmChartStatus) graphql.Marshaler { + if v == nil { return graphql.Null } - return out + return ec._Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus(ctx, sel, v) } -var __TypeImplementors = []string{"__Type"} - -func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Type") - case "kind": +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__JobVars2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1JobVars(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1JobVars) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Github__com___kloudlite___operator___apis___crds___v1__JobVars(ctx, sel, v) +} - out.Values[i] = ec.___Type_kind(ctx, field, obj) +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__JobVarsIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1JobVarsIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1JobVarsIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__JobVarsIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - if out.Values[i] == graphql.Null { - invalids++ +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___pkg___operator__ResourceRef2ᚕgithubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐResourceRefᚄ(ctx context.Context, sel ast.SelectionSet, v []operator.ResourceRef) 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() } - 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) + ret[i] = ec.marshalNGithub__com___kloudlite___operator___pkg___operator__ResourceRef2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐResourceRef(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - case "enumValues": + } + wg.Wait() - out.Values[i] = ec.___Type_enumValues(ctx, field, obj) + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } - case "inputFields": + return ret +} - out.Values[i] = ec.___Type_inputFields(ctx, field, obj) +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___pkg___operator__ResourceRef2ᚕᚖgithubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐResourceRefᚄ(ctx context.Context, sel ast.SelectionSet, v []*operator.ResourceRef) 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.marshalNGithub__com___kloudlite___operator___pkg___operator__ResourceRef2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐResourceRef(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - case "ofType": + } + wg.Wait() - out.Values[i] = ec.___Type_ofType(ctx, field, obj) + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } - case "specifiedByURL": + return ret +} - out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___pkg___operator__Status2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx context.Context, sel ast.SelectionSet, v operator.Status) graphql.Marshaler { + return ec._Github__com___kloudlite___operator___pkg___operator__Status(ctx, sel, &v) +} - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___pkg___raw____json__RawJson2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgRawJSONRawJSON(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorPkgRawJSONRawJSON) graphql.Marshaler { + if v == nil { return graphql.Null } - return out + return ec._Github__com___kloudlite___operator___pkg___raw____json__RawJson(ctx, sel, v) } -// endregion **************************** object.gotpl **************************** - -// region ***************************** type.gotpl ***************************** - -func (ec *executionContext) marshalNBYOCCluster2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐBYOCCluster(ctx context.Context, sel ast.SelectionSet, v *entities.BYOCCluster) graphql.Marshaler { +func (ec *executionContext) marshalOHelmRelease2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐHelmRelease(ctx context.Context, sel ast.SelectionSet, v *entities.HelmRelease) 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._BYOCCluster(ctx, sel, v) + return ec._HelmRelease(ctx, sel, v) } -func (ec *executionContext) unmarshalNBYOCClusterIn2kloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐBYOCCluster(ctx context.Context, v interface{}) (entities.BYOCCluster, error) { - res, err := ec.unmarshalInputBYOCClusterIn(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) +func (ec *executionContext) marshalOHelmReleasePaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐHelmReleasePaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.HelmReleasePaginatedRecords) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._HelmReleasePaginatedRecords(ctx, sel, v) } -func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { - res, err := graphql.UnmarshalBoolean(v) +func (ec *executionContext) unmarshalOInt2int64(ctx context.Context, v interface{}) (int64, error) { + res, err := graphql.UnmarshalInt64(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") - } - } +func (ec *executionContext) marshalOInt2int64(ctx context.Context, sel ast.SelectionSet, v int64) graphql.Marshaler { + res := graphql.MarshalInt64(v) return res } -func (ec *executionContext) marshalNCheckNameAvailabilityOutput2kloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚐCheckNameAvailabilityOutput(ctx context.Context, sel ast.SelectionSet, v domain.CheckNameAvailabilityOutput) graphql.Marshaler { - return ec._CheckNameAvailabilityOutput(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) marshalNCheckNameAvailabilityOutput2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚐCheckNameAvailabilityOutput(ctx context.Context, sel ast.SelectionSet, v *domain.CheckNameAvailabilityOutput) graphql.Marshaler { +func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.SelectionSet, v *int) 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._CheckNameAvailabilityOutput(ctx, sel, v) + res := graphql.MarshalInt(*v) + return res } -func (ec *executionContext) marshalNCloudProvider2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐCloudProvider(ctx context.Context, sel ast.SelectionSet, v *entities.CloudProvider) graphql.Marshaler { +func (ec *executionContext) unmarshalOInt2ᚖint64(ctx context.Context, v interface{}) (*int64, error) { 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 nil, nil } - return ec._CloudProvider(ctx, sel, v) + res, err := graphql.UnmarshalInt64(v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalNCloudProviderIn2kloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐCloudProvider(ctx context.Context, v interface{}) (entities.CloudProvider, error) { - res, err := ec.unmarshalInputCloudProviderIn(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) +func (ec *executionContext) marshalOInt2ᚖint64(ctx context.Context, sel ast.SelectionSet, v *int64) graphql.Marshaler { + if v == nil { + return graphql.Null + } + res := graphql.MarshalInt64(*v) + return res } -func (ec *executionContext) marshalNCloudProviderSpecProviderSecret2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐCloudProviderSpecProviderSecret(ctx context.Context, sel ast.SelectionSet, v *model.CloudProviderSpecProviderSecret) graphql.Marshaler { +func (ec *executionContext) marshalOK8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1AWSElasticBlockStoreVolumeSource(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1AWSElasticBlockStoreVolumeSource) 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._CloudProviderSpecProviderSecret(ctx, sel, v) + return ec._K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource(ctx, sel, v) } -func (ec *executionContext) unmarshalNCloudProviderSpecProviderSecretIn2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐCloudProviderSpecProviderSecretIn(ctx context.Context, v interface{}) (*model.CloudProviderSpecProviderSecretIn, error) { - res, err := ec.unmarshalInputCloudProviderSpecProviderSecretIn(ctx, v) +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__AWSElasticBlockStoreVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1AWSElasticBlockStoreVolumeSourceIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1AWSElasticBlockStoreVolumeSourceIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputK8s__io___api___core___v1__AWSElasticBlockStoreVolumeSourceIn(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNCluster2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐCluster(ctx context.Context, sel ast.SelectionSet, v *entities.Cluster) graphql.Marshaler { +func (ec *executionContext) marshalOK8s__io___api___core___v1__Affinity2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1Affinity(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1Affinity) 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._Cluster(ctx, sel, v) -} - -func (ec *executionContext) unmarshalNClusterIn2kloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐCluster(ctx context.Context, v interface{}) (entities.Cluster, error) { - res, err := ec.unmarshalInputClusterIn(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) unmarshalNDate2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(v) - return res, graphql.ErrorOnPath(ctx, err) + return ec._K8s__io___api___core___v1__Affinity(ctx, sel, v) } -func (ec *executionContext) marshalNDate2string(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") - } +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__AffinityIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1AffinityIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1AffinityIn, error) { + if v == nil { + return nil, nil } - return res + res, err := ec.unmarshalInputK8s__io___api___core___v1__AffinityIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNEdge2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐEdge(ctx context.Context, sel ast.SelectionSet, v *entities.Edge) graphql.Marshaler { +func (ec *executionContext) marshalOK8s__io___api___core___v1__AzureDiskVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1AzureDiskVolumeSource(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1AzureDiskVolumeSource) 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._Edge(ctx, sel, v) + return ec._K8s__io___api___core___v1__AzureDiskVolumeSource(ctx, sel, v) } -func (ec *executionContext) unmarshalNEdgeIn2kloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐEdge(ctx context.Context, v interface{}) (entities.Edge, error) { - res, err := ec.unmarshalInputEdgeIn(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__AzureDiskVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1AzureDiskVolumeSourceIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1AzureDiskVolumeSourceIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputK8s__io___api___core___v1__AzureDiskVolumeSourceIn(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) marshalOK8s__io___api___core___v1__AzureFilePersistentVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1AzureFilePersistentVolumeSource(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1AzureFilePersistentVolumeSource) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._K8s__io___api___core___v1__AzureFilePersistentVolumeSource(ctx, sel, v) } -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") - } +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__AzureFilePersistentVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1AzureFilePersistentVolumeSourceIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1AzureFilePersistentVolumeSourceIn, error) { + if v == nil { + return nil, nil } - return res + res, err := ec.unmarshalInputK8s__io___api___core___v1__AzureFilePersistentVolumeSourceIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalNInt2int64(ctx context.Context, v interface{}) (int64, error) { - res, err := graphql.UnmarshalInt64(v) - return res, graphql.ErrorOnPath(ctx, err) +func (ec *executionContext) marshalOK8s__io___api___core___v1__CSIPersistentVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1CSIPersistentVolumeSource(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1CSIPersistentVolumeSource) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._K8s__io___api___core___v1__CSIPersistentVolumeSource(ctx, sel, v) } -func (ec *executionContext) marshalNInt2int64(ctx context.Context, sel ast.SelectionSet, v int64) graphql.Marshaler { - res := graphql.MarshalInt64(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") - } +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__CSIPersistentVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1CSIPersistentVolumeSourceIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1CSIPersistentVolumeSourceIn, error) { + if v == nil { + return nil, nil } - return res + res, err := ec.unmarshalInputK8s__io___api___core___v1__CSIPersistentVolumeSourceIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNMasterNode2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐMasterNode(ctx context.Context, sel ast.SelectionSet, v *entities.MasterNode) graphql.Marshaler { +func (ec *executionContext) marshalOK8s__io___api___core___v1__CephFSPersistentVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1CephFSPersistentVolumeSource(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1CephFSPersistentVolumeSource) 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._MasterNode(ctx, sel, v) -} - -func (ec *executionContext) marshalNMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx context.Context, sel ast.SelectionSet, v v1.ObjectMeta) graphql.Marshaler { - return ec._Metadata(ctx, sel, &v) + return ec._K8s__io___api___core___v1__CephFSPersistentVolumeSource(ctx, sel, v) } -func (ec *executionContext) unmarshalNMetadataIn2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx context.Context, v interface{}) (v1.ObjectMeta, error) { - res, err := ec.unmarshalInputMetadataIn(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__CephFSPersistentVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1CephFSPersistentVolumeSourceIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1CephFSPersistentVolumeSourceIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputK8s__io___api___core___v1__CephFSPersistentVolumeSourceIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNNodePool2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐNodePool(ctx context.Context, sel ast.SelectionSet, v *entities.NodePool) graphql.Marshaler { +func (ec *executionContext) marshalOK8s__io___api___core___v1__CinderPersistentVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1CinderPersistentVolumeSource(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1CinderPersistentVolumeSource) 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._NodePool(ctx, sel, v) -} - -func (ec *executionContext) marshalNPatch2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋjsonᚑpatchᚐPatchOperation(ctx context.Context, sel ast.SelectionSet, v json_patch.PatchOperation) graphql.Marshaler { - return ec._Patch(ctx, sel, &v) + return ec._K8s__io___api___core___v1__CinderPersistentVolumeSource(ctx, sel, v) } -func (ec *executionContext) unmarshalNPatchIn2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋjsonᚑpatchᚐPatchOperation(ctx context.Context, v interface{}) (json_patch.PatchOperation, error) { - res, err := ec.unmarshalInputPatchIn(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__CinderPersistentVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1CinderPersistentVolumeSourceIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1CinderPersistentVolumeSourceIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputK8s__io___api___core___v1__CinderPersistentVolumeSourceIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalNResType2kloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚐResType(ctx context.Context, v interface{}) (domain.ResType, error) { - tmp, err := graphql.UnmarshalString(v) - res := domain.ResType(tmp) - return res, graphql.ErrorOnPath(ctx, err) +func (ec *executionContext) marshalOK8s__io___api___core___v1__FCVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1FCVolumeSource(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1FCVolumeSource) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._K8s__io___api___core___v1__FCVolumeSource(ctx, sel, v) } -func (ec *executionContext) marshalNResType2kloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚐResType(ctx context.Context, sel ast.SelectionSet, v domain.ResType) graphql.Marshaler { - res := graphql.MarshalString(string(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") - } +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__FCVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1FCVolumeSourceIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1FCVolumeSourceIn, error) { + if v == nil { + return nil, nil } - return res + res, err := ec.unmarshalInputK8s__io___api___core___v1__FCVolumeSourceIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalNSecretIn2kloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐSecret(ctx context.Context, v interface{}) (entities.Secret, error) { - res, err := ec.unmarshalInputSecretIn(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) +func (ec *executionContext) marshalOK8s__io___api___core___v1__FlexPersistentVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1FlexPersistentVolumeSource(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1FlexPersistentVolumeSource) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._K8s__io___api___core___v1__FlexPersistentVolumeSource(ctx, sel, 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) unmarshalOK8s__io___api___core___v1__FlexPersistentVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1FlexPersistentVolumeSourceIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1FlexPersistentVolumeSourceIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputK8s__io___api___core___v1__FlexPersistentVolumeSourceIn(ctx, 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") - } +func (ec *executionContext) marshalOK8s__io___api___core___v1__FlockerVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1FlockerVolumeSource(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1FlockerVolumeSource) graphql.Marshaler { + if v == nil { + return graphql.Null } - return res + return ec._K8s__io___api___core___v1__FlockerVolumeSource(ctx, sel, v) } -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 - } +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__FlockerVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1FlockerVolumeSourceIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1FlockerVolumeSourceIn, error) { + if v == nil { + return nil, nil } - return res, nil + res, err := ec.unmarshalInputK8s__io___api___core___v1__FlockerVolumeSourceIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -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]) +func (ec *executionContext) marshalOK8s__io___api___core___v1__GCEPersistentDiskVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1GCEPersistentDiskVolumeSource(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1GCEPersistentDiskVolumeSource) graphql.Marshaler { + if v == nil { + return graphql.Null } + return ec._K8s__io___api___core___v1__GCEPersistentDiskVolumeSource(ctx, sel, v) +} - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__GCEPersistentDiskVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1GCEPersistentDiskVolumeSourceIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1GCEPersistentDiskVolumeSourceIn, error) { + if v == nil { + return nil, nil } - - return ret + res, err := ec.unmarshalInputK8s__io___api___core___v1__GCEPersistentDiskVolumeSourceIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalNSyncAction2kloudliteᚗioᚋpkgᚋtypesᚐSyncAction(ctx context.Context, v interface{}) (types.SyncAction, error) { - tmp, err := graphql.UnmarshalString(v) - res := types.SyncAction(tmp) - return res, graphql.ErrorOnPath(ctx, err) +func (ec *executionContext) marshalOK8s__io___api___core___v1__GlusterfsPersistentVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1GlusterfsPersistentVolumeSource(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1GlusterfsPersistentVolumeSource) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._K8s__io___api___core___v1__GlusterfsPersistentVolumeSource(ctx, sel, v) } -func (ec *executionContext) marshalNSyncAction2kloudliteᚗioᚋpkgᚋtypesᚐSyncAction(ctx context.Context, sel ast.SelectionSet, v types.SyncAction) graphql.Marshaler { - res := graphql.MarshalString(string(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") - } +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__GlusterfsPersistentVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1GlusterfsPersistentVolumeSourceIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1GlusterfsPersistentVolumeSourceIn, error) { + if v == nil { + return nil, nil } - return res + res, err := ec.unmarshalInputK8s__io___api___core___v1__GlusterfsPersistentVolumeSourceIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalNSyncState2kloudliteᚗioᚋpkgᚋtypesᚐSyncState(ctx context.Context, v interface{}) (types.SyncState, error) { - tmp, err := graphql.UnmarshalString(v) - res := types.SyncState(tmp) - return res, graphql.ErrorOnPath(ctx, err) +func (ec *executionContext) marshalOK8s__io___api___core___v1__HostPathVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1HostPathVolumeSource(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1HostPathVolumeSource) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._K8s__io___api___core___v1__HostPathVolumeSource(ctx, sel, v) } -func (ec *executionContext) marshalNSyncState2kloudliteᚗioᚋpkgᚋtypesᚐSyncState(ctx context.Context, sel ast.SelectionSet, v types.SyncState) graphql.Marshaler { - res := graphql.MarshalString(string(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") - } +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__HostPathVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1HostPathVolumeSourceIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1HostPathVolumeSourceIn, error) { + if v == nil { + return nil, nil } - return res + res, err := ec.unmarshalInputK8s__io___api___core___v1__HostPathVolumeSourceIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNWorkerNode2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐWorkerNode(ctx context.Context, sel ast.SelectionSet, v *entities.WorkerNode) graphql.Marshaler { +func (ec *executionContext) marshalOK8s__io___api___core___v1__ISCSIPersistentVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ISCSIPersistentVolumeSource(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1ISCSIPersistentVolumeSource) 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._WorkerNode(ctx, sel, v) + return ec._K8s__io___api___core___v1__ISCSIPersistentVolumeSource(ctx, sel, v) } -func (ec *executionContext) unmarshalN_FieldSet2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(v) - return res, graphql.ErrorOnPath(ctx, err) +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__ISCSIPersistentVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ISCSIPersistentVolumeSourceIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1ISCSIPersistentVolumeSourceIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputK8s__io___api___core___v1__ISCSIPersistentVolumeSourceIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalN_FieldSet2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - res := graphql.MarshalString(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } +func (ec *executionContext) marshalOK8s__io___api___core___v1__LocalVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1LocalVolumeSource(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1LocalVolumeSource) graphql.Marshaler { + if v == nil { + return graphql.Null } - return res + return ec._K8s__io___api___core___v1__LocalVolumeSource(ctx, sel, v) } -func (ec *executionContext) marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx context.Context, sel ast.SelectionSet, v fedruntime.Service) graphql.Marshaler { - return ec.__Service(ctx, sel, &v) +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__LocalVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1LocalVolumeSourceIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1LocalVolumeSourceIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputK8s__io___api___core___v1__LocalVolumeSourceIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { - return ec.___Directive(ctx, sel, &v) +func (ec *executionContext) marshalOK8s__io___api___core___v1__NFSVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NFSVolumeSource(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1NFSVolumeSource) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._K8s__io___api___core___v1__NFSVolumeSource(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 { +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__NFSVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NFSVolumeSourceIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1NFSVolumeSourceIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputK8s__io___api___core___v1__NFSVolumeSourceIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOK8s__io___api___core___v1__NamespaceCondition2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NamespaceConditionᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.K8sIoAPICoreV1NamespaceCondition) graphql.Marshaler { + if v == nil { + return graphql.Null + } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -16991,7 +62465,7 @@ func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgq if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) + ret[i] = ec.marshalNK8s__io___api___core___v1__NamespaceCondition2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NamespaceCondition(ctx, sel, v[i]) } if isLen1 { f(i) @@ -17011,31 +62485,19 @@ func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgq 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") - } +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__NamespaceConditionIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NamespaceConditionInᚄ(ctx context.Context, v interface{}) ([]*model.K8sIoAPICoreV1NamespaceConditionIn, error) { + if v == nil { + return nil, nil } - 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)) + res := make([]*model.K8sIoAPICoreV1NamespaceConditionIn, len(vSlice)) for i := range vSlice { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) + res[i], err = ec.unmarshalNK8s__io___api___core___v1__NamespaceConditionIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NamespaceConditionIn(ctx, vSlice[i]) if err != nil { return nil, err } @@ -17043,63 +62505,86 @@ func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx conte 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)) +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__NamespacePhase2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NamespacePhase(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1NamespacePhase, error) { + if v == nil { + return nil, nil } - 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) - } + var res = new(model.K8sIoAPICoreV1NamespacePhase) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} +func (ec *executionContext) marshalOK8s__io___api___core___v1__NamespacePhase2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NamespacePhase(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1NamespacePhase) graphql.Marshaler { + if v == nil { + return graphql.Null } - wg.Wait() + return v +} - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } +func (ec *executionContext) marshalOK8s__io___api___core___v1__NamespaceSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NamespaceSpec(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1NamespaceSpec) graphql.Marshaler { + if v == nil { + return graphql.Null } + return ec._K8s__io___api___core___v1__NamespaceSpec(ctx, sel, v) +} - return ret +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__NamespaceSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NamespaceSpecIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1NamespaceSpecIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputK8s__io___api___core___v1__NamespaceSpecIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -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) marshalOK8s__io___api___core___v1__NamespaceStatus2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NamespaceStatus(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1NamespaceStatus) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._K8s__io___api___core___v1__NamespaceStatus(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) unmarshalOK8s__io___api___core___v1__NamespaceStatusIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NamespaceStatusIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1NamespaceStatusIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputK8s__io___api___core___v1__NamespaceStatusIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -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) marshalOK8s__io___api___core___v1__NodeAffinity2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeAffinity(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1NodeAffinity) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._K8s__io___api___core___v1__NodeAffinity(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 { +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__NodeAffinityIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeAffinityIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1NodeAffinityIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputK8s__io___api___core___v1__NodeAffinityIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOK8s__io___api___core___v1__NodeSelector2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelector(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1NodeSelector) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._K8s__io___api___core___v1__NodeSelector(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__NodeSelectorIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelectorIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1NodeSelectorIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputK8s__io___api___core___v1__NodeSelectorIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOK8s__io___api___core___v1__NodeSelectorRequirement2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelectorRequirementᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.K8sIoAPICoreV1NodeSelectorRequirement) graphql.Marshaler { + if v == nil { + return graphql.Null + } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -17123,7 +62608,7 @@ func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋg if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + ret[i] = ec.marshalNK8s__io___api___core___v1__NodeSelectorRequirement2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelectorRequirement(ctx, sel, v[i]) } if isLen1 { f(i) @@ -17139,15 +62624,49 @@ func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋg return graphql.Null } } - - return ret + + return ret +} + +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__NodeSelectorRequirementIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelectorRequirementInᚄ(ctx context.Context, v interface{}) ([]*model.K8sIoAPICoreV1NodeSelectorRequirementIn, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.K8sIoAPICoreV1NodeSelectorRequirementIn, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNK8s__io___api___core___v1__NodeSelectorRequirementIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelectorRequirementIn(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOK8s__io___api___core___v1__ObjectReference2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ObjectReference(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1ObjectReference) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._K8s__io___api___core___v1__ObjectReference(ctx, sel, v) } -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) unmarshalOK8s__io___api___core___v1__ObjectReferenceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ObjectReferenceIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1ObjectReferenceIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputK8s__io___api___core___v1__ObjectReferenceIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { +func (ec *executionContext) marshalOK8s__io___api___core___v1__PersistentVolumeClaimCondition2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeClaimConditionᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.K8sIoAPICoreV1PersistentVolumeClaimCondition) graphql.Marshaler { + if v == nil { + return graphql.Null + } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -17171,7 +62690,7 @@ func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgen if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + ret[i] = ec.marshalNK8s__io___api___core___v1__PersistentVolumeClaimCondition2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeClaimCondition(ctx, sel, v[i]) } if isLen1 { f(i) @@ -17191,48 +62710,149 @@ func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgen 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 { +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__PersistentVolumeClaimConditionIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeClaimConditionInᚄ(ctx context.Context, v interface{}) ([]*model.K8sIoAPICoreV1PersistentVolumeClaimConditionIn, error) { 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 nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.K8sIoAPICoreV1PersistentVolumeClaimConditionIn, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNK8s__io___api___core___v1__PersistentVolumeClaimConditionIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeClaimConditionIn(ctx, vSlice[i]) + if err != nil { + return nil, err } + } + return res, nil +} + +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__PersistentVolumeClaimPhase2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeClaimPhase(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1PersistentVolumeClaimPhase, error) { + if v == nil { + return nil, nil + } + var res = new(model.K8sIoAPICoreV1PersistentVolumeClaimPhase) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOK8s__io___api___core___v1__PersistentVolumeClaimPhase2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeClaimPhase(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1PersistentVolumeClaimPhase) graphql.Marshaler { + if v == nil { return graphql.Null } - return ec.___Type(ctx, sel, v) + return v } -func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(v) +func (ec *executionContext) marshalOK8s__io___api___core___v1__PersistentVolumeClaimSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeClaimSpec(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1PersistentVolumeClaimSpec) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._K8s__io___api___core___v1__PersistentVolumeClaimSpec(ctx, sel, v) +} + +func (ec *executionContext) marshalOK8s__io___api___core___v1__PersistentVolumeClaimStatus2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeClaimStatus(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1PersistentVolumeClaimStatus) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._K8s__io___api___core___v1__PersistentVolumeClaimStatus(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__PersistentVolumePhase2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumePhase(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1PersistentVolumePhase, error) { + if v == nil { + return nil, nil + } + var res = new(model.K8sIoAPICoreV1PersistentVolumePhase) + err := res.UnmarshalGQL(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") - } +func (ec *executionContext) marshalOK8s__io___api___core___v1__PersistentVolumePhase2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumePhase(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1PersistentVolumePhase) graphql.Marshaler { + if v == nil { + return graphql.Null } - return res + return v } -func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v interface{}) (interface{}, error) { +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__PersistentVolumeReclaimPolicy2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeReclaimPolicy(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1PersistentVolumeReclaimPolicy, error) { if v == nil { return nil, nil } - res, err := graphql.UnmarshalAny(v) + var res = new(model.K8sIoAPICoreV1PersistentVolumeReclaimPolicy) + err := res.UnmarshalGQL(v) return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOAny2interface(ctx context.Context, sel ast.SelectionSet, v interface{}) graphql.Marshaler { +func (ec *executionContext) marshalOK8s__io___api___core___v1__PersistentVolumeReclaimPolicy2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeReclaimPolicy(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1PersistentVolumeReclaimPolicy) graphql.Marshaler { if v == nil { return graphql.Null } - res := graphql.MarshalAny(v) - return res + return v +} + +func (ec *executionContext) marshalOK8s__io___api___core___v1__PersistentVolumeSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeSpec(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1PersistentVolumeSpec) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._K8s__io___api___core___v1__PersistentVolumeSpec(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__PersistentVolumeSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeSpecIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1PersistentVolumeSpecIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputK8s__io___api___core___v1__PersistentVolumeSpecIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOK8s__io___api___core___v1__PersistentVolumeStatus2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeStatus(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1PersistentVolumeStatus) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._K8s__io___api___core___v1__PersistentVolumeStatus(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__PersistentVolumeStatusIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeStatusIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1PersistentVolumeStatusIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputK8s__io___api___core___v1__PersistentVolumeStatusIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOK8s__io___api___core___v1__PhotonPersistentDiskVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PhotonPersistentDiskVolumeSource(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1PhotonPersistentDiskVolumeSource) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._K8s__io___api___core___v1__PhotonPersistentDiskVolumeSource(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__PhotonPersistentDiskVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PhotonPersistentDiskVolumeSourceIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1PhotonPersistentDiskVolumeSourceIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputK8s__io___api___core___v1__PhotonPersistentDiskVolumeSourceIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOK8s__io___api___core___v1__PodAffinity2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PodAffinity(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1PodAffinity) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._K8s__io___api___core___v1__PodAffinity(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__PodAffinityIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PodAffinityIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1PodAffinityIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputK8s__io___api___core___v1__PodAffinityIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOBYOCCluster2ᚕᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐBYOCClusterᚄ(ctx context.Context, sel ast.SelectionSet, v []*entities.BYOCCluster) graphql.Marshaler { +func (ec *executionContext) marshalOK8s__io___api___core___v1__PodAffinityTerm2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PodAffinityTermᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.K8sIoAPICoreV1PodAffinityTerm) graphql.Marshaler { if v == nil { return graphql.Null } @@ -17259,7 +62879,7 @@ func (ec *executionContext) marshalOBYOCCluster2ᚕᚖkloudliteᚗioᚋappsᚋin if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNBYOCCluster2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐBYOCCluster(ctx, sel, v[i]) + ret[i] = ec.marshalNK8s__io___api___core___v1__PodAffinityTerm2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PodAffinityTerm(ctx, sel, v[i]) } if isLen1 { f(i) @@ -17279,55 +62899,57 @@ func (ec *executionContext) marshalOBYOCCluster2ᚕᚖkloudliteᚗioᚋappsᚋin return ret } -func (ec *executionContext) marshalOBYOCCluster2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐBYOCCluster(ctx context.Context, sel ast.SelectionSet, v *entities.BYOCCluster) graphql.Marshaler { +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__PodAffinityTermIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PodAffinityTermInᚄ(ctx context.Context, v interface{}) ([]*model.K8sIoAPICoreV1PodAffinityTermIn, error) { if v == nil { - return graphql.Null + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.K8sIoAPICoreV1PodAffinityTermIn, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNK8s__io___api___core___v1__PodAffinityTermIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PodAffinityTermIn(ctx, vSlice[i]) + if err != nil { + return nil, err + } } - return ec._BYOCCluster(ctx, sel, v) + return res, nil } -func (ec *executionContext) marshalOBYOCClusterSpec2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐBYOCClusterSpec(ctx context.Context, sel ast.SelectionSet, v *model.BYOCClusterSpec) graphql.Marshaler { +func (ec *executionContext) marshalOK8s__io___api___core___v1__PodAntiAffinity2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PodAntiAffinity(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1PodAntiAffinity) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._BYOCClusterSpec(ctx, sel, v) + return ec._K8s__io___api___core___v1__PodAntiAffinity(ctx, sel, v) } -func (ec *executionContext) unmarshalOBYOCClusterSpecIn2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐBYOCClusterSpecIn(ctx context.Context, v interface{}) (*model.BYOCClusterSpecIn, error) { +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__PodAntiAffinityIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PodAntiAffinityIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1PodAntiAffinityIn, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalInputBYOCClusterSpecIn(ctx, v) + res, err := ec.unmarshalInputK8s__io___api___core___v1__PodAntiAffinityIn(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { - res, err := graphql.UnmarshalBoolean(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { - res := graphql.MarshalBoolean(v) - return res -} - -func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v interface{}) (*bool, error) { +func (ec *executionContext) marshalOK8s__io___api___core___v1__PortworxVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PortworxVolumeSource(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1PortworxVolumeSource) graphql.Marshaler { if v == nil { - return nil, nil + return graphql.Null } - res, err := graphql.UnmarshalBoolean(v) - return &res, graphql.ErrorOnPath(ctx, err) + return ec._K8s__io___api___core___v1__PortworxVolumeSource(ctx, sel, v) } -func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__PortworxVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PortworxVolumeSourceIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1PortworxVolumeSourceIn, error) { if v == nil { - return graphql.Null + return nil, nil } - res := graphql.MarshalBoolean(*v) - return res + res, err := ec.unmarshalInputK8s__io___api___core___v1__PortworxVolumeSourceIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOCloudProvider2ᚕᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐCloudProviderᚄ(ctx context.Context, sel ast.SelectionSet, v []*entities.CloudProvider) graphql.Marshaler { +func (ec *executionContext) marshalOK8s__io___api___core___v1__PreferredSchedulingTerm2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PreferredSchedulingTermᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.K8sIoAPICoreV1PreferredSchedulingTerm) graphql.Marshaler { if v == nil { return graphql.Null } @@ -17354,7 +62976,7 @@ func (ec *executionContext) marshalOCloudProvider2ᚕᚖkloudliteᚗioᚋappsᚋ if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNCloudProvider2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐCloudProvider(ctx, sel, v[i]) + ret[i] = ec.marshalNK8s__io___api___core___v1__PreferredSchedulingTerm2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PreferredSchedulingTerm(ctx, sel, v[i]) } if isLen1 { f(i) @@ -17374,29 +62996,57 @@ func (ec *executionContext) marshalOCloudProvider2ᚕᚖkloudliteᚗioᚋappsᚋ return ret } -func (ec *executionContext) marshalOCloudProvider2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐCloudProvider(ctx context.Context, sel ast.SelectionSet, v *entities.CloudProvider) graphql.Marshaler { +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__PreferredSchedulingTermIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PreferredSchedulingTermInᚄ(ctx context.Context, v interface{}) ([]*model.K8sIoAPICoreV1PreferredSchedulingTermIn, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.K8sIoAPICoreV1PreferredSchedulingTermIn, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNK8s__io___api___core___v1__PreferredSchedulingTermIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PreferredSchedulingTermIn(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOK8s__io___api___core___v1__QuobyteVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1QuobyteVolumeSource(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1QuobyteVolumeSource) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._CloudProvider(ctx, sel, v) + return ec._K8s__io___api___core___v1__QuobyteVolumeSource(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__QuobyteVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1QuobyteVolumeSourceIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1QuobyteVolumeSourceIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputK8s__io___api___core___v1__QuobyteVolumeSourceIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOCloudProviderSpec2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐCloudProviderSpec(ctx context.Context, sel ast.SelectionSet, v *model.CloudProviderSpec) graphql.Marshaler { +func (ec *executionContext) marshalOK8s__io___api___core___v1__RBDPersistentVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1RBDPersistentVolumeSource(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1RBDPersistentVolumeSource) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._CloudProviderSpec(ctx, sel, v) + return ec._K8s__io___api___core___v1__RBDPersistentVolumeSource(ctx, sel, v) } -func (ec *executionContext) unmarshalOCloudProviderSpecIn2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐCloudProviderSpecIn(ctx context.Context, v interface{}) (*model.CloudProviderSpecIn, error) { +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__RBDPersistentVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1RBDPersistentVolumeSourceIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1RBDPersistentVolumeSourceIn, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalInputCloudProviderSpecIn(ctx, v) + res, err := ec.unmarshalInputK8s__io___api___core___v1__RBDPersistentVolumeSourceIn(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOCluster2ᚕᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐClusterᚄ(ctx context.Context, sel ast.SelectionSet, v []*entities.Cluster) graphql.Marshaler { +func (ec *executionContext) marshalOK8s__io___api___core___v1__ResourceClaim2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ResourceClaimᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.K8sIoAPICoreV1ResourceClaim) graphql.Marshaler { if v == nil { return graphql.Null } @@ -17423,7 +63073,7 @@ func (ec *executionContext) marshalOCluster2ᚕᚖkloudliteᚗioᚋappsᚋinfra if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNCluster2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐCluster(ctx, sel, v[i]) + ret[i] = ec.marshalNK8s__io___api___core___v1__ResourceClaim2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ResourceClaim(ctx, sel, v[i]) } if isLen1 { f(i) @@ -17443,45 +63093,87 @@ func (ec *executionContext) marshalOCluster2ᚕᚖkloudliteᚗioᚋappsᚋinfra return ret } -func (ec *executionContext) marshalOCluster2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐCluster(ctx context.Context, sel ast.SelectionSet, v *entities.Cluster) graphql.Marshaler { +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__ResourceClaimIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ResourceClaimInᚄ(ctx context.Context, v interface{}) ([]*model.K8sIoAPICoreV1ResourceClaimIn, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.K8sIoAPICoreV1ResourceClaimIn, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNK8s__io___api___core___v1__ResourceClaimIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ResourceClaimIn(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOK8s__io___api___core___v1__ResourceRequirements2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ResourceRequirements(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1ResourceRequirements) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._Cluster(ctx, sel, v) + return ec._K8s__io___api___core___v1__ResourceRequirements(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__ResourceRequirementsIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ResourceRequirementsIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1ResourceRequirementsIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputK8s__io___api___core___v1__ResourceRequirementsIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOClusterSpec2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐClusterSpec(ctx context.Context, sel ast.SelectionSet, v *model.ClusterSpec) graphql.Marshaler { +func (ec *executionContext) marshalOK8s__io___api___core___v1__ScaleIOPersistentVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ScaleIOPersistentVolumeSource(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1ScaleIOPersistentVolumeSource) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._ClusterSpec(ctx, sel, v) + return ec._K8s__io___api___core___v1__ScaleIOPersistentVolumeSource(ctx, sel, v) } -func (ec *executionContext) unmarshalOClusterSpecIn2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐClusterSpecIn(ctx context.Context, v interface{}) (*model.ClusterSpecIn, error) { +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__ScaleIOPersistentVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ScaleIOPersistentVolumeSourceIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1ScaleIOPersistentVolumeSourceIn, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalInputClusterSpecIn(ctx, v) + res, err := ec.unmarshalInputK8s__io___api___core___v1__ScaleIOPersistentVolumeSourceIn(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalODate2ᚖstring(ctx context.Context, v interface{}) (*string, error) { +func (ec *executionContext) marshalOK8s__io___api___core___v1__SecretReference2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1SecretReference(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1SecretReference) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._K8s__io___api___core___v1__SecretReference(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__SecretReferenceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1SecretReferenceIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1SecretReferenceIn, error) { if v == nil { return nil, nil } - res, err := graphql.UnmarshalString(v) + res, err := ec.unmarshalInputK8s__io___api___core___v1__SecretReferenceIn(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalODate2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { +func (ec *executionContext) marshalOK8s__io___api___core___v1__StorageOSPersistentVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1StorageOSPersistentVolumeSource(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1StorageOSPersistentVolumeSource) graphql.Marshaler { if v == nil { return graphql.Null } - res := graphql.MarshalString(*v) - return res + return ec._K8s__io___api___core___v1__StorageOSPersistentVolumeSource(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__StorageOSPersistentVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1StorageOSPersistentVolumeSourceIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1StorageOSPersistentVolumeSourceIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputK8s__io___api___core___v1__StorageOSPersistentVolumeSourceIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOEdge2ᚕᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*entities.Edge) graphql.Marshaler { +func (ec *executionContext) marshalOK8s__io___api___core___v1__Taint2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1Taintᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.K8sIoAPICoreV1Taint) graphql.Marshaler { if v == nil { return graphql.Null } @@ -17508,7 +63200,7 @@ func (ec *executionContext) marshalOEdge2ᚕᚖkloudliteᚗioᚋappsᚋinfraᚋi if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNEdge2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐEdge(ctx, sel, v[i]) + ret[i] = ec.marshalNK8s__io___api___core___v1__Taint2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1Taint(ctx, sel, v[i]) } if isLen1 { f(i) @@ -17528,29 +63220,43 @@ func (ec *executionContext) marshalOEdge2ᚕᚖkloudliteᚗioᚋappsᚋinfraᚋi return ret } -func (ec *executionContext) marshalOEdge2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐEdge(ctx context.Context, sel ast.SelectionSet, v *entities.Edge) graphql.Marshaler { +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__TaintEffect2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TaintEffect(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1TaintEffect, error) { if v == nil { - return graphql.Null + return nil, nil } - return ec._Edge(ctx, sel, v) + var res = new(model.K8sIoAPICoreV1TaintEffect) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOEdgeSpec2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐEdgeSpec(ctx context.Context, sel ast.SelectionSet, v *model.EdgeSpec) graphql.Marshaler { +func (ec *executionContext) marshalOK8s__io___api___core___v1__TaintEffect2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TaintEffect(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1TaintEffect) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._EdgeSpec(ctx, sel, v) + return v } -func (ec *executionContext) unmarshalOEdgeSpecIn2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐEdgeSpecIn(ctx context.Context, v interface{}) (*model.EdgeSpecIn, error) { +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__TaintIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TaintInᚄ(ctx context.Context, v interface{}) ([]*model.K8sIoAPICoreV1TaintIn, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalInputEdgeSpecIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.K8sIoAPICoreV1TaintIn, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNK8s__io___api___core___v1__TaintIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TaintIn(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil } -func (ec *executionContext) marshalOEdgeSpecPools2ᚕᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐEdgeSpecPools(ctx context.Context, sel ast.SelectionSet, v []*model.EdgeSpecPools) graphql.Marshaler { +func (ec *executionContext) marshalOK8s__io___api___core___v1__Toleration2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1Tolerationᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.K8sIoAPICoreV1Toleration) graphql.Marshaler { if v == nil { return graphql.Null } @@ -17577,7 +63283,7 @@ func (ec *executionContext) marshalOEdgeSpecPools2ᚕᚖkloudliteᚗioᚋappsᚋ if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalOEdgeSpecPools2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐEdgeSpecPools(ctx, sel, v[i]) + ret[i] = ec.marshalNK8s__io___api___core___v1__Toleration2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1Toleration(ctx, sel, v[i]) } if isLen1 { f(i) @@ -17588,17 +63294,16 @@ func (ec *executionContext) marshalOEdgeSpecPools2ᚕᚖkloudliteᚗioᚋappsᚋ } wg.Wait() - return ret -} - -func (ec *executionContext) marshalOEdgeSpecPools2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐEdgeSpecPools(ctx context.Context, sel ast.SelectionSet, v *model.EdgeSpecPools) graphql.Marshaler { - if v == nil { - return graphql.Null + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } } - return ec._EdgeSpecPools(ctx, sel, v) + + return ret } -func (ec *executionContext) unmarshalOEdgeSpecPoolsIn2ᚕᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐEdgeSpecPoolsIn(ctx context.Context, v interface{}) ([]*model.EdgeSpecPoolsIn, error) { +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__TolerationIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TolerationInᚄ(ctx context.Context, v interface{}) ([]*model.K8sIoAPICoreV1TolerationIn, error) { if v == nil { return nil, nil } @@ -17607,10 +63312,10 @@ func (ec *executionContext) unmarshalOEdgeSpecPoolsIn2ᚕᚖkloudliteᚗioᚋapp vSlice = graphql.CoerceList(v) } var err error - res := make([]*model.EdgeSpecPoolsIn, len(vSlice)) + res := make([]*model.K8sIoAPICoreV1TolerationIn, len(vSlice)) for i := range vSlice { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalOEdgeSpecPoolsIn2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐEdgeSpecPoolsIn(ctx, vSlice[i]) + res[i], err = ec.unmarshalNK8s__io___api___core___v1__TolerationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TolerationIn(ctx, vSlice[i]) if err != nil { return nil, err } @@ -17618,73 +63323,83 @@ func (ec *executionContext) unmarshalOEdgeSpecPoolsIn2ᚕᚖkloudliteᚗioᚋapp return res, nil } -func (ec *executionContext) unmarshalOEdgeSpecPoolsIn2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐEdgeSpecPoolsIn(ctx context.Context, v interface{}) (*model.EdgeSpecPoolsIn, error) { +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__TolerationOperator2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TolerationOperator(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1TolerationOperator, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalInputEdgeSpecPoolsIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) + var res = new(model.K8sIoAPICoreV1TolerationOperator) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalOInt2int64(ctx context.Context, v interface{}) (int64, error) { - res, err := graphql.UnmarshalInt64(v) - return res, graphql.ErrorOnPath(ctx, err) +func (ec *executionContext) marshalOK8s__io___api___core___v1__TolerationOperator2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TolerationOperator(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1TolerationOperator) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v } -func (ec *executionContext) marshalOInt2int64(ctx context.Context, sel ast.SelectionSet, v int64) graphql.Marshaler { - res := graphql.MarshalInt64(v) - return res +func (ec *executionContext) marshalOK8s__io___api___core___v1__TypedLocalObjectReference2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TypedLocalObjectReference(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1TypedLocalObjectReference) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._K8s__io___api___core___v1__TypedLocalObjectReference(ctx, sel, v) } -func (ec *executionContext) unmarshalOInt2ᚖint(ctx context.Context, v interface{}) (*int, error) { +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__TypedLocalObjectReferenceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TypedLocalObjectReferenceIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1TypedLocalObjectReferenceIn, error) { if v == nil { return nil, nil } - res, err := graphql.UnmarshalInt(v) + res, err := ec.unmarshalInputK8s__io___api___core___v1__TypedLocalObjectReferenceIn(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.SelectionSet, v *int) graphql.Marshaler { +func (ec *executionContext) marshalOK8s__io___api___core___v1__TypedObjectReference2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TypedObjectReference(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1TypedObjectReference) graphql.Marshaler { if v == nil { return graphql.Null } - res := graphql.MarshalInt(*v) - return res + return ec._K8s__io___api___core___v1__TypedObjectReference(ctx, sel, v) } -func (ec *executionContext) unmarshalOJson2map(ctx context.Context, v interface{}) (map[string]interface{}, error) { +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__TypedObjectReferenceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TypedObjectReferenceIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1TypedObjectReferenceIn, error) { if v == nil { return nil, nil } - res, err := graphql.UnmarshalMap(v) - return res, graphql.ErrorOnPath(ctx, err) + res, err := ec.unmarshalInputK8s__io___api___core___v1__TypedObjectReferenceIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOJson2map(ctx context.Context, sel ast.SelectionSet, v map[string]interface{}) graphql.Marshaler { +func (ec *executionContext) marshalOK8s__io___api___core___v1__VolumeNodeAffinity2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1VolumeNodeAffinity(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1VolumeNodeAffinity) graphql.Marshaler { if v == nil { return graphql.Null } - res := graphql.MarshalMap(v) - return res + return ec._K8s__io___api___core___v1__VolumeNodeAffinity(ctx, sel, v) } -func (ec *executionContext) unmarshalOMap2map(ctx context.Context, v interface{}) (map[string]interface{}, error) { +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__VolumeNodeAffinityIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1VolumeNodeAffinityIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1VolumeNodeAffinityIn, error) { if v == nil { return nil, nil } - res, err := graphql.UnmarshalMap(v) - return res, graphql.ErrorOnPath(ctx, err) + res, err := ec.unmarshalInputK8s__io___api___core___v1__VolumeNodeAffinityIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOMap2map(ctx context.Context, sel ast.SelectionSet, v map[string]interface{}) graphql.Marshaler { +func (ec *executionContext) marshalOK8s__io___api___core___v1__VsphereVirtualDiskVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1VsphereVirtualDiskVolumeSource(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1VsphereVirtualDiskVolumeSource) graphql.Marshaler { if v == nil { return graphql.Null } - res := graphql.MarshalMap(v) - return res + return ec._K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__VsphereVirtualDiskVolumeSourceIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1VsphereVirtualDiskVolumeSourceIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1VsphereVirtualDiskVolumeSourceIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputK8s__io___api___core___v1__VsphereVirtualDiskVolumeSourceIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOMasterNode2ᚕᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐMasterNodeᚄ(ctx context.Context, sel ast.SelectionSet, v []*entities.MasterNode) graphql.Marshaler { +func (ec *executionContext) marshalOK8s__io___api___core___v1__WeightedPodAffinityTerm2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1WeightedPodAffinityTermᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.K8sIoAPICoreV1WeightedPodAffinityTerm) graphql.Marshaler { if v == nil { return graphql.Null } @@ -17711,7 +63426,7 @@ func (ec *executionContext) marshalOMasterNode2ᚕᚖkloudliteᚗioᚋappsᚋinf if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNMasterNode2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐMasterNode(ctx, sel, v[i]) + ret[i] = ec.marshalNK8s__io___api___core___v1__WeightedPodAffinityTerm2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1WeightedPodAffinityTerm(ctx, sel, v[i]) } if isLen1 { f(i) @@ -17731,22 +63446,72 @@ func (ec *executionContext) marshalOMasterNode2ᚕᚖkloudliteᚗioᚋappsᚋinf return ret } -func (ec *executionContext) marshalOMasterNodeSpec2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐMasterNodeSpec(ctx context.Context, sel ast.SelectionSet, v *model.MasterNodeSpec) graphql.Marshaler { +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__WeightedPodAffinityTermIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1WeightedPodAffinityTermInᚄ(ctx context.Context, v interface{}) ([]*model.K8sIoAPICoreV1WeightedPodAffinityTermIn, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.K8sIoAPICoreV1WeightedPodAffinityTermIn, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNK8s__io___api___core___v1__WeightedPodAffinityTermIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1WeightedPodAffinityTermIn(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOK8s__io___api___storage___v1__VolumeAttachmentStatus2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPIStorageV1VolumeAttachmentStatus(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPIStorageV1VolumeAttachmentStatus) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._K8s__io___api___storage___v1__VolumeAttachmentStatus(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOK8s__io___api___storage___v1__VolumeAttachmentStatusIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPIStorageV1VolumeAttachmentStatusIn(ctx context.Context, v interface{}) (*model.K8sIoAPIStorageV1VolumeAttachmentStatusIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputK8s__io___api___storage___v1__VolumeAttachmentStatusIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOK8s__io___api___storage___v1__VolumeError2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPIStorageV1VolumeError(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPIStorageV1VolumeError) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._K8s__io___api___storage___v1__VolumeError(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOK8s__io___api___storage___v1__VolumeErrorIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPIStorageV1VolumeErrorIn(ctx context.Context, v interface{}) (*model.K8sIoAPIStorageV1VolumeErrorIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputK8s__io___api___storage___v1__VolumeErrorIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOK8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoApimachineryPkgApisMetaV1LabelSelector(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoApimachineryPkgApisMetaV1LabelSelector) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._MasterNodeSpec(ctx, sel, v) + return ec._K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector(ctx, sel, v) } -func (ec *executionContext) unmarshalOMasterNodeSpecIn2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐMasterNodeSpecIn(ctx context.Context, v interface{}) (*model.MasterNodeSpecIn, error) { +func (ec *executionContext) unmarshalOK8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoApimachineryPkgApisMetaV1LabelSelectorIn(ctx context.Context, v interface{}) (*model.K8sIoApimachineryPkgApisMetaV1LabelSelectorIn, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalInputMasterNodeSpecIn(ctx, v) + res, err := ec.unmarshalInputK8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorIn(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalONodePool2ᚕᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐNodePoolᚄ(ctx context.Context, sel ast.SelectionSet, v []*entities.NodePool) graphql.Marshaler { +func (ec *executionContext) marshalOK8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoApimachineryPkgApisMetaV1LabelSelectorRequirementᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.K8sIoApimachineryPkgApisMetaV1LabelSelectorRequirement) graphql.Marshaler { if v == nil { return graphql.Null } @@ -17773,7 +63538,7 @@ func (ec *executionContext) marshalONodePool2ᚕᚖkloudliteᚗioᚋappsᚋinfra if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNNodePool2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐNodePool(ctx, sel, v[i]) + ret[i] = ec.marshalNK8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoApimachineryPkgApisMetaV1LabelSelectorRequirement(ctx, sel, v[i]) } if isLen1 { f(i) @@ -17793,37 +63558,63 @@ func (ec *executionContext) marshalONodePool2ᚕᚖkloudliteᚗioᚋappsᚋinfra return ret } -func (ec *executionContext) marshalONodePoolSpec2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐNodePoolSpec(ctx context.Context, sel ast.SelectionSet, v *model.NodePoolSpec) graphql.Marshaler { +func (ec *executionContext) unmarshalOK8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirementIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoApimachineryPkgApisMetaV1LabelSelectorRequirementInᚄ(ctx context.Context, v interface{}) ([]*model.K8sIoApimachineryPkgApisMetaV1LabelSelectorRequirementIn, error) { if v == nil { - return graphql.Null + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.K8sIoApimachineryPkgApisMetaV1LabelSelectorRequirementIn, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNK8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirementIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoApimachineryPkgApisMetaV1LabelSelectorRequirementIn(ctx, vSlice[i]) + if err != nil { + return nil, err + } } - return ec._NodePoolSpec(ctx, sel, v) + return res, nil } -func (ec *executionContext) unmarshalONodePoolSpecIn2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐNodePoolSpecIn(ctx context.Context, v interface{}) (*model.NodePoolSpecIn, error) { +func (ec *executionContext) unmarshalOMap2map(ctx context.Context, v interface{}) (map[string]interface{}, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalInputNodePoolSpecIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) + res, err := graphql.UnmarshalMap(v) + return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOOverrides2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋapisᚋcrdsᚋv1ᚐJsonPatch(ctx context.Context, sel ast.SelectionSet, v *v11.JsonPatch) graphql.Marshaler { +func (ec *executionContext) marshalOMap2map(ctx context.Context, sel ast.SelectionSet, v map[string]interface{}) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._Overrides(ctx, sel, v) + res := graphql.MarshalMap(v) + return res +} + +func (ec *executionContext) unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx context.Context, v interface{}) (*repos.MatchFilter, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputMatchFilterIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalOOverridesIn2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋapisᚋcrdsᚋv1ᚐJsonPatch(ctx context.Context, v interface{}) (*v11.JsonPatch, error) { +func (ec *executionContext) marshalOMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx context.Context, sel ast.SelectionSet, v v1.ObjectMeta) graphql.Marshaler { + return ec._Metadata(ctx, sel, &v) +} + +func (ec *executionContext) unmarshalOMetadataIn2ᚖk8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx context.Context, v interface{}) (*v1.ObjectMeta, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalInputOverridesIn(ctx, v) + res, err := ec.unmarshalInputMetadataIn(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOPatch2ᚕgithubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋjsonᚑpatchᚐPatchOperationᚄ(ctx context.Context, sel ast.SelectionSet, v []json_patch.PatchOperation) graphql.Marshaler { +func (ec *executionContext) marshalOMsvcTemplate2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐMsvcTemplateᚄ(ctx context.Context, sel ast.SelectionSet, v []*entities.MsvcTemplate) graphql.Marshaler { if v == nil { return graphql.Null } @@ -17850,7 +63641,7 @@ func (ec *executionContext) marshalOPatch2ᚕgithubᚗcomᚋkloudliteᚋoperator if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNPatch2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋjsonᚑpatchᚐPatchOperation(ctx, sel, v[i]) + ret[i] = ec.marshalNMsvcTemplate2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐMsvcTemplate(ctx, sel, v[i]) } if isLen1 { f(i) @@ -17870,43 +63661,140 @@ func (ec *executionContext) marshalOPatch2ᚕgithubᚗcomᚋkloudliteᚋoperator return ret } -func (ec *executionContext) unmarshalOPatchIn2ᚕgithubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋjsonᚑpatchᚐPatchOperationᚄ(ctx context.Context, v interface{}) ([]json_patch.PatchOperation, error) { +func (ec *executionContext) marshalONamespace2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐNamespace(ctx context.Context, sel ast.SelectionSet, v *entities.Namespace) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Namespace(ctx, sel, v) +} + +func (ec *executionContext) marshalONamespacePaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐNamespacePaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.NamespacePaginatedRecords) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._NamespacePaginatedRecords(ctx, sel, v) +} + +func (ec *executionContext) marshalONodePool2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐNodePool(ctx context.Context, sel ast.SelectionSet, v *entities.NodePool) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._NodePool(ctx, sel, v) +} + +func (ec *executionContext) marshalONodePoolPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐNodePoolPaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.NodePoolPaginatedRecords) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._NodePoolPaginatedRecords(ctx, sel, v) +} + +func (ec *executionContext) marshalOPersistentVolume2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐPersistentVolume(ctx context.Context, sel ast.SelectionSet, v *entities.PersistentVolume) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._PersistentVolume(ctx, sel, v) +} + +func (ec *executionContext) marshalOPersistentVolumeClaim2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐPersistentVolumeClaim(ctx context.Context, sel ast.SelectionSet, v *entities.PersistentVolumeClaim) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._PersistentVolumeClaim(ctx, sel, v) +} + +func (ec *executionContext) marshalOPersistentVolumeClaimPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐPersistentVolumeClaimPaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.PersistentVolumeClaimPaginatedRecords) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._PersistentVolumeClaimPaginatedRecords(ctx, sel, v) +} + +func (ec *executionContext) marshalOPersistentVolumePaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐPersistentVolumePaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.PersistentVolumePaginatedRecords) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._PersistentVolumePaginatedRecords(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOSearchCluster2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐSearchCluster(ctx context.Context, v interface{}) (*model.SearchCluster, error) { if v == nil { return nil, nil } - var vSlice []interface{} - if v != nil { - vSlice = graphql.CoerceList(v) + res, err := ec.unmarshalInputSearchCluster(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOSearchClusterManagedService2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐSearchClusterManagedService(ctx context.Context, v interface{}) (*model.SearchClusterManagedService, error) { + if v == nil { + return nil, nil } - var err error - res := make([]json_patch.PatchOperation, len(vSlice)) - for i := range vSlice { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalNPatchIn2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋjsonᚑpatchᚐPatchOperation(ctx, vSlice[i]) - if err != nil { - return nil, err - } + res, err := ec.unmarshalInputSearchClusterManagedService(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOSearchDomainEntry2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐSearchDomainEntry(ctx context.Context, v interface{}) (*model.SearchDomainEntry, error) { + if v == nil { + return nil, nil } - return res, nil + res, err := ec.unmarshalInputSearchDomainEntry(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalOSecretIn2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐSecret(ctx context.Context, v interface{}) (*entities.Secret, error) { +func (ec *executionContext) unmarshalOSearchHelmRelease2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐSearchHelmRelease(ctx context.Context, v interface{}) (*model.SearchHelmRelease, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalInputSecretIn(ctx, v) + res, err := ec.unmarshalInputSearchHelmRelease(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOStatus2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx context.Context, sel ast.SelectionSet, v operator.Status) graphql.Marshaler { - return ec._Status(ctx, sel, &v) +func (ec *executionContext) unmarshalOSearchNamespaces2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐSearchNamespaces(ctx context.Context, v interface{}) (*model.SearchNamespaces, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputSearchNamespaces(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOStatus2ᚖgithubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx context.Context, sel ast.SelectionSet, v *operator.Status) graphql.Marshaler { +func (ec *executionContext) unmarshalOSearchNodepool2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐSearchNodepool(ctx context.Context, v interface{}) (*model.SearchNodepool, error) { if v == nil { - return graphql.Null + return nil, nil + } + res, err := ec.unmarshalInputSearchNodepool(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOSearchPersistentVolumeClaims2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐSearchPersistentVolumeClaims(ctx context.Context, v interface{}) (*model.SearchPersistentVolumeClaims, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputSearchPersistentVolumeClaims(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOSearchPersistentVolumes2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐSearchPersistentVolumes(ctx context.Context, v interface{}) (*model.SearchPersistentVolumes, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputSearchPersistentVolumes(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOSearchProviderSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐSearchProviderSecret(ctx context.Context, v interface{}) (*model.SearchProviderSecret, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputSearchProviderSecret(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOSearchVolumeAttachments2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐSearchVolumeAttachments(ctx context.Context, v interface{}) (*model.SearchVolumeAttachments, error) { + if v == nil { + return nil, nil } - return ec._Status(ctx, sel, v) + res, err := ec.unmarshalInputSearchVolumeAttachments(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { @@ -17957,38 +63845,6 @@ func (ec *executionContext) marshalOString2ᚕstringᚄ(ctx context.Context, sel 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 @@ -18005,70 +63861,18 @@ func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel as return res } -func (ec *executionContext) marshalOSyncStatus2kloudliteᚗioᚋpkgᚋtypesᚐSyncStatus(ctx context.Context, sel ast.SelectionSet, v types.SyncStatus) graphql.Marshaler { - return ec._SyncStatus(ctx, sel, &v) -} - -func (ec *executionContext) marshalOWorkerNode2ᚕᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐWorkerNodeᚄ(ctx context.Context, sel ast.SelectionSet, v []*entities.WorkerNode) graphql.Marshaler { +func (ec *executionContext) marshalOVolumeAttachment2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋentitiesᚐVolumeAttachment(ctx context.Context, sel ast.SelectionSet, v *entities.VolumeAttachment) 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.marshalNWorkerNode2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋdomainᚋentitiesᚐWorkerNode(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 + return ec._VolumeAttachment(ctx, sel, v) } -func (ec *executionContext) marshalOWorkerNodeSpec2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐWorkerNodeSpec(ctx context.Context, sel ast.SelectionSet, v *model.WorkerNodeSpec) graphql.Marshaler { +func (ec *executionContext) marshalOVolumeAttachmentPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐVolumeAttachmentPaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.VolumeAttachmentPaginatedRecords) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._WorkerNodeSpec(ctx, sel, v) -} - -func (ec *executionContext) unmarshalOWorkerNodeSpecIn2ᚖkloudliteᚗioᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐWorkerNodeSpecIn(ctx context.Context, v interface{}) (*model.WorkerNodeSpecIn, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputWorkerNodeSpecIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) + return ec._VolumeAttachmentPaginatedRecords(ctx, sel, v) } func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler { diff --git a/apps/infra/internal/app/graph/helmrelease.resolvers.go b/apps/infra/internal/app/graph/helmrelease.resolvers.go new file mode 100644 index 000000000..7c5b67ad7 --- /dev/null +++ b/apps/infra/internal/app/graph/helmrelease.resolvers.go @@ -0,0 +1,96 @@ +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.28 + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + "time" + + "github.com/kloudlite/api/apps/infra/internal/app/graph/generated" + "github.com/kloudlite/api/apps/infra/internal/app/graph/model" + "github.com/kloudlite/api/apps/infra/internal/entities" + fn "github.com/kloudlite/api/pkg/functions" + "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// CreationTime is the resolver for the creationTime field. +func (r *helmReleaseResolver) CreationTime(ctx context.Context, obj *entities.HelmRelease) (string, error) { + if obj == nil { + return "", errors.Newf("helmRelease obj is nil") + } + + return obj.CreationTime.Format(time.RFC3339), nil +} + +// ID is the resolver for the id field. +func (r *helmReleaseResolver) ID(ctx context.Context, obj *entities.HelmRelease) (string, error) { + if obj == nil { + return "", errors.Newf("helmRelease obj is nil") + } + + return string(obj.Id), nil +} + +// Spec is the resolver for the spec field. +func (r *helmReleaseResolver) Spec(ctx context.Context, obj *entities.HelmRelease) (*model.GithubComKloudliteOperatorApisCrdsV1HelmChartSpec, error) { + if obj == nil { + return nil, errors.Newf("helmRelease is nil") + } + + var spec model.GithubComKloudliteOperatorApisCrdsV1HelmChartSpec + if err := fn.JsonConversion(&obj.Spec, &spec); err != nil { + return nil, errors.NewE(err) + } + return &spec, nil +} + +// Status is the resolver for the status field. +func (r *helmReleaseResolver) Status(ctx context.Context, obj *entities.HelmRelease) (*model.GithubComKloudliteOperatorApisCrdsV1HelmChartStatus, error) { + if obj == nil { + return nil, errors.Newf("helmRelease is nil") + } + + var status model.GithubComKloudliteOperatorApisCrdsV1HelmChartStatus + if err := fn.JsonConversion(&obj.Status, &status); err != nil { + return nil, errors.NewE(err) + } + return &status, nil +} + +// UpdateTime is the resolver for the updateTime field. +func (r *helmReleaseResolver) UpdateTime(ctx context.Context, obj *entities.HelmRelease) (string, error) { + if obj == nil { + return "", errors.Newf("helmRelease is nil") + } + return obj.UpdateTime.Format(time.RFC3339), nil +} + +// Metadata is the resolver for the metadata field. +func (r *helmReleaseInResolver) Metadata(ctx context.Context, obj *entities.HelmRelease, data *v1.ObjectMeta) error { + if obj == nil { + return errors.Newf("helmRelease is nil") + } + + return fn.JsonConversion(data, &obj.ObjectMeta) +} + +// Spec is the resolver for the spec field. +func (r *helmReleaseInResolver) Spec(ctx context.Context, obj *entities.HelmRelease, data *model.GithubComKloudliteOperatorApisCrdsV1HelmChartSpecIn) error { + if obj == nil { + return errors.Newf("helmRelease is nil") + } + + return fn.JsonConversion(data, &obj.Spec) +} + +// HelmRelease returns generated.HelmReleaseResolver implementation. +func (r *Resolver) HelmRelease() generated.HelmReleaseResolver { return &helmReleaseResolver{r} } + +// HelmReleaseIn returns generated.HelmReleaseInResolver implementation. +func (r *Resolver) HelmReleaseIn() generated.HelmReleaseInResolver { return &helmReleaseInResolver{r} } + +type helmReleaseResolver struct{ *Resolver } +type helmReleaseInResolver struct{ *Resolver } diff --git a/apps/infra/internal/app/graph/masternode.resolvers.go b/apps/infra/internal/app/graph/masternode.resolvers.go deleted file mode 100644 index a740c275b..000000000 --- a/apps/infra/internal/app/graph/masternode.resolvers.go +++ /dev/null @@ -1,53 +0,0 @@ -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.28 - -import ( - "context" - - "github.com/kloudlite/operator/pkg/operator" - "kloudlite.io/apps/infra/internal/app/graph/generated" - "kloudlite.io/apps/infra/internal/app/graph/model" - "kloudlite.io/apps/infra/internal/domain/entities" - fn "kloudlite.io/pkg/functions" -) - -// Status is the resolver for the status field. -func (r *masterNodeResolver) Status(ctx context.Context, obj *entities.MasterNode) (*operator.Status, error) { - if obj == nil { - return nil, nil - } - var op operator.Status - if err := fn.JsonConversion(obj.Status, &op); err != nil { - return nil, err - } - return &op, nil -} - -// Spec is the resolver for the spec field. -func (r *masterNodeResolver) Spec(ctx context.Context, obj *entities.MasterNode) (*model.MasterNodeSpec, error) { - var m model.MasterNodeSpec - if err := fn.JsonConversion(obj.Spec, &m); err != nil { - return nil, err - } - return &m, nil -} - -// Spec is the resolver for the spec field. -func (r *masterNodeInResolver) Spec(ctx context.Context, obj *entities.MasterNode, data *model.MasterNodeSpecIn) error { - if obj == nil { - return nil - } - return fn.JsonConversion(data, &obj.Spec) -} - -// MasterNode returns generated.MasterNodeResolver implementation. -func (r *Resolver) MasterNode() generated.MasterNodeResolver { return &masterNodeResolver{r} } - -// MasterNodeIn returns generated.MasterNodeInResolver implementation. -func (r *Resolver) MasterNodeIn() generated.MasterNodeInResolver { return &masterNodeInResolver{r} } - -type masterNodeResolver struct{ *Resolver } -type masterNodeInResolver struct{ *Resolver } diff --git a/apps/infra/internal/app/graph/model/models_gen.go b/apps/infra/internal/app/graph/model/models_gen.go index f51c3185b..73bcd854c 100644 --- a/apps/infra/internal/app/graph/model/models_gen.go +++ b/apps/infra/internal/app/graph/model/models_gen.go @@ -2,166 +2,2019 @@ package model -type BYOCClusterSpec struct { - Provider string `json:"provider"` - PublicIps []*string `json:"publicIps,omitempty"` - Region string `json:"region"` - StorageClasses []*string `json:"storageClasses,omitempty"` - AccountName string `json:"accountName"` - DisplayName *string `json:"displayName,omitempty"` - IncomingKafkaTopic string `json:"incomingKafkaTopic"` - IngressClasses []*string `json:"ingressClasses,omitempty"` -} - -type BYOCClusterSpecIn struct { - Provider string `json:"provider"` - PublicIps []*string `json:"publicIps,omitempty"` - Region string `json:"region"` - StorageClasses []*string `json:"storageClasses,omitempty"` - AccountName string `json:"accountName"` - DisplayName *string `json:"displayName,omitempty"` - IncomingKafkaTopic string `json:"incomingKafkaTopic"` - IngressClasses []*string `json:"ingressClasses,omitempty"` -} - -type CloudProviderSpec struct { - DisplayName string `json:"display_name"` - Provider string `json:"provider"` - ProviderSecret *CloudProviderSpecProviderSecret `json:"providerSecret"` - AccountName string `json:"accountName"` -} - -type CloudProviderSpecIn struct { - DisplayName string `json:"display_name"` - Provider string `json:"provider"` - ProviderSecret *CloudProviderSpecProviderSecretIn `json:"providerSecret"` - AccountName string `json:"accountName"` -} - -type CloudProviderSpecProviderSecret struct { - Name string `json:"name"` - Namespace string `json:"namespace"` -} - -type CloudProviderSpecProviderSecretIn struct { - Name string `json:"name"` - Namespace string `json:"namespace"` -} - -type ClusterSpec struct { - Provider string `json:"provider"` - ProviderName string `json:"providerName"` - Region string `json:"region"` - AccountName string `json:"accountName"` - Config string `json:"config"` - Count int `json:"count"` -} - -type ClusterSpecIn struct { - Provider string `json:"provider"` - ProviderName string `json:"providerName"` - Region string `json:"region"` - AccountName string `json:"accountName"` - Config string `json:"config"` - Count int `json:"count"` -} - -type EdgeSpec struct { - AccountName string `json:"accountName"` - ClusterName string `json:"clusterName"` - Pools []*EdgeSpecPools `json:"pools,omitempty"` - Provider *string `json:"provider,omitempty"` - ProviderName string `json:"providerName"` - Region string `json:"region"` -} - -type EdgeSpecIn struct { - AccountName string `json:"accountName"` - ClusterName string `json:"clusterName"` - Pools []*EdgeSpecPoolsIn `json:"pools,omitempty"` - Provider *string `json:"provider,omitempty"` - ProviderName string `json:"providerName"` - Region string `json:"region"` -} - -type EdgeSpecPools struct { - Name string `json:"name"` - Config string `json:"config"` - Max *int `json:"max,omitempty"` - Min *int `json:"min,omitempty"` -} - -type EdgeSpecPoolsIn struct { - Name string `json:"name"` - Config string `json:"config"` - Max *int `json:"max,omitempty"` - Min *int `json:"min,omitempty"` -} - -type MasterNodeSpec struct { - Region string `json:"region"` - AccountName string `json:"accountName"` - ClusterName string `json:"clusterName"` - Config string `json:"config"` - Provider string `json:"provider"` - ProviderName string `json:"providerName"` -} - -type MasterNodeSpecIn struct { - Region string `json:"region"` - AccountName string `json:"accountName"` - ClusterName string `json:"clusterName"` - Config string `json:"config"` - Provider string `json:"provider"` - ProviderName string `json:"providerName"` -} - -type NodePoolSpec struct { - AccountName string `json:"accountName"` - Config string `json:"config"` - Max *int `json:"max,omitempty"` - ProviderName string `json:"providerName"` - Region string `json:"region"` - ClusterName string `json:"clusterName"` - EdgeName string `json:"edgeName"` - Min *int `json:"min,omitempty"` - Provider string `json:"provider"` -} - -type NodePoolSpecIn struct { - AccountName string `json:"accountName"` - Config string `json:"config"` - Max *int `json:"max,omitempty"` - ProviderName string `json:"providerName"` - Region string `json:"region"` - ClusterName string `json:"clusterName"` - EdgeName string `json:"edgeName"` - Min *int `json:"min,omitempty"` - Provider string `json:"provider"` -} - -type WorkerNodeSpec struct { - ClusterName string `json:"clusterName"` - Config string `json:"config"` - NodeIndex *int `json:"nodeIndex,omitempty"` - Pool string `json:"pool"` - Provider string `json:"provider"` - AccountName string `json:"accountName"` - EdgeName string `json:"edgeName"` - ProviderName string `json:"providerName"` - Region string `json:"region"` - Stateful *bool `json:"stateful,omitempty"` -} - -type WorkerNodeSpecIn struct { - ClusterName string `json:"clusterName"` - Config string `json:"config"` - NodeIndex *int `json:"nodeIndex,omitempty"` - Pool string `json:"pool"` - Provider string `json:"provider"` - AccountName string `json:"accountName"` - EdgeName string `json:"edgeName"` - ProviderName string `json:"providerName"` - Region string `json:"region"` - Stateful *bool `json:"stateful,omitempty"` +import ( + "fmt" + "io" + "strconv" + + "github.com/kloudlite/api/apps/infra/internal/entities" + "github.com/kloudlite/api/pkg/repos" + "github.com/kloudlite/operator/pkg/operator" + "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type CheckAwsAccessOutput struct { + Result bool `json:"result"` + InstallationURL *string `json:"installationUrl,omitempty"` +} + +type CloudProviderSecretEdge struct { + Cursor string `json:"cursor"` + Node *entities.CloudProviderSecret `json:"node"` +} + +type CloudProviderSecretPaginatedRecords struct { + Edges []*CloudProviderSecretEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +type ClusterEdge struct { + Cursor string `json:"cursor"` + Node *entities.Cluster `json:"node"` +} + +type ClusterManagedServiceEdge struct { + Cursor string `json:"cursor"` + Node *entities.ClusterManagedService `json:"node"` +} + +type ClusterManagedServicePaginatedRecords struct { + Edges []*ClusterManagedServiceEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +type ClusterPaginatedRecords struct { + Edges []*ClusterEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +type DomainEntryEdge struct { + Cursor string `json:"cursor"` + Node *entities.DomainEntry `json:"node"` +} + +type DomainEntryPaginatedRecords struct { + Edges []*DomainEntryEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +type EncodedValue struct { + Value string `json:"value"` + Encoding string `json:"encoding"` +} + +type GithubComKloudliteAPIAppsInfraInternalEntitiesAWSSecretCredentials struct { + AccessKey *string `json:"accessKey,omitempty"` + AwsAccountID *string `json:"awsAccountId,omitempty"` + CfParamExternalID *string `json:"cfParamExternalID,omitempty"` + CfParamInstanceProfileName *string `json:"cfParamInstanceProfileName,omitempty"` + CfParamRoleName *string `json:"cfParamRoleName,omitempty"` + CfParamStackName *string `json:"cfParamStackName,omitempty"` + CfParamTrustedArn *string `json:"cfParamTrustedARN,omitempty"` + SecretKey *string `json:"secretKey,omitempty"` +} + +type GithubComKloudliteAPIAppsInfraInternalEntitiesAWSSecretCredentialsIn struct { + AccessKey *string `json:"accessKey,omitempty"` + AwsAccountID *string `json:"awsAccountId,omitempty"` + SecretKey *string `json:"secretKey,omitempty"` +} + +type GithubComKloudliteAPIAppsInfraInternalEntitiesInputField struct { + DefaultValue interface{} `json:"defaultValue,omitempty"` + DisplayUnit *string `json:"displayUnit,omitempty"` + InputType string `json:"inputType"` + Label string `json:"label"` + Max *float64 `json:"max,omitempty"` + Min *float64 `json:"min,omitempty"` + Multiplier *float64 `json:"multiplier,omitempty"` + Name string `json:"name"` + Required *bool `json:"required,omitempty"` + Unit *string `json:"unit,omitempty"` +} + +type GithubComKloudliteAPIAppsInfraInternalEntitiesMresTemplate struct { + APIVersion *string `json:"apiVersion,omitempty"` + Description string `json:"description"` + DisplayName string `json:"displayName"` + Fields []*GithubComKloudliteAPIAppsInfraInternalEntitiesInputField `json:"fields"` + Kind *string `json:"kind,omitempty"` + Name string `json:"name"` + Outputs []*GithubComKloudliteAPIAppsInfraInternalEntitiesOutputField `json:"outputs"` +} + +type GithubComKloudliteAPIAppsInfraInternalEntitiesOutputField struct { + Description string `json:"description"` + Label string `json:"label"` + Name string `json:"name"` +} + +type GithubComKloudliteOperatorApisClustersV1AWSClusterConfig struct { + K3sMasters *GithubComKloudliteOperatorApisClustersV1AWSK3sMastersConfig `json:"k3sMasters,omitempty"` + NodePools map[string]interface{} `json:"nodePools,omitempty"` + Region string `json:"region"` + SpotNodePools map[string]interface{} `json:"spotNodePools,omitempty"` +} + +type GithubComKloudliteOperatorApisClustersV1AWSClusterConfigIn struct { + K3sMasters *GithubComKloudliteOperatorApisClustersV1AWSK3sMastersConfigIn `json:"k3sMasters,omitempty"` + Region string `json:"region"` +} + +type GithubComKloudliteOperatorApisClustersV1AWSK3sMastersConfig struct { + IamInstanceProfileRole *string `json:"iamInstanceProfileRole,omitempty"` + ImageID string `json:"imageId"` + ImageSSHUsername string `json:"imageSSHUsername"` + InstanceType string `json:"instanceType"` + Nodes map[string]interface{} `json:"nodes,omitempty"` + NvidiaGpuEnabled bool `json:"nvidiaGpuEnabled"` + RootVolumeSize int `json:"rootVolumeSize"` + RootVolumeType string `json:"rootVolumeType"` +} + +type GithubComKloudliteOperatorApisClustersV1AWSK3sMastersConfigIn struct { + InstanceType string `json:"instanceType"` + NvidiaGpuEnabled bool `json:"nvidiaGpuEnabled"` +} + +type GithubComKloudliteOperatorApisClustersV1AWSNodePoolConfig struct { + AvailabilityZone string `json:"availabilityZone"` + Ec2Pool *GithubComKloudliteOperatorApisClustersV1AwsEC2PoolConfig `json:"ec2Pool,omitempty"` + IamInstanceProfileRole *string `json:"iamInstanceProfileRole,omitempty"` + ImageID string `json:"imageId"` + ImageSSHUsername string `json:"imageSSHUsername"` + NvidiaGpuEnabled bool `json:"nvidiaGpuEnabled"` + PoolType GithubComKloudliteOperatorApisClustersV1AWSPoolType `json:"poolType"` + RootVolumeSize int `json:"rootVolumeSize"` + RootVolumeType string `json:"rootVolumeType"` + SpotPool *GithubComKloudliteOperatorApisClustersV1AwsSpotPoolConfig `json:"spotPool,omitempty"` +} + +type GithubComKloudliteOperatorApisClustersV1AWSNodePoolConfigIn struct { + AvailabilityZone string `json:"availabilityZone"` + Ec2Pool *GithubComKloudliteOperatorApisClustersV1AwsEC2PoolConfigIn `json:"ec2Pool,omitempty"` + NvidiaGpuEnabled bool `json:"nvidiaGpuEnabled"` + PoolType GithubComKloudliteOperatorApisClustersV1AWSPoolType `json:"poolType"` + SpotPool *GithubComKloudliteOperatorApisClustersV1AwsSpotPoolConfigIn `json:"spotPool,omitempty"` +} + +type GithubComKloudliteOperatorApisClustersV1AwsEC2PoolConfig struct { + InstanceType string `json:"instanceType"` + Nodes map[string]interface{} `json:"nodes,omitempty"` +} + +type GithubComKloudliteOperatorApisClustersV1AwsEC2PoolConfigIn struct { + InstanceType string `json:"instanceType"` + Nodes map[string]interface{} `json:"nodes,omitempty"` +} + +type GithubComKloudliteOperatorApisClustersV1AwsSpotCPUNode struct { + MemoryPerVcpu *GithubComKloudliteOperatorApisCommonTypesMinMaxFloat `json:"memoryPerVcpu,omitempty"` + Vcpu *GithubComKloudliteOperatorApisCommonTypesMinMaxFloat `json:"vcpu"` +} + +type GithubComKloudliteOperatorApisClustersV1AwsSpotCPUNodeIn struct { + MemoryPerVcpu *GithubComKloudliteOperatorApisCommonTypesMinMaxFloatIn `json:"memoryPerVcpu,omitempty"` + Vcpu *GithubComKloudliteOperatorApisCommonTypesMinMaxFloatIn `json:"vcpu"` +} + +type GithubComKloudliteOperatorApisClustersV1AwsSpotGpuNode struct { + InstanceTypes []string `json:"instanceTypes"` +} + +type GithubComKloudliteOperatorApisClustersV1AwsSpotGpuNodeIn struct { + InstanceTypes []string `json:"instanceTypes"` +} + +type GithubComKloudliteOperatorApisClustersV1AwsSpotPoolConfig struct { + CPUNode *GithubComKloudliteOperatorApisClustersV1AwsSpotCPUNode `json:"cpuNode,omitempty"` + GpuNode *GithubComKloudliteOperatorApisClustersV1AwsSpotGpuNode `json:"gpuNode,omitempty"` + Nodes map[string]interface{} `json:"nodes,omitempty"` + SpotFleetTaggingRoleName string `json:"spotFleetTaggingRoleName"` +} + +type GithubComKloudliteOperatorApisClustersV1AwsSpotPoolConfigIn struct { + CPUNode *GithubComKloudliteOperatorApisClustersV1AwsSpotCPUNodeIn `json:"cpuNode,omitempty"` + GpuNode *GithubComKloudliteOperatorApisClustersV1AwsSpotGpuNodeIn `json:"gpuNode,omitempty"` + Nodes map[string]interface{} `json:"nodes,omitempty"` +} + +type GithubComKloudliteOperatorApisClustersV1CloudProviderCredentialKeys struct { + KeyAccessKey string `json:"keyAccessKey"` + KeyAWSAccountID string `json:"keyAWSAccountId"` + KeyAWSAssumeRoleExternalID string `json:"keyAWSAssumeRoleExternalID"` + KeyAWSAssumeRoleRoleArn string `json:"keyAWSAssumeRoleRoleARN"` + KeyIAMInstanceProfileRole string `json:"keyIAMInstanceProfileRole"` + KeySecretKey string `json:"keySecretKey"` +} + +type GithubComKloudliteOperatorApisClustersV1ClusterOutput struct { + JobName string `json:"jobName"` + JobNamespace string `json:"jobNamespace"` + KeyK3sAgentJoinToken string `json:"keyK3sAgentJoinToken"` + KeyK3sServerJoinToken string `json:"keyK3sServerJoinToken"` + KeyKubeconfig string `json:"keyKubeconfig"` + SecretName string `json:"secretName"` +} + +type GithubComKloudliteOperatorApisClustersV1ClusterSpec struct { + AccountID string `json:"accountId"` + AccountName string `json:"accountName"` + AvailabilityMode GithubComKloudliteOperatorApisClustersV1ClusterSpecAvailabilityMode `json:"availabilityMode"` + Aws *GithubComKloudliteOperatorApisClustersV1AWSClusterConfig `json:"aws,omitempty"` + BackupToS3Enabled bool `json:"backupToS3Enabled"` + CloudflareEnabled *bool `json:"cloudflareEnabled,omitempty"` + CloudProvider GithubComKloudliteOperatorApisCommonTypesCloudProvider `json:"cloudProvider"` + ClusterInternalDNSHost *string `json:"clusterInternalDnsHost,omitempty"` + ClusterTokenRef *GithubComKloudliteOperatorApisCommonTypesSecretKeyRef `json:"clusterTokenRef,omitempty"` + CredentialKeys *GithubComKloudliteOperatorApisClustersV1CloudProviderCredentialKeys `json:"credentialKeys,omitempty"` + CredentialsRef *GithubComKloudliteOperatorApisCommonTypesSecretRef `json:"credentialsRef"` + KloudliteRelease string `json:"kloudliteRelease"` + MessageQueueTopicName string `json:"messageQueueTopicName"` + Output *GithubComKloudliteOperatorApisClustersV1ClusterOutput `json:"output,omitempty"` + PublicDNSHost string `json:"publicDNSHost"` + TaintMasterNodes bool `json:"taintMasterNodes"` +} + +type GithubComKloudliteOperatorApisClustersV1ClusterSpecIn struct { + AvailabilityMode GithubComKloudliteOperatorApisClustersV1ClusterSpecAvailabilityMode `json:"availabilityMode"` + Aws *GithubComKloudliteOperatorApisClustersV1AWSClusterConfigIn `json:"aws,omitempty"` + CloudflareEnabled *bool `json:"cloudflareEnabled,omitempty"` + CloudProvider GithubComKloudliteOperatorApisCommonTypesCloudProvider `json:"cloudProvider"` + CredentialsRef *GithubComKloudliteOperatorApisCommonTypesSecretRefIn `json:"credentialsRef"` +} + +type GithubComKloudliteOperatorApisClustersV1InfrastuctureAsCode struct { + CloudProviderAccessKey *GithubComKloudliteOperatorApisCommonTypesSecretKeyRef `json:"cloudProviderAccessKey"` + CloudProviderSecretKey *GithubComKloudliteOperatorApisCommonTypesSecretKeyRef `json:"cloudProviderSecretKey"` + JobName *string `json:"jobName,omitempty"` + JobNamespace *string `json:"jobNamespace,omitempty"` + StateS3BucketFilePath string `json:"stateS3BucketFilePath"` + StateS3BucketName string `json:"stateS3BucketName"` + StateS3BucketRegion string `json:"stateS3BucketRegion"` +} + +type GithubComKloudliteOperatorApisClustersV1MasterNodeProps struct { + AvailabilityZone string `json:"availabilityZone"` + LastRecreatedAt *string `json:"lastRecreatedAt,omitempty"` + Role string `json:"role"` +} + +type GithubComKloudliteOperatorApisClustersV1NodePoolSpec struct { + Aws *GithubComKloudliteOperatorApisClustersV1AWSNodePoolConfig `json:"aws,omitempty"` + CloudProvider GithubComKloudliteOperatorApisCommonTypesCloudProvider `json:"cloudProvider"` + Iac *GithubComKloudliteOperatorApisClustersV1InfrastuctureAsCode `json:"iac"` + MaxCount int `json:"maxCount"` + MinCount int `json:"minCount"` + NodeLabels map[string]interface{} `json:"nodeLabels,omitempty"` + NodeTaints []*K8sIoAPICoreV1Taint `json:"nodeTaints,omitempty"` +} + +type GithubComKloudliteOperatorApisClustersV1NodePoolSpecIn struct { + Aws *GithubComKloudliteOperatorApisClustersV1AWSNodePoolConfigIn `json:"aws,omitempty"` + CloudProvider GithubComKloudliteOperatorApisCommonTypesCloudProvider `json:"cloudProvider"` + MaxCount int `json:"maxCount"` + MinCount int `json:"minCount"` + NodeLabels map[string]interface{} `json:"nodeLabels,omitempty"` + NodeTaints []*K8sIoAPICoreV1TaintIn `json:"nodeTaints,omitempty"` +} + +type GithubComKloudliteOperatorApisClustersV1NodeProps struct { + LastRecreatedAt *string `json:"lastRecreatedAt,omitempty"` +} + +type GithubComKloudliteOperatorApisClustersV1NodePropsIn struct { + LastRecreatedAt *string `json:"lastRecreatedAt,omitempty"` +} + +type GithubComKloudliteOperatorApisClustersV1NodeSpec struct { + NodepoolName string `json:"nodepoolName"` +} + +type GithubComKloudliteOperatorApisClustersV1NodeSpecIn struct { + NodepoolName string `json:"nodepoolName"` +} + +type GithubComKloudliteOperatorApisCommonTypesMinMaxFloat struct { + Max string `json:"max"` + Min string `json:"min"` +} + +type GithubComKloudliteOperatorApisCommonTypesMinMaxFloatIn struct { + Max string `json:"max"` + Min string `json:"min"` +} + +type GithubComKloudliteOperatorApisCommonTypesSecretKeyRef struct { + Key string `json:"key"` + Name string `json:"name"` + Namespace *string `json:"namespace,omitempty"` +} + +type GithubComKloudliteOperatorApisCommonTypesSecretRef struct { + Name string `json:"name"` + Namespace *string `json:"namespace,omitempty"` +} + +type GithubComKloudliteOperatorApisCommonTypesSecretRefIn struct { + Name string `json:"name"` + Namespace *string `json:"namespace,omitempty"` +} + +type GithubComKloudliteOperatorApisCrdsV1ClusterManagedServiceSpec struct { + MsvcSpec *GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpec `json:"msvcSpec"` + TargetNamespace string `json:"targetNamespace"` +} + +type GithubComKloudliteOperatorApisCrdsV1ClusterManagedServiceSpecIn struct { + MsvcSpec *GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpecIn `json:"msvcSpec"` + TargetNamespace string `json:"targetNamespace"` +} + +type GithubComKloudliteOperatorApisCrdsV1HelmChartSpec struct { + ChartName string `json:"chartName"` + ChartRepoURL string `json:"chartRepoURL"` + ChartVersion string `json:"chartVersion"` + JobVars *GithubComKloudliteOperatorApisCrdsV1JobVars `json:"jobVars,omitempty"` + PostInstall *string `json:"postInstall,omitempty"` + PostUninstall *string `json:"postUninstall,omitempty"` + PreInstall *string `json:"preInstall,omitempty"` + PreUninstall *string `json:"preUninstall,omitempty"` + Values map[string]interface{} `json:"values"` +} + +type GithubComKloudliteOperatorApisCrdsV1HelmChartSpecIn struct { + ChartName string `json:"chartName"` + ChartRepoURL string `json:"chartRepoURL"` + ChartVersion string `json:"chartVersion"` + JobVars *GithubComKloudliteOperatorApisCrdsV1JobVarsIn `json:"jobVars,omitempty"` + PostInstall *string `json:"postInstall,omitempty"` + PostUninstall *string `json:"postUninstall,omitempty"` + PreInstall *string `json:"preInstall,omitempty"` + PreUninstall *string `json:"preUninstall,omitempty"` + Values map[string]interface{} `json:"values"` +} + +type GithubComKloudliteOperatorApisCrdsV1HelmChartStatus struct { + Checks map[string]interface{} `json:"checks,omitempty"` + IsReady bool `json:"isReady"` + LastReadyGeneration *int `json:"lastReadyGeneration,omitempty"` + LastReconcileTime *string `json:"lastReconcileTime,omitempty"` + Message *GithubComKloudliteOperatorPkgRawJSONRawJSON `json:"message,omitempty"` + ReleaseNotes string `json:"releaseNotes"` + ReleaseStatus string `json:"releaseStatus"` + Resources []*operator.ResourceRef `json:"resources,omitempty"` +} + +type GithubComKloudliteOperatorApisCrdsV1JobVars struct { + Affinity *K8sIoAPICoreV1Affinity `json:"affinity,omitempty"` + BackOffLimit *int `json:"backOffLimit,omitempty"` + NodeSelector map[string]interface{} `json:"nodeSelector,omitempty"` + Tolerations []*K8sIoAPICoreV1Toleration `json:"tolerations,omitempty"` +} + +type GithubComKloudliteOperatorApisCrdsV1JobVarsIn struct { + Affinity *K8sIoAPICoreV1AffinityIn `json:"affinity,omitempty"` + BackOffLimit *int `json:"backOffLimit,omitempty"` + NodeSelector map[string]interface{} `json:"nodeSelector,omitempty"` + Tolerations []*K8sIoAPICoreV1TolerationIn `json:"tolerations,omitempty"` +} + +type GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpec struct { + ServiceTemplate *GithubComKloudliteOperatorApisCrdsV1ServiceTemplate `json:"serviceTemplate"` +} + +type GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpecIn struct { + ServiceTemplate *GithubComKloudliteOperatorApisCrdsV1ServiceTemplateIn `json:"serviceTemplate"` +} + +type GithubComKloudliteOperatorApisCrdsV1ServiceTemplate struct { + APIVersion string `json:"apiVersion"` + Kind string `json:"kind"` + Spec map[string]interface{} `json:"spec"` +} + +type GithubComKloudliteOperatorApisCrdsV1ServiceTemplateIn struct { + APIVersion string `json:"apiVersion"` + Kind string `json:"kind"` + Spec map[string]interface{} `json:"spec"` +} + +type GithubComKloudliteOperatorPkgRawJSONRawJSON struct { + RawMessage interface{} `json:"RawMessage,omitempty"` +} + +type HelmReleaseEdge struct { + Cursor string `json:"cursor"` + Node *entities.HelmRelease `json:"node"` +} + +type HelmReleasePaginatedRecords struct { + Edges []*HelmReleaseEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +type K8sIoAPICoreV1AWSElasticBlockStoreVolumeSource struct { + FsType *string `json:"fsType,omitempty"` + Partition *int `json:"partition,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + VolumeID string `json:"volumeID"` +} + +type K8sIoAPICoreV1AWSElasticBlockStoreVolumeSourceIn struct { + FsType *string `json:"fsType,omitempty"` + Partition *int `json:"partition,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + VolumeID string `json:"volumeID"` +} + +type K8sIoAPICoreV1Affinity struct { + NodeAffinity *K8sIoAPICoreV1NodeAffinity `json:"nodeAffinity,omitempty"` + PodAffinity *K8sIoAPICoreV1PodAffinity `json:"podAffinity,omitempty"` + PodAntiAffinity *K8sIoAPICoreV1PodAntiAffinity `json:"podAntiAffinity,omitempty"` +} + +type K8sIoAPICoreV1AffinityIn struct { + NodeAffinity *K8sIoAPICoreV1NodeAffinityIn `json:"nodeAffinity,omitempty"` + PodAffinity *K8sIoAPICoreV1PodAffinityIn `json:"podAffinity,omitempty"` + PodAntiAffinity *K8sIoAPICoreV1PodAntiAffinityIn `json:"podAntiAffinity,omitempty"` +} + +type K8sIoAPICoreV1AzureDiskVolumeSource struct { + CachingMode *string `json:"cachingMode,omitempty"` + DiskName string `json:"diskName"` + DiskURI string `json:"diskURI"` + FsType *string `json:"fsType,omitempty"` + Kind *string `json:"kind,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` +} + +type K8sIoAPICoreV1AzureDiskVolumeSourceIn struct { + CachingMode *string `json:"cachingMode,omitempty"` + DiskName string `json:"diskName"` + DiskURI string `json:"diskURI"` + FsType *string `json:"fsType,omitempty"` + Kind *string `json:"kind,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` +} + +type K8sIoAPICoreV1AzureFilePersistentVolumeSource struct { + ReadOnly *bool `json:"readOnly,omitempty"` + SecretName string `json:"secretName"` + SecretNamespace *string `json:"secretNamespace,omitempty"` + ShareName string `json:"shareName"` +} + +type K8sIoAPICoreV1AzureFilePersistentVolumeSourceIn struct { + ReadOnly *bool `json:"readOnly,omitempty"` + SecretName string `json:"secretName"` + SecretNamespace *string `json:"secretNamespace,omitempty"` + ShareName string `json:"shareName"` +} + +type K8sIoAPICoreV1CSIPersistentVolumeSource struct { + ControllerExpandSecretRef *K8sIoAPICoreV1SecretReference `json:"controllerExpandSecretRef,omitempty"` + ControllerPublishSecretRef *K8sIoAPICoreV1SecretReference `json:"controllerPublishSecretRef,omitempty"` + Driver string `json:"driver"` + FsType *string `json:"fsType,omitempty"` + NodeExpandSecretRef *K8sIoAPICoreV1SecretReference `json:"nodeExpandSecretRef,omitempty"` + NodePublishSecretRef *K8sIoAPICoreV1SecretReference `json:"nodePublishSecretRef,omitempty"` + NodeStageSecretRef *K8sIoAPICoreV1SecretReference `json:"nodeStageSecretRef,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + VolumeAttributes map[string]interface{} `json:"volumeAttributes,omitempty"` + VolumeHandle string `json:"volumeHandle"` +} + +type K8sIoAPICoreV1CSIPersistentVolumeSourceIn struct { + ControllerExpandSecretRef *K8sIoAPICoreV1SecretReferenceIn `json:"controllerExpandSecretRef,omitempty"` + ControllerPublishSecretRef *K8sIoAPICoreV1SecretReferenceIn `json:"controllerPublishSecretRef,omitempty"` + Driver string `json:"driver"` + FsType *string `json:"fsType,omitempty"` + NodeExpandSecretRef *K8sIoAPICoreV1SecretReferenceIn `json:"nodeExpandSecretRef,omitempty"` + NodePublishSecretRef *K8sIoAPICoreV1SecretReferenceIn `json:"nodePublishSecretRef,omitempty"` + NodeStageSecretRef *K8sIoAPICoreV1SecretReferenceIn `json:"nodeStageSecretRef,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + VolumeAttributes map[string]interface{} `json:"volumeAttributes,omitempty"` + VolumeHandle string `json:"volumeHandle"` +} + +type K8sIoAPICoreV1CephFSPersistentVolumeSource struct { + Monitors []string `json:"monitors"` + Path *string `json:"path,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + SecretFile *string `json:"secretFile,omitempty"` + SecretRef *K8sIoAPICoreV1SecretReference `json:"secretRef,omitempty"` + User *string `json:"user,omitempty"` +} + +type K8sIoAPICoreV1CephFSPersistentVolumeSourceIn struct { + Monitors []string `json:"monitors"` + Path *string `json:"path,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + SecretFile *string `json:"secretFile,omitempty"` + SecretRef *K8sIoAPICoreV1SecretReferenceIn `json:"secretRef,omitempty"` + User *string `json:"user,omitempty"` +} + +type K8sIoAPICoreV1CinderPersistentVolumeSource struct { + FsType *string `json:"fsType,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + SecretRef *K8sIoAPICoreV1SecretReference `json:"secretRef,omitempty"` + VolumeID string `json:"volumeID"` +} + +type K8sIoAPICoreV1CinderPersistentVolumeSourceIn struct { + FsType *string `json:"fsType,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + SecretRef *K8sIoAPICoreV1SecretReferenceIn `json:"secretRef,omitempty"` + VolumeID string `json:"volumeID"` +} + +type K8sIoAPICoreV1FCVolumeSource struct { + FsType *string `json:"fsType,omitempty"` + Lun *int `json:"lun,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + TargetWWNs []string `json:"targetWWNs,omitempty"` + Wwids []string `json:"wwids,omitempty"` +} + +type K8sIoAPICoreV1FCVolumeSourceIn struct { + FsType *string `json:"fsType,omitempty"` + Lun *int `json:"lun,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + TargetWWNs []string `json:"targetWWNs,omitempty"` + Wwids []string `json:"wwids,omitempty"` +} + +type K8sIoAPICoreV1FlexPersistentVolumeSource struct { + Driver string `json:"driver"` + FsType *string `json:"fsType,omitempty"` + Options map[string]interface{} `json:"options,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + SecretRef *K8sIoAPICoreV1SecretReference `json:"secretRef,omitempty"` +} + +type K8sIoAPICoreV1FlexPersistentVolumeSourceIn struct { + Driver string `json:"driver"` + FsType *string `json:"fsType,omitempty"` + Options map[string]interface{} `json:"options,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + SecretRef *K8sIoAPICoreV1SecretReferenceIn `json:"secretRef,omitempty"` +} + +type K8sIoAPICoreV1FlockerVolumeSource struct { + DatasetName *string `json:"datasetName,omitempty"` + DatasetUUID *string `json:"datasetUUID,omitempty"` +} + +type K8sIoAPICoreV1FlockerVolumeSourceIn struct { + DatasetName *string `json:"datasetName,omitempty"` + DatasetUUID *string `json:"datasetUUID,omitempty"` +} + +type K8sIoAPICoreV1GCEPersistentDiskVolumeSource struct { + FsType *string `json:"fsType,omitempty"` + Partition *int `json:"partition,omitempty"` + PdName string `json:"pdName"` + ReadOnly *bool `json:"readOnly,omitempty"` +} + +type K8sIoAPICoreV1GCEPersistentDiskVolumeSourceIn struct { + FsType *string `json:"fsType,omitempty"` + Partition *int `json:"partition,omitempty"` + PdName string `json:"pdName"` + ReadOnly *bool `json:"readOnly,omitempty"` +} + +type K8sIoAPICoreV1GlusterfsPersistentVolumeSource struct { + Endpoints string `json:"endpoints"` + EndpointsNamespace *string `json:"endpointsNamespace,omitempty"` + Path string `json:"path"` + ReadOnly *bool `json:"readOnly,omitempty"` +} + +type K8sIoAPICoreV1GlusterfsPersistentVolumeSourceIn struct { + Endpoints string `json:"endpoints"` + EndpointsNamespace *string `json:"endpointsNamespace,omitempty"` + Path string `json:"path"` + ReadOnly *bool `json:"readOnly,omitempty"` +} + +type K8sIoAPICoreV1HostPathVolumeSource struct { + Path string `json:"path"` + Type *string `json:"type,omitempty"` +} + +type K8sIoAPICoreV1HostPathVolumeSourceIn struct { + Path string `json:"path"` + Type *string `json:"type,omitempty"` +} + +type K8sIoAPICoreV1ISCSIPersistentVolumeSource struct { + ChapAuthDiscovery *bool `json:"chapAuthDiscovery,omitempty"` + ChapAuthSession *bool `json:"chapAuthSession,omitempty"` + FsType *string `json:"fsType,omitempty"` + InitiatorName *string `json:"initiatorName,omitempty"` + Iqn string `json:"iqn"` + IscsiInterface *string `json:"iscsiInterface,omitempty"` + Lun int `json:"lun"` + Portals []string `json:"portals,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + SecretRef *K8sIoAPICoreV1SecretReference `json:"secretRef,omitempty"` + TargetPortal string `json:"targetPortal"` +} + +type K8sIoAPICoreV1ISCSIPersistentVolumeSourceIn struct { + ChapAuthDiscovery *bool `json:"chapAuthDiscovery,omitempty"` + ChapAuthSession *bool `json:"chapAuthSession,omitempty"` + FsType *string `json:"fsType,omitempty"` + InitiatorName *string `json:"initiatorName,omitempty"` + Iqn string `json:"iqn"` + IscsiInterface *string `json:"iscsiInterface,omitempty"` + Lun int `json:"lun"` + Portals []string `json:"portals,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + SecretRef *K8sIoAPICoreV1SecretReferenceIn `json:"secretRef,omitempty"` + TargetPortal string `json:"targetPortal"` +} + +type K8sIoAPICoreV1LocalVolumeSource struct { + FsType *string `json:"fsType,omitempty"` + Path string `json:"path"` +} + +type K8sIoAPICoreV1LocalVolumeSourceIn struct { + FsType *string `json:"fsType,omitempty"` + Path string `json:"path"` +} + +type K8sIoAPICoreV1NFSVolumeSource struct { + Path string `json:"path"` + ReadOnly *bool `json:"readOnly,omitempty"` + Server string `json:"server"` +} + +type K8sIoAPICoreV1NFSVolumeSourceIn struct { + Path string `json:"path"` + ReadOnly *bool `json:"readOnly,omitempty"` + Server string `json:"server"` +} + +type K8sIoAPICoreV1NamespaceCondition struct { + LastTransitionTime *string `json:"lastTransitionTime,omitempty"` + Message *string `json:"message,omitempty"` + Reason *string `json:"reason,omitempty"` + Status K8sIoAPICoreV1ConditionStatus `json:"status"` + Type K8sIoAPICoreV1NamespaceConditionType `json:"type"` +} + +type K8sIoAPICoreV1NamespaceConditionIn struct { + LastTransitionTime *string `json:"lastTransitionTime,omitempty"` + Message *string `json:"message,omitempty"` + Reason *string `json:"reason,omitempty"` + Status K8sIoAPICoreV1ConditionStatus `json:"status"` + Type K8sIoAPICoreV1NamespaceConditionType `json:"type"` +} + +type K8sIoAPICoreV1NamespaceSpec struct { + Finalizers []string `json:"finalizers,omitempty"` +} + +type K8sIoAPICoreV1NamespaceSpecIn struct { + Finalizers []string `json:"finalizers,omitempty"` +} + +type K8sIoAPICoreV1NamespaceStatus struct { + Conditions []*K8sIoAPICoreV1NamespaceCondition `json:"conditions,omitempty"` + Phase *K8sIoAPICoreV1NamespacePhase `json:"phase,omitempty"` +} + +type K8sIoAPICoreV1NamespaceStatusIn struct { + Conditions []*K8sIoAPICoreV1NamespaceConditionIn `json:"conditions,omitempty"` + Phase *K8sIoAPICoreV1NamespacePhase `json:"phase,omitempty"` +} + +type K8sIoAPICoreV1NodeAffinity struct { + PreferredDuringSchedulingIgnoredDuringExecution []*K8sIoAPICoreV1PreferredSchedulingTerm `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"` + RequiredDuringSchedulingIgnoredDuringExecution *K8sIoAPICoreV1NodeSelector `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"` +} + +type K8sIoAPICoreV1NodeAffinityIn struct { + PreferredDuringSchedulingIgnoredDuringExecution []*K8sIoAPICoreV1PreferredSchedulingTermIn `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"` + RequiredDuringSchedulingIgnoredDuringExecution *K8sIoAPICoreV1NodeSelectorIn `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"` +} + +type K8sIoAPICoreV1NodeSelector struct { + NodeSelectorTerms []*K8sIoAPICoreV1NodeSelectorTerm `json:"nodeSelectorTerms"` +} + +type K8sIoAPICoreV1NodeSelectorIn struct { + NodeSelectorTerms []*K8sIoAPICoreV1NodeSelectorTermIn `json:"nodeSelectorTerms"` +} + +type K8sIoAPICoreV1NodeSelectorRequirement struct { + Key string `json:"key"` + Operator K8sIoAPICoreV1NodeSelectorOperator `json:"operator"` + Values []string `json:"values,omitempty"` +} + +type K8sIoAPICoreV1NodeSelectorRequirementIn struct { + Key string `json:"key"` + Operator K8sIoAPICoreV1NodeSelectorOperator `json:"operator"` + Values []string `json:"values,omitempty"` +} + +type K8sIoAPICoreV1NodeSelectorTerm struct { + MatchExpressions []*K8sIoAPICoreV1NodeSelectorRequirement `json:"matchExpressions,omitempty"` + MatchFields []*K8sIoAPICoreV1NodeSelectorRequirement `json:"matchFields,omitempty"` +} + +type K8sIoAPICoreV1NodeSelectorTermIn struct { + MatchExpressions []*K8sIoAPICoreV1NodeSelectorRequirementIn `json:"matchExpressions,omitempty"` + MatchFields []*K8sIoAPICoreV1NodeSelectorRequirementIn `json:"matchFields,omitempty"` +} + +type K8sIoAPICoreV1ObjectReference struct { + APIVersion *string `json:"apiVersion,omitempty"` + FieldPath *string `json:"fieldPath,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Namespace *string `json:"namespace,omitempty"` + ResourceVersion *string `json:"resourceVersion,omitempty"` + UID *string `json:"uid,omitempty"` +} + +type K8sIoAPICoreV1ObjectReferenceIn struct { + APIVersion *string `json:"apiVersion,omitempty"` + FieldPath *string `json:"fieldPath,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Namespace *string `json:"namespace,omitempty"` + ResourceVersion *string `json:"resourceVersion,omitempty"` + UID *string `json:"uid,omitempty"` +} + +type K8sIoAPICoreV1PersistentVolumeClaimCondition struct { + LastProbeTime *string `json:"lastProbeTime,omitempty"` + LastTransitionTime *string `json:"lastTransitionTime,omitempty"` + Message *string `json:"message,omitempty"` + Reason *string `json:"reason,omitempty"` + Status K8sIoAPICoreV1ConditionStatus `json:"status"` + Type K8sIoAPICoreV1PersistentVolumeClaimConditionType `json:"type"` +} + +type K8sIoAPICoreV1PersistentVolumeClaimConditionIn struct { + LastProbeTime *string `json:"lastProbeTime,omitempty"` + LastTransitionTime *string `json:"lastTransitionTime,omitempty"` + Message *string `json:"message,omitempty"` + Reason *string `json:"reason,omitempty"` + Status K8sIoAPICoreV1ConditionStatus `json:"status"` + Type K8sIoAPICoreV1PersistentVolumeClaimConditionType `json:"type"` +} + +type K8sIoAPICoreV1PersistentVolumeClaimSpec struct { + AccessModes []string `json:"accessModes,omitempty"` + DataSource *K8sIoAPICoreV1TypedLocalObjectReference `json:"dataSource,omitempty"` + DataSourceRef *K8sIoAPICoreV1TypedObjectReference `json:"dataSourceRef,omitempty"` + Resources *K8sIoAPICoreV1ResourceRequirements `json:"resources,omitempty"` + Selector *K8sIoApimachineryPkgApisMetaV1LabelSelector `json:"selector,omitempty"` + StorageClassName *string `json:"storageClassName,omitempty"` + VolumeMode *string `json:"volumeMode,omitempty"` + VolumeName *string `json:"volumeName,omitempty"` +} + +type K8sIoAPICoreV1PersistentVolumeClaimSpecIn struct { + AccessModes []string `json:"accessModes,omitempty"` + DataSource *K8sIoAPICoreV1TypedLocalObjectReferenceIn `json:"dataSource,omitempty"` + DataSourceRef *K8sIoAPICoreV1TypedObjectReferenceIn `json:"dataSourceRef,omitempty"` + Resources *K8sIoAPICoreV1ResourceRequirementsIn `json:"resources,omitempty"` + Selector *K8sIoApimachineryPkgApisMetaV1LabelSelectorIn `json:"selector,omitempty"` + StorageClassName *string `json:"storageClassName,omitempty"` + VolumeMode *string `json:"volumeMode,omitempty"` + VolumeName *string `json:"volumeName,omitempty"` +} + +type K8sIoAPICoreV1PersistentVolumeClaimStatus struct { + AccessModes []string `json:"accessModes,omitempty"` + AllocatedResources map[string]interface{} `json:"allocatedResources,omitempty"` + AllocatedResourceStatuses map[string]interface{} `json:"allocatedResourceStatuses,omitempty"` + Capacity map[string]interface{} `json:"capacity,omitempty"` + Conditions []*K8sIoAPICoreV1PersistentVolumeClaimCondition `json:"conditions,omitempty"` + Phase *K8sIoAPICoreV1PersistentVolumeClaimPhase `json:"phase,omitempty"` +} + +type K8sIoAPICoreV1PersistentVolumeClaimStatusIn struct { + AccessModes []string `json:"accessModes,omitempty"` + AllocatedResources map[string]interface{} `json:"allocatedResources,omitempty"` + AllocatedResourceStatuses map[string]interface{} `json:"allocatedResourceStatuses,omitempty"` + Capacity map[string]interface{} `json:"capacity,omitempty"` + Conditions []*K8sIoAPICoreV1PersistentVolumeClaimConditionIn `json:"conditions,omitempty"` + Phase *K8sIoAPICoreV1PersistentVolumeClaimPhase `json:"phase,omitempty"` +} + +type K8sIoAPICoreV1PersistentVolumeSpec struct { + AccessModes []string `json:"accessModes,omitempty"` + AwsElasticBlockStore *K8sIoAPICoreV1AWSElasticBlockStoreVolumeSource `json:"awsElasticBlockStore,omitempty"` + AzureDisk *K8sIoAPICoreV1AzureDiskVolumeSource `json:"azureDisk,omitempty"` + AzureFile *K8sIoAPICoreV1AzureFilePersistentVolumeSource `json:"azureFile,omitempty"` + Capacity map[string]interface{} `json:"capacity,omitempty"` + Cephfs *K8sIoAPICoreV1CephFSPersistentVolumeSource `json:"cephfs,omitempty"` + Cinder *K8sIoAPICoreV1CinderPersistentVolumeSource `json:"cinder,omitempty"` + ClaimRef *K8sIoAPICoreV1ObjectReference `json:"claimRef,omitempty"` + Csi *K8sIoAPICoreV1CSIPersistentVolumeSource `json:"csi,omitempty"` + Fc *K8sIoAPICoreV1FCVolumeSource `json:"fc,omitempty"` + FlexVolume *K8sIoAPICoreV1FlexPersistentVolumeSource `json:"flexVolume,omitempty"` + Flocker *K8sIoAPICoreV1FlockerVolumeSource `json:"flocker,omitempty"` + GcePersistentDisk *K8sIoAPICoreV1GCEPersistentDiskVolumeSource `json:"gcePersistentDisk,omitempty"` + Glusterfs *K8sIoAPICoreV1GlusterfsPersistentVolumeSource `json:"glusterfs,omitempty"` + HostPath *K8sIoAPICoreV1HostPathVolumeSource `json:"hostPath,omitempty"` + Iscsi *K8sIoAPICoreV1ISCSIPersistentVolumeSource `json:"iscsi,omitempty"` + Local *K8sIoAPICoreV1LocalVolumeSource `json:"local,omitempty"` + MountOptions []string `json:"mountOptions,omitempty"` + Nfs *K8sIoAPICoreV1NFSVolumeSource `json:"nfs,omitempty"` + NodeAffinity *K8sIoAPICoreV1VolumeNodeAffinity `json:"nodeAffinity,omitempty"` + PersistentVolumeReclaimPolicy *K8sIoAPICoreV1PersistentVolumeReclaimPolicy `json:"persistentVolumeReclaimPolicy,omitempty"` + PhotonPersistentDisk *K8sIoAPICoreV1PhotonPersistentDiskVolumeSource `json:"photonPersistentDisk,omitempty"` + PortworxVolume *K8sIoAPICoreV1PortworxVolumeSource `json:"portworxVolume,omitempty"` + Quobyte *K8sIoAPICoreV1QuobyteVolumeSource `json:"quobyte,omitempty"` + Rbd *K8sIoAPICoreV1RBDPersistentVolumeSource `json:"rbd,omitempty"` + ScaleIo *K8sIoAPICoreV1ScaleIOPersistentVolumeSource `json:"scaleIO,omitempty"` + StorageClassName *string `json:"storageClassName,omitempty"` + Storageos *K8sIoAPICoreV1StorageOSPersistentVolumeSource `json:"storageos,omitempty"` + VolumeMode *string `json:"volumeMode,omitempty"` + VsphereVolume *K8sIoAPICoreV1VsphereVirtualDiskVolumeSource `json:"vsphereVolume,omitempty"` +} + +type K8sIoAPICoreV1PersistentVolumeSpecIn struct { + AccessModes []string `json:"accessModes,omitempty"` + AwsElasticBlockStore *K8sIoAPICoreV1AWSElasticBlockStoreVolumeSourceIn `json:"awsElasticBlockStore,omitempty"` + AzureDisk *K8sIoAPICoreV1AzureDiskVolumeSourceIn `json:"azureDisk,omitempty"` + AzureFile *K8sIoAPICoreV1AzureFilePersistentVolumeSourceIn `json:"azureFile,omitempty"` + Capacity map[string]interface{} `json:"capacity,omitempty"` + Cephfs *K8sIoAPICoreV1CephFSPersistentVolumeSourceIn `json:"cephfs,omitempty"` + Cinder *K8sIoAPICoreV1CinderPersistentVolumeSourceIn `json:"cinder,omitempty"` + ClaimRef *K8sIoAPICoreV1ObjectReferenceIn `json:"claimRef,omitempty"` + Csi *K8sIoAPICoreV1CSIPersistentVolumeSourceIn `json:"csi,omitempty"` + Fc *K8sIoAPICoreV1FCVolumeSourceIn `json:"fc,omitempty"` + FlexVolume *K8sIoAPICoreV1FlexPersistentVolumeSourceIn `json:"flexVolume,omitempty"` + Flocker *K8sIoAPICoreV1FlockerVolumeSourceIn `json:"flocker,omitempty"` + GcePersistentDisk *K8sIoAPICoreV1GCEPersistentDiskVolumeSourceIn `json:"gcePersistentDisk,omitempty"` + Glusterfs *K8sIoAPICoreV1GlusterfsPersistentVolumeSourceIn `json:"glusterfs,omitempty"` + HostPath *K8sIoAPICoreV1HostPathVolumeSourceIn `json:"hostPath,omitempty"` + Iscsi *K8sIoAPICoreV1ISCSIPersistentVolumeSourceIn `json:"iscsi,omitempty"` + Local *K8sIoAPICoreV1LocalVolumeSourceIn `json:"local,omitempty"` + MountOptions []string `json:"mountOptions,omitempty"` + Nfs *K8sIoAPICoreV1NFSVolumeSourceIn `json:"nfs,omitempty"` + NodeAffinity *K8sIoAPICoreV1VolumeNodeAffinityIn `json:"nodeAffinity,omitempty"` + PersistentVolumeReclaimPolicy *K8sIoAPICoreV1PersistentVolumeReclaimPolicy `json:"persistentVolumeReclaimPolicy,omitempty"` + PhotonPersistentDisk *K8sIoAPICoreV1PhotonPersistentDiskVolumeSourceIn `json:"photonPersistentDisk,omitempty"` + PortworxVolume *K8sIoAPICoreV1PortworxVolumeSourceIn `json:"portworxVolume,omitempty"` + Quobyte *K8sIoAPICoreV1QuobyteVolumeSourceIn `json:"quobyte,omitempty"` + Rbd *K8sIoAPICoreV1RBDPersistentVolumeSourceIn `json:"rbd,omitempty"` + ScaleIo *K8sIoAPICoreV1ScaleIOPersistentVolumeSourceIn `json:"scaleIO,omitempty"` + StorageClassName *string `json:"storageClassName,omitempty"` + Storageos *K8sIoAPICoreV1StorageOSPersistentVolumeSourceIn `json:"storageos,omitempty"` + VolumeMode *string `json:"volumeMode,omitempty"` + VsphereVolume *K8sIoAPICoreV1VsphereVirtualDiskVolumeSourceIn `json:"vsphereVolume,omitempty"` +} + +type K8sIoAPICoreV1PersistentVolumeStatus struct { + LastPhaseTransitionTime *string `json:"lastPhaseTransitionTime,omitempty"` + Message *string `json:"message,omitempty"` + Phase *K8sIoAPICoreV1PersistentVolumePhase `json:"phase,omitempty"` + Reason *string `json:"reason,omitempty"` +} + +type K8sIoAPICoreV1PersistentVolumeStatusIn struct { + LastPhaseTransitionTime *string `json:"lastPhaseTransitionTime,omitempty"` + Message *string `json:"message,omitempty"` + Phase *K8sIoAPICoreV1PersistentVolumePhase `json:"phase,omitempty"` + Reason *string `json:"reason,omitempty"` +} + +type K8sIoAPICoreV1PhotonPersistentDiskVolumeSource struct { + FsType *string `json:"fsType,omitempty"` + PdID string `json:"pdID"` +} + +type K8sIoAPICoreV1PhotonPersistentDiskVolumeSourceIn struct { + FsType *string `json:"fsType,omitempty"` + PdID string `json:"pdID"` +} + +type K8sIoAPICoreV1PodAffinity struct { + PreferredDuringSchedulingIgnoredDuringExecution []*K8sIoAPICoreV1WeightedPodAffinityTerm `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"` + RequiredDuringSchedulingIgnoredDuringExecution []*K8sIoAPICoreV1PodAffinityTerm `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"` +} + +type K8sIoAPICoreV1PodAffinityIn struct { + PreferredDuringSchedulingIgnoredDuringExecution []*K8sIoAPICoreV1WeightedPodAffinityTermIn `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"` + RequiredDuringSchedulingIgnoredDuringExecution []*K8sIoAPICoreV1PodAffinityTermIn `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"` +} + +type K8sIoAPICoreV1PodAffinityTerm struct { + LabelSelector *K8sIoApimachineryPkgApisMetaV1LabelSelector `json:"labelSelector,omitempty"` + Namespaces []string `json:"namespaces,omitempty"` + NamespaceSelector *K8sIoApimachineryPkgApisMetaV1LabelSelector `json:"namespaceSelector,omitempty"` + TopologyKey string `json:"topologyKey"` +} + +type K8sIoAPICoreV1PodAffinityTermIn struct { + LabelSelector *K8sIoApimachineryPkgApisMetaV1LabelSelectorIn `json:"labelSelector,omitempty"` + Namespaces []string `json:"namespaces,omitempty"` + NamespaceSelector *K8sIoApimachineryPkgApisMetaV1LabelSelectorIn `json:"namespaceSelector,omitempty"` + TopologyKey string `json:"topologyKey"` +} + +type K8sIoAPICoreV1PodAntiAffinity struct { + PreferredDuringSchedulingIgnoredDuringExecution []*K8sIoAPICoreV1WeightedPodAffinityTerm `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"` + RequiredDuringSchedulingIgnoredDuringExecution []*K8sIoAPICoreV1PodAffinityTerm `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"` +} + +type K8sIoAPICoreV1PodAntiAffinityIn struct { + PreferredDuringSchedulingIgnoredDuringExecution []*K8sIoAPICoreV1WeightedPodAffinityTermIn `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"` + RequiredDuringSchedulingIgnoredDuringExecution []*K8sIoAPICoreV1PodAffinityTermIn `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"` +} + +type K8sIoAPICoreV1PortworxVolumeSource struct { + FsType *string `json:"fsType,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + VolumeID string `json:"volumeID"` +} + +type K8sIoAPICoreV1PortworxVolumeSourceIn struct { + FsType *string `json:"fsType,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + VolumeID string `json:"volumeID"` +} + +type K8sIoAPICoreV1PreferredSchedulingTerm struct { + Preference *K8sIoAPICoreV1NodeSelectorTerm `json:"preference"` + Weight int `json:"weight"` +} + +type K8sIoAPICoreV1PreferredSchedulingTermIn struct { + Preference *K8sIoAPICoreV1NodeSelectorTermIn `json:"preference"` + Weight int `json:"weight"` +} + +type K8sIoAPICoreV1QuobyteVolumeSource struct { + Group *string `json:"group,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + Registry string `json:"registry"` + Tenant *string `json:"tenant,omitempty"` + User *string `json:"user,omitempty"` + Volume string `json:"volume"` +} + +type K8sIoAPICoreV1QuobyteVolumeSourceIn struct { + Group *string `json:"group,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + Registry string `json:"registry"` + Tenant *string `json:"tenant,omitempty"` + User *string `json:"user,omitempty"` + Volume string `json:"volume"` +} + +type K8sIoAPICoreV1RBDPersistentVolumeSource struct { + FsType *string `json:"fsType,omitempty"` + Image string `json:"image"` + Keyring *string `json:"keyring,omitempty"` + Monitors []string `json:"monitors"` + Pool *string `json:"pool,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + SecretRef *K8sIoAPICoreV1SecretReference `json:"secretRef,omitempty"` + User *string `json:"user,omitempty"` +} + +type K8sIoAPICoreV1RBDPersistentVolumeSourceIn struct { + FsType *string `json:"fsType,omitempty"` + Image string `json:"image"` + Keyring *string `json:"keyring,omitempty"` + Monitors []string `json:"monitors"` + Pool *string `json:"pool,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + SecretRef *K8sIoAPICoreV1SecretReferenceIn `json:"secretRef,omitempty"` + User *string `json:"user,omitempty"` +} + +type K8sIoAPICoreV1ResourceClaim struct { + Name string `json:"name"` +} + +type K8sIoAPICoreV1ResourceClaimIn struct { + Name string `json:"name"` +} + +type K8sIoAPICoreV1ResourceRequirements struct { + Claims []*K8sIoAPICoreV1ResourceClaim `json:"claims,omitempty"` + Limits map[string]interface{} `json:"limits,omitempty"` + Requests map[string]interface{} `json:"requests,omitempty"` +} + +type K8sIoAPICoreV1ResourceRequirementsIn struct { + Claims []*K8sIoAPICoreV1ResourceClaimIn `json:"claims,omitempty"` + Limits map[string]interface{} `json:"limits,omitempty"` + Requests map[string]interface{} `json:"requests,omitempty"` +} + +type K8sIoAPICoreV1ScaleIOPersistentVolumeSource struct { + FsType *string `json:"fsType,omitempty"` + Gateway string `json:"gateway"` + ProtectionDomain *string `json:"protectionDomain,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + SecretRef *K8sIoAPICoreV1SecretReference `json:"secretRef,omitempty"` + SslEnabled *bool `json:"sslEnabled,omitempty"` + StorageMode *string `json:"storageMode,omitempty"` + StoragePool *string `json:"storagePool,omitempty"` + System string `json:"system"` + VolumeName *string `json:"volumeName,omitempty"` +} + +type K8sIoAPICoreV1ScaleIOPersistentVolumeSourceIn struct { + FsType *string `json:"fsType,omitempty"` + Gateway string `json:"gateway"` + ProtectionDomain *string `json:"protectionDomain,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + SecretRef *K8sIoAPICoreV1SecretReferenceIn `json:"secretRef,omitempty"` + SslEnabled *bool `json:"sslEnabled,omitempty"` + StorageMode *string `json:"storageMode,omitempty"` + StoragePool *string `json:"storagePool,omitempty"` + System string `json:"system"` + VolumeName *string `json:"volumeName,omitempty"` +} + +type K8sIoAPICoreV1SecretReference struct { + Name *string `json:"name,omitempty"` + Namespace *string `json:"namespace,omitempty"` +} + +type K8sIoAPICoreV1SecretReferenceIn struct { + Name *string `json:"name,omitempty"` + Namespace *string `json:"namespace,omitempty"` +} + +type K8sIoAPICoreV1StorageOSPersistentVolumeSource struct { + FsType *string `json:"fsType,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + SecretRef *K8sIoAPICoreV1ObjectReference `json:"secretRef,omitempty"` + VolumeName *string `json:"volumeName,omitempty"` + VolumeNamespace *string `json:"volumeNamespace,omitempty"` +} + +type K8sIoAPICoreV1StorageOSPersistentVolumeSourceIn struct { + FsType *string `json:"fsType,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + SecretRef *K8sIoAPICoreV1ObjectReferenceIn `json:"secretRef,omitempty"` + VolumeName *string `json:"volumeName,omitempty"` + VolumeNamespace *string `json:"volumeNamespace,omitempty"` +} + +type K8sIoAPICoreV1Taint struct { + Effect K8sIoAPICoreV1TaintEffect `json:"effect"` + Key string `json:"key"` + TimeAdded *string `json:"timeAdded,omitempty"` + Value *string `json:"value,omitempty"` +} + +type K8sIoAPICoreV1TaintIn struct { + Effect K8sIoAPICoreV1TaintEffect `json:"effect"` + Key string `json:"key"` + TimeAdded *string `json:"timeAdded,omitempty"` + Value *string `json:"value,omitempty"` +} + +type K8sIoAPICoreV1Toleration struct { + Effect *K8sIoAPICoreV1TaintEffect `json:"effect,omitempty"` + Key *string `json:"key,omitempty"` + Operator *K8sIoAPICoreV1TolerationOperator `json:"operator,omitempty"` + TolerationSeconds *int `json:"tolerationSeconds,omitempty"` + Value *string `json:"value,omitempty"` +} + +type K8sIoAPICoreV1TolerationIn struct { + Effect *K8sIoAPICoreV1TaintEffect `json:"effect,omitempty"` + Key *string `json:"key,omitempty"` + Operator *K8sIoAPICoreV1TolerationOperator `json:"operator,omitempty"` + TolerationSeconds *int `json:"tolerationSeconds,omitempty"` + Value *string `json:"value,omitempty"` +} + +type K8sIoAPICoreV1TypedLocalObjectReference struct { + APIGroup *string `json:"apiGroup,omitempty"` + Kind string `json:"kind"` + Name string `json:"name"` +} + +type K8sIoAPICoreV1TypedLocalObjectReferenceIn struct { + APIGroup *string `json:"apiGroup,omitempty"` + Kind string `json:"kind"` + Name string `json:"name"` +} + +type K8sIoAPICoreV1TypedObjectReference struct { + APIGroup *string `json:"apiGroup,omitempty"` + Kind string `json:"kind"` + Name string `json:"name"` + Namespace *string `json:"namespace,omitempty"` +} + +type K8sIoAPICoreV1TypedObjectReferenceIn struct { + APIGroup *string `json:"apiGroup,omitempty"` + Kind string `json:"kind"` + Name string `json:"name"` + Namespace *string `json:"namespace,omitempty"` +} + +type K8sIoAPICoreV1VolumeNodeAffinity struct { + Required *K8sIoAPICoreV1NodeSelector `json:"required,omitempty"` +} + +type K8sIoAPICoreV1VolumeNodeAffinityIn struct { + Required *K8sIoAPICoreV1NodeSelectorIn `json:"required,omitempty"` +} + +type K8sIoAPICoreV1VsphereVirtualDiskVolumeSource struct { + FsType *string `json:"fsType,omitempty"` + StoragePolicyID *string `json:"storagePolicyID,omitempty"` + StoragePolicyName *string `json:"storagePolicyName,omitempty"` + VolumePath string `json:"volumePath"` +} + +type K8sIoAPICoreV1VsphereVirtualDiskVolumeSourceIn struct { + FsType *string `json:"fsType,omitempty"` + StoragePolicyID *string `json:"storagePolicyID,omitempty"` + StoragePolicyName *string `json:"storagePolicyName,omitempty"` + VolumePath string `json:"volumePath"` +} + +type K8sIoAPICoreV1WeightedPodAffinityTerm struct { + PodAffinityTerm *K8sIoAPICoreV1PodAffinityTerm `json:"podAffinityTerm"` + Weight int `json:"weight"` +} + +type K8sIoAPICoreV1WeightedPodAffinityTermIn struct { + PodAffinityTerm *K8sIoAPICoreV1PodAffinityTermIn `json:"podAffinityTerm"` + Weight int `json:"weight"` +} + +type K8sIoAPIStorageV1VolumeAttachmentSource struct { + InlineVolumeSpec *K8sIoAPICoreV1PersistentVolumeSpec `json:"inlineVolumeSpec,omitempty"` + PersistentVolumeName *string `json:"persistentVolumeName,omitempty"` +} + +type K8sIoAPIStorageV1VolumeAttachmentSourceIn struct { + InlineVolumeSpec *K8sIoAPICoreV1PersistentVolumeSpecIn `json:"inlineVolumeSpec,omitempty"` + PersistentVolumeName *string `json:"persistentVolumeName,omitempty"` +} + +type K8sIoAPIStorageV1VolumeAttachmentSpec struct { + Attacher string `json:"attacher"` + NodeName string `json:"nodeName"` + Source *K8sIoAPIStorageV1VolumeAttachmentSource `json:"source"` +} + +type K8sIoAPIStorageV1VolumeAttachmentSpecIn struct { + Attacher string `json:"attacher"` + NodeName string `json:"nodeName"` + Source *K8sIoAPIStorageV1VolumeAttachmentSourceIn `json:"source"` +} + +type K8sIoAPIStorageV1VolumeAttachmentStatus struct { + Attached bool `json:"attached"` + AttachError *K8sIoAPIStorageV1VolumeError `json:"attachError,omitempty"` + AttachmentMetadata map[string]interface{} `json:"attachmentMetadata,omitempty"` + DetachError *K8sIoAPIStorageV1VolumeError `json:"detachError,omitempty"` +} + +type K8sIoAPIStorageV1VolumeAttachmentStatusIn struct { + Attached bool `json:"attached"` + AttachError *K8sIoAPIStorageV1VolumeErrorIn `json:"attachError,omitempty"` + AttachmentMetadata map[string]interface{} `json:"attachmentMetadata,omitempty"` + DetachError *K8sIoAPIStorageV1VolumeErrorIn `json:"detachError,omitempty"` +} + +type K8sIoAPIStorageV1VolumeError struct { + Message *string `json:"message,omitempty"` + Time *string `json:"time,omitempty"` +} + +type K8sIoAPIStorageV1VolumeErrorIn struct { + Message *string `json:"message,omitempty"` + Time *string `json:"time,omitempty"` +} + +type K8sIoApimachineryPkgAPIResourceQuantity struct { + Format K8sIoApimachineryPkgAPIResourceFormat `json:"Format"` +} + +type K8sIoApimachineryPkgAPIResourceQuantityIn struct { + Format K8sIoApimachineryPkgAPIResourceFormat `json:"Format"` +} + +type K8sIoApimachineryPkgApisMetaV1LabelSelector struct { + MatchExpressions []*K8sIoApimachineryPkgApisMetaV1LabelSelectorRequirement `json:"matchExpressions,omitempty"` + MatchLabels map[string]interface{} `json:"matchLabels,omitempty"` +} + +type K8sIoApimachineryPkgApisMetaV1LabelSelectorIn struct { + MatchExpressions []*K8sIoApimachineryPkgApisMetaV1LabelSelectorRequirementIn `json:"matchExpressions,omitempty"` + MatchLabels map[string]interface{} `json:"matchLabels,omitempty"` +} + +type K8sIoApimachineryPkgApisMetaV1LabelSelectorRequirement struct { + Key string `json:"key"` + Operator K8sIoApimachineryPkgApisMetaV1LabelSelectorOperator `json:"operator"` + Values []string `json:"values,omitempty"` +} + +type K8sIoApimachineryPkgApisMetaV1LabelSelectorRequirementIn struct { + Key string `json:"key"` + Operator K8sIoApimachineryPkgApisMetaV1LabelSelectorOperator `json:"operator"` + Values []string `json:"values,omitempty"` +} + +type NamespaceEdge struct { + Cursor string `json:"cursor"` + Node *entities.Namespace `json:"node"` +} + +type NamespacePaginatedRecords struct { + Edges []*NamespaceEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +type NodeEdge struct { + Cursor string `json:"cursor"` + Node *entities.Node `json:"node"` +} + +type NodeIn struct { + APIVersion *string `json:"apiVersion,omitempty"` + Kind *string `json:"kind,omitempty"` + Metadata *v1.ObjectMeta `json:"metadata,omitempty"` + Spec *GithubComKloudliteOperatorApisClustersV1NodeSpecIn `json:"spec"` +} + +type NodePaginatedRecords struct { + Edges []*NodeEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +type NodePoolEdge struct { + Cursor string `json:"cursor"` + Node *entities.NodePool `json:"node"` +} + +type NodePoolPaginatedRecords struct { + Edges []*NodePoolEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +type PageInfo struct { + EndCursor *string `json:"endCursor,omitempty"` + HasNextPage *bool `json:"hasNextPage,omitempty"` + HasPreviousPage *bool `json:"hasPreviousPage,omitempty"` + StartCursor *string `json:"startCursor,omitempty"` +} + +type PersistentVolumeClaimEdge struct { + Cursor string `json:"cursor"` + Node *entities.PersistentVolumeClaim `json:"node"` +} + +type PersistentVolumeClaimPaginatedRecords struct { + Edges []*PersistentVolumeClaimEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +type PersistentVolumeEdge struct { + Cursor string `json:"cursor"` + Node *entities.PersistentVolume `json:"node"` +} + +type PersistentVolumePaginatedRecords struct { + Edges []*PersistentVolumeEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +type SearchCluster struct { + CloudProviderName *repos.MatchFilter `json:"cloudProviderName,omitempty"` + IsReady *repos.MatchFilter `json:"isReady,omitempty"` + Region *repos.MatchFilter `json:"region,omitempty"` + Text *repos.MatchFilter `json:"text,omitempty"` +} + +type SearchClusterManagedService struct { + IsReady *repos.MatchFilter `json:"isReady,omitempty"` + Text *repos.MatchFilter `json:"text,omitempty"` +} + +type SearchDomainEntry struct { + ClusterName *repos.MatchFilter `json:"clusterName,omitempty"` + Text *repos.MatchFilter `json:"text,omitempty"` +} + +type SearchHelmRelease struct { + Text *repos.MatchFilter `json:"text,omitempty"` + IsReady *repos.MatchFilter `json:"isReady,omitempty"` +} + +type SearchNamespaces struct { + Text *repos.MatchFilter `json:"text,omitempty"` +} + +type SearchNodepool struct { + Text *repos.MatchFilter `json:"text,omitempty"` +} + +type SearchPersistentVolumeClaims struct { + Text *repos.MatchFilter `json:"text,omitempty"` +} + +type SearchPersistentVolumes struct { + Text *repos.MatchFilter `json:"text,omitempty"` +} + +type SearchProviderSecret struct { + CloudProviderName *repos.MatchFilter `json:"cloudProviderName,omitempty"` + Text *repos.MatchFilter `json:"text,omitempty"` +} + +type SearchVolumeAttachments struct { + Text *repos.MatchFilter `json:"text,omitempty"` +} + +type VolumeAttachmentEdge struct { + Cursor string `json:"cursor"` + Node *entities.VolumeAttachment `json:"node"` +} + +type VolumeAttachmentPaginatedRecords struct { + Edges []*VolumeAttachmentEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +type GithubComKloudliteOperatorApisClustersV1AWSPoolType string + +const ( + GithubComKloudliteOperatorApisClustersV1AWSPoolTypeEc2 GithubComKloudliteOperatorApisClustersV1AWSPoolType = "ec2" + GithubComKloudliteOperatorApisClustersV1AWSPoolTypeSpot GithubComKloudliteOperatorApisClustersV1AWSPoolType = "spot" +) + +var AllGithubComKloudliteOperatorApisClustersV1AWSPoolType = []GithubComKloudliteOperatorApisClustersV1AWSPoolType{ + GithubComKloudliteOperatorApisClustersV1AWSPoolTypeEc2, + GithubComKloudliteOperatorApisClustersV1AWSPoolTypeSpot, +} + +func (e GithubComKloudliteOperatorApisClustersV1AWSPoolType) IsValid() bool { + switch e { + case GithubComKloudliteOperatorApisClustersV1AWSPoolTypeEc2, GithubComKloudliteOperatorApisClustersV1AWSPoolTypeSpot: + return true + } + return false +} + +func (e GithubComKloudliteOperatorApisClustersV1AWSPoolType) String() string { + return string(e) +} + +func (e *GithubComKloudliteOperatorApisClustersV1AWSPoolType) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = GithubComKloudliteOperatorApisClustersV1AWSPoolType(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid Github__com___kloudlite___operator___apis___clusters___v1__AWSPoolType", str) + } + return nil +} + +func (e GithubComKloudliteOperatorApisClustersV1AWSPoolType) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type GithubComKloudliteOperatorApisClustersV1ClusterSpecAvailabilityMode string + +const ( + GithubComKloudliteOperatorApisClustersV1ClusterSpecAvailabilityModeDev GithubComKloudliteOperatorApisClustersV1ClusterSpecAvailabilityMode = "dev" + GithubComKloudliteOperatorApisClustersV1ClusterSpecAvailabilityModeHa GithubComKloudliteOperatorApisClustersV1ClusterSpecAvailabilityMode = "HA" +) + +var AllGithubComKloudliteOperatorApisClustersV1ClusterSpecAvailabilityMode = []GithubComKloudliteOperatorApisClustersV1ClusterSpecAvailabilityMode{ + GithubComKloudliteOperatorApisClustersV1ClusterSpecAvailabilityModeDev, + GithubComKloudliteOperatorApisClustersV1ClusterSpecAvailabilityModeHa, +} + +func (e GithubComKloudliteOperatorApisClustersV1ClusterSpecAvailabilityMode) IsValid() bool { + switch e { + case GithubComKloudliteOperatorApisClustersV1ClusterSpecAvailabilityModeDev, GithubComKloudliteOperatorApisClustersV1ClusterSpecAvailabilityModeHa: + return true + } + return false +} + +func (e GithubComKloudliteOperatorApisClustersV1ClusterSpecAvailabilityMode) String() string { + return string(e) +} + +func (e *GithubComKloudliteOperatorApisClustersV1ClusterSpecAvailabilityMode) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = GithubComKloudliteOperatorApisClustersV1ClusterSpecAvailabilityMode(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpecAvailabilityMode", str) + } + return nil +} + +func (e GithubComKloudliteOperatorApisClustersV1ClusterSpecAvailabilityMode) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type GithubComKloudliteOperatorApisCommonTypesCloudProvider string + +const ( + GithubComKloudliteOperatorApisCommonTypesCloudProviderAws GithubComKloudliteOperatorApisCommonTypesCloudProvider = "aws" + GithubComKloudliteOperatorApisCommonTypesCloudProviderAzure GithubComKloudliteOperatorApisCommonTypesCloudProvider = "azure" + GithubComKloudliteOperatorApisCommonTypesCloudProviderDo GithubComKloudliteOperatorApisCommonTypesCloudProvider = "do" + GithubComKloudliteOperatorApisCommonTypesCloudProviderGcp GithubComKloudliteOperatorApisCommonTypesCloudProvider = "gcp" +) + +var AllGithubComKloudliteOperatorApisCommonTypesCloudProvider = []GithubComKloudliteOperatorApisCommonTypesCloudProvider{ + GithubComKloudliteOperatorApisCommonTypesCloudProviderAws, + GithubComKloudliteOperatorApisCommonTypesCloudProviderAzure, + GithubComKloudliteOperatorApisCommonTypesCloudProviderDo, + GithubComKloudliteOperatorApisCommonTypesCloudProviderGcp, +} + +func (e GithubComKloudliteOperatorApisCommonTypesCloudProvider) IsValid() bool { + switch e { + case GithubComKloudliteOperatorApisCommonTypesCloudProviderAws, GithubComKloudliteOperatorApisCommonTypesCloudProviderAzure, GithubComKloudliteOperatorApisCommonTypesCloudProviderDo, GithubComKloudliteOperatorApisCommonTypesCloudProviderGcp: + return true + } + return false +} + +func (e GithubComKloudliteOperatorApisCommonTypesCloudProvider) String() string { + return string(e) +} + +func (e *GithubComKloudliteOperatorApisCommonTypesCloudProvider) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = GithubComKloudliteOperatorApisCommonTypesCloudProvider(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid Github__com___kloudlite___operator___apis___common____types__CloudProvider", str) + } + return nil +} + +func (e GithubComKloudliteOperatorApisCommonTypesCloudProvider) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type K8sIoAPICoreV1ConditionStatus string + +const ( + K8sIoAPICoreV1ConditionStatusFalse K8sIoAPICoreV1ConditionStatus = "False" + K8sIoAPICoreV1ConditionStatusTrue K8sIoAPICoreV1ConditionStatus = "True" + K8sIoAPICoreV1ConditionStatusUnknown K8sIoAPICoreV1ConditionStatus = "Unknown" +) + +var AllK8sIoAPICoreV1ConditionStatus = []K8sIoAPICoreV1ConditionStatus{ + K8sIoAPICoreV1ConditionStatusFalse, + K8sIoAPICoreV1ConditionStatusTrue, + K8sIoAPICoreV1ConditionStatusUnknown, +} + +func (e K8sIoAPICoreV1ConditionStatus) IsValid() bool { + switch e { + case K8sIoAPICoreV1ConditionStatusFalse, K8sIoAPICoreV1ConditionStatusTrue, K8sIoAPICoreV1ConditionStatusUnknown: + return true + } + return false +} + +func (e K8sIoAPICoreV1ConditionStatus) String() string { + return string(e) +} + +func (e *K8sIoAPICoreV1ConditionStatus) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = K8sIoAPICoreV1ConditionStatus(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid K8s__io___api___core___v1__ConditionStatus", str) + } + return nil +} + +func (e K8sIoAPICoreV1ConditionStatus) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type K8sIoAPICoreV1NamespaceConditionType string + +const ( + K8sIoAPICoreV1NamespaceConditionTypeNamespaceContentRemaining K8sIoAPICoreV1NamespaceConditionType = "NamespaceContentRemaining" + K8sIoAPICoreV1NamespaceConditionTypeNamespaceDeletionContentFailure K8sIoAPICoreV1NamespaceConditionType = "NamespaceDeletionContentFailure" + K8sIoAPICoreV1NamespaceConditionTypeNamespaceDeletionDiscoveryFailure K8sIoAPICoreV1NamespaceConditionType = "NamespaceDeletionDiscoveryFailure" + K8sIoAPICoreV1NamespaceConditionTypeNamespaceDeletionGroupVersionParsingFailure K8sIoAPICoreV1NamespaceConditionType = "NamespaceDeletionGroupVersionParsingFailure" + K8sIoAPICoreV1NamespaceConditionTypeNamespaceFinalizersRemaining K8sIoAPICoreV1NamespaceConditionType = "NamespaceFinalizersRemaining" +) + +var AllK8sIoAPICoreV1NamespaceConditionType = []K8sIoAPICoreV1NamespaceConditionType{ + K8sIoAPICoreV1NamespaceConditionTypeNamespaceContentRemaining, + K8sIoAPICoreV1NamespaceConditionTypeNamespaceDeletionContentFailure, + K8sIoAPICoreV1NamespaceConditionTypeNamespaceDeletionDiscoveryFailure, + K8sIoAPICoreV1NamespaceConditionTypeNamespaceDeletionGroupVersionParsingFailure, + K8sIoAPICoreV1NamespaceConditionTypeNamespaceFinalizersRemaining, +} + +func (e K8sIoAPICoreV1NamespaceConditionType) IsValid() bool { + switch e { + case K8sIoAPICoreV1NamespaceConditionTypeNamespaceContentRemaining, K8sIoAPICoreV1NamespaceConditionTypeNamespaceDeletionContentFailure, K8sIoAPICoreV1NamespaceConditionTypeNamespaceDeletionDiscoveryFailure, K8sIoAPICoreV1NamespaceConditionTypeNamespaceDeletionGroupVersionParsingFailure, K8sIoAPICoreV1NamespaceConditionTypeNamespaceFinalizersRemaining: + return true + } + return false +} + +func (e K8sIoAPICoreV1NamespaceConditionType) String() string { + return string(e) +} + +func (e *K8sIoAPICoreV1NamespaceConditionType) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = K8sIoAPICoreV1NamespaceConditionType(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid K8s__io___api___core___v1__NamespaceConditionType", str) + } + return nil +} + +func (e K8sIoAPICoreV1NamespaceConditionType) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type K8sIoAPICoreV1NamespacePhase string + +const ( + K8sIoAPICoreV1NamespacePhaseActive K8sIoAPICoreV1NamespacePhase = "Active" + K8sIoAPICoreV1NamespacePhaseTerminating K8sIoAPICoreV1NamespacePhase = "Terminating" +) + +var AllK8sIoAPICoreV1NamespacePhase = []K8sIoAPICoreV1NamespacePhase{ + K8sIoAPICoreV1NamespacePhaseActive, + K8sIoAPICoreV1NamespacePhaseTerminating, +} + +func (e K8sIoAPICoreV1NamespacePhase) IsValid() bool { + switch e { + case K8sIoAPICoreV1NamespacePhaseActive, K8sIoAPICoreV1NamespacePhaseTerminating: + return true + } + return false +} + +func (e K8sIoAPICoreV1NamespacePhase) String() string { + return string(e) +} + +func (e *K8sIoAPICoreV1NamespacePhase) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = K8sIoAPICoreV1NamespacePhase(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid K8s__io___api___core___v1__NamespacePhase", str) + } + return nil +} + +func (e K8sIoAPICoreV1NamespacePhase) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type K8sIoAPICoreV1NodeSelectorOperator string + +const ( + K8sIoAPICoreV1NodeSelectorOperatorDoesNotExist K8sIoAPICoreV1NodeSelectorOperator = "DoesNotExist" + K8sIoAPICoreV1NodeSelectorOperatorExists K8sIoAPICoreV1NodeSelectorOperator = "Exists" + K8sIoAPICoreV1NodeSelectorOperatorGt K8sIoAPICoreV1NodeSelectorOperator = "Gt" + K8sIoAPICoreV1NodeSelectorOperatorIn K8sIoAPICoreV1NodeSelectorOperator = "In" + K8sIoAPICoreV1NodeSelectorOperatorLt K8sIoAPICoreV1NodeSelectorOperator = "Lt" + K8sIoAPICoreV1NodeSelectorOperatorNotIn K8sIoAPICoreV1NodeSelectorOperator = "NotIn" +) + +var AllK8sIoAPICoreV1NodeSelectorOperator = []K8sIoAPICoreV1NodeSelectorOperator{ + K8sIoAPICoreV1NodeSelectorOperatorDoesNotExist, + K8sIoAPICoreV1NodeSelectorOperatorExists, + K8sIoAPICoreV1NodeSelectorOperatorGt, + K8sIoAPICoreV1NodeSelectorOperatorIn, + K8sIoAPICoreV1NodeSelectorOperatorLt, + K8sIoAPICoreV1NodeSelectorOperatorNotIn, +} + +func (e K8sIoAPICoreV1NodeSelectorOperator) IsValid() bool { + switch e { + case K8sIoAPICoreV1NodeSelectorOperatorDoesNotExist, K8sIoAPICoreV1NodeSelectorOperatorExists, K8sIoAPICoreV1NodeSelectorOperatorGt, K8sIoAPICoreV1NodeSelectorOperatorIn, K8sIoAPICoreV1NodeSelectorOperatorLt, K8sIoAPICoreV1NodeSelectorOperatorNotIn: + return true + } + return false +} + +func (e K8sIoAPICoreV1NodeSelectorOperator) String() string { + return string(e) +} + +func (e *K8sIoAPICoreV1NodeSelectorOperator) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = K8sIoAPICoreV1NodeSelectorOperator(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid K8s__io___api___core___v1__NodeSelectorOperator", str) + } + return nil +} + +func (e K8sIoAPICoreV1NodeSelectorOperator) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type K8sIoAPICoreV1PersistentVolumeClaimConditionType string + +const ( + K8sIoAPICoreV1PersistentVolumeClaimConditionTypeFileSystemResizePending K8sIoAPICoreV1PersistentVolumeClaimConditionType = "FileSystemResizePending" + K8sIoAPICoreV1PersistentVolumeClaimConditionTypeResizing K8sIoAPICoreV1PersistentVolumeClaimConditionType = "Resizing" +) + +var AllK8sIoAPICoreV1PersistentVolumeClaimConditionType = []K8sIoAPICoreV1PersistentVolumeClaimConditionType{ + K8sIoAPICoreV1PersistentVolumeClaimConditionTypeFileSystemResizePending, + K8sIoAPICoreV1PersistentVolumeClaimConditionTypeResizing, +} + +func (e K8sIoAPICoreV1PersistentVolumeClaimConditionType) IsValid() bool { + switch e { + case K8sIoAPICoreV1PersistentVolumeClaimConditionTypeFileSystemResizePending, K8sIoAPICoreV1PersistentVolumeClaimConditionTypeResizing: + return true + } + return false +} + +func (e K8sIoAPICoreV1PersistentVolumeClaimConditionType) String() string { + return string(e) +} + +func (e *K8sIoAPICoreV1PersistentVolumeClaimConditionType) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = K8sIoAPICoreV1PersistentVolumeClaimConditionType(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid K8s__io___api___core___v1__PersistentVolumeClaimConditionType", str) + } + return nil +} + +func (e K8sIoAPICoreV1PersistentVolumeClaimConditionType) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type K8sIoAPICoreV1PersistentVolumeClaimPhase string + +const ( + K8sIoAPICoreV1PersistentVolumeClaimPhaseBound K8sIoAPICoreV1PersistentVolumeClaimPhase = "Bound" + K8sIoAPICoreV1PersistentVolumeClaimPhaseLost K8sIoAPICoreV1PersistentVolumeClaimPhase = "Lost" + K8sIoAPICoreV1PersistentVolumeClaimPhasePending K8sIoAPICoreV1PersistentVolumeClaimPhase = "Pending" +) + +var AllK8sIoAPICoreV1PersistentVolumeClaimPhase = []K8sIoAPICoreV1PersistentVolumeClaimPhase{ + K8sIoAPICoreV1PersistentVolumeClaimPhaseBound, + K8sIoAPICoreV1PersistentVolumeClaimPhaseLost, + K8sIoAPICoreV1PersistentVolumeClaimPhasePending, +} + +func (e K8sIoAPICoreV1PersistentVolumeClaimPhase) IsValid() bool { + switch e { + case K8sIoAPICoreV1PersistentVolumeClaimPhaseBound, K8sIoAPICoreV1PersistentVolumeClaimPhaseLost, K8sIoAPICoreV1PersistentVolumeClaimPhasePending: + return true + } + return false +} + +func (e K8sIoAPICoreV1PersistentVolumeClaimPhase) String() string { + return string(e) +} + +func (e *K8sIoAPICoreV1PersistentVolumeClaimPhase) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = K8sIoAPICoreV1PersistentVolumeClaimPhase(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid K8s__io___api___core___v1__PersistentVolumeClaimPhase", str) + } + return nil +} + +func (e K8sIoAPICoreV1PersistentVolumeClaimPhase) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type K8sIoAPICoreV1PersistentVolumePhase string + +const ( + K8sIoAPICoreV1PersistentVolumePhaseAvailable K8sIoAPICoreV1PersistentVolumePhase = "Available" + K8sIoAPICoreV1PersistentVolumePhaseBound K8sIoAPICoreV1PersistentVolumePhase = "Bound" + K8sIoAPICoreV1PersistentVolumePhaseFailed K8sIoAPICoreV1PersistentVolumePhase = "Failed" + K8sIoAPICoreV1PersistentVolumePhasePending K8sIoAPICoreV1PersistentVolumePhase = "Pending" + K8sIoAPICoreV1PersistentVolumePhaseReleased K8sIoAPICoreV1PersistentVolumePhase = "Released" +) + +var AllK8sIoAPICoreV1PersistentVolumePhase = []K8sIoAPICoreV1PersistentVolumePhase{ + K8sIoAPICoreV1PersistentVolumePhaseAvailable, + K8sIoAPICoreV1PersistentVolumePhaseBound, + K8sIoAPICoreV1PersistentVolumePhaseFailed, + K8sIoAPICoreV1PersistentVolumePhasePending, + K8sIoAPICoreV1PersistentVolumePhaseReleased, +} + +func (e K8sIoAPICoreV1PersistentVolumePhase) IsValid() bool { + switch e { + case K8sIoAPICoreV1PersistentVolumePhaseAvailable, K8sIoAPICoreV1PersistentVolumePhaseBound, K8sIoAPICoreV1PersistentVolumePhaseFailed, K8sIoAPICoreV1PersistentVolumePhasePending, K8sIoAPICoreV1PersistentVolumePhaseReleased: + return true + } + return false +} + +func (e K8sIoAPICoreV1PersistentVolumePhase) String() string { + return string(e) +} + +func (e *K8sIoAPICoreV1PersistentVolumePhase) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = K8sIoAPICoreV1PersistentVolumePhase(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid K8s__io___api___core___v1__PersistentVolumePhase", str) + } + return nil +} + +func (e K8sIoAPICoreV1PersistentVolumePhase) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type K8sIoAPICoreV1PersistentVolumeReclaimPolicy string + +const ( + K8sIoAPICoreV1PersistentVolumeReclaimPolicyDelete K8sIoAPICoreV1PersistentVolumeReclaimPolicy = "Delete" + K8sIoAPICoreV1PersistentVolumeReclaimPolicyRecycle K8sIoAPICoreV1PersistentVolumeReclaimPolicy = "Recycle" + K8sIoAPICoreV1PersistentVolumeReclaimPolicyRetain K8sIoAPICoreV1PersistentVolumeReclaimPolicy = "Retain" +) + +var AllK8sIoAPICoreV1PersistentVolumeReclaimPolicy = []K8sIoAPICoreV1PersistentVolumeReclaimPolicy{ + K8sIoAPICoreV1PersistentVolumeReclaimPolicyDelete, + K8sIoAPICoreV1PersistentVolumeReclaimPolicyRecycle, + K8sIoAPICoreV1PersistentVolumeReclaimPolicyRetain, +} + +func (e K8sIoAPICoreV1PersistentVolumeReclaimPolicy) IsValid() bool { + switch e { + case K8sIoAPICoreV1PersistentVolumeReclaimPolicyDelete, K8sIoAPICoreV1PersistentVolumeReclaimPolicyRecycle, K8sIoAPICoreV1PersistentVolumeReclaimPolicyRetain: + return true + } + return false +} + +func (e K8sIoAPICoreV1PersistentVolumeReclaimPolicy) String() string { + return string(e) +} + +func (e *K8sIoAPICoreV1PersistentVolumeReclaimPolicy) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = K8sIoAPICoreV1PersistentVolumeReclaimPolicy(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid K8s__io___api___core___v1__PersistentVolumeReclaimPolicy", str) + } + return nil +} + +func (e K8sIoAPICoreV1PersistentVolumeReclaimPolicy) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type K8sIoAPICoreV1TaintEffect string + +const ( + K8sIoAPICoreV1TaintEffectNoExecute K8sIoAPICoreV1TaintEffect = "NoExecute" + K8sIoAPICoreV1TaintEffectNoSchedule K8sIoAPICoreV1TaintEffect = "NoSchedule" + K8sIoAPICoreV1TaintEffectPreferNoSchedule K8sIoAPICoreV1TaintEffect = "PreferNoSchedule" +) + +var AllK8sIoAPICoreV1TaintEffect = []K8sIoAPICoreV1TaintEffect{ + K8sIoAPICoreV1TaintEffectNoExecute, + K8sIoAPICoreV1TaintEffectNoSchedule, + K8sIoAPICoreV1TaintEffectPreferNoSchedule, +} + +func (e K8sIoAPICoreV1TaintEffect) IsValid() bool { + switch e { + case K8sIoAPICoreV1TaintEffectNoExecute, K8sIoAPICoreV1TaintEffectNoSchedule, K8sIoAPICoreV1TaintEffectPreferNoSchedule: + return true + } + return false +} + +func (e K8sIoAPICoreV1TaintEffect) String() string { + return string(e) +} + +func (e *K8sIoAPICoreV1TaintEffect) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = K8sIoAPICoreV1TaintEffect(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid K8s__io___api___core___v1__TaintEffect", str) + } + return nil +} + +func (e K8sIoAPICoreV1TaintEffect) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type K8sIoAPICoreV1TolerationOperator string + +const ( + K8sIoAPICoreV1TolerationOperatorEqual K8sIoAPICoreV1TolerationOperator = "Equal" + K8sIoAPICoreV1TolerationOperatorExists K8sIoAPICoreV1TolerationOperator = "Exists" +) + +var AllK8sIoAPICoreV1TolerationOperator = []K8sIoAPICoreV1TolerationOperator{ + K8sIoAPICoreV1TolerationOperatorEqual, + K8sIoAPICoreV1TolerationOperatorExists, +} + +func (e K8sIoAPICoreV1TolerationOperator) IsValid() bool { + switch e { + case K8sIoAPICoreV1TolerationOperatorEqual, K8sIoAPICoreV1TolerationOperatorExists: + return true + } + return false +} + +func (e K8sIoAPICoreV1TolerationOperator) String() string { + return string(e) +} + +func (e *K8sIoAPICoreV1TolerationOperator) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = K8sIoAPICoreV1TolerationOperator(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid K8s__io___api___core___v1__TolerationOperator", str) + } + return nil +} + +func (e K8sIoAPICoreV1TolerationOperator) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type K8sIoApimachineryPkgAPIResourceFormat string + +const ( + K8sIoApimachineryPkgAPIResourceFormatBinarySi K8sIoApimachineryPkgAPIResourceFormat = "BinarySI" + K8sIoApimachineryPkgAPIResourceFormatDecimalExponent K8sIoApimachineryPkgAPIResourceFormat = "DecimalExponent" + K8sIoApimachineryPkgAPIResourceFormatDecimalSi K8sIoApimachineryPkgAPIResourceFormat = "DecimalSI" +) + +var AllK8sIoApimachineryPkgAPIResourceFormat = []K8sIoApimachineryPkgAPIResourceFormat{ + K8sIoApimachineryPkgAPIResourceFormatBinarySi, + K8sIoApimachineryPkgAPIResourceFormatDecimalExponent, + K8sIoApimachineryPkgAPIResourceFormatDecimalSi, +} + +func (e K8sIoApimachineryPkgAPIResourceFormat) IsValid() bool { + switch e { + case K8sIoApimachineryPkgAPIResourceFormatBinarySi, K8sIoApimachineryPkgAPIResourceFormatDecimalExponent, K8sIoApimachineryPkgAPIResourceFormatDecimalSi: + return true + } + return false +} + +func (e K8sIoApimachineryPkgAPIResourceFormat) String() string { + return string(e) +} + +func (e *K8sIoApimachineryPkgAPIResourceFormat) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = K8sIoApimachineryPkgAPIResourceFormat(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid K8s__io___apimachinery___pkg___api___resource__Format", str) + } + return nil +} + +func (e K8sIoApimachineryPkgAPIResourceFormat) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type K8sIoApimachineryPkgApisMetaV1LabelSelectorOperator string + +const ( + K8sIoApimachineryPkgApisMetaV1LabelSelectorOperatorDoesNotExist K8sIoApimachineryPkgApisMetaV1LabelSelectorOperator = "DoesNotExist" + K8sIoApimachineryPkgApisMetaV1LabelSelectorOperatorExists K8sIoApimachineryPkgApisMetaV1LabelSelectorOperator = "Exists" + K8sIoApimachineryPkgApisMetaV1LabelSelectorOperatorIn K8sIoApimachineryPkgApisMetaV1LabelSelectorOperator = "In" + K8sIoApimachineryPkgApisMetaV1LabelSelectorOperatorNotIn K8sIoApimachineryPkgApisMetaV1LabelSelectorOperator = "NotIn" +) + +var AllK8sIoApimachineryPkgApisMetaV1LabelSelectorOperator = []K8sIoApimachineryPkgApisMetaV1LabelSelectorOperator{ + K8sIoApimachineryPkgApisMetaV1LabelSelectorOperatorDoesNotExist, + K8sIoApimachineryPkgApisMetaV1LabelSelectorOperatorExists, + K8sIoApimachineryPkgApisMetaV1LabelSelectorOperatorIn, + K8sIoApimachineryPkgApisMetaV1LabelSelectorOperatorNotIn, +} + +func (e K8sIoApimachineryPkgApisMetaV1LabelSelectorOperator) IsValid() bool { + switch e { + case K8sIoApimachineryPkgApisMetaV1LabelSelectorOperatorDoesNotExist, K8sIoApimachineryPkgApisMetaV1LabelSelectorOperatorExists, K8sIoApimachineryPkgApisMetaV1LabelSelectorOperatorIn, K8sIoApimachineryPkgApisMetaV1LabelSelectorOperatorNotIn: + return true + } + return false +} + +func (e K8sIoApimachineryPkgApisMetaV1LabelSelectorOperator) String() string { + return string(e) +} + +func (e *K8sIoApimachineryPkgApisMetaV1LabelSelectorOperator) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = K8sIoApimachineryPkgApisMetaV1LabelSelectorOperator(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorOperator", str) + } + return nil +} + +func (e K8sIoApimachineryPkgApisMetaV1LabelSelectorOperator) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) } diff --git a/apps/infra/internal/app/graph/namespace.resolvers.go b/apps/infra/internal/app/graph/namespace.resolvers.go new file mode 100644 index 000000000..3ad8cb588 --- /dev/null +++ b/apps/infra/internal/app/graph/namespace.resolvers.go @@ -0,0 +1,92 @@ +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.28 + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + "time" + + "github.com/kloudlite/api/apps/infra/internal/app/graph/generated" + "github.com/kloudlite/api/apps/infra/internal/app/graph/model" + "github.com/kloudlite/api/apps/infra/internal/entities" + fn "github.com/kloudlite/api/pkg/functions" + "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// CreationTime is the resolver for the creationTime field. +func (r *namespaceResolver) CreationTime(ctx context.Context, obj *entities.Namespace) (string, error) { + if obj == nil { + return "", errors.Newf("namespace/creation-time is nil") + } + return obj.CreationTime.Format(time.RFC3339), nil +} + +// ID is the resolver for the id field. +func (r *namespaceResolver) ID(ctx context.Context, obj *entities.Namespace) (string, error) { + if obj == nil { + return "", errors.Newf("namespace is nil") + } + return string(obj.Id), nil +} + +// Spec is the resolver for the spec field. +func (r *namespaceResolver) Spec(ctx context.Context, obj *entities.Namespace) (*model.K8sIoAPICoreV1NamespaceSpec, error) { + var m model.K8sIoAPICoreV1NamespaceSpec + if err := fn.JsonConversion(obj.Spec, &m); err != nil { + return nil, errors.NewE(err) + } + return &m, nil +} + +// Status is the resolver for the status field. +func (r *namespaceResolver) Status(ctx context.Context, obj *entities.Namespace) (*model.K8sIoAPICoreV1NamespaceStatus, error) { + var m model.K8sIoAPICoreV1NamespaceStatus + if err := fn.JsonConversion(obj.Status, &m); err != nil { + return nil, errors.NewE(err) + } + return &m, nil +} + +// UpdateTime is the resolver for the updateTime field. +func (r *namespaceResolver) UpdateTime(ctx context.Context, obj *entities.Namespace) (string, error) { + if obj == nil || obj.UpdateTime.IsZero() { + return "", errors.Newf("namespace/update-time is nil") + } + return obj.UpdateTime.Format(time.RFC3339), nil +} + +// Metadata is the resolver for the metadata field. +func (r *namespaceInResolver) Metadata(ctx context.Context, obj *entities.Namespace, data *v1.ObjectMeta) error { + if obj == nil { + return errors.Newf("namespace is nil") + } + return fn.JsonConversion(data, &obj.ObjectMeta) +} + +// Spec is the resolver for the spec field. +func (r *namespaceInResolver) Spec(ctx context.Context, obj *entities.Namespace, data *model.K8sIoAPICoreV1NamespaceSpecIn) error { + if obj == nil { + return errors.Newf("namespace is nil") + } + return fn.JsonConversion(data, &obj.Spec) +} + +// Status is the resolver for the status field. +func (r *namespaceInResolver) Status(ctx context.Context, obj *entities.Namespace, data *model.K8sIoAPICoreV1NamespaceStatusIn) error { + if obj == nil { + return errors.Newf("namespace obj is nil") + } + return fn.JsonConversion(data, &obj.Status) +} + +// Namespace returns generated.NamespaceResolver implementation. +func (r *Resolver) Namespace() generated.NamespaceResolver { return &namespaceResolver{r} } + +// NamespaceIn returns generated.NamespaceInResolver implementation. +func (r *Resolver) NamespaceIn() generated.NamespaceInResolver { return &namespaceInResolver{r} } + +type namespaceResolver struct{ *Resolver } +type namespaceInResolver struct{ *Resolver } diff --git a/apps/infra/internal/app/graph/node.resolvers.go b/apps/infra/internal/app/graph/node.resolvers.go new file mode 100644 index 000000000..c9500b133 --- /dev/null +++ b/apps/infra/internal/app/graph/node.resolvers.go @@ -0,0 +1,54 @@ +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.28 + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + "time" + + "github.com/kloudlite/api/apps/infra/internal/app/graph/generated" + "github.com/kloudlite/api/apps/infra/internal/app/graph/model" + "github.com/kloudlite/api/apps/infra/internal/entities" + fn "github.com/kloudlite/api/pkg/functions" +) + +// CreationTime is the resolver for the creationTime field. +func (r *nodeResolver) CreationTime(ctx context.Context, obj *entities.Node) (string, error) { + if obj == nil || obj.CreationTime.IsZero() { + return "", errors.Newf("node is nil") + } + return obj.CreationTime.Format(time.RFC3339), nil +} + +// ID is the resolver for the id field. +func (r *nodeResolver) ID(ctx context.Context, obj *entities.Node) (string, error) { + if obj == nil { + return "", errors.Newf("node is nil") + } + return string(obj.Id), nil +} + +// Spec is the resolver for the spec field. +func (r *nodeResolver) Spec(ctx context.Context, obj *entities.Node) (*model.GithubComKloudliteOperatorApisClustersV1NodeSpec, error) { + var m model.GithubComKloudliteOperatorApisClustersV1NodeSpec + if err := fn.JsonConversion(obj.Spec, &m); err != nil { + return nil, errors.NewE(err) + } + return &m, nil +} + +// UpdateTime is the resolver for the updateTime field. +func (r *nodeResolver) UpdateTime(ctx context.Context, obj *entities.Node) (string, error) { + if obj == nil || obj.UpdateTime.IsZero() { + return "", errors.Newf("node is nil") + } + return obj.UpdateTime.Format(time.RFC3339), nil +} + +// Node returns generated.NodeResolver implementation. +func (r *Resolver) Node() generated.NodeResolver { return &nodeResolver{r} } + +type nodeResolver struct{ *Resolver } diff --git a/apps/infra/internal/app/graph/nodepool.resolvers.go b/apps/infra/internal/app/graph/nodepool.resolvers.go index 7492810a6..a3e478c76 100644 --- a/apps/infra/internal/app/graph/nodepool.resolvers.go +++ b/apps/infra/internal/app/graph/nodepool.resolvers.go @@ -6,37 +6,59 @@ package graph import ( "context" + "github.com/kloudlite/api/pkg/errors" + "time" - "github.com/kloudlite/operator/pkg/operator" - "kloudlite.io/apps/infra/internal/app/graph/generated" - "kloudlite.io/apps/infra/internal/app/graph/model" - "kloudlite.io/apps/infra/internal/domain/entities" - fn "kloudlite.io/pkg/functions" + "github.com/kloudlite/api/apps/infra/internal/app/graph/generated" + "github.com/kloudlite/api/apps/infra/internal/app/graph/model" + "github.com/kloudlite/api/apps/infra/internal/entities" + fn "github.com/kloudlite/api/pkg/functions" + "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// CreationTime is the resolver for the creationTime field. +func (r *nodePoolResolver) CreationTime(ctx context.Context, obj *entities.NodePool) (string, error) { + if obj == nil || obj.CreationTime.IsZero() { + return "", errors.Newf("nodepool is nil") + } + return obj.CreationTime.Format(time.RFC3339), nil +} + +// ID is the resolver for the id field. +func (r *nodePoolResolver) ID(ctx context.Context, obj *entities.NodePool) (string, error) { + if obj == nil { + return "", errors.Newf("nodepool is nil") + } + return string(obj.Id), nil +} + // Spec is the resolver for the spec field. -func (r *nodePoolResolver) Spec(ctx context.Context, obj *entities.NodePool) (*model.NodePoolSpec, error) { - var m model.NodePoolSpec +func (r *nodePoolResolver) Spec(ctx context.Context, obj *entities.NodePool) (*model.GithubComKloudliteOperatorApisClustersV1NodePoolSpec, error) { + var m model.GithubComKloudliteOperatorApisClustersV1NodePoolSpec if err := fn.JsonConversion(obj.Spec, &m); err != nil { - return nil, err + return nil, errors.NewE(err) } return &m, nil } -// Status is the resolver for the status field. -func (r *nodePoolResolver) Status(ctx context.Context, obj *entities.NodePool) (*operator.Status, error) { - if obj == nil { - return nil, nil +// UpdateTime is the resolver for the updateTime field. +func (r *nodePoolResolver) UpdateTime(ctx context.Context, obj *entities.NodePool) (string, error) { + if obj == nil || obj.UpdateTime.IsZero() { + return "", errors.Newf("nodepool is nil") } - var op operator.Status - if err := fn.JsonConversion(obj.Status, &op); err != nil { - return nil, err + return obj.UpdateTime.Format(time.RFC3339), nil +} + +// Metadata is the resolver for the metadata field. +func (r *nodePoolInResolver) Metadata(ctx context.Context, obj *entities.NodePool, data *v1.ObjectMeta) error { + if obj == nil { + return errors.Newf("nodepool is nil") } - return &op, nil + return fn.JsonConversion(data, &obj.ObjectMeta) } // Spec is the resolver for the spec field. -func (r *nodePoolInResolver) Spec(ctx context.Context, obj *entities.NodePool, data *model.NodePoolSpecIn) error { +func (r *nodePoolInResolver) Spec(ctx context.Context, obj *entities.NodePool, data *model.GithubComKloudliteOperatorApisClustersV1NodePoolSpecIn) error { if obj == nil { return nil } diff --git a/apps/infra/internal/app/graph/persistentvolume.resolvers.go b/apps/infra/internal/app/graph/persistentvolume.resolvers.go new file mode 100644 index 000000000..5b69abf85 --- /dev/null +++ b/apps/infra/internal/app/graph/persistentvolume.resolvers.go @@ -0,0 +1,96 @@ +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.28 + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + "time" + + "github.com/kloudlite/api/apps/infra/internal/app/graph/generated" + "github.com/kloudlite/api/apps/infra/internal/app/graph/model" + "github.com/kloudlite/api/apps/infra/internal/entities" + fn "github.com/kloudlite/api/pkg/functions" + "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// CreationTime is the resolver for the creationTime field. +func (r *persistentVolumeResolver) CreationTime(ctx context.Context, obj *entities.PersistentVolume) (string, error) { + if obj == nil { + return "", errors.Newf("persistent-volume/creation-time is nil") + } + return obj.CreationTime.Format(time.RFC3339), nil +} + +// ID is the resolver for the id field. +func (r *persistentVolumeResolver) ID(ctx context.Context, obj *entities.PersistentVolume) (string, error) { + if obj == nil { + return "", errors.Newf("persitent volume is nil") + } + return string(obj.Id), nil +} + +// Spec is the resolver for the spec field. +func (r *persistentVolumeResolver) Spec(ctx context.Context, obj *entities.PersistentVolume) (*model.K8sIoAPICoreV1PersistentVolumeSpec, error) { + var m model.K8sIoAPICoreV1PersistentVolumeSpec + if err := fn.JsonConversion(obj.Spec, &m); err != nil { + return nil, errors.NewE(err) + } + return &m, nil +} + +// Status is the resolver for the status field. +func (r *persistentVolumeResolver) Status(ctx context.Context, obj *entities.PersistentVolume) (*model.K8sIoAPICoreV1PersistentVolumeStatus, error) { + var m model.K8sIoAPICoreV1PersistentVolumeStatus + if err := fn.JsonConversion(obj.Status, &m); err != nil { + return nil, errors.NewE(err) + } + return &m, nil +} + +// UpdateTime is the resolver for the updateTime field. +func (r *persistentVolumeResolver) UpdateTime(ctx context.Context, obj *entities.PersistentVolume) (string, error) { + if obj == nil || obj.UpdateTime.IsZero() { + return "", errors.Newf("persistent-volume/update-time is nil") + } + return obj.UpdateTime.Format(time.RFC3339), nil +} + +// Metadata is the resolver for the metadata field. +func (r *persistentVolumeInResolver) Metadata(ctx context.Context, obj *entities.PersistentVolume, data *v1.ObjectMeta) error { + if obj == nil { + return errors.Newf("persistance volume is nil") + } + return fn.JsonConversion(data, &obj.ObjectMeta) +} + +// Spec is the resolver for the spec field. +func (r *persistentVolumeInResolver) Spec(ctx context.Context, obj *entities.PersistentVolume, data *model.K8sIoAPICoreV1PersistentVolumeSpecIn) error { + if obj == nil { + return errors.Newf("persistance volume is nil") + } + return fn.JsonConversion(data, &obj.Spec) +} + +// Status is the resolver for the status field. +func (r *persistentVolumeInResolver) Status(ctx context.Context, obj *entities.PersistentVolume, data *model.K8sIoAPICoreV1PersistentVolumeStatusIn) error { + if obj == nil { + return errors.Newf("persistance volume is nil") + } + return fn.JsonConversion(data, &obj.Status) +} + +// PersistentVolume returns generated.PersistentVolumeResolver implementation. +func (r *Resolver) PersistentVolume() generated.PersistentVolumeResolver { + return &persistentVolumeResolver{r} +} + +// PersistentVolumeIn returns generated.PersistentVolumeInResolver implementation. +func (r *Resolver) PersistentVolumeIn() generated.PersistentVolumeInResolver { + return &persistentVolumeInResolver{r} +} + +type persistentVolumeResolver struct{ *Resolver } +type persistentVolumeInResolver struct{ *Resolver } diff --git a/apps/infra/internal/app/graph/persistentvolumeclaim.resolvers.go b/apps/infra/internal/app/graph/persistentvolumeclaim.resolvers.go new file mode 100644 index 000000000..dc2aa68d9 --- /dev/null +++ b/apps/infra/internal/app/graph/persistentvolumeclaim.resolvers.go @@ -0,0 +1,65 @@ +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.28 + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + "time" + + "github.com/kloudlite/api/apps/infra/internal/app/graph/generated" + "github.com/kloudlite/api/apps/infra/internal/app/graph/model" + "github.com/kloudlite/api/apps/infra/internal/entities" + fn "github.com/kloudlite/api/pkg/functions" +) + +// CreationTime is the resolver for the creationTime field. +func (r *persistentVolumeClaimResolver) CreationTime(ctx context.Context, obj *entities.PersistentVolumeClaim) (string, error) { + if obj == nil { + return "", errors.Newf("persistent-volume-claim/creation-time is nil") + } + return obj.CreationTime.Format(time.RFC3339), nil +} + +// ID is the resolver for the id field. +func (r *persistentVolumeClaimResolver) ID(ctx context.Context, obj *entities.PersistentVolumeClaim) (string, error) { + if obj == nil { + return "", errors.Newf("persitent volume claim is nil") + } + return string(obj.Id), nil +} + +// Spec is the resolver for the spec field. +func (r *persistentVolumeClaimResolver) Spec(ctx context.Context, obj *entities.PersistentVolumeClaim) (*model.K8sIoAPICoreV1PersistentVolumeClaimSpec, error) { + var m model.K8sIoAPICoreV1PersistentVolumeClaimSpec + if err := fn.JsonConversion(obj.Spec, &m); err != nil { + return nil, errors.NewE(err) + } + return &m, nil +} + +// Status is the resolver for the status field. +func (r *persistentVolumeClaimResolver) Status(ctx context.Context, obj *entities.PersistentVolumeClaim) (*model.K8sIoAPICoreV1PersistentVolumeClaimStatus, error) { + var m model.K8sIoAPICoreV1PersistentVolumeClaimStatus + if err := fn.JsonConversion(obj.Status, &m); err != nil { + return nil, errors.NewE(err) + } + return &m, nil +} + +// UpdateTime is the resolver for the updateTime field. +func (r *persistentVolumeClaimResolver) UpdateTime(ctx context.Context, obj *entities.PersistentVolumeClaim) (string, error) { + if obj == nil || obj.UpdateTime.IsZero() { + return "", errors.Newf("persistent-volume-claim/update-time is nil") + } + return obj.UpdateTime.Format(time.RFC3339), nil +} + +// PersistentVolumeClaim returns generated.PersistentVolumeClaimResolver implementation. +func (r *Resolver) PersistentVolumeClaim() generated.PersistentVolumeClaimResolver { + return &persistentVolumeClaimResolver{r} +} + +type persistentVolumeClaimResolver struct{ *Resolver } diff --git a/apps/infra/internal/app/graph/resolver-utils.go b/apps/infra/internal/app/graph/resolver-utils.go index dc7c033d7..01ad16ed9 100644 --- a/apps/infra/internal/app/graph/resolver-utils.go +++ b/apps/infra/internal/app/graph/resolver-utils.go @@ -2,13 +2,13 @@ package graph import ( "context" - "fmt" - "kloudlite.io/apps/infra/internal/domain" + "github.com/kloudlite/api/apps/infra/internal/domain" + "github.com/kloudlite/api/pkg/errors" ) -func toInfraContext(ctx context.Context) domain.InfraContext { +func toInfraContext(ctx context.Context) (domain.InfraContext, error) { if d, ok := ctx.Value("infra-ctx").(domain.InfraContext); ok { - return d + return d, nil } - panic(fmt.Errorf("infra context not found in gql context")) + return domain.InfraContext{}, errors.Newf("infra context not found in gql context") } diff --git a/apps/infra/internal/app/graph/resolver.go b/apps/infra/internal/app/graph/resolver.go index de6876771..fd6129fbc 100644 --- a/apps/infra/internal/app/graph/resolver.go +++ b/apps/infra/internal/app/graph/resolver.go @@ -1,6 +1,6 @@ package graph -import "kloudlite.io/apps/infra/internal/domain" +import "github.com/kloudlite/api/apps/infra/internal/domain" // This file will not be regenerated automatically. // diff --git a/apps/infra/internal/app/graph/scalars-override.resolvers.go b/apps/infra/internal/app/graph/scalars-override.resolvers.go deleted file mode 100644 index 84ced9e86..000000000 --- a/apps/infra/internal/app/graph/scalars-override.resolvers.go +++ /dev/null @@ -1,17 +0,0 @@ -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.28 - -import ( - "kloudlite.io/apps/infra/internal/app/graph/generated" - "kloudlite.io/common" -) - -func (r *Resolver) Metadata() generated.MetadataResolver { return &common.MetadataResolver{} } -func (r *Resolver) Status() generated.StatusResolver { return &common.StatusResolver{} } -func (r *Resolver) SyncStatus() generated.SyncStatusResolver { return &common.SyncStatusResolver{} } -func (r *Resolver) MetadataIn() generated.MetadataInResolver { return &common.MetadataInResolver{} } -func (r *Resolver) Patch() generated.PatchResolver { return &common.PatchResolver{} } -func (r *Resolver) PatchIn() generated.PatchInResolver { return &common.PatchInResolver{} } diff --git a/apps/infra/internal/app/graph/schema.graphqls b/apps/infra/internal/app/graph/schema.graphqls index 6113b167f..d6ad9a83c 100644 --- a/apps/infra/internal/app/graph/schema.graphqls +++ b/apps/infra/internal/app/graph/schema.graphqls @@ -1,68 +1,149 @@ directive @isLoggedIn on FIELD_DEFINITION +directive @isLoggedInAndVerified on FIELD_DEFINITION directive @hasAccount on FIELD_DEFINITION enum ResType { - byoc - cluster - cloudprovider - providersecret - edge + cluster + # cloudprovider + providersecret + # edge + nodepool + helm_release } type CheckNameAvailabilityOutput { - result: Boolean! - suggestedNames: [String!]! + result: Boolean! + suggestedNames: [String!]! +} + +input SearchCluster { + cloudProviderName: MatchFilterIn + isReady: MatchFilterIn + region: MatchFilterIn + text: MatchFilterIn +} + +input SearchClusterManagedService { + isReady: MatchFilterIn + text: MatchFilterIn +} + +input SearchNodepool { + text: MatchFilterIn +} + +input SearchHelmRelease { + text: MatchFilterIn + isReady: MatchFilterIn +} + +input SearchProviderSecret { + cloudProviderName: MatchFilterIn + text: MatchFilterIn +} + +input SearchDomainEntry { + clusterName: MatchFilterIn + text: MatchFilterIn +} + +input SearchPersistentVolumeClaims { + text: MatchFilterIn +} + +input SearchPersistentVolumes { + text: MatchFilterIn +} + +input SearchNamespaces { + text: MatchFilterIn +} + +input SearchVolumeAttachments { + text: MatchFilterIn +} + +type CheckAwsAccessOutput { + result: Boolean! + installationUrl: String } type Query { - # unique name suggestions - infra_checkNameAvailability(resType: ResType!, name: String!): CheckNameAvailabilityOutput! @isLoggedIn @hasAccount + # unique name suggestions + infra_checkNameAvailability(resType: ResType!, clusterName: String, name: String!): CheckNameAvailabilityOutput! @isLoggedIn @hasAccount + + # clusters + infra_listClusters(search: SearchCluster, pagination: CursorPaginationIn): ClusterPaginatedRecords @isLoggedInAndVerified @hasAccount + infra_getCluster(name: String!): Cluster @isLoggedInAndVerified @hasAccount + + # get node pools + infra_listNodePools(clusterName: String!, search: SearchNodepool, pagination: CursorPaginationIn): NodePoolPaginatedRecords @isLoggedInAndVerified @hasAccount + infra_getNodePool(clusterName: String!, poolName: String!): NodePool @isLoggedInAndVerified @hasAccount + + infra_listProviderSecrets(search: SearchProviderSecret, pagination: CursorPaginationIn): CloudProviderSecretPaginatedRecords @isLoggedInAndVerified @hasAccount + infra_getProviderSecret(name: String!): CloudProviderSecret @isLoggedInAndVerified @hasAccount + + infra_listDomainEntries(search: SearchDomainEntry, pagination: CursorPaginationIn): DomainEntryPaginatedRecords @isLoggedInAndVerified @hasAccount + infra_getDomainEntry(domainName: String!): DomainEntry @isLoggedInAndVerified @hasAccount + + infra_checkAwsAccess(cloudproviderName: String!): CheckAwsAccessOutput! @isLoggedInAndVerified @hasAccount + + infra_listClusterManagedServices(clusterName: String!, search: SearchClusterManagedService, pagination: CursorPaginationIn): ClusterManagedServicePaginatedRecords @isLoggedInAndVerified @hasAccount + infra_getClusterManagedService(clusterName: String!, name: String!): ClusterManagedService @isLoggedInAndVerified @hasAccount - # BYOC clusters - infra_listBYOCClusters: [BYOCCluster!] @isLoggedIn @hasAccount - infra_getBYOCCluster(name: String!): BYOCCluster @isLoggedIn @hasAccount + infra_listHelmReleases(clusterName: String!, search: SearchHelmRelease, pagination: CursorPaginationIn): HelmReleasePaginatedRecords @isLoggedInAndVerified @hasAccount + infra_getHelmRelease(clusterName: String!, name: String!): HelmRelease @isLoggedInAndVerified @hasAccount - # clusters - infra_listClusters: [Cluster!] @isLoggedIn @hasAccount - infra_getCluster(name: String!): Cluster @isLoggedIn @hasAccount + infra_listManagedServiceTemplates: [MsvcTemplate!] + infra_getManagedServiceTemplate(category: String!, name: String!): Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry - # cloud providers - infra_listCloudProviders: [CloudProvider!] @isLoggedIn @hasAccount - infra_getCloudProvider(name: String!): CloudProvider @isLoggedIn @hasAccount + # kubernetes native resources + infra_listPVCs(clusterName: String!, search: SearchPersistentVolumeClaims, pq: CursorPaginationIn): PersistentVolumeClaimPaginatedRecords @isLoggedInAndVerified @hasAccount + infra_getPVC(clusterName: String!, name: String!): PersistentVolumeClaim @isLoggedInAndVerified @hasAccount - # list edges - infra_listEdges(clusterName: String!, providerName: String): [Edge!] @isLoggedIn @hasAccount - infra_getEdge(clusterName: String!, name: String!): Edge @isLoggedIn @hasAccount + infra_listNamespaces(clusterName: String!, search: SearchNamespaces, pq: CursorPaginationIn): NamespacePaginatedRecords @isLoggedInAndVerified @hasAccount + infra_getNamespace(clusterName: String!, name: String!): Namespace @isLoggedInAndVerified @hasAccount - # get master nodes - infra_getMasterNodes(clusterName: String!): [MasterNode!] @isLoggedIn @hasAccount - infra_getWorkerNodes(clusterName: String!, edgeName: String!): [WorkerNode!] @isLoggedIn @hasAccount + infra_listPVs(clusterName: String!, search: SearchPersistentVolumes, pq: CursorPaginationIn): PersistentVolumePaginatedRecords @isLoggedInAndVerified @hasAccount + infra_getPV(clusterName: String!, name: String!): PersistentVolume @isLoggedInAndVerified @hasAccount - # get node pools - infra_getNodePools(clusterName: String!, edgeName: String!): [NodePool!] @isLoggedIn @hasAccount + infra_listVolumeAttachments(clusterName: String!, search: SearchVolumeAttachments, pq: CursorPaginationIn): VolumeAttachmentPaginatedRecords @isLoggedInAndVerified @hasAccount + infra_getVolumeAttachment(clusterName: String!, name: String!): VolumeAttachment @isLoggedInAndVerified @hasAccount } type Mutation { - # BYOC clusters - infra_createBYOCCluster(cluster: BYOCClusterIn!): BYOCCluster @isLoggedIn @hasAccount - infra_updateBYOCCluster(cluster: BYOCClusterIn!): BYOCCluster @isLoggedIn @hasAccount - infra_deleteBYOCCluster(name: String!): Boolean! @isLoggedIn @hasAccount - - # clusters - infra_createCluster(cluster: ClusterIn!): Cluster @isLoggedIn @hasAccount - infra_updateCluster(cluster: ClusterIn!): Cluster @isLoggedIn @hasAccount - infra_deleteCluster(name: String!): Boolean! @isLoggedIn @hasAccount - - # cloud provider - infra_createCloudProvider(cloudProvider: CloudProviderIn!, providerSecret: SecretIn!): CloudProvider @isLoggedIn @hasAccount - infra_updateCloudProvider(cloudProvider: CloudProviderIn!, providerSecret: SecretIn): CloudProvider @isLoggedIn @hasAccount - infra_deleteCloudProvider(name: String!): Boolean! @isLoggedIn @hasAccount - - # Edge Regions - infra_createEdge(edge: EdgeIn!): Edge @isLoggedIn @hasAccount - infra_updateEdge(edge: EdgeIn!): Edge @isLoggedIn @hasAccount - infra_deleteEdge(clusterName: String!, name: String!): Boolean! @isLoggedIn @hasAccount - - # Nodes - infra_deleteWorkerNode(clusterName: String!, edgeName: String!, name: String!): Boolean! @isLoggedIn @hasAccount + # clusters + infra_createCluster(cluster: ClusterIn!): Cluster @isLoggedInAndVerified @hasAccount + infra_updateCluster(cluster: ClusterIn!): Cluster @isLoggedInAndVerified @hasAccount + infra_deleteCluster(name: String!): Boolean! @isLoggedInAndVerified @hasAccount + # infra_resyncCluster(name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + infra_createProviderSecret(secret: CloudProviderSecretIn!): CloudProviderSecret @isLoggedInAndVerified @hasAccount + infra_updateProviderSecret(secret: CloudProviderSecretIn!): CloudProviderSecret @isLoggedInAndVerified @hasAccount + infra_deleteProviderSecret(secretName: String!): Boolean! @isLoggedInAndVerified @hasAccount + + infra_createDomainEntry(domainEntry: DomainEntryIn!): DomainEntry @isLoggedInAndVerified @hasAccount + infra_updateDomainEntry(domainEntry: DomainEntryIn!): DomainEntry @isLoggedInAndVerified @hasAccount + infra_deleteDomainEntry(domainName: String!): Boolean! @isLoggedInAndVerified @hasAccount + + infra_createNodePool(clusterName: String!, pool: NodePoolIn!): NodePool @isLoggedInAndVerified @hasAccount + infra_updateNodePool(clusterName: String!, pool: NodePoolIn!): NodePool @isLoggedInAndVerified @hasAccount + infra_deleteNodePool(clusterName: String!, poolName: String!): Boolean! @isLoggedInAndVerified @hasAccount + + infra_createClusterManagedService(clusterName: String!, service: ClusterManagedServiceIn!): ClusterManagedService @isLoggedInAndVerified @hasAccount + infra_updateClusterManagedService(clusterName: String!, service: ClusterManagedServiceIn!): ClusterManagedService @isLoggedInAndVerified @hasAccount + infra_deleteClusterManagedService(clusterName: String!, serviceName: String!): Boolean! @isLoggedInAndVerified @hasAccount + + infra_createHelmRelease(clusterName: String!, release: HelmReleaseIn!): HelmRelease @isLoggedInAndVerified @hasAccount + infra_updateHelmRelease(clusterName: String!, release: HelmReleaseIn!): HelmRelease @isLoggedInAndVerified @hasAccount + infra_deleteHelmRelease(clusterName: String!, releaseName: String!): Boolean! @isLoggedInAndVerified @hasAccount +} + +type EncodedValue { + value: String! + encoding: String! +} + +extend type Cluster { + adminKubeconfig: EncodedValue } diff --git a/apps/infra/internal/app/graph/schema.resolvers.go b/apps/infra/internal/app/graph/schema.resolvers.go index 217f60525..13b9059cd 100644 --- a/apps/infra/internal/app/graph/schema.resolvers.go +++ b/apps/infra/internal/app/graph/schema.resolvers.go @@ -6,164 +6,823 @@ package graph import ( "context" + "encoding/base64" - "kloudlite.io/apps/infra/internal/app/graph/generated" - "kloudlite.io/apps/infra/internal/domain" - "kloudlite.io/apps/infra/internal/domain/entities" + "github.com/kloudlite/api/apps/infra/internal/app/graph/generated" + "github.com/kloudlite/api/apps/infra/internal/app/graph/model" + "github.com/kloudlite/api/apps/infra/internal/domain" + "github.com/kloudlite/api/apps/infra/internal/entities" + "github.com/kloudlite/api/pkg/errors" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/repos" ) -// InfraCreateBYOCCluster is the resolver for the infra_createBYOCCluster field. -func (r *mutationResolver) InfraCreateBYOCCluster(ctx context.Context, cluster entities.BYOCCluster) (*entities.BYOCCluster, error) { - return r.Domain.CreateBYOCCluster(toInfraContext(ctx), cluster) -} - -// InfraUpdateBYOCCluster is the resolver for the infra_updateBYOCCluster field. -func (r *mutationResolver) InfraUpdateBYOCCluster(ctx context.Context, cluster entities.BYOCCluster) (*entities.BYOCCluster, error) { - return r.Domain.UpdateBYOCCluster(toInfraContext(ctx), cluster) -} - -// InfraDeleteBYOCCluster is the resolver for the infra_deleteBYOCCluster field. -func (r *mutationResolver) InfraDeleteBYOCCluster(ctx context.Context, name string) (bool, error) { - err := r.Domain.DeleteBYOCCluster(toInfraContext(ctx), name) +// AdminKubeconfig is the resolver for the adminKubeconfig field. +func (r *clusterResolver) AdminKubeconfig(ctx context.Context, obj *entities.Cluster) (*model.EncodedValue, error) { + ictx, err := toInfraContext(ctx) if err != nil { - return false, err + return nil, errors.NewE(err) } - return true, nil + s, err := r.Domain.GetClusterAdminKubeconfig(ictx, obj.Name) + if err != nil { + return nil, errors.NewE(err) + } + + if s == nil { + return nil, errors.Newf("kubeconfig could not be found") + } + + return &model.EncodedValue{ + Value: base64.StdEncoding.EncodeToString([]byte(*s)), + Encoding: "base64", + }, nil } // InfraCreateCluster is the resolver for the infra_createCluster field. func (r *mutationResolver) InfraCreateCluster(ctx context.Context, cluster entities.Cluster) (*entities.Cluster, error) { - return r.Domain.CreateCluster(toInfraContext(ctx), cluster) + ictx, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.CreateCluster(ictx, cluster) } // InfraUpdateCluster is the resolver for the infra_updateCluster field. func (r *mutationResolver) InfraUpdateCluster(ctx context.Context, cluster entities.Cluster) (*entities.Cluster, error) { - return r.Domain.UpdateCluster(toInfraContext(ctx), cluster) + ictx, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.Domain.UpdateCluster(ictx, cluster) } // InfraDeleteCluster is the resolver for the infra_deleteCluster field. func (r *mutationResolver) InfraDeleteCluster(ctx context.Context, name string) (bool, error) { - if err := r.Domain.DeleteCluster(toInfraContext(ctx), name); err != nil { - return false, err + ictx, err := toInfraContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + if err := r.Domain.DeleteCluster(ictx, name); err != nil { + return false, errors.NewE(err) } return true, nil } -// InfraCreateCloudProvider is the resolver for the infra_createCloudProvider field. -func (r *mutationResolver) InfraCreateCloudProvider(ctx context.Context, cloudProvider entities.CloudProvider, providerSecret entities.Secret) (*entities.CloudProvider, error) { - return r.Domain.CreateCloudProvider(toInfraContext(ctx), cloudProvider, providerSecret) +// InfraCreateProviderSecret is the resolver for the infra_createProviderSecret field. +func (r *mutationResolver) InfraCreateProviderSecret(ctx context.Context, secret entities.CloudProviderSecret) (*entities.CloudProviderSecret, error) { + ictx, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.Domain.CreateProviderSecret(ictx, secret) } -// InfraUpdateCloudProvider is the resolver for the infra_updateCloudProvider field. -func (r *mutationResolver) InfraUpdateCloudProvider(ctx context.Context, cloudProvider entities.CloudProvider, providerSecret *entities.Secret) (*entities.CloudProvider, error) { - return r.Domain.UpdateCloudProvider(toInfraContext(ctx), cloudProvider, providerSecret) +// InfraUpdateProviderSecret is the resolver for the infra_updateProviderSecret field. +func (r *mutationResolver) InfraUpdateProviderSecret(ctx context.Context, secret entities.CloudProviderSecret) (*entities.CloudProviderSecret, error) { + ictx, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.Domain.UpdateProviderSecret(ictx, secret) } -// InfraDeleteCloudProvider is the resolver for the infra_deleteCloudProvider field. -func (r *mutationResolver) InfraDeleteCloudProvider(ctx context.Context, name string) (bool, error) { - if err := r.Domain.DeleteCloudProvider(toInfraContext(ctx), name); err != nil { - return false, err +// InfraDeleteProviderSecret is the resolver for the infra_deleteProviderSecret field. +func (r *mutationResolver) InfraDeleteProviderSecret(ctx context.Context, secretName string) (bool, error) { + ictx, err := toInfraContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + + if err := r.Domain.DeleteProviderSecret(ictx, secretName); err != nil { + return false, errors.NewE(err) } return true, nil } -// InfraCreateEdge is the resolver for the infra_createEdge field. -func (r *mutationResolver) InfraCreateEdge(ctx context.Context, edge entities.Edge) (*entities.Edge, error) { - return r.Domain.CreateEdge(toInfraContext(ctx), edge) +// InfraCreateDomainEntry is the resolver for the infra_createDomainEntry field. +func (r *mutationResolver) InfraCreateDomainEntry(ctx context.Context, domainEntry entities.DomainEntry) (*entities.DomainEntry, error) { + ictx, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.CreateDomainEntry(ictx, domainEntry) } -// InfraUpdateEdge is the resolver for the infra_updateEdge field. -func (r *mutationResolver) InfraUpdateEdge(ctx context.Context, edge entities.Edge) (*entities.Edge, error) { - return r.Domain.UpdateEdge(toInfraContext(ctx), edge) +// InfraUpdateDomainEntry is the resolver for the infra_updateDomainEntry field. +func (r *mutationResolver) InfraUpdateDomainEntry(ctx context.Context, domainEntry entities.DomainEntry) (*entities.DomainEntry, error) { + ictx, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.UpdateDomainEntry(ictx, domainEntry) } -// InfraDeleteEdge is the resolver for the infra_deleteEdge field. -func (r *mutationResolver) InfraDeleteEdge(ctx context.Context, clusterName string, name string) (bool, error) { - if err := r.Domain.DeleteEdge(toInfraContext(ctx), clusterName, name); err != nil { - return false, err +// InfraDeleteDomainEntry is the resolver for the infra_deleteDomainEntry field. +func (r *mutationResolver) InfraDeleteDomainEntry(ctx context.Context, domainName string) (bool, error) { + ictx, err := toInfraContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + if err := r.Domain.DeleteDomainEntry(ictx, domainName); err != nil { + return false, errors.NewE(err) } return true, nil } -// InfraDeleteWorkerNode is the resolver for the infra_deleteWorkerNode field. -func (r *mutationResolver) InfraDeleteWorkerNode(ctx context.Context, clusterName string, edgeName string, name string) (bool, error) { - return r.Domain.DeleteWorkerNode(toInfraContext(ctx), clusterName, edgeName, name) +// InfraCreateNodePool is the resolver for the infra_createNodePool field. +func (r *mutationResolver) InfraCreateNodePool(ctx context.Context, clusterName string, pool entities.NodePool) (*entities.NodePool, error) { + ictx, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.Domain.CreateNodePool(ictx, clusterName, pool) } -// InfraCheckNameAvailability is the resolver for the infra_checkNameAvailability field. -func (r *queryResolver) InfraCheckNameAvailability(ctx context.Context, resType domain.ResType, name string) (*domain.CheckNameAvailabilityOutput, error) { - return r.Domain.CheckNameAvailability(toInfraContext(ctx), resType, name) +// InfraUpdateNodePool is the resolver for the infra_updateNodePool field. +func (r *mutationResolver) InfraUpdateNodePool(ctx context.Context, clusterName string, pool entities.NodePool) (*entities.NodePool, error) { + ictx, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.Domain.UpdateNodePool(ictx, clusterName, pool) +} + +// InfraDeleteNodePool is the resolver for the infra_deleteNodePool field. +func (r *mutationResolver) InfraDeleteNodePool(ctx context.Context, clusterName string, poolName string) (bool, error) { + ictx, err := toInfraContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + + if err := r.Domain.DeleteNodePool(ictx, clusterName, poolName); err != nil { + return false, errors.NewE(err) + } + return true, nil } -// InfraListBYOCClusters is the resolver for the infra_listBYOCClusters field. -func (r *queryResolver) InfraListBYOCClusters(ctx context.Context) ([]*entities.BYOCCluster, error) { - clusters, err := r.Domain.ListBYOCClusters(toInfraContext(ctx)) - if clusters == nil { - clusters = make([]*entities.BYOCCluster, 0) +// InfraCreateClusterManagedService is the resolver for the infra_createClusterManagedService field. +func (r *mutationResolver) InfraCreateClusterManagedService(ctx context.Context, clusterName string, service entities.ClusterManagedService) (*entities.ClusterManagedService, error) { + ictx, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) } - return clusters, err + return r.Domain.CreateClusterManagedService(ictx, clusterName, service) } -// InfraGetBYOCCluster is the resolver for the infra_getBYOCCluster field. -func (r *queryResolver) InfraGetBYOCCluster(ctx context.Context, name string) (*entities.BYOCCluster, error) { - return r.Domain.GetBYOCCluster(toInfraContext(ctx), name) +// InfraUpdateClusterManagedService is the resolver for the infra_updateClusterManagedService field. +func (r *mutationResolver) InfraUpdateClusterManagedService(ctx context.Context, clusterName string, service entities.ClusterManagedService) (*entities.ClusterManagedService, error) { + ictx, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.Domain.UpdateClusterManagedService(ictx, clusterName, service) +} + +// InfraDeleteClusterManagedService is the resolver for the infra_deleteClusterManagedService field. +func (r *mutationResolver) InfraDeleteClusterManagedService(ctx context.Context, clusterName string, serviceName string) (bool, error) { + ictx, err := toInfraContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + if err := r.Domain.DeleteClusterManagedService(ictx, clusterName, serviceName); err != nil { + return false, errors.NewE(err) + } + return true, nil +} + +// InfraCreateHelmRelease is the resolver for the infra_createHelmRelease field. +func (r *mutationResolver) InfraCreateHelmRelease(ctx context.Context, clusterName string, release entities.HelmRelease) (*entities.HelmRelease, error) { + ictx, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.CreateHelmRelease(ictx, clusterName, release) +} + +// InfraUpdateHelmRelease is the resolver for the infra_updateHelmRelease field. +func (r *mutationResolver) InfraUpdateHelmRelease(ctx context.Context, clusterName string, release entities.HelmRelease) (*entities.HelmRelease, error) { + ictx, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.UpdateHelmRelease(ictx, clusterName, release) +} + +// InfraDeleteHelmRelease is the resolver for the infra_deleteHelmRelease field. +func (r *mutationResolver) InfraDeleteHelmRelease(ctx context.Context, clusterName string, releaseName string) (bool, error) { + ictx, err := toInfraContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + if err := r.Domain.DeleteHelmRelease(ictx, clusterName, releaseName); err != nil { + return false, err + } + return true, nil +} + +// InfraCheckNameAvailability is the resolver for the infra_checkNameAvailability field. +func (r *queryResolver) InfraCheckNameAvailability(ctx context.Context, resType domain.ResType, clusterName *string, name string) (*domain.CheckNameAvailabilityOutput, error) { + ictx, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.Domain.CheckNameAvailability(ictx, resType, clusterName, name) } // InfraListClusters is the resolver for the infra_listClusters field. -func (r *queryResolver) InfraListClusters(ctx context.Context) ([]*entities.Cluster, error) { - cls, err := r.Domain.ListClusters(toInfraContext(ctx)) - if cls == nil { - cls = make([]*entities.Cluster, 0) +func (r *queryResolver) InfraListClusters(ctx context.Context, search *model.SearchCluster, pagination *repos.CursorPagination) (*model.ClusterPaginatedRecords, error) { + ictx, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) } - return cls, err + + if pagination == nil { + pagination = &repos.DefaultCursorPagination + } + + filter := map[string]repos.MatchFilter{} + + if search != nil { + if search.IsReady != nil { + filter["status.isReady"] = *search.IsReady + } + + if search.CloudProviderName != nil { + filter["spec.cloudProvider"] = *search.CloudProviderName + } + + if search.Region != nil { + filter["spec.region"] = *search.Region + } + + if search.Text != nil { + filter["metadata.name"] = *search.Text + } + } + + pClusters, err := r.Domain.ListClusters(ictx, filter, *pagination) + if err != nil { + return nil, errors.NewE(err) + } + + ce := make([]*model.ClusterEdge, len(pClusters.Edges)) + for i := range pClusters.Edges { + ce[i] = &model.ClusterEdge{ + Node: pClusters.Edges[i].Node, + Cursor: pClusters.Edges[i].Cursor, + } + } + + m := model.ClusterPaginatedRecords{ + Edges: ce, + PageInfo: &model.PageInfo{ + EndCursor: &pClusters.PageInfo.EndCursor, + HasNextPage: pClusters.PageInfo.HasNextPage, + HasPreviousPage: pClusters.PageInfo.HasPrevPage, + StartCursor: &pClusters.PageInfo.StartCursor, + }, + TotalCount: int(pClusters.TotalCount), + } + + return &m, nil } // InfraGetCluster is the resolver for the infra_getCluster field. func (r *queryResolver) InfraGetCluster(ctx context.Context, name string) (*entities.Cluster, error) { - return r.Domain.GetCluster(toInfraContext(ctx), name) + ictx, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.Domain.GetCluster(ictx, name) +} + +// InfraListNodePools is the resolver for the infra_listNodePools field. +func (r *queryResolver) InfraListNodePools(ctx context.Context, clusterName string, search *model.SearchNodepool, pagination *repos.CursorPagination) (*model.NodePoolPaginatedRecords, error) { + ictx, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + if pagination == nil { + pagination = &repos.DefaultCursorPagination + } + + filter := map[string]repos.MatchFilter{} + + if search != nil { + if search.Text != nil { + filter["metadata.name"] = *search.Text + } + } + + pNodePools, err := r.Domain.ListNodePools(ictx, clusterName, filter, *pagination) + if err != nil { + return nil, errors.NewE(err) + } + + pe := make([]*model.NodePoolEdge, len(pNodePools.Edges)) + for i := range pNodePools.Edges { + pe[i] = &model.NodePoolEdge{ + Node: pNodePools.Edges[i].Node, + Cursor: pNodePools.Edges[i].Cursor, + } + } + + m := model.NodePoolPaginatedRecords{ + Edges: pe, + PageInfo: &model.PageInfo{ + EndCursor: &pNodePools.PageInfo.EndCursor, + HasNextPage: pNodePools.PageInfo.HasNextPage, + HasPreviousPage: pNodePools.PageInfo.HasPrevPage, + StartCursor: &pNodePools.PageInfo.StartCursor, + }, + TotalCount: int(pNodePools.TotalCount), + } + + return &m, nil +} + +// InfraGetNodePool is the resolver for the infra_getNodePool field. +func (r *queryResolver) InfraGetNodePool(ctx context.Context, clusterName string, poolName string) (*entities.NodePool, error) { + ictx, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.Domain.GetNodePool(ictx, clusterName, poolName) +} + +// InfraListProviderSecrets is the resolver for the infra_listProviderSecrets field. +func (r *queryResolver) InfraListProviderSecrets(ctx context.Context, search *model.SearchProviderSecret, pagination *repos.CursorPagination) (*model.CloudProviderSecretPaginatedRecords, error) { + ictx, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + if pagination == nil { + pagination = &repos.DefaultCursorPagination + } + + filter := map[string]repos.MatchFilter{} + + if search != nil { + if search.Text != nil { + filter["metadata.name"] = *search.Text + } + + if search.CloudProviderName != nil { + filter["cloudProviderName"] = *search.CloudProviderName + } + } + + pSecrets, err := r.Domain.ListProviderSecrets(ictx, filter, *pagination) + if err != nil { + return nil, errors.NewE(err) + } + + pe := make([]*model.CloudProviderSecretEdge, len(pSecrets.Edges)) + for i := range pSecrets.Edges { + pe[i] = &model.CloudProviderSecretEdge{ + Node: pSecrets.Edges[i].Node, + Cursor: pSecrets.Edges[i].Cursor, + } + } + + m := model.CloudProviderSecretPaginatedRecords{ + Edges: pe, + PageInfo: &model.PageInfo{ + EndCursor: &pSecrets.PageInfo.EndCursor, + HasNextPage: pSecrets.PageInfo.HasNextPage, + HasPreviousPage: pSecrets.PageInfo.HasPrevPage, + StartCursor: &pSecrets.PageInfo.StartCursor, + }, + TotalCount: int(pSecrets.TotalCount), + } + + return &m, nil } -// InfraListCloudProviders is the resolver for the infra_listCloudProviders field. -func (r *queryResolver) InfraListCloudProviders(ctx context.Context) ([]*entities.CloudProvider, error) { - cp, err := r.Domain.ListCloudProviders(toInfraContext(ctx)) - if cp == nil { - cp = make([]*entities.CloudProvider, 0) +// InfraGetProviderSecret is the resolver for the infra_getProviderSecret field. +func (r *queryResolver) InfraGetProviderSecret(ctx context.Context, name string) (*entities.CloudProviderSecret, error) { + ictx, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) } - return cp, err + + return r.Domain.GetProviderSecret(ictx, name) } -// InfraGetCloudProvider is the resolver for the infra_getCloudProvider field. -func (r *queryResolver) InfraGetCloudProvider(ctx context.Context, name string) (*entities.CloudProvider, error) { - return r.Domain.GetCloudProvider(toInfraContext(ctx), name) +// InfraListDomainEntries is the resolver for the infra_listDomainEntries field. +func (r *queryResolver) InfraListDomainEntries(ctx context.Context, search *model.SearchDomainEntry, pagination *repos.CursorPagination) (*model.DomainEntryPaginatedRecords, error) { + ictx, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + filter := map[string]repos.MatchFilter{} + + if search != nil { + if search.Text != nil { + filter["metadata.name"] = *search.Text + } + + if search.ClusterName != nil { + filter["spec.clusterName"] = *search.ClusterName + } + } + + dEntries, err := r.Domain.ListDomainEntries(ictx, filter, fn.DefaultIfNil(pagination, repos.DefaultCursorPagination)) + if err != nil { + return nil, errors.NewE(err) + } + + edges := make([]*model.DomainEntryEdge, len(dEntries.Edges)) + for i := range dEntries.Edges { + edges[i] = &model.DomainEntryEdge{ + Node: dEntries.Edges[i].Node, + Cursor: dEntries.Edges[i].Cursor, + } + } + + m := model.DomainEntryPaginatedRecords{ + Edges: edges, + PageInfo: &model.PageInfo{ + EndCursor: &dEntries.PageInfo.EndCursor, + HasNextPage: dEntries.PageInfo.HasNextPage, + HasPreviousPage: dEntries.PageInfo.HasPrevPage, + StartCursor: &dEntries.PageInfo.StartCursor, + }, + TotalCount: int(dEntries.TotalCount), + } + + return &m, nil } -// InfraListEdges is the resolver for the infra_listEdges field. -func (r *queryResolver) InfraListEdges(ctx context.Context, clusterName string, providerName *string) ([]*entities.Edge, error) { - e, err := r.Domain.ListEdges(toInfraContext(ctx), clusterName, providerName) - if e == nil { - e = make([]*entities.Edge, 0) +// InfraGetDomainEntry is the resolver for the infra_getDomainEntry field. +func (r *queryResolver) InfraGetDomainEntry(ctx context.Context, domainName string) (*entities.DomainEntry, error) { + ictx, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) } - return e, err + + return r.Domain.GetDomainEntry(ictx, domainName) } -// InfraGetEdge is the resolver for the infra_getEdge field. -func (r *queryResolver) InfraGetEdge(ctx context.Context, clusterName string, name string) (*entities.Edge, error) { - return r.Domain.GetEdge(toInfraContext(ctx), clusterName, name) +// InfraCheckAwsAccess is the resolver for the infra_checkAwsAccess field. +func (r *queryResolver) InfraCheckAwsAccess(ctx context.Context, cloudproviderName string) (*model.CheckAwsAccessOutput, error) { + ictx, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + output, err := r.Domain.ValidateProviderSecretAWSAccess(ictx, cloudproviderName) + if err != nil { + return nil, errors.NewE(err) + } + + return &model.CheckAwsAccessOutput{ + Result: output.Result, + InstallationURL: output.InstallationURL, + }, nil } -// InfraGetMasterNodes is the resolver for the infra_getMasterNodes field. -func (r *queryResolver) InfraGetMasterNodes(ctx context.Context, clusterName string) ([]*entities.MasterNode, error) { - return r.Domain.GetMasterNodes(toInfraContext(ctx), clusterName) +// InfraListClusterManagedServices is the resolver for the infra_listClusterManagedServices field. +func (r *queryResolver) InfraListClusterManagedServices(ctx context.Context, clusterName string, search *model.SearchClusterManagedService, pagination *repos.CursorPagination) (*model.ClusterManagedServicePaginatedRecords, error) { + ictx, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + if pagination == nil { + pagination = &repos.DefaultCursorPagination + } + + filter := map[string]repos.MatchFilter{} + + if search != nil { + if search.IsReady != nil { + filter["status.isReady"] = *search.IsReady + } + + if search.Text != nil { + filter["metadata.name"] = *search.Text + } + } + + pClusters, err := r.Domain.ListClusterManagedServices(ictx, clusterName, filter, *pagination) + if err != nil { + return nil, errors.NewE(err) + } + + ce := make([]*model.ClusterManagedServiceEdge, len(pClusters.Edges)) + for i := range pClusters.Edges { + ce[i] = &model.ClusterManagedServiceEdge{ + Node: pClusters.Edges[i].Node, + Cursor: pClusters.Edges[i].Cursor, + } + } + + m := model.ClusterManagedServicePaginatedRecords{ + Edges: ce, + PageInfo: &model.PageInfo{ + EndCursor: &pClusters.PageInfo.EndCursor, + HasNextPage: pClusters.PageInfo.HasNextPage, + HasPreviousPage: pClusters.PageInfo.HasPrevPage, + StartCursor: &pClusters.PageInfo.StartCursor, + }, + TotalCount: int(pClusters.TotalCount), + } + + return &m, nil } -// InfraGetWorkerNodes is the resolver for the infra_getWorkerNodes field. -func (r *queryResolver) InfraGetWorkerNodes(ctx context.Context, clusterName string, edgeName string) ([]*entities.WorkerNode, error) { - return r.Domain.GetWorkerNodes(toInfraContext(ctx), clusterName, edgeName) +// InfraGetClusterManagedService is the resolver for the infra_getClusterManagedService field. +func (r *queryResolver) InfraGetClusterManagedService(ctx context.Context, clusterName string, name string) (*entities.ClusterManagedService, error) { + ictx, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.Domain.GetClusterManagedService(ictx, clusterName, name) } -// InfraGetNodePools is the resolver for the infra_getNodePools field. -func (r *queryResolver) InfraGetNodePools(ctx context.Context, clusterName string, edgeName string) ([]*entities.NodePool, error) { - return r.Domain.GetNodePools(toInfraContext(ctx), clusterName, edgeName) +// InfraListHelmReleases is the resolver for the infra_listHelmReleases field. +func (r *queryResolver) InfraListHelmReleases(ctx context.Context, clusterName string, search *model.SearchHelmRelease, pagination *repos.CursorPagination) (*model.HelmReleasePaginatedRecords, error) { + ictx, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + if pagination == nil { + pagination = &repos.DefaultCursorPagination + } + + filter := map[string]repos.MatchFilter{} + + if search != nil { + if search.IsReady != nil { + filter["status.isReady"] = *search.IsReady + } + + if search.Text != nil { + filter["metadata.name"] = *search.Text + } + } + + pRelease, err := r.Domain.ListHelmReleases(ictx, clusterName, filter, *pagination) + if err != nil { + return nil, errors.NewE(err) + } + + ce := make([]*model.HelmReleaseEdge, len(pRelease.Edges)) + for i := range pRelease.Edges { + ce[i] = &model.HelmReleaseEdge{ + Node: pRelease.Edges[i].Node, + Cursor: pRelease.Edges[i].Cursor, + } + } + + m := model.HelmReleasePaginatedRecords{ + Edges: ce, + PageInfo: &model.PageInfo{ + EndCursor: &pRelease.PageInfo.EndCursor, + HasNextPage: pRelease.PageInfo.HasNextPage, + HasPreviousPage: pRelease.PageInfo.HasPrevPage, + StartCursor: &pRelease.PageInfo.StartCursor, + }, + TotalCount: int(pRelease.TotalCount), + } + + return &m, nil +} + +// InfraGetHelmRelease is the resolver for the infra_getHelmRelease field. +func (r *queryResolver) InfraGetHelmRelease(ctx context.Context, clusterName string, name string) (*entities.HelmRelease, error) { + ictx, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.Domain.GetHelmRelease(ictx, clusterName, name) +} + +// InfraListManagedServiceTemplates is the resolver for the infra_listManagedServiceTemplates field. +func (r *queryResolver) InfraListManagedServiceTemplates(ctx context.Context) ([]*entities.MsvcTemplate, error) { + return r.Domain.ListManagedSvcTemplates() +} + +// InfraGetManagedServiceTemplate is the resolver for the infra_getManagedServiceTemplate field. +func (r *queryResolver) InfraGetManagedServiceTemplate(ctx context.Context, category string, name string) (*entities.MsvcTemplateEntry, error) { + return r.Domain.GetManagedSvcTemplate(category, name) +} + +// InfraListPVCs is the resolver for the infra_listPVCs field. +func (r *queryResolver) InfraListPVCs(ctx context.Context, clusterName string, search *model.SearchPersistentVolumeClaims, pq *repos.CursorPagination) (*model.PersistentVolumeClaimPaginatedRecords, error) { + filter := map[string]repos.MatchFilter{} + if search != nil { + if search.Text != nil { + filter["metadata.name"] = *search.Text + } + } + + cc, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + pvcs, err := r.Domain.ListPVCs(cc, clusterName, filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) + if err != nil { + return nil, errors.NewE(err) + } + + ve := make([]*model.PersistentVolumeClaimEdge, len(pvcs.Edges)) + for i := range pvcs.Edges { + ve[i] = &model.PersistentVolumeClaimEdge{ + Node: pvcs.Edges[i].Node, + Cursor: pvcs.Edges[i].Cursor, + } + } + + m := model.PersistentVolumeClaimPaginatedRecords{ + Edges: ve, + PageInfo: &model.PageInfo{ + EndCursor: &pvcs.PageInfo.EndCursor, + HasNextPage: pvcs.PageInfo.HasNextPage, + HasPreviousPage: pvcs.PageInfo.HasPrevPage, + StartCursor: &pvcs.PageInfo.StartCursor, + }, + TotalCount: int(pvcs.TotalCount), + } + + return &m, nil +} + +// InfraGetPvc is the resolver for the infra_getPVC field. +func (r *queryResolver) InfraGetPvc(ctx context.Context, clusterName string, name string) (*entities.PersistentVolumeClaim, error) { + cc, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + return r.Domain.GetPVC(cc, clusterName, name) +} + +// InfraListNamespaces is the resolver for the infra_listNamespaces field. +func (r *queryResolver) InfraListNamespaces(ctx context.Context, clusterName string, search *model.SearchNamespaces, pq *repos.CursorPagination) (*model.NamespacePaginatedRecords, error) { + filter := map[string]repos.MatchFilter{} + if search != nil { + if search.Text != nil { + filter["metadata.name"] = *search.Text + } + } + + cc, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + namespaces, err := r.Domain.ListNamespaces(cc, clusterName, filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) + if err != nil { + return nil, errors.NewE(err) + } + + ve := make([]*model.NamespaceEdge, len(namespaces.Edges)) + for i := range namespaces.Edges { + ve[i] = &model.NamespaceEdge{ + Node: namespaces.Edges[i].Node, + Cursor: namespaces.Edges[i].Cursor, + } + } + + m := model.NamespacePaginatedRecords{ + Edges: ve, + PageInfo: &model.PageInfo{ + EndCursor: &namespaces.PageInfo.EndCursor, + HasNextPage: namespaces.PageInfo.HasNextPage, + HasPreviousPage: namespaces.PageInfo.HasPrevPage, + StartCursor: &namespaces.PageInfo.StartCursor, + }, + TotalCount: int(namespaces.TotalCount), + } + + return &m, nil +} + +// InfraGetNamespace is the resolver for the infra_getNamespace field. +func (r *queryResolver) InfraGetNamespace(ctx context.Context, clusterName string, name string) (*entities.Namespace, error) { + cc, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.GetNamespace(cc, clusterName, name) +} + +// InfraListPVs is the resolver for the infra_listPVs field. +func (r *queryResolver) InfraListPVs(ctx context.Context, clusterName string, search *model.SearchPersistentVolumes, pq *repos.CursorPagination) (*model.PersistentVolumePaginatedRecords, error) { + filter := map[string]repos.MatchFilter{} + if search != nil { + if search.Text != nil { + filter["metadata.name"] = *search.Text + } + } + + cc, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + pvs, err := r.Domain.ListPVs(cc, clusterName, filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) + if err != nil { + return nil, errors.NewE(err) + } + + ve := make([]*model.PersistentVolumeEdge, len(pvs.Edges)) + for i := range pvs.Edges { + ve[i] = &model.PersistentVolumeEdge{ + Node: pvs.Edges[i].Node, + Cursor: pvs.Edges[i].Cursor, + } + } + + m := model.PersistentVolumePaginatedRecords{ + Edges: ve, + PageInfo: &model.PageInfo{ + EndCursor: &pvs.PageInfo.EndCursor, + HasNextPage: pvs.PageInfo.HasNextPage, + HasPreviousPage: pvs.PageInfo.HasPrevPage, + StartCursor: &pvs.PageInfo.StartCursor, + }, + TotalCount: int(pvs.TotalCount), + } + + return &m, nil +} + +// InfraGetPv is the resolver for the infra_getPV field. +func (r *queryResolver) InfraGetPv(ctx context.Context, clusterName string, name string) (*entities.PersistentVolume, error) { + cc, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.GetPV(cc, clusterName, name) +} + +// InfraListVolumeAttachments is the resolver for the infra_listVolumeAttachments field. +func (r *queryResolver) InfraListVolumeAttachments(ctx context.Context, clusterName string, search *model.SearchVolumeAttachments, pq *repos.CursorPagination) (*model.VolumeAttachmentPaginatedRecords, error) { + filter := map[string]repos.MatchFilter{} + if search != nil { + if search.Text != nil { + filter["metadata.name"] = *search.Text + } + } + + cc, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + volatt, err := r.Domain.ListVolumeAttachments(cc, clusterName, filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) + if err != nil { + return nil, errors.NewE(err) + } + + ve := make([]*model.VolumeAttachmentEdge, len(volatt.Edges)) + for i := range volatt.Edges { + ve[i] = &model.VolumeAttachmentEdge{ + Node: volatt.Edges[i].Node, + Cursor: volatt.Edges[i].Cursor, + } + } + + m := model.VolumeAttachmentPaginatedRecords{ + Edges: ve, + PageInfo: &model.PageInfo{ + EndCursor: &volatt.PageInfo.EndCursor, + HasNextPage: volatt.PageInfo.HasNextPage, + HasPreviousPage: volatt.PageInfo.HasPrevPage, + StartCursor: &volatt.PageInfo.StartCursor, + }, + TotalCount: int(volatt.TotalCount), + } + + return &m, nil +} + +// InfraGetVolumeAttachment is the resolver for the infra_getVolumeAttachment field. +func (r *queryResolver) InfraGetVolumeAttachment(ctx context.Context, clusterName string, name string) (*entities.VolumeAttachment, error) { + cc, err := toInfraContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.GetVolumeAttachment(cc, clusterName, name) } // Mutation returns generated.MutationResolver implementation. diff --git a/apps/infra/internal/app/graph/secret.resolvers.go b/apps/infra/internal/app/graph/secret.resolvers.go deleted file mode 100644 index 5d995e6e4..000000000 --- a/apps/infra/internal/app/graph/secret.resolvers.go +++ /dev/null @@ -1,80 +0,0 @@ -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.28 - -import ( - "context" - - corev1 "k8s.io/api/core/v1" - "kloudlite.io/apps/infra/internal/app/graph/generated" - "kloudlite.io/apps/infra/internal/domain/entities" - fn "kloudlite.io/pkg/functions" -) - -// StringData is the resolver for the stringData field. -func (r *secretResolver) StringData(ctx context.Context, obj *entities.Secret) (map[string]interface{}, error) { - if obj == nil { - return nil, nil - } - var m map[string]any - if err := fn.JsonConversion(obj.StringData, &m); err != nil { - return nil, err - } - return m, nil -} - -// Data is the resolver for the data field. -func (r *secretResolver) Data(ctx context.Context, obj *entities.Secret) (map[string]interface{}, error) { - if obj == nil { - return nil, nil - } - var m map[string]any - if err := fn.JsonConversion(obj.Data, &m); err != nil { - return nil, err - } - return m, nil -} - -// Type is the resolver for the type field. -func (r *secretResolver) Type(ctx context.Context, obj *entities.Secret) (*string, error) { - if obj == nil { - return nil, nil - } - return fn.New(string(obj.Type)), nil -} - -// StringData is the resolver for the stringData field. -func (r *secretInResolver) StringData(ctx context.Context, obj *entities.Secret, data map[string]interface{}) error { - if obj == nil { - return nil - } - return fn.JsonConversion(data, &obj.StringData) -} - -// Data is the resolver for the data field. -func (r *secretInResolver) Data(ctx context.Context, obj *entities.Secret, data map[string]interface{}) error { - if obj == nil { - return nil - } - return fn.JsonConversion(data, &obj.Data) -} - -// Type is the resolver for the type field. -func (r *secretInResolver) Type(ctx context.Context, obj *entities.Secret, data *string) error { - if obj == nil { - return nil - } - obj.Type = corev1.SecretType(*data) - return nil -} - -// Secret returns generated.SecretResolver implementation. -func (r *Resolver) Secret() generated.SecretResolver { return &secretResolver{r} } - -// SecretIn returns generated.SecretInResolver implementation. -func (r *Resolver) SecretIn() generated.SecretInResolver { return &secretInResolver{r} } - -type secretResolver struct{ *Resolver } -type secretInResolver struct{ *Resolver } diff --git a/apps/infra/internal/app/graph/struct-to-graphql/cloudprovidersecret.graphqls b/apps/infra/internal/app/graph/struct-to-graphql/cloudprovidersecret.graphqls new file mode 100644 index 000000000..5072b45c4 --- /dev/null +++ b/apps/infra/internal/app/graph/struct-to-graphql/cloudprovidersecret.graphqls @@ -0,0 +1,33 @@ +type CloudProviderSecret @shareable { + accountName: String! + aws: Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials + cloudProviderName: Github__com___kloudlite___operator___apis___common____types__CloudProvider! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + id: String! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata! @goField(name: "objectMeta") + recordVersion: Int! + updateTime: Date! +} + +type CloudProviderSecretEdge @shareable { + cursor: String! + node: CloudProviderSecret! +} + +type CloudProviderSecretPaginatedRecords @shareable { + edges: [CloudProviderSecretEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input CloudProviderSecretIn { + aws: Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentialsIn + cloudProviderName: Github__com___kloudlite___operator___apis___common____types__CloudProvider! + displayName: String! + metadata: MetadataIn! +} + diff --git a/apps/infra/internal/app/graph/struct-to-graphql/cluster.graphqls b/apps/infra/internal/app/graph/struct-to-graphql/cluster.graphqls new file mode 100644 index 000000000..9bfd52de0 --- /dev/null +++ b/apps/infra/internal/app/graph/struct-to-graphql/cluster.graphqls @@ -0,0 +1,37 @@ +type Cluster @shareable { + accountName: String! + apiVersion: String + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata! @goField(name: "objectMeta") + recordVersion: Int! + spec: Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec! + status: Github__com___kloudlite___operator___pkg___operator__Status + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type ClusterEdge @shareable { + cursor: String! + node: Cluster! +} + +type ClusterPaginatedRecords @shareable { + edges: [ClusterEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input ClusterIn { + apiVersion: String + displayName: String! + kind: String + metadata: MetadataIn! + spec: Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpecIn! +} + diff --git a/apps/infra/internal/app/graph/struct-to-graphql/clustermanagedservice.graphqls b/apps/infra/internal/app/graph/struct-to-graphql/clustermanagedservice.graphqls new file mode 100644 index 000000000..552c31450 --- /dev/null +++ b/apps/infra/internal/app/graph/struct-to-graphql/clustermanagedservice.graphqls @@ -0,0 +1,38 @@ +type ClusterManagedService @shareable { + accountName: String! + apiVersion: String + clusterName: String! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + recordVersion: Int! + spec: Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec + status: Github__com___kloudlite___operator___pkg___operator__Status + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type ClusterManagedServiceEdge @shareable { + cursor: String! + node: ClusterManagedService! +} + +type ClusterManagedServicePaginatedRecords @shareable { + edges: [ClusterManagedServiceEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input ClusterManagedServiceIn { + apiVersion: String + displayName: String! + kind: String + metadata: MetadataIn + spec: Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpecIn +} + diff --git a/apps/infra/internal/app/graph/struct-to-graphql/common-types.graphqls b/apps/infra/internal/app/graph/struct-to-graphql/common-types.graphqls new file mode 100644 index 000000000..de9e72aba --- /dev/null +++ b/apps/infra/internal/app/graph/struct-to-graphql/common-types.graphqls @@ -0,0 +1,1344 @@ +type Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials @shareable { + accessKey: String + awsAccountId: String + cfParamExternalID: String + cfParamInstanceProfileName: String + cfParamRoleName: String + cfParamStackName: String + cfParamTrustedARN: String + secretKey: String +} + +type Github__com___kloudlite___api___apps___infra___internal___entities__InputField @shareable { + defaultValue: Any + displayUnit: String + inputType: String! + label: String! + max: Float + min: Float + multiplier: Float + name: String! + required: Boolean + unit: String +} + +type Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate @shareable { + apiVersion: String + description: String! + displayName: String! + fields: [Github__com___kloudlite___api___apps___infra___internal___entities__InputField!]! + kind: String + name: String! + outputs: [Github__com___kloudlite___api___apps___infra___internal___entities__OutputField!]! +} + +type Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry @shareable { + active: Boolean! + apiVersion: String + description: String! + displayName: String! + fields: [Github__com___kloudlite___api___apps___infra___internal___entities__InputField!]! + kind: String + logoUrl: String! + name: String! + outputs: [Github__com___kloudlite___api___apps___infra___internal___entities__OutputField!]! + resources: [Github__com___kloudlite___api___apps___infra___internal___entities__MresTemplate!]! +} + +type Github__com___kloudlite___api___apps___infra___internal___entities__OutputField @shareable { + description: String! + label: String! + name: String! +} + +type Github__com___kloudlite___api___common__CreatedOrUpdatedBy @shareable { + userEmail: String! + userId: String! + userName: String! +} + +type Github__com___kloudlite___api___pkg___types__SyncStatus @shareable { + action: Github__com___kloudlite___api___pkg___types__SyncAction! + error: String + lastSyncedAt: Date + recordVersion: Int! + state: Github__com___kloudlite___api___pkg___types__SyncState! + syncScheduledAt: Date +} + +type Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig @shareable { + k3sMasters: Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig + nodePools: Map + region: String! + spotNodePools: Map +} + +type Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig @shareable { + iamInstanceProfileRole: String + imageId: String! + imageSSHUsername: String! + instanceType: String! + nodes: Map + nvidiaGpuEnabled: Boolean! + rootVolumeSize: Int! + rootVolumeType: String! +} + +type Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig @shareable { + availabilityZone: String! + ec2Pool: Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig + iamInstanceProfileRole: String + imageId: String! + imageSSHUsername: String! + nvidiaGpuEnabled: Boolean! + poolType: Github__com___kloudlite___operator___apis___clusters___v1__AWSPoolType! + rootVolumeSize: Int! + rootVolumeType: String! + spotPool: Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig +} + +type Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfig @shareable { + instanceType: String! + nodes: Map +} + +type Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode @shareable { + memoryPerVcpu: Github__com___kloudlite___operator___apis___common____types__MinMaxFloat + vcpu: Github__com___kloudlite___operator___apis___common____types__MinMaxFloat! +} + +type Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNode @shareable { + instanceTypes: [String!]! +} + +type Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfig @shareable { + cpuNode: Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNode + gpuNode: Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNode + nodes: Map + spotFleetTaggingRoleName: String! +} + +type Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys @shareable { + keyAccessKey: String! + keyAWSAccountId: String! + keyAWSAssumeRoleExternalID: String! + keyAWSAssumeRoleRoleARN: String! + keyIAMInstanceProfileRole: String! + keySecretKey: String! +} + +type Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput @shareable { + jobName: String! + jobNamespace: String! + keyK3sAgentJoinToken: String! + keyK3sServerJoinToken: String! + keyKubeconfig: String! + secretName: String! +} + +type Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec @shareable { + accountId: String! + accountName: String! + availabilityMode: Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpecAvailabilityMode! + aws: Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig + backupToS3Enabled: Boolean! + cloudflareEnabled: Boolean + cloudProvider: Github__com___kloudlite___operator___apis___common____types__CloudProvider! + clusterInternalDnsHost: String + clusterTokenRef: Github__com___kloudlite___operator___apis___common____types__SecretKeyRef + credentialKeys: Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys + credentialsRef: Github__com___kloudlite___operator___apis___common____types__SecretRef! + kloudliteRelease: String! + messageQueueTopicName: String! + output: Github__com___kloudlite___operator___apis___clusters___v1__ClusterOutput + publicDNSHost: String! + taintMasterNodes: Boolean! +} + +type Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode @shareable { + cloudProviderAccessKey: Github__com___kloudlite___operator___apis___common____types__SecretKeyRef! + cloudProviderSecretKey: Github__com___kloudlite___operator___apis___common____types__SecretKeyRef! + jobName: String + jobNamespace: String + stateS3BucketFilePath: String! + stateS3BucketName: String! + stateS3BucketRegion: String! +} + +type Github__com___kloudlite___operator___apis___clusters___v1__MasterNodeProps @shareable { + availabilityZone: String! + lastRecreatedAt: Date + role: String! +} + +type Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec @shareable { + aws: Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig + cloudProvider: Github__com___kloudlite___operator___apis___common____types__CloudProvider! + iac: Github__com___kloudlite___operator___apis___clusters___v1__InfrastuctureAsCode! + maxCount: Int! + minCount: Int! + nodeLabels: Map + nodeTaints: [K8s__io___api___core___v1__Taint!] +} + +type Github__com___kloudlite___operator___apis___clusters___v1__NodeProps @shareable { + lastRecreatedAt: Date +} + +type Github__com___kloudlite___operator___apis___clusters___v1__NodeSpec @shareable { + nodepoolName: String! +} + +type Github__com___kloudlite___operator___apis___common____types__MinMaxFloat @shareable { + max: String! + min: String! +} + +type Github__com___kloudlite___operator___apis___common____types__SecretKeyRef @shareable { + key: String! + name: String! + namespace: String +} + +type Github__com___kloudlite___operator___apis___common____types__SecretRef @shareable { + name: String! + namespace: String +} + +type Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpec @shareable { + msvcSpec: Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec! + targetNamespace: String! +} + +type Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec @shareable { + chartName: String! + chartRepoURL: String! + chartVersion: String! + jobVars: Github__com___kloudlite___operator___apis___crds___v1__JobVars + postInstall: String + postUninstall: String + preInstall: String + preUninstall: String + values: Map! +} + +type Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus @shareable { + checks: Map + isReady: Boolean! + lastReadyGeneration: Int + lastReconcileTime: Date + message: Github__com___kloudlite___operator___pkg___raw____json__RawJson + releaseNotes: String! + releaseStatus: String! + resources: [Github__com___kloudlite___operator___pkg___operator__ResourceRef!] +} + +type Github__com___kloudlite___operator___apis___crds___v1__JobVars @shareable { + affinity: K8s__io___api___core___v1__Affinity + backOffLimit: Int + nodeSelector: Map + tolerations: [K8s__io___api___core___v1__Toleration!] +} + +type Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec @shareable { + serviceTemplate: Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate! +} + +type Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate @shareable { + apiVersion: String! + kind: String! + spec: Map! +} + +type Github__com___kloudlite___operator___pkg___operator__Check @shareable { + generation: Int + message: String + status: Boolean! +} + +type Github__com___kloudlite___operator___pkg___operator__ResourceRef @shareable { + apiVersion: String! + kind: String! + name: String! + namespace: String! +} + +type Github__com___kloudlite___operator___pkg___operator__Status @shareable { + checks: Map + isReady: Boolean! + lastReadyGeneration: Int + lastReconcileTime: Date + message: Github__com___kloudlite___operator___pkg___raw____json__RawJson + resources: [Github__com___kloudlite___operator___pkg___operator__ResourceRef!] +} + +type Github__com___kloudlite___operator___pkg___raw____json__RawJson @shareable { + RawMessage: Any +} + +type K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource @shareable { + fsType: String + partition: Int + readOnly: Boolean + volumeID: String! +} + +type K8s__io___api___core___v1__Affinity @shareable { + nodeAffinity: K8s__io___api___core___v1__NodeAffinity + podAffinity: K8s__io___api___core___v1__PodAffinity + podAntiAffinity: K8s__io___api___core___v1__PodAntiAffinity +} + +type K8s__io___api___core___v1__AzureDiskVolumeSource @shareable { + cachingMode: String + diskName: String! + diskURI: String! + fsType: String + kind: String + readOnly: Boolean +} + +type K8s__io___api___core___v1__AzureFilePersistentVolumeSource @shareable { + readOnly: Boolean + secretName: String! + secretNamespace: String + shareName: String! +} + +type K8s__io___api___core___v1__CSIPersistentVolumeSource @shareable { + controllerExpandSecretRef: K8s__io___api___core___v1__SecretReference + controllerPublishSecretRef: K8s__io___api___core___v1__SecretReference + driver: String! + fsType: String + nodeExpandSecretRef: K8s__io___api___core___v1__SecretReference + nodePublishSecretRef: K8s__io___api___core___v1__SecretReference + nodeStageSecretRef: K8s__io___api___core___v1__SecretReference + readOnly: Boolean + volumeAttributes: Map + volumeHandle: String! +} + +type K8s__io___api___core___v1__CephFSPersistentVolumeSource @shareable { + monitors: [String!]! + path: String + readOnly: Boolean + secretFile: String + secretRef: K8s__io___api___core___v1__SecretReference + user: String +} + +type K8s__io___api___core___v1__CinderPersistentVolumeSource @shareable { + fsType: String + readOnly: Boolean + secretRef: K8s__io___api___core___v1__SecretReference + volumeID: String! +} + +type K8s__io___api___core___v1__FCVolumeSource @shareable { + fsType: String + lun: Int + readOnly: Boolean + targetWWNs: [String!] + wwids: [String!] +} + +type K8s__io___api___core___v1__FlexPersistentVolumeSource @shareable { + driver: String! + fsType: String + options: Map + readOnly: Boolean + secretRef: K8s__io___api___core___v1__SecretReference +} + +type K8s__io___api___core___v1__FlockerVolumeSource @shareable { + datasetName: String + datasetUUID: String +} + +type K8s__io___api___core___v1__GCEPersistentDiskVolumeSource @shareable { + fsType: String + partition: Int + pdName: String! + readOnly: Boolean +} + +type K8s__io___api___core___v1__GlusterfsPersistentVolumeSource @shareable { + endpoints: String! + endpointsNamespace: String + path: String! + readOnly: Boolean +} + +type K8s__io___api___core___v1__HostPathVolumeSource @shareable { + path: String! + type: String +} + +type K8s__io___api___core___v1__ISCSIPersistentVolumeSource @shareable { + chapAuthDiscovery: Boolean + chapAuthSession: Boolean + fsType: String + initiatorName: String + iqn: String! + iscsiInterface: String + lun: Int! + portals: [String!] + readOnly: Boolean + secretRef: K8s__io___api___core___v1__SecretReference + targetPortal: String! +} + +type K8s__io___api___core___v1__LocalVolumeSource @shareable { + fsType: String + path: String! +} + +type K8s__io___api___core___v1__NFSVolumeSource @shareable { + path: String! + readOnly: Boolean + server: String! +} + +type K8s__io___api___core___v1__NamespaceCondition @shareable { + lastTransitionTime: Date + message: String + reason: String + status: K8s__io___api___core___v1__ConditionStatus! + type: K8s__io___api___core___v1__NamespaceConditionType! +} + +type K8s__io___api___core___v1__NamespaceSpec @shareable { + finalizers: [String!] +} + +type K8s__io___api___core___v1__NamespaceStatus @shareable { + conditions: [K8s__io___api___core___v1__NamespaceCondition!] + phase: K8s__io___api___core___v1__NamespacePhase +} + +type K8s__io___api___core___v1__NodeAffinity @shareable { + preferredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__PreferredSchedulingTerm!] + requiredDuringSchedulingIgnoredDuringExecution: K8s__io___api___core___v1__NodeSelector +} + +type K8s__io___api___core___v1__NodeSelector @shareable { + nodeSelectorTerms: [K8s__io___api___core___v1__NodeSelectorTerm!]! +} + +type K8s__io___api___core___v1__NodeSelectorRequirement @shareable { + key: String! + operator: K8s__io___api___core___v1__NodeSelectorOperator! + values: [String!] +} + +type K8s__io___api___core___v1__NodeSelectorTerm @shareable { + matchExpressions: [K8s__io___api___core___v1__NodeSelectorRequirement!] + matchFields: [K8s__io___api___core___v1__NodeSelectorRequirement!] +} + +type K8s__io___api___core___v1__ObjectReference @shareable { + apiVersion: String + fieldPath: String + kind: String + name: String + namespace: String + resourceVersion: String + uid: String +} + +type K8s__io___api___core___v1__PersistentVolumeClaimCondition @shareable { + lastProbeTime: Date + lastTransitionTime: Date + message: String + reason: String + status: K8s__io___api___core___v1__ConditionStatus! + type: K8s__io___api___core___v1__PersistentVolumeClaimConditionType! +} + +type K8s__io___api___core___v1__PersistentVolumeClaimSpec @shareable { + accessModes: [String!] + dataSource: K8s__io___api___core___v1__TypedLocalObjectReference + dataSourceRef: K8s__io___api___core___v1__TypedObjectReference + resources: K8s__io___api___core___v1__ResourceRequirements + selector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector + storageClassName: String + volumeMode: String + volumeName: String +} + +type K8s__io___api___core___v1__PersistentVolumeClaimStatus @shareable { + accessModes: [String!] + allocatedResources: Map + allocatedResourceStatuses: Map + capacity: Map + conditions: [K8s__io___api___core___v1__PersistentVolumeClaimCondition!] + phase: K8s__io___api___core___v1__PersistentVolumeClaimPhase +} + +type K8s__io___api___core___v1__PersistentVolumeSpec @shareable { + accessModes: [String!] + awsElasticBlockStore: K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSource + azureDisk: K8s__io___api___core___v1__AzureDiskVolumeSource + azureFile: K8s__io___api___core___v1__AzureFilePersistentVolumeSource + capacity: Map + cephfs: K8s__io___api___core___v1__CephFSPersistentVolumeSource + cinder: K8s__io___api___core___v1__CinderPersistentVolumeSource + claimRef: K8s__io___api___core___v1__ObjectReference + csi: K8s__io___api___core___v1__CSIPersistentVolumeSource + fc: K8s__io___api___core___v1__FCVolumeSource + flexVolume: K8s__io___api___core___v1__FlexPersistentVolumeSource + flocker: K8s__io___api___core___v1__FlockerVolumeSource + gcePersistentDisk: K8s__io___api___core___v1__GCEPersistentDiskVolumeSource + glusterfs: K8s__io___api___core___v1__GlusterfsPersistentVolumeSource + hostPath: K8s__io___api___core___v1__HostPathVolumeSource + iscsi: K8s__io___api___core___v1__ISCSIPersistentVolumeSource + local: K8s__io___api___core___v1__LocalVolumeSource + mountOptions: [String!] + nfs: K8s__io___api___core___v1__NFSVolumeSource + nodeAffinity: K8s__io___api___core___v1__VolumeNodeAffinity + persistentVolumeReclaimPolicy: K8s__io___api___core___v1__PersistentVolumeReclaimPolicy + photonPersistentDisk: K8s__io___api___core___v1__PhotonPersistentDiskVolumeSource + portworxVolume: K8s__io___api___core___v1__PortworxVolumeSource + quobyte: K8s__io___api___core___v1__QuobyteVolumeSource + rbd: K8s__io___api___core___v1__RBDPersistentVolumeSource + scaleIO: K8s__io___api___core___v1__ScaleIOPersistentVolumeSource + storageClassName: String + storageos: K8s__io___api___core___v1__StorageOSPersistentVolumeSource + volumeMode: String + vsphereVolume: K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource +} + +type K8s__io___api___core___v1__PersistentVolumeStatus @shareable { + lastPhaseTransitionTime: Date + message: String + phase: K8s__io___api___core___v1__PersistentVolumePhase + reason: String +} + +type K8s__io___api___core___v1__PhotonPersistentDiskVolumeSource @shareable { + fsType: String + pdID: String! +} + +type K8s__io___api___core___v1__PodAffinity @shareable { + preferredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__WeightedPodAffinityTerm!] + requiredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__PodAffinityTerm!] +} + +type K8s__io___api___core___v1__PodAffinityTerm @shareable { + labelSelector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector + namespaces: [String!] + namespaceSelector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector + topologyKey: String! +} + +type K8s__io___api___core___v1__PodAntiAffinity @shareable { + preferredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__WeightedPodAffinityTerm!] + requiredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__PodAffinityTerm!] +} + +type K8s__io___api___core___v1__PortworxVolumeSource @shareable { + fsType: String + readOnly: Boolean + volumeID: String! +} + +type K8s__io___api___core___v1__PreferredSchedulingTerm @shareable { + preference: K8s__io___api___core___v1__NodeSelectorTerm! + weight: Int! +} + +type K8s__io___api___core___v1__QuobyteVolumeSource @shareable { + group: String + readOnly: Boolean + registry: String! + tenant: String + user: String + volume: String! +} + +type K8s__io___api___core___v1__RBDPersistentVolumeSource @shareable { + fsType: String + image: String! + keyring: String + monitors: [String!]! + pool: String + readOnly: Boolean + secretRef: K8s__io___api___core___v1__SecretReference + user: String +} + +type K8s__io___api___core___v1__ResourceClaim @shareable { + name: String! +} + +type K8s__io___api___core___v1__ResourceRequirements @shareable { + claims: [K8s__io___api___core___v1__ResourceClaim!] + limits: Map + requests: Map +} + +type K8s__io___api___core___v1__ScaleIOPersistentVolumeSource @shareable { + fsType: String + gateway: String! + protectionDomain: String + readOnly: Boolean + secretRef: K8s__io___api___core___v1__SecretReference + sslEnabled: Boolean + storageMode: String + storagePool: String + system: String! + volumeName: String +} + +type K8s__io___api___core___v1__SecretReference @shareable { + name: String + namespace: String +} + +type K8s__io___api___core___v1__StorageOSPersistentVolumeSource @shareable { + fsType: String + readOnly: Boolean + secretRef: K8s__io___api___core___v1__ObjectReference + volumeName: String + volumeNamespace: String +} + +type K8s__io___api___core___v1__Taint @shareable { + effect: K8s__io___api___core___v1__TaintEffect! + key: String! + timeAdded: Date + value: String +} + +type K8s__io___api___core___v1__Toleration @shareable { + effect: K8s__io___api___core___v1__TaintEffect + key: String + operator: K8s__io___api___core___v1__TolerationOperator + tolerationSeconds: Int + value: String +} + +type K8s__io___api___core___v1__TypedLocalObjectReference @shareable { + apiGroup: String + kind: String! + name: String! +} + +type K8s__io___api___core___v1__TypedObjectReference @shareable { + apiGroup: String + kind: String! + name: String! + namespace: String +} + +type K8s__io___api___core___v1__VolumeNodeAffinity @shareable { + required: K8s__io___api___core___v1__NodeSelector +} + +type K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource @shareable { + fsType: String + storagePolicyID: String + storagePolicyName: String + volumePath: String! +} + +type K8s__io___api___core___v1__WeightedPodAffinityTerm @shareable { + podAffinityTerm: K8s__io___api___core___v1__PodAffinityTerm! + weight: Int! +} + +type K8s__io___api___storage___v1__VolumeAttachmentSource @shareable { + inlineVolumeSpec: K8s__io___api___core___v1__PersistentVolumeSpec + persistentVolumeName: String +} + +type K8s__io___api___storage___v1__VolumeAttachmentSpec @shareable { + attacher: String! + nodeName: String! + source: K8s__io___api___storage___v1__VolumeAttachmentSource! +} + +type K8s__io___api___storage___v1__VolumeAttachmentStatus @shareable { + attached: Boolean! + attachError: K8s__io___api___storage___v1__VolumeError + attachmentMetadata: Map + detachError: K8s__io___api___storage___v1__VolumeError +} + +type K8s__io___api___storage___v1__VolumeError @shareable { + message: String + time: Date +} + +type K8s__io___apimachinery___pkg___api___resource__Quantity @shareable { + Format: K8s__io___apimachinery___pkg___api___resource__Format! +} + +type K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector @shareable { + matchExpressions: [K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement!] + matchLabels: Map +} + +type K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement @shareable { + key: String! + operator: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorOperator! + values: [String!] +} + +type Metadata @shareable { + annotations: Map + creationTimestamp: Date! + deletionTimestamp: Date + generation: Int! + labels: Map + name: String! + namespace: String +} + +type PageInfo @shareable { + endCursor: String + hasNextPage: Boolean + hasPreviousPage: Boolean + startCursor: String +} + +input Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentialsIn { + accessKey: String + awsAccountId: String + secretKey: String +} + +input Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfigIn { + k3sMasters: Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfigIn + region: String! +} + +input Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfigIn { + instanceType: String! + nvidiaGpuEnabled: Boolean! +} + +input Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfigIn { + availabilityZone: String! + ec2Pool: Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfigIn + nvidiaGpuEnabled: Boolean! + poolType: Github__com___kloudlite___operator___apis___clusters___v1__AWSPoolType! + spotPool: Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfigIn +} + +input Github__com___kloudlite___operator___apis___clusters___v1__AwsEC2PoolConfigIn { + instanceType: String! + nodes: Map +} + +input Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNodeIn { + memoryPerVcpu: Github__com___kloudlite___operator___apis___common____types__MinMaxFloatIn + vcpu: Github__com___kloudlite___operator___apis___common____types__MinMaxFloatIn! +} + +input Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNodeIn { + instanceTypes: [String!]! +} + +input Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConfigIn { + cpuNode: Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotCpuNodeIn + gpuNode: Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotGpuNodeIn + nodes: Map +} + +input Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpecIn { + availabilityMode: Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpecAvailabilityMode! + aws: Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfigIn + cloudflareEnabled: Boolean + cloudProvider: Github__com___kloudlite___operator___apis___common____types__CloudProvider! + credentialsRef: Github__com___kloudlite___operator___apis___common____types__SecretRefIn! +} + +input Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpecIn { + aws: Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfigIn + cloudProvider: Github__com___kloudlite___operator___apis___common____types__CloudProvider! + maxCount: Int! + minCount: Int! + nodeLabels: Map + nodeTaints: [K8s__io___api___core___v1__TaintIn!] +} + +input Github__com___kloudlite___operator___apis___clusters___v1__NodePropsIn { + lastRecreatedAt: Date +} + +input Github__com___kloudlite___operator___apis___clusters___v1__NodeSpecIn { + nodepoolName: String! +} + +input Github__com___kloudlite___operator___apis___common____types__MinMaxFloatIn { + max: String! + min: String! +} + +input Github__com___kloudlite___operator___apis___common____types__SecretRefIn { + name: String! + namespace: String +} + +input Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpecIn { + msvcSpec: Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn! + targetNamespace: String! +} + +input Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpecIn { + chartName: String! + chartRepoURL: String! + chartVersion: String! + jobVars: Github__com___kloudlite___operator___apis___crds___v1__JobVarsIn + postInstall: String + postUninstall: String + preInstall: String + preUninstall: String + values: Map! +} + +input Github__com___kloudlite___operator___apis___crds___v1__JobVarsIn { + affinity: K8s__io___api___core___v1__AffinityIn + backOffLimit: Int + nodeSelector: Map + tolerations: [K8s__io___api___core___v1__TolerationIn!] +} + +input Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn { + serviceTemplate: Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn! +} + +input Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn { + apiVersion: String! + kind: String! + spec: Map! +} + +input K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSourceIn { + fsType: String + partition: Int + readOnly: Boolean + volumeID: String! +} + +input K8s__io___api___core___v1__AffinityIn { + nodeAffinity: K8s__io___api___core___v1__NodeAffinityIn + podAffinity: K8s__io___api___core___v1__PodAffinityIn + podAntiAffinity: K8s__io___api___core___v1__PodAntiAffinityIn +} + +input K8s__io___api___core___v1__AzureDiskVolumeSourceIn { + cachingMode: String + diskName: String! + diskURI: String! + fsType: String + kind: String + readOnly: Boolean +} + +input K8s__io___api___core___v1__AzureFilePersistentVolumeSourceIn { + readOnly: Boolean + secretName: String! + secretNamespace: String + shareName: String! +} + +input K8s__io___api___core___v1__CSIPersistentVolumeSourceIn { + controllerExpandSecretRef: K8s__io___api___core___v1__SecretReferenceIn + controllerPublishSecretRef: K8s__io___api___core___v1__SecretReferenceIn + driver: String! + fsType: String + nodeExpandSecretRef: K8s__io___api___core___v1__SecretReferenceIn + nodePublishSecretRef: K8s__io___api___core___v1__SecretReferenceIn + nodeStageSecretRef: K8s__io___api___core___v1__SecretReferenceIn + readOnly: Boolean + volumeAttributes: Map + volumeHandle: String! +} + +input K8s__io___api___core___v1__CephFSPersistentVolumeSourceIn { + monitors: [String!]! + path: String + readOnly: Boolean + secretFile: String + secretRef: K8s__io___api___core___v1__SecretReferenceIn + user: String +} + +input K8s__io___api___core___v1__CinderPersistentVolumeSourceIn { + fsType: String + readOnly: Boolean + secretRef: K8s__io___api___core___v1__SecretReferenceIn + volumeID: String! +} + +input K8s__io___api___core___v1__FCVolumeSourceIn { + fsType: String + lun: Int + readOnly: Boolean + targetWWNs: [String!] + wwids: [String!] +} + +input K8s__io___api___core___v1__FlexPersistentVolumeSourceIn { + driver: String! + fsType: String + options: Map + readOnly: Boolean + secretRef: K8s__io___api___core___v1__SecretReferenceIn +} + +input K8s__io___api___core___v1__FlockerVolumeSourceIn { + datasetName: String + datasetUUID: String +} + +input K8s__io___api___core___v1__GCEPersistentDiskVolumeSourceIn { + fsType: String + partition: Int + pdName: String! + readOnly: Boolean +} + +input K8s__io___api___core___v1__GlusterfsPersistentVolumeSourceIn { + endpoints: String! + endpointsNamespace: String + path: String! + readOnly: Boolean +} + +input K8s__io___api___core___v1__HostPathVolumeSourceIn { + path: String! + type: String +} + +input K8s__io___api___core___v1__ISCSIPersistentVolumeSourceIn { + chapAuthDiscovery: Boolean + chapAuthSession: Boolean + fsType: String + initiatorName: String + iqn: String! + iscsiInterface: String + lun: Int! + portals: [String!] + readOnly: Boolean + secretRef: K8s__io___api___core___v1__SecretReferenceIn + targetPortal: String! +} + +input K8s__io___api___core___v1__LocalVolumeSourceIn { + fsType: String + path: String! +} + +input K8s__io___api___core___v1__NFSVolumeSourceIn { + path: String! + readOnly: Boolean + server: String! +} + +input K8s__io___api___core___v1__NamespaceConditionIn { + lastTransitionTime: Date + message: String + reason: String + status: K8s__io___api___core___v1__ConditionStatus! + type: K8s__io___api___core___v1__NamespaceConditionType! +} + +input K8s__io___api___core___v1__NamespaceSpecIn { + finalizers: [String!] +} + +input K8s__io___api___core___v1__NamespaceStatusIn { + conditions: [K8s__io___api___core___v1__NamespaceConditionIn!] + phase: K8s__io___api___core___v1__NamespacePhase +} + +input K8s__io___api___core___v1__NodeAffinityIn { + preferredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__PreferredSchedulingTermIn!] + requiredDuringSchedulingIgnoredDuringExecution: K8s__io___api___core___v1__NodeSelectorIn +} + +input K8s__io___api___core___v1__NodeSelectorIn { + nodeSelectorTerms: [K8s__io___api___core___v1__NodeSelectorTermIn!]! +} + +input K8s__io___api___core___v1__NodeSelectorRequirementIn { + key: String! + operator: K8s__io___api___core___v1__NodeSelectorOperator! + values: [String!] +} + +input K8s__io___api___core___v1__NodeSelectorTermIn { + matchExpressions: [K8s__io___api___core___v1__NodeSelectorRequirementIn!] + matchFields: [K8s__io___api___core___v1__NodeSelectorRequirementIn!] +} + +input K8s__io___api___core___v1__ObjectReferenceIn { + apiVersion: String + fieldPath: String + kind: String + name: String + namespace: String + resourceVersion: String + uid: String +} + +input K8s__io___api___core___v1__PersistentVolumeClaimConditionIn { + lastProbeTime: Date + lastTransitionTime: Date + message: String + reason: String + status: K8s__io___api___core___v1__ConditionStatus! + type: K8s__io___api___core___v1__PersistentVolumeClaimConditionType! +} + +input K8s__io___api___core___v1__PersistentVolumeClaimSpecIn { + accessModes: [String!] + dataSource: K8s__io___api___core___v1__TypedLocalObjectReferenceIn + dataSourceRef: K8s__io___api___core___v1__TypedObjectReferenceIn + resources: K8s__io___api___core___v1__ResourceRequirementsIn + selector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorIn + storageClassName: String + volumeMode: String + volumeName: String +} + +input K8s__io___api___core___v1__PersistentVolumeClaimStatusIn { + accessModes: [String!] + allocatedResources: Map + allocatedResourceStatuses: Map + capacity: Map + conditions: [K8s__io___api___core___v1__PersistentVolumeClaimConditionIn!] + phase: K8s__io___api___core___v1__PersistentVolumeClaimPhase +} + +input K8s__io___api___core___v1__PersistentVolumeSpecIn { + accessModes: [String!] + awsElasticBlockStore: K8s__io___api___core___v1__AWSElasticBlockStoreVolumeSourceIn + azureDisk: K8s__io___api___core___v1__AzureDiskVolumeSourceIn + azureFile: K8s__io___api___core___v1__AzureFilePersistentVolumeSourceIn + capacity: Map + cephfs: K8s__io___api___core___v1__CephFSPersistentVolumeSourceIn + cinder: K8s__io___api___core___v1__CinderPersistentVolumeSourceIn + claimRef: K8s__io___api___core___v1__ObjectReferenceIn + csi: K8s__io___api___core___v1__CSIPersistentVolumeSourceIn + fc: K8s__io___api___core___v1__FCVolumeSourceIn + flexVolume: K8s__io___api___core___v1__FlexPersistentVolumeSourceIn + flocker: K8s__io___api___core___v1__FlockerVolumeSourceIn + gcePersistentDisk: K8s__io___api___core___v1__GCEPersistentDiskVolumeSourceIn + glusterfs: K8s__io___api___core___v1__GlusterfsPersistentVolumeSourceIn + hostPath: K8s__io___api___core___v1__HostPathVolumeSourceIn + iscsi: K8s__io___api___core___v1__ISCSIPersistentVolumeSourceIn + local: K8s__io___api___core___v1__LocalVolumeSourceIn + mountOptions: [String!] + nfs: K8s__io___api___core___v1__NFSVolumeSourceIn + nodeAffinity: K8s__io___api___core___v1__VolumeNodeAffinityIn + persistentVolumeReclaimPolicy: K8s__io___api___core___v1__PersistentVolumeReclaimPolicy + photonPersistentDisk: K8s__io___api___core___v1__PhotonPersistentDiskVolumeSourceIn + portworxVolume: K8s__io___api___core___v1__PortworxVolumeSourceIn + quobyte: K8s__io___api___core___v1__QuobyteVolumeSourceIn + rbd: K8s__io___api___core___v1__RBDPersistentVolumeSourceIn + scaleIO: K8s__io___api___core___v1__ScaleIOPersistentVolumeSourceIn + storageClassName: String + storageos: K8s__io___api___core___v1__StorageOSPersistentVolumeSourceIn + volumeMode: String + vsphereVolume: K8s__io___api___core___v1__VsphereVirtualDiskVolumeSourceIn +} + +input K8s__io___api___core___v1__PersistentVolumeStatusIn { + lastPhaseTransitionTime: Date + message: String + phase: K8s__io___api___core___v1__PersistentVolumePhase + reason: String +} + +input K8s__io___api___core___v1__PhotonPersistentDiskVolumeSourceIn { + fsType: String + pdID: String! +} + +input K8s__io___api___core___v1__PodAffinityIn { + preferredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__WeightedPodAffinityTermIn!] + requiredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__PodAffinityTermIn!] +} + +input K8s__io___api___core___v1__PodAffinityTermIn { + labelSelector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorIn + namespaces: [String!] + namespaceSelector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorIn + topologyKey: String! +} + +input K8s__io___api___core___v1__PodAntiAffinityIn { + preferredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__WeightedPodAffinityTermIn!] + requiredDuringSchedulingIgnoredDuringExecution: [K8s__io___api___core___v1__PodAffinityTermIn!] +} + +input K8s__io___api___core___v1__PortworxVolumeSourceIn { + fsType: String + readOnly: Boolean + volumeID: String! +} + +input K8s__io___api___core___v1__PreferredSchedulingTermIn { + preference: K8s__io___api___core___v1__NodeSelectorTermIn! + weight: Int! +} + +input K8s__io___api___core___v1__QuobyteVolumeSourceIn { + group: String + readOnly: Boolean + registry: String! + tenant: String + user: String + volume: String! +} + +input K8s__io___api___core___v1__RBDPersistentVolumeSourceIn { + fsType: String + image: String! + keyring: String + monitors: [String!]! + pool: String + readOnly: Boolean + secretRef: K8s__io___api___core___v1__SecretReferenceIn + user: String +} + +input K8s__io___api___core___v1__ResourceClaimIn { + name: String! +} + +input K8s__io___api___core___v1__ResourceRequirementsIn { + claims: [K8s__io___api___core___v1__ResourceClaimIn!] + limits: Map + requests: Map +} + +input K8s__io___api___core___v1__ScaleIOPersistentVolumeSourceIn { + fsType: String + gateway: String! + protectionDomain: String + readOnly: Boolean + secretRef: K8s__io___api___core___v1__SecretReferenceIn + sslEnabled: Boolean + storageMode: String + storagePool: String + system: String! + volumeName: String +} + +input K8s__io___api___core___v1__SecretReferenceIn { + name: String + namespace: String +} + +input K8s__io___api___core___v1__StorageOSPersistentVolumeSourceIn { + fsType: String + readOnly: Boolean + secretRef: K8s__io___api___core___v1__ObjectReferenceIn + volumeName: String + volumeNamespace: String +} + +input K8s__io___api___core___v1__TaintIn { + effect: K8s__io___api___core___v1__TaintEffect! + key: String! + timeAdded: Date + value: String +} + +input K8s__io___api___core___v1__TolerationIn { + effect: K8s__io___api___core___v1__TaintEffect + key: String + operator: K8s__io___api___core___v1__TolerationOperator + tolerationSeconds: Int + value: String +} + +input K8s__io___api___core___v1__TypedLocalObjectReferenceIn { + apiGroup: String + kind: String! + name: String! +} + +input K8s__io___api___core___v1__TypedObjectReferenceIn { + apiGroup: String + kind: String! + name: String! + namespace: String +} + +input K8s__io___api___core___v1__VolumeNodeAffinityIn { + required: K8s__io___api___core___v1__NodeSelectorIn +} + +input K8s__io___api___core___v1__VsphereVirtualDiskVolumeSourceIn { + fsType: String + storagePolicyID: String + storagePolicyName: String + volumePath: String! +} + +input K8s__io___api___core___v1__WeightedPodAffinityTermIn { + podAffinityTerm: K8s__io___api___core___v1__PodAffinityTermIn! + weight: Int! +} + +input K8s__io___api___storage___v1__VolumeAttachmentSourceIn { + inlineVolumeSpec: K8s__io___api___core___v1__PersistentVolumeSpecIn + persistentVolumeName: String +} + +input K8s__io___api___storage___v1__VolumeAttachmentSpecIn { + attacher: String! + nodeName: String! + source: K8s__io___api___storage___v1__VolumeAttachmentSourceIn! +} + +input K8s__io___api___storage___v1__VolumeAttachmentStatusIn { + attached: Boolean! + attachError: K8s__io___api___storage___v1__VolumeErrorIn + attachmentMetadata: Map + detachError: K8s__io___api___storage___v1__VolumeErrorIn +} + +input K8s__io___api___storage___v1__VolumeErrorIn { + message: String + time: Date +} + +input K8s__io___apimachinery___pkg___api___resource__QuantityIn { + Format: K8s__io___apimachinery___pkg___api___resource__Format! +} + +input K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorIn { + matchExpressions: [K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirementIn!] + matchLabels: Map +} + +input K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirementIn { + key: String! + operator: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorOperator! + values: [String!] +} + +input MetadataIn { + annotations: Map + labels: Map + name: String! + namespace: String +} + +enum Github__com___kloudlite___api___pkg___types__SyncAction { + APPLY + DELETE +} + +enum Github__com___kloudlite___api___pkg___types__SyncState { + APPLIED_AT_AGENT + DELETED_AT_AGENT + DELETING_AT_AGENT + ERRORED_AT_AGENT + IDLE + IN_QUEUE + UPDATED_AT_AGENT +} + +enum Github__com___kloudlite___operator___apis___clusters___v1__AWSPoolType { + ec2 + spot +} + +enum Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpecAvailabilityMode { + dev + HA +} + +enum Github__com___kloudlite___operator___apis___common____types__CloudProvider { + aws + azure + do + gcp +} + +enum K8s__io___api___core___v1__ConditionStatus { + False + True + Unknown +} + +enum K8s__io___api___core___v1__NamespaceConditionType { + NamespaceContentRemaining + NamespaceDeletionContentFailure + NamespaceDeletionDiscoveryFailure + NamespaceDeletionGroupVersionParsingFailure + NamespaceFinalizersRemaining +} + +enum K8s__io___api___core___v1__NamespacePhase { + Active + Terminating +} + +enum K8s__io___api___core___v1__NodeSelectorOperator { + DoesNotExist + Exists + Gt + In + Lt + NotIn +} + +enum K8s__io___api___core___v1__PersistentVolumeClaimConditionType { + FileSystemResizePending + Resizing +} + +enum K8s__io___api___core___v1__PersistentVolumeClaimPhase { + Bound + Lost + Pending +} + +enum K8s__io___api___core___v1__PersistentVolumePhase { + Available + Bound + Failed + Pending + Released +} + +enum K8s__io___api___core___v1__PersistentVolumeReclaimPolicy { + Delete + Recycle + Retain +} + +enum K8s__io___api___core___v1__TaintEffect { + NoExecute + NoSchedule + PreferNoSchedule +} + +enum K8s__io___api___core___v1__TolerationOperator { + Equal + Exists +} + +enum K8s__io___apimachinery___pkg___api___resource__Format { + BinarySI + DecimalExponent + DecimalSI +} + +enum K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorOperator { + DoesNotExist + Exists + In + NotIn +} + diff --git a/apps/infra/internal/app/graph/struct-to-graphql/cursorpagination.graphqls b/apps/infra/internal/app/graph/struct-to-graphql/cursorpagination.graphqls new file mode 100644 index 000000000..58815e858 --- /dev/null +++ b/apps/infra/internal/app/graph/struct-to-graphql/cursorpagination.graphqls @@ -0,0 +1,23 @@ +type CursorPagination @shareable { + after: String + before: String + first: Int + last: Int + orderBy: String + sortDirection: CursorPaginationSortDirection +} + +input CursorPaginationIn { + after: String + before: String + first: Int + last: Int + orderBy: String = "_id" + sortDirection: CursorPaginationSortDirection = "ASC" +} + +enum CursorPaginationSortDirection { + ASC + DESC +} + diff --git a/apps/infra/internal/app/graph/struct-to-graphql/directives.graphqls b/apps/infra/internal/app/graph/struct-to-graphql/directives.graphqls new file mode 100644 index 000000000..59d6b45c6 --- /dev/null +++ b/apps/infra/internal/app/graph/struct-to-graphql/directives.graphqls @@ -0,0 +1,6 @@ +extend schema @link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@key", "@shareable", "@external"]) + +directive @goField( + forceResolver: Boolean + name: String +) on INPUT_FIELD_DEFINITION | FIELD_DEFINITION diff --git a/apps/infra/internal/app/graph/struct-to-graphql/domainentry.graphqls b/apps/infra/internal/app/graph/struct-to-graphql/domainentry.graphqls new file mode 100644 index 000000000..4a8aa87c5 --- /dev/null +++ b/apps/infra/internal/app/graph/struct-to-graphql/domainentry.graphqls @@ -0,0 +1,31 @@ +type DomainEntry @shareable { + accountName: String! + clusterName: String! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + domainName: String! + id: String! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + recordVersion: Int! + updateTime: Date! +} + +type DomainEntryEdge @shareable { + cursor: String! + node: DomainEntry! +} + +type DomainEntryPaginatedRecords @shareable { + edges: [DomainEntryEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input DomainEntryIn { + clusterName: String! + displayName: String! + domainName: String! +} + diff --git a/apps/infra/internal/app/graph/struct-to-graphql/helmrelease.graphqls b/apps/infra/internal/app/graph/struct-to-graphql/helmrelease.graphqls new file mode 100644 index 000000000..00a643f7e --- /dev/null +++ b/apps/infra/internal/app/graph/struct-to-graphql/helmrelease.graphqls @@ -0,0 +1,38 @@ +type HelmRelease @shareable { + accountName: String! + apiVersion: String + clusterName: String! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + recordVersion: Int! + spec: Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec + status: Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type HelmReleaseEdge @shareable { + cursor: String! + node: HelmRelease! +} + +type HelmReleasePaginatedRecords @shareable { + edges: [HelmReleaseEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input HelmReleaseIn { + apiVersion: String + displayName: String! + kind: String + metadata: MetadataIn + spec: Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpecIn +} + diff --git a/apps/infra/internal/app/graph/struct-to-graphql/matchfilter.graphqls b/apps/infra/internal/app/graph/struct-to-graphql/matchfilter.graphqls new file mode 100644 index 000000000..ef1a0cb45 --- /dev/null +++ b/apps/infra/internal/app/graph/struct-to-graphql/matchfilter.graphqls @@ -0,0 +1,20 @@ +type MatchFilter @shareable { + array: [Any!] + exact: Any + matchType: MatchFilterMatchType! + regex: String +} + +input MatchFilterIn { + array: [Any!] + exact: Any + matchType: MatchFilterMatchType! + regex: String +} + +enum MatchFilterMatchType { + array + exact + regex +} + diff --git a/apps/infra/internal/app/graph/struct-to-graphql/msvctemplate.graphqls b/apps/infra/internal/app/graph/struct-to-graphql/msvctemplate.graphqls new file mode 100644 index 000000000..ec2753219 --- /dev/null +++ b/apps/infra/internal/app/graph/struct-to-graphql/msvctemplate.graphqls @@ -0,0 +1,6 @@ +type MsvcTemplate @shareable { + category: String! + displayName: String! + items: [Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry!]! +} + diff --git a/apps/infra/internal/app/graph/struct-to-graphql/namespace.graphqls b/apps/infra/internal/app/graph/struct-to-graphql/namespace.graphqls new file mode 100644 index 000000000..ff1b7832d --- /dev/null +++ b/apps/infra/internal/app/graph/struct-to-graphql/namespace.graphqls @@ -0,0 +1,38 @@ +type Namespace @shareable { + accountName: String! + apiVersion: String + clusterName: String! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + recordVersion: Int! + spec: K8s__io___api___core___v1__NamespaceSpec + status: K8s__io___api___core___v1__NamespaceStatus + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type NamespaceEdge @shareable { + cursor: String! + node: Namespace! +} + +type NamespacePaginatedRecords @shareable { + edges: [NamespaceEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input NamespaceIn { + apiVersion: String + kind: String + metadata: MetadataIn + spec: K8s__io___api___core___v1__NamespaceSpecIn + status: K8s__io___api___core___v1__NamespaceStatusIn +} + diff --git a/apps/infra/internal/app/graph/struct-to-graphql/node.graphqls b/apps/infra/internal/app/graph/struct-to-graphql/node.graphqls new file mode 100644 index 000000000..fdea271f6 --- /dev/null +++ b/apps/infra/internal/app/graph/struct-to-graphql/node.graphqls @@ -0,0 +1,34 @@ +type Node @shareable { + accountName: String! + apiVersion: String + clusterName: String! + creationTime: Date! + id: String! + kind: String + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + recordVersion: Int! + spec: Github__com___kloudlite___operator___apis___clusters___v1__NodeSpec! + status: Github__com___kloudlite___operator___pkg___operator__Status + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type NodeEdge @shareable { + cursor: String! + node: Node! +} + +type NodePaginatedRecords @shareable { + edges: [NodeEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input NodeIn { + apiVersion: String + kind: String + metadata: MetadataIn + spec: Github__com___kloudlite___operator___apis___clusters___v1__NodeSpecIn! +} + diff --git a/apps/infra/internal/app/graph/struct-to-graphql/nodepool.graphqls b/apps/infra/internal/app/graph/struct-to-graphql/nodepool.graphqls new file mode 100644 index 000000000..0c562dea2 --- /dev/null +++ b/apps/infra/internal/app/graph/struct-to-graphql/nodepool.graphqls @@ -0,0 +1,38 @@ +type NodePool @shareable { + accountName: String! + apiVersion: String + clusterName: String! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + recordVersion: Int! + spec: Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec! + status: Github__com___kloudlite___operator___pkg___operator__Status + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type NodePoolEdge @shareable { + cursor: String! + node: NodePool! +} + +type NodePoolPaginatedRecords @shareable { + edges: [NodePoolEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input NodePoolIn { + apiVersion: String + displayName: String! + kind: String + metadata: MetadataIn + spec: Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpecIn! +} + diff --git a/apps/infra/internal/app/graph/struct-to-graphql/persistentvolume.graphqls b/apps/infra/internal/app/graph/struct-to-graphql/persistentvolume.graphqls new file mode 100644 index 000000000..0220c81dc --- /dev/null +++ b/apps/infra/internal/app/graph/struct-to-graphql/persistentvolume.graphqls @@ -0,0 +1,38 @@ +type PersistentVolume @shareable { + accountName: String! + apiVersion: String + clusterName: String! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + recordVersion: Int! + spec: K8s__io___api___core___v1__PersistentVolumeSpec + status: K8s__io___api___core___v1__PersistentVolumeStatus + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type PersistentVolumeEdge @shareable { + cursor: String! + node: PersistentVolume! +} + +type PersistentVolumePaginatedRecords @shareable { + edges: [PersistentVolumeEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input PersistentVolumeIn { + apiVersion: String + kind: String + metadata: MetadataIn + spec: K8s__io___api___core___v1__PersistentVolumeSpecIn + status: K8s__io___api___core___v1__PersistentVolumeStatusIn +} + diff --git a/apps/infra/internal/app/graph/struct-to-graphql/persistentvolumeclaim.graphqls b/apps/infra/internal/app/graph/struct-to-graphql/persistentvolumeclaim.graphqls new file mode 100644 index 000000000..c584a8e05 --- /dev/null +++ b/apps/infra/internal/app/graph/struct-to-graphql/persistentvolumeclaim.graphqls @@ -0,0 +1,30 @@ +type PersistentVolumeClaim @shareable { + accountName: String! + apiVersion: String + clusterName: String! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + recordVersion: Int! + spec: K8s__io___api___core___v1__PersistentVolumeClaimSpec + status: K8s__io___api___core___v1__PersistentVolumeClaimStatus + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type PersistentVolumeClaimEdge @shareable { + cursor: String! + node: PersistentVolumeClaim! +} + +type PersistentVolumeClaimPaginatedRecords @shareable { + edges: [PersistentVolumeClaimEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + diff --git a/apps/infra/internal/app/graph/struct-to-graphql/scalars.graphqls b/apps/infra/internal/app/graph/struct-to-graphql/scalars.graphqls new file mode 100644 index 000000000..1f83443a9 --- /dev/null +++ b/apps/infra/internal/app/graph/struct-to-graphql/scalars.graphqls @@ -0,0 +1,4 @@ +scalar Any +scalar Json +scalar Map +scalar Date diff --git a/apps/infra/internal/app/graph/struct-to-graphql/volumeattachment.graphqls b/apps/infra/internal/app/graph/struct-to-graphql/volumeattachment.graphqls new file mode 100644 index 000000000..299b3fd3a --- /dev/null +++ b/apps/infra/internal/app/graph/struct-to-graphql/volumeattachment.graphqls @@ -0,0 +1,38 @@ +type VolumeAttachment @shareable { + accountName: String! + apiVersion: String + clusterName: String! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + displayName: String! + id: String! + kind: String + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + markedForDeletion: Boolean + metadata: Metadata @goField(name: "objectMeta") + recordVersion: Int! + spec: K8s__io___api___storage___v1__VolumeAttachmentSpec! + status: K8s__io___api___storage___v1__VolumeAttachmentStatus + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! + updateTime: Date! +} + +type VolumeAttachmentEdge @shareable { + cursor: String! + node: VolumeAttachment! +} + +type VolumeAttachmentPaginatedRecords @shareable { + edges: [VolumeAttachmentEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input VolumeAttachmentIn { + apiVersion: String + kind: String + metadata: MetadataIn + spec: K8s__io___api___storage___v1__VolumeAttachmentSpecIn! + status: K8s__io___api___storage___v1__VolumeAttachmentStatusIn +} + diff --git a/apps/infra/internal/app/graph/volumeattachment.resolvers.go b/apps/infra/internal/app/graph/volumeattachment.resolvers.go new file mode 100644 index 000000000..fe87cb1a1 --- /dev/null +++ b/apps/infra/internal/app/graph/volumeattachment.resolvers.go @@ -0,0 +1,96 @@ +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.28 + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + "time" + + "github.com/kloudlite/api/apps/infra/internal/app/graph/generated" + "github.com/kloudlite/api/apps/infra/internal/app/graph/model" + "github.com/kloudlite/api/apps/infra/internal/entities" + fn "github.com/kloudlite/api/pkg/functions" + "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// CreationTime is the resolver for the creationTime field. +func (r *volumeAttachmentResolver) CreationTime(ctx context.Context, obj *entities.VolumeAttachment) (string, error) { + if obj == nil { + return "", errors.Newf("volume-attachment/creation-time is nil") + } + return obj.CreationTime.Format(time.RFC3339), nil +} + +// ID is the resolver for the id field. +func (r *volumeAttachmentResolver) ID(ctx context.Context, obj *entities.VolumeAttachment) (string, error) { + if obj == nil { + return "", errors.Newf("volume attachment is nil") + } + return string(obj.Id), nil +} + +// Spec is the resolver for the spec field. +func (r *volumeAttachmentResolver) Spec(ctx context.Context, obj *entities.VolumeAttachment) (*model.K8sIoAPIStorageV1VolumeAttachmentSpec, error) { + var m model.K8sIoAPIStorageV1VolumeAttachmentSpec + if err := fn.JsonConversion(obj.Spec, &m); err != nil { + return nil, errors.NewE(err) + } + return &m, nil +} + +// Status is the resolver for the status field. +func (r *volumeAttachmentResolver) Status(ctx context.Context, obj *entities.VolumeAttachment) (*model.K8sIoAPIStorageV1VolumeAttachmentStatus, error) { + var m model.K8sIoAPIStorageV1VolumeAttachmentStatus + if err := fn.JsonConversion(obj.Status, &m); err != nil { + return nil, errors.NewE(err) + } + return &m, nil +} + +// UpdateTime is the resolver for the updateTime field. +func (r *volumeAttachmentResolver) UpdateTime(ctx context.Context, obj *entities.VolumeAttachment) (string, error) { + if obj == nil || obj.UpdateTime.IsZero() { + return "", errors.Newf("volume-attachment/update-time is nil") + } + return obj.UpdateTime.Format(time.RFC3339), nil +} + +// Metadata is the resolver for the metadata field. +func (r *volumeAttachmentInResolver) Metadata(ctx context.Context, obj *entities.VolumeAttachment, data *v1.ObjectMeta) error { + if obj == nil { + return errors.Newf("volume attachment is nil") + } + return fn.JsonConversion(data, &obj.ObjectMeta) +} + +// Spec is the resolver for the spec field. +func (r *volumeAttachmentInResolver) Spec(ctx context.Context, obj *entities.VolumeAttachment, data *model.K8sIoAPIStorageV1VolumeAttachmentSpecIn) error { + if obj == nil { + return errors.Newf("volume attachment is nil") + } + return fn.JsonConversion(data, &obj.Spec) +} + +// Status is the resolver for the status field. +func (r *volumeAttachmentInResolver) Status(ctx context.Context, obj *entities.VolumeAttachment, data *model.K8sIoAPIStorageV1VolumeAttachmentStatusIn) error { + if obj == nil { + return errors.Newf("volume attachment is nil") + } + return fn.JsonConversion(data, &obj.Status) +} + +// VolumeAttachment returns generated.VolumeAttachmentResolver implementation. +func (r *Resolver) VolumeAttachment() generated.VolumeAttachmentResolver { + return &volumeAttachmentResolver{r} +} + +// VolumeAttachmentIn returns generated.VolumeAttachmentInResolver implementation. +func (r *Resolver) VolumeAttachmentIn() generated.VolumeAttachmentInResolver { + return &volumeAttachmentInResolver{r} +} + +type volumeAttachmentResolver struct{ *Resolver } +type volumeAttachmentInResolver struct{ *Resolver } diff --git a/apps/infra/internal/app/graph/workernode.resolvers.go b/apps/infra/internal/app/graph/workernode.resolvers.go deleted file mode 100644 index b5bf88cda..000000000 --- a/apps/infra/internal/app/graph/workernode.resolvers.go +++ /dev/null @@ -1,53 +0,0 @@ -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.28 - -import ( - "context" - - "github.com/kloudlite/operator/pkg/operator" - "kloudlite.io/apps/infra/internal/app/graph/generated" - "kloudlite.io/apps/infra/internal/app/graph/model" - "kloudlite.io/apps/infra/internal/domain/entities" - fn "kloudlite.io/pkg/functions" -) - -// Spec is the resolver for the spec field. -func (r *workerNodeResolver) Spec(ctx context.Context, obj *entities.WorkerNode) (*model.WorkerNodeSpec, error) { - var m model.WorkerNodeSpec - if err := fn.JsonConversion(obj.Spec, &m); err != nil { - return nil, err - } - return &m, nil -} - -// Status is the resolver for the status field. -func (r *workerNodeResolver) Status(ctx context.Context, obj *entities.WorkerNode) (*operator.Status, error) { - if obj == nil { - return nil, nil - } - var op operator.Status - if err := fn.JsonConversion(obj.Status, &op); err != nil { - return nil, err - } - return &op, nil -} - -// Spec is the resolver for the spec field. -func (r *workerNodeInResolver) Spec(ctx context.Context, obj *entities.WorkerNode, data *model.WorkerNodeSpecIn) error { - if obj == nil { - return nil - } - return fn.JsonConversion(data, &obj.Spec) -} - -// WorkerNode returns generated.WorkerNodeResolver implementation. -func (r *Resolver) WorkerNode() generated.WorkerNodeResolver { return &workerNodeResolver{r} } - -// WorkerNodeIn returns generated.WorkerNodeInResolver implementation. -func (r *Resolver) WorkerNodeIn() generated.WorkerNodeInResolver { return &workerNodeInResolver{r} } - -type workerNodeResolver struct{ *Resolver } -type workerNodeInResolver struct{ *Resolver } diff --git a/apps/infra/internal/app/grpc-server.go b/apps/infra/internal/app/grpc-server.go new file mode 100644 index 000000000..1ed0e085c --- /dev/null +++ b/apps/infra/internal/app/grpc-server.go @@ -0,0 +1,93 @@ +package app + +import ( + "context" + + "github.com/kloudlite/api/apps/infra/internal/domain" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/infra" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" +) + +type grpcServer struct { + d domain.Domain + infra.UnimplementedInfraServer +} + +func (g *grpcServer) contextFromAccount(ctx context.Context, accountName string) domain.InfraContext { + dctx := domain.InfraContext{ + Context: ctx, + UserId: "sys-user:error-on-apply-worker", + UserEmail: "", + UserName: "", + AccountName: accountName, + } + return dctx +} + +// GetCluster implements infra.InfraServer. +func (g *grpcServer) GetCluster(ctx context.Context, in *infra.GetClusterIn) (*infra.GetClusterOut, error) { + infraCtx := domain.InfraContext{ + Context: ctx, + UserId: repos.ID(in.UserId), + UserEmail: in.UserEmail, + UserName: in.UserName, + AccountName: in.AccountName, + } + c, err := g.d.GetCluster(infraCtx, in.ClusterName) + if err != nil { + return nil, errors.NewE(err) + } + + if c == nil { + return nil, errors.Newf("cluster %s not found", in.ClusterName) + } + + return &infra.GetClusterOut{ + MessageQueueTopic: c.Spec.MessageQueueTopicName, + DnsHost: c.Spec.PublicDNSHost, + + IACJobName: func() string { + if c.Spec.Output != nil { + return c.Spec.Output.JobName + } + return "" + }(), + IACJobNamespace: func() string { + if c.Spec.Output != nil { + return c.Spec.Output.JobNamespace + } + return "" + }(), + }, nil +} + +// GetNodepool implements infra.InfraServer +func (g *grpcServer) GetNodepool(ctx context.Context, in *infra.GetNodepoolIn) (*infra.GetNodepoolOut, error) { + infraCtx := domain.InfraContext{ + Context: ctx, + UserId: repos.ID(in.UserId), + UserEmail: in.UserEmail, + UserName: in.UserName, + AccountName: in.AccountName, + } + np, err := g.d.GetNodePool(infraCtx, in.ClusterName, in.NodepoolName) + if err != nil { + return nil, errors.NewE(err) + } + + if np == nil { + return nil, errors.Newf("nodepool %s not found", in.NodepoolName) + } + + return &infra.GetNodepoolOut{ + // IACJobName: np.Spec.IAC.JobName, + // IACJobNamespace: np.Spec.IAC.JobNamespace, + }, nil +} + +func newGrpcServer(d domain.Domain) infra.InfraServer { + return &grpcServer{ + d: d, + } +} diff --git a/apps/infra/internal/app/process-byoc-client-updates.go b/apps/infra/internal/app/process-byoc-client-updates.go deleted file mode 100644 index 5085cba1d..000000000 --- a/apps/infra/internal/app/process-byoc-client-updates.go +++ /dev/null @@ -1,81 +0,0 @@ -package app - -import ( - "context" - "encoding/json" - "strings" - "time" - - clusterv1 "github.com/kloudlite/operator/apis/clusters/v1" - "github.com/kloudlite/operator/operators/resource-watcher/types" - "kloudlite.io/apps/infra/internal/domain" - "kloudlite.io/pkg/logging" - "kloudlite.io/pkg/redpanda" -) - -type ByocClientUpdatesConsumer redpanda.Consumer - -func processByocClientUpdates(consumer ByocClientUpdatesConsumer, d domain.Domain, logger logging.Logger) { - consumer.StartConsuming(func(msg []byte, timeStamp time.Time, offset int64) error { - logger.Debugf("processing offset %d timestamp %s", offset, timeStamp) - - var su types.ResourceUpdate - if err := json.Unmarshal(msg, &su); err != nil { - logger.Errorf(err, "parsing into status update") - return nil - // return err - } - - if len(strings.TrimSpace(su.AccountName)) == 0 { - logger.Infof("message does not contain 'accountName', so won't be able to find a resource uniquely, thus ignoring ...") - return nil - } - - b, err := json.Marshal(su.Object) - if err != nil { - return err - } - var obj clusterv1.BYOC - if err := json.Unmarshal(b, &obj); err != nil { - return err - } - - // obj := unstructured.Unstructured{Object: su.Object} - - mLogger := logger.WithKV( - "gvk", obj.GetObjectKind().GroupVersionKind().String(), - "accountName", su.AccountName, - "clusterName", su.ClusterName, - ) - - mLogger.Infof("received message") - defer func() { - mLogger.Infof("processed message") - }() - - ctx := domain.InfraContext{Context: context.TODO(), AccountName: su.AccountName} - byocCluster, err := d.GetBYOCCluster(ctx, su.ClusterName) - if err != nil { - logger.Infof("error: %s, commiting anyway ...", err.Error()) - return nil - } - - if byocCluster == nil { - return nil - } - - if byocCluster.Generation > obj.Generation { - // this message belongs to previous generation, so we can ignore it - return nil - } - - byocCluster.Spec = obj.Spec - byocCluster.Status = obj.Status - - if err := d.OnBYOCClusterHelmUpdates(ctx, *byocCluster); err != nil { - return err - } - - return nil - }) -} diff --git a/apps/infra/internal/app/process-error-on-apply.go b/apps/infra/internal/app/process-error-on-apply.go new file mode 100644 index 000000000..3c54e5c35 --- /dev/null +++ b/apps/infra/internal/app/process-error-on-apply.go @@ -0,0 +1,106 @@ +package app + +import ( + "context" + "encoding/json" + + "github.com/kloudlite/api/apps/infra/internal/domain" + "github.com/kloudlite/api/apps/infra/internal/entities" + t "github.com/kloudlite/api/apps/tenant-agent/types" + "github.com/kloudlite/api/pkg/errors" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/api/pkg/messaging" + "github.com/kloudlite/api/pkg/messaging/types" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" +) + +type ErrorOnApplyConsumer messaging.Consumer + +func ProcessErrorOnApply(consumer ErrorOnApplyConsumer, logger logging.Logger, d domain.Domain) { + counter := 0 + processMsg := func(msg *types.ConsumeMsg) error { + counter += 1 + + var errObj t.AgentErrMessage + if err := json.Unmarshal(msg.Payload, &errObj); err != nil { + return errors.NewE(err) + } + + obj := unstructured.Unstructured{Object: errObj.Object} + + mLogger := logger.WithKV( + "gvk", obj.GroupVersionKind(), + "accountName", errObj.AccountName, + "clusterName", errObj.ClusterName, + ) + + mLogger.Infof("[%d] received message", counter) + defer func() { + mLogger.Infof("[%d] processed message", counter) + }() + + dctx := domain.InfraContext{ + Context: context.TODO(), + UserId: "sys-user:error-on-apply-worker", + UserEmail: "", + UserName: "", + AccountName: errObj.AccountName, + } + + opts := domain.UpdateAndDeleteOpts{MessageTimestamp: msg.Timestamp} + + gvkstr := obj.GroupVersionKind().String() + switch gvkstr { + case nodepoolGVK.String(): + { + nodepool, err := fn.JsonConvert[entities.NodePool](obj.Object) + if err != nil { + return err + } + + if errObj.Action == t.ActionApply { + return d.OnNodepoolApplyError(dctx, errObj.ClusterName, obj.GetName(), errObj.Error, opts) + } + return d.OnNodePoolDeleteMessage(dctx, errObj.ClusterName, nodepool) + } + case clusterMsvcGVK.String(): + { + cmsvc, err := fn.JsonConvert[entities.ClusterManagedService](obj.Object) + if err != nil { + return err + } + + if errObj.Action == t.ActionApply { + return d.OnClusterManagedServiceApplyError(dctx, errObj.ClusterName, obj.GetName(), errObj.Error, opts) + } + return d.OnClusterManagedServiceDeleteMessage(dctx, errObj.ClusterName, cmsvc) + + } + case helmreleaseGVK.String(): + { + helmRelease, err := fn.JsonConvert[entities.HelmRelease](obj.Object) + if err != nil { + return err + } + + if errObj.Action == t.ActionApply { + return d.OnHelmReleaseApplyError(dctx, errObj.ClusterName, obj.GetName(), errObj.Error, opts) + } + return d.OnHelmReleaseDeleteMessage(dctx, errObj.ClusterName, helmRelease) + } + default: + { + return errors.Newf("infra error-on-apply reader does not acknowledge resource with gvk (%s)", gvkstr) + } + } + } + + if err := consumer.Consume(processMsg, types.ConsumeOpts{ + OnError: func(err error) error { + return nil + }, + }); err != nil { + logger.Errorf(err, "when setting up error-on-apply consumer") + } +} diff --git a/apps/infra/internal/app/process-resource-updates.go b/apps/infra/internal/app/process-resource-updates.go new file mode 100644 index 000000000..28c9d0ac1 --- /dev/null +++ b/apps/infra/internal/app/process-resource-updates.go @@ -0,0 +1,237 @@ +package app + +import ( + "context" + "encoding/json" + "fmt" + "strings" + "time" + + "github.com/kloudlite/api/pkg/errors" + + "github.com/kloudlite/api/apps/infra/internal/domain" + "github.com/kloudlite/api/apps/infra/internal/entities" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/operator/operators/resource-watcher/types" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + + "github.com/kloudlite/api/pkg/messaging" + msgTypes "github.com/kloudlite/api/pkg/messaging/types" + corev1 "k8s.io/api/core/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + + networkingv1 "k8s.io/api/networking/v1" +) + +type ReceiveResourceUpdatesConsumer messaging.Consumer + +func gvk(obj client.Object) string { + val := obj.GetObjectKind().GroupVersionKind().String() + return val +} + +var ( + clusterGVK = fn.GVK("clusters.kloudlite.io/v1", "Cluster") + nodepoolGVK = fn.GVK("clusters.kloudlite.io/v1", "NodePool") + helmreleaseGVK = fn.GVK("crds.kloudlite.io/v1", "HelmChart") + pvcGVK = fn.GVK("v1", "PersistentVolumeClaim") + pvGVK = fn.GVK("v1", "PersistentVolume") + volumeAttachmentGVK = fn.GVK("storage.k8s.io/v1", "VolumeAttachment") + namespaceGVK = fn.GVK("v1", "Namespace") + clusterMsvcGVK = fn.GVK("crds.kloudlite.io/v1", "ClusterManagedService") + ingressGVK = fn.GVK("networking.k8s.io/v1", "Ingress") +) + +func processResourceUpdates(consumer ReceiveResourceUpdatesConsumer, d domain.Domain, logger logging.Logger) { + readMsg := func(msg *msgTypes.ConsumeMsg) error { + logger.Debugf("processing msg timestamp %s", msg.Timestamp.Format(time.RFC3339)) + + var su types.ResourceUpdate + if err := json.Unmarshal(msg.Payload, &su); err != nil { + logger.Errorf(err, "parsing into status update") + return nil + } + + if su.Object == nil { + logger.Infof("message does not contain 'object', so won't be able to find a resource uniquely, thus ignoring ...") + return nil + } + + if len(strings.TrimSpace(su.AccountName)) == 0 { + logger.Infof("message does not contain 'accountName', so won't be able to find a resource uniquely, thus ignoring ...") + return nil + } + + dctx := domain.InfraContext{Context: context.TODO(), UserId: "sys-user-process-infra-updates", AccountName: su.AccountName} + + obj := unstructured.Unstructured{Object: su.Object} + gvkStr := obj.GetObjectKind().GroupVersionKind().String() + + resStatus, err := func() (types.ResourceStatus, error) { + v, ok := su.Object[types.ResourceStatusKey] + if !ok { + return "", errors.NewE(fmt.Errorf("field %s not found in object", types.ResourceStatusKey)) + } + s, ok := v.(string) + if !ok { + return "", errors.NewE(fmt.Errorf("field value %v is not a string", v)) + } + + return types.ResourceStatus(s), nil + }() + if err != nil { + return err + } + + mLogger := logger.WithKV( + "gvk", obj.GetObjectKind().GroupVersionKind(), + "NN", fmt.Sprintf("%s/%s", obj.GetNamespace(), obj.GetName()), + "resource-status", resStatus, + "accountName/clusterName", fmt.Sprintf("%s/%s", su.AccountName, su.ClusterName), + ) + + mLogger.Infof("received message") + defer func() { + mLogger.Infof("processed message") + }() + + switch gvkStr { + case clusterGVK.String(): + { + var clus entities.Cluster + if err := fn.JsonConversion(su.Object, &clus); err != nil { + return err + } + + if resStatus == types.ResourceStatusDeleted { + return d.OnClusterDeleteMessage(dctx, clus) + } + return d.OnClusterUpdateMessage(dctx, clus, resStatus, domain.UpdateAndDeleteOpts{MessageTimestamp: msg.Timestamp}) + } + case nodepoolGVK.String(): + { + var np entities.NodePool + if err := fn.JsonConversion(su.Object, &np); err != nil { + return errors.NewE(err) + } + + if resStatus == types.ResourceStatusDeleted { + return d.OnNodePoolDeleteMessage(dctx, su.ClusterName, np) + } + return d.OnNodePoolUpdateMessage(dctx, su.ClusterName, np, resStatus, domain.UpdateAndDeleteOpts{MessageTimestamp: msg.Timestamp}) + } + case pvcGVK.String(): + { + var pvc entities.PersistentVolumeClaim + if err := fn.JsonConversion(su.Object, &pvc); err != nil { + return errors.NewE(err) + } + + if resStatus == types.ResourceStatusDeleted { + return d.OnPVCDeleteMessage(dctx, su.ClusterName, pvc) + } + return d.OnPVCUpdateMessage(dctx, su.ClusterName, pvc, resStatus, domain.UpdateAndDeleteOpts{MessageTimestamp: msg.Timestamp}) + } + + case pvGVK.String(): + { + var pv entities.PersistentVolume + if err := fn.JsonConversion(su.Object, &pv); err != nil { + return errors.NewE(err) + } + + if resStatus == types.ResourceStatusDeleted { + return d.OnPVDeleteMessage(dctx, su.ClusterName, pv) + } + return d.OnPVUpdateMessage(dctx, su.ClusterName, pv, resStatus, domain.UpdateAndDeleteOpts{MessageTimestamp: msg.Timestamp}) + } + + case volumeAttachmentGVK.String(): + { + var volatt entities.VolumeAttachment + if err := fn.JsonConversion(su.Object, &volatt); err != nil { + return errors.NewE(err) + } + + if resStatus == types.ResourceStatusDeleted { + return d.OnVolumeAttachmentDeleteMessage(dctx, su.ClusterName, volatt) + } + return d.OnVolumeAttachmentUpdateMessage(dctx, su.ClusterName, volatt, resStatus, domain.UpdateAndDeleteOpts{MessageTimestamp: msg.Timestamp}) + } + + case helmreleaseGVK.String(): + { + var hr entities.HelmRelease + if err := fn.JsonConversion(su.Object, &hr); err != nil { + return errors.NewE(err) + } + + if resStatus == types.ResourceStatusDeleted { + return d.OnHelmReleaseDeleteMessage(dctx, su.ClusterName, hr) + } + return d.OnHelmReleaseUpdateMessage(dctx, su.ClusterName, hr, resStatus, domain.UpdateAndDeleteOpts{MessageTimestamp: msg.Timestamp}) + } + + case namespaceGVK.String(): + { + var ns entities.Namespace + + if err := fn.JsonConversion(su.Object, &ns); err != nil { + return errors.NewE(err) + } + + if resStatus == types.ResourceStatusDeleted { + return d.OnNamespaceDeleteMessage(dctx, su.ClusterName, ns) + } + return d.OnNamespaceUpdateMessage(dctx, su.ClusterName, ns, resStatus, domain.UpdateAndDeleteOpts{MessageTimestamp: msg.Timestamp}) + } + + case clusterMsvcGVK.String(): + { + var cmsvc entities.ClusterManagedService + if err := fn.JsonConversion(su.Object, &cmsvc); err != nil { + return errors.NewE(err) + } + + if v, ok := su.Object[types.KeyClusterManagedSvcSecret]; ok { + if v2, ok := v.(*corev1.Secret); ok { + cmsvc.SyncedOutputSecretRef = v2 + } + } + + if resStatus == types.ResourceStatusDeleted { + return d.OnClusterManagedServiceDeleteMessage(dctx, su.ClusterName, cmsvc) + } + return d.OnClusterManagedServiceUpdateMessage(dctx, su.ClusterName, cmsvc, resStatus, domain.UpdateAndDeleteOpts{MessageTimestamp: msg.Timestamp}) + } + + case ingressGVK.String(): + { + var ingress networkingv1.Ingress + if err := fn.JsonConversion(su.Object, &ingress); err != nil { + return errors.NewE(err) + } + + if resStatus == types.ResourceStatusDeleted { + return d.OnIngressDeleteMessage(dctx, su.ClusterName, ingress) + } + return d.OnIngressUpdateMessage(dctx, su.ClusterName, ingress, resStatus, domain.UpdateAndDeleteOpts{MessageTimestamp: msg.Timestamp}) + } + default: + { + mLogger.Infof("infra status updates consumer does not acknowledge the gvk %s", gvk(&obj)) + return nil + } + } + } + + if err := consumer.Consume(readMsg, msgTypes.ConsumeOpts{ + OnError: func(err error) error { + logger.Errorf(err, "error while consuming message") + return nil + }, + }); err != nil { + logger.Errorf(err, "error while consuming messages") + } +} diff --git a/apps/infra/internal/app/process-status-updates.go b/apps/infra/internal/app/process-status-updates.go deleted file mode 100644 index 1000107c4..000000000 --- a/apps/infra/internal/app/process-status-updates.go +++ /dev/null @@ -1,120 +0,0 @@ -package app - -import ( - "context" - "encoding/json" - "strings" - "time" - - "github.com/kloudlite/operator/operators/resource-watcher/types" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "kloudlite.io/apps/infra/internal/domain" - "kloudlite.io/apps/infra/internal/domain/entities" - fn "kloudlite.io/pkg/functions" - "kloudlite.io/pkg/logging" - "kloudlite.io/pkg/redpanda" -) - -type InfraUpdatesConsumer redpanda.Consumer - -func processInfraUpdates(consumer InfraUpdatesConsumer, d domain.Domain, logger logging.Logger) { - consumer.StartConsuming(func(msg []byte, timeStamp time.Time, offset int64) error { - logger.Debugf("processing offset %d timestamp %s", offset, timeStamp) - - var su types.ResourceUpdate - if err := json.Unmarshal(msg, &su); err != nil { - logger.Errorf(err, "parsing into status update") - return nil - } - - if su.Object == nil { - logger.Infof("message does not contain 'object', so won't be able to find a resource uniquely, thus ignoring ...") - return nil - } - - if len(strings.TrimSpace(su.AccountName)) == 0 { - logger.Infof("message does not contain 'accountName', so won't be able to find a resource uniquely, thus ignoring ...") - return nil - } - - obj := unstructured.Unstructured{Object: su.Object} - mLogger := logger.WithKV( - "gvk", obj.GetObjectKind().GroupVersionKind(), - "accountName", su.AccountName, - "clusterName", su.ClusterName, - ) - - mLogger.Infof("received message") - defer func() { - mLogger.Infof("processed message") - }() - - ctx := domain.InfraContext{Context: context.TODO(), AccountName: su.AccountName} - - kind := obj.GetObjectKind().GroupVersionKind().Kind - switch kind { - case "CloudProvider": - { - var cp entities.CloudProvider - if err := fn.JsonConversion(su.Object, &cp); err != nil { - return err - } - - if obj.GetDeletionTimestamp() != nil { - return d.OnDeleteCloudProviderMessage(ctx, cp) - } - return d.OnUpdateCloudProviderMessage(ctx, cp) - } - case "Edge": - { - var edge entities.Edge - if err := fn.JsonConversion(su.Object, &edge); err != nil { - return err - } - if obj.GetDeletionTimestamp() != nil { - return d.OnDeleteEdgeMessage(ctx, edge) - } - return d.OnUpdateEdgeMessage(ctx, edge) - } - case "WorkerNode": - { - var wNode entities.WorkerNode - if err := fn.JsonConversion(su.Object, &wNode); err != nil { - return err - } - if obj.GetDeletionTimestamp() != nil { - return d.OnDeleteWorkerNodeMessage(ctx, wNode) - } - return d.OnUpdateWorkerNodeMessage(ctx, wNode) - } - case "Cluster": - { - var clus entities.Cluster - if err := fn.JsonConversion(su.Object, &clus); err != nil { - return err - } - if obj.GetDeletionTimestamp() != nil { - return d.OnDeleteClusterMessage(ctx, clus) - } - return d.OnUpdateClusterMessage(ctx, clus) - } - case "BYOCCluster": - { - var clus entities.BYOCCluster - if err := fn.JsonConversion(su.Object, &clus); err != nil { - return err - } - if obj.GetDeletionTimestamp() != nil { - return d.OnDeleteBYOCClusterMessage(ctx, clus) - } - // return d.OnUpdateBYOCClusterMessage(ctx, clus) - return nil - } - default: - { - mLogger.Infof("infra status updates consumer does not acknowledge the kind %s", kind) - return nil - } - } - }) -} diff --git a/apps/infra/internal/app/type-generator/main.go b/apps/infra/internal/app/type-generator/main.go deleted file mode 100644 index aa2489632..000000000 --- a/apps/infra/internal/app/type-generator/main.go +++ /dev/null @@ -1,26 +0,0 @@ -package main - -import ( - "fmt" - "os" - - "kloudlite.io/apps/infra/internal/domain/entities" - gqltypesgenerator "kloudlite.io/pkg/gql-types-generator" -) - -func main() { - types := []interface{}{ - entities.Cluster{}, - entities.MasterNode{}, - entities.CloudProvider{}, - entities.Edge{}, - entities.NodePool{}, - } - - s := gqltypesgenerator.GenerateGraphQLTypes(types, nil) - err := os.WriteFile("types.graphql", []byte(s), os.ModePerm) - if err!= nil{ - panic(err) - } - fmt.Println(s) -} diff --git a/apps/infra/internal/app/type-generator/types.graphql b/apps/infra/internal/app/type-generator/types.graphql deleted file mode 100755 index 0a0b1c2ed..000000000 --- a/apps/infra/internal/app/type-generator/types.graphql +++ /dev/null @@ -1,159 +0,0 @@ -type Cluster { - id: String! - metadata: ObjectMeta - spec: ClusterSpec - status: Status - kind: String - apiVersion: String -} - -type ObjectMeta { - name: String - generateName: String - namespace: String - selfLink: String - uid: String - resourceVersion: String - generation: Int - creationTimestamp: String - deletionTimestamp: String - deletionGracePeriodSeconds: Int - labels: String - annotations: String - ownerReferences: [OwnerReference] - finalizers: [String] - managedFields: [ManagedFieldsEntry] -} - -type OwnerReference { - apiVersion: String! - kind: String! - name: String! - uid: String! - controller: Boolean - blockOwnerDeletion: Boolean -} - -type ManagedFieldsEntry { - manager: String - operation: String - apiVersion: String - time: String - fieldsType: String - fieldsV1: String - subresource: String -} - -type ClusterSpec { - accountName: String! - providerName: String! - provider: String! - count: Int! - region: String! - config: String! -} - -type Status { - isReady: Boolean! - message: String - messages: [ContainerMessage] - displayVars: String - generatedVars: String - conditions: [Condition] - childConditions: [Condition] - opsConditions: [Condition] - checks: String - lastReconcileTime: String -} - -type ContainerMessage { - state: String! - pod: String - container: String - reason: String! - message: String! - exitCode: Int -} - -type Condition { - type: String! - status: String! - observedGeneration: Int - lastTransitionTime: String! - reason: String! - message: String! -} - -type MasterNode { - metadata: ObjectMeta - spec: MasterNodeSpec - status: Status -} - -type MasterNodeSpec { - accountName: String! - clusterName: String! - mysqlURI: String! - providerName: String! - provider: String! - config: String! - region: String! -} - -type CloudProvider { - metadata: ObjectMeta - spec: CloudProviderSpec - status: Status -} - -type CloudProviderSpec { - accountName: String! - providerSecret: ObjectRef! -} - -type ObjectRef { - name: String! - namespace: String! -} - -type Edge { - BaseEntity: BaseEntity! - metadata: ObjectMeta - spec: EdgeSpec - status: Status -} - -type EdgeSpec { - accountName: String! - provider: String - region: String! - providerName: String! - clusterName: String! - pools: [Pool] -} - -type Pool { - name: String! - config: String! - min: Int - max: Int -} - -type NodePool { - metadata: ObjectMeta - spec: NodePoolSpec - status: Status -} - -type NodePoolSpec { - accountName: String! - clusterName: String! - edgeName: String! - provider: String! - providerName: String! - region: String! - config: String! - min: Int - max: Int -} - diff --git a/apps/infra/internal/domain/api.go b/apps/infra/internal/domain/api.go index 2d48ea291..7a8295220 100644 --- a/apps/infra/internal/domain/api.go +++ b/apps/infra/internal/domain/api.go @@ -2,63 +2,143 @@ package domain import ( "context" + networkingv1 "k8s.io/api/networking/v1" + "time" - "kloudlite.io/apps/infra/internal/domain/entities" + "github.com/kloudlite/api/apps/infra/internal/entities" + "github.com/kloudlite/api/pkg/repos" + "github.com/kloudlite/operator/operators/resource-watcher/types" ) type InfraContext struct { context.Context + UserId repos.ID + UserEmail string + UserName string AccountName string } -type Domain interface { - CheckNameAvailability(ctx InfraContext, typeArg ResType, name string) (*CheckNameAvailabilityOutput, error) +func (i InfraContext) GetUserId() repos.ID { + return i.UserId +} - ListBYOCClusters(ctx InfraContext) ([]*entities.BYOCCluster, error) - GetBYOCCluster(ctx InfraContext, name string) (*entities.BYOCCluster, error) +func (i InfraContext) GetUserEmail() string { + return i.UserEmail +} - CreateBYOCCluster(ctx InfraContext, cluster entities.BYOCCluster) (*entities.BYOCCluster, error) - UpdateBYOCCluster(ctx InfraContext, cluster entities.BYOCCluster) (*entities.BYOCCluster, error) - DeleteBYOCCluster(ctx InfraContext, name string) error +func (i InfraContext) GetUserName() string { + return i.UserName +} - OnDeleteBYOCClusterMessage(ctx InfraContext, cluster entities.BYOCCluster) error - OnBYOCClusterHelmUpdates(ctx InfraContext, cluster entities.BYOCCluster) error +type UpdateAndDeleteOpts struct { + MessageTimestamp time.Time +} - CreateCluster(ctx InfraContext, cluster entities.Cluster) (*entities.Cluster, error) - ListClusters(ctx InfraContext) ([]*entities.Cluster, error) - GetCluster(ctx InfraContext, name string) (*entities.Cluster, error) +type ResourceType string + +const ( + ResourceTypeClusterManagedService ResourceType = "cluster_managed_service" + ResourceTypeCluster ResourceType = "cluster" + ResourceTypeDomainEntries ResourceType = "domain_entries" + ResourceTypeHelmRelease ResourceType = "helm_release" + ResourceTypeNodePool ResourceType = "nodepool" + ResourceTypePVC ResourceType = "persistance_volume_claim" + ResourceTypePV ResourceType = "persistance_volume" + ResourceTypeVolumeAttachment ResourceType = "volume_attachment" +) + +type Domain interface { + CheckNameAvailability(ctx InfraContext, typeArg ResType, clusterName *string, name string) (*CheckNameAvailabilityOutput, error) + CreateCluster(ctx InfraContext, cluster entities.Cluster) (*entities.Cluster, error) UpdateCluster(ctx InfraContext, cluster entities.Cluster) (*entities.Cluster, error) DeleteCluster(ctx InfraContext, name string) error - OnDeleteClusterMessage(ctx InfraContext, cluster entities.Cluster) error - OnUpdateClusterMessage(ctx InfraContext, cluster entities.Cluster) error + ListClusters(ctx InfraContext, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.Cluster], error) + GetCluster(ctx InfraContext, name string) (*entities.Cluster, error) + + GetClusterAdminKubeconfig(ctx InfraContext, clusterName string) (*string, error) + + OnClusterDeleteMessage(ctx InfraContext, cluster entities.Cluster) error + OnClusterUpdateMessage(ctx InfraContext, cluster entities.Cluster, status types.ResourceStatus, opts UpdateAndDeleteOpts) error + + CreateProviderSecret(ctx InfraContext, secret entities.CloudProviderSecret) (*entities.CloudProviderSecret, error) + UpdateProviderSecret(ctx InfraContext, secret entities.CloudProviderSecret) (*entities.CloudProviderSecret, error) + DeleteProviderSecret(ctx InfraContext, secretName string) error + + ListProviderSecrets(ctx InfraContext, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.CloudProviderSecret], error) + GetProviderSecret(ctx InfraContext, name string) (*entities.CloudProviderSecret, error) + + ValidateProviderSecretAWSAccess(ctx InfraContext, name string) (*AWSAccessValidationOutput, error) + + ListDomainEntries(ctx InfraContext, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.DomainEntry], error) + GetDomainEntry(ctx InfraContext, name string) (*entities.DomainEntry, error) + + CreateDomainEntry(ctx InfraContext, domainName entities.DomainEntry) (*entities.DomainEntry, error) + UpdateDomainEntry(ctx InfraContext, domainName entities.DomainEntry) (*entities.DomainEntry, error) + DeleteDomainEntry(ctx InfraContext, name string) error + + CreateNodePool(ctx InfraContext, clusterName string, nodePool entities.NodePool) (*entities.NodePool, error) + UpdateNodePool(ctx InfraContext, clusterName string, nodePool entities.NodePool) (*entities.NodePool, error) + DeleteNodePool(ctx InfraContext, clusterName string, poolName string) error + + ListNodePools(ctx InfraContext, clusterName string, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.NodePool], error) + GetNodePool(ctx InfraContext, clusterName string, poolName string) (*entities.NodePool, error) + + OnNodePoolDeleteMessage(ctx InfraContext, clusterName string, nodePool entities.NodePool) error + OnNodePoolUpdateMessage(ctx InfraContext, clusterName string, nodePool entities.NodePool, status types.ResourceStatus, opts UpdateAndDeleteOpts) error + OnNodepoolApplyError(ctx InfraContext, clusterName string, name string, errMsg string, opts UpdateAndDeleteOpts) error + + ListNodes(ctx InfraContext, clusterName string, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.Node], error) + GetNode(ctx InfraContext, clusterName string, nodeName string) (*entities.Node, error) + + OnNodeUpdateMessage(ctx InfraContext, clusterName string, node entities.Node) error + OnNodeDeleteMessage(ctx InfraContext, clusterName string, node entities.Node) error + + ListClusterManagedServices(ctx InfraContext, clusterName string, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.ClusterManagedService], error) + GetClusterManagedService(ctx InfraContext, clusterName string, serviceName string) (*entities.ClusterManagedService, error) + CreateClusterManagedService(ctx InfraContext, clusterName string, service entities.ClusterManagedService) (*entities.ClusterManagedService, error) + UpdateClusterManagedService(ctx InfraContext, clusterName string, service entities.ClusterManagedService) (*entities.ClusterManagedService, error) + DeleteClusterManagedService(ctx InfraContext, clusterName string, name string) error + + OnClusterManagedServiceApplyError(ctx InfraContext, clusterName, name, errMsg string, opts UpdateAndDeleteOpts) error + OnClusterManagedServiceDeleteMessage(ctx InfraContext, clusterName string, service entities.ClusterManagedService) error + OnClusterManagedServiceUpdateMessage(ctx InfraContext, clusterName string, service entities.ClusterManagedService, status types.ResourceStatus, opts UpdateAndDeleteOpts) error + + ListHelmReleases(ctx InfraContext, clusterName string, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.HelmRelease], error) + GetHelmRelease(ctx InfraContext, clusterName string, serviceName string) (*entities.HelmRelease, error) + CreateHelmRelease(ctx InfraContext, clusterName string, service entities.HelmRelease) (*entities.HelmRelease, error) + UpdateHelmRelease(ctx InfraContext, clusterName string, service entities.HelmRelease) (*entities.HelmRelease, error) - GetProviderSecret(ctx InfraContext, name string) (*entities.Secret, error) + DeleteHelmRelease(ctx InfraContext, clusterName string, name string) error + OnHelmReleaseApplyError(ctx InfraContext, clusterName string, name string, errMsg string, opts UpdateAndDeleteOpts) error + OnHelmReleaseDeleteMessage(ctx InfraContext, clusterName string, service entities.HelmRelease) error + OnHelmReleaseUpdateMessage(ctx InfraContext, clusterName string, service entities.HelmRelease, status types.ResourceStatus, opts UpdateAndDeleteOpts) error - CreateCloudProvider(ctx InfraContext, cloudProvider entities.CloudProvider, providerSecret entities.Secret) (*entities.CloudProvider, error) - ListCloudProviders(ctx InfraContext) ([]*entities.CloudProvider, error) - GetCloudProvider(ctx InfraContext, name string) (*entities.CloudProvider, error) - UpdateCloudProvider(ctx InfraContext, cloudProvider entities.CloudProvider, providerSecret *entities.Secret) (*entities.CloudProvider, error) - DeleteCloudProvider(ctx InfraContext, name string) error - OnDeleteCloudProviderMessage(ctx InfraContext, cloudProvider entities.CloudProvider) error - OnUpdateCloudProviderMessage(ctx InfraContext, cloudProvider entities.CloudProvider) error + ListManagedSvcTemplates() ([]*entities.MsvcTemplate, error) + GetManagedSvcTemplate(category string, name string) (*entities.MsvcTemplateEntry, error) - ListEdges(ctx InfraContext, clusterName string, providerName *string) ([]*entities.Edge, error) - GetEdge(ctx InfraContext, clusterName string, name string) (*entities.Edge, error) + // kubernetes native resources + ListPVCs(ctx InfraContext, clusterName string, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.PersistentVolumeClaim], error) + GetPVC(ctx InfraContext, clusterName string, pvcName string) (*entities.PersistentVolumeClaim, error) + OnPVCUpdateMessage(ctx InfraContext, clusterName string, pvc entities.PersistentVolumeClaim, status types.ResourceStatus, opts UpdateAndDeleteOpts) error + OnPVCDeleteMessage(ctx InfraContext, clusterName string, pvc entities.PersistentVolumeClaim) error - CreateEdge(ctx InfraContext, edge entities.Edge) (*entities.Edge, error) - UpdateEdge(ctx InfraContext, edge entities.Edge) (*entities.Edge, error) - DeleteEdge(ctx InfraContext, clusterName string, name string) error + ListNamespaces(ctx InfraContext, clusterName string, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.Namespace], error) + GetNamespace(ctx InfraContext, clusterName string, namespace string) (*entities.Namespace, error) + OnNamespaceUpdateMessage(ctx InfraContext, clusterName string, namespace entities.Namespace, status types.ResourceStatus, opts UpdateAndDeleteOpts) error + OnNamespaceDeleteMessage(ctx InfraContext, clusterName string, namespace entities.Namespace) error - OnDeleteEdgeMessage(ctx InfraContext, edge entities.Edge) error - OnUpdateEdgeMessage(ctx InfraContext, edge entities.Edge) error + ListPVs(ctx InfraContext, clusterName string, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.PersistentVolume], error) + GetPV(ctx InfraContext, clusterName string, pvName string) (*entities.PersistentVolume, error) + OnPVUpdateMessage(ctx InfraContext, clusterName string, pv entities.PersistentVolume, status types.ResourceStatus, opts UpdateAndDeleteOpts) error + OnPVDeleteMessage(ctx InfraContext, clusterName string, pv entities.PersistentVolume) error - GetNodePools(ctx InfraContext, clusterName string, edgeName string) ([]*entities.NodePool, error) - GetMasterNodes(ctx InfraContext, clusterName string) ([]*entities.MasterNode, error) - GetWorkerNodes(ctx InfraContext, clusterName string, edgeName string) ([]*entities.WorkerNode, error) - DeleteWorkerNode(ctx InfraContext, clusterName string, edgeName string, name string) (bool, error) + OnIngressUpdateMessage(ctx InfraContext, clusterName string, ingress networkingv1.Ingress, status types.ResourceStatus, opts UpdateAndDeleteOpts) error + OnIngressDeleteMessage(ctx InfraContext, clusterName string, ingress networkingv1.Ingress) error - OnDeleteWorkerNodeMessage(ctx InfraContext, workerNode entities.WorkerNode) error - OnUpdateWorkerNodeMessage(ctx InfraContext, workerNode entities.WorkerNode) error + ListVolumeAttachments(ctx InfraContext, clusterName string, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.VolumeAttachment], error) + GetVolumeAttachment(ctx InfraContext, clusterName string, volAttachmentName string) (*entities.VolumeAttachment, error) + OnVolumeAttachmentUpdateMessage(ctx InfraContext, clusterName string, volumeAttachment entities.VolumeAttachment, status types.ResourceStatus, opts UpdateAndDeleteOpts) error + OnVolumeAttachmentDeleteMessage(ctx InfraContext, clusterName string, volumeAttachment entities.VolumeAttachment) error } diff --git a/apps/infra/internal/domain/cloud-providers.go b/apps/infra/internal/domain/cloud-providers.go deleted file mode 100644 index c2e4366c6..000000000 --- a/apps/infra/internal/domain/cloud-providers.go +++ /dev/null @@ -1,191 +0,0 @@ -package domain - -import ( - "fmt" - "time" - - "kloudlite.io/apps/infra/internal/domain/entities" - "kloudlite.io/pkg/repos" - t "kloudlite.io/pkg/types" -) - -func (d *domain) upsertProviderSecret(ctx InfraContext, ps *entities.Secret) (*entities.Secret, error) { - return d.secretRepo.SilentUpsert(ctx, repos.Filter{"metadata.name": ps.Name, "metadata.namespace": ps.Namespace}, ps) -} - -func (d *domain) GetProviderSecret(ctx InfraContext, providerName string) (*entities.Secret, error) { - cp, err := d.findCloudProvider(ctx, providerName) - if err != nil { - return nil, err - } - return d.findProviderSecret(ctx, cp.Spec.ProviderSecret.Name) -} - -func (d *domain) CreateCloudProvider(ctx InfraContext, cloudProvider entities.CloudProvider, providerSecret entities.Secret) (*entities.CloudProvider, error) { - cloudProvider.EnsureGVK() - providerSecret.EnsureGVK() - - providerSecret.Namespace = d.env.ProviderSecretNamespace - - if err := d.k8sExtendedClient.ValidateStruct(ctx, &providerSecret.Secret); err != nil { - return nil, err - } - - ps, err := d.upsertProviderSecret(ctx, &providerSecret) - if err != nil { - return nil, err - } - - cloudProvider.Spec.ProviderSecret.Name = ps.Name - cloudProvider.Spec.ProviderSecret.Namespace = ps.Namespace - - if err := d.k8sExtendedClient.ValidateStruct(ctx, &cloudProvider.CloudProvider); err != nil { - return nil, err - } - - cloudProvider.AccountName = ctx.AccountName - cloudProvider.SyncStatus = t.GetSyncStatusForCreation() - - cp, err := d.providerRepo.Create(ctx, &cloudProvider) - if err != nil { - if d.providerRepo.ErrAlreadyExists(err) { - return nil, fmt.Errorf("cloud provider with name %q, already exists", cloudProvider.Name) - } - return nil, err - } - - if err := d.applyK8sResource(ctx, &ps.Secret); err != nil { - return nil, err - } - - if err := d.applyK8sResource(ctx, &cp.CloudProvider); err != nil { - return nil, err - } - - return cp, nil -} - -func (d *domain) ListCloudProviders(ctx InfraContext) ([]*entities.CloudProvider, error) { - return d.providerRepo.Find(ctx, repos.Query{Filter: repos.Filter{ - "accountName": ctx.AccountName, - }}) -} - -func (d *domain) GetCloudProvider(ctx InfraContext, name string) (*entities.CloudProvider, error) { - return d.findCloudProvider(ctx, name) -} - -func (d *domain) findCloudProvider(ctx InfraContext, name string) (*entities.CloudProvider, error) { - cp, err := d.providerRepo.FindOne(ctx, repos.Filter{ - "accountName": ctx.AccountName, - "metadata.name": name, - }) - if err != nil { - return nil, err - } - - if cp == nil { - return nil, fmt.Errorf("cloud provider with name %q not found", name) - } - - return cp, nil -} - -func (d *domain) UpdateCloudProvider(ctx InfraContext, cloudProvider entities.CloudProvider, providerSecret *entities.Secret) (*entities.CloudProvider, error) { - cloudProvider.EnsureGVK() - providerSecret.EnsureGVK() - - if err := d.k8sExtendedClient.ValidateStruct(ctx, &cloudProvider.CloudProvider); err != nil { - return nil, err - } - - cp, err := d.findCloudProvider(ctx, cloudProvider.Name) - if err != nil { - return nil, err - } - - if providerSecret != nil { - if err := d.k8sExtendedClient.ValidateStruct(ctx, &providerSecret.Secret); err != nil { - return nil, err - } - - if providerSecret.Name != cp.Spec.ProviderSecret.Name { - return nil, fmt.Errorf("secret name mismatch b/w provider (%s) and provider secret(%s)", cp.Spec.ProviderSecret.Name, providerSecret.Name) - } - } - - cloudProvider.SyncStatus = t.GetSyncStatusForUpdation(cp.Generation + 1) - - uProvider, err := d.providerRepo.UpdateById(ctx, cp.Id, &cloudProvider) - if err != nil { - return nil, err - } - - if err := d.applyK8sResource(ctx, &uProvider.CloudProvider); err != nil { - return nil, err - } - - upSecret, err := d.upsertProviderSecret(ctx, providerSecret) - if err != nil { - return nil, err - } - - if err := d.applyK8sResource(ctx, &upSecret.Secret); err != nil { - return nil, err - } - - return nil, err -} - -func (d *domain) DeleteCloudProvider(ctx InfraContext, name string) error { - cp, err := d.findCloudProvider(ctx, name) - if err != nil { - return err - } - - cp.SyncStatus = t.GetSyncStatusForDeletion(cp.Generation) - uCp, err := d.providerRepo.UpdateById(ctx, cp.Id, cp) - if err != nil { - return err - } - - return d.deleteK8sResource(ctx, &uCp.CloudProvider) -} - -func (d *domain) OnDeleteCloudProviderMessage(ctx InfraContext, cloudProvider entities.CloudProvider) error { - return d.providerRepo.DeleteOne(ctx, repos.Filter{ - "accountName": ctx.AccountName, - "metadata.name": cloudProvider.Name, - }) -} - -func (d *domain) OnUpdateCloudProviderMessage(ctx InfraContext, cloudProvider entities.CloudProvider) error { - cp, err := d.findCloudProvider(ctx, cloudProvider.Name) - if err != nil { - return err - } - - cp.CloudProvider = cloudProvider.CloudProvider - cp.SyncStatus.LastSyncedAt = time.Now() - cp.SyncStatus.State = t.ParseSyncState(cloudProvider.Status.IsReady) - _, err = d.providerRepo.UpdateById(ctx, cp.Id, cp) - return err -} - -func (d *domain) findProviderSecret(ctx InfraContext, name string) (*entities.Secret, error) { - ps, err := d.secretRepo.FindOne(ctx, repos.Filter{ - "accountName": ctx.AccountName, - "metadata.name": name, - "metadata.namespace": d.env.ProviderSecretNamespace, - }) - - if err != nil { - return nil, err - } - - if ps == nil { - return nil, fmt.Errorf("provider secret with name %q not found", name) - } - - return ps, nil -} diff --git a/apps/infra/internal/domain/cluster-managed-service.go b/apps/infra/internal/domain/cluster-managed-service.go new file mode 100644 index 000000000..555ee5fac --- /dev/null +++ b/apps/infra/internal/domain/cluster-managed-service.go @@ -0,0 +1,253 @@ +package domain + +import ( + iamT "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/apps/infra/internal/entities" + fc "github.com/kloudlite/api/apps/infra/internal/entities/field-constants" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + "github.com/kloudlite/operator/operators/resource-watcher/types" +) + +func (d *domain) ListClusterManagedServices(ctx InfraContext, clusterName string, mf map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.ClusterManagedService], error) { + if err := d.canPerformActionInAccount(ctx, iamT.ListClusterManagedServices); err != nil { + return nil, errors.NewE(err) + } + + f := repos.Filter{ + fields.ClusterName: clusterName, + fields.AccountName: ctx.AccountName, + } + + pr, err := d.clusterManagedServiceRepo.FindPaginated(ctx, d.secretRepo.MergeMatchFilters(f, mf), pagination) + if err != nil { + return nil, errors.NewE(err) + } + + return pr, nil +} + +func (d *domain) findClusterManagedService(ctx InfraContext, clusterName string, svcName string) (*entities.ClusterManagedService, error) { + cmsvc, err := d.clusterManagedServiceRepo.FindOne(ctx, repos.Filter{ + fields.ClusterName: clusterName, + fields.AccountName: ctx.AccountName, + fields.MetadataName: svcName, + }) + if err != nil { + return nil, errors.NewE(err) + } + + if cmsvc == nil { + return nil, errors.Newf("cmsvc with name %q not found", clusterName) + } + return cmsvc, nil +} + +func (d *domain) GetClusterManagedService(ctx InfraContext, clusterName string, serviceName string) (*entities.ClusterManagedService, error) { + if err := d.canPerformActionInAccount(ctx, iamT.GetClusterManagedService); err != nil { + return nil, errors.NewE(err) + } + + c, err := d.findClusterManagedService(ctx, clusterName, serviceName) + if err != nil { + return nil, errors.NewE(err) + } + + return c, nil +} + +func (d *domain) applyClusterManagedService(ctx InfraContext, cmsvc *entities.ClusterManagedService) error { + addTrackingId(&cmsvc.ClusterManagedService, cmsvc.Id) + return d.resDispatcher.ApplyToTargetCluster(ctx, cmsvc.ClusterName, &cmsvc.ClusterManagedService, cmsvc.RecordVersion) +} + +func (d *domain) CreateClusterManagedService(ctx InfraContext, clusterName string, service entities.ClusterManagedService) (*entities.ClusterManagedService, error) { + if err := d.canPerformActionInAccount(ctx, iamT.CreateClusterManagedService); err != nil { + return nil, errors.NewE(err) + } + + service.IncrementRecordVersion() + + service.CreatedBy = common.CreatedOrUpdatedBy{ + UserId: ctx.UserId, + UserName: ctx.UserName, + UserEmail: ctx.UserEmail, + } + + service.LastUpdatedBy = service.CreatedBy + + existing, err := d.clusterManagedServiceRepo.FindOne(ctx, repos.Filter{ + fields.ClusterName: clusterName, + fields.AccountName: ctx.AccountName, + fields.MetadataName: service.Name, + }) + if err != nil { + return nil, errors.NewE(err) + } + + if existing != nil { + return nil, errors.Newf("cluster managed service with name %q already exists", clusterName) + } + + service.AccountName = ctx.AccountName + service.ClusterName = clusterName + service.SyncStatus = t.GenSyncStatus(t.SyncActionApply, service.RecordVersion) + + service.EnsureGVK() + + if err := d.k8sClient.ValidateObject(ctx, &service.ClusterManagedService); err != nil { + return nil, errors.NewE(err) + } + + ncms, err := d.clusterManagedServiceRepo.Create(ctx, &service) + if err != nil { + return nil, errors.NewE(err) + } + + if err := d.applyClusterManagedService(ctx, &service); err != nil { + return nil, errors.NewE(err) + } + + d.resourceEventPublisher.PublishResourceEvent(ctx, clusterName, ResourceTypeClusterManagedService, ncms.Name, PublishAdd) + + return ncms, nil +} + +func (d *domain) UpdateClusterManagedService(ctx InfraContext, clusterName string, serviceIn entities.ClusterManagedService) (*entities.ClusterManagedService, error) { + if err := d.canPerformActionInAccount(ctx, iamT.UpdateClusterManagedService); err != nil { + return nil, errors.NewE(err) + } + + serviceIn.EnsureGVK() + if err := d.k8sClient.ValidateObject(ctx, &serviceIn.ClusterManagedService); err != nil { + return nil, errors.NewE(err) + } + + patchForUpdate := common.PatchForUpdate( + ctx, + &serviceIn, + common.PatchOpts{ + XPatch: repos.Document{ + fc.ClusterManagedServiceSpecMsvcSpec: serviceIn.Spec, + }, + }) + + ucmsvc, err := d.clusterManagedServiceRepo.Patch( + ctx, + repos.Filter{ + fields.ClusterName: clusterName, + fields.AccountName: ctx.AccountName, + fields.MetadataName: serviceIn.Name, + }, + patchForUpdate, + ) + if err != nil { + return nil, errors.NewE(err) + } + + d.resourceEventPublisher.PublishResourceEvent(ctx, clusterName, ResourceTypeClusterManagedService, ucmsvc.Name, PublishUpdate) + + if err := d.applyClusterManagedService(ctx, ucmsvc); err != nil { + return nil, errors.NewE(err) + } + + return ucmsvc, nil +} + +func (d *domain) DeleteClusterManagedService(ctx InfraContext, clusterName string, name string) error { + if err := d.canPerformActionInAccount(ctx, iamT.DeleteClusterManagedService); err != nil { + return errors.NewE(err) + } + + ucmsvc, err := d.clusterManagedServiceRepo.Patch( + ctx, + repos.Filter{ + fields.ClusterName: clusterName, + fields.AccountName: ctx.AccountName, + fields.MetadataName: name, + }, + common.PatchForMarkDeletion(), + ) + if err != nil { + return errors.NewE(err) + } + + d.resourceEventPublisher.PublishResourceEvent(ctx, clusterName, ResourceTypeClusterManagedService, ucmsvc.Name, PublishUpdate) + + return d.resDispatcher.DeleteFromTargetCluster(ctx, clusterName, &ucmsvc.ClusterManagedService) +} + +func (d *domain) OnClusterManagedServiceApplyError(ctx InfraContext, clusterName, name, errMsg string, opts UpdateAndDeleteOpts) error { + ucmsvc, err := d.clusterManagedServiceRepo.Patch( + ctx, + repos.Filter{ + fields.ClusterName: clusterName, + fields.AccountName: ctx.AccountName, + fields.MetadataName: name, + }, + common.PatchForErrorFromAgent( + errMsg, + common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + }, + ), + ) + if err != nil { + return errors.NewE(err) + } + + d.resourceEventPublisher.PublishResourceEvent(ctx, clusterName, ResourceTypeClusterManagedService, ucmsvc.Name, PublishDelete) + return errors.NewE(err) +} + +func (d *domain) OnClusterManagedServiceDeleteMessage(ctx InfraContext, clusterName string, service entities.ClusterManagedService) error { + err := d.clusterManagedServiceRepo.DeleteOne( + ctx, + repos.Filter{ + fields.ClusterName: clusterName, + fields.AccountName: ctx.AccountName, + fields.MetadataName: service.Name, + }, + ) + if err != nil { + return errors.NewE(err) + } + d.resourceEventPublisher.PublishResourceEvent(ctx, clusterName, ResourceTypeClusterManagedService, service.Name, PublishDelete) + return err +} + +func (d *domain) OnClusterManagedServiceUpdateMessage(ctx InfraContext, clusterName string, service entities.ClusterManagedService, status types.ResourceStatus, opts UpdateAndDeleteOpts) error { + xService, err := d.findClusterManagedService(ctx, clusterName, service.Name) + if err != nil { + return errors.NewE(err) + } + + if xService == nil { + return errors.Newf("no cluster manage service found") + } + + if _, err := d.matchRecordVersion(service.Annotations, xService.RecordVersion); err != nil { + return d.resyncToTargetCluster(ctx, xService.SyncStatus.Action, clusterName, xService, xService.RecordVersion) + } + + recordVersion, err := d.matchRecordVersion(service.Annotations, xService.RecordVersion) + if err != nil { + return errors.NewE(err) + } + + ucmsvc, err := d.clusterManagedServiceRepo.PatchById( + ctx, + xService.Id, + common.PatchForSyncFromAgent(&service, recordVersion, status, common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + })) + if err != nil { + return errors.NewE(err) + } + + d.resourceEventPublisher.PublishResourceEvent(ctx, clusterName, ResourceTypeClusterManagedService, ucmsvc.GetName(), PublishUpdate) + return nil +} diff --git a/apps/infra/internal/domain/clusters.go b/apps/infra/internal/domain/clusters.go index fa28e29ae..a6e1cfe92 100644 --- a/apps/infra/internal/domain/clusters.go +++ b/apps/infra/internal/domain/clusters.go @@ -2,234 +2,488 @@ package domain import ( "fmt" - "time" - "kloudlite.io/apps/infra/internal/domain/entities" - "kloudlite.io/common" - "kloudlite.io/pkg/repos" - t "kloudlite.io/pkg/types" + iamT "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/apps/infra/internal/domain/templates" + fc "github.com/kloudlite/api/apps/infra/internal/entities/field-constants" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/common/fields" + message_office_internal "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/message-office-internal" + ct "github.com/kloudlite/operator/apis/common-types" + "github.com/kloudlite/operator/operators/resource-watcher/types" + "sigs.k8s.io/yaml" + + "github.com/kloudlite/api/apps/infra/internal/entities" + clustersv1 "github.com/kloudlite/operator/apis/clusters/v1" + + "github.com/kloudlite/api/pkg/errors" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + crdsv1 "github.com/kloudlite/operator/apis/crds/v1" + corev1 "k8s.io/api/core/v1" + apiErrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -func (d *domain) CreateCluster(ctx InfraContext, cluster entities.Cluster) (*entities.Cluster, error) { - cluster.EnsureGVK() - if err := d.k8sExtendedClient.ValidateStruct(ctx, &cluster.Cluster); err != nil { - return nil, err - } +const ( + keyClusterToken = "cluster-token" +) - cluster.AccountName = ctx.AccountName - cluster.SyncStatus = t.GetSyncStatusForCreation() +type ErrClusterAlreadyExists struct { + ClusterName string + AccountName string +} - nCluster, err := d.clusterRepo.Create(ctx, &cluster) +func (e ErrClusterAlreadyExists) Error() string { + return fmt.Sprintf("cluster with name %q already exists for account: %s", e.ClusterName, e.AccountName) +} + +func (d *domain) createTokenSecret(ctx InfraContext, ps *entities.CloudProviderSecret, clusterName string, clusterNamespace string) (*corev1.Secret, error) { + secret := &corev1.Secret{ + TypeMeta: metav1.TypeMeta{ + APIVersion: "v1", + Kind: "Secret", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: clusterName, + Namespace: clusterNamespace, + }, + } + + tout, err := d.messageOfficeInternalClient.GenerateClusterToken(ctx, &message_office_internal.GenerateClusterTokenIn{ + AccountName: ctx.AccountName, + ClusterName: clusterName, + }) if err != nil { - if d.clusterRepo.ErrAlreadyExists(err) { - return nil, fmt.Errorf("cluster with name %q already exists", cluster.Name) - } - return nil, err + return nil, errors.NewE(err) } - if err := d.applyK8sResource(ctx, &nCluster.Cluster); err != nil { - return nil, err + secret.Data = map[string][]byte{ + keyClusterToken: []byte(tout.ClusterToken), } - return nCluster, nil + return secret, nil } -func (d *domain) ListClusters(ctx InfraContext) ([]*entities.Cluster, error) { - return d.clusterRepo.Find(ctx, repos.Query{ - Filter: repos.Filter{ - "accountName": ctx.AccountName, - }, - }) -} - -func (d *domain) GetCluster(ctx InfraContext, name string) (*entities.Cluster, error) { - return d.clusterRepo.FindOne(ctx, repos.Filter{ - "accountName": ctx.AccountName, - "metadata.name": name, - }) -} +func (d *domain) GetClusterAdminKubeconfig(ctx InfraContext, clusterName string) (*string, error) { + if err := d.canPerformActionInAccount(ctx, iamT.UpdateCluster); err != nil { + return nil, errors.NewE(err) + } -func (d *domain) UpdateCluster(ctx InfraContext, cluster entities.Cluster) (*entities.Cluster, error) { - cluster.EnsureGVK() - clus, err := d.findCluster(ctx, cluster.Name) + cluster, err := d.findCluster(ctx, clusterName) if err != nil { - return nil, err + return nil, errors.NewE(err) } - clus.Cluster = cluster.Cluster - clus.SyncStatus = t.GetSyncStatusForUpdation(clus.Generation + 1) + if cluster.Spec.Output == nil { + return fn.New(""), nil + } - uCluster, err := d.clusterRepo.UpdateById(ctx, clus.Id, clus) - if err != nil { - return nil, err + kscrt := corev1.Secret{} + if err := d.k8sClient.Get(ctx.Context, fn.NN(cluster.Namespace, cluster.Spec.Output.SecretName), &kscrt); err != nil { + return nil, errors.NewE(err) } - if err := d.applyK8sResource(ctx, &uCluster.Cluster); err != nil { - return nil, err + kubeconfig, ok := kscrt.Data[cluster.Spec.Output.KeyKubeconfig] + if !ok { + return nil, errors.Newf("kubeconfig key %q not found in secret %q", cluster.Spec.Output.KeyKubeconfig, cluster.Spec.Output.SecretName) } - return uCluster, nil + return fn.New(string(kubeconfig)), nil } -func (d *domain) DeleteCluster(ctx InfraContext, name string) error { - c, err := d.findCluster(ctx, name) - if err != nil { - return err +func (d *domain) applyCluster(ctx InfraContext, cluster *entities.Cluster) error { + addTrackingId(&cluster.Cluster, cluster.Id) + return d.applyK8sResource(ctx, &cluster.Cluster, cluster.RecordVersion) +} + +func (d *domain) CreateCluster(ctx InfraContext, cluster entities.Cluster) (*entities.Cluster, error) { + if err := d.canPerformActionInAccount(ctx, iamT.CreateCluster); err != nil { + return nil, errors.NewE(err) } - c.SyncStatus = t.GetSyncStatusForDeletion(c.Generation) - upC, err := d.clusterRepo.UpdateById(ctx, c.Id, c) + accNs, err := d.getAccNamespace(ctx) if err != nil { - return err + return nil, errors.NewE(err) } - return d.deleteK8sResource(ctx, &upC.Cluster) -} -func (d *domain) OnDeleteClusterMessage(ctx InfraContext, cluster entities.Cluster) error { - return d.clusterRepo.DeleteOne(ctx, repos.Filter{ - "accountName": ctx.AccountName, - "metadata.name": cluster.Name, - }) -} + cluster.EnsureGVK() + cluster.Namespace = accNs -func (d *domain) OnUpdateClusterMessage(ctx InfraContext, cluster entities.Cluster) error { - c, err := d.findCluster(ctx, cluster.Name) + cps, err := d.findProviderSecret(ctx, cluster.Spec.CredentialsRef.Name) if err != nil { - return err + return nil, errors.NewE(err) } - c.Cluster = cluster.Cluster - c.SyncStatus.LastSyncedAt = time.Now() - c.SyncStatus.State = t.ParseSyncState(c.Status.IsReady) - - _, err = d.clusterRepo.UpdateById(ctx, c.Id, c) - return err -} + if cps.IsMarkedForDeletion() { + return nil, errors.Newf("cloud provider secret %q is marked for deletion, aborting cluster creation", cps.Name) + } -func (d *domain) findCluster(ctx InfraContext, clusterName string) (*entities.Cluster, error) { - cluster, err := d.clusterRepo.FindOne(ctx, repos.Filter{ - "accountName": ctx.AccountName, - "metadata.name": clusterName, + existing, err := d.clusterRepo.FindOne(ctx, repos.Filter{ + fields.MetadataName: cluster.Name, + fields.MetadataNamespace: cluster.Namespace, + fields.AccountName: ctx.AccountName, }) if err != nil { - return nil, err + return nil, errors.NewE(err) } - if cluster == nil { - return nil, fmt.Errorf("cluster with name %q not found", clusterName) + + if existing != nil { + return nil, ErrClusterAlreadyExists{ClusterName: cluster.Name, AccountName: ctx.AccountName} } - return cluster, nil -} -func (d *domain) findBYOCCluster(ctx InfraContext, clusterName string) (*entities.BYOCCluster, error) { - cluster, err := d.byocClusterRepo.FindOne(ctx, repos.Filter{ - "spec.accountName": ctx.AccountName, - "metadata.name": clusterName, - }) + cluster.AccountName = ctx.AccountName + out, err := d.accountsSvc.GetAccount(ctx, string(ctx.UserId), ctx.AccountName) if err != nil { - return nil, err + return nil, errors.NewEf(err, "failed to get account %q", ctx.AccountName) } - if cluster == nil { - return nil, fmt.Errorf("cluster with name %q not found", clusterName) + + cluster.Spec.AccountId = out.AccountId + + if cluster.Spec.CredentialsRef.Namespace == "" { + cluster.Spec.CredentialsRef.Namespace = cps.Namespace } - return cluster, nil -} -func (d *domain) CreateBYOCCluster(ctx InfraContext, cluster entities.BYOCCluster) (*entities.BYOCCluster, error) { - cluster.EnsureGVK() - cluster.Spec.IncomingKafkaTopic = common.GetKafkaTopicName(ctx.AccountName, cluster.Name) + tokenScrt, err := d.createTokenSecret(ctx, cps, cluster.Name, cluster.Namespace) + if err != nil { + return nil, errors.NewE(err) + } + + if err := d.k8sClient.ValidateObject(ctx, &cluster.Cluster); err != nil { + return nil, errors.NewE(err) + } + + if err := d.applyK8sResource(ctx, tokenScrt, 1); err != nil { + return nil, errors.NewE(err) + } + + cluster.Spec = clustersv1.ClusterSpec{ + AccountName: ctx.AccountName, + AccountId: out.AccountId, + ClusterTokenRef: ct.SecretKeyRef{ + Name: tokenScrt.Name, + Namespace: tokenScrt.Namespace, + Key: keyClusterToken, + }, + CredentialsRef: cluster.Spec.CredentialsRef, + CredentialKeys: &clustersv1.CloudProviderCredentialKeys{ + KeyAWSAccountId: entities.AWSAccountId, + KeyAWSAssumeRoleExternalID: entities.AWSAssumeRoleExternalId, + KeyAWSAssumeRoleRoleARN: entities.AWAssumeRoleRoleARN, + KeyAWSIAMInstanceProfileRole: entities.AWSInstanceProfileName, + KeyAccessKey: entities.AccessKey, + KeySecretKey: entities.SecretKey, + }, + AvailabilityMode: cluster.Spec.AvailabilityMode, + + // PublicDNSHost is ..tenants. + PublicDNSHost: fmt.Sprintf("%s.%s.tenants.%s", cluster.Name, ctx.AccountName, d.env.PublicDNSHostSuffix), + ClusterInternalDnsHost: fn.New("cluster.local"), + CloudflareEnabled: fn.New(true), + TaintMasterNodes: true, + BackupToS3Enabled: false, + + CloudProvider: cluster.Spec.CloudProvider, + AWS: func() *clustersv1.AWSClusterConfig { + if cluster.Spec.CloudProvider != ct.CloudProviderAWS { + return nil + } + return &clustersv1.AWSClusterConfig{ + Region: cluster.Spec.AWS.Region, + K3sMasters: clustersv1.AWSK3sMastersConfig{ + ImageId: d.env.AWSAMI, + ImageSSHUsername: "ubuntu", + InstanceType: cluster.Spec.AWS.K3sMasters.InstanceType, + NvidiaGpuEnabled: cluster.Spec.AWS.K3sMasters.NvidiaGpuEnabled, + RootVolumeType: "gp3", + RootVolumeSize: func() int { + if cluster.Spec.AWS.K3sMasters.NvidiaGpuEnabled { + return 80 + } + return 50 + }(), + IAMInstanceProfileRole: &cps.AWS.CfParamInstanceProfileName, + Nodes: func() map[string]clustersv1.MasterNodeProps { + if cluster.Spec.AvailabilityMode == "dev" { + return map[string]clustersv1.MasterNodeProps{ + "master-1": { + Role: "primary-master", + }, + } + } + return map[string]clustersv1.MasterNodeProps{ + "master-1": { + Role: "primary-master", + }, + "master-2": { + Role: "secondary-master", + }, + "master-3": { + Role: "secondary-master", + }, + } + }(), + }, + } + }(), + // MessageQueueTopicName: fmt.Sprintf("kl-acc-%s-clus-%s", ctx.AccountName, cluster.Name), + MessageQueueTopicName: common.GetTenantClusterMessagingTopic(ctx.AccountName, cluster.Name), + KloudliteRelease: d.env.KloudliteRelease, + Output: nil, + } - if err := d.k8sExtendedClient.ValidateStruct(ctx, &cluster.BYOC); err != nil { - return nil, err + cluster.IncrementRecordVersion() + cluster.CreatedBy = common.CreatedOrUpdatedBy{ + UserId: ctx.UserId, + UserName: ctx.UserName, + UserEmail: ctx.UserEmail, } + cluster.LastUpdatedBy = cluster.CreatedBy - cluster.IsConnected = false + cluster.Spec.AccountId = out.AccountId cluster.Spec.AccountName = ctx.AccountName - cluster.SyncStatus = t.GetSyncStatusForCreation() + cluster.SyncStatus = t.GenSyncStatus(t.SyncActionApply, 0) - nCluster, err := d.byocClusterRepo.Create(ctx, &cluster) + nCluster, err := d.clusterRepo.Create(ctx, &cluster) if err != nil { if d.clusterRepo.ErrAlreadyExists(err) { - return nil, fmt.Errorf("cluster with name %q already exists", cluster.Name) + return nil, errors.Newf("cluster with name %q already exists in namespace %q", cluster.Name, cluster.Namespace) } + return nil, errors.NewE(err) } - if err := d.applyK8sResource(ctx, &nCluster.BYOC); err != nil { - return nil, err + if err := d.applyCluster(ctx, nCluster); err != nil { + return nil, errors.NewE(err) + } + + d.resourceEventPublisher.PublishInfraEvent(ctx, ResourceTypeCluster, nCluster.Name, PublishAdd) + + if err := d.applyHelmKloudliteAgent(ctx, nCluster, string(tokenScrt.Data[keyClusterToken])); err != nil { + return nil, errors.NewE(err) } return nCluster, nil } -func (d *domain) ListBYOCClusters(ctx InfraContext) ([]*entities.BYOCCluster, error) { - return d.byocClusterRepo.Find(ctx, repos.Query{ - Filter: repos.Filter{ - "spec.accountName": ctx.AccountName, - }, +func (d *domain) applyHelmKloudliteAgent(ctx InfraContext, cluster *entities.Cluster, clusterToken string) error { + b, err := templates.Read(templates.HelmKloudliteAgent) + if err != nil { + return errors.NewE(err) + } + + b2, err := templates.ParseBytes(b, map[string]any{ + "account-name": ctx.AccountName, + "cluster-name": cluster.Name, + "cluster-token": clusterToken, + + "kloudlite-release": d.env.KloudliteRelease, + "message-office-grpc-addr": d.env.MessageOfficeExternalGrpcAddr, }) + if err != nil { + return errors.NewE(err) + } + + var m map[string]any + if err := yaml.Unmarshal(b2, &m); err != nil { + return errors.NewE(err) + } + + helmChart, err := fn.JsonConvert[crdsv1.HelmChart](m) + if err != nil { + return errors.NewE(err) + } + + hr := entities.HelmRelease{ + HelmChart: helmChart, + ResourceMetadata: common.ResourceMetadata{ + DisplayName: fmt.Sprintf("kloudlite agent %s", d.env.KloudliteRelease), + CreatedBy: common.CreatedOrUpdatedBy{ + UserId: "kloudlite-platform", + UserName: "kloudlite-platform", + UserEmail: "kloudlite-platform", + }, + LastUpdatedBy: common.CreatedOrUpdatedBy{ + UserId: "kloudlite-platform", + UserName: "kloudlite-platform", + UserEmail: "kloudlite-platform", + }, + }, + AccountName: ctx.AccountName, + ClusterName: cluster.Name, + SyncStatus: t.GenSyncStatus(t.SyncActionApply, 0), + } + + hr.IncrementRecordVersion() + + uhr, err := d.upsertHelmRelease(ctx, cluster.Name, &hr) + if err != nil { + return errors.NewE(err) + } + + if err := d.resDispatcher.ApplyToTargetCluster(ctx, cluster.Name, &uhr.HelmChart, uhr.RecordVersion); err != nil { + return errors.NewE(err) + } + + return nil } -func (d *domain) GetBYOCCluster(ctx InfraContext, name string) (*entities.BYOCCluster, error) { - return d.findBYOCCluster(ctx, name) +func (d *domain) ListClusters(ctx InfraContext, mf map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.Cluster], error) { + if err := d.canPerformActionInAccount(ctx, iamT.ListClusters); err != nil { + return nil, errors.NewE(err) + } + + accNs, err := d.getAccNamespace(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + f := repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataNamespace: accNs, + } + + pr, err := d.clusterRepo.FindPaginated(ctx, d.secretRepo.MergeMatchFilters(f, mf), pagination) + if err != nil { + return nil, errors.NewE(err) + } + + return pr, nil } -func (d *domain) UpdateBYOCCluster(ctx InfraContext, cluster entities.BYOCCluster) (*entities.BYOCCluster, error) { - cluster.EnsureGVK() - c, err := d.findBYOCCluster(ctx, cluster.Name) +func (d *domain) GetCluster(ctx InfraContext, name string) (*entities.Cluster, error) { + if err := d.canPerformActionInAccount(ctx, iamT.GetCluster); err != nil { + return nil, errors.NewE(err) + } + + c, err := d.findCluster(ctx, name) if err != nil { - return nil, err + return nil, errors.NewE(err) + } + + return c, nil +} + +func (d *domain) UpdateCluster(ctx InfraContext, clusterIn entities.Cluster) (*entities.Cluster, error) { + if err := d.canPerformActionInAccount(ctx, iamT.UpdateCluster); err != nil { + return nil, errors.NewE(err) } - c.BYOC = cluster.BYOC - c.SyncStatus = t.GetSyncStatusForUpdation(c.Generation + 1) + clusterIn.EnsureGVK() - // c.Spec.AccountName = ctx.AccountName - // c.Spec.Region = cluster.Spec.Region - // c.Spec.Provider = cluster.Spec.Provider - uCluster, err := d.byocClusterRepo.UpdateOne(ctx, repos.Filter{"metadata.name": cluster.Name}, c) + uCluster, err := d.clusterRepo.Patch( + ctx, + repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataName: clusterIn.Name, + }, + common.PatchForUpdate(ctx, &clusterIn), + ) if err != nil { - return nil, err + return nil, errors.NewE(err) } - if err := d.applyK8sResource(ctx, &uCluster.BYOC); err != nil { - return nil, err + if err := d.applyCluster(ctx, uCluster); err != nil { + return nil, errors.NewE(err) } + d.resourceEventPublisher.PublishInfraEvent(ctx, ResourceTypeCluster, uCluster.Name, PublishUpdate) return uCluster, nil } -func (d *domain) DeleteBYOCCluster(ctx InfraContext, name string) error { - clus, err := d.findBYOCCluster(ctx, name) - if err != nil { - return err +func (d *domain) readClusterK8sResource(ctx InfraContext, namespace string, name string) (cluster *clustersv1.Cluster, found bool, err error) { + var clus entities.Cluster + if err := d.k8sClient.Get(ctx, fn.NN(namespace, name), &clus.Cluster); err != nil { + if apiErrors.IsNotFound(err) { + return nil, false, nil + } + } + return &clus.Cluster, true, nil +} + +func (d *domain) DeleteCluster(ctx InfraContext, name string) error { + if err := d.canPerformActionInAccount(ctx, iamT.DeleteCluster); err != nil { + return errors.NewE(err) } - clus.SyncStatus = t.GetSyncStatusForDeletion(clus.Generation) - upC, err := d.byocClusterRepo.UpdateById(ctx, clus.Id, clus) + ucluster, err := d.clusterRepo.Patch( + ctx, + repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataName: name, + }, + common.PatchForMarkDeletion(), + ) if err != nil { - return err + return errors.NewE(err) } - return d.deleteK8sResource(ctx, &upC.BYOC) + + d.resourceEventPublisher.PublishInfraEvent(ctx, ResourceTypeCluster, ucluster.Name, PublishUpdate) + if err := d.deleteK8sResource(ctx, &ucluster.Cluster); err != nil { + return errors.NewE(err) + } + return nil } -func (d *domain) OnDeleteBYOCClusterMessage(ctx InfraContext, cluster entities.BYOCCluster) error { - return d.clusterRepo.DeleteOne(ctx, repos.Filter{ - "spec.accountName": ctx.AccountName, - "metadata.name": cluster.Name, +func (d *domain) OnClusterDeleteMessage(ctx InfraContext, cluster entities.Cluster) error { + accNs, err := d.getAccNamespace(ctx) + if err != nil { + return errors.NewE(err) + } + err = d.clusterRepo.DeleteOne(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataName: cluster.Name, + fields.MetadataNamespace: accNs, }) + if err != nil { + return errors.NewE(err) + } + + d.resourceEventPublisher.PublishInfraEvent(ctx, ResourceTypeCluster, cluster.Name, PublishDelete) + + return nil } -func (d *domain) OnBYOCClusterHelmUpdates(ctx InfraContext, cluster entities.BYOCCluster) error { - c, err := d.findBYOCCluster(ctx, cluster.Name) +func (d *domain) OnClusterUpdateMessage(ctx InfraContext, cluster entities.Cluster, status types.ResourceStatus, opts UpdateAndDeleteOpts) error { + xCluster, err := d.findCluster(ctx, cluster.Name) if err != nil { - return err + return errors.NewE(err) } - _, err = d.byocClusterRepo.UpdateById(ctx, c.Id, &cluster) + recordVersion, err := d.matchRecordVersion(cluster.Annotations, xCluster.RecordVersion) if err != nil { - return err + return nil } - return nil + + uCluster, err := d.clusterRepo.PatchById( + ctx, + xCluster.Id, + common.PatchForSyncFromAgent(&cluster, recordVersion, status, common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + XPatch: repos.Document{ + fc.ClusterSpecOutput: cluster.Spec.Output, + }, + })) + d.resourceEventPublisher.PublishInfraEvent(ctx, ResourceTypeCluster, uCluster.GetName(), PublishUpdate) + return errors.NewE(err) } -// func (d *domain) OnUpdateBYOCClusterMessage(ctx InfraContext, cluster entities.BYOCCluster) error { -// d.findBYOCCluster(ctx, cluster.Name) -// } +func (d *domain) findCluster(ctx InfraContext, clusterName string) (*entities.Cluster, error) { + accNs, err := d.getAccNamespace(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + cluster, err := d.clusterRepo.FindOne(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataName: clusterName, + fields.MetadataNamespace: accNs, + }) + if err != nil { + return nil, errors.NewE(err) + } + + if cluster == nil { + return nil, errors.Newf("cluster with name %q not found", clusterName) + } + return cluster, nil +} diff --git a/apps/infra/internal/domain/clusters_test b/apps/infra/internal/domain/clusters_test new file mode 100644 index 000000000..f65339db8 --- /dev/null +++ b/apps/infra/internal/domain/clusters_test @@ -0,0 +1,324 @@ +package domain + +import ( + "context" + "errors" + "testing" + + domainMocks "github.com/kloudlite/api/apps/infra/internal/domain/mocks" + "github.com/kloudlite/api/apps/infra/internal/entities" + "github.com/kloudlite/api/apps/infra/internal/env" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/accounts" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" + message_office_internal "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/message-office-internal" + iamMock "github.com/kloudlite/api/mocks/grpc-interfaces/kloudlite.io/rpc/iam" + msgOfficeInternalMock "github.com/kloudlite/api/mocks/grpc-interfaces/kloudlite.io/rpc/message-office-internal" + k8sMock "github.com/kloudlite/api/mocks/pkg/k8s" + + reposMock "github.com/kloudlite/api/mocks/pkg/repos" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/api/pkg/repos" + "github.com/kloudlite/api/pkg/types" + clustersv1 "github.com/kloudlite/operator/apis/clusters/v1" + "google.golang.org/grpc" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +func TestCreateCluster(t *testing.T) { + type domainArgs struct { + env *env.Env + + byocClusterRepo reposMock.DbRepo[*entities.BYOCCluster] + clusterRepo reposMock.DbRepo[*entities.Cluster] + nodeRepo reposMock.DbRepo[*entities.Node] + nodePoolRepo reposMock.DbRepo[*entities.NodePool] + domainEntryRepo reposMock.DbRepo[*entities.DomainEntry] + secretRepo reposMock.DbRepo[*entities.CloudProviderSecret] + vpnDeviceRepo reposMock.DbRepo[*entities.VPNDevice] + pvcRepo reposMock.DbRepo[*entities.PersistentVolumeClaim] + buildRunRepo reposMock.DbRepo[*entities.BuildRun] + + k8sClient k8sMock.Client + + + iamClient iamMock.IAMClient + accountsSvc domainMocks.AccountsSvc + messageOfficeInternalClient msgOfficeInternalMock.MessageOfficeInternalClient + } + + type args struct { + ctx InfraContext + cluster entities.Cluster + } + + type want struct { + cluster *entities.Cluster + errorLike func(t *testing.T, gotErr error) + } + + type test struct { + name string + buildDomain func(d *domainArgs) + args args + want want + } + + logerr := func(t *testing.T, gotErr error, wantErr error) { + t.Errorf("CreateCluster() errored, got error = %v, want error = %v", gotErr, wantErr) + } + + tests := []test{ + { + name: "1. when iam grpc service is unreachable/down, creation should fail", + buildDomain: func(d *domainArgs) { + d.iamClient = iamMock.IAMClient{} + d.iamClient.MockCan = func(ctx context.Context, in *iam.CanIn, opts ...grpc.CallOption) (*iam.CanOut, error) { + return nil, errors.New("iam grpc service is unreachable/down") + } + }, + args: args{ + ctx: InfraContext{}, + cluster: entities.Cluster{}, + }, + want: want{ + cluster: nil, + errorLike: func(t *testing.T, gotErr error) { + var werr ErrGRPCCall + if !errors.As(gotErr, &werr) { + logerr(t, gotErr, werr) + } + }, + }, + }, + { + name: "2. when user is not allowed to create cluster, creation should fail", + buildDomain: func(d *domainArgs) { + d.iamClient = iamMock.IAMClient{} + d.iamClient.MockCan = func(ctx context.Context, in *iam.CanIn, opts ...grpc.CallOption) (*iam.CanOut, error) { + return &iam.CanOut{ + Status: false, + }, nil + } + }, + args: args{ + ctx: InfraContext{}, + cluster: entities.Cluster{}, + }, + want: want{ + cluster: nil, + errorLike: func(t *testing.T, gotErr error) { + var werr ErrIAMUnauthorized + if !errors.As(gotErr, &werr) { + logerr(t, gotErr, werr) + } + }, + }, + }, + { + name: "3. when account does not exist, creation should fail", + buildDomain: func(d *domainArgs) { + d.iamClient.MockCan = func(ctx context.Context, in *iam.CanIn, opts ...grpc.CallOption) (*iam.CanOut, error) { + return &iam.CanOut{ + Status: true, + }, nil + } + + d.accountsSvc.MockGetAccount = func(ctx context.Context, userId, accountName string) (*accounts.GetAccountOut, error) { + return nil, errors.New("account does not exist") + } + }, + args: args{ + ctx: InfraContext{}, + cluster: entities.Cluster{ + Cluster: clustersv1.Cluster{ + ObjectMeta: metav1.ObjectMeta{}, + }, + }, + }, + want: want{ + cluster: nil, + errorLike: func(t *testing.T, gotErr error) { + werr := errors.New("account does not exist") + if gotErr.Error() != werr.Error() { + logerr(t, gotErr, werr) + } + }, + }, + }, + { + name: "4. when cluster already exists, creation should fail", + buildDomain: func(d *domainArgs) { + d.iamClient.MockCan = func(ctx context.Context, in *iam.CanIn, opts ...grpc.CallOption) (*iam.CanOut, error) { + return &iam.CanOut{ + Status: true, + }, nil + } + + d.accountsSvc.MockGetAccount = func(ctx context.Context, userId, accountName string) (*accounts.GetAccountOut, error) { + return &accounts.GetAccountOut{ + IsActive: true, + TargetNamespace: "sample", + AccountId: "sample", + }, nil + } + + d.clusterRepo.MockFindOne = func(ctx context.Context, filter repos.Filter) (*entities.Cluster, error) { + return &entities.Cluster{ + BaseEntity: repos.BaseEntity{}, + Cluster: clustersv1.Cluster{ + ObjectMeta: metav1.ObjectMeta{ + Name: "sample", + }, + }, + ResourceMetadata: common.ResourceMetadata{}, + AccountName: "", + SyncStatus: types.SyncStatus{}, + }, nil + } + + d.secretRepo.MockFindOne = func(ctx context.Context, filter repos.Filter) (*entities.CloudProviderSecret, error) { + return &entities.CloudProviderSecret{}, nil + } + + d.messageOfficeInternalClient.MockGenerateClusterToken = func(ctx context.Context, in *message_office_internal.GenerateClusterTokenIn, opts ...grpc.CallOption) (*message_office_internal.GenerateClusterTokenOut, error) { + return &message_office_internal.GenerateClusterTokenOut{ + ClusterToken: "sample", + }, nil + } + + d.k8sClient.MockValidateObject = func(ctx context.Context, obj client.Object) error { + return nil + } + + d.k8sClient.MockApplyYAML = func(ctx context.Context, yamls ...[]byte) error { + return nil + } + + d.clusterRepo.MockCreate = func(ctx context.Context, data *entities.Cluster) (*entities.Cluster, error) { + return &entities.Cluster{}, nil + } + }, + args: args{ + ctx: InfraContext{}, + cluster: entities.Cluster{ + Cluster: clustersv1.Cluster{ + ObjectMeta: metav1.ObjectMeta{ + Name: "sample", + }, + }, + }, + }, + want: want{ + cluster: nil, + errorLike: func(t *testing.T, gotErr error) { + var werr ErrClusterAlreadyExists + if !errors.As(gotErr, &werr) { + logerr(t, gotErr, werr) + } + }, + }, + }, + // { + // name: "5. when cluster already exists", + // buildDomain: func(d *domainArgs) { + // d.iamClient = iamMock.IAMClient{} + // d.iamClient.MockCan = func(ctx context.Context, in *iam.CanIn, opts ...grpc.CallOption) (*iam.CanOut, error) { + // return &iam.CanOut{ + // Status: true, + // }, nil + // } + // + // d.accountsSvc.MockGetAccount = func(ctx context.Context, userId, accountName string) (*accounts.GetAccountOut, error) { + // return &accounts.GetAccountOut{ + // IsActive: true, + // TargetNamespace: "sample", + // AccountId: "sample", + // }, nil + // } + // + // d.clusterRepo.MockFindOne = func(ctx context.Context, filter repos.Filter) (*entities.Cluster, error) { + // return &entities.Cluster{ + // BaseEntity: repos.BaseEntity{}, + // Cluster: clustersv1.Cluster{ + // ObjectMeta: metav1.ObjectMeta{ + // Name: "sample", + // }, + // }, + // ResourceMetadata: common.ResourceMetadata{}, + // AccountName: "", + // SyncStatus: types.SyncStatus{}, + // }, nil + // } + // + // d.secretRepo.MockFindOne = func(ctx context.Context, filter repos.Filter) (*entities.CloudProviderSecret, error) { + // return &entities.CloudProviderSecret{}, nil + // } + // + // d.messageOfficeInternalClient.MockGenerateClusterToken = func(ctx context.Context, in *message_office_internal.GenerateClusterTokenIn, opts ...grpc.CallOption) (*message_office_internal.GenerateClusterTokenOut, error) { + // return &message_office_internal.GenerateClusterTokenOut{ + // ClusterToken: "sample", + // }, nil + // } + // + // d.k8sClient.MockValidateObject = func(ctx context.Context, obj client.Object) error { + // return nil + // } + // + // d.k8sClient.MockApplyYAML = func(ctx context.Context, yamls ...[]byte) error { + // return nil + // } + // + // d.clusterRepo.MockCreate = func(ctx context.Context, data *entities.Cluster) (*entities.Cluster, error) { + // return &entities.Cluster{}, nil + // } + // }, + // args: args{ + // ctx: InfraContext{}, + // cluster: entities.Cluster{}, + // }, + // want: want{ + // cluster: nil, + // errorLike: func(t *testing.T, gotErr error) { + // var werr ErrIAMUnauthorized + // if !errors.As(gotErr, &werr) { + // logerr(t, gotErr, werr) + // } + // }, + // }, + // }, + } + + logger, _ := logging.New(&logging.Options{Name: "test"}) + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + dargs := domainArgs{} + tt.buildDomain(&dargs) + d := domain{ + logger: logger, + env: &env.Env{}, + byocClusterRepo: &dargs.byocClusterRepo, + clusterRepo: &dargs.clusterRepo, + nodeRepo: &dargs.nodeRepo, + nodePoolRepo: &dargs.nodePoolRepo, + domainEntryRepo: &dargs.domainEntryRepo, + secretRepo: &dargs.secretRepo, + vpnDeviceRepo: &dargs.vpnDeviceRepo, + pvcRepo: &dargs.pvcRepo, + buildRunRepo: &dargs.buildRunRepo, + k8sClient: &dargs.k8sClient, + iamClient: &dargs.iamClient, + accountsSvc: &dargs.accountsSvc, + messageOfficeInternalClient: &dargs.messageOfficeInternalClient, + } + got, err := d.CreateCluster(tt.args.ctx, tt.args.cluster) + if err != nil && tt.want.errorLike != nil { + tt.want.errorLike(t, err) + } + if got != tt.want.cluster { + t.Errorf("CreateCluster() returned, got cluster = %v, want cluster = %v", got, tt.want) + } + }) + } +} diff --git a/apps/infra/internal/domain/domain-entries.go b/apps/infra/internal/domain/domain-entries.go new file mode 100644 index 000000000..bd438d8ff --- /dev/null +++ b/apps/infra/internal/domain/domain-entries.go @@ -0,0 +1,111 @@ +package domain + +import ( + "context" + iamT "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/apps/infra/internal/entities" + fc "github.com/kloudlite/api/apps/infra/internal/entities/field-constants" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" +) + +func (d *domain) ListDomainEntries(ctx InfraContext, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.DomainEntry], error) { + if err := d.canPerformActionInAccount(ctx, iamT.ListDomainEntries); err != nil { + return nil, errors.NewE(err) + } + + filters := map[string]any{ + fields.AccountName: ctx.AccountName, + } + return d.domainEntryRepo.FindPaginated(ctx, d.domainEntryRepo.MergeMatchFilters(filters, search), pagination) +} + +func (d *domain) GetDomainEntry(ctx InfraContext, domainName string) (*entities.DomainEntry, error) { + if err := d.canPerformActionInAccount(ctx, iamT.GetDomainEntry); err != nil { + return nil, errors.NewE(err) + } + return d.findDomainEntry(ctx, ctx.AccountName, domainName) +} + +func (d *domain) CreateDomainEntry(ctx InfraContext, de entities.DomainEntry) (*entities.DomainEntry, error) { + if err := d.canPerformActionInAccount(ctx, iamT.CreateDomainEntry); err != nil { + return nil, errors.NewE(err) + } + de.AccountName = ctx.AccountName + de.CreatedBy = common.CreatedOrUpdatedBy{ + UserId: ctx.UserId, + UserName: ctx.UserName, + UserEmail: ctx.UserEmail, + } + de.LastUpdatedBy = de.CreatedBy + + nde, err := d.domainEntryRepo.Create(ctx, &de) + if err != nil { + return nil, errors.NewE(err) + } + d.resourceEventPublisher.PublishInfraEvent(ctx, ResourceTypeDomainEntries, nde.DomainName, PublishAdd) + + return nde, nil +} + +func (d *domain) UpdateDomainEntry(ctx InfraContext, de entities.DomainEntry) (*entities.DomainEntry, error) { + if err := d.canPerformActionInAccount(ctx, iamT.UpdateDomainEntry); err != nil { + return nil, errors.NewE(err) + } + + existing, err := d.findDomainEntry(ctx, ctx.AccountName, de.DomainName) + if err != nil { + return nil, errors.NewE(err) + } + + existing.DisplayName = de.DisplayName + existing.LastUpdatedBy = common.CreatedOrUpdatedBy{ + UserId: ctx.UserId, + UserName: ctx.UserName, + UserEmail: ctx.UserEmail, + } + + newDe, err := d.domainEntryRepo.UpdateById(ctx, existing.Id, existing) + if err != nil { + return nil, errors.NewE(err) + } + d.resourceEventPublisher.PublishInfraEvent(ctx, ResourceTypeDomainEntries, newDe.DomainName, PublishUpdate) + return newDe, nil +} + +func (d *domain) DeleteDomainEntry(ctx InfraContext, domainName string) error { + if err := d.canPerformActionInAccount(ctx, iamT.DeleteDomainEntry); err != nil { + return errors.NewE(err) + } + err := d.domainEntryRepo.DeleteOne( + ctx, + repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataName: domainName, + }, + ) + if err != nil { + return errors.NewE(err) + } + d.resourceEventPublisher.PublishInfraEvent(ctx, ResourceTypeDomainEntries, domainName, PublishDelete) + return nil +} + +func (d *domain) findDomainEntry(ctx context.Context, accountName string, domainName string) (*entities.DomainEntry, error) { + filters := repos.Filter{ + fields.AccountName: accountName, + fc.DomainEntryDomainName: domainName, + } + one, err := d.domainEntryRepo.FindOne(ctx, filters) + if err != nil { + return nil, errors.NewE(err) + } + + if one == nil { + return nil, errors.Newf("domainName entry not found") + } + + return one, nil +} diff --git a/apps/infra/internal/domain/domain.go b/apps/infra/internal/domain/domain.go index a8fd00592..3542cbf4f 100644 --- a/apps/infra/internal/domain/domain.go +++ b/apps/infra/internal/domain/domain.go @@ -1,128 +1,226 @@ package domain import ( - "encoding/json" - - "github.com/kloudlite/operator/agent/types" - "github.com/kloudlite/operator/pkg/kubectl" + "fmt" + "io" + "os" + "strconv" + + "sigs.k8s.io/yaml" + + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/k8s" + + "github.com/kloudlite/api/apps/infra/internal/entities" + + "github.com/kloudlite/api/apps/infra/internal/env" + constant "github.com/kloudlite/api/constants" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" + message_office_internal "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/message-office-internal" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/api/pkg/repos" + "github.com/kloudlite/operator/pkg/constants" "go.uber.org/fx" - "kloudlite.io/apps/infra/internal/domain/entities" - "kloudlite.io/apps/infra/internal/env" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/finance" - "kloudlite.io/pkg/agent" - fn "kloudlite.io/pkg/functions" - "kloudlite.io/pkg/k8s" - "kloudlite.io/pkg/redpanda" - "kloudlite.io/pkg/repos" "sigs.k8s.io/controller-runtime/pkg/client" + + types "github.com/kloudlite/api/pkg/types" ) type domain struct { - env *env.Env - - clusterRepo repos.DbRepo[*entities.Cluster] - byocClusterRepo repos.DbRepo[*entities.BYOCCluster] - edgeRepo repos.DbRepo[*entities.Edge] - providerRepo repos.DbRepo[*entities.CloudProvider] - k8sClient client.Client - masterNodeRepo repos.DbRepo[*entities.MasterNode] - workerNodeRepo repos.DbRepo[*entities.WorkerNode] - nodePoolRepo repos.DbRepo[*entities.NodePool] - - secretRepo repos.DbRepo[*entities.Secret] - - producer redpanda.Producer - k8sYamlClient *kubectl.YAMLClient - k8sExtendedClient k8s.ExtendedK8sClient + logger logging.Logger + env *env.Env + + clusterRepo repos.DbRepo[*entities.Cluster] + clusterManagedServiceRepo repos.DbRepo[*entities.ClusterManagedService] + helmReleaseRepo repos.DbRepo[*entities.HelmRelease] + nodeRepo repos.DbRepo[*entities.Node] + nodePoolRepo repos.DbRepo[*entities.NodePool] + domainEntryRepo repos.DbRepo[*entities.DomainEntry] + secretRepo repos.DbRepo[*entities.CloudProviderSecret] + pvcRepo repos.DbRepo[*entities.PersistentVolumeClaim] + namespaceRepo repos.DbRepo[*entities.Namespace] + pvRepo repos.DbRepo[*entities.PersistentVolume] + volumeAttachmentRepo repos.DbRepo[*entities.VolumeAttachment] + + iamClient iam.IAMClient + accountsSvc AccountsSvc + messageOfficeInternalClient message_office_internal.MessageOfficeInternalClient + resDispatcher ResourceDispatcher + k8sClient k8s.Client + resourceEventPublisher ResourceEventPublisher + + msvcTemplates []*entities.MsvcTemplate + msvcTemplatesMap map[string]map[string]*entities.MsvcTemplateEntry } -func (d *domain) dispatchToTargetAgent(ctx InfraContext, action agent.Action, clusterName string, obj client.Object) error { - // b, err := fn.K8sObjToYAML(obj) - // if err != nil { - // return err - // } - var m map[string]any - if err := fn.JsonConversion(obj, &m); err != nil { - return err +func (d *domain) resyncToTargetCluster(ctx InfraContext, action types.SyncAction, clusterName string, obj client.Object, recordVersion int) error { + switch action { + case types.SyncActionApply: + return d.resDispatcher.ApplyToTargetCluster(ctx, clusterName, obj, recordVersion) + case types.SyncActionDelete: + return d.resDispatcher.DeleteFromTargetCluster(ctx, clusterName, obj) } + return errors.Newf("unknonw action: %q", action) +} - b, err := json.Marshal(types.AgentMessage{ - AccountName: ctx.AccountName, - ClusterName: clusterName, - Action: types.ActionApply, - Object: m, - }) - if err != nil { - return err +func addTrackingId(obj client.Object, id repos.ID) { + ann := obj.GetAnnotations() + if ann == nil { + ann = make(map[string]string, 1) } - - _, err = d.producer.Produce(ctx, clusterName+"-incoming", obj.GetNamespace(), b) - return err + ann[constant.ObservabilityTrackingKey] = string(id) + obj.SetAnnotations(ann) } -func (d *domain) applyK8sResource(ctx InfraContext, obj client.Object) error { +func (d *domain) applyK8sResource(ctx InfraContext, obj client.Object, recordVersion int) error { + if recordVersion > 0 { + ann := obj.GetAnnotations() + if ann == nil { + ann = make(map[string]string, 1) + } + ann[constants.RecordVersionKey] = fmt.Sprintf("%d", recordVersion) + obj.SetAnnotations(ann) + } + b, err := fn.K8sObjToYAML(obj) if err != nil { - return err - } - if _, err := d.k8sYamlClient.ApplyYAML(ctx, b); err != nil { - return err + return errors.NewE(err) } + if err := d.k8sClient.ApplyYAML(ctx, b); err != nil { + return errors.NewE(err) + } return nil } func (d *domain) deleteK8sResource(ctx InfraContext, obj client.Object) error { b, err := fn.K8sObjToYAML(obj) if err != nil { - return err + return errors.NewE(err) } - if err := d.k8sYamlClient.DeleteYAML(ctx, b); err != nil { - return err + if err := d.k8sClient.DeleteYAML(ctx, b); err != nil { + return errors.NewE(err) } return nil } +func (d *domain) parseRecordVersionFromAnnotations(annotations map[string]string) (int, error) { + annotatedVersion, ok := annotations[constants.RecordVersionKey] + if !ok { + return 0, errors.Newf("no annotation with record version key (%s), found on the resource", constants.RecordVersionKey) + } + + annVersion, err := strconv.ParseInt(annotatedVersion, 10, 32) + if err != nil { + return 0, errors.NewE(err) + } + + return int(annVersion), nil +} + +func (d *domain) matchRecordVersion(annotations map[string]string, rv int) (int, error) { + annVersion, err := d.parseRecordVersionFromAnnotations(annotations) + if err != nil { + return -1, errors.NewE(err) + } + + if annVersion != rv { + return -1, errors.Newf("record version mismatch, expected %d, got %d", rv, annVersion) + } + + return annVersion, nil +} + +func (d *domain) getAccNamespace(ctx InfraContext) (string, error) { + acc, err := d.accountsSvc.GetAccount(ctx, string(ctx.UserId), ctx.AccountName) + if err != nil { + return "", errors.NewE(err) + } + if !acc.IsActive { + return "", errors.Newf("account %q is not active", ctx.AccountName) + } + + return acc.TargetNamespace, nil +} + var Module = fx.Module("domain", fx.Provide( func( env *env.Env, clusterRepo repos.DbRepo[*entities.Cluster], - byocClusterRepo repos.DbRepo[*entities.BYOCCluster], - providerRepo repos.DbRepo[*entities.CloudProvider], - edgeRepo repos.DbRepo[*entities.Edge], - masterNodeRepo repos.DbRepo[*entities.MasterNode], - workerNodeRepo repos.DbRepo[*entities.WorkerNode], + clustermanagedserviceRepo repos.DbRepo[*entities.ClusterManagedService], + nodeRepo repos.DbRepo[*entities.Node], nodePoolRepo repos.DbRepo[*entities.NodePool], - secretRepo repos.DbRepo[*entities.Secret], + secretRepo repos.DbRepo[*entities.CloudProviderSecret], + domainNameRepo repos.DbRepo[*entities.DomainEntry], + resourceDispatcher ResourceDispatcher, + helmReleaseRepo repos.DbRepo[*entities.HelmRelease], + + pvcRepo repos.DbRepo[*entities.PersistentVolumeClaim], + pvRepo repos.DbRepo[*entities.PersistentVolume], + namespaceRepo repos.DbRepo[*entities.Namespace], + volumeAttachmentRepo repos.DbRepo[*entities.VolumeAttachment], + + k8sClient k8s.Client, + + iamClient iam.IAMClient, + accountsSvc AccountsSvc, + msgOfficeInternalClient message_office_internal.MessageOfficeInternalClient, + logger logging.Logger, + resourceEventPublisher ResourceEventPublisher, + ) (Domain, error) { + open, err := os.Open(env.MsvcTemplateFilePath) + if err != nil { + return nil, errors.NewE(err) + } - financeClient finance.FinanceClient, + b, err := io.ReadAll(open) + if err != nil { + return nil, errors.NewE(err) + } - // agentMessenger agent.Sender, - producer redpanda.Producer, + var templates []*entities.MsvcTemplate - k8sClient client.Client, - k8sYamlClient *kubectl.YAMLClient, - k8sExtendedClient k8s.ExtendedK8sClient, - ) Domain { - return &domain{ - env: env, - - clusterRepo: clusterRepo, - byocClusterRepo: byocClusterRepo, - providerRepo: providerRepo, - edgeRepo: edgeRepo, - masterNodeRepo: masterNodeRepo, - workerNodeRepo: workerNodeRepo, - nodePoolRepo: nodePoolRepo, - secretRepo: secretRepo, - - producer: producer, - - k8sClient: k8sClient, - k8sYamlClient: k8sYamlClient, - k8sExtendedClient: k8sExtendedClient, + if err := yaml.Unmarshal(b, &templates); err != nil { + return nil, errors.NewE(err) } + + msvcTemplatesMap := map[string]map[string]*entities.MsvcTemplateEntry{} + + for _, t := range templates { + if _, ok := msvcTemplatesMap[t.Category]; !ok { + msvcTemplatesMap[t.Category] = make(map[string]*entities.MsvcTemplateEntry, len(t.Items)) + } + for i := range t.Items { + msvcTemplatesMap[t.Category][t.Items[i].Name] = &t.Items[i] + } + } + + return &domain{ + msvcTemplatesMap: msvcTemplatesMap, + msvcTemplates: templates, + logger: logger, + env: env, + clusterRepo: clusterRepo, + clusterManagedServiceRepo: clustermanagedserviceRepo, + nodeRepo: nodeRepo, + nodePoolRepo: nodePoolRepo, + secretRepo: secretRepo, + domainEntryRepo: domainNameRepo, + resDispatcher: resourceDispatcher, + k8sClient: k8sClient, + iamClient: iamClient, + accountsSvc: accountsSvc, + messageOfficeInternalClient: msgOfficeInternalClient, + resourceEventPublisher: resourceEventPublisher, + helmReleaseRepo: helmReleaseRepo, + + pvcRepo: pvcRepo, + volumeAttachmentRepo: volumeAttachmentRepo, + pvRepo: pvRepo, + namespaceRepo: namespaceRepo, + }, nil }), ) diff --git a/apps/infra/internal/domain/edges.go b/apps/infra/internal/domain/edges.go deleted file mode 100644 index bb9e6c1dd..000000000 --- a/apps/infra/internal/domain/edges.go +++ /dev/null @@ -1,118 +0,0 @@ -package domain - -import ( - "fmt" - "time" - - "kloudlite.io/apps/infra/internal/domain/entities" - "kloudlite.io/pkg/repos" - t "kloudlite.io/pkg/types" -) - -func (d *domain) CreateEdge(ctx InfraContext, edge entities.Edge) (*entities.Edge, error) { - edge.EnsureGVK() - if err := d.k8sExtendedClient.ValidateStruct(ctx, &edge.Edge); err != nil { - return nil, err - } - - edge.AccountName = ctx.AccountName - edge.SyncStatus = t.GetSyncStatusForCreation() - nEdge, err := d.edgeRepo.Create(ctx, &edge) - if err != nil { - return nil, err - } - - if err := d.applyK8sResource(ctx, &nEdge.Edge); err != nil { - return nil, err - } - return nEdge, err -} - -func (d *domain) ListEdges(ctx InfraContext, clusterName string, providerName *string) ([]*entities.Edge, error) { - f := repos.Filter{"spec.clusterName": clusterName} - if providerName != nil { - f["spec.providerName"] = providerName - } - return d.edgeRepo.Find(ctx, repos.Query{Filter: f}) -} - -func (d *domain) GetEdge(ctx InfraContext, clusterName string, name string) (*entities.Edge, error) { - return d.edgeRepo.FindOne(ctx, repos.Filter{"metadata.name": name, "spec.clusterName": clusterName}) -} - -func (d *domain) UpdateEdge(ctx InfraContext, edge entities.Edge) (*entities.Edge, error) { - edge.EnsureGVK() - - if err := d.k8sExtendedClient.ValidateStruct(ctx, &edge.Edge); err != nil { - return nil, err - } - - _, err := d.findCluster(ctx, edge.Spec.ClusterName) - if err != nil { - return nil, err - } - - e, err := d.findEdge(ctx, edge.Name) - if err != nil { - return nil, err - } - - e.Spec = edge.Spec - e.SyncStatus = t.GetSyncStatusForUpdation(e.Generation + 1) - - uEdge, err := d.edgeRepo.UpdateById(ctx, e.Id, e) - if err != nil { - return nil, err - } - - if err := d.applyK8sResource(ctx, &uEdge.Edge); err != nil { - return nil, err - } - return uEdge, nil -} - -func (d *domain) DeleteEdge(ctx InfraContext, clusterName string, name string) error { - e, err := d.findEdge(ctx, name) - if err != nil { - return err - } - e.SyncStatus = t.GetSyncStatusForDeletion(e.Generation) - return d.deleteK8sResource(ctx, e) -} - -func (d *domain) OnDeleteEdgeMessage(ctx InfraContext, edge entities.Edge) error { - e, err := d.findEdge(ctx, edge.Name) - if err != nil { - return err - } - - return d.edgeRepo.DeleteById(ctx, e.Id) -} - -func (d *domain) OnUpdateEdgeMessage(ctx InfraContext, edge entities.Edge) error { - e, err := d.findEdge(ctx, edge.Name) - if err != nil { - return err - } - - e.Edge = edge.Edge - e.SyncStatus.LastSyncedAt = time.Now() - e.SyncStatus.State = t.ParseSyncState(edge.Status.IsReady) - _, err = d.edgeRepo.UpdateById(ctx, e.Id, e) - return err -} - -func (d *domain) findEdge(ctx InfraContext, edgeName string) (*entities.Edge, error) { - e, err := d.edgeRepo.FindOne(ctx, repos.Filter{ - "accountName": ctx.AccountName, - "metadata.name": edgeName, - }) - if err != nil { - return nil, err - } - - if e == nil { - return nil, fmt.Errorf("edge with name %q not found", edgeName) - } - return e, nil -} diff --git a/apps/infra/internal/domain/entities/byoc-cluster.go b/apps/infra/internal/domain/entities/byoc-cluster.go deleted file mode 100644 index 9cc4ff515..000000000 --- a/apps/infra/internal/domain/entities/byoc-cluster.go +++ /dev/null @@ -1,38 +0,0 @@ -package entities - -import ( - clusterv1 "github.com/kloudlite/operator/apis/clusters/v1" - "kloudlite.io/pkg/repos" - t "kloudlite.io/pkg/types" -) - -type HelmStatusVal struct { - IsReady *bool `json:"isReady"` - Message string `json:"message"` -} - -type BYOCCluster struct { - repos.BaseEntity `bson:",inline" json:",inline"` - clusterv1.BYOC `json:",inline"` - IsConnected bool `json:"isConnected"` - SyncStatus t.SyncStatus `json:"syncStatus"` - HelmStatus map[string]HelmStatusVal `json:"helmStatus"` -} - -var BYOCClusterIndices = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: "id", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "metadata.name", Value: repos.IndexAsc}, - {Key: "spec.accountName", Value: repos.IndexAsc}, - {Key: "spec.region", Value: repos.IndexAsc}, - {Key: "spec.provider", Value: repos.IndexAsc}, - }, - Unique: true, - }, -} diff --git a/apps/infra/internal/domain/entities/cloud-provider.go b/apps/infra/internal/domain/entities/cloud-provider.go deleted file mode 100644 index a777827c9..000000000 --- a/apps/infra/internal/domain/entities/cloud-provider.go +++ /dev/null @@ -1,80 +0,0 @@ -package entities - -import ( - crdsv1 "github.com/kloudlite/operator/apis/crds/v1" - - infraV1 "github.com/kloudlite/cluster-operator/apis/infra/v1" - - "kloudlite.io/pkg/repos" - t "kloudlite.io/pkg/types" -) - -type Secret struct { - repos.BaseEntity `json:",inline"` - crdsv1.Secret `json:",inline"` - AccountName string `json:"accountName"` - ClusterName string `json:"clusterName"` - SyncStatus t.SyncStatus `json:"syncStatus"` -} - -var SecretIndices = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: "id", Value: repos.IndexAsc}, - }, - Unique: true, - }, - - { - Field: []repos.IndexKey{ - {Key: "metadata.name", Value: repos.IndexAsc}, - {Key: "metadata.namespace", Value: repos.IndexAsc}, - }, - Unique: true, - }, - - { - Field: []repos.IndexKey{ - {Key: "accountName", Value: repos.IndexAsc}, - }, - }, - { - Field: []repos.IndexKey{ - {Key: "clusterName", Value: repos.IndexAsc}, - }, - }, -} - -type CloudProvider struct { - repos.BaseEntity `bson:",inline" json:",inline"` - infraV1.CloudProvider `bson:",inline" json:",inline"` - AccountName string `json:"accountName"` - ClusterName string `json:"clusterName"` - SyncStatus t.SyncStatus `json:"syncStatus"` -} - -var CloudProviderIndices = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: "id", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "metadata.name", Value: repos.IndexAsc}, - {Key: "spec.accountId", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "accountName", Value: repos.IndexAsc}, - }, - }, - { - Field: []repos.IndexKey{ - {Key: "clusterName", Value: repos.IndexAsc}, - }, - }, -} diff --git a/apps/infra/internal/domain/entities/cluster.go b/apps/infra/internal/domain/entities/cluster.go deleted file mode 100644 index 2e2b6ab35..000000000 --- a/apps/infra/internal/domain/entities/cluster.go +++ /dev/null @@ -1,35 +0,0 @@ -package entities - -import ( - cmgrV1 "github.com/kloudlite/cluster-operator/apis/cmgr/v1" - "kloudlite.io/pkg/repos" - t "kloudlite.io/pkg/types" -) - -type Cluster struct { - repos.BaseEntity `bson:",inline" json:",inline"` - cmgrV1.Cluster `json:",inline"` - AccountName string `json:"accountName"` - - SyncStatus t.SyncStatus `json:"syncStatus"` -} - -var ClusterIndices = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: "id", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "metadata.name", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "accountName", Value: repos.IndexAsc}, - }, - }, -} diff --git a/apps/infra/internal/domain/entities/edge.go b/apps/infra/internal/domain/entities/edge.go deleted file mode 100644 index 1543d9add..000000000 --- a/apps/infra/internal/domain/entities/edge.go +++ /dev/null @@ -1,41 +0,0 @@ -package entities - -import ( - infraV1 "github.com/kloudlite/cluster-operator/apis/infra/v1" - "kloudlite.io/pkg/repos" - t "kloudlite.io/pkg/types" -) - -type Edge struct { - repos.BaseEntity `bson:",inline"` - infraV1.Edge `json:",inline" bson:",inline"` - AccountName string `json:"accountName"` - ClusterName string `json:"clusterName"` - SyncStatus t.SyncStatus `json:"syncStatus"` -} - -var EdgeIndices = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: "id", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "metadata.name", Value: repos.IndexAsc}, - }, - Unique: true, - }, - - { - Field: []repos.IndexKey{ - {Key: "accountName", Value: repos.IndexAsc}, - }, - }, - { - Field: []repos.IndexKey{ - {Key: "clusterName", Value: repos.IndexAsc}, - }, - }, -} diff --git a/apps/infra/internal/domain/entities/node.go b/apps/infra/internal/domain/entities/node.go deleted file mode 100644 index c83ad7c34..000000000 --- a/apps/infra/internal/domain/entities/node.go +++ /dev/null @@ -1,111 +0,0 @@ -package entities - -import ( - cmgrV1 "github.com/kloudlite/cluster-operator/apis/cmgr/v1" - infraV1 "github.com/kloudlite/cluster-operator/apis/infra/v1" - "kloudlite.io/pkg/repos" - t "kloudlite.io/pkg/types" -) - -type MasterNode struct { - repos.BaseEntity `json:",inline"` - cmgrV1.MasterNode `json:",inline"` - ClusterName string `json:"clusterName"` - AccountName string `json:"accountName"` - SyncStatus t.SyncStatus `json:"syncStatus"` -} - -var MasterNodeIndices = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: "id", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "metadata.name", Value: repos.IndexAsc}, - {Key: "spec.clusterName", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "accountName", Value: repos.IndexAsc}, - }, - }, - { - Field: []repos.IndexKey{ - {Key: "clusterName", Value: repos.IndexAsc}, - }, - }, -} - -type WorkerNode struct { - repos.BaseEntity `json:",inline"` - infraV1.WorkerNode `json:",inline"` - ClusterName string `json:"clusterName"` - AccountName string `json:"accountName"` - SyncStatus t.SyncStatus `json:"syncStatus"` -} - -var WorkerNodeIndices = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: "id", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "metadata.name", Value: repos.IndexAsc}, - {Key: "spec.clusterName", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "accountName", Value: repos.IndexAsc}, - }, - }, - { - Field: []repos.IndexKey{ - {Key: "clusterName", Value: repos.IndexAsc}, - }, - }, -} - -type NodePool struct { - repos.BaseEntity `json:",inline"` - infraV1.NodePool `json:",inline"` - AccountName string `json:"accoutName"` - ClusterName string `json:"clusterName"` - SyncStatus t.SyncStatus `json:"syncStatus"` -} - -var NodePoolIndices = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: "id", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "metadata.name", Value: repos.IndexAsc}, - {Key: "spec.edgeName", Value: repos.IndexAsc}, - {Key: "spec.clusterName", Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: "accountName", Value: repos.IndexAsc}, - }, - }, - { - Field: []repos.IndexKey{ - {Key: "clusterName", Value: repos.IndexAsc}, - }, - }, -} diff --git a/apps/infra/internal/domain/helm-release.go b/apps/infra/internal/domain/helm-release.go new file mode 100644 index 000000000..b56e6dfc6 --- /dev/null +++ b/apps/infra/internal/domain/helm-release.go @@ -0,0 +1,273 @@ +package domain + +import ( + iamT "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/apps/infra/internal/entities" + fc "github.com/kloudlite/api/apps/infra/internal/entities/field-constants" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + "github.com/kloudlite/operator/operators/resource-watcher/types" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +func (d *domain) findHelmRelease(ctx InfraContext, clusterName string, hrName string) (*entities.HelmRelease, error) { + cluster, err := d.helmReleaseRepo.FindOne(ctx, repos.Filter{ + fields.ClusterName: clusterName, + fields.AccountName: ctx.AccountName, + fields.MetadataName: hrName, + }) + if err != nil { + return nil, errors.NewE(err) + } + + if cluster == nil { + return nil, errors.Newf("helm release with name %q not found", hrName) + } + return cluster, nil +} + +func (d *domain) upsertHelmRelease(ctx InfraContext, clusterName string, hr *entities.HelmRelease) (*entities.HelmRelease, error) { + cluster, err := d.helmReleaseRepo.Upsert(ctx, repos.Filter{ + fields.ClusterName: clusterName, + fields.AccountName: ctx.AccountName, + fields.MetadataName: hr.Name, + }, hr) + if err != nil { + return nil, errors.NewE(err) + } + + if cluster == nil { + return nil, errors.Newf("could not upsert helm release %s", hr.Name) + } + return cluster, nil +} + +func (d *domain) ListHelmReleases(ctx InfraContext, clusterName string, mf map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.HelmRelease], error) { + if err := d.canPerformActionInAccount(ctx, iamT.ListHelmReleases); err != nil { + return nil, errors.NewE(err) + } + + f := repos.Filter{ + fields.ClusterName: clusterName, + fields.AccountName: ctx.AccountName, + } + + pr, err := d.helmReleaseRepo.FindPaginated(ctx, d.helmReleaseRepo.MergeMatchFilters(f, mf), pagination) + if err != nil { + return nil, errors.NewE(err) + } + + return pr, nil +} + +func (d *domain) GetHelmRelease(ctx InfraContext, clusterName string, hrName string) (*entities.HelmRelease, error) { + if err := d.canPerformActionInAccount(ctx, iamT.GetHelmRelease); err != nil { + return nil, errors.NewE(err) + } + + c, err := d.GetHelmRelease(ctx, clusterName, hrName) + if err != nil { + return nil, errors.NewE(err) + } + + return c, nil +} + +func (d *domain) applyHelmRelease(ctx InfraContext, hr *entities.HelmRelease) error { + addTrackingId(&hr.HelmChart, hr.Id) + return d.resDispatcher.ApplyToTargetCluster(ctx, hr.ClusterName, &hr.HelmChart, hr.RecordVersion) +} + +func (d *domain) CreateHelmRelease(ctx InfraContext, clusterName string, hr entities.HelmRelease) (*entities.HelmRelease, error) { + if err := d.canPerformActionInAccount(ctx, iamT.CreateHelmRelease); err != nil { + return nil, errors.NewE(err) + } + hr.EnsureGVK() + if err := d.k8sClient.ValidateObject(ctx, &hr.HelmChart); err != nil { + return nil, errors.NewE(err) + } + + hr.IncrementRecordVersion() + hr.CreatedBy = common.CreatedOrUpdatedBy{ + UserId: ctx.UserId, + UserName: ctx.UserName, + UserEmail: ctx.UserEmail, + } + + hr.LastUpdatedBy = hr.CreatedBy + + existing, err := d.helmReleaseRepo.FindOne( + ctx, + repos.Filter{ + fields.ClusterName: clusterName, + fields.AccountName: ctx.AccountName, + fields.MetadataName: hr.Name, + }, + ) + if err != nil { + return nil, errors.NewE(err) + } + + if existing != nil { + return nil, errors.Newf("helm release with name %q already exists", hr.Name) + } + + hr.AccountName = ctx.AccountName + hr.ClusterName = clusterName + hr.SyncStatus = t.GenSyncStatus(t.SyncActionApply, hr.RecordVersion) + + nhr, err := d.helmReleaseRepo.Create(ctx, &hr) + if err != nil { + return nil, errors.NewE(err) + } + + d.resourceEventPublisher.PublishInfraEvent(ctx, ResourceTypeHelmRelease, nhr.Name, PublishAdd) + + if err = d.resDispatcher.ApplyToTargetCluster(ctx, clusterName, &corev1.Namespace{ + TypeMeta: metav1.TypeMeta{ + Kind: "Namespace", + APIVersion: "v1", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: hr.Namespace, + }, + }, hr.RecordVersion); err != nil { + return nil, errors.NewE(err) + } + + if err := d.applyHelmRelease(ctx, nhr); err != nil { + return nil, errors.NewE(err) + } + + return nhr, nil +} + +func (d *domain) UpdateHelmRelease(ctx InfraContext, clusterName string, hrIn entities.HelmRelease) (*entities.HelmRelease, error) { + if err := d.canPerformActionInAccount(ctx, iamT.UpdateHelmRelease); err != nil { + return nil, errors.NewE(err) + } + + hrIn.EnsureGVK() + if err := d.k8sClient.ValidateObject(ctx, &hrIn); err != nil { + return nil, errors.NewE(err) + } + + patchForUpdate := common.PatchForUpdate( + ctx, + &hrIn, + common.PatchOpts{ + XPatch: repos.Document{ + fc.HelmReleaseSpecChartVersion: hrIn.Spec.ChartVersion, + fc.HelmReleaseSpecValues: hrIn.Spec.Values, + }, + }) + + uphr, err := d.helmReleaseRepo.Patch( + ctx, + repos.Filter{ + fields.ClusterName: clusterName, + fields.AccountName: ctx.AccountName, + fields.MetadataName: hrIn.Name, + }, + patchForUpdate, + ) + if err != nil { + return nil, errors.NewE(err) + } + + d.resourceEventPublisher.PublishInfraEvent(ctx, ResourceTypeHelmRelease, uphr.Name, PublishUpdate) + if err := d.applyHelmRelease(ctx, uphr); err != nil { + return nil, errors.NewE(err) + } + return uphr, nil +} + +func (d *domain) DeleteHelmRelease(ctx InfraContext, clusterName string, name string) error { + if err := d.canPerformActionInAccount(ctx, iamT.DeleteHelmRelease); err != nil { + return errors.NewE(err) + } + + uphr, err := d.helmReleaseRepo.Patch( + ctx, + repos.Filter{ + fields.ClusterName: clusterName, + fields.AccountName: ctx.AccountName, + fields.MetadataName: name, + }, + common.PatchForMarkDeletion(), + ) + if err != nil { + return errors.NewE(err) + } + + d.resourceEventPublisher.PublishInfraEvent(ctx, ResourceTypeHelmRelease, uphr.Name, PublishUpdate) + + return d.resDispatcher.DeleteFromTargetCluster(ctx, clusterName, &uphr.HelmChart) +} + +func (d *domain) OnHelmReleaseApplyError(ctx InfraContext, clusterName string, name string, errMsg string, opts UpdateAndDeleteOpts) error { + uphr, err := d.helmReleaseRepo.Patch( + ctx, + repos.Filter{ + fields.ClusterName: clusterName, + fields.AccountName: ctx.AccountName, + fields.MetadataName: name, + }, + common.PatchForErrorFromAgent( + errMsg, + common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + }, + ), + ) + if err != nil { + return errors.NewE(err) + } + d.resourceEventPublisher.PublishInfraEvent(ctx, ResourceTypeHelmRelease, uphr.Name, PublishUpdate) + return errors.NewE(err) +} + +func (d *domain) OnHelmReleaseDeleteMessage(ctx InfraContext, clusterName string, hr entities.HelmRelease) error { + err := d.helmReleaseRepo.DeleteOne( + ctx, + repos.Filter{ + fields.ClusterName: clusterName, + fields.AccountName: ctx.AccountName, + fields.MetadataName: hr.Name, + }, + ) + if err != nil { + return errors.NewE(err) + } + d.resourceEventPublisher.PublishInfraEvent(ctx, ResourceTypeHelmRelease, hr.Name, PublishDelete) + return err +} + +func (d *domain) OnHelmReleaseUpdateMessage(ctx InfraContext, clusterName string, hr entities.HelmRelease, status types.ResourceStatus, opts UpdateAndDeleteOpts) error { + xhr, err := d.findHelmRelease(ctx, clusterName, hr.Name) + if err != nil { + return errors.NewE(err) + } + + recordVersion, err := d.matchRecordVersion(hr.Annotations, xhr.RecordVersion) + if err != nil { + return d.resyncToTargetCluster(ctx, xhr.SyncStatus.Action, clusterName, xhr, xhr.RecordVersion) + } + + uphr, err := d.helmReleaseRepo.PatchById( + ctx, + xhr.Id, + common.PatchForSyncFromAgent(&hr, recordVersion, status, common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + })) + if err != nil { + return errors.NewE(err) + } + + d.resourceEventPublisher.PublishInfraEvent(ctx, ResourceTypeHelmRelease, uphr.GetName(), PublishUpdate) + return nil +} diff --git a/apps/infra/internal/domain/iam-checks.go b/apps/infra/internal/domain/iam-checks.go new file mode 100644 index 000000000..9eb39fae0 --- /dev/null +++ b/apps/infra/internal/domain/iam-checks.go @@ -0,0 +1,69 @@ +package domain + +import ( + "fmt" + "github.com/kloudlite/api/pkg/errors" + + iamT "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" +) + +type ErrIAMUnauthorized struct { + UserId string + Resource string + Action string +} + +func (e ErrIAMUnauthorized) Error() string { + return fmt.Sprintf("user (%q) is unauthorized to perform action (%q) on resource (%q)", e.UserId, e.Action, e.Resource) +} + +type ErrGRPCCall struct { + Err error +} + +func (e ErrGRPCCall) Error() string { + return fmt.Sprintf("grpc call failed with error: %v", errors.NewE(e.Err)) +} + +func (d *domain) canPerformActionInAccount(ctx InfraContext, action iamT.Action) error { + co, err := d.iamClient.Can(ctx, &iam.CanIn{ + UserId: string(ctx.UserId), + ResourceRefs: []string{ + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), + }, + Action: string(action), + }) + if err != nil { + return ErrGRPCCall{Err: err} + } + if !co.Status { + return ErrIAMUnauthorized{ + UserId: string(ctx.UserId), + Resource: fmt.Sprintf("account: %s", ctx.AccountName), + Action: string(action), + } + } + return nil +} + +func (d *domain) canPerformActionInDevice(ctx InfraContext, action iamT.Action, devName string) error { + co, err := d.iamClient.Can(ctx, &iam.CanIn{ + UserId: string(ctx.UserId), + ResourceRefs: []string{ + iamT.NewResourceRef(ctx.AccountName, iamT.ResourceInfraVPNDevice, devName), + }, + Action: string(action), + }) + if err != nil { + return ErrGRPCCall{Err: err} + } + if !co.Status { + return ErrIAMUnauthorized{ + UserId: string(ctx.UserId), + Resource: fmt.Sprintf("device: %s", devName), + Action: string(action), + } + } + return nil +} diff --git a/apps/infra/internal/domain/ingress.go b/apps/infra/internal/domain/ingress.go new file mode 100644 index 000000000..290c808a2 --- /dev/null +++ b/apps/infra/internal/domain/ingress.go @@ -0,0 +1,67 @@ +package domain + +import ( + "github.com/kloudlite/api/apps/infra/internal/entities" + fc "github.com/kloudlite/api/apps/infra/internal/entities/field-constants" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/repos" + "github.com/kloudlite/operator/operators/resource-watcher/types" + networkingv1 "k8s.io/api/networking/v1" +) + +func (d *domain) OnIngressUpdateMessage(ctx InfraContext, clusterName string, ingress networkingv1.Ingress, status types.ResourceStatus, opts UpdateAndDeleteOpts) error { + for i := range ingress.Spec.Rules { + domainName := ingress.Spec.Rules[i].Host + de, err := d.domainEntryRepo.Upsert(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + fc.DomainEntryDomainName: domainName, + }, &entities.DomainEntry{ + ResourceMetadata: common.ResourceMetadata{ + DisplayName: domainName, + CreatedBy: common.CreatedOrUpdatedByResourceSync, + LastUpdatedBy: common.CreatedOrUpdatedByResourceSync, + }, + DomainName: domainName, + AccountName: ctx.AccountName, + ClusterName: clusterName, + }) + if err != nil { + return err + } + + d.resourceEventPublisher.PublishInfraEvent(ctx, ResourceTypeDomainEntries, de.DomainName, PublishUpdate) + } + + return nil +} + +func (d *domain) OnIngressDeleteMessage(ctx InfraContext, clusterName string, ingress networkingv1.Ingress) error { + domainNames := make([]any, 0, len(ingress.Spec.Rules)) + for i := range ingress.Spec.Rules { + domainNames = append(domainNames, ingress.Spec.Rules[i].Host) + } + + filter := repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + } + + filters := d.domainEntryRepo.MergeMatchFilters(filter, map[string]repos.MatchFilter{ + fc.DomainEntryDomainName: { + MatchType: repos.MatchTypeArray, + Array: domainNames, + }, + }) + + err := d.domainEntryRepo.DeleteMany(ctx, filters) + if err != nil { + return err + } + + for i := range domainNames { + d.resourceEventPublisher.PublishInfraEvent(ctx, ResourceTypeDomainEntries, domainNames[i].(string), PublishDelete) + } + return nil +} diff --git a/apps/infra/internal/domain/mocks/accountssvc.go b/apps/infra/internal/domain/mocks/accountssvc.go new file mode 100644 index 000000000..9ae81d021 --- /dev/null +++ b/apps/infra/internal/domain/mocks/accountssvc.go @@ -0,0 +1,35 @@ +// Code generated by mocki. DO NOT EDIT. +package mocks + +import ( + context "context" + accounts "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/accounts" +) + +type AccountsSvcCallerInfo struct { + Args []any +} + +type AccountsSvc struct { + Calls map[string][]AccountsSvcCallerInfo + MockGetAccount func(ctx context.Context, userId string, accountName string) (*accounts.GetAccountOut, error) +} + +func (m *AccountsSvc) registerCall(funcName string, args ...any) { + if m.Calls == nil { + m.Calls = map[string][]AccountsSvcCallerInfo{} + } + m.Calls[funcName] = append(m.Calls[funcName], AccountsSvcCallerInfo{Args: args}) +} + +func (aMock *AccountsSvc) GetAccount(ctx context.Context, userId string, accountName string) (*accounts.GetAccountOut, error) { + if aMock.MockGetAccount != nil { + aMock.registerCall("GetAccount", ctx, userId, accountName) + return aMock.MockGetAccount(ctx, userId, accountName) + } + panic("AccountsSvc: method 'GetAccount' not implemented, yet") +} + +func NewAccountsSvc() *AccountsSvc { + return &AccountsSvc{} +} diff --git a/apps/infra/internal/domain/msvc-templates.go b/apps/infra/internal/domain/msvc-templates.go new file mode 100644 index 000000000..f00300568 --- /dev/null +++ b/apps/infra/internal/domain/msvc-templates.go @@ -0,0 +1,13 @@ +package domain + +import ( + "github.com/kloudlite/api/apps/infra/internal/entities" +) + +func (d *domain) ListManagedSvcTemplates() ([]*entities.MsvcTemplate, error) { + return d.msvcTemplates, nil +} + +func (d *domain) GetManagedSvcTemplate(category string, name string) (*entities.MsvcTemplateEntry, error) { + return d.msvcTemplatesMap[category][name], nil +} diff --git a/apps/infra/internal/domain/names.go b/apps/infra/internal/domain/names.go index 42ce01667..d50f222a2 100644 --- a/apps/infra/internal/domain/names.go +++ b/apps/infra/internal/domain/names.go @@ -2,9 +2,10 @@ package domain import ( "context" - - fn "kloudlite.io/pkg/functions" - "kloudlite.io/pkg/repos" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/errors" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/repos" ) func (d *domain) SuggestName(ctx context.Context, seed *string) string { @@ -14,11 +15,11 @@ func (d *domain) SuggestName(ctx context.Context, seed *string) string { type ResType string const ( - // ResTypeCluster ResType = "cluster" - ResTypeCluster ResType = "cluster" - ResTypeCloudProvider ResType = "cloudprovider" - ResTypeEdge ResType = "edge" - ResTypeProviderSecret ResType = "providersecret" + ResTypeCluster ResType = "cluster" + ResTypeClusterManagedService ResType = "cluster_managed_service" + ResTypeProviderSecret ResType = "providersecret" + ResTypeNodePool ResType = "nodepool" + ResTypeHelmRelease ResType = "helm_release" ) type CheckNameAvailabilityOutput struct { @@ -26,83 +27,79 @@ type CheckNameAvailabilityOutput struct { SuggestedNames []string `json:"suggestedNames"` } -func (d *domain) CheckNameAvailability(ctx InfraContext, typeArg ResType, name string) (*CheckNameAvailabilityOutput, error) { - switch typeArg { - case ResTypeCloudProvider: - { - cp, err := d.providerRepo.FindOne(ctx, repos.Filter{ - "accountName": ctx.AccountName, - "metadata.name": name, - }) - if err != nil { - return &CheckNameAvailabilityOutput{Result: false}, err - } +func checkResourceName[T repos.Entity](ctx context.Context, filters repos.Filter, repo repos.DbRepo[T]) (*CheckNameAvailabilityOutput, error) { + res, err := repo.FindOne(ctx, filters) + if err != nil { + return &CheckNameAvailabilityOutput{Result: false}, errors.NewE(err) + } - if cp == nil { - return &CheckNameAvailabilityOutput{Result: true}, nil - } + if fn.IsNil(res) { + return &CheckNameAvailabilityOutput{Result: true}, nil + } - return &CheckNameAvailabilityOutput{Result: false, SuggestedNames: []string{ - fn.GenReadableName(name), fn.GenReadableName(name), fn.GenReadableName(name), - }}, nil - } - case ResTypeCluster: - { - cp, err := d.clusterRepo.FindOne(ctx, repos.Filter{ - "accountName": ctx.AccountName, - "metadata.name": name, - }) - if err != nil { - return &CheckNameAvailabilityOutput{Result: false}, err - } + return &CheckNameAvailabilityOutput{ + Result: false, + SuggestedNames: fn.GenValidK8sResourceNames(filters[fields.MetadataName].(string), 3), + }, nil +} - if cp == nil { - return &CheckNameAvailabilityOutput{Result: true}, nil - } +func (d *domain) CheckNameAvailability(ctx InfraContext, typeArg ResType, clusterName *string, name string) (*CheckNameAvailabilityOutput, error) { + + if !fn.IsValidK8sResourceName(name) { + return &CheckNameAvailabilityOutput{Result: false, SuggestedNames: fn.GenValidK8sResourceNames(name, 3)}, nil + } - return &CheckNameAvailabilityOutput{Result: false, SuggestedNames: []string{ - fn.GenReadableName(name), fn.GenReadableName(name), fn.GenReadableName(name), - }}, nil + switch typeArg { + case ResTypeCluster: + { + return checkResourceName(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataName: name, + }, d.clusterRepo) } - case ResTypeEdge: + case ResTypeProviderSecret: { - cp, err := d.clusterRepo.FindOne(ctx, repos.Filter{ - "accountName": ctx.AccountName, - "metadata.name": name, - }) - if err != nil { - return &CheckNameAvailabilityOutput{Result: false}, err - } - - if cp == nil { - return &CheckNameAvailabilityOutput{Result: true}, nil + return checkResourceName(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataName: name, + }, d.secretRepo) + } + case ResTypeNodePool: + { + if clusterName == nil || *clusterName == "" { + return nil, errors.Newf("clusterName is required for checking name availability for %s", ResTypeHelmRelease) } - - return &CheckNameAvailabilityOutput{Result: false, SuggestedNames: []string{ - fn.GenReadableName(name), fn.GenReadableName(name), fn.GenReadableName(name), - }}, nil + return checkResourceName(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + fields.MetadataName: name, + }, d.nodePoolRepo) } - case ResTypeProviderSecret: + case ResTypeHelmRelease: { - cp, err := d.secretRepo.FindOne(ctx, repos.Filter{ - "accountName": ctx.AccountName, - "metadata.name": name, - }) - if err != nil { - return &CheckNameAvailabilityOutput{Result: false}, err + if clusterName == nil || *clusterName == "" { + return nil, errors.Newf("clusterName is required for checking name availability for %s", ResTypeNodePool) } - - if cp == nil { - return &CheckNameAvailabilityOutput{Result: true}, nil + return checkResourceName(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + fields.MetadataName: name, + }, d.helmReleaseRepo) + } + case ResTypeClusterManagedService: + { + if clusterName == nil || *clusterName == "" { + return nil, errors.Newf("clusterName is required for checking name availability for %s", ResTypeNodePool) } - - return &CheckNameAvailabilityOutput{Result: false, SuggestedNames: []string{ - fn.GenReadableName(name), fn.GenReadableName(name), fn.GenReadableName(name), - }}, nil + return checkResourceName(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + fields.MetadataName: name, + }, d.clusterManagedServiceRepo) } default: { - return &CheckNameAvailabilityOutput{Result: false}, nil + return &CheckNameAvailabilityOutput{Result: false}, errors.Newf("unknown resource type provided: %q", typeArg) } } } diff --git a/apps/infra/internal/domain/namespaces.go b/apps/infra/internal/domain/namespaces.go new file mode 100644 index 000000000..8c4c4a672 --- /dev/null +++ b/apps/infra/internal/domain/namespaces.go @@ -0,0 +1,89 @@ +package domain + +import ( + "github.com/kloudlite/api/apps/infra/internal/entities" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" + "github.com/kloudlite/operator/operators/resource-watcher/types" +) + +// GetNamespace implements Domain. +func (d *domain) GetNamespace(ctx InfraContext, clusterName string, namespace string) (*entities.Namespace, error) { + ns, err := d.namespaceRepo.FindOne(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + fields.MetadataName: namespace, + }) + if err != nil { + return nil, errors.NewE(err) + } + + if ns == nil { + return nil, errors.Newf("namespace with name %q not found", namespace) + } + return ns, nil +} + +// ListNamespaces implements Domain. +func (d *domain) ListNamespaces(ctx InfraContext, clusterName string, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.Namespace], error) { + filter := repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + } + return d.namespaceRepo.FindPaginated(ctx, d.namespaceRepo.MergeMatchFilters(filter, search), pagination) +} + +// OnNamespaceDeleteMessage implements Domain. +func (d *domain) OnNamespaceDeleteMessage(ctx InfraContext, clusterName string, namespace entities.Namespace) error { + if err := d.namespaceRepo.DeleteOne(ctx, repos.Filter{ + fields.MetadataName: namespace.Name, + fields.MetadataNamespace: namespace.Namespace, + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + }); err != nil { + return errors.NewE(err) + } + return nil +} + +// OnNamespaceUpdateMessage implements Domain. +func (d *domain) OnNamespaceUpdateMessage(ctx InfraContext, clusterName string, namespace entities.Namespace, status types.ResourceStatus, opts UpdateAndDeleteOpts) error { + ns, err := d.namespaceRepo.FindOne(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + fields.MetadataName: namespace.Name, + }) + if err != nil { + return err + } + + if ns == nil { + namespace.AccountName = ctx.AccountName + namespace.ClusterName = clusterName + + namespace.CreatedBy = common.CreatedOrUpdatedBy{ + UserId: repos.ID(common.CreatedByResourceSyncUserId), + UserName: common.CreatedByResourceSyncUsername, + UserEmail: common.CreatedByResourceSyncUserEmail, + } + namespace.LastUpdatedBy = namespace.CreatedBy + + ns, err = d.namespaceRepo.Create(ctx, &namespace) + if err != nil { + return errors.NewE(err) + } + } + + _, err = d.namespaceRepo.PatchById( + ctx, + ns.Id, + common.PatchForSyncFromAgent(&namespace, ns.RecordVersion, status, common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + })) + if err != nil { + return errors.NewE(err) + } + return nil +} diff --git a/apps/infra/internal/domain/nodepool.go b/apps/infra/internal/domain/nodepool.go new file mode 100644 index 000000000..d20d19442 --- /dev/null +++ b/apps/infra/internal/domain/nodepool.go @@ -0,0 +1,301 @@ +package domain + +import ( + iamT "github.com/kloudlite/api/apps/iam/types" + fc "github.com/kloudlite/api/apps/infra/internal/entities/field-constants" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/errors" + clustersv1 "github.com/kloudlite/operator/apis/clusters/v1" + ct "github.com/kloudlite/operator/apis/common-types" + "github.com/kloudlite/operator/operators/resource-watcher/types" + + "github.com/kloudlite/api/apps/infra/internal/entities" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" +) + +func (d *domain) applyNodePool(ctx InfraContext, np *entities.NodePool) error { + addTrackingId(&np.NodePool, np.Id) + return d.resDispatcher.ApplyToTargetCluster(ctx, np.ClusterName, &np.NodePool, np.RecordVersion) +} + +func (d *domain) CreateNodePool(ctx InfraContext, clusterName string, nodepool entities.NodePool) (*entities.NodePool, error) { + if err := d.canPerformActionInAccount(ctx, iamT.CreateNodepool); err != nil { + return nil, errors.NewE(err) + } + + nodepool.IncrementRecordVersion() + nodepool.CreatedBy = common.CreatedOrUpdatedBy{ + UserId: ctx.UserId, + UserName: ctx.UserName, + UserEmail: ctx.UserEmail, + } + nodepool.LastUpdatedBy = nodepool.CreatedBy + + cluster, err := d.findCluster(ctx, clusterName) + if err != nil { + return nil, errors.NewE(err) + } + + ps, err := d.findProviderSecret(ctx, cluster.Spec.CredentialsRef.Name) + if err != nil { + return nil, errors.NewE(err) + } + + switch nodepool.Spec.CloudProvider { + case ct.CloudProviderAWS: + { + nodepool.Spec.AWS = &clustersv1.AWSNodePoolConfig{ + ImageId: d.env.AWSAMI, + ImageSSHUsername: "ubuntu", + AvailabilityZone: nodepool.Spec.AWS.AvailabilityZone, + NvidiaGpuEnabled: nodepool.Spec.AWS.NvidiaGpuEnabled, + RootVolumeType: "gp3", + RootVolumeSize: func() int { + if nodepool.Spec.AWS.NvidiaGpuEnabled { + return 80 + } + return 50 + }(), + IAMInstanceProfileRole: &ps.AWS.CfParamInstanceProfileName, + PoolType: nodepool.Spec.AWS.PoolType, + EC2Pool: nodepool.Spec.AWS.EC2Pool, + SpotPool: func() *clustersv1.AwsSpotPoolConfig { + if nodepool.Spec.AWS.SpotPool == nil { + return nil + } + return &clustersv1.AwsSpotPoolConfig{ + SpotFleetTaggingRoleName: ps.AWS.CfParamRoleName, + CpuNode: nodepool.Spec.AWS.SpotPool.CpuNode, + GpuNode: nodepool.Spec.AWS.SpotPool.GpuNode, + Nodes: nodepool.Spec.AWS.SpotPool.Nodes, + } + }(), + } + } + default: + { + return nil, errors.Newf("cloudprovider: %s, currently not supported", nodepool.Spec.CloudProvider) + } + } + + nodepool.AccountName = ctx.AccountName + nodepool.ClusterName = clusterName + nodepool.SyncStatus = t.GenSyncStatus(t.SyncActionApply, nodepool.RecordVersion) + + nodepool.EnsureGVK() + if err := d.k8sClient.ValidateObject(ctx, &nodepool.NodePool); err != nil { + return nil, errors.NewE(err) + } + nodepool.IncrementRecordVersion() + + np, err := d.nodePoolRepo.Create(ctx, &nodepool) + if err != nil { + if d.nodePoolRepo.ErrAlreadyExists(err) { + return nil, errors.Newf("nodepool with name %q already exists", nodepool.Name) + } + return nil, errors.NewE(err) + } + d.resourceEventPublisher.PublishResourceEvent(ctx, clusterName, ResourceTypeNodePool, np.Name, PublishAdd) + + if err := d.applyNodePool(ctx, np); err != nil { + return nil, errors.NewE(err) + } + + return np, nil +} + +func (d *domain) UpdateNodePool(ctx InfraContext, clusterName string, nodePoolIn entities.NodePool) (*entities.NodePool, error) { + if err := d.canPerformActionInAccount(ctx, iamT.UpdateNodepool); err != nil { + return nil, errors.NewE(err) + } + + nodePoolIn.EnsureGVK() + if err := d.k8sClient.ValidateObject(ctx, &nodePoolIn.NodePool); err != nil { + return nil, errors.NewE(err) + } + + patchForUpdate := common.PatchForUpdate( + ctx, + &nodePoolIn, + common.PatchOpts{ + XPatch: repos.Document{ + fc.NodePoolSpecMinCount: nodePoolIn.Spec.MinCount, + fc.NodePoolSpecMaxCount: nodePoolIn.Spec.MaxCount, + }, + }) + + unp, err := d.nodePoolRepo.Patch( + ctx, + repos.Filter{ + fields.ClusterName: clusterName, + fields.AccountName: ctx.AccountName, + fields.MetadataName: nodePoolIn.Name, + }, + patchForUpdate, + ) + if err != nil { + return nil, errors.NewE(err) + } + + d.resourceEventPublisher.PublishResourceEvent(ctx, clusterName, ResourceTypeNodePool, unp.Name, PublishUpdate) + + if err := d.applyNodePool(ctx, unp); err != nil { + return nil, errors.NewE(err) + } + + return unp, nil +} + +func (d *domain) DeleteNodePool(ctx InfraContext, clusterName string, poolName string) error { + if err := d.canPerformActionInAccount(ctx, iamT.DeleteNodepool); err != nil { + return errors.NewE(err) + } + + unp, err := d.nodePoolRepo.Patch( + ctx, + repos.Filter{ + fields.ClusterName: clusterName, + fields.AccountName: ctx.AccountName, + fields.MetadataName: poolName, + }, + common.PatchForMarkDeletion(), + ) + if err != nil { + return errors.NewE(err) + } + + d.resourceEventPublisher.PublishResourceEvent(ctx, clusterName, ResourceTypeNodePool, unp.Name, PublishUpdate) + return d.resDispatcher.DeleteFromTargetCluster(ctx, clusterName, &unp.NodePool) +} + +func (d *domain) GetNodePool(ctx InfraContext, clusterName string, poolName string) (*entities.NodePool, error) { + if err := d.canPerformActionInAccount(ctx, iamT.GetNodepool); err != nil { + return nil, errors.NewE(err) + } + np, err := d.findNodePool(ctx, clusterName, poolName) + if err != nil { + return nil, errors.NewE(err) + } + return np, nil +} + +func (d *domain) ListNodePools(ctx InfraContext, clusterName string, matchFilters map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.NodePool], error) { + if err := d.canPerformActionInAccount(ctx, iamT.ListNodepools); err != nil { + return nil, errors.NewE(err) + } + filter := repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + } + return d.nodePoolRepo.FindPaginated(ctx, d.nodePoolRepo.MergeMatchFilters(filter, matchFilters), pagination) +} + +func (d *domain) findNodePool(ctx InfraContext, clusterName string, poolName string) (*entities.NodePool, error) { + np, err := d.nodePoolRepo.FindOne(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + fields.MetadataName: poolName, + }) + if err != nil { + return nil, errors.NewE(err) + } + if np == nil { + return nil, errors.Newf("nodepool with name %q not found", clusterName) + } + return np, nil +} + +func (d *domain) ResyncNodePool(ctx InfraContext, clusterName string, poolName string) error { + if err := func() error { + if err := d.canPerformActionInAccount(ctx, iamT.UpdateNodepool); err != nil { + return d.canPerformActionInAccount(ctx, iamT.DeleteNodepool) + } + return nil + }(); err != nil { + return errors.NewE(err) + } + np, err := d.findNodePool(ctx, clusterName, poolName) + if err != nil { + return errors.NewE(err) + } + + return d.resyncToTargetCluster(ctx, np.SyncStatus.Action, clusterName, &np.NodePool, np.RecordVersion) +} + +// on message events + +func (d *domain) OnNodePoolDeleteMessage(ctx InfraContext, clusterName string, nodePool entities.NodePool) error { + err := d.nodePoolRepo.DeleteOne( + ctx, + repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + fields.MetadataName: nodePool.Name, + }, + ) + if err != nil { + return errors.NewE(err) + } + d.resourceEventPublisher.PublishResourceEvent(ctx, clusterName, ResourceTypeNodePool, nodePool.Name, PublishDelete) + return err +} + +func (d *domain) OnNodePoolUpdateMessage(ctx InfraContext, clusterName string, nodePool entities.NodePool, status types.ResourceStatus, opts UpdateAndDeleteOpts) error { + xnp, err := d.findNodePool(ctx, clusterName, nodePool.Name) + if err != nil { + return errors.NewE(err) + } + + if xnp == nil { + return errors.Newf("no nodepool found") + } + + if _, err := d.matchRecordVersion(nodePool.Annotations, xnp.RecordVersion); err != nil { + return d.resyncToTargetCluster(ctx, xnp.SyncStatus.Action, clusterName, &xnp.NodePool, xnp.RecordVersion) + } + + recordVersion, err := d.matchRecordVersion(nodePool.Annotations, xnp.RecordVersion) + if err != nil { + return errors.NewE(err) + } + + unp, err := d.nodePoolRepo.PatchById( + ctx, + xnp.Id, + common.PatchForSyncFromAgent(&nodePool, + recordVersion, status, + common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + })) + if err != nil { + return errors.NewE(err) + } + + d.resourceEventPublisher.PublishResourceEvent(ctx, clusterName, ResourceTypeNodePool, unp.GetName(), PublishUpdate) + return nil +} + +// OnNodepoolApplyError implements Domain. +func (d *domain) OnNodepoolApplyError(ctx InfraContext, clusterName string, name string, errMsg string, opts UpdateAndDeleteOpts) error { + unp, err := d.nodePoolRepo.Patch( + ctx, + repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + fields.MetadataName: name, + }, + common.PatchForErrorFromAgent( + errMsg, + common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + }, + ), + ) + if err != nil { + return errors.NewE(err) + } + d.resourceEventPublisher.PublishResourceEvent(ctx, clusterName, ResourceTypeNodePool, unp.Name, PublishUpdate) + return errors.NewE(err) +} diff --git a/apps/infra/internal/domain/nodes.go b/apps/infra/internal/domain/nodes.go index 4558cb076..8c9655083 100644 --- a/apps/infra/internal/domain/nodes.go +++ b/apps/infra/internal/domain/nodes.go @@ -1,117 +1,62 @@ package domain import ( - "fmt" - - cmgrV1 "github.com/kloudlite/cluster-operator/apis/cmgr/v1" - infraV1 "github.com/kloudlite/cluster-operator/apis/infra/v1" - "k8s.io/apimachinery/pkg/labels" - "kloudlite.io/apps/infra/internal/domain/entities" - "kloudlite.io/constants" - "kloudlite.io/pkg/repos" - "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/kloudlite/api/apps/infra/internal/entities" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" ) -func (d *domain) GetNodePools(ctx InfraContext, clusterName string, edgeName string) ([]*entities.NodePool, error) { - _, err := d.findCluster(ctx, clusterName) - if err != nil { - return nil, err - } - - var nodePools infraV1.NodePoolList - if err := d.k8sClient.List(ctx, &nodePools, &client.ListOptions{ - LabelSelector: labels.SelectorFromValidatedSet(map[string]string{ - //constants.ClusterNameKey: cluster.Name, - constants.EdgeNameKey: edgeName, - }), - }); err != nil { - return nil, err +func (d *domain) ListNodes(ctx InfraContext, clusterName string, matchFilters map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.Node], error) { + filter := repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, } - results := make([]*entities.NodePool, len(nodePools.Items)) - for i := range nodePools.Items { - results[i] = &entities.NodePool{ - NodePool: nodePools.Items[i], - } - } - return results, nil + return d.nodeRepo.FindPaginated(ctx, d.nodeRepo.MergeMatchFilters(filter, matchFilters), pagination) } -func (d *domain) GetMasterNodes(ctx InfraContext, clusterName string) ([]*entities.MasterNode, error) { - cluster, err := d.findCluster(ctx, clusterName) - if err != nil { - return nil, err - } - - var mNodesList cmgrV1.MasterNodeList - if err := d.k8sClient.List(ctx, &mNodesList, &client.ListOptions{ - LabelSelector: labels.SelectorFromValidatedSet(map[string]string{constants.ClusterNameKey: cluster.Name}), - }); err != nil { - return nil, err - } +//TODO (nxtcoder17): Deleting node should also be available - results := make([]*entities.MasterNode, len(mNodesList.Items)) - for i := range mNodesList.Items { - results[i] = &entities.MasterNode{ - MasterNode: mNodesList.Items[i], - } - } - return results, nil +func (d *domain) GetNode(ctx InfraContext, clusterName string, nodeName string) (*entities.Node, error) { + return d.findNode(ctx, clusterName, nodeName) } -func (d *domain) GetWorkerNodes(ctx InfraContext, clusterName string, edgeName string) ([]*entities.WorkerNode, error) { - cluster, err := d.findCluster(ctx, clusterName) +func (d *domain) findNode(ctx InfraContext, clusterName string, nodeName string) (*entities.Node, error) { + node, err := d.nodeRepo.FindOne(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + fields.MetadataName: nodeName, + }) if err != nil { - return nil, err + return nil, errors.NewE(err) } - var wNodes infraV1.WorkerNodeList - if err := d.k8sClient.List(ctx, &wNodes, &client.ListOptions{ - LabelSelector: labels.SelectorFromValidatedSet(map[string]string{ - constants.ClusterNameKey: cluster.Name, - constants.EdgeNameKey: edgeName, - }), - }); err != nil { - return nil, err + if node == nil { + return nil, errors.Newf("no node with name %q found in cluster %q", nodeName, clusterName) } - results := make([]*entities.WorkerNode, len(wNodes.Items)) - for i := range wNodes.Items { - results[i] = &entities.WorkerNode{ - WorkerNode: wNodes.Items[i], - } - } - return results, nil + return node, nil } -func (d *domain) DeleteWorkerNode(ctx InfraContext, clusterName string, edgeName string, name string) (bool, error) { - cluster, err := d.findCluster(ctx, clusterName) - if err != nil { - return false, err - } - - if err := d.deleteK8sResource(ctx, &cluster.Cluster); err != nil { - return false, err +func (d *domain) OnNodeUpdateMessage(ctx InfraContext, clusterName string, node entities.Node) error { + if _, err := d.nodeRepo.Upsert(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + fields.MetadataName: node.Name, + }, &node); err != nil { + return errors.NewE(err) } - return true, err + return nil } -func (d *domain) OnDeleteWorkerNodeMessage(ctx InfraContext, workerNode entities.WorkerNode) error { - return d.workerNodeRepo.DeleteOne(ctx, repos.Filter{"metadata.name": workerNode.Name, "spec.edgeName": workerNode.Spec.EdgeName}) -} - -func (d *domain) OnUpdateWorkerNodeMessage(ctx InfraContext, workerNode entities.WorkerNode) error { - wn, err := d.workerNodeRepo.FindOne(ctx, repos.Filter{ - "accountName": ctx.AccountName, - "metadata.name": workerNode.Name, - }) - if err != nil { - return err - } - if wn == nil { - return fmt.Errorf("worker node %q not found", workerNode.Name) +func (d *domain) OnNodeDeleteMessage(ctx InfraContext, clusterName string, node entities.Node) error { + if err := d.namespaceRepo.DeleteOne(ctx, repos.Filter{ + fields.MetadataName: node.Name, + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + }); err != nil { + return errors.NewE(err) } - wn.WorkerNode = workerNode.WorkerNode - _, err = d.workerNodeRepo.UpdateById(ctx, wn.Id, wn) - return err + return nil } diff --git a/apps/infra/internal/domain/ports.go b/apps/infra/internal/domain/ports.go new file mode 100644 index 000000000..bde574f7e --- /dev/null +++ b/apps/infra/internal/domain/ports.go @@ -0,0 +1,29 @@ +package domain + +import ( + "context" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/accounts" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +type AccountsSvc interface { + GetAccount(ctx context.Context, userId string, accountName string) (*accounts.GetAccountOut, error) +} + +type ResourceDispatcher interface { + ApplyToTargetCluster(ctx InfraContext, clusterName string, obj client.Object, recordVersion int) error + DeleteFromTargetCluster(ctx InfraContext, clusterName string, obj client.Object) error +} + +type PublishMsg string + +const ( + PublishAdd PublishMsg = "added" + PublishDelete PublishMsg = "deleted" + PublishUpdate PublishMsg = "updated" +) + +type ResourceEventPublisher interface { + PublishInfraEvent(ctx InfraContext, resourceType ResourceType, resName string, update PublishMsg) + PublishResourceEvent(ctx InfraContext, clusterName string, resourceType ResourceType, resName string, update PublishMsg) +} diff --git a/apps/infra/internal/domain/provider-secrets-validator.go b/apps/infra/internal/domain/provider-secrets-validator.go new file mode 100644 index 000000000..9a0ebe143 --- /dev/null +++ b/apps/infra/internal/domain/provider-secrets-validator.go @@ -0,0 +1,145 @@ +package domain + +import ( + "encoding/json" + "github.com/kloudlite/api/pkg/errors" + "net/url" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/service/iam" +) + +func (d *domain) ValidateProviderSecret(providerName string, accessKeyId, secretAccessKey string) error { + switch providerName { + case "aws": + { + return validateAwsKeys(accessKeyId, secretAccessKey) + } + default: + { + return errors.Newf("provider %s is not supported", providerName) + } + } +} + +func validateAwsKeys(accessKeyID, secretAccessKey string) error { + requiredActions := []string{"iam:*", "s3:*", "ec2:*"} + + sess, err := session.NewSession(&aws.Config{ + Region: aws.String("us-west-2"), + Credentials: credentials.NewStaticCredentials(accessKeyID, secretAccessKey, ""), + }) + + if err != nil { + return errors.Newf("Error creating session: %s", err) + } + + svc := iam.New(sess) + userOutput, err := svc.GetUser(nil) + + if err != nil { + return errors.Newf("Failed to get user: %s", err) + } + + // Getting the policies attached to the user + listUserPoliciesInput := &iam.ListAttachedUserPoliciesInput{ + UserName: userOutput.User.UserName, + } + + policies, err := svc.ListAttachedUserPolicies(listUserPoliciesInput) + + if err != nil { + return errors.Newf("Failed to list user policies: %s", err) + } + + for _, attachedPolicy := range policies.AttachedPolicies { + policyOutput, err := svc.GetPolicy(&iam.GetPolicyInput{ + PolicyArn: attachedPolicy.PolicyArn, + }) + + if err != nil { + // fmt.Println("Failed to get policy:", err) + continue + } + + policyVersionOutput, err := svc.GetPolicyVersion(&iam.GetPolicyVersionInput{ + PolicyArn: policyOutput.Policy.Arn, + VersionId: policyOutput.Policy.DefaultVersionId, + }) + + if err != nil { + // fmt.Println("Failed to get policy version:", err) + continue + } + + s, err := url.QueryUnescape(*policyVersionOutput.PolicyVersion.Document) + if err != nil { + // fmt.Println("Failed to get policy version:", err) + continue + } + + b, err := validatePolicyJson(s, requiredActions) + if err != nil { + // fmt.Println("Permission Check Error:", err) + continue + } + + if b { + return nil + } + } + return errors.Newf("coudn't find the required permissions ( full access to [S3,EC2,IAM] on all resources )") + +} + +func validatePolicyJson(policyJSON string, actions []string) (bool, error) { + type Statement struct { + Action []string `json:"Action"` + Resource string `json:"Resource"` + } + + type Policy struct { + Statement []Statement `json:"Statement"` + } + + var policy Policy + if err := json.Unmarshal([]byte(policyJSON), &policy); err != nil { + return false, errors.Newf("Failed to unmarshal policy document: %v", err) + } + + for _, s := range policy.Statement { + if s.Resource != "*" { + continue + } + found := false + for _, v := range actions { + f := false + for _, v2 := range s.Action { + if v == v2 { + f = true + } + } + if !f { + found = false + break + } + found = true + } + if found { + return true, nil + } + } + + return false, errors.Newf("permissions not matched") +} + +func contains(slice []string, value string) bool { + for _, v := range slice { + if v == value { + return true + } + } + return false +} diff --git a/apps/infra/internal/domain/provider-secrets.go b/apps/infra/internal/domain/provider-secrets.go new file mode 100644 index 000000000..57a9b4118 --- /dev/null +++ b/apps/infra/internal/domain/provider-secrets.go @@ -0,0 +1,322 @@ +package domain + +import ( + "bytes" + "context" + "fmt" + fc "github.com/kloudlite/api/apps/infra/internal/entities/field-constants" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/operator/pkg/constants" + corev1 "k8s.io/api/core/v1" + "strings" + "time" + + iamT "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/common" + fn "github.com/kloudlite/api/pkg/functions" + ct "github.com/kloudlite/operator/apis/common-types" + + "github.com/kloudlite/api/apps/infra/internal/entities" + "github.com/kloudlite/api/apps/infra/internal/env" + "github.com/kloudlite/api/pkg/repos" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/service/sts" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +func generateAWSCloudformationTemplateUrl(args entities.AWSSecretCredentials, ev *env.Env) (string, error) { + qp := []string{ + "templateURL=" + ev.AWSCfStackS3URL, + "stackName=" + args.CfParamStackName, + "param_ExternalId=" + args.CfParamExternalID, + "param_TrustedArn=" + args.CfParamTrustedARN, + "param_RoleName=" + args.CfParamRoleName, + "param_InstanceProfileName=" + args.CfParamInstanceProfileName, + } + + result := bytes.NewBuffer(nil) + _, err := fmt.Fprintf(result, "https://console.aws.amazon.com/cloudformation/home#/stacks/quickcreate?") + if err != nil { + return "", errors.NewE(err) + } + _, err = fmt.Fprint(result, strings.Join(qp, "&")) + if err != nil { + return "", errors.NewE(err) + } + return result.String(), nil +} + +func (d *domain) validateAWSAssumeRole(_ context.Context, paramExternalId string, roleARN string) error { + sess, err := session.NewSession() + if err != nil { + d.logger.Errorf(err, "while creating new session") + return errors.NewE(err) + } + + svc := sts.New(sess) + + resp, err := svc.AssumeRole(&sts.AssumeRoleInput{ + RoleArn: aws.String(roleARN), + ExternalId: aws.String(paramExternalId), + RoleSessionName: aws.String("TestSession"), + }) + if err != nil { + d.logger.Errorf(err, "while assuming role, and getting caller identity") + return errors.NewE(err) + } + + if resp.AssumedRoleUser.Arn != nil { + return nil + } + + return nil +} + +type AWSAccessValidationOutput struct { + Result bool + InstallationURL *string +} + +func (d *domain) ValidateProviderSecretAWSAccess(ctx InfraContext, name string) (*AWSAccessValidationOutput, error) { + if err := d.canPerformActionInAccount(ctx, iamT.CreateCloudProviderSecret); err != nil { + return nil, errors.NewE(err) + } + + psecret, err := d.findProviderSecret(ctx, name) + if err != nil { + return nil, errors.NewE(err) + } + + if err := psecret.Validate(); err != nil { + return nil, errors.NewE(err) + } + + if err := d.validateAWSAssumeRole(ctx, psecret.AWS.CfParamExternalID, psecret.AWS.GetAssumeRoleRoleARN()); err != nil { + installationURL, err := generateAWSCloudformationTemplateUrl(*psecret.AWS, d.env) + if err != nil { + return nil, errors.NewE(err) + } + return &AWSAccessValidationOutput{ + Result: false, + InstallationURL: &installationURL, + }, nil + } + + return &AWSAccessValidationOutput{ + Result: true, + InstallationURL: nil, + }, errors.NewE(err) +} + +func corev1SecretFromProviderSecret(ps *entities.CloudProviderSecret) *corev1.Secret { + stringData := map[string]string{} + if ps.AWS.AccessKey != nil { + stringData[entities.AccessKey] = *ps.AWS.AccessKey + } + if ps.AWS.SecretKey != nil { + stringData[entities.SecretKey] = *ps.AWS.SecretKey + } + + if ps.AWS.IsAssumeRoleConfiguration() && ps.AWS.AWSAccountId != nil { + stringData[entities.AWSAccountId] = *ps.AWS.AWSAccountId + } + if ps.AWS.IsAssumeRoleConfiguration() && ps.AWS.CfParamExternalID != "" { + stringData[entities.AWSAssumeRoleExternalId] = ps.AWS.CfParamExternalID + } + if ps.AWS.IsAssumeRoleConfiguration() && ps.AWS.CfParamRoleName != "" { + stringData[entities.AWAssumeRoleRoleARN] = ps.AWS.GetAssumeRoleRoleARN() + } + if ps.AWS.IsAssumeRoleConfiguration() && ps.AWS.CfParamInstanceProfileName != "" { + stringData[entities.AWSInstanceProfileName] = ps.AWS.CfParamInstanceProfileName + } + + return &corev1.Secret{ + TypeMeta: metav1.TypeMeta{APIVersion: "v1", Kind: "Secret"}, + ObjectMeta: metav1.ObjectMeta{ + Name: ps.Name, + Namespace: ps.Namespace, + CreationTimestamp: metav1.Time{ + Time: time.Now(), + }, + Annotations: map[string]string{ + constants.DescriptionKey: fmt.Sprintf("created by cloudprovider secret %s", ps.Name), + }, + }, + StringData: stringData, + } +} + +func (d *domain) CreateProviderSecret(ctx InfraContext, psecretIn entities.CloudProviderSecret) (*entities.CloudProviderSecret, error) { + if err := d.canPerformActionInAccount(ctx, iamT.CreateCloudProviderSecret); err != nil { + return nil, errors.NewE(err) + } + + accNs, err := d.getAccNamespace(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + psecretIn.AccountName = ctx.AccountName + psecretIn.Namespace = accNs + + if err := psecretIn.Validate(); err != nil { + return nil, errors.NewE(err) + } + + psecretIn.IncrementRecordVersion() + psecretIn.CreatedBy = common.CreatedOrUpdatedBy{ + UserId: ctx.UserId, + UserName: ctx.UserName, + UserEmail: ctx.UserEmail, + } + + psecretIn.LastUpdatedBy = psecretIn.CreatedBy + psecretIn.Id = d.secretRepo.NewId() + switch psecretIn.CloudProviderName { + case ct.CloudProviderAWS: + { + psecretIn.AWS = &entities.AWSSecretCredentials{ + AWSAccountId: psecretIn.AWS.AWSAccountId, + AccessKey: psecretIn.AWS.AccessKey, + SecretKey: psecretIn.AWS.SecretKey, + + CfParamStackName: fmt.Sprintf("%s-%s", d.env.AWSCfStackNamePrefix, psecretIn.Id), + CfParamRoleName: fmt.Sprintf("%s-%s", d.env.AWSCfRoleNamePrefix, psecretIn.Id), + CfParamInstanceProfileName: fmt.Sprintf("%s-%s", d.env.AWSCfInstanceProfileNamePrefix, psecretIn.Id), + CfParamTrustedARN: d.env.AWSCfParamTrustedARN, + CfParamExternalID: fn.CleanerNanoidOrDie(40), + } + + if err := psecretIn.AWS.Validate(); err != nil { + return nil, errors.NewE(err) + } + } + default: + return nil, errors.Newf("unknown cloud provider") + } + + secret := corev1SecretFromProviderSecret(&psecretIn) + psecretIn.ObjectMeta = secret.ObjectMeta + + nSecret, err := d.secretRepo.Create(ctx, &psecretIn) + if err != nil { + return nil, errors.NewE(err) + } + + if err != nil { + return nil, errors.NewE(err) + } + if err := d.applyK8sResource(ctx, secret, nSecret.RecordVersion); err != nil { + return nil, errors.NewE(err) + } + return nSecret, nil +} + +// Depricate AWS_SECRET_KEY and AWS_ACCESS_KEY input +func (d *domain) UpdateProviderSecret(ctx InfraContext, providerSecretIn entities.CloudProviderSecret) (*entities.CloudProviderSecret, error) { + if err := d.canPerformActionInAccount(ctx, iamT.UpdateCloudProviderSecret); err != nil { + return nil, errors.NewE(err) + } + + if err := providerSecretIn.Validate(); err != nil { + return nil, errors.NewE(err) + } + + //switch providerSecretIn.CloudProviderName { + //case ct.CloudProviderAWS: + // { + // currScrt.AWS.AccessKey = providerSecretIn.AWS.AccessKey + // currScrt.AWS.SecretKey = providerSecretIn.AWS.SecretKey + // } + //} + + patchForUpdate := common.PatchForUpdate( + ctx, + &providerSecretIn, + ) + + uScrt, err := d.secretRepo.Patch( + ctx, + repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataName: providerSecretIn.Name, + }, + patchForUpdate, + ) + + if err != nil { + return nil, errors.NewE(err) + } + + if err := d.applyK8sResource(ctx, corev1SecretFromProviderSecret(uScrt), uScrt.RecordVersion); err != nil { + return nil, errors.NewE(err) + } + + return uScrt, nil +} + +func (d *domain) DeleteProviderSecret(ctx InfraContext, secretName string) error { + if err := d.canPerformActionInAccount(ctx, iamT.DeleteCloudProviderSecret); err != nil { + return errors.NewE(err) + } + cps, err := d.findProviderSecret(ctx, secretName) + if err != nil { + return errors.NewE(err) + } + + clusters, err := d.clusterRepo.Find(ctx, repos.Query{ + Filter: repos.Filter{ + fields.AccountName: ctx.AccountName, + fc.ClusterSpecCredentialsRefName: secretName, + }, + }) + if err != nil { + return errors.NewE(err) + } + + if len(clusters) > 0 { + return errors.Newf("cloud provider secret %q is used by %d cluster(s), deletion is forbidden", secretName, len(clusters)) + } + + if err := d.deleteK8sResource(ctx, corev1SecretFromProviderSecret(cps)); err != nil { + return errors.NewE(err) + } + return d.secretRepo.DeleteById(ctx, cps.Id) +} + +func (d *domain) ListProviderSecrets(ctx InfraContext, matchFilters map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.CloudProviderSecret], error) { + if err := d.canPerformActionInAccount(ctx, iamT.ListCloudProviderSecrets); err != nil { + return nil, errors.NewE(err) + } + + filter := repos.Filter{ + fields.AccountName: ctx.AccountName, + } + return d.secretRepo.FindPaginated(ctx, d.secretRepo.MergeMatchFilters(filter, matchFilters), pagination) +} + +func (d *domain) GetProviderSecret(ctx InfraContext, name string) (*entities.CloudProviderSecret, error) { + if err := d.canPerformActionInAccount(ctx, iamT.GetCloudProviderSecret); err != nil { + return nil, errors.NewE(err) + } + return d.findProviderSecret(ctx, name) +} + +func (d *domain) findProviderSecret(ctx InfraContext, name string) (*entities.CloudProviderSecret, error) { + scrt, err := d.secretRepo.FindOne(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.MetadataName: name, + }) + if err != nil { + return nil, errors.NewE(err) + } + + if scrt == nil { + return nil, errors.Newf("provider secret with name %q not found", name) + } + + return scrt, nil +} diff --git a/apps/infra/internal/domain/pv.go b/apps/infra/internal/domain/pv.go new file mode 100644 index 000000000..2531435dd --- /dev/null +++ b/apps/infra/internal/domain/pv.go @@ -0,0 +1,72 @@ +package domain + +import ( + "github.com/kloudlite/api/apps/infra/internal/entities" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + "github.com/kloudlite/operator/operators/resource-watcher/types" +) + +// GetPV implements Domain. +func (d *domain) GetPV(ctx InfraContext, clusterName string, pvName string) (*entities.PersistentVolume, error) { + pv, err := d.pvRepo.FindOne(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + fields.MetadataName: pvName, + }) + if err != nil { + return nil, errors.NewE(err) + } + + if pv == nil { + return nil, errors.Newf("persistent volume with name %q not found", pvName) + } + return pv, nil +} + +// ListPVs implements Domain. +func (d *domain) ListPVs(ctx InfraContext, clusterName string, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.PersistentVolume], error) { + filter := repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + } + return d.pvRepo.FindPaginated(ctx, d.nodePoolRepo.MergeMatchFilters(filter, search), pagination) +} + +// OnPVDeleteMessage implements Domain. +func (d *domain) OnPVDeleteMessage(ctx InfraContext, clusterName string, pv entities.PersistentVolume) error { + if err := d.pvRepo.DeleteOne(ctx, repos.Filter{ + fields.MetadataName: pv.Name, + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + }); err != nil { + return errors.NewE(err) + } + d.resourceEventPublisher.PublishResourceEvent(ctx, clusterName, ResourceTypePV, pv.Name, PublishDelete) + return nil +} + +// OnPVUpdateMessage implements Domain. +func (d *domain) OnPVUpdateMessage(ctx InfraContext, clusterName string, pv entities.PersistentVolume, status types.ResourceStatus, opts UpdateAndDeleteOpts) error { + pv.SyncStatus.LastSyncedAt = opts.MessageTimestamp + pv.SyncStatus.State = func() t.SyncState { + if status == types.ResourceStatusDeleting { + return t.SyncStateDeletingAtAgent + } + return t.SyncStateUpdatedAtAgent + }() + pv.AccountName = ctx.AccountName + pv.ClusterName = clusterName + upsert, err := d.pvRepo.Upsert(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + fields.MetadataName: pv.Name, + }, &pv) + if err != nil { + return errors.NewE(err) + } + d.resourceEventPublisher.PublishResourceEvent(ctx, clusterName, ResourceTypePV, upsert.Name, PublishUpdate) + return nil +} diff --git a/apps/infra/internal/domain/pvc.go b/apps/infra/internal/domain/pvc.go new file mode 100644 index 000000000..6a43f089c --- /dev/null +++ b/apps/infra/internal/domain/pvc.go @@ -0,0 +1,86 @@ +package domain + +import ( + "github.com/kloudlite/api/apps/infra/internal/entities" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" + "github.com/kloudlite/operator/operators/resource-watcher/types" +) + +func (d *domain) ListPVCs(ctx InfraContext, clusterName string, matchFilters map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.PersistentVolumeClaim], error) { + filter := repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + } + return d.pvcRepo.FindPaginated(ctx, d.nodePoolRepo.MergeMatchFilters(filter, matchFilters), pagination) +} + +func (d *domain) GetPVC(ctx InfraContext, clusterName string, buildRunName string) (*entities.PersistentVolumeClaim, error) { + pvc, err := d.pvcRepo.FindOne(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + fields.MetadataName: buildRunName, + }) + if err != nil { + return nil, errors.NewE(err) + } + + if pvc == nil { + return nil, errors.Newf("persistent volume claim with name %q not found", buildRunName) + } + return pvc, nil +} + +func (d *domain) OnPVCUpdateMessage(ctx InfraContext, clusterName string, pvc entities.PersistentVolumeClaim, status types.ResourceStatus, opts UpdateAndDeleteOpts) error { + xpvc, err := d.pvcRepo.FindOne(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + fields.MetadataName: pvc.Name, + }) + if err != nil { + return err + } + + if xpvc == nil { + pvc.AccountName = ctx.AccountName + pvc.ClusterName = clusterName + + pvc.CreatedBy = common.CreatedOrUpdatedBy{ + UserId: repos.ID(common.CreatedByResourceSyncUserId), + UserName: common.CreatedByResourceSyncUsername, + UserEmail: common.CreatedByResourceSyncUserEmail, + } + pvc.LastUpdatedBy = pvc.CreatedBy + xpvc, err = d.pvcRepo.Create(ctx, &pvc) + if err != nil { + return errors.NewE(err) + } + } + + upvc, err := d.pvcRepo.PatchById( + ctx, + xpvc.Id, + common.PatchForSyncFromAgent(&pvc, pvc.RecordVersion, status, common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + })) + if err != nil { + return errors.NewE(err) + } + d.resourceEventPublisher.PublishResourceEvent(ctx, clusterName, ResourceTypePVC, upvc.Name, PublishUpdate) + return nil +} + +func (d *domain) OnPVCDeleteMessage(ctx InfraContext, clusterName string, pvc entities.PersistentVolumeClaim) error { + if err := d.pvcRepo.DeleteOne(ctx, repos.Filter{ + fields.MetadataName: pvc.Name, + fields.MetadataNamespace: pvc.Namespace, + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + }); err != nil { + return errors.NewE(err) + } + d.resourceEventPublisher.PublishResourceEvent(ctx, clusterName, ResourceTypePVC, pvc.Name, PublishDelete) + return nil +} diff --git a/apps/infra/internal/domain/templates/embed.go b/apps/infra/internal/domain/templates/embed.go new file mode 100644 index 000000000..cd4d68e66 --- /dev/null +++ b/apps/infra/internal/domain/templates/embed.go @@ -0,0 +1,23 @@ +package templates + +import ( + "embed" + "path/filepath" + + "github.com/kloudlite/operator/pkg/templates" +) + +//go:embed * +var templatesDir embed.FS + +type templateFile string + +const ( + HelmKloudliteAgent templateFile = "./helm-charts-kloudlite-agent.yml.tpl" +) + +func Read(t templateFile) ([]byte, error) { + return templatesDir.ReadFile(filepath.Join(string(t))) +} + +var ParseBytes = templates.ParseBytes diff --git a/apps/infra/internal/domain/templates/helm-charts-kloudlite-agent.yml.tpl b/apps/infra/internal/domain/templates/helm-charts-kloudlite-agent.yml.tpl new file mode 100644 index 000000000..4fb14754c --- /dev/null +++ b/apps/infra/internal/domain/templates/helm-charts-kloudlite-agent.yml.tpl @@ -0,0 +1,118 @@ +{{- $accountName := get . "account-name" }} +{{- $clusterName := get . "cluster-name" }} + +{{- $kloudliteRelease := get . "kloudlite-release" }} +{{- $messageOfficeGrpcAddr := get . "message-office-grpc-addr" }} + +{{- $clusterToken := get . "cluster-token" }} + +--- +apiVersion: crds.kloudlite.io/v1 +kind: HelmChart +metadata: + name: kloudlite-agent + namespace: kloudlite +spec: + chartRepoURL: https://kloudlite.github.io/helm-charts + chartVersion: {{$kloudliteRelease}} + chartName: kloudlite-agent + + jobVars: + tolerations: + - operator: Exists + + postInstall: |+ + if kubectl get ns kloudlite-tmp; + then + kubectl delete ns kloudlite-tmp + fi + + values: + imagePullPolicy: Always + + accountName: {{$accountName}} + clusterName: {{$clusterName}} + + clusterToken: {{$clusterToken}} + + clusterIdentitySecretName: kl-cluster-identity + + messageOfficeGRPCAddr: {{$messageOfficeGrpcAddr}} + + svcAccountName: sa + + clusterInternalDNS: "cluster.local" + + {{- /* kloudliteRelease: {{$kloudliteRelease}} */}} + + nodeSelector: + node-role.kubernetes.io/master: "true" + tolerations: + - key: "node-role.kubernetes.io/master" + operator: "Exists" + effect: "NoSchedule" + + agent: + enabled: true + name: kl-agent + image: + repository: ghcr.io/kloudlite/api/tenant-agent + tag: "" + pullPolicy: "" + nodeSelector: {} + tolerations: [] + + preferOperatorsOnMasterNodes: true + operators: + agentOperator: + enabled: true + name: kl-agent-operator + image: + repository: ghcr.io/kloudlite/operator/agent + tag: "" + pullPolicy: "" + + tolerations: [] + nodeSelector: {} + + configuration: + letsEncryptSupportEmail: "support@kloudlite.io" + + wireguard: + podCIDR: 10.42.0.0/16 + svcCIDR: 10.43.0.0/16 + + deviceNamespace: kl-vpn-devices + + helmCharts: + ingressNginx: + enabled: true + name: "ingress-nginx" + tolerations: [] + nodeSelector: {} + configuration: + controllerKind: DaemonSet + ingressClassName: nginx + + certManager: + enabled: true + name: "cert-manager" + nodeSelector: {} + tolerations: [] + affinity: {} + configuration: + defaultClusterIssuer: letsencrypt-prod + clusterIssuers: + - name: letsencrypt-prod + default: true + acme: + email: "support@kloudlite.io" + server: https://acme-v02.api.letsencrypt.org/directory + + vector: + enabled: true + name: "vector" + debugOnStdout: false + nodeSelector: {} + tolerations: [] + diff --git a/apps/infra/internal/domain/volume-attachment.go b/apps/infra/internal/domain/volume-attachment.go new file mode 100644 index 000000000..e1109bc96 --- /dev/null +++ b/apps/infra/internal/domain/volume-attachment.go @@ -0,0 +1,89 @@ +package domain + +import ( + "github.com/kloudlite/api/apps/infra/internal/entities" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" + "github.com/kloudlite/operator/operators/resource-watcher/types" +) + +// GetVolumeAttachment implements Domain. +func (d *domain) GetVolumeAttachment(ctx InfraContext, clusterName string, volAttachmentName string) (*entities.VolumeAttachment, error) { + volatt, err := d.volumeAttachmentRepo.FindOne(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + fields.MetadataName: volAttachmentName, + }) + if err != nil { + return nil, errors.NewE(err) + } + + if volatt == nil { + return nil, errors.Newf("persistent volume claim with name %q not found", volAttachmentName) + } + return volatt, nil +} + +// ListVolumeAttachments implements Domain. +func (d *domain) ListVolumeAttachments(ctx InfraContext, clusterName string, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.VolumeAttachment], error) { + filter := repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + } + return d.volumeAttachmentRepo.FindPaginated(ctx, d.nodePoolRepo.MergeMatchFilters(filter, search), pagination) +} + +// OnVolumeAttachmentDeleteMessage implements Domain. +func (d *domain) OnVolumeAttachmentDeleteMessage(ctx InfraContext, clusterName string, volumeAttachment entities.VolumeAttachment) error { + if err := d.volumeAttachmentRepo.DeleteOne(ctx, repos.Filter{ + fields.MetadataName: volumeAttachment.Name, + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + }); err != nil { + return errors.NewE(err) + } + d.resourceEventPublisher.PublishResourceEvent(ctx, clusterName, ResourceTypeVolumeAttachment, volumeAttachment.Name, PublishDelete) + return nil +} + +// OnVolumeAttachmentUpdateMessage implements Domain. +func (d *domain) OnVolumeAttachmentUpdateMessage(ctx InfraContext, clusterName string, volumeAttachment entities.VolumeAttachment, status types.ResourceStatus, opts UpdateAndDeleteOpts) error { + vatt, err := d.volumeAttachmentRepo.FindOne(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fields.ClusterName: clusterName, + fields.MetadataName: volumeAttachment.Name, + }) + if err != nil { + return err + } + + if vatt == nil { + volumeAttachment.AccountName = ctx.AccountName + volumeAttachment.ClusterName = clusterName + + volumeAttachment.CreatedBy = common.CreatedOrUpdatedBy{ + UserId: repos.ID(common.CreatedByResourceSyncUserId), + UserName: common.CreatedByResourceSyncUsername, + UserEmail: common.CreatedByResourceSyncUserEmail, + } + volumeAttachment.LastUpdatedBy = volumeAttachment.CreatedBy + vatt, err = d.volumeAttachmentRepo.Create(ctx, &volumeAttachment) + if err != nil { + return errors.NewE(err) + } + } + + upvatt, err := d.volumeAttachmentRepo.PatchById( + ctx, + vatt.Id, + common.PatchForSyncFromAgent(&volumeAttachment, volumeAttachment.RecordVersion, status, common.PatchOpts{ + MessageTimestamp: opts.MessageTimestamp, + })) + if err != nil { + return errors.NewE(err) + } + d.resourceEventPublisher.PublishResourceEvent(ctx, clusterName, ResourceTypeVolumeAttachment, upvatt.Name, PublishUpdate) + return nil +} diff --git a/apps/infra/internal/entities/cluster-managed-service.go b/apps/infra/internal/entities/cluster-managed-service.go new file mode 100644 index 000000000..a09821aa9 --- /dev/null +++ b/apps/infra/internal/entities/cluster-managed-service.go @@ -0,0 +1,48 @@ +package entities + +import ( + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + crdsv1 "github.com/kloudlite/operator/apis/crds/v1" + "github.com/kloudlite/operator/pkg/operator" + corev1 "k8s.io/api/core/v1" +) + +type ClusterManagedService struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + crdsv1.ClusterManagedService `json:",inline"` + + AccountName string `json:"accountName" graphql:"noinput"` + ClusterName string `json:"clusterName" graphql:"noinput"` + + SyncedOutputSecretRef *corev1.Secret `json:"syncedOutputSecretRef" graphql:"ignore"` + + common.ResourceMetadata `json:",inline"` + SyncStatus t.SyncStatus `json:"syncStatus" graphql:"noinput"` +} + +func (c *ClusterManagedService) GetDisplayName() string { + return c.ResourceMetadata.DisplayName +} + +func (c *ClusterManagedService) GetStatus() operator.Status { + return c.ClusterManagedService.Status +} + +var ClusterManagedServiceIndices = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: "id", Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: "metadata.name", Value: repos.IndexAsc}, + {Key: "accountName", Value: repos.IndexAsc}, + {Key: "clusterName", Value: repos.IndexAsc}, + }, + Unique: true, + }, +} diff --git a/apps/infra/internal/entities/cluster.go b/apps/infra/internal/entities/cluster.go new file mode 100644 index 000000000..87f61ed88 --- /dev/null +++ b/apps/infra/internal/entities/cluster.go @@ -0,0 +1,49 @@ +package entities + +import ( + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + clustersv1 "github.com/kloudlite/operator/apis/clusters/v1" + "github.com/kloudlite/operator/pkg/operator" +) + +type Cluster struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + + clustersv1.Cluster `json:",inline"` + + common.ResourceMetadata `json:",inline"` + + AccountName string `json:"accountName" graphql:"noinput"` + SyncStatus t.SyncStatus `json:"syncStatus" graphql:"noinput"` +} + +func (c *Cluster) GetDisplayName() string { + return c.ResourceMetadata.DisplayName +} + +func (c *Cluster) GetStatus() operator.Status { + return c.Cluster.Status +} + +var ClusterIndices = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: "id", Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: "metadata.name", Value: repos.IndexAsc}, + {Key: "metadata.namespace", Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: "accountName", Value: repos.IndexAsc}, + }, + }, +} diff --git a/apps/infra/internal/entities/domain-names.go b/apps/infra/internal/entities/domain-names.go new file mode 100644 index 000000000..8f365e823 --- /dev/null +++ b/apps/infra/internal/entities/domain-names.go @@ -0,0 +1,48 @@ +package entities + +import ( + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/repos" + "github.com/kloudlite/operator/pkg/operator" +) + +type DomainEntry struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + common.ResourceMetadata `json:",inline"` + + DomainName string `json:"domainName"` + + AccountName string `json:"accountName" graphql:"noinput"` + ClusterName string `json:"clusterName"` +} + +func (d DomainEntry) GetDisplayName() string { + return d.ResourceMetadata.DisplayName +} + +func (d DomainEntry) GetStatus() operator.Status { + return operator.Status{} +} + +var DomainEntryIndices = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: "id", Value: repos.IndexAsc}, + }, + Unique: true, + }, + + { + Field: []repos.IndexKey{ + {Key: "accountName", Value: repos.IndexAsc}, + }, + }, + + { + Field: []repos.IndexKey{ + {Key: "domainName", Value: repos.IndexAsc}, + {Key: "clusterName", Value: repos.IndexAsc}, + }, + Unique: true, + }, +} diff --git a/apps/infra/internal/entities/field-constants/gen.go b/apps/infra/internal/entities/field-constants/gen.go new file mode 100644 index 000000000..f0c75ca38 --- /dev/null +++ b/apps/infra/internal/entities/field-constants/gen.go @@ -0,0 +1,3 @@ +package field_constants + +//go:generate go run github.com/kloudlite/api/cmd/struct-json-path --pkg github.com/kloudlite/api/apps/infra/internal/entities --common-path "metadata" --common-path "apiVersion" --common-path "kind" --common-path "status" --common-path "syncStatus" --common-path "lastUpdatedBy" --common-path "createdBy" --common-path "displayName" --common-path "creationTime" --common-path "updateTime" --common-path "id" --common-path "recordVersion" --common-path "accountName" --common-path "clusterName" --common-path "markedForDeletion" --out-file ./generated_constants.go --banner "package field_constants" --ignore-nesting "time.Time" --ignore-nesting "k8s.io/apimachinery/pkg/apis/meta/v1.Time" diff --git a/apps/infra/internal/entities/field-constants/generated_constants.go b/apps/infra/internal/entities/field-constants/generated_constants.go new file mode 100644 index 000000000..3c837d800 --- /dev/null +++ b/apps/infra/internal/entities/field-constants/generated_constants.go @@ -0,0 +1,719 @@ +// DO NOT EDIT. generated by "github.com/kloudlite/api/cmd/struct-json-path" + +package field_constants + +// constant vars generated for struct AWSSecretCredentials +const ( + AWSSecretCredentialsAccessKey = "accessKey" + AWSSecretCredentialsAwsAccountId = "awsAccountId" + AWSSecretCredentialsCfParamExternalID = "cfParamExternalID" + AWSSecretCredentialsCfParamInstanceProfileName = "cfParamInstanceProfileName" + AWSSecretCredentialsCfParamRoleName = "cfParamRoleName" + AWSSecretCredentialsCfParamStackName = "cfParamStackName" + AWSSecretCredentialsCfParamTrustedARN = "cfParamTrustedARN" + AWSSecretCredentialsSecretKey = "secretKey" +) + +// constant vars generated for struct CloudProviderSecret +const ( + CloudProviderSecretAws = "aws" + CloudProviderSecretAwsAccessKey = "aws.accessKey" + CloudProviderSecretAwsAwsAccountId = "aws.awsAccountId" + CloudProviderSecretAwsCfParamExternalID = "aws.cfParamExternalID" + CloudProviderSecretAwsCfParamInstanceProfileName = "aws.cfParamInstanceProfileName" + CloudProviderSecretAwsCfParamRoleName = "aws.cfParamRoleName" + CloudProviderSecretAwsCfParamStackName = "aws.cfParamStackName" + CloudProviderSecretAwsCfParamTrustedARN = "aws.cfParamTrustedARN" + CloudProviderSecretAwsSecretKey = "aws.secretKey" + CloudProviderSecretCloudProviderName = "cloudProviderName" +) + +// constant vars generated for struct Cluster +const ( + ClusterSpec = "spec" + ClusterSpecAccountId = "spec.accountId" + ClusterSpecAccountName = "spec.accountName" + ClusterSpecAvailabilityMode = "spec.availabilityMode" + ClusterSpecAws = "spec.aws" + ClusterSpecAwsK3sMasters = "spec.aws.k3sMasters" + ClusterSpecAwsK3sMastersIamInstanceProfileRole = "spec.aws.k3sMasters.iamInstanceProfileRole" + ClusterSpecAwsK3sMastersImageId = "spec.aws.k3sMasters.imageId" + ClusterSpecAwsK3sMastersImageSSHUsername = "spec.aws.k3sMasters.imageSSHUsername" + ClusterSpecAwsK3sMastersInstanceType = "spec.aws.k3sMasters.instanceType" + ClusterSpecAwsK3sMastersNodes = "spec.aws.k3sMasters.nodes" + ClusterSpecAwsK3sMastersNvidiaGpuEnabled = "spec.aws.k3sMasters.nvidiaGpuEnabled" + ClusterSpecAwsK3sMastersRootVolumeSize = "spec.aws.k3sMasters.rootVolumeSize" + ClusterSpecAwsK3sMastersRootVolumeType = "spec.aws.k3sMasters.rootVolumeType" + ClusterSpecAwsNodePools = "spec.aws.nodePools" + ClusterSpecAwsRegion = "spec.aws.region" + ClusterSpecAwsSpotNodePools = "spec.aws.spotNodePools" + ClusterSpecBackupToS3Enabled = "spec.backupToS3Enabled" + ClusterSpecCloudProvider = "spec.cloudProvider" + ClusterSpecCloudflareEnabled = "spec.cloudflareEnabled" + ClusterSpecClusterInternalDnsHost = "spec.clusterInternalDnsHost" + ClusterSpecClusterTokenRef = "spec.clusterTokenRef" + ClusterSpecClusterTokenRefKey = "spec.clusterTokenRef.key" + ClusterSpecClusterTokenRefName = "spec.clusterTokenRef.name" + ClusterSpecClusterTokenRefNamespace = "spec.clusterTokenRef.namespace" + ClusterSpecCredentialKeys = "spec.credentialKeys" + ClusterSpecCredentialKeysKeyAWSAccountId = "spec.credentialKeys.keyAWSAccountId" + ClusterSpecCredentialKeysKeyAWSAssumeRoleExternalID = "spec.credentialKeys.keyAWSAssumeRoleExternalID" + ClusterSpecCredentialKeysKeyAWSAssumeRoleRoleARN = "spec.credentialKeys.keyAWSAssumeRoleRoleARN" + ClusterSpecCredentialKeysKeyAccessKey = "spec.credentialKeys.keyAccessKey" + ClusterSpecCredentialKeysKeyIAMInstanceProfileRole = "spec.credentialKeys.keyIAMInstanceProfileRole" + ClusterSpecCredentialKeysKeySecretKey = "spec.credentialKeys.keySecretKey" + ClusterSpecCredentialsRef = "spec.credentialsRef" + ClusterSpecCredentialsRefName = "spec.credentialsRef.name" + ClusterSpecCredentialsRefNamespace = "spec.credentialsRef.namespace" + ClusterSpecKloudliteRelease = "spec.kloudliteRelease" + ClusterSpecMessageQueueTopicName = "spec.messageQueueTopicName" + ClusterSpecOutput = "spec.output" + ClusterSpecOutputJobName = "spec.output.jobName" + ClusterSpecOutputJobNamespace = "spec.output.jobNamespace" + ClusterSpecOutputKeyK3sAgentJoinToken = "spec.output.keyK3sAgentJoinToken" + ClusterSpecOutputKeyK3sServerJoinToken = "spec.output.keyK3sServerJoinToken" + ClusterSpecOutputKeyKubeconfig = "spec.output.keyKubeconfig" + ClusterSpecOutputSecretName = "spec.output.secretName" + ClusterSpecPublicDNSHost = "spec.publicDNSHost" + ClusterSpecTaintMasterNodes = "spec.taintMasterNodes" +) + +// constant vars generated for struct ClusterManagedService +const ( + ClusterManagedServiceSpec = "spec" + ClusterManagedServiceSpecMsvcSpec = "spec.msvcSpec" + ClusterManagedServiceSpecMsvcSpecServiceTemplate = "spec.msvcSpec.serviceTemplate" + ClusterManagedServiceSpecMsvcSpecServiceTemplateApiVersion = "spec.msvcSpec.serviceTemplate.apiVersion" + ClusterManagedServiceSpecMsvcSpecServiceTemplateKind = "spec.msvcSpec.serviceTemplate.kind" + ClusterManagedServiceSpecMsvcSpecServiceTemplateSpec = "spec.msvcSpec.serviceTemplate.spec" + ClusterManagedServiceSpecTargetNamespace = "spec.targetNamespace" + ClusterManagedServiceSyncedOutputSecretRef = "syncedOutputSecretRef" + ClusterManagedServiceSyncedOutputSecretRefApiVersion = "syncedOutputSecretRef.apiVersion" + ClusterManagedServiceSyncedOutputSecretRefData = "syncedOutputSecretRef.data" + ClusterManagedServiceSyncedOutputSecretRefImmutable = "syncedOutputSecretRef.immutable" + ClusterManagedServiceSyncedOutputSecretRefKind = "syncedOutputSecretRef.kind" + ClusterManagedServiceSyncedOutputSecretRefMetadata = "syncedOutputSecretRef.metadata" + ClusterManagedServiceSyncedOutputSecretRefMetadataAnnotations = "syncedOutputSecretRef.metadata.annotations" + ClusterManagedServiceSyncedOutputSecretRefMetadataCreationTimestamp = "syncedOutputSecretRef.metadata.creationTimestamp" + ClusterManagedServiceSyncedOutputSecretRefMetadataDeletionGracePeriodSeconds = "syncedOutputSecretRef.metadata.deletionGracePeriodSeconds" + ClusterManagedServiceSyncedOutputSecretRefMetadataDeletionTimestamp = "syncedOutputSecretRef.metadata.deletionTimestamp" + ClusterManagedServiceSyncedOutputSecretRefMetadataFinalizers = "syncedOutputSecretRef.metadata.finalizers" + ClusterManagedServiceSyncedOutputSecretRefMetadataGenerateName = "syncedOutputSecretRef.metadata.generateName" + ClusterManagedServiceSyncedOutputSecretRefMetadataGeneration = "syncedOutputSecretRef.metadata.generation" + ClusterManagedServiceSyncedOutputSecretRefMetadataLabels = "syncedOutputSecretRef.metadata.labels" + ClusterManagedServiceSyncedOutputSecretRefMetadataManagedFields = "syncedOutputSecretRef.metadata.managedFields" + ClusterManagedServiceSyncedOutputSecretRefMetadataName = "syncedOutputSecretRef.metadata.name" + ClusterManagedServiceSyncedOutputSecretRefMetadataNamespace = "syncedOutputSecretRef.metadata.namespace" + ClusterManagedServiceSyncedOutputSecretRefMetadataOwnerReferences = "syncedOutputSecretRef.metadata.ownerReferences" + ClusterManagedServiceSyncedOutputSecretRefMetadataResourceVersion = "syncedOutputSecretRef.metadata.resourceVersion" + ClusterManagedServiceSyncedOutputSecretRefMetadataSelfLink = "syncedOutputSecretRef.metadata.selfLink" + ClusterManagedServiceSyncedOutputSecretRefMetadataUid = "syncedOutputSecretRef.metadata.uid" + ClusterManagedServiceSyncedOutputSecretRefStringData = "syncedOutputSecretRef.stringData" + ClusterManagedServiceSyncedOutputSecretRefType = "syncedOutputSecretRef.type" +) + +// constant vars generated for struct DomainEntry +const ( + DomainEntryDomainName = "domainName" +) + +// constant vars generated for struct HelmRelease +const ( + HelmReleaseSpec = "spec" + HelmReleaseSpecChartName = "spec.chartName" + HelmReleaseSpecChartRepoURL = "spec.chartRepoURL" + HelmReleaseSpecChartVersion = "spec.chartVersion" + HelmReleaseSpecJobVars = "spec.jobVars" + HelmReleaseSpecJobVarsAffinity = "spec.jobVars.affinity" + HelmReleaseSpecJobVarsAffinityNodeAffinity = "spec.jobVars.affinity.nodeAffinity" + HelmReleaseSpecJobVarsAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution = "spec.jobVars.affinity.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution" + HelmReleaseSpecJobVarsAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution = "spec.jobVars.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution" + HelmReleaseSpecJobVarsAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms = "spec.jobVars.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms" + HelmReleaseSpecJobVarsAffinityPodAffinity = "spec.jobVars.affinity.podAffinity" + HelmReleaseSpecJobVarsAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution = "spec.jobVars.affinity.podAffinity.preferredDuringSchedulingIgnoredDuringExecution" + HelmReleaseSpecJobVarsAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution = "spec.jobVars.affinity.podAffinity.requiredDuringSchedulingIgnoredDuringExecution" + HelmReleaseSpecJobVarsAffinityPodAntiAffinity = "spec.jobVars.affinity.podAntiAffinity" + HelmReleaseSpecJobVarsAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecution = "spec.jobVars.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution" + HelmReleaseSpecJobVarsAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecution = "spec.jobVars.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution" + HelmReleaseSpecJobVarsBackOffLimit = "spec.jobVars.backOffLimit" + HelmReleaseSpecJobVarsNodeSelector = "spec.jobVars.nodeSelector" + HelmReleaseSpecJobVarsTolerations = "spec.jobVars.tolerations" + HelmReleaseSpecPostInstall = "spec.postInstall" + HelmReleaseSpecPostUninstall = "spec.postUninstall" + HelmReleaseSpecPreInstall = "spec.preInstall" + HelmReleaseSpecPreUninstall = "spec.preUninstall" + HelmReleaseSpecValues = "spec.values" +) + +// constant vars generated for struct InputField +const ( + InputFieldDefaultValue = "defaultValue" + InputFieldDisplayUnit = "displayUnit" + InputFieldInputType = "inputType" + InputFieldLabel = "label" + InputFieldMax = "max" + InputFieldMin = "min" + InputFieldMultiplier = "multiplier" + InputFieldName = "name" + InputFieldRequired = "required" + InputFieldUnit = "unit" +) + +// constant vars generated for struct MresTemplate +const ( + MresTemplateDescription = "description" + MresTemplateFields = "fields" + MresTemplateName = "name" + MresTemplateOutputs = "outputs" +) + +// constant vars generated for struct MsvcTemplate +const ( + MsvcTemplateCategory = "category" + MsvcTemplateItems = "items" +) + +// constant vars generated for struct MsvcTemplateEntry +const ( + MsvcTemplateEntryActive = "active" + MsvcTemplateEntryDescription = "description" + MsvcTemplateEntryFields = "fields" + MsvcTemplateEntryLogoUrl = "logoUrl" + MsvcTemplateEntryName = "name" + MsvcTemplateEntryOutputs = "outputs" + MsvcTemplateEntryResources = "resources" +) + +// constant vars generated for struct Namespace +const ( + NamespaceSpec = "spec" + NamespaceSpecFinalizers = "spec.finalizers" +) + +// constant vars generated for struct Node +const ( + NodeSpec = "spec" + NodeSpecNodepoolName = "spec.nodepoolName" +) + +// constant vars generated for struct NodePool +const ( + NodePoolSpec = "spec" + NodePoolSpecAws = "spec.aws" + NodePoolSpecAwsAvailabilityZone = "spec.aws.availabilityZone" + NodePoolSpecAwsEc2Pool = "spec.aws.ec2Pool" + NodePoolSpecAwsEc2PoolInstanceType = "spec.aws.ec2Pool.instanceType" + NodePoolSpecAwsEc2PoolNodes = "spec.aws.ec2Pool.nodes" + NodePoolSpecAwsIamInstanceProfileRole = "spec.aws.iamInstanceProfileRole" + NodePoolSpecAwsImageId = "spec.aws.imageId" + NodePoolSpecAwsImageSSHUsername = "spec.aws.imageSSHUsername" + NodePoolSpecAwsNvidiaGpuEnabled = "spec.aws.nvidiaGpuEnabled" + NodePoolSpecAwsPoolType = "spec.aws.poolType" + NodePoolSpecAwsRootVolumeSize = "spec.aws.rootVolumeSize" + NodePoolSpecAwsRootVolumeType = "spec.aws.rootVolumeType" + NodePoolSpecAwsSpotPool = "spec.aws.spotPool" + NodePoolSpecAwsSpotPoolCpuNode = "spec.aws.spotPool.cpuNode" + NodePoolSpecAwsSpotPoolCpuNodeMemoryPerVcpu = "spec.aws.spotPool.cpuNode.memoryPerVcpu" + NodePoolSpecAwsSpotPoolCpuNodeMemoryPerVcpuMax = "spec.aws.spotPool.cpuNode.memoryPerVcpu.max" + NodePoolSpecAwsSpotPoolCpuNodeMemoryPerVcpuMin = "spec.aws.spotPool.cpuNode.memoryPerVcpu.min" + NodePoolSpecAwsSpotPoolCpuNodeVcpu = "spec.aws.spotPool.cpuNode.vcpu" + NodePoolSpecAwsSpotPoolCpuNodeVcpuMax = "spec.aws.spotPool.cpuNode.vcpu.max" + NodePoolSpecAwsSpotPoolCpuNodeVcpuMin = "spec.aws.spotPool.cpuNode.vcpu.min" + NodePoolSpecAwsSpotPoolGpuNode = "spec.aws.spotPool.gpuNode" + NodePoolSpecAwsSpotPoolGpuNodeInstanceTypes = "spec.aws.spotPool.gpuNode.instanceTypes" + NodePoolSpecAwsSpotPoolNodes = "spec.aws.spotPool.nodes" + NodePoolSpecAwsSpotPoolSpotFleetTaggingRoleName = "spec.aws.spotPool.spotFleetTaggingRoleName" + NodePoolSpecCloudProvider = "spec.cloudProvider" + NodePoolSpecIac = "spec.iac" + NodePoolSpecIacCloudProviderAccessKey = "spec.iac.cloudProviderAccessKey" + NodePoolSpecIacCloudProviderAccessKeyKey = "spec.iac.cloudProviderAccessKey.key" + NodePoolSpecIacCloudProviderAccessKeyName = "spec.iac.cloudProviderAccessKey.name" + NodePoolSpecIacCloudProviderAccessKeyNamespace = "spec.iac.cloudProviderAccessKey.namespace" + NodePoolSpecIacCloudProviderSecretKey = "spec.iac.cloudProviderSecretKey" + NodePoolSpecIacCloudProviderSecretKeyKey = "spec.iac.cloudProviderSecretKey.key" + NodePoolSpecIacCloudProviderSecretKeyName = "spec.iac.cloudProviderSecretKey.name" + NodePoolSpecIacCloudProviderSecretKeyNamespace = "spec.iac.cloudProviderSecretKey.namespace" + NodePoolSpecIacJobName = "spec.iac.jobName" + NodePoolSpecIacJobNamespace = "spec.iac.jobNamespace" + NodePoolSpecIacStateS3BucketFilePath = "spec.iac.stateS3BucketFilePath" + NodePoolSpecIacStateS3BucketName = "spec.iac.stateS3BucketName" + NodePoolSpecIacStateS3BucketRegion = "spec.iac.stateS3BucketRegion" + NodePoolSpecMaxCount = "spec.maxCount" + NodePoolSpecMinCount = "spec.minCount" + NodePoolSpecNodeLabels = "spec.nodeLabels" + NodePoolSpecNodeTaints = "spec.nodeTaints" +) + +// constant vars generated for struct OutputField +const ( + OutputFieldDescription = "description" + OutputFieldLabel = "label" + OutputFieldName = "name" +) + +// constant vars generated for struct PersistentVolume +const ( + PersistentVolumeSpec = "spec" + PersistentVolumeSpecAccessModes = "spec.accessModes" + PersistentVolumeSpecAwsElasticBlockStore = "spec.awsElasticBlockStore" + PersistentVolumeSpecAwsElasticBlockStoreFsType = "spec.awsElasticBlockStore.fsType" + PersistentVolumeSpecAwsElasticBlockStorePartition = "spec.awsElasticBlockStore.partition" + PersistentVolumeSpecAwsElasticBlockStoreReadOnly = "spec.awsElasticBlockStore.readOnly" + PersistentVolumeSpecAwsElasticBlockStoreVolumeID = "spec.awsElasticBlockStore.volumeID" + PersistentVolumeSpecAzureDisk = "spec.azureDisk" + PersistentVolumeSpecAzureDiskCachingMode = "spec.azureDisk.cachingMode" + PersistentVolumeSpecAzureDiskDiskName = "spec.azureDisk.diskName" + PersistentVolumeSpecAzureDiskDiskURI = "spec.azureDisk.diskURI" + PersistentVolumeSpecAzureDiskFsType = "spec.azureDisk.fsType" + PersistentVolumeSpecAzureDiskKind = "spec.azureDisk.kind" + PersistentVolumeSpecAzureDiskReadOnly = "spec.azureDisk.readOnly" + PersistentVolumeSpecAzureFile = "spec.azureFile" + PersistentVolumeSpecAzureFileReadOnly = "spec.azureFile.readOnly" + PersistentVolumeSpecAzureFileSecretName = "spec.azureFile.secretName" + PersistentVolumeSpecAzureFileSecretNamespace = "spec.azureFile.secretNamespace" + PersistentVolumeSpecAzureFileShareName = "spec.azureFile.shareName" + PersistentVolumeSpecCapacity = "spec.capacity" + PersistentVolumeSpecCephfs = "spec.cephfs" + PersistentVolumeSpecCephfsMonitors = "spec.cephfs.monitors" + PersistentVolumeSpecCephfsPath = "spec.cephfs.path" + PersistentVolumeSpecCephfsReadOnly = "spec.cephfs.readOnly" + PersistentVolumeSpecCephfsSecretFile = "spec.cephfs.secretFile" + PersistentVolumeSpecCephfsSecretRef = "spec.cephfs.secretRef" + PersistentVolumeSpecCephfsSecretRefName = "spec.cephfs.secretRef.name" + PersistentVolumeSpecCephfsSecretRefNamespace = "spec.cephfs.secretRef.namespace" + PersistentVolumeSpecCephfsUser = "spec.cephfs.user" + PersistentVolumeSpecCinder = "spec.cinder" + PersistentVolumeSpecCinderFsType = "spec.cinder.fsType" + PersistentVolumeSpecCinderReadOnly = "spec.cinder.readOnly" + PersistentVolumeSpecCinderSecretRef = "spec.cinder.secretRef" + PersistentVolumeSpecCinderSecretRefName = "spec.cinder.secretRef.name" + PersistentVolumeSpecCinderSecretRefNamespace = "spec.cinder.secretRef.namespace" + PersistentVolumeSpecCinderVolumeID = "spec.cinder.volumeID" + PersistentVolumeSpecClaimRef = "spec.claimRef" + PersistentVolumeSpecClaimRefApiVersion = "spec.claimRef.apiVersion" + PersistentVolumeSpecClaimRefFieldPath = "spec.claimRef.fieldPath" + PersistentVolumeSpecClaimRefKind = "spec.claimRef.kind" + PersistentVolumeSpecClaimRefName = "spec.claimRef.name" + PersistentVolumeSpecClaimRefNamespace = "spec.claimRef.namespace" + PersistentVolumeSpecClaimRefResourceVersion = "spec.claimRef.resourceVersion" + PersistentVolumeSpecClaimRefUid = "spec.claimRef.uid" + PersistentVolumeSpecCsi = "spec.csi" + PersistentVolumeSpecCsiControllerExpandSecretRef = "spec.csi.controllerExpandSecretRef" + PersistentVolumeSpecCsiControllerExpandSecretRefName = "spec.csi.controllerExpandSecretRef.name" + PersistentVolumeSpecCsiControllerExpandSecretRefNamespace = "spec.csi.controllerExpandSecretRef.namespace" + PersistentVolumeSpecCsiControllerPublishSecretRef = "spec.csi.controllerPublishSecretRef" + PersistentVolumeSpecCsiControllerPublishSecretRefName = "spec.csi.controllerPublishSecretRef.name" + PersistentVolumeSpecCsiControllerPublishSecretRefNamespace = "spec.csi.controllerPublishSecretRef.namespace" + PersistentVolumeSpecCsiDriver = "spec.csi.driver" + PersistentVolumeSpecCsiFsType = "spec.csi.fsType" + PersistentVolumeSpecCsiNodeExpandSecretRef = "spec.csi.nodeExpandSecretRef" + PersistentVolumeSpecCsiNodeExpandSecretRefName = "spec.csi.nodeExpandSecretRef.name" + PersistentVolumeSpecCsiNodeExpandSecretRefNamespace = "spec.csi.nodeExpandSecretRef.namespace" + PersistentVolumeSpecCsiNodePublishSecretRef = "spec.csi.nodePublishSecretRef" + PersistentVolumeSpecCsiNodePublishSecretRefName = "spec.csi.nodePublishSecretRef.name" + PersistentVolumeSpecCsiNodePublishSecretRefNamespace = "spec.csi.nodePublishSecretRef.namespace" + PersistentVolumeSpecCsiNodeStageSecretRef = "spec.csi.nodeStageSecretRef" + PersistentVolumeSpecCsiNodeStageSecretRefName = "spec.csi.nodeStageSecretRef.name" + PersistentVolumeSpecCsiNodeStageSecretRefNamespace = "spec.csi.nodeStageSecretRef.namespace" + PersistentVolumeSpecCsiReadOnly = "spec.csi.readOnly" + PersistentVolumeSpecCsiVolumeAttributes = "spec.csi.volumeAttributes" + PersistentVolumeSpecCsiVolumeHandle = "spec.csi.volumeHandle" + PersistentVolumeSpecFc = "spec.fc" + PersistentVolumeSpecFcFsType = "spec.fc.fsType" + PersistentVolumeSpecFcLun = "spec.fc.lun" + PersistentVolumeSpecFcReadOnly = "spec.fc.readOnly" + PersistentVolumeSpecFcTargetWWNs = "spec.fc.targetWWNs" + PersistentVolumeSpecFcWwids = "spec.fc.wwids" + PersistentVolumeSpecFlexVolume = "spec.flexVolume" + PersistentVolumeSpecFlexVolumeDriver = "spec.flexVolume.driver" + PersistentVolumeSpecFlexVolumeFsType = "spec.flexVolume.fsType" + PersistentVolumeSpecFlexVolumeOptions = "spec.flexVolume.options" + PersistentVolumeSpecFlexVolumeReadOnly = "spec.flexVolume.readOnly" + PersistentVolumeSpecFlexVolumeSecretRef = "spec.flexVolume.secretRef" + PersistentVolumeSpecFlexVolumeSecretRefName = "spec.flexVolume.secretRef.name" + PersistentVolumeSpecFlexVolumeSecretRefNamespace = "spec.flexVolume.secretRef.namespace" + PersistentVolumeSpecFlocker = "spec.flocker" + PersistentVolumeSpecFlockerDatasetName = "spec.flocker.datasetName" + PersistentVolumeSpecFlockerDatasetUUID = "spec.flocker.datasetUUID" + PersistentVolumeSpecGcePersistentDisk = "spec.gcePersistentDisk" + PersistentVolumeSpecGcePersistentDiskFsType = "spec.gcePersistentDisk.fsType" + PersistentVolumeSpecGcePersistentDiskPartition = "spec.gcePersistentDisk.partition" + PersistentVolumeSpecGcePersistentDiskPdName = "spec.gcePersistentDisk.pdName" + PersistentVolumeSpecGcePersistentDiskReadOnly = "spec.gcePersistentDisk.readOnly" + PersistentVolumeSpecGlusterfs = "spec.glusterfs" + PersistentVolumeSpecGlusterfsEndpoints = "spec.glusterfs.endpoints" + PersistentVolumeSpecGlusterfsEndpointsNamespace = "spec.glusterfs.endpointsNamespace" + PersistentVolumeSpecGlusterfsPath = "spec.glusterfs.path" + PersistentVolumeSpecGlusterfsReadOnly = "spec.glusterfs.readOnly" + PersistentVolumeSpecHostPath = "spec.hostPath" + PersistentVolumeSpecHostPathPath = "spec.hostPath.path" + PersistentVolumeSpecHostPathType = "spec.hostPath.type" + PersistentVolumeSpecIscsi = "spec.iscsi" + PersistentVolumeSpecIscsiChapAuthDiscovery = "spec.iscsi.chapAuthDiscovery" + PersistentVolumeSpecIscsiChapAuthSession = "spec.iscsi.chapAuthSession" + PersistentVolumeSpecIscsiFsType = "spec.iscsi.fsType" + PersistentVolumeSpecIscsiInitiatorName = "spec.iscsi.initiatorName" + PersistentVolumeSpecIscsiIqn = "spec.iscsi.iqn" + PersistentVolumeSpecIscsiIscsiInterface = "spec.iscsi.iscsiInterface" + PersistentVolumeSpecIscsiLun = "spec.iscsi.lun" + PersistentVolumeSpecIscsiPortals = "spec.iscsi.portals" + PersistentVolumeSpecIscsiReadOnly = "spec.iscsi.readOnly" + PersistentVolumeSpecIscsiSecretRef = "spec.iscsi.secretRef" + PersistentVolumeSpecIscsiSecretRefName = "spec.iscsi.secretRef.name" + PersistentVolumeSpecIscsiSecretRefNamespace = "spec.iscsi.secretRef.namespace" + PersistentVolumeSpecIscsiTargetPortal = "spec.iscsi.targetPortal" + PersistentVolumeSpecLocal = "spec.local" + PersistentVolumeSpecLocalFsType = "spec.local.fsType" + PersistentVolumeSpecLocalPath = "spec.local.path" + PersistentVolumeSpecMountOptions = "spec.mountOptions" + PersistentVolumeSpecNfs = "spec.nfs" + PersistentVolumeSpecNfsPath = "spec.nfs.path" + PersistentVolumeSpecNfsReadOnly = "spec.nfs.readOnly" + PersistentVolumeSpecNfsServer = "spec.nfs.server" + PersistentVolumeSpecNodeAffinity = "spec.nodeAffinity" + PersistentVolumeSpecNodeAffinityRequired = "spec.nodeAffinity.required" + PersistentVolumeSpecNodeAffinityRequiredNodeSelectorTerms = "spec.nodeAffinity.required.nodeSelectorTerms" + PersistentVolumeSpecPersistentVolumeReclaimPolicy = "spec.persistentVolumeReclaimPolicy" + PersistentVolumeSpecPhotonPersistentDisk = "spec.photonPersistentDisk" + PersistentVolumeSpecPhotonPersistentDiskFsType = "spec.photonPersistentDisk.fsType" + PersistentVolumeSpecPhotonPersistentDiskPdID = "spec.photonPersistentDisk.pdID" + PersistentVolumeSpecPortworxVolume = "spec.portworxVolume" + PersistentVolumeSpecPortworxVolumeFsType = "spec.portworxVolume.fsType" + PersistentVolumeSpecPortworxVolumeReadOnly = "spec.portworxVolume.readOnly" + PersistentVolumeSpecPortworxVolumeVolumeID = "spec.portworxVolume.volumeID" + PersistentVolumeSpecQuobyte = "spec.quobyte" + PersistentVolumeSpecQuobyteGroup = "spec.quobyte.group" + PersistentVolumeSpecQuobyteReadOnly = "spec.quobyte.readOnly" + PersistentVolumeSpecQuobyteRegistry = "spec.quobyte.registry" + PersistentVolumeSpecQuobyteTenant = "spec.quobyte.tenant" + PersistentVolumeSpecQuobyteUser = "spec.quobyte.user" + PersistentVolumeSpecQuobyteVolume = "spec.quobyte.volume" + PersistentVolumeSpecRbd = "spec.rbd" + PersistentVolumeSpecRbdFsType = "spec.rbd.fsType" + PersistentVolumeSpecRbdImage = "spec.rbd.image" + PersistentVolumeSpecRbdKeyring = "spec.rbd.keyring" + PersistentVolumeSpecRbdMonitors = "spec.rbd.monitors" + PersistentVolumeSpecRbdPool = "spec.rbd.pool" + PersistentVolumeSpecRbdReadOnly = "spec.rbd.readOnly" + PersistentVolumeSpecRbdSecretRef = "spec.rbd.secretRef" + PersistentVolumeSpecRbdSecretRefName = "spec.rbd.secretRef.name" + PersistentVolumeSpecRbdSecretRefNamespace = "spec.rbd.secretRef.namespace" + PersistentVolumeSpecRbdUser = "spec.rbd.user" + PersistentVolumeSpecScaleIO = "spec.scaleIO" + PersistentVolumeSpecScaleIOFsType = "spec.scaleIO.fsType" + PersistentVolumeSpecScaleIOGateway = "spec.scaleIO.gateway" + PersistentVolumeSpecScaleIOProtectionDomain = "spec.scaleIO.protectionDomain" + PersistentVolumeSpecScaleIOReadOnly = "spec.scaleIO.readOnly" + PersistentVolumeSpecScaleIOSecretRef = "spec.scaleIO.secretRef" + PersistentVolumeSpecScaleIOSecretRefName = "spec.scaleIO.secretRef.name" + PersistentVolumeSpecScaleIOSecretRefNamespace = "spec.scaleIO.secretRef.namespace" + PersistentVolumeSpecScaleIOSslEnabled = "spec.scaleIO.sslEnabled" + PersistentVolumeSpecScaleIOStorageMode = "spec.scaleIO.storageMode" + PersistentVolumeSpecScaleIOStoragePool = "spec.scaleIO.storagePool" + PersistentVolumeSpecScaleIOSystem = "spec.scaleIO.system" + PersistentVolumeSpecScaleIOVolumeName = "spec.scaleIO.volumeName" + PersistentVolumeSpecStorageClassName = "spec.storageClassName" + PersistentVolumeSpecStorageos = "spec.storageos" + PersistentVolumeSpecStorageosFsType = "spec.storageos.fsType" + PersistentVolumeSpecStorageosReadOnly = "spec.storageos.readOnly" + PersistentVolumeSpecStorageosSecretRef = "spec.storageos.secretRef" + PersistentVolumeSpecStorageosSecretRefApiVersion = "spec.storageos.secretRef.apiVersion" + PersistentVolumeSpecStorageosSecretRefFieldPath = "spec.storageos.secretRef.fieldPath" + PersistentVolumeSpecStorageosSecretRefKind = "spec.storageos.secretRef.kind" + PersistentVolumeSpecStorageosSecretRefName = "spec.storageos.secretRef.name" + PersistentVolumeSpecStorageosSecretRefNamespace = "spec.storageos.secretRef.namespace" + PersistentVolumeSpecStorageosSecretRefResourceVersion = "spec.storageos.secretRef.resourceVersion" + PersistentVolumeSpecStorageosSecretRefUid = "spec.storageos.secretRef.uid" + PersistentVolumeSpecStorageosVolumeName = "spec.storageos.volumeName" + PersistentVolumeSpecStorageosVolumeNamespace = "spec.storageos.volumeNamespace" + PersistentVolumeSpecVolumeMode = "spec.volumeMode" + PersistentVolumeSpecVsphereVolume = "spec.vsphereVolume" + PersistentVolumeSpecVsphereVolumeFsType = "spec.vsphereVolume.fsType" + PersistentVolumeSpecVsphereVolumeStoragePolicyID = "spec.vsphereVolume.storagePolicyID" + PersistentVolumeSpecVsphereVolumeStoragePolicyName = "spec.vsphereVolume.storagePolicyName" + PersistentVolumeSpecVsphereVolumeVolumePath = "spec.vsphereVolume.volumePath" +) + +// constant vars generated for struct PersistentVolumeClaim +const ( + PersistentVolumeClaimSpec = "spec" + PersistentVolumeClaimSpecAccessModes = "spec.accessModes" + PersistentVolumeClaimSpecDataSource = "spec.dataSource" + PersistentVolumeClaimSpecDataSourceApiGroup = "spec.dataSource.apiGroup" + PersistentVolumeClaimSpecDataSourceKind = "spec.dataSource.kind" + PersistentVolumeClaimSpecDataSourceName = "spec.dataSource.name" + PersistentVolumeClaimSpecDataSourceRef = "spec.dataSourceRef" + PersistentVolumeClaimSpecDataSourceRefApiGroup = "spec.dataSourceRef.apiGroup" + PersistentVolumeClaimSpecDataSourceRefKind = "spec.dataSourceRef.kind" + PersistentVolumeClaimSpecDataSourceRefName = "spec.dataSourceRef.name" + PersistentVolumeClaimSpecDataSourceRefNamespace = "spec.dataSourceRef.namespace" + PersistentVolumeClaimSpecResources = "spec.resources" + PersistentVolumeClaimSpecResourcesClaims = "spec.resources.claims" + PersistentVolumeClaimSpecResourcesLimits = "spec.resources.limits" + PersistentVolumeClaimSpecResourcesRequests = "spec.resources.requests" + PersistentVolumeClaimSpecSelector = "spec.selector" + PersistentVolumeClaimSpecSelectorMatchExpressions = "spec.selector.matchExpressions" + PersistentVolumeClaimSpecSelectorMatchLabels = "spec.selector.matchLabels" + PersistentVolumeClaimSpecStorageClassName = "spec.storageClassName" + PersistentVolumeClaimSpecVolumeMode = "spec.volumeMode" + PersistentVolumeClaimSpecVolumeName = "spec.volumeName" +) + +// constant vars generated for struct VolumeAttachment +const ( + VolumeAttachmentSpec = "spec" + VolumeAttachmentSpecAttacher = "spec.attacher" + VolumeAttachmentSpecNodeName = "spec.nodeName" + VolumeAttachmentSpecSource = "spec.source" + VolumeAttachmentSpecSourceInlineVolumeSpec = "spec.source.inlineVolumeSpec" + VolumeAttachmentSpecSourceInlineVolumeSpecAccessModes = "spec.source.inlineVolumeSpec.accessModes" + VolumeAttachmentSpecSourceInlineVolumeSpecAwsElasticBlockStore = "spec.source.inlineVolumeSpec.awsElasticBlockStore" + VolumeAttachmentSpecSourceInlineVolumeSpecAwsElasticBlockStoreFsType = "spec.source.inlineVolumeSpec.awsElasticBlockStore.fsType" + VolumeAttachmentSpecSourceInlineVolumeSpecAwsElasticBlockStorePartition = "spec.source.inlineVolumeSpec.awsElasticBlockStore.partition" + VolumeAttachmentSpecSourceInlineVolumeSpecAwsElasticBlockStoreReadOnly = "spec.source.inlineVolumeSpec.awsElasticBlockStore.readOnly" + VolumeAttachmentSpecSourceInlineVolumeSpecAwsElasticBlockStoreVolumeID = "spec.source.inlineVolumeSpec.awsElasticBlockStore.volumeID" + VolumeAttachmentSpecSourceInlineVolumeSpecAzureDisk = "spec.source.inlineVolumeSpec.azureDisk" + VolumeAttachmentSpecSourceInlineVolumeSpecAzureDiskCachingMode = "spec.source.inlineVolumeSpec.azureDisk.cachingMode" + VolumeAttachmentSpecSourceInlineVolumeSpecAzureDiskDiskName = "spec.source.inlineVolumeSpec.azureDisk.diskName" + VolumeAttachmentSpecSourceInlineVolumeSpecAzureDiskDiskURI = "spec.source.inlineVolumeSpec.azureDisk.diskURI" + VolumeAttachmentSpecSourceInlineVolumeSpecAzureDiskFsType = "spec.source.inlineVolumeSpec.azureDisk.fsType" + VolumeAttachmentSpecSourceInlineVolumeSpecAzureDiskKind = "spec.source.inlineVolumeSpec.azureDisk.kind" + VolumeAttachmentSpecSourceInlineVolumeSpecAzureDiskReadOnly = "spec.source.inlineVolumeSpec.azureDisk.readOnly" + VolumeAttachmentSpecSourceInlineVolumeSpecAzureFile = "spec.source.inlineVolumeSpec.azureFile" + VolumeAttachmentSpecSourceInlineVolumeSpecAzureFileReadOnly = "spec.source.inlineVolumeSpec.azureFile.readOnly" + VolumeAttachmentSpecSourceInlineVolumeSpecAzureFileSecretName = "spec.source.inlineVolumeSpec.azureFile.secretName" + VolumeAttachmentSpecSourceInlineVolumeSpecAzureFileSecretNamespace = "spec.source.inlineVolumeSpec.azureFile.secretNamespace" + VolumeAttachmentSpecSourceInlineVolumeSpecAzureFileShareName = "spec.source.inlineVolumeSpec.azureFile.shareName" + VolumeAttachmentSpecSourceInlineVolumeSpecCapacity = "spec.source.inlineVolumeSpec.capacity" + VolumeAttachmentSpecSourceInlineVolumeSpecCephfs = "spec.source.inlineVolumeSpec.cephfs" + VolumeAttachmentSpecSourceInlineVolumeSpecCephfsMonitors = "spec.source.inlineVolumeSpec.cephfs.monitors" + VolumeAttachmentSpecSourceInlineVolumeSpecCephfsPath = "spec.source.inlineVolumeSpec.cephfs.path" + VolumeAttachmentSpecSourceInlineVolumeSpecCephfsReadOnly = "spec.source.inlineVolumeSpec.cephfs.readOnly" + VolumeAttachmentSpecSourceInlineVolumeSpecCephfsSecretFile = "spec.source.inlineVolumeSpec.cephfs.secretFile" + VolumeAttachmentSpecSourceInlineVolumeSpecCephfsSecretRef = "spec.source.inlineVolumeSpec.cephfs.secretRef" + VolumeAttachmentSpecSourceInlineVolumeSpecCephfsSecretRefName = "spec.source.inlineVolumeSpec.cephfs.secretRef.name" + VolumeAttachmentSpecSourceInlineVolumeSpecCephfsSecretRefNamespace = "spec.source.inlineVolumeSpec.cephfs.secretRef.namespace" + VolumeAttachmentSpecSourceInlineVolumeSpecCephfsUser = "spec.source.inlineVolumeSpec.cephfs.user" + VolumeAttachmentSpecSourceInlineVolumeSpecCinder = "spec.source.inlineVolumeSpec.cinder" + VolumeAttachmentSpecSourceInlineVolumeSpecCinderFsType = "spec.source.inlineVolumeSpec.cinder.fsType" + VolumeAttachmentSpecSourceInlineVolumeSpecCinderReadOnly = "spec.source.inlineVolumeSpec.cinder.readOnly" + VolumeAttachmentSpecSourceInlineVolumeSpecCinderSecretRef = "spec.source.inlineVolumeSpec.cinder.secretRef" + VolumeAttachmentSpecSourceInlineVolumeSpecCinderSecretRefName = "spec.source.inlineVolumeSpec.cinder.secretRef.name" + VolumeAttachmentSpecSourceInlineVolumeSpecCinderSecretRefNamespace = "spec.source.inlineVolumeSpec.cinder.secretRef.namespace" + VolumeAttachmentSpecSourceInlineVolumeSpecCinderVolumeID = "spec.source.inlineVolumeSpec.cinder.volumeID" + VolumeAttachmentSpecSourceInlineVolumeSpecClaimRef = "spec.source.inlineVolumeSpec.claimRef" + VolumeAttachmentSpecSourceInlineVolumeSpecClaimRefApiVersion = "spec.source.inlineVolumeSpec.claimRef.apiVersion" + VolumeAttachmentSpecSourceInlineVolumeSpecClaimRefFieldPath = "spec.source.inlineVolumeSpec.claimRef.fieldPath" + VolumeAttachmentSpecSourceInlineVolumeSpecClaimRefKind = "spec.source.inlineVolumeSpec.claimRef.kind" + VolumeAttachmentSpecSourceInlineVolumeSpecClaimRefName = "spec.source.inlineVolumeSpec.claimRef.name" + VolumeAttachmentSpecSourceInlineVolumeSpecClaimRefNamespace = "spec.source.inlineVolumeSpec.claimRef.namespace" + VolumeAttachmentSpecSourceInlineVolumeSpecClaimRefResourceVersion = "spec.source.inlineVolumeSpec.claimRef.resourceVersion" + VolumeAttachmentSpecSourceInlineVolumeSpecClaimRefUid = "spec.source.inlineVolumeSpec.claimRef.uid" + VolumeAttachmentSpecSourceInlineVolumeSpecCsi = "spec.source.inlineVolumeSpec.csi" + VolumeAttachmentSpecSourceInlineVolumeSpecCsiControllerExpandSecretRef = "spec.source.inlineVolumeSpec.csi.controllerExpandSecretRef" + VolumeAttachmentSpecSourceInlineVolumeSpecCsiControllerExpandSecretRefName = "spec.source.inlineVolumeSpec.csi.controllerExpandSecretRef.name" + VolumeAttachmentSpecSourceInlineVolumeSpecCsiControllerExpandSecretRefNamespace = "spec.source.inlineVolumeSpec.csi.controllerExpandSecretRef.namespace" + VolumeAttachmentSpecSourceInlineVolumeSpecCsiControllerPublishSecretRef = "spec.source.inlineVolumeSpec.csi.controllerPublishSecretRef" + VolumeAttachmentSpecSourceInlineVolumeSpecCsiControllerPublishSecretRefName = "spec.source.inlineVolumeSpec.csi.controllerPublishSecretRef.name" + VolumeAttachmentSpecSourceInlineVolumeSpecCsiControllerPublishSecretRefNamespace = "spec.source.inlineVolumeSpec.csi.controllerPublishSecretRef.namespace" + VolumeAttachmentSpecSourceInlineVolumeSpecCsiDriver = "spec.source.inlineVolumeSpec.csi.driver" + VolumeAttachmentSpecSourceInlineVolumeSpecCsiFsType = "spec.source.inlineVolumeSpec.csi.fsType" + VolumeAttachmentSpecSourceInlineVolumeSpecCsiNodeExpandSecretRef = "spec.source.inlineVolumeSpec.csi.nodeExpandSecretRef" + VolumeAttachmentSpecSourceInlineVolumeSpecCsiNodeExpandSecretRefName = "spec.source.inlineVolumeSpec.csi.nodeExpandSecretRef.name" + VolumeAttachmentSpecSourceInlineVolumeSpecCsiNodeExpandSecretRefNamespace = "spec.source.inlineVolumeSpec.csi.nodeExpandSecretRef.namespace" + VolumeAttachmentSpecSourceInlineVolumeSpecCsiNodePublishSecretRef = "spec.source.inlineVolumeSpec.csi.nodePublishSecretRef" + VolumeAttachmentSpecSourceInlineVolumeSpecCsiNodePublishSecretRefName = "spec.source.inlineVolumeSpec.csi.nodePublishSecretRef.name" + VolumeAttachmentSpecSourceInlineVolumeSpecCsiNodePublishSecretRefNamespace = "spec.source.inlineVolumeSpec.csi.nodePublishSecretRef.namespace" + VolumeAttachmentSpecSourceInlineVolumeSpecCsiNodeStageSecretRef = "spec.source.inlineVolumeSpec.csi.nodeStageSecretRef" + VolumeAttachmentSpecSourceInlineVolumeSpecCsiNodeStageSecretRefName = "spec.source.inlineVolumeSpec.csi.nodeStageSecretRef.name" + VolumeAttachmentSpecSourceInlineVolumeSpecCsiNodeStageSecretRefNamespace = "spec.source.inlineVolumeSpec.csi.nodeStageSecretRef.namespace" + VolumeAttachmentSpecSourceInlineVolumeSpecCsiReadOnly = "spec.source.inlineVolumeSpec.csi.readOnly" + VolumeAttachmentSpecSourceInlineVolumeSpecCsiVolumeAttributes = "spec.source.inlineVolumeSpec.csi.volumeAttributes" + VolumeAttachmentSpecSourceInlineVolumeSpecCsiVolumeHandle = "spec.source.inlineVolumeSpec.csi.volumeHandle" + VolumeAttachmentSpecSourceInlineVolumeSpecFc = "spec.source.inlineVolumeSpec.fc" + VolumeAttachmentSpecSourceInlineVolumeSpecFcFsType = "spec.source.inlineVolumeSpec.fc.fsType" + VolumeAttachmentSpecSourceInlineVolumeSpecFcLun = "spec.source.inlineVolumeSpec.fc.lun" + VolumeAttachmentSpecSourceInlineVolumeSpecFcReadOnly = "spec.source.inlineVolumeSpec.fc.readOnly" + VolumeAttachmentSpecSourceInlineVolumeSpecFcTargetWWNs = "spec.source.inlineVolumeSpec.fc.targetWWNs" + VolumeAttachmentSpecSourceInlineVolumeSpecFcWwids = "spec.source.inlineVolumeSpec.fc.wwids" + VolumeAttachmentSpecSourceInlineVolumeSpecFlexVolume = "spec.source.inlineVolumeSpec.flexVolume" + VolumeAttachmentSpecSourceInlineVolumeSpecFlexVolumeDriver = "spec.source.inlineVolumeSpec.flexVolume.driver" + VolumeAttachmentSpecSourceInlineVolumeSpecFlexVolumeFsType = "spec.source.inlineVolumeSpec.flexVolume.fsType" + VolumeAttachmentSpecSourceInlineVolumeSpecFlexVolumeOptions = "spec.source.inlineVolumeSpec.flexVolume.options" + VolumeAttachmentSpecSourceInlineVolumeSpecFlexVolumeReadOnly = "spec.source.inlineVolumeSpec.flexVolume.readOnly" + VolumeAttachmentSpecSourceInlineVolumeSpecFlexVolumeSecretRef = "spec.source.inlineVolumeSpec.flexVolume.secretRef" + VolumeAttachmentSpecSourceInlineVolumeSpecFlexVolumeSecretRefName = "spec.source.inlineVolumeSpec.flexVolume.secretRef.name" + VolumeAttachmentSpecSourceInlineVolumeSpecFlexVolumeSecretRefNamespace = "spec.source.inlineVolumeSpec.flexVolume.secretRef.namespace" + VolumeAttachmentSpecSourceInlineVolumeSpecFlocker = "spec.source.inlineVolumeSpec.flocker" + VolumeAttachmentSpecSourceInlineVolumeSpecFlockerDatasetName = "spec.source.inlineVolumeSpec.flocker.datasetName" + VolumeAttachmentSpecSourceInlineVolumeSpecFlockerDatasetUUID = "spec.source.inlineVolumeSpec.flocker.datasetUUID" + VolumeAttachmentSpecSourceInlineVolumeSpecGcePersistentDisk = "spec.source.inlineVolumeSpec.gcePersistentDisk" + VolumeAttachmentSpecSourceInlineVolumeSpecGcePersistentDiskFsType = "spec.source.inlineVolumeSpec.gcePersistentDisk.fsType" + VolumeAttachmentSpecSourceInlineVolumeSpecGcePersistentDiskPartition = "spec.source.inlineVolumeSpec.gcePersistentDisk.partition" + VolumeAttachmentSpecSourceInlineVolumeSpecGcePersistentDiskPdName = "spec.source.inlineVolumeSpec.gcePersistentDisk.pdName" + VolumeAttachmentSpecSourceInlineVolumeSpecGcePersistentDiskReadOnly = "spec.source.inlineVolumeSpec.gcePersistentDisk.readOnly" + VolumeAttachmentSpecSourceInlineVolumeSpecGlusterfs = "spec.source.inlineVolumeSpec.glusterfs" + VolumeAttachmentSpecSourceInlineVolumeSpecGlusterfsEndpoints = "spec.source.inlineVolumeSpec.glusterfs.endpoints" + VolumeAttachmentSpecSourceInlineVolumeSpecGlusterfsEndpointsNamespace = "spec.source.inlineVolumeSpec.glusterfs.endpointsNamespace" + VolumeAttachmentSpecSourceInlineVolumeSpecGlusterfsPath = "spec.source.inlineVolumeSpec.glusterfs.path" + VolumeAttachmentSpecSourceInlineVolumeSpecGlusterfsReadOnly = "spec.source.inlineVolumeSpec.glusterfs.readOnly" + VolumeAttachmentSpecSourceInlineVolumeSpecHostPath = "spec.source.inlineVolumeSpec.hostPath" + VolumeAttachmentSpecSourceInlineVolumeSpecHostPathPath = "spec.source.inlineVolumeSpec.hostPath.path" + VolumeAttachmentSpecSourceInlineVolumeSpecHostPathType = "spec.source.inlineVolumeSpec.hostPath.type" + VolumeAttachmentSpecSourceInlineVolumeSpecIscsi = "spec.source.inlineVolumeSpec.iscsi" + VolumeAttachmentSpecSourceInlineVolumeSpecIscsiChapAuthDiscovery = "spec.source.inlineVolumeSpec.iscsi.chapAuthDiscovery" + VolumeAttachmentSpecSourceInlineVolumeSpecIscsiChapAuthSession = "spec.source.inlineVolumeSpec.iscsi.chapAuthSession" + VolumeAttachmentSpecSourceInlineVolumeSpecIscsiFsType = "spec.source.inlineVolumeSpec.iscsi.fsType" + VolumeAttachmentSpecSourceInlineVolumeSpecIscsiInitiatorName = "spec.source.inlineVolumeSpec.iscsi.initiatorName" + VolumeAttachmentSpecSourceInlineVolumeSpecIscsiIqn = "spec.source.inlineVolumeSpec.iscsi.iqn" + VolumeAttachmentSpecSourceInlineVolumeSpecIscsiIscsiInterface = "spec.source.inlineVolumeSpec.iscsi.iscsiInterface" + VolumeAttachmentSpecSourceInlineVolumeSpecIscsiLun = "spec.source.inlineVolumeSpec.iscsi.lun" + VolumeAttachmentSpecSourceInlineVolumeSpecIscsiPortals = "spec.source.inlineVolumeSpec.iscsi.portals" + VolumeAttachmentSpecSourceInlineVolumeSpecIscsiReadOnly = "spec.source.inlineVolumeSpec.iscsi.readOnly" + VolumeAttachmentSpecSourceInlineVolumeSpecIscsiSecretRef = "spec.source.inlineVolumeSpec.iscsi.secretRef" + VolumeAttachmentSpecSourceInlineVolumeSpecIscsiSecretRefName = "spec.source.inlineVolumeSpec.iscsi.secretRef.name" + VolumeAttachmentSpecSourceInlineVolumeSpecIscsiSecretRefNamespace = "spec.source.inlineVolumeSpec.iscsi.secretRef.namespace" + VolumeAttachmentSpecSourceInlineVolumeSpecIscsiTargetPortal = "spec.source.inlineVolumeSpec.iscsi.targetPortal" + VolumeAttachmentSpecSourceInlineVolumeSpecLocal = "spec.source.inlineVolumeSpec.local" + VolumeAttachmentSpecSourceInlineVolumeSpecLocalFsType = "spec.source.inlineVolumeSpec.local.fsType" + VolumeAttachmentSpecSourceInlineVolumeSpecLocalPath = "spec.source.inlineVolumeSpec.local.path" + VolumeAttachmentSpecSourceInlineVolumeSpecMountOptions = "spec.source.inlineVolumeSpec.mountOptions" + VolumeAttachmentSpecSourceInlineVolumeSpecNfs = "spec.source.inlineVolumeSpec.nfs" + VolumeAttachmentSpecSourceInlineVolumeSpecNfsPath = "spec.source.inlineVolumeSpec.nfs.path" + VolumeAttachmentSpecSourceInlineVolumeSpecNfsReadOnly = "spec.source.inlineVolumeSpec.nfs.readOnly" + VolumeAttachmentSpecSourceInlineVolumeSpecNfsServer = "spec.source.inlineVolumeSpec.nfs.server" + VolumeAttachmentSpecSourceInlineVolumeSpecNodeAffinity = "spec.source.inlineVolumeSpec.nodeAffinity" + VolumeAttachmentSpecSourceInlineVolumeSpecNodeAffinityRequired = "spec.source.inlineVolumeSpec.nodeAffinity.required" + VolumeAttachmentSpecSourceInlineVolumeSpecNodeAffinityRequiredNodeSelectorTerms = "spec.source.inlineVolumeSpec.nodeAffinity.required.nodeSelectorTerms" + VolumeAttachmentSpecSourceInlineVolumeSpecPersistentVolumeReclaimPolicy = "spec.source.inlineVolumeSpec.persistentVolumeReclaimPolicy" + VolumeAttachmentSpecSourceInlineVolumeSpecPhotonPersistentDisk = "spec.source.inlineVolumeSpec.photonPersistentDisk" + VolumeAttachmentSpecSourceInlineVolumeSpecPhotonPersistentDiskFsType = "spec.source.inlineVolumeSpec.photonPersistentDisk.fsType" + VolumeAttachmentSpecSourceInlineVolumeSpecPhotonPersistentDiskPdID = "spec.source.inlineVolumeSpec.photonPersistentDisk.pdID" + VolumeAttachmentSpecSourceInlineVolumeSpecPortworxVolume = "spec.source.inlineVolumeSpec.portworxVolume" + VolumeAttachmentSpecSourceInlineVolumeSpecPortworxVolumeFsType = "spec.source.inlineVolumeSpec.portworxVolume.fsType" + VolumeAttachmentSpecSourceInlineVolumeSpecPortworxVolumeReadOnly = "spec.source.inlineVolumeSpec.portworxVolume.readOnly" + VolumeAttachmentSpecSourceInlineVolumeSpecPortworxVolumeVolumeID = "spec.source.inlineVolumeSpec.portworxVolume.volumeID" + VolumeAttachmentSpecSourceInlineVolumeSpecQuobyte = "spec.source.inlineVolumeSpec.quobyte" + VolumeAttachmentSpecSourceInlineVolumeSpecQuobyteGroup = "spec.source.inlineVolumeSpec.quobyte.group" + VolumeAttachmentSpecSourceInlineVolumeSpecQuobyteReadOnly = "spec.source.inlineVolumeSpec.quobyte.readOnly" + VolumeAttachmentSpecSourceInlineVolumeSpecQuobyteRegistry = "spec.source.inlineVolumeSpec.quobyte.registry" + VolumeAttachmentSpecSourceInlineVolumeSpecQuobyteTenant = "spec.source.inlineVolumeSpec.quobyte.tenant" + VolumeAttachmentSpecSourceInlineVolumeSpecQuobyteUser = "spec.source.inlineVolumeSpec.quobyte.user" + VolumeAttachmentSpecSourceInlineVolumeSpecQuobyteVolume = "spec.source.inlineVolumeSpec.quobyte.volume" + VolumeAttachmentSpecSourceInlineVolumeSpecRbd = "spec.source.inlineVolumeSpec.rbd" + VolumeAttachmentSpecSourceInlineVolumeSpecRbdFsType = "spec.source.inlineVolumeSpec.rbd.fsType" + VolumeAttachmentSpecSourceInlineVolumeSpecRbdImage = "spec.source.inlineVolumeSpec.rbd.image" + VolumeAttachmentSpecSourceInlineVolumeSpecRbdKeyring = "spec.source.inlineVolumeSpec.rbd.keyring" + VolumeAttachmentSpecSourceInlineVolumeSpecRbdMonitors = "spec.source.inlineVolumeSpec.rbd.monitors" + VolumeAttachmentSpecSourceInlineVolumeSpecRbdPool = "spec.source.inlineVolumeSpec.rbd.pool" + VolumeAttachmentSpecSourceInlineVolumeSpecRbdReadOnly = "spec.source.inlineVolumeSpec.rbd.readOnly" + VolumeAttachmentSpecSourceInlineVolumeSpecRbdSecretRef = "spec.source.inlineVolumeSpec.rbd.secretRef" + VolumeAttachmentSpecSourceInlineVolumeSpecRbdSecretRefName = "spec.source.inlineVolumeSpec.rbd.secretRef.name" + VolumeAttachmentSpecSourceInlineVolumeSpecRbdSecretRefNamespace = "spec.source.inlineVolumeSpec.rbd.secretRef.namespace" + VolumeAttachmentSpecSourceInlineVolumeSpecRbdUser = "spec.source.inlineVolumeSpec.rbd.user" + VolumeAttachmentSpecSourceInlineVolumeSpecScaleIO = "spec.source.inlineVolumeSpec.scaleIO" + VolumeAttachmentSpecSourceInlineVolumeSpecScaleIOFsType = "spec.source.inlineVolumeSpec.scaleIO.fsType" + VolumeAttachmentSpecSourceInlineVolumeSpecScaleIOGateway = "spec.source.inlineVolumeSpec.scaleIO.gateway" + VolumeAttachmentSpecSourceInlineVolumeSpecScaleIOProtectionDomain = "spec.source.inlineVolumeSpec.scaleIO.protectionDomain" + VolumeAttachmentSpecSourceInlineVolumeSpecScaleIOReadOnly = "spec.source.inlineVolumeSpec.scaleIO.readOnly" + VolumeAttachmentSpecSourceInlineVolumeSpecScaleIOSecretRef = "spec.source.inlineVolumeSpec.scaleIO.secretRef" + VolumeAttachmentSpecSourceInlineVolumeSpecScaleIOSecretRefName = "spec.source.inlineVolumeSpec.scaleIO.secretRef.name" + VolumeAttachmentSpecSourceInlineVolumeSpecScaleIOSecretRefNamespace = "spec.source.inlineVolumeSpec.scaleIO.secretRef.namespace" + VolumeAttachmentSpecSourceInlineVolumeSpecScaleIOSslEnabled = "spec.source.inlineVolumeSpec.scaleIO.sslEnabled" + VolumeAttachmentSpecSourceInlineVolumeSpecScaleIOStorageMode = "spec.source.inlineVolumeSpec.scaleIO.storageMode" + VolumeAttachmentSpecSourceInlineVolumeSpecScaleIOStoragePool = "spec.source.inlineVolumeSpec.scaleIO.storagePool" + VolumeAttachmentSpecSourceInlineVolumeSpecScaleIOSystem = "spec.source.inlineVolumeSpec.scaleIO.system" + VolumeAttachmentSpecSourceInlineVolumeSpecScaleIOVolumeName = "spec.source.inlineVolumeSpec.scaleIO.volumeName" + VolumeAttachmentSpecSourceInlineVolumeSpecStorageClassName = "spec.source.inlineVolumeSpec.storageClassName" + VolumeAttachmentSpecSourceInlineVolumeSpecStorageos = "spec.source.inlineVolumeSpec.storageos" + VolumeAttachmentSpecSourceInlineVolumeSpecStorageosFsType = "spec.source.inlineVolumeSpec.storageos.fsType" + VolumeAttachmentSpecSourceInlineVolumeSpecStorageosReadOnly = "spec.source.inlineVolumeSpec.storageos.readOnly" + VolumeAttachmentSpecSourceInlineVolumeSpecStorageosSecretRef = "spec.source.inlineVolumeSpec.storageos.secretRef" + VolumeAttachmentSpecSourceInlineVolumeSpecStorageosSecretRefApiVersion = "spec.source.inlineVolumeSpec.storageos.secretRef.apiVersion" + VolumeAttachmentSpecSourceInlineVolumeSpecStorageosSecretRefFieldPath = "spec.source.inlineVolumeSpec.storageos.secretRef.fieldPath" + VolumeAttachmentSpecSourceInlineVolumeSpecStorageosSecretRefKind = "spec.source.inlineVolumeSpec.storageos.secretRef.kind" + VolumeAttachmentSpecSourceInlineVolumeSpecStorageosSecretRefName = "spec.source.inlineVolumeSpec.storageos.secretRef.name" + VolumeAttachmentSpecSourceInlineVolumeSpecStorageosSecretRefNamespace = "spec.source.inlineVolumeSpec.storageos.secretRef.namespace" + VolumeAttachmentSpecSourceInlineVolumeSpecStorageosSecretRefResourceVersion = "spec.source.inlineVolumeSpec.storageos.secretRef.resourceVersion" + VolumeAttachmentSpecSourceInlineVolumeSpecStorageosSecretRefUid = "spec.source.inlineVolumeSpec.storageos.secretRef.uid" + VolumeAttachmentSpecSourceInlineVolumeSpecStorageosVolumeName = "spec.source.inlineVolumeSpec.storageos.volumeName" + VolumeAttachmentSpecSourceInlineVolumeSpecStorageosVolumeNamespace = "spec.source.inlineVolumeSpec.storageos.volumeNamespace" + VolumeAttachmentSpecSourceInlineVolumeSpecVolumeMode = "spec.source.inlineVolumeSpec.volumeMode" + VolumeAttachmentSpecSourceInlineVolumeSpecVsphereVolume = "spec.source.inlineVolumeSpec.vsphereVolume" + VolumeAttachmentSpecSourceInlineVolumeSpecVsphereVolumeFsType = "spec.source.inlineVolumeSpec.vsphereVolume.fsType" + VolumeAttachmentSpecSourceInlineVolumeSpecVsphereVolumeStoragePolicyID = "spec.source.inlineVolumeSpec.vsphereVolume.storagePolicyID" + VolumeAttachmentSpecSourceInlineVolumeSpecVsphereVolumeStoragePolicyName = "spec.source.inlineVolumeSpec.vsphereVolume.storagePolicyName" + VolumeAttachmentSpecSourceInlineVolumeSpecVsphereVolumeVolumePath = "spec.source.inlineVolumeSpec.vsphereVolume.volumePath" + VolumeAttachmentSpecSourcePersistentVolumeName = "spec.source.persistentVolumeName" +) + +// constant vars generated for struct +const ( + AccountName = "accountName" + ApiVersion = "apiVersion" + ClusterName = "clusterName" + CreatedBy = "createdBy" + CreatedByUserEmail = "createdBy.userEmail" + CreatedByUserId = "createdBy.userId" + CreatedByUserName = "createdBy.userName" + CreationTime = "creationTime" + DisplayName = "displayName" + Id = "id" + Kind = "kind" + LastUpdatedBy = "lastUpdatedBy" + LastUpdatedByUserEmail = "lastUpdatedBy.userEmail" + LastUpdatedByUserId = "lastUpdatedBy.userId" + LastUpdatedByUserName = "lastUpdatedBy.userName" + MarkedForDeletion = "markedForDeletion" + Metadata = "metadata" + MetadataAnnotations = "metadata.annotations" + MetadataCreationTimestamp = "metadata.creationTimestamp" + MetadataDeletionGracePeriodSeconds = "metadata.deletionGracePeriodSeconds" + MetadataDeletionTimestamp = "metadata.deletionTimestamp" + MetadataFinalizers = "metadata.finalizers" + MetadataGenerateName = "metadata.generateName" + MetadataGeneration = "metadata.generation" + MetadataLabels = "metadata.labels" + MetadataManagedFields = "metadata.managedFields" + MetadataName = "metadata.name" + MetadataNamespace = "metadata.namespace" + MetadataOwnerReferences = "metadata.ownerReferences" + MetadataResourceVersion = "metadata.resourceVersion" + MetadataSelfLink = "metadata.selfLink" + MetadataUid = "metadata.uid" + RecordVersion = "recordVersion" + Status = "status" + StatusAccessModes = "status.accessModes" + StatusAllocatedResourceStatuses = "status.allocatedResourceStatuses" + StatusAllocatedResources = "status.allocatedResources" + StatusAttachError = "status.attachError" + StatusAttachErrorMessage = "status.attachError.message" + StatusAttachErrorTime = "status.attachError.time" + StatusAttached = "status.attached" + StatusAttachmentMetadata = "status.attachmentMetadata" + StatusCapacity = "status.capacity" + StatusChecks = "status.checks" + StatusConditions = "status.conditions" + StatusDetachError = "status.detachError" + StatusDetachErrorMessage = "status.detachError.message" + StatusDetachErrorTime = "status.detachError.time" + StatusIsReady = "status.isReady" + StatusLastPhaseTransitionTime = "status.lastPhaseTransitionTime" + StatusLastReadyGeneration = "status.lastReadyGeneration" + StatusLastReconcileTime = "status.lastReconcileTime" + StatusMessage = "status.message" + StatusMessageItems = "status.message.items" + StatusPhase = "status.phase" + StatusReason = "status.reason" + StatusReleaseNotes = "status.releaseNotes" + StatusReleaseStatus = "status.releaseStatus" + StatusResources = "status.resources" + SyncStatus = "syncStatus" + SyncStatusAction = "syncStatus.action" + SyncStatusError = "syncStatus.error" + SyncStatusLastSyncedAt = "syncStatus.lastSyncedAt" + SyncStatusRecordVersion = "syncStatus.recordVersion" + SyncStatusState = "syncStatus.state" + SyncStatusSyncScheduledAt = "syncStatus.syncScheduledAt" + UpdateTime = "updateTime" +) diff --git a/apps/infra/internal/entities/helm-release.go b/apps/infra/internal/entities/helm-release.go new file mode 100644 index 000000000..3ecf052bf --- /dev/null +++ b/apps/infra/internal/entities/helm-release.go @@ -0,0 +1,46 @@ +package entities + +import ( + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + crdsv1 "github.com/kloudlite/operator/apis/crds/v1" + "github.com/kloudlite/operator/pkg/operator" +) + +type HelmRelease struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + crdsv1.HelmChart `json:",inline" graphql:"uri=k8s://helmcharts.crds.kloudlite.io"` + + common.ResourceMetadata `json:",inline"` + + AccountName string `json:"accountName" graphql:"noinput"` + ClusterName string `json:"clusterName" graphql:"noinput"` + + SyncStatus t.SyncStatus `json:"syncStatus" graphql:"noinput"` +} + +func (h *HelmRelease) GetDisplayName() string { + return h.DisplayName +} + +func (h *HelmRelease) GetStatus() operator.Status { + return h.Status.Status +} + +var HelmReleaseIndices = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: "id", Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: "metadata.name", Value: repos.IndexAsc}, + {Key: "accountName", Value: repos.IndexAsc}, + {Key: "clusterName", Value: repos.IndexAsc}, + }, + Unique: true, + }, +} diff --git a/apps/infra/internal/entities/msvc-template.go b/apps/infra/internal/entities/msvc-template.go new file mode 100644 index 000000000..f4e973865 --- /dev/null +++ b/apps/infra/internal/entities/msvc-template.go @@ -0,0 +1,52 @@ +package entities + +type InputField struct { + Name string `json:"name"` + Label string `json:"label"` + InputType string `json:"inputType"` + DefaultValue any `json:"defaultValue,omitempty"` + Min *float64 `json:"min,omitempty"` + Max *float64 `json:"max,omitempty"` + Required *bool `json:"required,omitempty"` + Unit *string `json:"unit,omitempty"` + DisplayUnit *string `json:"displayUnit,omitempty"` + Multiplier *float64 `json:"multiplier,omitempty"` +} + +type OutputField struct { + Name string `json:"name"` + Label string `json:"label"` + Description string `json:"description"` +} + +type MsvcTemplateEntry struct { + // TOOD (nxtcoder17): remove omitempty ASAP + ApiVersion string `json:"apiVersion,omitempty"` + Kind string `json:"kind,omitempty"` + Name string `json:"name"` + LogoUrl string `json:"logoUrl"` + DisplayName string `json:"displayName"` + Description string `json:"description"` + Active bool `json:"active"` + Fields []InputField `json:"fields"` + // InputMiddleware *string `json:"inputMiddleware"` + Outputs []OutputField `json:"outputs"` + Resources []MresTemplate `json:"resources"` +} + +type MresTemplate struct { + // TOOD (nxtcoder17): remove omitempty ASAP + ApiVersion string `json:"apiVersion,omitempty"` + Kind string `json:"kind,omitempty"` + Name string `json:"name"` + DisplayName string `json:"displayName"` + Description string `json:"description"` + Fields []InputField `json:"fields"` + Outputs []OutputField `json:"outputs"` +} + +type MsvcTemplate struct { + Category string `json:"category" graphql:"noinput"` + DisplayName string `json:"displayName" graphql:"noinput"` + Items []MsvcTemplateEntry `json:"items" graphql:"noinput"` +} diff --git a/apps/infra/internal/entities/namespaces.go b/apps/infra/internal/entities/namespaces.go new file mode 100644 index 000000000..9db22fd1b --- /dev/null +++ b/apps/infra/internal/entities/namespaces.go @@ -0,0 +1,45 @@ +package entities + +import ( + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/repos" + "github.com/kloudlite/api/pkg/types" + "github.com/kloudlite/operator/pkg/operator" + corev1 "k8s.io/api/core/v1" +) + +type Namespace struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + corev1.Namespace `json:",inline"` + + AccountName string `json:"accountName" graphql:"noinput"` + ClusterName string `json:"clusterName" graphql:"noinput"` + + common.ResourceMetadata `json:",inline" graphql:"noinput"` + SyncStatus types.SyncStatus `json:"syncStatus" graphql:"noinput"` +} + +func (n *Namespace) GetDisplayName() string { + return n.ResourceMetadata.DisplayName +} + +func (n *Namespace) GetStatus() operator.Status { + return operator.Status{} +} + +var NamespaceIndices = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: "id", Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: "metadata.name", Value: repos.IndexAsc}, + {Key: "accountName", Value: repos.IndexAsc}, + {Key: "clusterName", Value: repos.IndexAsc}, + }, + Unique: true, + }, +} diff --git a/apps/infra/internal/entities/node.go b/apps/infra/internal/entities/node.go new file mode 100644 index 000000000..c95549d08 --- /dev/null +++ b/apps/infra/internal/entities/node.go @@ -0,0 +1,32 @@ +package entities + +import ( + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + clustersv1 "github.com/kloudlite/operator/apis/clusters/v1" +) + +type Node struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + clustersv1.Node `json:",inline" graphql:"uri=k8s://nodes.clusters.kloudlite.io"` + AccountName string `json:"accountName" graphql:"noinput"` + ClusterName string `json:"clusterName" graphql:"noinput"` + SyncStatus t.SyncStatus `json:"syncStatus" graphql:"noinput"` +} + +var NodeIndices = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: "id", Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: "metadata.name", Value: repos.IndexAsc}, + {Key: "accountName", Value: repos.IndexAsc}, + {Key: "clusterName", Value: repos.IndexAsc}, + }, + Unique: true, + }, +} diff --git a/apps/infra/internal/entities/nodepool.go b/apps/infra/internal/entities/nodepool.go new file mode 100644 index 000000000..aab9c8100 --- /dev/null +++ b/apps/infra/internal/entities/nodepool.go @@ -0,0 +1,51 @@ +package entities + +import ( + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + clustersv1 "github.com/kloudlite/operator/apis/clusters/v1" + "github.com/kloudlite/operator/pkg/operator" +) + +type NodePool struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + clustersv1.NodePool `json:",inline" graphql:"uri=k8s://nodepools.clusters.kloudlite.io"` + + common.ResourceMetadata `json:",inline"` + + AccountName string `json:"accountName" graphql:"noinput"` + ClusterName string `json:"clusterName" graphql:"noinput"` + + SyncStatus t.SyncStatus `json:"syncStatus" graphql:"noinput"` +} + +func (n *NodePool) GetDisplayName() string { + return n.ResourceMetadata.DisplayName +} + +func (n *NodePool) GetStatus() operator.Status { + return n.NodePool.Status +} + +var NodePoolIndices = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: "id", Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: "metadata.name", Value: repos.IndexAsc}, + {Key: "accountName", Value: repos.IndexAsc}, + {Key: "clusterName", Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: "metadata.name", Value: repos.IndexAsc}, + }, + }, +} diff --git a/apps/infra/internal/entities/provider-secret.go b/apps/infra/internal/entities/provider-secret.go new file mode 100644 index 000000000..eefcece0a --- /dev/null +++ b/apps/infra/internal/entities/provider-secret.go @@ -0,0 +1,145 @@ +package entities + +import ( + "fmt" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/operator/pkg/operator" + + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/repos" + ct "github.com/kloudlite/operator/apis/common-types" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +const ( + AccessKey string = "accessKey" + SecretKey string = "secretKey" + + AWSAccountId string = "awsAccountId" + AWSAssumeRoleExternalId string = "awsAssumeRoleExternalId" + AWAssumeRoleRoleARN string = "awsAssumeRoleRoleARN" + AWSInstanceProfileName string = "awsInstanceProfileName" +) + +type AWSSecretCredentials struct { + AccessKey *string `json:"accessKey,omitempty"` + SecretKey *string `json:"secretKey,omitempty"` + + AWSAccountId *string `json:"awsAccountId,omitempty"` + CfParamStackName string `json:"cfParamStackName,omitempty" graphql:"noinput"` + CfParamRoleName string `json:"cfParamRoleName,omitempty" graphql:"noinput"` + CfParamInstanceProfileName string `json:"cfParamInstanceProfileName,omitempty" graphql:"noinput"` + CfParamTrustedARN string `json:"cfParamTrustedARN,omitempty" graphql:"noinput"` + CfParamExternalID string `json:"cfParamExternalID,omitempty" graphql:"noinput"` +} + +func (asc *AWSSecretCredentials) GetAssumeRoleRoleARN() string { + return fmt.Sprintf("arn:aws:iam::%s:role/%s", *asc.AWSAccountId, asc.CfParamRoleName) +} + +func (asc *AWSSecretCredentials) IsAssumeRoleConfiguration() bool { + return asc.AccessKey == nil || asc.SecretKey == nil +} + +func (asc *AWSSecretCredentials) Validate() error { + if asc == nil { + return errors.Newf("aws secret credentials, is nil") + } + + if asc.AccessKey != nil || asc.SecretKey != nil { + return nil + } + + if asc.AWSAccountId == nil { + return errors.Newf("awsAccountId, must be provided") + } + + if asc.CfParamStackName == "" { + return errors.Newf("cfParamStackName, must be provided") + } + if asc.CfParamExternalID == "" { + return errors.Newf("cfParamExternalID, must be provided") + } + if asc.CfParamRoleName == "" { + return errors.Newf("cfParamRoleName, must be provided") + } + if asc.CfParamTrustedARN == "" { + return errors.Newf("cfParamTrustedARN, must be provided") + } + if asc.CfParamInstanceProfileName == "" { + return errors.Newf("cfParamInstanceProfileName, must be provided") + } + + return nil +} + +type CloudProviderSecret struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + // corev1.Secret `json:",inline" graphql:"uri=k8s://secrets.crds.kloudlite.io"` + metav1.ObjectMeta `json:"metadata"` + CloudProviderName ct.CloudProvider `json:"cloudProviderName"` + + common.ResourceMetadata `json:",inline"` + AWS *AWSSecretCredentials `json:"aws,omitempty"` + + AccountName string `json:"accountName" graphql:"noinput"` +} + +func (cps *CloudProviderSecret) GetDisplayName() string { + return cps.ResourceMetadata.DisplayName +} + +func (cps *CloudProviderSecret) GetStatus() operator.Status { + return operator.Status{} +} + +var CloudProviderSecretIndices = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: "id", Value: repos.IndexAsc}, + }, + Unique: true, + }, + + { + Field: []repos.IndexKey{ + {Key: "metadata.name", Value: repos.IndexAsc}, + {Key: "metadata.namespace", Value: repos.IndexAsc}, + }, + Unique: true, + }, + + { + Field: []repos.IndexKey{ + {Key: "metadata.name", Value: repos.IndexAsc}, + {Key: "accountName", Value: repos.IndexAsc}, + }, + Unique: true, + }, +} + +func (cps *CloudProviderSecret) Validate() error { + if cps == nil { + return errors.Newf("cloud provider secret is nil") + } + + switch cps.CloudProviderName { + case ct.CloudProviderAWS: + { + if cps.AWS == nil { + return errors.Newf(".aws is nil, must be provided when cloudproviderName is set to aws") + } + if cps.AWS.AWSAccountId == nil && (cps.AWS.AccessKey == nil || cps.AWS.SecretKey == nil) { + return errors.Newf("neither .aws.%s nor (.aws.%s and .aws.%s) is provided", AWSAccountId, AccessKey, SecretKey) + } + } + default: + { + // if cps.StringData[AccessKey] == "" || cps.StringData[SecretKey] == "" { + // return false, errors.Newf(".stringData.accessKey or .stringData.accessSecret is empty") + // } + } + } + + return nil +} diff --git a/apps/infra/internal/entities/pv.go b/apps/infra/internal/entities/pv.go new file mode 100644 index 000000000..5bfc6ec0d --- /dev/null +++ b/apps/infra/internal/entities/pv.go @@ -0,0 +1,36 @@ +package entities + +import ( + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/repos" + "github.com/kloudlite/api/pkg/types" + corev1 "k8s.io/api/core/v1" +) + +type PersistentVolume struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + corev1.PersistentVolume `json:",inline"` + + AccountName string `json:"accountName" graphql:"noinput"` + ClusterName string `json:"clusterName" graphql:"noinput"` + + common.ResourceMetadata `json:",inline" graphql:"noinput"` + SyncStatus types.SyncStatus `json:"syncStatus" graphql:"noinput"` +} + +var PersistentVolumeIndices = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: "id", Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: "metadata.name", Value: repos.IndexAsc}, + {Key: "accountName", Value: repos.IndexAsc}, + {Key: "clusterName", Value: repos.IndexAsc}, + }, + Unique: true, + }, +} diff --git a/apps/infra/internal/entities/pvc.go b/apps/infra/internal/entities/pvc.go new file mode 100644 index 000000000..c9f46fe29 --- /dev/null +++ b/apps/infra/internal/entities/pvc.go @@ -0,0 +1,46 @@ +package entities + +import ( + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/repos" + "github.com/kloudlite/api/pkg/types" + "github.com/kloudlite/operator/pkg/operator" + corev1 "k8s.io/api/core/v1" +) + +type PersistentVolumeClaim struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + corev1.PersistentVolumeClaim `json:",inline" graphql:"noinput"` + + AccountName string `json:"accountName" graphql:"noinput"` + ClusterName string `json:"clusterName" graphql:"noinput"` + + common.ResourceMetadata `json:",inline" graphql:"noinput"` + SyncStatus types.SyncStatus `json:"syncStatus" graphql:"noinput"` +} + +func (p *PersistentVolumeClaim) GetDisplayName() string { + return p.ResourceMetadata.DisplayName +} + +func (p *PersistentVolumeClaim) GetStatus() operator.Status { + return operator.Status{} +} + +var PersistentVolumeClaimIndices = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: "id", Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: "metadata.name", Value: repos.IndexAsc}, + {Key: "metadata.namespace", Value: repos.IndexAsc}, + {Key: "accountName", Value: repos.IndexAsc}, + {Key: "clusterName", Value: repos.IndexAsc}, + }, + Unique: true, + }, +} diff --git a/apps/infra/internal/entities/volumeattachment.go b/apps/infra/internal/entities/volumeattachment.go new file mode 100644 index 000000000..703461893 --- /dev/null +++ b/apps/infra/internal/entities/volumeattachment.go @@ -0,0 +1,45 @@ +package entities + +import ( + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/repos" + "github.com/kloudlite/api/pkg/types" + "github.com/kloudlite/operator/pkg/operator" + storagev1 "k8s.io/api/storage/v1" +) + +type VolumeAttachment struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + storagev1.VolumeAttachment `json:",inline"` + + AccountName string `json:"accountName" graphql:"noinput"` + ClusterName string `json:"clusterName" graphql:"noinput"` + + common.ResourceMetadata `json:",inline" graphql:"noinput"` + SyncStatus types.SyncStatus `json:"syncStatus" graphql:"noinput"` +} + +func (v *VolumeAttachment) GetDisplayName() string { + return v.ResourceMetadata.DisplayName +} + +func (v *VolumeAttachment) GetStatus() operator.Status { + return operator.Status{} +} + +var VolumeAttachmentIndices = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: "id", Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: "metadata.name", Value: repos.IndexAsc}, + {Key: "accountName", Value: repos.IndexAsc}, + {Key: "clusterName", Value: repos.IndexAsc}, + }, + Unique: true, + }, +} diff --git a/apps/infra/internal/env/env.go b/apps/infra/internal/env/env.go index 183fa5bf2..3256b1c75 100644 --- a/apps/infra/internal/env/env.go +++ b/apps/infra/internal/env/env.go @@ -1,28 +1,57 @@ package env +import ( + "github.com/codingconcepts/env" + "github.com/kloudlite/api/pkg/errors" +) + type Env struct { - InfraDbUri string `env:"INFRA_DB_URI" required:"true"` - InfraDbName string `env:"INFRA_DB_NAME" required:"true"` + InfraDbUri string `env:"MONGO_DB_URI" required:"true"` + InfraDbName string `env:"MONGO_DB_NAME" required:"true"` HttpPort uint16 `env:"HTTP_PORT" required:"true"` + GrpcPort uint16 `env:"GRPC_PORT" required:"true"` CookieDomain string `env:"COOKIE_DOMAIN" required:"true"` - FinanceGrpcAddr string `env:"FINANCE_GRPC_ADDR" required:"true"` + NatsURL string `env:"NATS_URL" required:"true"` + NatsStream string `env:"NATS_STREAM" required:"true"` - AuthRedisHosts string `env:"AUTH_REDIS_HOSTS" required:"true"` - AuthRedisUserName string `env:"AUTH_REDIS_USER_NAME" required:"true"` - AuthRedisPassword string `env:"AUTH_REDIS_PASSWORD" required:"true"` - AuthRedisPrefix string `env:"AUTH_REDIS_PREFIX" required:"true"` + AccountCookieName string `env:"ACCOUNT_COOKIE_NAME" required:"true"` + ProviderSecretNamespace string `env:"PROVIDER_SECRET_NAMESPACE" required:"true"` - KafkaBrokers string `env:"KAFKA_BROKERS" required:"true"` - KafkaUsername string `env:"KAFKA_USERNAME" required:"true"` - KafkaPassword string `env:"KAFKA_PASSWORD" required:"true"` - KafkaConsumerGroupId string `env:"KAFKA_CONSUMER_GROUP_ID" required:"true"` + IAMGrpcAddr string `env:"IAM_GRPC_ADDR" required:"true"` + AccountsGrpcAddr string `env:"ACCOUNTS_GRPC_ADDR" required:"true"` - KafkaTopicInfraUpdates string `env:"KAFKA_TOPIC_INFRA_UPDATES" required:"true"` - // KafkaTopicByocHelmUpdates string `env:"KAFKA_TOPIC_BYOC_HELM_UPDATES" required:"true"` - KafkaTopicByocClientUpdates string `env:"KAFKA_TOPIC_BYOC_CLIENT_UPDATES" required:"true"` + MessageOfficeInternalGrpcAddr string `env:"MESSAGE_OFFICE_INTERNAL_GRPC_ADDR" required:"true"` + MessageOfficeExternalGrpcAddr string `env:"MESSAGE_OFFICE_EXTERNAL_GRPC_ADDR" required:"true"` - AccountCookieName string `env:"ACCOUNT_COOKIE_NAME" required:"true"` - ProviderSecretNamespace string `env:"PROVIDER_SECRET_NAMESPACE" required:"true"` + AWSCfParamTrustedARN string `env:"AWS_CF_PARAM_TRUSTED_ARN" required:"true"` + AWSCfStackNamePrefix string `env:"AWS_CF_STACK_NAME_PREFIX" required:"true"` + AWSCfRoleNamePrefix string `env:"AWS_CF_ROLE_NAME_PREFIX" required:"true"` + AWSCfInstanceProfileNamePrefix string `env:"AWS_CF_INSTANCE_PROFILE_NAME_PREFIX" required:"true"` + AWSCfStackS3URL string `env:"AWS_CF_STACK_S3_URL" required:"true"` + + AWSAccessKey string `env:"AWS_ACCESS_KEY" required:"true"` + AWSSecretKey string `env:"AWS_SECRET_KEY" required:"true"` + + AWSAMI string `env:"AWS_AMI_ID" required:"true" default:"ami-0ec149e1e8b76e957"` + + PublicDNSHostSuffix string `env:"PUBLIC_DNS_HOST_SUFFIX" required:"true"` + SessionKVBucket string `env:"SESSION_KV_BUCKET" required:"true"` + IsDev bool + KubernetesApiProxy string `env:"KUBERNETES_API_PROXY"` + + MsvcTemplateFilePath string `env:"MSVC_TEMPLATE_FILE_PATH" required:"true"` + + DeviceNamespace string `env:"DEVICE_NAMESPACE" required:"true"` + + KloudliteRelease string `env:"KLOUDLITE_RELEASE" required:"true"` +} + +func LoadEnv() (*Env, error) { + var ev Env + if err := env.Set(&ev); err != nil { + return nil, errors.NewE(err) + } + return &ev, nil } diff --git a/apps/infra/internal/framework/framework.go b/apps/infra/internal/framework/framework.go index 1f1de8f0f..890301694 100644 --- a/apps/infra/internal/framework/framework.go +++ b/apps/infra/internal/framework/framework.go @@ -1,37 +1,27 @@ package framework import ( + "context" + "fmt" + + "github.com/kloudlite/api/apps/infra/internal/app" + "github.com/kloudlite/api/apps/infra/internal/env" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/grpc" + httpServer "github.com/kloudlite/api/pkg/http-server" + "github.com/kloudlite/api/pkg/kv" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/api/pkg/nats" + + mongoRepo "github.com/kloudlite/api/pkg/repos" "go.uber.org/fx" - "kloudlite.io/apps/infra/internal/app" - "kloudlite.io/apps/infra/internal/env" - "kloudlite.io/pkg/cache" - rpc "kloudlite.io/pkg/grpc" - httpServer "kloudlite.io/pkg/http-server" - "kloudlite.io/pkg/redpanda" - mongoRepo "kloudlite.io/pkg/repos" ) type framework struct { *env.Env } -func (f *framework) GetBrokers() (brokers string) { - return f.Env.KafkaBrokers -} - -func (f *framework) GetKafkaSASLAuth() *redpanda.KafkaSASLAuth { - return nil - // return &redpanda.KafkaSASLAuth{ - // SASLMechanism: redpanda.ScramSHA256, - // User: f.Env.KafkaUsername, - // Password: f.Env.KafkaPassword, - // } -} - -func (f *framework) GetGRPCServerURL() string { - return f.FinanceGrpcAddr -} - func (f *framework) GetHttpCors() string { return "https://studio.apollographql.com" } @@ -50,16 +40,86 @@ var Module = fx.Module("framework", }), mongoRepo.NewMongoClientFx[*framework](), - httpServer.NewHttpServerFx[*framework](), - redpanda.NewClientFx[*framework](), + fx.Provide(func(ev *env.Env, logger logging.Logger) (*nats.Client, error) { + return nats.NewClient(ev.NatsURL, nats.ClientOpts{ + Name: "infra", + Logger: logger, + }) + }), + + fx.Provide(func(c *nats.Client) (*nats.JetstreamClient, error) { + return nats.NewJetstreamClient(c) + }), fx.Provide( - func(f *framework) app.AuthCacheClient { - return cache.NewRedisClient(f.AuthRedisHosts, f.AuthRedisUserName, f.AuthRedisPassword, f.AuthRedisPrefix) + func(ev *env.Env, jc *nats.JetstreamClient) (kv.Repo[*common.AuthSession], error) { + cxt := context.TODO() + return kv.NewNatsKVRepo[*common.AuthSession](cxt, ev.SessionKVBucket, jc) }, ), - rpc.NewGrpcClientFx[*framework, app.FinanceClientConnection](), - cache.FxLifeCycle[app.AuthCacheClient](), + + fx.Provide(func(ev *env.Env) (app.IAMGrpcClient, error) { + return grpc.NewGrpcClient(ev.IAMGrpcAddr) + }), + + fx.Provide(func(ev *env.Env) (app.AccountGrpcClient, error) { + return grpc.NewGrpcClient(ev.AccountsGrpcAddr) + }), + + fx.Provide(func(ev *env.Env) (app.MessageOfficeInternalGrpcClient, error) { + return grpc.NewGrpcClient(ev.MessageOfficeInternalGrpcAddr) + }), + + fx.Invoke(func(lf fx.Lifecycle, c1 app.IAMGrpcClient) { + lf.Append(fx.Hook{ + OnStop: func(context.Context) error { + if err := c1.Close(); err != nil { + return errors.NewE(err) + } + return nil + }, + }) + }), + app.Module, + + fx.Provide(func(logr logging.Logger) (app.InfraGrpcServer, error) { + return grpc.NewGrpcServer(grpc.ServerOpts{ + Logger: logr, + }) + }), + + fx.Invoke(func(ev *env.Env, server app.InfraGrpcServer, lf fx.Lifecycle, logger logging.Logger) { + lf.Append(fx.Hook{ + OnStart: func(context.Context) error { + go func() { + if err := server.Listen(fmt.Sprintf(":%d", ev.GrpcPort)); err != nil { + logger.Errorf(err, "while starting grpc server") + } + }() + return nil + }, + OnStop: func(context.Context) error { + server.Stop() + return nil + }, + }) + }), + + fx.Provide(func(logger logging.Logger, e *env.Env) httpServer.Server { + corsOrigins := "https://studio.apollographql.com" + return httpServer.NewServer(httpServer.ServerArgs{Logger: logger, CorsAllowOrigins: &corsOrigins, IsDev: e.IsDev}) + }), + + fx.Invoke(func(lf fx.Lifecycle, server httpServer.Server, ev *env.Env) { + lf.Append(fx.Hook{ + OnStart: func(context.Context) error { + return server.Listen(fmt.Sprintf(":%d", ev.HttpPort)) + }, + OnStop: func(context.Context) error { + return server.Close() + }, + }) + }), ) diff --git a/apps/infra/main.go b/apps/infra/main.go index c77b0a327..e945dc663 100644 --- a/apps/infra/main.go +++ b/apps/infra/main.go @@ -3,25 +3,22 @@ package main import ( "context" "flag" - "fmt" - cmgrV1 "github.com/kloudlite/cluster-operator/apis/cmgr/v1" - infraV1 "github.com/kloudlite/cluster-operator/apis/infra/v1" - crdsv1 "github.com/kloudlite/operator/apis/crds/v1" - "github.com/kloudlite/operator/pkg/kubectl" - wgV1 "github.com/kloudlite/wg-operator/apis/wg/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/client-go/rest" - "kloudlite.io/pkg/config" - "kloudlite.io/pkg/k8s" - "sigs.k8s.io/controller-runtime/pkg/client" + "os" "time" - "go.uber.org/fx" - "kloudlite.io/apps/infra/internal/env" - "kloudlite.io/apps/infra/internal/framework" - fn "kloudlite.io/pkg/functions" - "kloudlite.io/pkg/logging" + "github.com/kloudlite/api/pkg/errors" + clustersv1 "github.com/kloudlite/operator/apis/clusters/v1" + + "github.com/kloudlite/api/apps/infra/internal/env" + "github.com/kloudlite/api/apps/infra/internal/framework" + "github.com/kloudlite/api/common" + "k8s.io/client-go/rest" + "github.com/kloudlite/api/pkg/k8s" + "github.com/kloudlite/api/pkg/logging" + crdsv1 "github.com/kloudlite/operator/apis/crds/v1" + "go.uber.org/fx" + "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" k8sScheme "k8s.io/client-go/kubernetes/scheme" ) @@ -31,76 +28,62 @@ func main() { flag.BoolVar(&isDev, "dev", false, "--dev") flag.Parse() + logger, err := logging.New(&logging.Options{Name: "infra", Dev: isDev}) + if err != nil { + panic(err) + } + app := fx.New( - // fx.NopLogger, - fx.Provide( - func() (logging.Logger, error) { - return logging.New(&logging.Options{Name: "infra", Dev: isDev}) - }, - ), + fx.NopLogger, + + fx.Provide(func() logging.Logger { + return logger + }), fx.Provide(func() (*env.Env, error) { - ev, err := config.LoadEnv[env.Env]()() + e, err := env.LoadEnv() if err != nil { - return nil, err + return nil, errors.NewE(err) } - return ev, nil + + e.IsDev = isDev + return e, nil }), - fx.Provide(func() (*rest.Config, error) { - if isDev { + fx.Provide(func(e *env.Env) (*rest.Config, error) { + if e.KubernetesApiProxy != "" { return &rest.Config{ - Host: "localhost:8080", + Host: e.KubernetesApiProxy, }, nil } return k8s.RestInclusterConfig() }), - fx.Provide(func(restCfg *rest.Config) (client.Client, error) { + fx.Provide(func(restCfg *rest.Config) (k8s.Client, error) { scheme := runtime.NewScheme() utilruntime.Must(k8sScheme.AddToScheme(scheme)) utilruntime.Must(crdsv1.AddToScheme(scheme)) - utilruntime.Must(infraV1.AddToScheme(scheme)) - utilruntime.Must(cmgrV1.AddToScheme(scheme)) - utilruntime.Must(wgV1.AddToScheme(scheme)) - - return client.New(restCfg, client.Options{ - Scheme: scheme, - Mapper: nil, - Opts: client.WarningHandlerOptions{ - SuppressWarnings: true, - }, - }) - }), - - fx.Provide(func(restCfg *rest.Config) (*kubectl.YAMLClient, error) { - return kubectl.NewYAMLClient(restCfg) - }), + utilruntime.Must(clustersv1.AddToScheme(scheme)) - fx.Provide(func(restCfg *rest.Config) (k8s.ExtendedK8sClient, error) { - return k8s.NewExtendedK8sClient(restCfg) + return k8s.NewClient(restCfg, scheme) }), - fn.FxErrorHandler(), framework.Module, ) - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) - + ctx, cancel := func() (context.Context, context.CancelFunc) { + if isDev { + return context.WithTimeout(context.TODO(), 10*time.Second) + } + return context.WithTimeout(context.Background(), 2*time.Second) + }() defer cancel() + if err := app.Start(ctx); err != nil { - panic(err) + logger.Errorf(err, "failed to start app") + os.Exit(1) } - fmt.Println( - ` -██████ ███████ █████ ██████ ██ ██ -██ ██ ██ ██ ██ ██ ██ ██ ██ -██████ █████ ███████ ██ ██ ████ -██ ██ ██ ██ ██ ██ ██ ██ -██ ██ ███████ ██ ██ ██████ ██ - `, - ) - + common.PrintReadyBanner() <-app.Done() } diff --git a/apps/js-eval/.env b/apps/js-eval/.env deleted file mode 100644 index 2fc80e3a4..000000000 --- a/apps/js-eval/.env +++ /dev/null @@ -1 +0,0 @@ -PORT=3000 diff --git a/apps/js-eval/Dockerfile b/apps/js-eval/Dockerfile deleted file mode 100644 index 46c0041c2..000000000 --- a/apps/js-eval/Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -# context-dir: -FROM golang:buster AS base -USER 1001 -ENV GOPATH=/tmp/go -ENV GOCACHE=/tmp/go-cache -WORKDIR /tmp/app -# COPY --chown=1001 ./go.mod ./go.sum ./tools.go pkg common grpc-interfaces ./ -COPY --chown=1001 ./ ./ -ARG APP_DIR -WORKDIR $APP_DIR -RUN go build -tags musl -o /tmp/bin/js-eval ./main.go -RUN chmod +x /tmp/bin/js-eval - -FROM golang:buster -RUN mkdir /tmp/app -RUN chown -R 1001 /tmp/app -USER 1001 -WORKDIR /tmp/app -COPY --from=base --chown=1001 /tmp/bin/js-eval ./ -ENTRYPOINT ["./js-eval"] diff --git a/apps/js-eval/Taskfile.yml b/apps/js-eval/Taskfile.yml deleted file mode 100644 index 71ea68dfd..000000000 --- a/apps/js-eval/Taskfile.yml +++ /dev/null @@ -1,23 +0,0 @@ -version: "3" - -dotenv: [".secrets/env"] - -tasks: - run: - env: - PRICING_PATH: ./price/ - sources: - - ./main.go - cmds: - - go version - - nodemon -e go --signal SIGKILL --exec 'go run -tags dynamic main.go --dev || exit 1' - - docker-build: - dir: ../.. - vars: - IMAGE: registry.kloudlite.io/kloudlite/{{.EnvName}}/js-eval:{{.Tag}} - APP_DIR: ./apps/js-eval - cmds: - - docker buildx build -f ./{{.APP_DIR}}/Dockerfile -t {{.IMAGE}} . --platform linux/amd64 --build-arg APP_DIR={{.APP_DIR}} - - docker push {{.IMAGE}} - diff --git a/apps/js-eval/go.json b/apps/js-eval/go.json deleted file mode 100644 index f045d4ad1..000000000 --- a/apps/js-eval/go.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "inputstring":"{\"cpu\": 1, \"size\": 1}", - "functionstring":"function (inputs) {\n const defaultPlan = \"Basic\"\n return {\n annotation: {\n \"kloudlite.io/billing-plan\": defaultPlan,\n \"kloudlite.io/billable-quantity\": inputs.cpu,\n \"kloudlite.io/is-shared\": true,\n },\n inputs: {\n ...inputs,\n cpu: `${inputs.cpu * 1000}m`,\n size: `${inputs.size}Gi`,\n },\n };\n}" -} diff --git a/apps/js-eval/main.go b/apps/js-eval/main.go deleted file mode 100644 index 0c6fbd953..000000000 --- a/apps/js-eval/main.go +++ /dev/null @@ -1,56 +0,0 @@ -package main - -import ( - "context" - "fmt" - "google.golang.org/grpc" - "google.golang.org/protobuf/types/known/anypb" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/jseval" - "net" - "os" - v8 "rogchap.com/v8go" - "sync" -) - -type JsServer struct { - jseval.UnimplementedJSEvalServer -} - -func (s *JsServer) Eval(c context.Context, in *jseval.EvalIn) (*jseval.EvalOut, error) { - f := in.FunName + `(` + string(in.Inputs.Value) + `)` - ctx := v8.NewContext() - ctx.RunScript(in.Init, "eval.js") - val, err := ctx.RunScript(f, "eval.js") - if err != nil { - return nil, err - } - marshalJSON, err := val.MarshalJSON() - return &jseval.EvalOut{Output: &anypb.Any{ - TypeUrl: "", - Value: marshalJSON, - }}, nil -} - -func main() { - port := os.Getenv("PORT") - if port == "" { - port = "3000" - } - listen, err := net.Listen("tcp", fmt.Sprintf(":%s", port)) - if err != nil { - panic(err) - } else { - server := grpc.NewServer() - jseval.RegisterJSEvalServer(server, &JsServer{}) - var wg sync.WaitGroup - wg.Add(1) - go func() { - err := server.Serve(listen) - wg.Done() - if err != nil { - panic(err) - } - }() - wg.Wait() - } -} diff --git a/apps/message-office/Containerfile.local b/apps/message-office/Containerfile.local new file mode 100644 index 000000000..139e421fc --- /dev/null +++ b/apps/message-office/Containerfile.local @@ -0,0 +1,6 @@ +# syntax=docker/dockerfile:1.4 +FROM scratch +WORKDIR /app +ARG binpath +COPY --from=local-builder --chown=1001 $binpath ./message-office +ENTRYPOINT ["./message-office"] diff --git a/apps/message-office/Dockerfile b/apps/message-office/Dockerfile index 93f8d48ae..2537f0aca 100644 --- a/apps/message-office/Dockerfile +++ b/apps/message-office/Dockerfile @@ -16,7 +16,7 @@ COPY --chown=1001 ./ ./ RUN CGO_ENABLED=0 go build -tags musl -o /tmp/bin/$APP ./main.go RUN chmod +x /tmp/bin/$APP -FROM gcr.io/distroless/static-debian11 +FROM gcr.io/distroless/static-debian11:nonroot ARG APP -COPY --from=base --chown=1001 /tmp/bin/$APP /message-office -CMD ["/message-office"] +COPY --from=base --chown=1001 /tmp/bin/$APP ./message-office +CMD ["./message-office"] diff --git a/apps/message-office/Taskfile.yml b/apps/message-office/Taskfile.yml index 5e9a01e49..09c55a45e 100644 --- a/apps/message-office/Taskfile.yml +++ b/apps/message-office/Taskfile.yml @@ -1,5 +1,8 @@ version: 3 +vars: + ImagePrefix: "ghcr.io/kloudlite/api" + tasks: run: dotenv: @@ -7,14 +10,24 @@ tasks: cmds: - go run ./main.go + vector:proto: + cmds: + - protoc --go_out=. --go-grpc_out=. --go_opt=paths=import --go-grpc_opt=paths=import ./internal/app/proto/*.proto + + build: env: CGO_ENABLED: 0 + GOOS: linux + GOARCH: amd64 + vars: + BuiltAt: + sh: date | sed 's/\s/_/g' preconditions: - sh: '[ -n "{{.Out}}" ]' msg: var Out must have a value cmds: - - go build -ldflags="-s -w" -o {{.Out}} + - go build -ldflags="-s -w -X 'kloudlite.io/common.BuiltAt={{.BuiltAt}}'" -o {{.Out}} - upx {{.Out}} gql: @@ -24,36 +37,19 @@ tasks: local-build: preconditions: - - sh: '[ -n "{{.EnvName}}" ]' - msg: 'var EnvName must have a value' - sh: '[ -n "{{.Tag}}" ]' msg: 'var Tag must have a value' vars: APP: message-office - IMAGE: registry.kloudlite.io/kloudlite/{{.EnvName}}/{{.APP}}-api:{{.Tag}} - env: - CGO_ENABLED: 0 - GOOS: linux - GOARCH: amd64 + IMAGE: "{{.ImagePrefix}}/{{.APP}}:{{.Tag}}" silent: true cmds: - |+ - lineNumbers=$(cat Dockerfile | grep -i '^FROM' -n | tail +2 | awk -F: '{print $1}') - - startLineNo=$(echo "$lineNumbers" | head -n+1) - finalLineNo=$(echo "$lineNumbers" | tail -1) - tDir=$(mktemp -d) + binpath="{{.APP}}" + task build Out=$tDir/$binpath - nDockerfile=$(cat Dockerfile | tail --lines=+$startLineNo | grep -i --invert-match 'from=base') - echo "$nDockerfile" | sed "1 i # syntax=docker/dockerfile:1.4" > $tDir/Dockerfile.base - - cat $tDir/Dockerfile.base | sed "4 i COPY --from=local-builder ./{{.APP}} /{{.APP}}" > $tDir/Dockerfile - cat $tDir/Dockerfile - echo "building application ..." - - task build Out=$tDir/{{.APP}} - - docker buildx build -f $tDir/Dockerfile -t {{.IMAGE}} . --build-context local-builder=${tDir} - docker push {{.IMAGE}} - rm -rf $tDir + echo "[#] building container image" + podman buildx build -f ./Containerfile.local -t {{.IMAGE}} . --build-arg binpath="$binpath" --build-context local-builder=${tDir} + echo "[#] pushing container image" + podman push {{.IMAGE}} diff --git a/apps/message-office/internal/app/app.go b/apps/message-office/internal/app/app.go index 3fe3cfc88..95dedbe3f 100644 --- a/apps/message-office/internal/app/app.go +++ b/apps/message-office/internal/app/app.go @@ -1,66 +1,98 @@ package app import ( - "github.com/gofiber/fiber/v2" - artifactsv1 "github.com/kloudlite/operator/apis/artifacts/v1" + "context" + + "github.com/kloudlite/api/apps/message-office/internal/app/graph" + "github.com/kloudlite/api/apps/message-office/internal/app/graph/generated" + proto_rpc "github.com/kloudlite/api/apps/message-office/internal/app/proto-rpc" + "github.com/kloudlite/api/apps/message-office/internal/domain" + "github.com/kloudlite/api/apps/message-office/internal/env" + message_office_internal "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/message-office-internal" + "github.com/kloudlite/api/pkg/grpc" + httpServer "github.com/kloudlite/api/pkg/http-server" + "github.com/kloudlite/api/pkg/logging" + msg_nats "github.com/kloudlite/api/pkg/messaging/nats" + "github.com/kloudlite/api/pkg/nats" + "github.com/kloudlite/api/pkg/repos" "github.com/kloudlite/operator/grpc-interfaces/grpc/messages" - "github.com/kloudlite/operator/pkg/kubectl" "go.uber.org/fx" - "google.golang.org/grpc" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/client-go/rest" - - "kloudlite.io/apps/message-office/internal/app/graph" - "kloudlite.io/apps/message-office/internal/app/graph/generated" - "kloudlite.io/apps/message-office/internal/domain" - "kloudlite.io/apps/message-office/internal/env" - httpServer "kloudlite.io/pkg/http-server" - "kloudlite.io/pkg/logging" - "kloudlite.io/pkg/redpanda" - "kloudlite.io/pkg/repos" ) -type ContainerRegistryGrpcConnection *grpc.ClientConn +type ( + RealVectorGrpcClient grpc.Client +) + +type ( + ExternalGrpcServer grpc.Server + InternalGrpcServer grpc.Server +) var Module = fx.Module("app", - redpanda.NewProducerFx[redpanda.Client](), + repos.NewFxMongoRepo[*domain.MessageOfficeToken]("mo_tokens", "mot", domain.MOTokenIndexes), + repos.NewFxMongoRepo[*domain.AccessToken]("acc_tokens", "acct", domain.AccessTokenIndexes), + + fx.Provide(func(jsc *nats.JetstreamClient, logger logging.Logger) UpdatesProducer { + return msg_nats.NewJetstreamProducer(jsc) + }), + + fx.Invoke(func(lf fx.Lifecycle, producer UpdatesProducer) { + lf.Append(fx.Hook{ + OnStop: func(ctx context.Context) error { + return producer.Stop(ctx) + }, + }) + }), + + domain.Module, + + fx.Provide(func(logger logging.Logger, jc *nats.JetstreamClient, producer UpdatesProducer, ev *env.Env, d domain.Domain) (messages.MessageDispatchServiceServer, error) { + return NewMessageOfficeServer(producer, jc, ev, d, logger.WithName("message-office")) + }), - fx.Provide(func(restCfg *rest.Config) (kubectl.ControllerClient, error) { - scheme := runtime.NewScheme() - artifactsv1.AddToScheme(scheme) - return kubectl.NewClientWithScheme(restCfg, scheme) + fx.Provide(func(conn RealVectorGrpcClient) proto_rpc.VectorClient { + return proto_rpc.NewVectorClient(conn) }), - fx.Provide(func(logger logging.Logger, producer redpanda.Producer, ev *env.Env, d domain.Domain, kControllerCli kubectl.ControllerClient) messages.MessageDispatchServiceServer { - return &grpcServer{ - domain: d, - logger: logger, - producer: producer, - consumers: map[string]redpanda.Consumer{}, - ev: ev, - k8sControllerCli: kControllerCli, + fx.Provide(func(vectorGrpcClient proto_rpc.VectorClient, logger logging.Logger, d domain.Domain, ev *env.Env) proto_rpc.VectorServer { + return &vectorProxyServer{ + realVectorClient: vectorGrpcClient, + logger: logger.WithName("vector-proxy"), + domain: d, + tokenHashingSecret: ev.TokenHashingSecret, + pushEventsCounter: 0, + healthCheckCounter: 0, } }), + + fx.Provide(func(d domain.Domain) message_office_internal.MessageOfficeInternalServer { + return newInternalMsgServer(d) + }), + + fx.Invoke(func(server InternalGrpcServer, internalMsgServer message_office_internal.MessageOfficeInternalServer) { + message_office_internal.RegisterMessageOfficeInternalServer(server, internalMsgServer) + }), + fx.Invoke( - func(server *grpc.Server, messageServer messages.MessageDispatchServiceServer) { + func(server ExternalGrpcServer, messageServer messages.MessageDispatchServiceServer) { messages.RegisterMessageDispatchServiceServer(server, messageServer) }, ), - repos.NewFxMongoRepo[*domain.MessageOfficeToken]("mo_tokens", "mot", domain.MOTokenIndexes), - repos.NewFxMongoRepo[*domain.AccessToken]("acc_tokens", "acct", domain.AccessTokenIndexes), fx.Invoke( - func( - server *fiber.App, - d domain.Domain, - ) { + func(server ExternalGrpcServer, vectorServer proto_rpc.VectorServer) { + proto_rpc.RegisterVectorServer(server, vectorServer) + }, + ), + + fx.Invoke( + func(server httpServer.Server, d domain.Domain) { schema := generated.NewExecutableSchema( generated.Config{ Resolvers: &graph.Resolver{Domain: d}, }, ) - httpServer.SetupGQLServer(server, schema) + server.SetupGraphqlServer(schema) }, ), - domain.Module, ) diff --git a/apps/message-office/internal/app/gqlgen.yml b/apps/message-office/internal/app/gqlgen.yml index c8aced13a..e8a8dc413 100644 --- a/apps/message-office/internal/app/gqlgen.yml +++ b/apps/message-office/internal/app/gqlgen.yml @@ -1,4 +1,4 @@ -# Where are all the schema files located? globs are supported eg src/**/*.graphqls +# Where are all the schema files located?tglobs are supported eg src/**/*.graphqls schema: - graph/*.graphqls @@ -44,3 +44,8 @@ models: fields: clusterToken: resolver: true + + Cluster: + fields: + clusterToken: + resolver: true diff --git a/apps/message-office/internal/app/graph/entity.resolvers.go b/apps/message-office/internal/app/graph/entity.resolvers.go index 5d6611cc3..958067c6b 100644 --- a/apps/message-office/internal/app/graph/entity.resolvers.go +++ b/apps/message-office/internal/app/graph/entity.resolvers.go @@ -7,8 +7,8 @@ package graph import ( "context" - "kloudlite.io/apps/message-office/internal/app/graph/generated" - "kloudlite.io/apps/message-office/internal/app/graph/model" + "github.com/kloudlite/api/apps/message-office/internal/app/graph/generated" + "github.com/kloudlite/api/apps/message-office/internal/app/graph/model" ) // FindBYOCClusterByMetadataNameAndSpecAccountName is the resolver for the findBYOCClusterByMetadataNameAndSpecAccountName field. @@ -17,7 +17,20 @@ func (r *entityResolver) FindBYOCClusterByMetadataNameAndSpecAccountName(ctx con Metadata: &model.Metadata{ Name: metadataName, }, - Spec: &model.BYOCClusterSpec{ + Spec: &model.GithubComKloudliteOperatorApisClustersV1BYOCSpec{ + AccountName: specAccountName, + }, + ClusterToken: "", + }, nil +} + +// FindClusterByMetadataNameAndSpecAccountName is the resolver for the findClusterByMetadataNameAndSpecAccountName field. +func (r *entityResolver) FindClusterByMetadataNameAndSpecAccountName(ctx context.Context, metadataName string, specAccountName string) (*model.Cluster, error) { + return &model.Cluster{ + Metadata: &model.Metadata{ + Name: metadataName, + }, + Spec: &model.GithubComKloudliteOperatorApisClustersV1ClusterSpec{ AccountName: specAccountName, }, ClusterToken: "", diff --git a/apps/message-office/internal/app/graph/generated/federation.go b/apps/message-office/internal/app/graph/generated/federation.go index 8f15146e6..f81ae3501 100644 --- a/apps/message-office/internal/app/graph/generated/federation.go +++ b/apps/message-office/internal/app/graph/generated/federation.go @@ -101,6 +101,30 @@ func (ec *executionContext) __resolve_entities(ctx context.Context, representati return fmt.Errorf(`resolving Entity "BYOCCluster": %w`, err) } + list[idx[i]] = entity + return nil + } + case "Cluster": + resolverName, err := entityResolverNameForCluster(ctx, rep) + if err != nil { + return fmt.Errorf(`finding resolver for Entity "Cluster": %w`, err) + } + switch resolverName { + + case "findClusterByMetadataNameAndSpecAccountName": + id0, err := ec.unmarshalNString2string(ctx, rep["metadata"].(map[string]interface{})["name"]) + if err != nil { + return fmt.Errorf(`unmarshalling param 0 for findClusterByMetadataNameAndSpecAccountName(): %w`, err) + } + id1, err := ec.unmarshalNString2string(ctx, rep["spec"].(map[string]interface{})["accountName"]) + if err != nil { + return fmt.Errorf(`unmarshalling param 1 for findClusterByMetadataNameAndSpecAccountName(): %w`, err) + } + entity, err := ec.resolvers.Entity().FindClusterByMetadataNameAndSpecAccountName(ctx, id0, id1) + if err != nil { + return fmt.Errorf(`resolving Entity "Cluster": %w`, err) + } + list[idx[i]] = entity return nil } @@ -205,3 +229,36 @@ func entityResolverNameForBYOCCluster(ctx context.Context, rep map[string]interf } return "", fmt.Errorf("%w for BYOCCluster", ErrTypeNotFound) } + +func entityResolverNameForCluster(ctx context.Context, rep map[string]interface{}) (string, error) { + for { + var ( + m map[string]interface{} + val interface{} + ok bool + ) + _ = val + m = rep + if val, ok = m["metadata"]; !ok { + break + } + if m, ok = val.(map[string]interface{}); !ok { + break + } + if _, ok = m["name"]; !ok { + break + } + m = rep + if val, ok = m["spec"]; !ok { + break + } + if m, ok = val.(map[string]interface{}); !ok { + break + } + if _, ok = m["accountName"]; !ok { + break + } + return "findClusterByMetadataNameAndSpecAccountName", nil + } + return "", fmt.Errorf("%w for Cluster", ErrTypeNotFound) +} diff --git a/apps/message-office/internal/app/graph/generated/generated.go b/apps/message-office/internal/app/graph/generated/generated.go index 11fb7953a..6c48e9fba 100644 --- a/apps/message-office/internal/app/graph/generated/generated.go +++ b/apps/message-office/internal/app/graph/generated/generated.go @@ -16,7 +16,7 @@ import ( "github.com/99designs/gqlgen/plugin/federation/fedruntime" gqlparser "github.com/vektah/gqlparser/v2" "github.com/vektah/gqlparser/v2/ast" - "kloudlite.io/apps/message-office/internal/app/graph/model" + "github.com/kloudlite/api/apps/message-office/internal/app/graph/model" ) // region ************************** generated!.gotpl ************************** @@ -38,6 +38,7 @@ type Config struct { type ResolverRoot interface { BYOCCluster() BYOCClusterResolver + Cluster() ClusterResolver Entity() EntityResolver Mutation() MutationResolver } @@ -52,12 +53,23 @@ type ComplexityRoot struct { Spec func(childComplexity int) int } - BYOCClusterSpec struct { - AccountName func(childComplexity int) int + Cluster struct { + ClusterToken func(childComplexity int) int + Metadata func(childComplexity int) int + Spec func(childComplexity int) int } Entity struct { FindBYOCClusterByMetadataNameAndSpecAccountName func(childComplexity int, metadataName string, specAccountName string) int + FindClusterByMetadataNameAndSpecAccountName func(childComplexity int, metadataName string, specAccountName string) int + } + + Github__com___kloudlite___operator___apis___clusters___v1__BYOCSpec struct { + AccountName func(childComplexity int) int + } + + Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec struct { + AccountName func(childComplexity int) int } Metadata struct { @@ -81,8 +93,12 @@ type ComplexityRoot struct { type BYOCClusterResolver interface { ClusterToken(ctx context.Context, obj *model.BYOCCluster) (string, error) } +type ClusterResolver interface { + ClusterToken(ctx context.Context, obj *model.Cluster) (string, error) +} type EntityResolver interface { FindBYOCClusterByMetadataNameAndSpecAccountName(ctx context.Context, metadataName string, specAccountName string) (*model.BYOCCluster, error) + FindClusterByMetadataNameAndSpecAccountName(ctx context.Context, metadataName string, specAccountName string) (*model.Cluster, error) } type MutationResolver interface { GenerateClusterToken(ctx context.Context, accountName string, clusterName string) (string, error) @@ -124,12 +140,26 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.BYOCCluster.Spec(childComplexity), true - case "BYOCClusterSpec.accountName": - if e.complexity.BYOCClusterSpec.AccountName == nil { + case "Cluster.clusterToken": + if e.complexity.Cluster.ClusterToken == nil { + break + } + + return e.complexity.Cluster.ClusterToken(childComplexity), true + + case "Cluster.metadata": + if e.complexity.Cluster.Metadata == nil { break } - return e.complexity.BYOCClusterSpec.AccountName(childComplexity), true + return e.complexity.Cluster.Metadata(childComplexity), true + + case "Cluster.spec": + if e.complexity.Cluster.Spec == nil { + break + } + + return e.complexity.Cluster.Spec(childComplexity), true case "Entity.findBYOCClusterByMetadataNameAndSpecAccountName": if e.complexity.Entity.FindBYOCClusterByMetadataNameAndSpecAccountName == nil { @@ -143,6 +173,32 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Entity.FindBYOCClusterByMetadataNameAndSpecAccountName(childComplexity, args["metadataName"].(string), args["specAccountName"].(string)), true + case "Entity.findClusterByMetadataNameAndSpecAccountName": + if e.complexity.Entity.FindClusterByMetadataNameAndSpecAccountName == nil { + break + } + + args, err := ec.field_Entity_findClusterByMetadataNameAndSpecAccountName_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Entity.FindClusterByMetadataNameAndSpecAccountName(childComplexity, args["metadataName"].(string), args["specAccountName"].(string)), true + + case "Github__com___kloudlite___operator___apis___clusters___v1__BYOCSpec.accountName": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__BYOCSpec.AccountName == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__BYOCSpec.AccountName(childComplexity), true + + case "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.accountName": + if e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.AccountName == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec.AccountName(childComplexity), true + case "Metadata.name": if e.complexity.Metadata.Name == nil { break @@ -259,7 +315,17 @@ var sources = []*ast.Source{ metadata: Metadata! # name: String! # accountName: String! - spec: BYOCClusterSpec! + # spec: BYOCClusterSpec! + spec: Github__com___kloudlite___operator___apis___clusters___v1__BYOCSpec! + clusterToken: String! +} + +extend type Cluster @key(fields: "metadata { name } spec { accountName }") { + metadata: Metadata! + # name: String! + # accountName: String! + # spec: BYOCClusterSpec! + spec: Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec clusterToken: String! } @@ -267,7 +333,11 @@ extend type Metadata { name: String! } -extend type BYOCClusterSpec { +extend type Github__com___kloudlite___operator___apis___clusters___v1__BYOCSpec { + accountName: String! +} + +extend type Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec { accountName: String! } @@ -287,11 +357,12 @@ type Mutation { `, BuiltIn: true}, {Name: "../../federation/entity.graphql", Input: ` # a union of all types that use the @key directive -union _Entity = BYOCCluster +union _Entity = BYOCCluster | Cluster # fake type to build resolver interfaces for users to implement type Entity { findBYOCClusterByMetadataNameAndSpecAccountName(metadataName: String!,specAccountName: String!,): BYOCCluster! + findClusterByMetadataNameAndSpecAccountName(metadataName: String!,specAccountName: String!,): Cluster! } @@ -335,6 +406,30 @@ func (ec *executionContext) field_Entity_findBYOCClusterByMetadataNameAndSpecAcc return args, nil } +func (ec *executionContext) field_Entity_findClusterByMetadataNameAndSpecAccountName_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["metadataName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadataName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["metadataName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["specAccountName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("specAccountName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["specAccountName"] = arg1 + return args, nil +} + func (ec *executionContext) field_Mutation_generateClusterToken_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -501,9 +596,9 @@ func (ec *executionContext) _BYOCCluster_spec(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(*model.BYOCClusterSpec) + res := resTmp.(*model.GithubComKloudliteOperatorApisClustersV1BYOCSpec) fc.Result = res - return ec.marshalNBYOCClusterSpec2ᚖkloudliteᚗioᚋappsᚋmessageᚑofficeᚋinternalᚋappᚋgraphᚋmodelᚐBYOCClusterSpec(ctx, field.Selections, res) + return ec.marshalNGithub__com___kloudlite___operator___apis___clusters___v1__BYOCSpec2ᚖkloudliteᚗioᚋappsᚋmessageᚑofficeᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1BYOCSpec(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_BYOCCluster_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -515,9 +610,9 @@ func (ec *executionContext) fieldContext_BYOCCluster_spec(ctx context.Context, f Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "accountName": - return ec.fieldContext_BYOCClusterSpec_accountName(ctx, field) + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__BYOCSpec_accountName(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type BYOCClusterSpec", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___clusters___v1__BYOCSpec", field.Name) }, } return fc, nil @@ -567,8 +662,8 @@ func (ec *executionContext) fieldContext_BYOCCluster_clusterToken(ctx context.Co return fc, nil } -func (ec *executionContext) _BYOCClusterSpec_accountName(ctx context.Context, field graphql.CollectedField, obj *model.BYOCClusterSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_BYOCClusterSpec_accountName(ctx, field) +func (ec *executionContext) _Cluster_metadata(ctx context.Context, field graphql.CollectedField, obj *model.Cluster) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Cluster_metadata(ctx, field) if err != nil { return graphql.Null } @@ -581,7 +676,7 @@ func (ec *executionContext) _BYOCClusterSpec_accountName(ctx context.Context, fi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.AccountName, nil + return obj.Metadata, nil }) if err != nil { ec.Error(ctx, err) @@ -593,17 +688,110 @@ func (ec *executionContext) _BYOCClusterSpec_accountName(ctx context.Context, fi } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*model.Metadata) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNMetadata2ᚖkloudliteᚗioᚋappsᚋmessageᚑofficeᚋinternalᚋappᚋgraphᚋmodelᚐMetadata(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Cluster_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Cluster", + 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_Metadata_name(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Cluster_spec(ctx context.Context, field graphql.CollectedField, obj *model.Cluster) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Cluster_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 { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorApisClustersV1ClusterSpec) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___clusters___v1__ClusterSpec2ᚖkloudliteᚗioᚋappsᚋmessageᚑofficeᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1ClusterSpec(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_BYOCClusterSpec_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Cluster_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "BYOCClusterSpec", + Object: "Cluster", Field: field, IsMethod: false, IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accountName": + return ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_accountName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Cluster_clusterToken(ctx context.Context, field graphql.CollectedField, obj *model.Cluster) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Cluster_clusterToken(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Cluster().ClusterToken(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_Cluster_clusterToken(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Cluster", + 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") }, @@ -674,6 +862,157 @@ func (ec *executionContext) fieldContext_Entity_findBYOCClusterByMetadataNameAnd return fc, nil } +func (ec *executionContext) _Entity_findClusterByMetadataNameAndSpecAccountName(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_findClusterByMetadataNameAndSpecAccountName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Entity().FindClusterByMetadataNameAndSpecAccountName(rctx, fc.Args["metadataName"].(string), fc.Args["specAccountName"].(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.(*model.Cluster) + fc.Result = res + return ec.marshalNCluster2ᚖkloudliteᚗioᚋappsᚋmessageᚑofficeᚋinternalᚋappᚋgraphᚋmodelᚐCluster(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_findClusterByMetadataNameAndSpecAccountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "metadata": + return ec.fieldContext_Cluster_metadata(ctx, field) + case "spec": + return ec.fieldContext_Cluster_spec(ctx, field) + case "clusterToken": + return ec.fieldContext_Cluster_clusterToken(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Cluster", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Entity_findClusterByMetadataNameAndSpecAccountName_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__BYOCSpec_accountName(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1BYOCSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__BYOCSpec_accountName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__BYOCSpec_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__BYOCSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_accountName(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisClustersV1ClusterSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_accountName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil + }) + if err != nil { + ec.Error(ctx, err) + 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_Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _Metadata_name(ctx context.Context, field graphql.CollectedField, obj *model.Metadata) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Metadata_name(ctx, field) if err != nil { @@ -2834,6 +3173,13 @@ func (ec *executionContext) __Entity(ctx context.Context, sel ast.SelectionSet, return graphql.Null } return ec._BYOCCluster(ctx, sel, obj) + case model.Cluster: + return ec._Cluster(ctx, sel, &obj) + case *model.Cluster: + if obj == nil { + return graphql.Null + } + return ec._Cluster(ctx, sel, obj) default: panic(fmt.Errorf("unexpected type %T", obj)) } @@ -2898,23 +3244,47 @@ func (ec *executionContext) _BYOCCluster(ctx context.Context, sel ast.SelectionS return out } -var bYOCClusterSpecImplementors = []string{"BYOCClusterSpec"} +var clusterImplementors = []string{"Cluster", "_Entity"} -func (ec *executionContext) _BYOCClusterSpec(ctx context.Context, sel ast.SelectionSet, obj *model.BYOCClusterSpec) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, bYOCClusterSpecImplementors) +func (ec *executionContext) _Cluster(ctx context.Context, sel ast.SelectionSet, obj *model.Cluster) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, clusterImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("BYOCClusterSpec") - case "accountName": + out.Values[i] = graphql.MarshalString("Cluster") + case "metadata": - out.Values[i] = ec._BYOCClusterSpec_accountName(ctx, field, obj) + out.Values[i] = ec._Cluster_metadata(ctx, field, obj) if out.Values[i] == graphql.Null { - invalids++ + atomic.AddUint32(&invalids, 1) + } + case "spec": + + out.Values[i] = ec._Cluster_spec(ctx, field, obj) + + case "clusterToken": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Cluster_clusterToken(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -2965,6 +3335,29 @@ func (ec *executionContext) _Entity(ctx context.Context, sel ast.SelectionSet) g return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) } + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "findClusterByMetadataNameAndSpecAccountName": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Entity_findClusterByMetadataNameAndSpecAccountName(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + out.Concurrently(i, func() graphql.Marshaler { return rrm(innerCtx) }) @@ -2979,6 +3372,62 @@ func (ec *executionContext) _Entity(ctx context.Context, sel ast.SelectionSet) g return out } +var github__com___kloudlite___operator___apis___clusters___v1__BYOCSpecImplementors = []string{"Github__com___kloudlite___operator___apis___clusters___v1__BYOCSpec"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__BYOCSpec(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisClustersV1BYOCSpec) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___clusters___v1__BYOCSpecImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___clusters___v1__BYOCSpec") + case "accountName": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__BYOCSpec_accountName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___apis___clusters___v1__ClusterSpecImplementors = []string{"Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisClustersV1ClusterSpec) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___clusters___v1__ClusterSpecImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec") + case "accountName": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_accountName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + var metadataImplementors = []string{"Metadata"} func (ec *executionContext) _Metadata(ctx context.Context, sel ast.SelectionSet, obj *model.Metadata) graphql.Marshaler { @@ -3491,16 +3940,6 @@ func (ec *executionContext) marshalNBYOCCluster2ᚖkloudliteᚗioᚋappsᚋmessa return ec._BYOCCluster(ctx, sel, v) } -func (ec *executionContext) marshalNBYOCClusterSpec2ᚖkloudliteᚗioᚋappsᚋmessageᚑofficeᚋinternalᚋappᚋgraphᚋmodelᚐBYOCClusterSpec(ctx context.Context, sel ast.SelectionSet, v *model.BYOCClusterSpec) 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._BYOCClusterSpec(ctx, sel, v) -} - func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) return res, graphql.ErrorOnPath(ctx, err) @@ -3516,6 +3955,30 @@ func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.Se return res } +func (ec *executionContext) marshalNCluster2kloudliteᚗioᚋappsᚋmessageᚑofficeᚋinternalᚋappᚋgraphᚋmodelᚐCluster(ctx context.Context, sel ast.SelectionSet, v model.Cluster) graphql.Marshaler { + return ec._Cluster(ctx, sel, &v) +} + +func (ec *executionContext) marshalNCluster2ᚖkloudliteᚗioᚋappsᚋmessageᚑofficeᚋinternalᚋappᚋgraphᚋmodelᚐCluster(ctx context.Context, sel ast.SelectionSet, v *model.Cluster) 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._Cluster(ctx, sel, v) +} + +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___clusters___v1__BYOCSpec2ᚖkloudliteᚗioᚋappsᚋmessageᚑofficeᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1BYOCSpec(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisClustersV1BYOCSpec) 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._Github__com___kloudlite___operator___apis___clusters___v1__BYOCSpec(ctx, sel, v) +} + func (ec *executionContext) marshalNMetadata2ᚖkloudliteᚗioᚋappsᚋmessageᚑofficeᚋinternalᚋappᚋgraphᚋmodelᚐMetadata(ctx context.Context, sel ast.SelectionSet, v *model.Metadata) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { @@ -3930,6 +4393,13 @@ func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast return res } +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___clusters___v1__ClusterSpec2ᚖkloudliteᚗioᚋappsᚋmessageᚑofficeᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1ClusterSpec(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisClustersV1ClusterSpec) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec(ctx, sel, v) +} + func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) return res, graphql.ErrorOnPath(ctx, err) diff --git a/apps/message-office/internal/app/graph/model/models_gen.go b/apps/message-office/internal/app/graph/model/models_gen.go index ac35b289b..068b88d76 100644 --- a/apps/message-office/internal/app/graph/model/models_gen.go +++ b/apps/message-office/internal/app/graph/model/models_gen.go @@ -3,14 +3,26 @@ package model type BYOCCluster struct { - Metadata *Metadata `json:"metadata"` - Spec *BYOCClusterSpec `json:"spec"` - ClusterToken string `json:"clusterToken"` + Metadata *Metadata `json:"metadata"` + Spec *GithubComKloudliteOperatorApisClustersV1BYOCSpec `json:"spec"` + ClusterToken string `json:"clusterToken"` } func (BYOCCluster) IsEntity() {} -type BYOCClusterSpec struct { +type Cluster struct { + Metadata *Metadata `json:"metadata"` + Spec *GithubComKloudliteOperatorApisClustersV1ClusterSpec `json:"spec,omitempty"` + ClusterToken string `json:"clusterToken"` +} + +func (Cluster) IsEntity() {} + +type GithubComKloudliteOperatorApisClustersV1BYOCSpec struct { + AccountName string `json:"accountName"` +} + +type GithubComKloudliteOperatorApisClustersV1ClusterSpec struct { AccountName string `json:"accountName"` } diff --git a/apps/message-office/internal/app/graph/resolver.go b/apps/message-office/internal/app/graph/resolver.go index 4d4b47aad..5895545a3 100644 --- a/apps/message-office/internal/app/graph/resolver.go +++ b/apps/message-office/internal/app/graph/resolver.go @@ -4,7 +4,7 @@ package graph // // It serves as dependency injection for your app, add any dependencies you require here. import ( - "kloudlite.io/apps/message-office/internal/domain" + "github.com/kloudlite/api/apps/message-office/internal/domain" ) type Resolver struct { diff --git a/apps/message-office/internal/app/graph/schema.graphqls b/apps/message-office/internal/app/graph/schema.graphqls index 491b5911e..bca6598b0 100644 --- a/apps/message-office/internal/app/graph/schema.graphqls +++ b/apps/message-office/internal/app/graph/schema.graphqls @@ -2,7 +2,17 @@ extend type BYOCCluster @key(fields: "metadata { name } spec { accountName }") metadata: Metadata! # name: String! # accountName: String! - spec: BYOCClusterSpec! + # spec: BYOCClusterSpec! + spec: Github__com___kloudlite___operator___apis___clusters___v1__BYOCSpec! + clusterToken: String! +} + +extend type Cluster @key(fields: "metadata { name } spec { accountName }") { + metadata: Metadata! + # name: String! + # accountName: String! + # spec: BYOCClusterSpec! + spec: Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec clusterToken: String! } @@ -10,7 +20,11 @@ extend type Metadata { name: String! } -extend type BYOCClusterSpec { +extend type Github__com___kloudlite___operator___apis___clusters___v1__BYOCSpec { + accountName: String! +} + +extend type Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec { accountName: String! } diff --git a/apps/message-office/internal/app/graph/schema.resolvers.go b/apps/message-office/internal/app/graph/schema.resolvers.go index 2d7ed545d..2bfeb606e 100644 --- a/apps/message-office/internal/app/graph/schema.resolvers.go +++ b/apps/message-office/internal/app/graph/schema.resolvers.go @@ -6,9 +6,10 @@ package graph import ( "context" + "github.com/kloudlite/api/pkg/errors" - "kloudlite.io/apps/message-office/internal/app/graph/generated" - "kloudlite.io/apps/message-office/internal/app/graph/model" + "github.com/kloudlite/api/apps/message-office/internal/app/graph/generated" + "github.com/kloudlite/api/apps/message-office/internal/app/graph/model" ) // ClusterToken is the resolver for the clusterToken field. @@ -16,7 +17,19 @@ func (r *bYOCClusterResolver) ClusterToken(ctx context.Context, obj *model.BYOCC if obj.ClusterToken == "" { t, err := r.Domain.GenClusterToken(ctx, obj.Spec.AccountName, obj.Metadata.Name) if err != nil { - return "", err + return "", errors.NewE(err) + } + return t, nil + } + return obj.ClusterToken, nil +} + +// ClusterToken is the resolver for the clusterToken field. +func (r *clusterResolver) ClusterToken(ctx context.Context, obj *model.Cluster) (string, error) { + if obj.ClusterToken == "" { + t, err := r.Domain.GenClusterToken(ctx, obj.Spec.AccountName, obj.Metadata.Name) + if err != nil { + return "", errors.NewE(err) } return t, nil } @@ -31,8 +44,12 @@ func (r *mutationResolver) GenerateClusterToken(ctx context.Context, accountName // BYOCCluster returns generated.BYOCClusterResolver implementation. func (r *Resolver) BYOCCluster() generated.BYOCClusterResolver { return &bYOCClusterResolver{r} } +// Cluster returns generated.ClusterResolver implementation. +func (r *Resolver) Cluster() generated.ClusterResolver { return &clusterResolver{r} } + // Mutation returns generated.MutationResolver implementation. func (r *Resolver) Mutation() generated.MutationResolver { return &mutationResolver{r} } type bYOCClusterResolver struct{ *Resolver } +type clusterResolver struct{ *Resolver } type mutationResolver struct{ *Resolver } diff --git a/apps/message-office/internal/app/grpc-server.go b/apps/message-office/internal/app/grpc-server.go index 7aafd6df1..b83c0d47e 100644 --- a/apps/message-office/internal/app/grpc-server.go +++ b/apps/message-office/internal/app/grpc-server.go @@ -1,259 +1,456 @@ package app import ( - context "context" + "context" + "crypto/sha256" + "encoding/base64" "fmt" - "time" + "strings" - artifactsv1 "github.com/kloudlite/operator/apis/artifacts/v1" + klErrors "github.com/kloudlite/api/pkg/errors" + + "github.com/kloudlite/api/common" "github.com/kloudlite/operator/grpc-interfaces/grpc/messages" - "github.com/kloudlite/operator/pkg/kubectl" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/types" - - "kloudlite.io/apps/message-office/internal/domain" - "kloudlite.io/apps/message-office/internal/env" - "kloudlite.io/common" - "kloudlite.io/constants" - "kloudlite.io/grpc-interfaces/kloudlite.io/rpc/container_registry" - "kloudlite.io/pkg/logging" - "kloudlite.io/pkg/redpanda" + "github.com/pkg/errors" + "google.golang.org/grpc/metadata" + + "github.com/kloudlite/api/pkg/messaging" + msg_nats "github.com/kloudlite/api/pkg/messaging/nats" + "github.com/kloudlite/api/pkg/messaging/types" + "github.com/kloudlite/api/pkg/nats" + + "github.com/kloudlite/api/apps/message-office/internal/domain" + "github.com/kloudlite/api/apps/message-office/internal/env" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/logging" ) -type grpcServer struct { - messages.UnimplementedMessageDispatchServiceServer - logger logging.Logger +type ( + UpdatesProducer messaging.Producer + grpcServer struct { + messages.UnimplementedMessageDispatchServiceServer + logger logging.Logger - producer redpanda.Producer - consumers map[string]redpanda.Consumer - ev *env.Env + updatesProducer UpdatesProducer + consumers map[string]messaging.Consumer + ev *env.Env - domain domain.Domain + domain domain.Domain - containerRegistryCli container_registry.ContainerRegistryClient - k8sControllerCli kubectl.ControllerClient + createConsumer func(ctx context.Context, accountName string, clusterName string) (messaging.Consumer, error) - resourceUpdatesCounter int64 - infraUpdatesCounter int64 - errorMessagesCounter int64 - byocClientUpdatesCounter int64 -} + resourceUpdatesCounter int64 + infraUpdatesCounter int64 + crUpdatesCounter int64 + errorMessagesCounter int64 + clusterUpdatesCounter int64 + } +) -// ReceiveErrors implements messages.MessageDispatchServiceServer -func (g *grpcServer) ReceiveErrors(server messages.MessageDispatchService_ReceiveErrorsServer) error { - for { - errorMsg, err := server.Recv() - if err != nil { - return err - } +// ReceiveConsoleResourceUpdate implements messages.MessageDispatchServiceServer. +func (g *grpcServer) ReceiveConsoleResourceUpdate(ctx context.Context, msg *messages.ResourceUpdate) (*messages.Empty, error) { + logger := g.logger.WithKV("accountName", msg.AccountName).WithKV("cluster", msg.ClusterName) + logger.Debugf("console resource update request received") + defer func() { + logger.Debugf("console resource update request processed") + }() - g.errorMessagesCounter++ - g.logger.Infof("[%v] received error-on-apply message", g.errorMessagesCounter) - g.logger.Infof("[%v] [error]: %s\n", g.errorMessagesCounter, errorMsg.Data) + if _, _, err := validateAndDecodeAccessToken(msg.AccessToken, g.ev.TokenHashingSecret); err != nil { + return nil, err + } - if err := g.domain.ValidateAccessToken(server.Context(), errorMsg.AccessToken, errorMsg.AccountName, errorMsg.ClusterName); err != nil { - g.logger.Errorf(err, fmt.Sprintf("[%v] ERROR while validating access token", g.resourceUpdatesCounter)) - return err - } + if err := g.processConsoleResourceUpdate(ctx, msg); err != nil { + return nil, err + } - po, err := g.producer.Produce(server.Context(), g.ev.KafkaTopicErrorOnApply, errorMsg.ClusterName, errorMsg.Data) - if err != nil { - g.logger.Errorf(err, fmt.Sprintf("[%v] ERROR while producing to topic (%s)", g.resourceUpdatesCounter, g.ev.KafkaTopicErrorOnApply)) - return err - } - g.logger.WithKV("topic", g.ev.KafkaTopicErrorOnApply). - WithKV("parition", po.Partition). - WithKV("offset", po.Offset). - Infof("%v dispatched error-on-apply message", g.errorMessagesCounter) + return &messages.Empty{}, nil +} + +// ReceiveContainerRegistryUpdate implements messages.MessageDispatchServiceServer. +func (g *grpcServer) ReceiveContainerRegistryUpdate(ctx context.Context, msg *messages.ResourceUpdate) (*messages.Empty, error) { + logger := g.logger.WithKV("accountName", msg.AccountName).WithKV("cluster", msg.ClusterName) + logger.Debugf("container registry resource update request received") + defer func() { + logger.Debugf("container registry resource update request processed") + }() + + if _, _, err := validateAndDecodeAccessToken(msg.AccessToken, g.ev.TokenHashingSecret); err != nil { + return nil, err + } + + if err := g.processContainerRegistryResourceUpdate(ctx, msg); err != nil { + return nil, err } + + return &messages.Empty{}, nil } -// GetAccessToken implements messages.MessageDispatchServiceServer -func (g *grpcServer) GetAccessToken(ctx context.Context, msg *messages.GetClusterTokenIn) (*messages.GetClusterTokenOut, error) { - g.logger.Infof("request received for clustertoken: %s", msg.ClusterToken) +// ReceiveError implements messages.MessageDispatchServiceServer. +func (g *grpcServer) ReceiveError(ctx context.Context, msg *messages.ErrorData) (*messages.Empty, error) { + logger := g.logger.WithKV("accountName", msg.AccountName).WithKV("cluster", msg.ClusterName) + logger.Debugf("request received for access token validation") + isValid := true + defer func() { - g.logger.Infof("request processed for clustertoken: %s", msg.ClusterToken) + logger.Debugf("is access token valid? (%v)", isValid) }() - record, err := g.domain.GenAccessToken(ctx, msg.ClusterToken) - if err != nil { + if _, _, err := validateAndDecodeAccessToken(msg.AccessToken, g.ev.TokenHashingSecret); err != nil { return nil, err } - var hu artifactsv1.HarborUserAccount - if err := g.k8sControllerCli.Get(ctx, types.NamespacedName{Namespace: constants.NamespaceCore, Name: record.AccountName}, &hu); err != nil { + if err := g.processError(ctx, msg.AccountName, msg.ClusterName, msg.Message); err != nil { return nil, err } - var harborSecret corev1.Secret - if err := g.k8sControllerCli.Get(ctx, types.NamespacedName{Namespace: constants.NamespaceCore, Name: hu.Spec.TargetSecret}, &harborSecret); err != nil { + return &messages.Empty{}, nil +} + +// ReceiveInfraResourceUpdate implements messages.MessageDispatchServiceServer. +func (g *grpcServer) ReceiveInfraResourceUpdate(ctx context.Context, msg *messages.ResourceUpdate) (*messages.Empty, error) { + logger := g.logger.WithKV("accountName", msg.AccountName).WithKV("cluster", msg.ClusterName) + logger.Debugf("infra resource update request received") + defer func() { + logger.Debugf("infra resource update request processed") + }() + + if _, _, err := validateAndDecodeAccessToken(msg.AccessToken, g.ev.TokenHashingSecret); err != nil { return nil, err } - return &messages.GetClusterTokenOut{ - AccessToken: record.AccessToken, - HarborDockerConfigJson: string(harborSecret.Data[".dockerconfigjson"]), - }, nil + if err := g.processInfraResourceUpdate(ctx, msg); err != nil { + return nil, err + } + + return &messages.Empty{}, nil } -func (g *grpcServer) createConsumer(ev *env.Env, topicName string) (redpanda.Consumer, error) { - return redpanda.NewConsumer(ev.KafkaBrokers, ev.KafkaConsumerGroup, redpanda.ConsumerOpts{ - // SASLAuth: &redpanda.KafkaSASLAuth{ - // SASLMechanism: redpanda.ScramSHA256, - // User: ev.KafkaSaslUsername, - // Password: ev.KafkaSaslPassword, - // }, - Logger: g.logger.WithName("g-consumer"), - }, []string{topicName}) +// ReceiveError implements messages.MessageDispatchServiceServer. +// func (g *grpcServer) ReceiveError(ctx context.Context, msg *messages.ErrorData) (*messages.Empty, error) { +// } + +// Ping implements messages.MessageDispatchServiceServer. +func (*grpcServer) Ping(context.Context, *messages.Empty) (*messages.PingOutput, error) { + return &messages.PingOutput{Ok: true}, nil +} + +func encodeAccessToken(accountName, clusterName, clusterToken string, tokenSecret string) string { + info := fmt.Sprintf("account=%s;cluster=%s;cluster-token=%s", accountName, clusterName, clusterToken) + + fn.FxErrorHandler() + + h := sha256.New() + h.Write([]byte(info + tokenSecret)) + sum := fmt.Sprintf("%x", h.Sum(nil)) + + info += fmt.Sprintf(";sha256sum=%s", sum) + + return base64.StdEncoding.EncodeToString([]byte(info)) } -func (g grpcServer) SendActions( - request *messages.StreamActionsRequest, - server messages.MessageDispatchService_SendActionsServer, -) error { - if err := g.domain.ValidateAccessToken(server.Context(), request.AccessToken, request.AccountName, request.ClusterName); err != nil { - return err +func validateAndDecodeAccessToken(accessToken string, tokenSecret string) (accountName string, clusterName string, err error) { + b, err := base64.StdEncoding.DecodeString(accessToken) + if err != nil { + return "", "", errors.Wrap(err, "invalid access token, incorrect format") } - key := fmt.Sprintf("%s/%s", request.AccountName, request.ClusterName) + info := string(b) - consumer, err := func() (redpanda.Consumer, error) { - if c, ok := g.consumers[key]; ok { - return c, nil + sp := strings.SplitN(info, ";sha256sum=", 2) + if len(sp) != 2 { + return "", "", errors.New("invalid access token, incorrect format") + } + data := sp[0] + sum := sp[1] + + h := sha256.New() + h.Write([]byte(data + tokenSecret)) + calculatedSum := fmt.Sprintf("%x", h.Sum(nil)) + + if sum != calculatedSum { + return "", "", errors.New("invalid access token, checksum mismatch") + } + + s := strings.SplitN(data, ";", 3) + if len(s) != 3 { + return "", "", errors.New("invalid access token, incorrect data format") + } + + for _, v := range s { + sp := strings.SplitN(v, "=", 2) + if len(sp) != 2 { + return "", "", errors.New("invalid access token, incorrect data format") } - c, err := g.createConsumer( - g.ev, - common.GetKafkaTopicName(request.AccountName, request.ClusterName), - ) - if err != nil { - return nil, err + if sp[0] == "account" { + accountName = sp[1] } - if err := c.Ping(server.Context()); err != nil { - return nil, err + if sp[0] == "cluster" { + clusterName = sp[1] } - g.consumers[key] = c - return c, nil - }() - if err != nil { - return err } - go func() { - <-server.Context().Done() - g.logger.Debugf("server context has been closed") - delete(g.consumers, key) - consumer.Close() - }() + return accountName, clusterName, nil +} + +func validateAndDecodeFromGrpcContext(ctx context.Context, tokenSecret string) (accountName string, clusterName string, err error) { + authToken := metadata.ValueFromIncomingContext(ctx, "authorization") + if len(authToken) != 1 { + return "", "", errors.New("no authorization header passed") + } + + return validateAndDecodeAccessToken(authToken[0], tokenSecret) +} + +func (g *grpcServer) validateAndDecodeFromGrpcContext(grpcServerCtx context.Context, tokenSecret string) (accountName string, clusterName string, err error) { + authToken := metadata.ValueFromIncomingContext(grpcServerCtx, "authorization") + if len(authToken) != 1 { + return "", "", errors.New("no authorization header passed") + } + + if authToken[0] != g.ev.PlatformAccessToken { + return validateAndDecodeAccessToken(authToken[0], tokenSecret) + } + + splits := strings.Split(authToken[0], ";") + for _, v := range splits { + sp := strings.SplitN(v, "=", 2) + if len(sp) != 2 { + return "", "", errors.New("invalid access token, incorrect data format") + } + if sp[0] == "account" { + accountName = sp[1] + } + if sp[0] == "cluster" { + clusterName = sp[1] + } + } + + return accountName, clusterName, nil +} +func (g *grpcServer) ValidateAccessToken(ctx context.Context, msg *messages.ValidateAccessTokenIn) (*messages.ValidateAccessTokenOut, error) { + logger := g.logger.WithKV("accountName", msg.AccountName).WithKV("cluster", msg.ClusterName) + logger.Debugf("request received for access token validation") + isValid := true defer func() { - g.logger.Debugf("kafka consumer has been closed") - delete(g.consumers, key) - consumer.Close() + logger.Debugf("is access token valid? (%v)", isValid) }() - consumer.StartConsumingSync(func(msg []byte, timeStamp time.Time, offset int64) error { - g.logger.WithKV("timestamp", timeStamp).Infof("received message") - defer func() { - g.logger.WithKV("timestamp", timeStamp).Infof("processed message") - }() - return server.Send(&messages.Action{Data: msg}) - }) - return nil + if msg.AccessToken == g.ev.PlatformAccessToken { + return &messages.ValidateAccessTokenOut{Valid: true}, nil + } + + if _, _, err := validateAndDecodeAccessToken(msg.AccessToken, g.ev.TokenHashingSecret); err != nil { + isValid = false + } + return &messages.ValidateAccessTokenOut{Valid: isValid}, nil } -func (g *grpcServer) ReceiveResourceUpdates(server messages.MessageDispatchService_ReceiveResourceUpdatesServer) error { - for { - statusMsg, err := server.Recv() +func (g *grpcServer) processError(ctx context.Context, accountName string, clusterName string, msg []byte) (err error) { + g.errorMessagesCounter++ + logger := g.logger.WithKV("accountName", accountName).WithKV("cluster", clusterName) + + logger.Infof("[%v] received error-on-apply message", g.errorMessagesCounter) + defer func() { if err != nil { - return err + err = errors.Wrap(err, fmt.Sprintf("[%v] (with ERROR) processed error-on-apply message", g.clusterUpdatesCounter)) + logger.Errorf(err) + return } + logger.Infof("[%v] processed error-on-apply message", g.infraUpdatesCounter) + }() - g.resourceUpdatesCounter++ - g.logger.Infof("[%v] received status update", g.resourceUpdatesCounter) + msgTopic := common.GetPlatformClusterMessagingTopic(accountName, clusterName, common.InfraReceiver, common.EventErrorOnApply) + if err := g.updatesProducer.Produce(ctx, types.ProduceMsg{Subject: msgTopic, Payload: msg}); err != nil { + return errors.Wrap(err, fmt.Sprintf("while producing to topic (%s)", msgTopic)) + } - if err = g.domain.ValidateAccessToken(server.Context(), statusMsg.AccessToken, statusMsg.AccountName, statusMsg.ClusterName); err != nil { - g.logger.Errorf(err, fmt.Sprintf("[%v] ERROR while processing resource update", g.resourceUpdatesCounter)) - return err - } + logger.Infof("[%v] dispatched error-on-apply message to %s receiver", g.errorMessagesCounter, common.InfraReceiver) - po, err := g.producer.Produce(server.Context(), g.ev.KafkaTopicStatusUpdates, statusMsg.ClusterName, statusMsg.Message) - if err != nil { - g.logger.Errorf(err, fmt.Sprintf("[%v] ERROR while processing resource update", g.resourceUpdatesCounter)) - return err - } - g.logger.Infof("[%v] processed status update", g.resourceUpdatesCounter) - g.logger.WithKV("topic", g.ev.KafkaTopicStatusUpdates).WithKV("parition", po.Partition).WithKV("offset", po.Offset).Infof("%v dispatched status updates", g.resourceUpdatesCounter) + msgTopic = common.GetPlatformClusterMessagingTopic(accountName, clusterName, common.ConsoleReceiver, common.EventErrorOnApply) + if err := g.updatesProducer.Produce(ctx, types.ProduceMsg{Subject: msgTopic, Payload: msg}); err != nil { + return errors.Wrap(err, fmt.Sprintf("while producing to topic (%s)", msgTopic)) + } + logger.Infof("[%v] dispatched error-on-apply message to %s receiver", g.errorMessagesCounter, common.ConsoleReceiver) + + msgTopic = common.GetPlatformClusterMessagingTopic(accountName, clusterName, common.ContainerRegistryReceiver, common.EventErrorOnApply) + if err := g.updatesProducer.Produce(ctx, types.ProduceMsg{Subject: msgTopic, Payload: msg}); err != nil { + return errors.Wrap(err, fmt.Sprintf("while producing to topic (%s)", msgTopic)) + } + logger.Infof("[%v] dispatched error-on-apply message to %s receiver", g.errorMessagesCounter, common.ContainerRegistryReceiver) + + return nil +} + +// GetAccessToken implements messages.MessageDispatchServiceServer +func (g *grpcServer) GetAccessToken(ctx context.Context, msg *messages.GetClusterTokenIn) (*messages.GetClusterTokenOut, error) { + g.logger.Infof("request received for cluster-token (%q) exchange", msg.ClusterToken) + + ct, err := g.domain.GetClusterToken(ctx, msg.AccountName, msg.ClusterName) + if err != nil { + return nil, klErrors.NewE(err) + } + if ct != msg.ClusterToken { + return nil, errors.New("invalid cluster-token,account-name,cluster-name triplet") } + + s := encodeAccessToken(msg.AccountName, msg.ClusterName, msg.ClusterToken, g.ev.TokenHashingSecret) + g.logger.Infof("SUCCESSFUL cluster-token exchange for account=%q, cluster=%q", msg.ClusterToken, msg.AccountName, msg.ClusterName) + + return &messages.GetClusterTokenOut{ + AccessToken: s, + }, nil } -func (g *grpcServer) ReceiveBYOCClientUpdates(server messages.MessageDispatchService_ReceiveBYOCClientUpdatesServer) (err error) { - for { - clientUpdateMsg, err := server.Recv() - if err != nil { - return err - } +func (g *grpcServer) SendActions(request *messages.Empty, server messages.MessageDispatchService_SendActionsServer) error { + accountName, clusterName, err := g.validateAndDecodeFromGrpcContext(server.Context(), g.ev.TokenHashingSecret) + if err != nil { + return klErrors.NewE(err) + } + + logger := g.logger.WithKV("accountName", accountName, "clusterName", clusterName) + logger.Infof("request received for sending actions to cluster") + defer func() { + logger.Infof("stopped sending actions to cluster") + }() - g.byocClientUpdatesCounter++ - g.logger.Infof("[%v] received byoc client update", g.byocClientUpdatesCounter) + key := fmt.Sprintf("%s/%s", accountName, clusterName) - if err = g.domain.ValidateAccessToken(server.Context(), clientUpdateMsg.AccessToken, clientUpdateMsg.AccountName, clientUpdateMsg.ClusterName); err != nil { - g.logger.Errorf(err, fmt.Sprintf("[%v] ERROR while processing BYOC Client update message", g.resourceUpdatesCounter)) - return err + consumer, err := g.createConsumer(server.Context(), accountName, clusterName) + if err != nil { + return klErrors.NewE(err) + } + + logger.Infof("consumer is available now") + + go func() { + <-server.Context().Done() + logger.Debugf("server context has been closed") + delete(g.consumers, key) + if err := consumer.Stop(context.TODO()); err != nil { + logger.Errorf(err, "while stopping consumer") } + logger.Infof("consumer is closed now") + }() - po, err := g.producer.Produce(server.Context(), g.ev.KafkaTopicBYOCClientUpdates, clientUpdateMsg.ClusterName, clientUpdateMsg.Message) + if err := consumer.Consume(func(msg *types.ConsumeMsg) error { + logger.WithKV("subject", msg.Subject).Infof("read message from consumer") + defer func() { + logger.WithKV("subject", msg.Subject).Infof("dispatched message to agent") + }() + return server.Send(&messages.Action{Message: msg.Payload}) + }, types.ConsumeOpts{ + OnError: func(error) error { + logger.Infof("error occurrred on agent side, while parsing/applying the message, ignoring as we don't want to block the queue") + return nil + }, + }); err != nil { + logger.Errorf(err, "while consuming messages from consumer") + } + + return nil +} + +func (g *grpcServer) processConsoleResourceUpdate(ctx context.Context, msg *messages.ResourceUpdate) (err error) { + g.resourceUpdatesCounter++ + + logger := g.logger.WithKV("accountName", msg.AccountName).WithKV("clusterName", msg.ClusterName).WithKV("component", "console-resource-update") + logger.Infof("[%v] received resource status update", g.resourceUpdatesCounter) + defer func() { if err != nil { - g.logger.Errorf(err, fmt.Sprintf("[%v] ERROR while processing BYOC Client update message", g.resourceUpdatesCounter)) - return err + err = errors.Wrap(err, fmt.Sprintf("[%v] (with ERROR) processed resource status update", g.clusterUpdatesCounter)) + logger.Errorf(err) + return } - g.logger.Infof("[%v] processed BYOC Client ClientUpdate", g.byocClientUpdatesCounter) - g.logger.WithKV("topic", g.ev.KafkaTopicBYOCClientUpdates). - WithKV("parition", po.Partition). - WithKV("offset", po.Offset). - Infof("%v dispatched byoc client updates", g.byocClientUpdatesCounter) + logger.Infof("[%v] processed resource status update", g.resourceUpdatesCounter) + }() + + msgTopic := common.GetPlatformClusterMessagingTopic(msg.AccountName, msg.ClusterName, common.ConsoleReceiver, common.EventResourceUpdate) + if err := g.updatesProducer.Produce(ctx, types.ProduceMsg{ + Subject: msgTopic, + Payload: msg.Message, + }); err != nil { + return errors.Wrap(err, fmt.Sprintf("while producing resource update to topic %q", msgTopic)) } + + logger.Infof("[%v] dispatched resource updates to topic %q", g.resourceUpdatesCounter, msgTopic) + return nil } -// ReceiveInfraUpdates implements messages.MessageDispatchServiceServer -func (g *grpcServer) ReceiveInfraUpdates( - server messages.MessageDispatchService_ReceiveInfraUpdatesServer, -) (err error) { - for { - statusMsg, err := server.Recv() +func (g *grpcServer) processInfraResourceUpdate(ctx context.Context, msg *messages.ResourceUpdate) (err error) { + g.infraUpdatesCounter++ + logger := g.logger.WithKV("accountName", msg.AccountName).WithKV("clusterName", msg.ClusterName).WithKV("component", "infra-resource-update") + + logger.Infof("[%v] received infra update", g.infraUpdatesCounter) + defer func() { if err != nil { - return err + err = errors.Wrap(err, fmt.Sprintf("[%v] (with ERROR) processed infra update", g.infraUpdatesCounter)) + logger.Errorf(err) + return } + logger.Infof("[%v] processed infra update", g.infraUpdatesCounter) + }() - g.infraUpdatesCounter++ - g.logger.Infof("%v received infra update", g.infraUpdatesCounter) + msgTopic := common.GetPlatformClusterMessagingTopic(msg.AccountName, msg.ClusterName, common.InfraReceiver, common.EventResourceUpdate) + if err := g.updatesProducer.Produce(ctx, types.ProduceMsg{ + Subject: msgTopic, + Payload: msg.Message, + }); err != nil { + return errors.Wrap(err, fmt.Sprintf("while producing resource update to topic %q", msgTopic)) + } - defer func() { - if err != nil { - g.logger.Errorf( - err, - fmt.Sprintf("[%v] ERROR while processing infra update", g.infraUpdatesCounter), - ) - return - } - g.logger.Infof("[%v] processed infra update", g.infraUpdatesCounter) - }() + logger.Infof("[%v] processed infra update", g.infraUpdatesCounter) + return nil +} - if err := g.domain.ValidateAccessToken(server.Context(), statusMsg.AccessToken, statusMsg.AccountName, statusMsg.ClusterName); err != nil { - return err - } +func (g *grpcServer) processContainerRegistryResourceUpdate(ctx context.Context, msg *messages.ResourceUpdate) (err error) { + g.crUpdatesCounter++ + logger := g.logger.WithKV("accountName", msg.AccountName).WithKV("clusterName", msg.ClusterName).WithKV("component", "container-registry-update") - po, err := g.producer.Produce( - server.Context(), - g.ev.KafkaTopicInfraUpdates, - statusMsg.ClusterName, - statusMsg.Message, - ) + logger.Infof("[%v] received cr update", g.crUpdatesCounter) + defer func() { if err != nil { - return err + err = errors.Wrap(err, fmt.Sprintf("[%v] (with ERROR) processed cr update", g.crUpdatesCounter)) + logger.Errorf(err) + return } - g.logger.WithKV("topic", g.ev.KafkaTopicInfraUpdates). - WithKV("parition", po.Partition). - WithKV("offset", po.Offset). - Infof("%v dispatched infra updates", g.infraUpdatesCounter) + logger.Infof("[%v] processed cr update", g.crUpdatesCounter) + }() + + msgTopic := common.GetPlatformClusterMessagingTopic(msg.AccountName, msg.ClusterName, common.ContainerRegistryReceiver, common.EventResourceUpdate) + if err := g.updatesProducer.Produce(ctx, types.ProduceMsg{ + Subject: msgTopic, + Payload: msg.Message, + }); err != nil { + return errors.Wrap(err, fmt.Sprintf("while producing resource update to topic %q", msgTopic)) } + + logger.Infof("[%v] processed cr update", g.crUpdatesCounter) + return nil +} + +func NewMessageOfficeServer(producer UpdatesProducer, jc *nats.JetstreamClient, ev *env.Env, d domain.Domain, logger logging.Logger) (messages.MessageDispatchServiceServer, error) { + return &grpcServer{ + UnimplementedMessageDispatchServiceServer: messages.UnimplementedMessageDispatchServiceServer{}, + logger: logger, + updatesProducer: producer, + consumers: map[string]messaging.Consumer{}, + ev: ev, + domain: d, + createConsumer: func(ctx context.Context, accountName string, clusterName string) (messaging.Consumer, error) { + name := fmt.Sprintf("tenant-consumer-for-account-%s-cluster-%s", accountName, clusterName) + + return msg_nats.NewJetstreamConsumer(ctx, jc, msg_nats.JetstreamConsumerArgs{ + Stream: ev.NatsStream, + ConsumerConfig: msg_nats.ConsumerConfig{ + Name: name, + Durable: name, + Description: "this consumer consumes messages from platform, and dispatches them to the tenant cluster via kloudlite agent", + FilterSubjects: []string{ + common.GetTenantClusterMessagingTopic(accountName, clusterName), + }, + }, + }) + }, + }, nil } diff --git a/apps/message-office/internal/app/internal-grpc-server.go b/apps/message-office/internal/app/internal-grpc-server.go new file mode 100644 index 000000000..75e0e1936 --- /dev/null +++ b/apps/message-office/internal/app/internal-grpc-server.go @@ -0,0 +1,27 @@ +package app + +import ( + "context" + "github.com/kloudlite/api/apps/message-office/internal/domain" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/message-office-internal" + "github.com/kloudlite/api/pkg/errors" +) + +type internalMsgServer struct { + d domain.Domain + message_office_internal.UnimplementedMessageOfficeInternalServer +} + +func (s *internalMsgServer) GenerateClusterToken(ctx context.Context, in *message_office_internal.GenerateClusterTokenIn) (*message_office_internal.GenerateClusterTokenOut, error) { + token, err := s.d.GenClusterToken(ctx, in.AccountName, in.ClusterName) + if err != nil { + return nil, errors.NewE(err) + } + return &message_office_internal.GenerateClusterTokenOut{ + ClusterToken: token, + }, nil +} + +func newInternalMsgServer(d domain.Domain) *internalMsgServer { + return &internalMsgServer{d: d} +} diff --git a/apps/message-office/internal/app/proto-rpc/event.pb.go b/apps/message-office/internal/app/proto-rpc/event.pb.go new file mode 100644 index 000000000..158f7ab31 --- /dev/null +++ b/apps/message-office/internal/app/proto-rpc/event.pb.go @@ -0,0 +1,3110 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v4.23.3 +// source: internal/app/proto/event.proto + +package proto_rpc + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ValueNull int32 + +const ( + ValueNull_NULL_VALUE ValueNull = 0 +) + +// Enum value maps for ValueNull. +var ( + ValueNull_name = map[int32]string{ + 0: "NULL_VALUE", + } + ValueNull_value = map[string]int32{ + "NULL_VALUE": 0, + } +) + +func (x ValueNull) Enum() *ValueNull { + p := new(ValueNull) + *p = x + return p +} + +func (x ValueNull) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ValueNull) Descriptor() protoreflect.EnumDescriptor { + return file_internal_app_proto_event_proto_enumTypes[0].Descriptor() +} + +func (ValueNull) Type() protoreflect.EnumType { + return &file_internal_app_proto_event_proto_enumTypes[0] +} + +func (x ValueNull) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ValueNull.Descriptor instead. +func (ValueNull) EnumDescriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{0} +} + +type StatisticKind int32 + +const ( + StatisticKind_Histogram StatisticKind = 0 + StatisticKind_Summary StatisticKind = 1 +) + +// Enum value maps for StatisticKind. +var ( + StatisticKind_name = map[int32]string{ + 0: "Histogram", + 1: "Summary", + } + StatisticKind_value = map[string]int32{ + "Histogram": 0, + "Summary": 1, + } +) + +func (x StatisticKind) Enum() *StatisticKind { + p := new(StatisticKind) + *p = x + return p +} + +func (x StatisticKind) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (StatisticKind) Descriptor() protoreflect.EnumDescriptor { + return file_internal_app_proto_event_proto_enumTypes[1].Descriptor() +} + +func (StatisticKind) Type() protoreflect.EnumType { + return &file_internal_app_proto_event_proto_enumTypes[1] +} + +func (x StatisticKind) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use StatisticKind.Descriptor instead. +func (StatisticKind) EnumDescriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{1} +} + +type Metric_Kind int32 + +const ( + Metric_Incremental Metric_Kind = 0 + Metric_Absolute Metric_Kind = 1 +) + +// Enum value maps for Metric_Kind. +var ( + Metric_Kind_name = map[int32]string{ + 0: "Incremental", + 1: "Absolute", + } + Metric_Kind_value = map[string]int32{ + "Incremental": 0, + "Absolute": 1, + } +) + +func (x Metric_Kind) Enum() *Metric_Kind { + p := new(Metric_Kind) + *p = x + return p +} + +func (x Metric_Kind) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Metric_Kind) Descriptor() protoreflect.EnumDescriptor { + return file_internal_app_proto_event_proto_enumTypes[2].Descriptor() +} + +func (Metric_Kind) Type() protoreflect.EnumType { + return &file_internal_app_proto_event_proto_enumTypes[2] +} + +func (x Metric_Kind) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Metric_Kind.Descriptor instead. +func (Metric_Kind) EnumDescriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{10, 0} +} + +type EventArray struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Events: + // + // *EventArray_Logs + // *EventArray_Metrics + // *EventArray_Traces + Events isEventArray_Events `protobuf_oneof:"events"` +} + +func (x *EventArray) Reset() { + *x = EventArray{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventArray) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventArray) ProtoMessage() {} + +func (x *EventArray) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EventArray.ProtoReflect.Descriptor instead. +func (*EventArray) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{0} +} + +func (m *EventArray) GetEvents() isEventArray_Events { + if m != nil { + return m.Events + } + return nil +} + +func (x *EventArray) GetLogs() *LogArray { + if x, ok := x.GetEvents().(*EventArray_Logs); ok { + return x.Logs + } + return nil +} + +func (x *EventArray) GetMetrics() *MetricArray { + if x, ok := x.GetEvents().(*EventArray_Metrics); ok { + return x.Metrics + } + return nil +} + +func (x *EventArray) GetTraces() *TraceArray { + if x, ok := x.GetEvents().(*EventArray_Traces); ok { + return x.Traces + } + return nil +} + +type isEventArray_Events interface { + isEventArray_Events() +} + +type EventArray_Logs struct { + Logs *LogArray `protobuf:"bytes,1,opt,name=logs,proto3,oneof"` +} + +type EventArray_Metrics struct { + Metrics *MetricArray `protobuf:"bytes,2,opt,name=metrics,proto3,oneof"` +} + +type EventArray_Traces struct { + Traces *TraceArray `protobuf:"bytes,3,opt,name=traces,proto3,oneof"` +} + +func (*EventArray_Logs) isEventArray_Events() {} + +func (*EventArray_Metrics) isEventArray_Events() {} + +func (*EventArray_Traces) isEventArray_Events() {} + +type LogArray struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Logs []*Log `protobuf:"bytes,1,rep,name=logs,proto3" json:"logs,omitempty"` +} + +func (x *LogArray) Reset() { + *x = LogArray{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LogArray) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LogArray) ProtoMessage() {} + +func (x *LogArray) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LogArray.ProtoReflect.Descriptor instead. +func (*LogArray) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{1} +} + +func (x *LogArray) GetLogs() []*Log { + if x != nil { + return x.Logs + } + return nil +} + +type MetricArray struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Metrics []*Metric `protobuf:"bytes,1,rep,name=metrics,proto3" json:"metrics,omitempty"` +} + +func (x *MetricArray) Reset() { + *x = MetricArray{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MetricArray) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MetricArray) ProtoMessage() {} + +func (x *MetricArray) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MetricArray.ProtoReflect.Descriptor instead. +func (*MetricArray) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{2} +} + +func (x *MetricArray) GetMetrics() []*Metric { + if x != nil { + return x.Metrics + } + return nil +} + +type TraceArray struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Traces []*Trace `protobuf:"bytes,1,rep,name=traces,proto3" json:"traces,omitempty"` +} + +func (x *TraceArray) Reset() { + *x = TraceArray{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TraceArray) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TraceArray) ProtoMessage() {} + +func (x *TraceArray) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TraceArray.ProtoReflect.Descriptor instead. +func (*TraceArray) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{3} +} + +func (x *TraceArray) GetTraces() []*Trace { + if x != nil { + return x.Traces + } + return nil +} + +type EventWrapper struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Event: + // + // *EventWrapper_Log + // *EventWrapper_Metric + // *EventWrapper_Trace + Event isEventWrapper_Event `protobuf_oneof:"event"` +} + +func (x *EventWrapper) Reset() { + *x = EventWrapper{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventWrapper) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventWrapper) ProtoMessage() {} + +func (x *EventWrapper) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EventWrapper.ProtoReflect.Descriptor instead. +func (*EventWrapper) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{4} +} + +func (m *EventWrapper) GetEvent() isEventWrapper_Event { + if m != nil { + return m.Event + } + return nil +} + +func (x *EventWrapper) GetLog() *Log { + if x, ok := x.GetEvent().(*EventWrapper_Log); ok { + return x.Log + } + return nil +} + +func (x *EventWrapper) GetMetric() *Metric { + if x, ok := x.GetEvent().(*EventWrapper_Metric); ok { + return x.Metric + } + return nil +} + +func (x *EventWrapper) GetTrace() *Trace { + if x, ok := x.GetEvent().(*EventWrapper_Trace); ok { + return x.Trace + } + return nil +} + +type isEventWrapper_Event interface { + isEventWrapper_Event() +} + +type EventWrapper_Log struct { + Log *Log `protobuf:"bytes,1,opt,name=log,proto3,oneof"` +} + +type EventWrapper_Metric struct { + Metric *Metric `protobuf:"bytes,2,opt,name=metric,proto3,oneof"` +} + +type EventWrapper_Trace struct { + Trace *Trace `protobuf:"bytes,3,opt,name=trace,proto3,oneof"` +} + +func (*EventWrapper_Log) isEventWrapper_Event() {} + +func (*EventWrapper_Metric) isEventWrapper_Event() {} + +func (*EventWrapper_Trace) isEventWrapper_Event() {} + +type Log struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Deprecated, use value instead + Fields map[string]*Value `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Value *Value `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + Metadata *Value `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (x *Log) Reset() { + *x = Log{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Log) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Log) ProtoMessage() {} + +func (x *Log) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Log.ProtoReflect.Descriptor instead. +func (*Log) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{5} +} + +func (x *Log) GetFields() map[string]*Value { + if x != nil { + return x.Fields + } + return nil +} + +func (x *Log) GetValue() *Value { + if x != nil { + return x.Value + } + return nil +} + +func (x *Log) GetMetadata() *Value { + if x != nil { + return x.Metadata + } + return nil +} + +type Trace struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Fields map[string]*Value `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Metadata *Value `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (x *Trace) Reset() { + *x = Trace{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Trace) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Trace) ProtoMessage() {} + +func (x *Trace) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Trace.ProtoReflect.Descriptor instead. +func (*Trace) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{6} +} + +func (x *Trace) GetFields() map[string]*Value { + if x != nil { + return x.Fields + } + return nil +} + +func (x *Trace) GetMetadata() *Value { + if x != nil { + return x.Metadata + } + return nil +} + +type ValueMap struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Fields map[string]*Value `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *ValueMap) Reset() { + *x = ValueMap{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValueMap) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValueMap) ProtoMessage() {} + +func (x *ValueMap) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValueMap.ProtoReflect.Descriptor instead. +func (*ValueMap) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{7} +} + +func (x *ValueMap) GetFields() map[string]*Value { + if x != nil { + return x.Fields + } + return nil +} + +type ValueArray struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Items []*Value `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` +} + +func (x *ValueArray) Reset() { + *x = ValueArray{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValueArray) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValueArray) ProtoMessage() {} + +func (x *ValueArray) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValueArray.ProtoReflect.Descriptor instead. +func (*ValueArray) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{8} +} + +func (x *ValueArray) GetItems() []*Value { + if x != nil { + return x.Items + } + return nil +} + +type Value struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Kind: + // + // *Value_RawBytes + // *Value_Timestamp + // *Value_Integer + // *Value_Float + // *Value_Boolean + // *Value_Map + // *Value_Array + // *Value_Null + Kind isValue_Kind `protobuf_oneof:"kind"` +} + +func (x *Value) Reset() { + *x = Value{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Value) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Value) ProtoMessage() {} + +func (x *Value) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Value.ProtoReflect.Descriptor instead. +func (*Value) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{9} +} + +func (m *Value) GetKind() isValue_Kind { + if m != nil { + return m.Kind + } + return nil +} + +func (x *Value) GetRawBytes() []byte { + if x, ok := x.GetKind().(*Value_RawBytes); ok { + return x.RawBytes + } + return nil +} + +func (x *Value) GetTimestamp() *timestamppb.Timestamp { + if x, ok := x.GetKind().(*Value_Timestamp); ok { + return x.Timestamp + } + return nil +} + +func (x *Value) GetInteger() int64 { + if x, ok := x.GetKind().(*Value_Integer); ok { + return x.Integer + } + return 0 +} + +func (x *Value) GetFloat() float64 { + if x, ok := x.GetKind().(*Value_Float); ok { + return x.Float + } + return 0 +} + +func (x *Value) GetBoolean() bool { + if x, ok := x.GetKind().(*Value_Boolean); ok { + return x.Boolean + } + return false +} + +func (x *Value) GetMap() *ValueMap { + if x, ok := x.GetKind().(*Value_Map); ok { + return x.Map + } + return nil +} + +func (x *Value) GetArray() *ValueArray { + if x, ok := x.GetKind().(*Value_Array); ok { + return x.Array + } + return nil +} + +func (x *Value) GetNull() ValueNull { + if x, ok := x.GetKind().(*Value_Null); ok { + return x.Null + } + return ValueNull_NULL_VALUE +} + +type isValue_Kind interface { + isValue_Kind() +} + +type Value_RawBytes struct { + RawBytes []byte `protobuf:"bytes,1,opt,name=raw_bytes,json=rawBytes,proto3,oneof"` +} + +type Value_Timestamp struct { + Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3,oneof"` +} + +type Value_Integer struct { + Integer int64 `protobuf:"varint,4,opt,name=integer,proto3,oneof"` +} + +type Value_Float struct { + Float float64 `protobuf:"fixed64,5,opt,name=float,proto3,oneof"` +} + +type Value_Boolean struct { + Boolean bool `protobuf:"varint,6,opt,name=boolean,proto3,oneof"` +} + +type Value_Map struct { + Map *ValueMap `protobuf:"bytes,7,opt,name=map,proto3,oneof"` +} + +type Value_Array struct { + Array *ValueArray `protobuf:"bytes,8,opt,name=array,proto3,oneof"` +} + +type Value_Null struct { + Null ValueNull `protobuf:"varint,9,opt,name=null,proto3,enum=vector.ValueNull,oneof"` +} + +func (*Value_RawBytes) isValue_Kind() {} + +func (*Value_Timestamp) isValue_Kind() {} + +func (*Value_Integer) isValue_Kind() {} + +func (*Value_Float) isValue_Kind() {} + +func (*Value_Boolean) isValue_Kind() {} + +func (*Value_Map) isValue_Kind() {} + +func (*Value_Array) isValue_Kind() {} + +func (*Value_Null) isValue_Kind() {} + +type Metric struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + TagsV1 map[string]string `protobuf:"bytes,3,rep,name=tags_v1,json=tagsV1,proto3" json:"tags_v1,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + TagsV2 map[string]*TagValues `protobuf:"bytes,20,rep,name=tags_v2,json=tagsV2,proto3" json:"tags_v2,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Kind Metric_Kind `protobuf:"varint,4,opt,name=kind,proto3,enum=vector.Metric_Kind" json:"kind,omitempty"` + // Types that are assignable to Value: + // + // *Metric_Counter + // *Metric_Gauge + // *Metric_Set + // *Metric_Distribution1 + // *Metric_AggregatedHistogram1 + // *Metric_AggregatedSummary1 + // *Metric_Distribution2 + // *Metric_AggregatedHistogram2 + // *Metric_AggregatedSummary2 + // *Metric_Sketch + // *Metric_AggregatedHistogram3 + // *Metric_AggregatedSummary3 + Value isMetric_Value `protobuf_oneof:"value"` + Namespace string `protobuf:"bytes,11,opt,name=namespace,proto3" json:"namespace,omitempty"` + IntervalMs uint32 `protobuf:"varint,18,opt,name=interval_ms,json=intervalMs,proto3" json:"interval_ms,omitempty"` + Metadata *Value `protobuf:"bytes,19,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (x *Metric) Reset() { + *x = Metric{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Metric) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Metric) ProtoMessage() {} + +func (x *Metric) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Metric.ProtoReflect.Descriptor instead. +func (*Metric) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{10} +} + +func (x *Metric) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Metric) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +func (x *Metric) GetTagsV1() map[string]string { + if x != nil { + return x.TagsV1 + } + return nil +} + +func (x *Metric) GetTagsV2() map[string]*TagValues { + if x != nil { + return x.TagsV2 + } + return nil +} + +func (x *Metric) GetKind() Metric_Kind { + if x != nil { + return x.Kind + } + return Metric_Incremental +} + +func (m *Metric) GetValue() isMetric_Value { + if m != nil { + return m.Value + } + return nil +} + +func (x *Metric) GetCounter() *Counter { + if x, ok := x.GetValue().(*Metric_Counter); ok { + return x.Counter + } + return nil +} + +func (x *Metric) GetGauge() *Gauge { + if x, ok := x.GetValue().(*Metric_Gauge); ok { + return x.Gauge + } + return nil +} + +func (x *Metric) GetSet() *Set { + if x, ok := x.GetValue().(*Metric_Set); ok { + return x.Set + } + return nil +} + +func (x *Metric) GetDistribution1() *Distribution1 { + if x, ok := x.GetValue().(*Metric_Distribution1); ok { + return x.Distribution1 + } + return nil +} + +func (x *Metric) GetAggregatedHistogram1() *AggregatedHistogram1 { + if x, ok := x.GetValue().(*Metric_AggregatedHistogram1); ok { + return x.AggregatedHistogram1 + } + return nil +} + +func (x *Metric) GetAggregatedSummary1() *AggregatedSummary1 { + if x, ok := x.GetValue().(*Metric_AggregatedSummary1); ok { + return x.AggregatedSummary1 + } + return nil +} + +func (x *Metric) GetDistribution2() *Distribution2 { + if x, ok := x.GetValue().(*Metric_Distribution2); ok { + return x.Distribution2 + } + return nil +} + +func (x *Metric) GetAggregatedHistogram2() *AggregatedHistogram2 { + if x, ok := x.GetValue().(*Metric_AggregatedHistogram2); ok { + return x.AggregatedHistogram2 + } + return nil +} + +func (x *Metric) GetAggregatedSummary2() *AggregatedSummary2 { + if x, ok := x.GetValue().(*Metric_AggregatedSummary2); ok { + return x.AggregatedSummary2 + } + return nil +} + +func (x *Metric) GetSketch() *Sketch { + if x, ok := x.GetValue().(*Metric_Sketch); ok { + return x.Sketch + } + return nil +} + +func (x *Metric) GetAggregatedHistogram3() *AggregatedHistogram3 { + if x, ok := x.GetValue().(*Metric_AggregatedHistogram3); ok { + return x.AggregatedHistogram3 + } + return nil +} + +func (x *Metric) GetAggregatedSummary3() *AggregatedSummary3 { + if x, ok := x.GetValue().(*Metric_AggregatedSummary3); ok { + return x.AggregatedSummary3 + } + return nil +} + +func (x *Metric) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *Metric) GetIntervalMs() uint32 { + if x != nil { + return x.IntervalMs + } + return 0 +} + +func (x *Metric) GetMetadata() *Value { + if x != nil { + return x.Metadata + } + return nil +} + +type isMetric_Value interface { + isMetric_Value() +} + +type Metric_Counter struct { + Counter *Counter `protobuf:"bytes,5,opt,name=counter,proto3,oneof"` +} + +type Metric_Gauge struct { + Gauge *Gauge `protobuf:"bytes,6,opt,name=gauge,proto3,oneof"` +} + +type Metric_Set struct { + Set *Set `protobuf:"bytes,7,opt,name=set,proto3,oneof"` +} + +type Metric_Distribution1 struct { + Distribution1 *Distribution1 `protobuf:"bytes,8,opt,name=distribution1,proto3,oneof"` +} + +type Metric_AggregatedHistogram1 struct { + AggregatedHistogram1 *AggregatedHistogram1 `protobuf:"bytes,9,opt,name=aggregated_histogram1,json=aggregatedHistogram1,proto3,oneof"` +} + +type Metric_AggregatedSummary1 struct { + AggregatedSummary1 *AggregatedSummary1 `protobuf:"bytes,10,opt,name=aggregated_summary1,json=aggregatedSummary1,proto3,oneof"` +} + +type Metric_Distribution2 struct { + Distribution2 *Distribution2 `protobuf:"bytes,12,opt,name=distribution2,proto3,oneof"` +} + +type Metric_AggregatedHistogram2 struct { + AggregatedHistogram2 *AggregatedHistogram2 `protobuf:"bytes,13,opt,name=aggregated_histogram2,json=aggregatedHistogram2,proto3,oneof"` +} + +type Metric_AggregatedSummary2 struct { + AggregatedSummary2 *AggregatedSummary2 `protobuf:"bytes,14,opt,name=aggregated_summary2,json=aggregatedSummary2,proto3,oneof"` +} + +type Metric_Sketch struct { + Sketch *Sketch `protobuf:"bytes,15,opt,name=sketch,proto3,oneof"` +} + +type Metric_AggregatedHistogram3 struct { + AggregatedHistogram3 *AggregatedHistogram3 `protobuf:"bytes,16,opt,name=aggregated_histogram3,json=aggregatedHistogram3,proto3,oneof"` +} + +type Metric_AggregatedSummary3 struct { + AggregatedSummary3 *AggregatedSummary3 `protobuf:"bytes,17,opt,name=aggregated_summary3,json=aggregatedSummary3,proto3,oneof"` +} + +func (*Metric_Counter) isMetric_Value() {} + +func (*Metric_Gauge) isMetric_Value() {} + +func (*Metric_Set) isMetric_Value() {} + +func (*Metric_Distribution1) isMetric_Value() {} + +func (*Metric_AggregatedHistogram1) isMetric_Value() {} + +func (*Metric_AggregatedSummary1) isMetric_Value() {} + +func (*Metric_Distribution2) isMetric_Value() {} + +func (*Metric_AggregatedHistogram2) isMetric_Value() {} + +func (*Metric_AggregatedSummary2) isMetric_Value() {} + +func (*Metric_Sketch) isMetric_Value() {} + +func (*Metric_AggregatedHistogram3) isMetric_Value() {} + +func (*Metric_AggregatedSummary3) isMetric_Value() {} + +type TagValues struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Values []*TagValue `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` +} + +func (x *TagValues) Reset() { + *x = TagValues{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TagValues) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TagValues) ProtoMessage() {} + +func (x *TagValues) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TagValues.ProtoReflect.Descriptor instead. +func (*TagValues) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{11} +} + +func (x *TagValues) GetValues() []*TagValue { + if x != nil { + return x.Values + } + return nil +} + +type TagValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value *string `protobuf:"bytes,1,opt,name=value,proto3,oneof" json:"value,omitempty"` +} + +func (x *TagValue) Reset() { + *x = TagValue{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TagValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TagValue) ProtoMessage() {} + +func (x *TagValue) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TagValue.ProtoReflect.Descriptor instead. +func (*TagValue) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{12} +} + +func (x *TagValue) GetValue() string { + if x != nil && x.Value != nil { + return *x.Value + } + return "" +} + +type Counter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *Counter) Reset() { + *x = Counter{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Counter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Counter) ProtoMessage() {} + +func (x *Counter) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Counter.ProtoReflect.Descriptor instead. +func (*Counter) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{13} +} + +func (x *Counter) GetValue() float64 { + if x != nil { + return x.Value + } + return 0 +} + +type Gauge struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *Gauge) Reset() { + *x = Gauge{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Gauge) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Gauge) ProtoMessage() {} + +func (x *Gauge) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Gauge.ProtoReflect.Descriptor instead. +func (*Gauge) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{14} +} + +func (x *Gauge) GetValue() float64 { + if x != nil { + return x.Value + } + return 0 +} + +type Set struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Values []string `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` +} + +func (x *Set) Reset() { + *x = Set{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Set) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Set) ProtoMessage() {} + +func (x *Set) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Set.ProtoReflect.Descriptor instead. +func (*Set) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{15} +} + +func (x *Set) GetValues() []string { + if x != nil { + return x.Values + } + return nil +} + +type Distribution1 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Values []float64 `protobuf:"fixed64,1,rep,packed,name=values,proto3" json:"values,omitempty"` + SampleRates []uint32 `protobuf:"varint,2,rep,packed,name=sample_rates,json=sampleRates,proto3" json:"sample_rates,omitempty"` + Statistic StatisticKind `protobuf:"varint,3,opt,name=statistic,proto3,enum=vector.StatisticKind" json:"statistic,omitempty"` +} + +func (x *Distribution1) Reset() { + *x = Distribution1{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Distribution1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Distribution1) ProtoMessage() {} + +func (x *Distribution1) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Distribution1.ProtoReflect.Descriptor instead. +func (*Distribution1) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{16} +} + +func (x *Distribution1) GetValues() []float64 { + if x != nil { + return x.Values + } + return nil +} + +func (x *Distribution1) GetSampleRates() []uint32 { + if x != nil { + return x.SampleRates + } + return nil +} + +func (x *Distribution1) GetStatistic() StatisticKind { + if x != nil { + return x.Statistic + } + return StatisticKind_Histogram +} + +type Distribution2 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Samples []*DistributionSample `protobuf:"bytes,1,rep,name=samples,proto3" json:"samples,omitempty"` + Statistic StatisticKind `protobuf:"varint,2,opt,name=statistic,proto3,enum=vector.StatisticKind" json:"statistic,omitempty"` +} + +func (x *Distribution2) Reset() { + *x = Distribution2{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Distribution2) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Distribution2) ProtoMessage() {} + +func (x *Distribution2) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Distribution2.ProtoReflect.Descriptor instead. +func (*Distribution2) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{17} +} + +func (x *Distribution2) GetSamples() []*DistributionSample { + if x != nil { + return x.Samples + } + return nil +} + +func (x *Distribution2) GetStatistic() StatisticKind { + if x != nil { + return x.Statistic + } + return StatisticKind_Histogram +} + +type DistributionSample struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"` + Rate uint32 `protobuf:"varint,2,opt,name=rate,proto3" json:"rate,omitempty"` +} + +func (x *DistributionSample) Reset() { + *x = DistributionSample{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DistributionSample) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DistributionSample) ProtoMessage() {} + +func (x *DistributionSample) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DistributionSample.ProtoReflect.Descriptor instead. +func (*DistributionSample) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{18} +} + +func (x *DistributionSample) GetValue() float64 { + if x != nil { + return x.Value + } + return 0 +} + +func (x *DistributionSample) GetRate() uint32 { + if x != nil { + return x.Rate + } + return 0 +} + +type AggregatedHistogram1 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Buckets []float64 `protobuf:"fixed64,1,rep,packed,name=buckets,proto3" json:"buckets,omitempty"` + Counts []uint32 `protobuf:"varint,2,rep,packed,name=counts,proto3" json:"counts,omitempty"` + Count uint32 `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"` + Sum float64 `protobuf:"fixed64,4,opt,name=sum,proto3" json:"sum,omitempty"` +} + +func (x *AggregatedHistogram1) Reset() { + *x = AggregatedHistogram1{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AggregatedHistogram1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AggregatedHistogram1) ProtoMessage() {} + +func (x *AggregatedHistogram1) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AggregatedHistogram1.ProtoReflect.Descriptor instead. +func (*AggregatedHistogram1) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{19} +} + +func (x *AggregatedHistogram1) GetBuckets() []float64 { + if x != nil { + return x.Buckets + } + return nil +} + +func (x *AggregatedHistogram1) GetCounts() []uint32 { + if x != nil { + return x.Counts + } + return nil +} + +func (x *AggregatedHistogram1) GetCount() uint32 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *AggregatedHistogram1) GetSum() float64 { + if x != nil { + return x.Sum + } + return 0 +} + +type AggregatedHistogram2 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Buckets []*HistogramBucket `protobuf:"bytes,1,rep,name=buckets,proto3" json:"buckets,omitempty"` + Count uint32 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` + Sum float64 `protobuf:"fixed64,3,opt,name=sum,proto3" json:"sum,omitempty"` +} + +func (x *AggregatedHistogram2) Reset() { + *x = AggregatedHistogram2{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AggregatedHistogram2) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AggregatedHistogram2) ProtoMessage() {} + +func (x *AggregatedHistogram2) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AggregatedHistogram2.ProtoReflect.Descriptor instead. +func (*AggregatedHistogram2) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{20} +} + +func (x *AggregatedHistogram2) GetBuckets() []*HistogramBucket { + if x != nil { + return x.Buckets + } + return nil +} + +func (x *AggregatedHistogram2) GetCount() uint32 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *AggregatedHistogram2) GetSum() float64 { + if x != nil { + return x.Sum + } + return 0 +} + +type AggregatedHistogram3 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Buckets []*HistogramBucket3 `protobuf:"bytes,1,rep,name=buckets,proto3" json:"buckets,omitempty"` + Count uint64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` + Sum float64 `protobuf:"fixed64,3,opt,name=sum,proto3" json:"sum,omitempty"` +} + +func (x *AggregatedHistogram3) Reset() { + *x = AggregatedHistogram3{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AggregatedHistogram3) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AggregatedHistogram3) ProtoMessage() {} + +func (x *AggregatedHistogram3) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AggregatedHistogram3.ProtoReflect.Descriptor instead. +func (*AggregatedHistogram3) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{21} +} + +func (x *AggregatedHistogram3) GetBuckets() []*HistogramBucket3 { + if x != nil { + return x.Buckets + } + return nil +} + +func (x *AggregatedHistogram3) GetCount() uint64 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *AggregatedHistogram3) GetSum() float64 { + if x != nil { + return x.Sum + } + return 0 +} + +type HistogramBucket struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UpperLimit float64 `protobuf:"fixed64,1,opt,name=upper_limit,json=upperLimit,proto3" json:"upper_limit,omitempty"` + Count uint32 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *HistogramBucket) Reset() { + *x = HistogramBucket{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HistogramBucket) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HistogramBucket) ProtoMessage() {} + +func (x *HistogramBucket) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HistogramBucket.ProtoReflect.Descriptor instead. +func (*HistogramBucket) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{22} +} + +func (x *HistogramBucket) GetUpperLimit() float64 { + if x != nil { + return x.UpperLimit + } + return 0 +} + +func (x *HistogramBucket) GetCount() uint32 { + if x != nil { + return x.Count + } + return 0 +} + +type HistogramBucket3 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UpperLimit float64 `protobuf:"fixed64,1,opt,name=upper_limit,json=upperLimit,proto3" json:"upper_limit,omitempty"` + Count uint64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *HistogramBucket3) Reset() { + *x = HistogramBucket3{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HistogramBucket3) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HistogramBucket3) ProtoMessage() {} + +func (x *HistogramBucket3) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HistogramBucket3.ProtoReflect.Descriptor instead. +func (*HistogramBucket3) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{23} +} + +func (x *HistogramBucket3) GetUpperLimit() float64 { + if x != nil { + return x.UpperLimit + } + return 0 +} + +func (x *HistogramBucket3) GetCount() uint64 { + if x != nil { + return x.Count + } + return 0 +} + +type AggregatedSummary1 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Quantiles []float64 `protobuf:"fixed64,1,rep,packed,name=quantiles,proto3" json:"quantiles,omitempty"` + Values []float64 `protobuf:"fixed64,2,rep,packed,name=values,proto3" json:"values,omitempty"` + Count uint32 `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"` + Sum float64 `protobuf:"fixed64,4,opt,name=sum,proto3" json:"sum,omitempty"` +} + +func (x *AggregatedSummary1) Reset() { + *x = AggregatedSummary1{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AggregatedSummary1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AggregatedSummary1) ProtoMessage() {} + +func (x *AggregatedSummary1) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AggregatedSummary1.ProtoReflect.Descriptor instead. +func (*AggregatedSummary1) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{24} +} + +func (x *AggregatedSummary1) GetQuantiles() []float64 { + if x != nil { + return x.Quantiles + } + return nil +} + +func (x *AggregatedSummary1) GetValues() []float64 { + if x != nil { + return x.Values + } + return nil +} + +func (x *AggregatedSummary1) GetCount() uint32 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *AggregatedSummary1) GetSum() float64 { + if x != nil { + return x.Sum + } + return 0 +} + +type AggregatedSummary2 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Quantiles []*SummaryQuantile `protobuf:"bytes,1,rep,name=quantiles,proto3" json:"quantiles,omitempty"` + Count uint32 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` + Sum float64 `protobuf:"fixed64,3,opt,name=sum,proto3" json:"sum,omitempty"` +} + +func (x *AggregatedSummary2) Reset() { + *x = AggregatedSummary2{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AggregatedSummary2) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AggregatedSummary2) ProtoMessage() {} + +func (x *AggregatedSummary2) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AggregatedSummary2.ProtoReflect.Descriptor instead. +func (*AggregatedSummary2) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{25} +} + +func (x *AggregatedSummary2) GetQuantiles() []*SummaryQuantile { + if x != nil { + return x.Quantiles + } + return nil +} + +func (x *AggregatedSummary2) GetCount() uint32 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *AggregatedSummary2) GetSum() float64 { + if x != nil { + return x.Sum + } + return 0 +} + +type AggregatedSummary3 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Quantiles []*SummaryQuantile `protobuf:"bytes,1,rep,name=quantiles,proto3" json:"quantiles,omitempty"` + Count uint64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` + Sum float64 `protobuf:"fixed64,3,opt,name=sum,proto3" json:"sum,omitempty"` +} + +func (x *AggregatedSummary3) Reset() { + *x = AggregatedSummary3{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AggregatedSummary3) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AggregatedSummary3) ProtoMessage() {} + +func (x *AggregatedSummary3) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AggregatedSummary3.ProtoReflect.Descriptor instead. +func (*AggregatedSummary3) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{26} +} + +func (x *AggregatedSummary3) GetQuantiles() []*SummaryQuantile { + if x != nil { + return x.Quantiles + } + return nil +} + +func (x *AggregatedSummary3) GetCount() uint64 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *AggregatedSummary3) GetSum() float64 { + if x != nil { + return x.Sum + } + return 0 +} + +type SummaryQuantile struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Quantile float64 `protobuf:"fixed64,1,opt,name=quantile,proto3" json:"quantile,omitempty"` + Value float64 `protobuf:"fixed64,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *SummaryQuantile) Reset() { + *x = SummaryQuantile{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SummaryQuantile) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SummaryQuantile) ProtoMessage() {} + +func (x *SummaryQuantile) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SummaryQuantile.ProtoReflect.Descriptor instead. +func (*SummaryQuantile) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{27} +} + +func (x *SummaryQuantile) GetQuantile() float64 { + if x != nil { + return x.Quantile + } + return 0 +} + +func (x *SummaryQuantile) GetValue() float64 { + if x != nil { + return x.Value + } + return 0 +} + +type Sketch struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Sketch: + // + // *Sketch_AgentDdSketch + Sketch isSketch_Sketch `protobuf_oneof:"sketch"` +} + +func (x *Sketch) Reset() { + *x = Sketch{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Sketch) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Sketch) ProtoMessage() {} + +func (x *Sketch) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[28] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Sketch.ProtoReflect.Descriptor instead. +func (*Sketch) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{28} +} + +func (m *Sketch) GetSketch() isSketch_Sketch { + if m != nil { + return m.Sketch + } + return nil +} + +func (x *Sketch) GetAgentDdSketch() *Sketch_AgentDDSketch { + if x, ok := x.GetSketch().(*Sketch_AgentDdSketch); ok { + return x.AgentDdSketch + } + return nil +} + +type isSketch_Sketch interface { + isSketch_Sketch() +} + +type Sketch_AgentDdSketch struct { + AgentDdSketch *Sketch_AgentDDSketch `protobuf:"bytes,1,opt,name=agent_dd_sketch,json=agentDdSketch,proto3,oneof"` +} + +func (*Sketch_AgentDdSketch) isSketch_Sketch() {} + +type Sketch_AgentDDSketch struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Summary statistics for the samples in this sketch. + Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` + Min float64 `protobuf:"fixed64,2,opt,name=min,proto3" json:"min,omitempty"` + Max float64 `protobuf:"fixed64,3,opt,name=max,proto3" json:"max,omitempty"` + Sum float64 `protobuf:"fixed64,4,opt,name=sum,proto3" json:"sum,omitempty"` + Avg float64 `protobuf:"fixed64,5,opt,name=avg,proto3" json:"avg,omitempty"` + // The bins (buckets) of this sketch, where `k` and `n` are unzipped pairs. + // `k` is the list of bin indexes that are populated, and `n` is the count of samples + // within the given bin. + K []int32 `protobuf:"zigzag32,6,rep,packed,name=k,proto3" json:"k,omitempty"` + N []uint32 `protobuf:"varint,7,rep,packed,name=n,proto3" json:"n,omitempty"` +} + +func (x *Sketch_AgentDDSketch) Reset() { + *x = Sketch_AgentDDSketch{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_event_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Sketch_AgentDDSketch) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Sketch_AgentDDSketch) ProtoMessage() {} + +func (x *Sketch_AgentDDSketch) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_event_proto_msgTypes[34] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Sketch_AgentDDSketch.ProtoReflect.Descriptor instead. +func (*Sketch_AgentDDSketch) Descriptor() ([]byte, []int) { + return file_internal_app_proto_event_proto_rawDescGZIP(), []int{28, 0} +} + +func (x *Sketch_AgentDDSketch) GetCount() uint32 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *Sketch_AgentDDSketch) GetMin() float64 { + if x != nil { + return x.Min + } + return 0 +} + +func (x *Sketch_AgentDDSketch) GetMax() float64 { + if x != nil { + return x.Max + } + return 0 +} + +func (x *Sketch_AgentDDSketch) GetSum() float64 { + if x != nil { + return x.Sum + } + return 0 +} + +func (x *Sketch_AgentDDSketch) GetAvg() float64 { + if x != nil { + return x.Avg + } + return 0 +} + +func (x *Sketch_AgentDDSketch) GetK() []int32 { + if x != nil { + return x.K + } + return nil +} + +func (x *Sketch_AgentDDSketch) GetN() []uint32 { + if x != nil { + return x.N + } + return nil +} + +var File_internal_app_proto_event_proto protoreflect.FileDescriptor + +var file_internal_app_proto_event_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x06, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9d, 0x01, 0x0a, 0x0a, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x26, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, + 0x4c, 0x6f, 0x67, 0x41, 0x72, 0x72, 0x61, 0x79, 0x48, 0x00, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, + 0x12, 0x2f, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x13, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x41, 0x72, 0x72, 0x61, 0x79, 0x48, 0x00, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, + 0x73, 0x12, 0x2c, 0x0a, 0x06, 0x74, 0x72, 0x61, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x12, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, + 0x41, 0x72, 0x72, 0x61, 0x79, 0x48, 0x00, 0x52, 0x06, 0x74, 0x72, 0x61, 0x63, 0x65, 0x73, 0x42, + 0x08, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x2b, 0x0a, 0x08, 0x4c, 0x6f, 0x67, + 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x1f, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x6f, 0x67, + 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x22, 0x37, 0x0a, 0x0b, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, + 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x28, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, + 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x22, + 0x33, 0x0a, 0x0a, 0x54, 0x72, 0x61, 0x63, 0x65, 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x25, 0x0a, + 0x06, 0x74, 0x72, 0x61, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, + 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x52, 0x06, 0x74, 0x72, + 0x61, 0x63, 0x65, 0x73, 0x22, 0x89, 0x01, 0x0a, 0x0c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x57, 0x72, + 0x61, 0x70, 0x70, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x03, 0x6c, 0x6f, 0x67, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x48, + 0x00, 0x52, 0x03, 0x6c, 0x6f, 0x67, 0x12, 0x28, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, + 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x48, 0x00, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, + 0x12, 0x25, 0x0a, 0x05, 0x74, 0x72, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0d, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x48, 0x00, + 0x52, 0x05, 0x74, 0x72, 0x61, 0x63, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x22, 0xd0, 0x01, 0x0a, 0x03, 0x4c, 0x6f, 0x67, 0x12, 0x2f, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x23, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x29, + 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0d, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, + 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x48, 0x0a, 0x0b, 0x46, 0x69, 0x65, + 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x76, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x22, 0xaf, 0x01, 0x0a, 0x05, 0x54, 0x72, 0x61, 0x63, 0x65, 0x12, 0x31, 0x0a, + 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x46, 0x69, 0x65, + 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, + 0x12, 0x29, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x48, 0x0a, 0x0b, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x76, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x8a, 0x01, 0x0a, 0x08, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4d, + 0x61, 0x70, 0x12, 0x34, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x4d, 0x61, 0x70, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x1a, 0x48, 0x0a, 0x0b, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x22, 0x31, 0x0a, 0x0a, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x41, 0x72, 0x72, 0x61, 0x79, + 0x12, 0x23, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x0d, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, + 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0xbb, 0x02, 0x0a, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x1d, 0x0a, 0x09, 0x72, 0x61, 0x77, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x48, 0x00, 0x52, 0x08, 0x72, 0x61, 0x77, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x3a, + 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1a, 0x0a, 0x07, 0x69, 0x6e, + 0x74, 0x65, 0x67, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x07, 0x69, + 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x05, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x05, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x12, 0x1a, + 0x0a, 0x07, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x48, + 0x00, 0x52, 0x07, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x12, 0x24, 0x0a, 0x03, 0x6d, 0x61, + 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, + 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x61, 0x70, 0x48, 0x00, 0x52, 0x03, 0x6d, 0x61, 0x70, + 0x12, 0x2a, 0x0a, 0x05, 0x61, 0x72, 0x72, 0x61, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x12, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x41, 0x72, + 0x72, 0x61, 0x79, 0x48, 0x00, 0x52, 0x05, 0x61, 0x72, 0x72, 0x61, 0x79, 0x12, 0x27, 0x0a, 0x04, + 0x6e, 0x75, 0x6c, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x76, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4e, 0x75, 0x6c, 0x6c, 0x48, 0x00, 0x52, + 0x04, 0x6e, 0x75, 0x6c, 0x6c, 0x42, 0x06, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x4a, 0x04, 0x08, + 0x03, 0x10, 0x04, 0x22, 0x95, 0x0a, 0x0a, 0x06, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x33, 0x0a, 0x07, + 0x74, 0x61, 0x67, 0x73, 0x5f, 0x76, 0x31, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x2e, 0x54, 0x61, + 0x67, 0x73, 0x56, 0x31, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x74, 0x61, 0x67, 0x73, 0x56, + 0x31, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x61, 0x67, 0x73, 0x5f, 0x76, 0x32, 0x18, 0x14, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x4d, 0x65, 0x74, 0x72, + 0x69, 0x63, 0x2e, 0x54, 0x61, 0x67, 0x73, 0x56, 0x32, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, + 0x74, 0x61, 0x67, 0x73, 0x56, 0x32, 0x12, 0x27, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x4d, 0x65, + 0x74, 0x72, 0x69, 0x63, 0x2e, 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, + 0x2b, 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0f, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, + 0x72, 0x48, 0x00, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x25, 0x0a, 0x05, + 0x67, 0x61, 0x75, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x76, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x47, 0x61, 0x75, 0x67, 0x65, 0x48, 0x00, 0x52, 0x05, 0x67, 0x61, + 0x75, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x03, 0x73, 0x65, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0b, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x48, 0x00, 0x52, + 0x03, 0x73, 0x65, 0x74, 0x12, 0x3d, 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x76, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x31, 0x48, 0x00, 0x52, 0x0d, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x31, 0x12, 0x53, 0x0a, 0x15, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x31, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x31, + 0x48, 0x00, 0x52, 0x14, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x48, 0x69, + 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x31, 0x12, 0x4d, 0x0a, 0x13, 0x61, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x31, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x41, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, + 0x31, 0x48, 0x00, 0x52, 0x12, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, + 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x31, 0x12, 0x3d, 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, + 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x48, 0x00, 0x52, 0x0d, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x12, 0x53, 0x0a, 0x15, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x32, 0x18, + 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x41, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, + 0x61, 0x6d, 0x32, 0x48, 0x00, 0x52, 0x14, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, + 0x64, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x32, 0x12, 0x4d, 0x0a, 0x13, 0x61, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, + 0x79, 0x32, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x75, 0x6d, 0x6d, + 0x61, 0x72, 0x79, 0x32, 0x48, 0x00, 0x52, 0x12, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x65, 0x64, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x32, 0x12, 0x28, 0x0a, 0x06, 0x73, 0x6b, + 0x65, 0x74, 0x63, 0x68, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x76, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x6b, 0x65, 0x74, 0x63, 0x68, 0x48, 0x00, 0x52, 0x06, 0x73, 0x6b, + 0x65, 0x74, 0x63, 0x68, 0x12, 0x53, 0x0a, 0x15, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x33, 0x18, 0x10, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x67, 0x67, + 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, + 0x33, 0x48, 0x00, 0x52, 0x14, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x48, + 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x33, 0x12, 0x4d, 0x0a, 0x13, 0x61, 0x67, 0x67, + 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x33, + 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, + 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, + 0x79, 0x33, 0x48, 0x00, 0x52, 0x12, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, + 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x33, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, + 0x61, 0x6c, 0x5f, 0x6d, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x76, 0x61, 0x6c, 0x4d, 0x73, 0x12, 0x29, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x76, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x1a, 0x39, 0x0a, 0x0b, 0x54, 0x61, 0x67, 0x73, 0x56, 0x31, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x4c, 0x0a, + 0x0b, 0x54, 0x61, 0x67, 0x73, 0x56, 0x32, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x27, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, + 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x25, 0x0a, 0x04, 0x4b, + 0x69, 0x6e, 0x64, 0x12, 0x0f, 0x0a, 0x0b, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x61, 0x6c, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, + 0x10, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x35, 0x0a, 0x09, 0x54, + 0x61, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x28, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x2e, 0x54, 0x61, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x22, 0x2f, 0x0a, 0x08, 0x54, 0x61, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x19, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x88, 0x01, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x22, 0x1f, 0x0a, 0x07, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x22, 0x1d, 0x0a, 0x05, 0x47, 0x61, 0x75, 0x67, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x22, 0x1d, 0x0a, 0x03, 0x53, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x22, 0x7f, 0x0a, 0x0d, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x31, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x01, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x73, + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0d, 0x52, 0x0b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x61, 0x74, 0x65, 0x73, 0x12, 0x33, + 0x0a, 0x09, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x15, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x69, + 0x73, 0x74, 0x69, 0x63, 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, + 0x74, 0x69, 0x63, 0x22, 0x7a, 0x0a, 0x0d, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x32, 0x12, 0x34, 0x0a, 0x07, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x44, + 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x52, 0x07, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x12, 0x33, 0x0a, 0x09, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, + 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, + 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x22, + 0x3e, 0x0a, 0x12, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x53, + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, + 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x72, 0x61, 0x74, 0x65, 0x22, + 0x70, 0x0a, 0x14, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x48, 0x69, 0x73, + 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x31, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x01, 0x52, 0x07, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0d, 0x52, 0x06, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, + 0x10, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x73, 0x75, + 0x6d, 0x22, 0x71, 0x0a, 0x14, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x48, + 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x32, 0x12, 0x31, 0x0a, 0x07, 0x62, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x76, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x42, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x52, 0x07, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, + 0x03, 0x73, 0x75, 0x6d, 0x22, 0x72, 0x0a, 0x14, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x65, 0x64, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x33, 0x12, 0x32, 0x0a, 0x07, + 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, + 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, + 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x33, 0x52, 0x07, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, + 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x01, 0x52, 0x03, 0x73, 0x75, 0x6d, 0x22, 0x48, 0x0a, 0x0f, 0x48, 0x69, 0x73, 0x74, + 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x75, + 0x70, 0x70, 0x65, 0x72, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, + 0x52, 0x0a, 0x75, 0x70, 0x70, 0x65, 0x72, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x22, 0x49, 0x0a, 0x10, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x42, + 0x75, 0x63, 0x6b, 0x65, 0x74, 0x33, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x70, 0x70, 0x65, 0x72, 0x5f, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x75, 0x70, 0x70, + 0x65, 0x72, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x72, 0x0a, + 0x12, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x75, 0x6d, 0x6d, 0x61, + 0x72, 0x79, 0x31, 0x12, 0x1c, 0x0a, 0x09, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x01, 0x52, 0x09, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, + 0x73, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x01, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, + 0x10, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x73, 0x75, + 0x6d, 0x22, 0x73, 0x0a, 0x12, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, + 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x32, 0x12, 0x35, 0x0a, 0x09, 0x71, 0x75, 0x61, 0x6e, 0x74, + 0x69, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x76, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x51, 0x75, 0x61, 0x6e, 0x74, + 0x69, 0x6c, 0x65, 0x52, 0x09, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x14, + 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x01, 0x52, 0x03, 0x73, 0x75, 0x6d, 0x22, 0x73, 0x0a, 0x12, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x65, 0x64, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x33, 0x12, 0x35, 0x0a, 0x09, + 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, + 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x52, 0x09, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, + 0x6c, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x75, 0x6d, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x73, 0x75, 0x6d, 0x22, 0x43, 0x0a, 0x0f, 0x53, + 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x12, 0x1a, + 0x0a, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, + 0x52, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x22, 0xe6, 0x01, 0x0a, 0x06, 0x53, 0x6b, 0x65, 0x74, 0x63, 0x68, 0x12, 0x46, 0x0a, 0x0f, 0x61, + 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x64, 0x5f, 0x73, 0x6b, 0x65, 0x74, 0x63, 0x68, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x6b, + 0x65, 0x74, 0x63, 0x68, 0x2e, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x44, 0x44, 0x53, 0x6b, 0x65, 0x74, + 0x63, 0x68, 0x48, 0x00, 0x52, 0x0d, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x44, 0x64, 0x53, 0x6b, 0x65, + 0x74, 0x63, 0x68, 0x1a, 0x89, 0x01, 0x0a, 0x0d, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x44, 0x44, 0x53, + 0x6b, 0x65, 0x74, 0x63, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6d, + 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x6d, 0x69, 0x6e, 0x12, 0x10, 0x0a, + 0x03, 0x6d, 0x61, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x6d, 0x61, 0x78, 0x12, + 0x10, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x73, 0x75, + 0x6d, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x76, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, + 0x61, 0x76, 0x67, 0x12, 0x0c, 0x0a, 0x01, 0x6b, 0x18, 0x06, 0x20, 0x03, 0x28, 0x11, 0x52, 0x01, + 0x6b, 0x12, 0x0c, 0x0a, 0x01, 0x6e, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x01, 0x6e, 0x42, + 0x08, 0x0a, 0x06, 0x73, 0x6b, 0x65, 0x74, 0x63, 0x68, 0x2a, 0x1b, 0x0a, 0x09, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x4e, 0x75, 0x6c, 0x6c, 0x12, 0x0e, 0x0a, 0x0a, 0x4e, 0x55, 0x4c, 0x4c, 0x5f, 0x56, + 0x41, 0x4c, 0x55, 0x45, 0x10, 0x00, 0x2a, 0x2b, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, + 0x74, 0x69, 0x63, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x0d, 0x0a, 0x09, 0x48, 0x69, 0x73, 0x74, 0x6f, + 0x67, 0x72, 0x61, 0x6d, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, + 0x79, 0x10, 0x01, 0x42, 0x18, 0x5a, 0x16, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, + 0x61, 0x70, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2d, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_internal_app_proto_event_proto_rawDescOnce sync.Once + file_internal_app_proto_event_proto_rawDescData = file_internal_app_proto_event_proto_rawDesc +) + +func file_internal_app_proto_event_proto_rawDescGZIP() []byte { + file_internal_app_proto_event_proto_rawDescOnce.Do(func() { + file_internal_app_proto_event_proto_rawDescData = protoimpl.X.CompressGZIP(file_internal_app_proto_event_proto_rawDescData) + }) + return file_internal_app_proto_event_proto_rawDescData +} + +var file_internal_app_proto_event_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_internal_app_proto_event_proto_msgTypes = make([]protoimpl.MessageInfo, 35) +var file_internal_app_proto_event_proto_goTypes = []interface{}{ + (ValueNull)(0), // 0: vector.ValueNull + (StatisticKind)(0), // 1: vector.StatisticKind + (Metric_Kind)(0), // 2: vector.Metric.Kind + (*EventArray)(nil), // 3: vector.EventArray + (*LogArray)(nil), // 4: vector.LogArray + (*MetricArray)(nil), // 5: vector.MetricArray + (*TraceArray)(nil), // 6: vector.TraceArray + (*EventWrapper)(nil), // 7: vector.EventWrapper + (*Log)(nil), // 8: vector.Log + (*Trace)(nil), // 9: vector.Trace + (*ValueMap)(nil), // 10: vector.ValueMap + (*ValueArray)(nil), // 11: vector.ValueArray + (*Value)(nil), // 12: vector.Value + (*Metric)(nil), // 13: vector.Metric + (*TagValues)(nil), // 14: vector.TagValues + (*TagValue)(nil), // 15: vector.TagValue + (*Counter)(nil), // 16: vector.Counter + (*Gauge)(nil), // 17: vector.Gauge + (*Set)(nil), // 18: vector.Set + (*Distribution1)(nil), // 19: vector.Distribution1 + (*Distribution2)(nil), // 20: vector.Distribution2 + (*DistributionSample)(nil), // 21: vector.DistributionSample + (*AggregatedHistogram1)(nil), // 22: vector.AggregatedHistogram1 + (*AggregatedHistogram2)(nil), // 23: vector.AggregatedHistogram2 + (*AggregatedHistogram3)(nil), // 24: vector.AggregatedHistogram3 + (*HistogramBucket)(nil), // 25: vector.HistogramBucket + (*HistogramBucket3)(nil), // 26: vector.HistogramBucket3 + (*AggregatedSummary1)(nil), // 27: vector.AggregatedSummary1 + (*AggregatedSummary2)(nil), // 28: vector.AggregatedSummary2 + (*AggregatedSummary3)(nil), // 29: vector.AggregatedSummary3 + (*SummaryQuantile)(nil), // 30: vector.SummaryQuantile + (*Sketch)(nil), // 31: vector.Sketch + nil, // 32: vector.Log.FieldsEntry + nil, // 33: vector.Trace.FieldsEntry + nil, // 34: vector.ValueMap.FieldsEntry + nil, // 35: vector.Metric.TagsV1Entry + nil, // 36: vector.Metric.TagsV2Entry + (*Sketch_AgentDDSketch)(nil), // 37: vector.Sketch.AgentDDSketch + (*timestamppb.Timestamp)(nil), // 38: google.protobuf.Timestamp +} +var file_internal_app_proto_event_proto_depIdxs = []int32{ + 4, // 0: vector.EventArray.logs:type_name -> vector.LogArray + 5, // 1: vector.EventArray.metrics:type_name -> vector.MetricArray + 6, // 2: vector.EventArray.traces:type_name -> vector.TraceArray + 8, // 3: vector.LogArray.logs:type_name -> vector.Log + 13, // 4: vector.MetricArray.metrics:type_name -> vector.Metric + 9, // 5: vector.TraceArray.traces:type_name -> vector.Trace + 8, // 6: vector.EventWrapper.log:type_name -> vector.Log + 13, // 7: vector.EventWrapper.metric:type_name -> vector.Metric + 9, // 8: vector.EventWrapper.trace:type_name -> vector.Trace + 32, // 9: vector.Log.fields:type_name -> vector.Log.FieldsEntry + 12, // 10: vector.Log.value:type_name -> vector.Value + 12, // 11: vector.Log.metadata:type_name -> vector.Value + 33, // 12: vector.Trace.fields:type_name -> vector.Trace.FieldsEntry + 12, // 13: vector.Trace.metadata:type_name -> vector.Value + 34, // 14: vector.ValueMap.fields:type_name -> vector.ValueMap.FieldsEntry + 12, // 15: vector.ValueArray.items:type_name -> vector.Value + 38, // 16: vector.Value.timestamp:type_name -> google.protobuf.Timestamp + 10, // 17: vector.Value.map:type_name -> vector.ValueMap + 11, // 18: vector.Value.array:type_name -> vector.ValueArray + 0, // 19: vector.Value.null:type_name -> vector.ValueNull + 38, // 20: vector.Metric.timestamp:type_name -> google.protobuf.Timestamp + 35, // 21: vector.Metric.tags_v1:type_name -> vector.Metric.TagsV1Entry + 36, // 22: vector.Metric.tags_v2:type_name -> vector.Metric.TagsV2Entry + 2, // 23: vector.Metric.kind:type_name -> vector.Metric.Kind + 16, // 24: vector.Metric.counter:type_name -> vector.Counter + 17, // 25: vector.Metric.gauge:type_name -> vector.Gauge + 18, // 26: vector.Metric.set:type_name -> vector.Set + 19, // 27: vector.Metric.distribution1:type_name -> vector.Distribution1 + 22, // 28: vector.Metric.aggregated_histogram1:type_name -> vector.AggregatedHistogram1 + 27, // 29: vector.Metric.aggregated_summary1:type_name -> vector.AggregatedSummary1 + 20, // 30: vector.Metric.distribution2:type_name -> vector.Distribution2 + 23, // 31: vector.Metric.aggregated_histogram2:type_name -> vector.AggregatedHistogram2 + 28, // 32: vector.Metric.aggregated_summary2:type_name -> vector.AggregatedSummary2 + 31, // 33: vector.Metric.sketch:type_name -> vector.Sketch + 24, // 34: vector.Metric.aggregated_histogram3:type_name -> vector.AggregatedHistogram3 + 29, // 35: vector.Metric.aggregated_summary3:type_name -> vector.AggregatedSummary3 + 12, // 36: vector.Metric.metadata:type_name -> vector.Value + 15, // 37: vector.TagValues.values:type_name -> vector.TagValue + 1, // 38: vector.Distribution1.statistic:type_name -> vector.StatisticKind + 21, // 39: vector.Distribution2.samples:type_name -> vector.DistributionSample + 1, // 40: vector.Distribution2.statistic:type_name -> vector.StatisticKind + 25, // 41: vector.AggregatedHistogram2.buckets:type_name -> vector.HistogramBucket + 26, // 42: vector.AggregatedHistogram3.buckets:type_name -> vector.HistogramBucket3 + 30, // 43: vector.AggregatedSummary2.quantiles:type_name -> vector.SummaryQuantile + 30, // 44: vector.AggregatedSummary3.quantiles:type_name -> vector.SummaryQuantile + 37, // 45: vector.Sketch.agent_dd_sketch:type_name -> vector.Sketch.AgentDDSketch + 12, // 46: vector.Log.FieldsEntry.value:type_name -> vector.Value + 12, // 47: vector.Trace.FieldsEntry.value:type_name -> vector.Value + 12, // 48: vector.ValueMap.FieldsEntry.value:type_name -> vector.Value + 14, // 49: vector.Metric.TagsV2Entry.value:type_name -> vector.TagValues + 50, // [50:50] is the sub-list for method output_type + 50, // [50:50] is the sub-list for method input_type + 50, // [50:50] is the sub-list for extension type_name + 50, // [50:50] is the sub-list for extension extendee + 0, // [0:50] is the sub-list for field type_name +} + +func init() { file_internal_app_proto_event_proto_init() } +func file_internal_app_proto_event_proto_init() { + if File_internal_app_proto_event_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_internal_app_proto_event_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventArray); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_event_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LogArray); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_event_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MetricArray); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_event_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TraceArray); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_event_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventWrapper); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_event_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Log); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_event_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Trace); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_event_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValueMap); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_event_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValueArray); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_event_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Value); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_event_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Metric); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_event_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TagValues); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_event_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TagValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_event_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Counter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_event_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Gauge); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_event_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Set); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_event_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Distribution1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_event_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Distribution2); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_event_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DistributionSample); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_event_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AggregatedHistogram1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_event_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AggregatedHistogram2); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_event_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AggregatedHistogram3); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_event_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HistogramBucket); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_event_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HistogramBucket3); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_event_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AggregatedSummary1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_event_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AggregatedSummary2); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_event_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AggregatedSummary3); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_event_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SummaryQuantile); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_event_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Sketch); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_event_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Sketch_AgentDDSketch); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_internal_app_proto_event_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*EventArray_Logs)(nil), + (*EventArray_Metrics)(nil), + (*EventArray_Traces)(nil), + } + file_internal_app_proto_event_proto_msgTypes[4].OneofWrappers = []interface{}{ + (*EventWrapper_Log)(nil), + (*EventWrapper_Metric)(nil), + (*EventWrapper_Trace)(nil), + } + file_internal_app_proto_event_proto_msgTypes[9].OneofWrappers = []interface{}{ + (*Value_RawBytes)(nil), + (*Value_Timestamp)(nil), + (*Value_Integer)(nil), + (*Value_Float)(nil), + (*Value_Boolean)(nil), + (*Value_Map)(nil), + (*Value_Array)(nil), + (*Value_Null)(nil), + } + file_internal_app_proto_event_proto_msgTypes[10].OneofWrappers = []interface{}{ + (*Metric_Counter)(nil), + (*Metric_Gauge)(nil), + (*Metric_Set)(nil), + (*Metric_Distribution1)(nil), + (*Metric_AggregatedHistogram1)(nil), + (*Metric_AggregatedSummary1)(nil), + (*Metric_Distribution2)(nil), + (*Metric_AggregatedHistogram2)(nil), + (*Metric_AggregatedSummary2)(nil), + (*Metric_Sketch)(nil), + (*Metric_AggregatedHistogram3)(nil), + (*Metric_AggregatedSummary3)(nil), + } + file_internal_app_proto_event_proto_msgTypes[12].OneofWrappers = []interface{}{} + file_internal_app_proto_event_proto_msgTypes[28].OneofWrappers = []interface{}{ + (*Sketch_AgentDdSketch)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_internal_app_proto_event_proto_rawDesc, + NumEnums: 3, + NumMessages: 35, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_internal_app_proto_event_proto_goTypes, + DependencyIndexes: file_internal_app_proto_event_proto_depIdxs, + EnumInfos: file_internal_app_proto_event_proto_enumTypes, + MessageInfos: file_internal_app_proto_event_proto_msgTypes, + }.Build() + File_internal_app_proto_event_proto = out.File + file_internal_app_proto_event_proto_rawDesc = nil + file_internal_app_proto_event_proto_goTypes = nil + file_internal_app_proto_event_proto_depIdxs = nil +} diff --git a/apps/message-office/internal/app/proto-rpc/vector.pb.go b/apps/message-office/internal/app/proto-rpc/vector.pb.go new file mode 100644 index 000000000..acae2d7ef --- /dev/null +++ b/apps/message-office/internal/app/proto-rpc/vector.pb.go @@ -0,0 +1,386 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v4.23.3 +// source: internal/app/proto/vector.proto + +package proto_rpc + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ServingStatus int32 + +const ( + ServingStatus_SERVING ServingStatus = 0 + ServingStatus_NOT_SERVING ServingStatus = 1 +) + +// Enum value maps for ServingStatus. +var ( + ServingStatus_name = map[int32]string{ + 0: "SERVING", + 1: "NOT_SERVING", + } + ServingStatus_value = map[string]int32{ + "SERVING": 0, + "NOT_SERVING": 1, + } +) + +func (x ServingStatus) Enum() *ServingStatus { + p := new(ServingStatus) + *p = x + return p +} + +func (x ServingStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ServingStatus) Descriptor() protoreflect.EnumDescriptor { + return file_internal_app_proto_vector_proto_enumTypes[0].Descriptor() +} + +func (ServingStatus) Type() protoreflect.EnumType { + return &file_internal_app_proto_vector_proto_enumTypes[0] +} + +func (x ServingStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ServingStatus.Descriptor instead. +func (ServingStatus) EnumDescriptor() ([]byte, []int) { + return file_internal_app_proto_vector_proto_rawDescGZIP(), []int{0} +} + +type PushEventsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Events []*EventWrapper `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"` +} + +func (x *PushEventsRequest) Reset() { + *x = PushEventsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_vector_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PushEventsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PushEventsRequest) ProtoMessage() {} + +func (x *PushEventsRequest) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_vector_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PushEventsRequest.ProtoReflect.Descriptor instead. +func (*PushEventsRequest) Descriptor() ([]byte, []int) { + return file_internal_app_proto_vector_proto_rawDescGZIP(), []int{0} +} + +func (x *PushEventsRequest) GetEvents() []*EventWrapper { + if x != nil { + return x.Events + } + return nil +} + +type PushEventsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *PushEventsResponse) Reset() { + *x = PushEventsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_vector_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PushEventsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PushEventsResponse) ProtoMessage() {} + +func (x *PushEventsResponse) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_vector_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PushEventsResponse.ProtoReflect.Descriptor instead. +func (*PushEventsResponse) Descriptor() ([]byte, []int) { + return file_internal_app_proto_vector_proto_rawDescGZIP(), []int{1} +} + +type HealthCheckRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *HealthCheckRequest) Reset() { + *x = HealthCheckRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_vector_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HealthCheckRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HealthCheckRequest) ProtoMessage() {} + +func (x *HealthCheckRequest) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_vector_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HealthCheckRequest.ProtoReflect.Descriptor instead. +func (*HealthCheckRequest) Descriptor() ([]byte, []int) { + return file_internal_app_proto_vector_proto_rawDescGZIP(), []int{2} +} + +type HealthCheckResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status ServingStatus `protobuf:"varint,1,opt,name=status,proto3,enum=vector.ServingStatus" json:"status,omitempty"` +} + +func (x *HealthCheckResponse) Reset() { + *x = HealthCheckResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_app_proto_vector_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HealthCheckResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HealthCheckResponse) ProtoMessage() {} + +func (x *HealthCheckResponse) ProtoReflect() protoreflect.Message { + mi := &file_internal_app_proto_vector_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HealthCheckResponse.ProtoReflect.Descriptor instead. +func (*HealthCheckResponse) Descriptor() ([]byte, []int) { + return file_internal_app_proto_vector_proto_rawDescGZIP(), []int{3} +} + +func (x *HealthCheckResponse) GetStatus() ServingStatus { + if x != nil { + return x.Status + } + return ServingStatus_SERVING +} + +var File_internal_app_proto_vector_proto protoreflect.FileDescriptor + +var file_internal_app_proto_vector_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x06, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x1a, 0x1e, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x6e, 0x61, 0x6c, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x41, 0x0a, 0x11, 0x50, 0x75, 0x73, + 0x68, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, + 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x57, 0x72, 0x61, + 0x70, 0x70, 0x65, 0x72, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x14, 0x0a, 0x12, + 0x50, 0x75, 0x73, 0x68, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x14, 0x0a, 0x12, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x44, 0x0a, 0x13, 0x48, 0x65, 0x61, 0x6c, + 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x2d, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x15, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x6e, 0x67, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2a, 0x2d, + 0x0a, 0x0d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x0b, 0x0a, 0x07, 0x53, 0x45, 0x52, 0x56, 0x49, 0x4e, 0x47, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, + 0x4e, 0x4f, 0x54, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x32, 0x97, 0x01, + 0x0a, 0x06, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x45, 0x0a, 0x0a, 0x50, 0x75, 0x73, 0x68, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x19, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, + 0x50, 0x75, 0x73, 0x68, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1a, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x46, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x1a, + 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x76, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x18, 0x5a, 0x16, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x6e, 0x61, 0x6c, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2d, 0x72, 0x70, + 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_internal_app_proto_vector_proto_rawDescOnce sync.Once + file_internal_app_proto_vector_proto_rawDescData = file_internal_app_proto_vector_proto_rawDesc +) + +func file_internal_app_proto_vector_proto_rawDescGZIP() []byte { + file_internal_app_proto_vector_proto_rawDescOnce.Do(func() { + file_internal_app_proto_vector_proto_rawDescData = protoimpl.X.CompressGZIP(file_internal_app_proto_vector_proto_rawDescData) + }) + return file_internal_app_proto_vector_proto_rawDescData +} + +var file_internal_app_proto_vector_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_internal_app_proto_vector_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_internal_app_proto_vector_proto_goTypes = []interface{}{ + (ServingStatus)(0), // 0: vector.ServingStatus + (*PushEventsRequest)(nil), // 1: vector.PushEventsRequest + (*PushEventsResponse)(nil), // 2: vector.PushEventsResponse + (*HealthCheckRequest)(nil), // 3: vector.HealthCheckRequest + (*HealthCheckResponse)(nil), // 4: vector.HealthCheckResponse + (*EventWrapper)(nil), // 5: vector.EventWrapper +} +var file_internal_app_proto_vector_proto_depIdxs = []int32{ + 5, // 0: vector.PushEventsRequest.events:type_name -> vector.EventWrapper + 0, // 1: vector.HealthCheckResponse.status:type_name -> vector.ServingStatus + 1, // 2: vector.Vector.PushEvents:input_type -> vector.PushEventsRequest + 3, // 3: vector.Vector.HealthCheck:input_type -> vector.HealthCheckRequest + 2, // 4: vector.Vector.PushEvents:output_type -> vector.PushEventsResponse + 4, // 5: vector.Vector.HealthCheck:output_type -> vector.HealthCheckResponse + 4, // [4:6] is the sub-list for method output_type + 2, // [2:4] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_internal_app_proto_vector_proto_init() } +func file_internal_app_proto_vector_proto_init() { + if File_internal_app_proto_vector_proto != nil { + return + } + file_internal_app_proto_event_proto_init() + if !protoimpl.UnsafeEnabled { + file_internal_app_proto_vector_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PushEventsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_vector_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PushEventsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_vector_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HealthCheckRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_app_proto_vector_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HealthCheckResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_internal_app_proto_vector_proto_rawDesc, + NumEnums: 1, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_internal_app_proto_vector_proto_goTypes, + DependencyIndexes: file_internal_app_proto_vector_proto_depIdxs, + EnumInfos: file_internal_app_proto_vector_proto_enumTypes, + MessageInfos: file_internal_app_proto_vector_proto_msgTypes, + }.Build() + File_internal_app_proto_vector_proto = out.File + file_internal_app_proto_vector_proto_rawDesc = nil + file_internal_app_proto_vector_proto_goTypes = nil + file_internal_app_proto_vector_proto_depIdxs = nil +} diff --git a/apps/message-office/internal/app/proto-rpc/vector_grpc.pb.go b/apps/message-office/internal/app/proto-rpc/vector_grpc.pb.go new file mode 100644 index 000000000..a193efaeb --- /dev/null +++ b/apps/message-office/internal/app/proto-rpc/vector_grpc.pb.go @@ -0,0 +1,146 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.23.3 +// source: internal/app/proto/vector.proto + +package proto_rpc + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Vector_PushEvents_FullMethodName = "/vector.Vector/PushEvents" + Vector_HealthCheck_FullMethodName = "/vector.Vector/HealthCheck" +) + +// VectorClient is the client API for Vector service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type VectorClient interface { + PushEvents(ctx context.Context, in *PushEventsRequest, opts ...grpc.CallOption) (*PushEventsResponse, error) + HealthCheck(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) +} + +type vectorClient struct { + cc grpc.ClientConnInterface +} + +func NewVectorClient(cc grpc.ClientConnInterface) VectorClient { + return &vectorClient{cc} +} + +func (c *vectorClient) PushEvents(ctx context.Context, in *PushEventsRequest, opts ...grpc.CallOption) (*PushEventsResponse, error) { + out := new(PushEventsResponse) + err := c.cc.Invoke(ctx, Vector_PushEvents_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *vectorClient) HealthCheck(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) { + out := new(HealthCheckResponse) + err := c.cc.Invoke(ctx, Vector_HealthCheck_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// VectorServer is the server API for Vector service. +// All implementations must embed UnimplementedVectorServer +// for forward compatibility +type VectorServer interface { + PushEvents(context.Context, *PushEventsRequest) (*PushEventsResponse, error) + HealthCheck(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) + mustEmbedUnimplementedVectorServer() +} + +// UnimplementedVectorServer must be embedded to have forward compatible implementations. +type UnimplementedVectorServer struct { +} + +func (UnimplementedVectorServer) PushEvents(context.Context, *PushEventsRequest) (*PushEventsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PushEvents not implemented") +} +func (UnimplementedVectorServer) HealthCheck(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method HealthCheck not implemented") +} +func (UnimplementedVectorServer) mustEmbedUnimplementedVectorServer() {} + +// UnsafeVectorServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to VectorServer will +// result in compilation errors. +type UnsafeVectorServer interface { + mustEmbedUnimplementedVectorServer() +} + +func RegisterVectorServer(s grpc.ServiceRegistrar, srv VectorServer) { + s.RegisterService(&Vector_ServiceDesc, srv) +} + +func _Vector_PushEvents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PushEventsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VectorServer).PushEvents(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Vector_PushEvents_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VectorServer).PushEvents(ctx, req.(*PushEventsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Vector_HealthCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HealthCheckRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VectorServer).HealthCheck(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Vector_HealthCheck_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VectorServer).HealthCheck(ctx, req.(*HealthCheckRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Vector_ServiceDesc is the grpc.ServiceDesc for Vector service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Vector_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "vector.Vector", + HandlerType: (*VectorServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "PushEvents", + Handler: _Vector_PushEvents_Handler, + }, + { + MethodName: "HealthCheck", + Handler: _Vector_HealthCheck_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "internal/app/proto/vector.proto", +} diff --git a/apps/message-office/internal/app/proto/event.proto b/apps/message-office/internal/app/proto/event.proto new file mode 100644 index 000000000..05e5f3fdc --- /dev/null +++ b/apps/message-office/internal/app/proto/event.proto @@ -0,0 +1,215 @@ +syntax = "proto3"; +option go_package = "internal/app/proto-rpc"; + +import "google/protobuf/timestamp.proto"; + +package vector; + +message EventArray { + oneof events { + LogArray logs = 1; + MetricArray metrics = 2; + TraceArray traces = 3; + } +} + +message LogArray { + repeated Log logs = 1; +} + +message MetricArray { + repeated Metric metrics = 1; +} + +message TraceArray { + repeated Trace traces = 1; +} + +message EventWrapper { + oneof event { + Log log = 1; + Metric metric = 2; + Trace trace = 3; + } +} + +message Log { + // Deprecated, use value instead + map fields = 1; + Value value = 2; + Value metadata = 3; +} + +message Trace { + map fields = 1; + Value metadata = 2; +} + +message ValueMap { + map fields = 1; +} + +message ValueArray { + repeated Value items = 1; +} + +enum ValueNull { + NULL_VALUE = 0; +} + +message Value { + reserved 3; + oneof kind { + bytes raw_bytes = 1; + google.protobuf.Timestamp timestamp = 2; + int64 integer = 4; + double float = 5; + bool boolean = 6; + ValueMap map = 7; + ValueArray array = 8; + ValueNull null = 9; + } +} + +message Metric { + string name = 1; + google.protobuf.Timestamp timestamp = 2; + map tags_v1 = 3; + map tags_v2 = 20; + enum Kind { + Incremental = 0; + Absolute = 1; + } + Kind kind = 4; + oneof value { + Counter counter = 5; + Gauge gauge = 6; + Set set = 7; + Distribution1 distribution1 = 8; + AggregatedHistogram1 aggregated_histogram1 = 9; + AggregatedSummary1 aggregated_summary1 = 10; + Distribution2 distribution2 = 12; + AggregatedHistogram2 aggregated_histogram2 = 13; + AggregatedSummary2 aggregated_summary2 = 14; + Sketch sketch = 15; + AggregatedHistogram3 aggregated_histogram3 = 16; + AggregatedSummary3 aggregated_summary3 = 17; + } + string namespace = 11; + uint32 interval_ms = 18; + Value metadata = 19; +} + +message TagValues { + repeated TagValue values = 1; +} + +message TagValue { + optional string value = 1; +} + +message Counter { + double value = 1; +} + +message Gauge { + double value = 1; +} + +message Set { + repeated string values = 1; +} + +enum StatisticKind { + Histogram = 0; + Summary = 1; +} + +message Distribution1 { + repeated double values = 1; + repeated uint32 sample_rates = 2; + StatisticKind statistic = 3; +} + +message Distribution2 { + repeated DistributionSample samples = 1; + StatisticKind statistic = 2; +} + +message DistributionSample { + double value = 1; + uint32 rate = 2; +} + +message AggregatedHistogram1 { + repeated double buckets = 1; + repeated uint32 counts = 2; + uint32 count = 3; + double sum = 4; +} + +message AggregatedHistogram2 { + repeated HistogramBucket buckets = 1; + uint32 count = 2; + double sum = 3; +} + +message AggregatedHistogram3 { + repeated HistogramBucket3 buckets = 1; + uint64 count = 2; + double sum = 3; +} + +message HistogramBucket { + double upper_limit = 1; + uint32 count = 2; +} + +message HistogramBucket3 { + double upper_limit = 1; + uint64 count = 2; +} + +message AggregatedSummary1 { + repeated double quantiles = 1; + repeated double values = 2; + uint32 count = 3; + double sum = 4; +} + +message AggregatedSummary2 { + repeated SummaryQuantile quantiles = 1; + uint32 count = 2; + double sum = 3; +} + +message AggregatedSummary3 { + repeated SummaryQuantile quantiles = 1; + uint64 count = 2; + double sum = 3; +} + +message SummaryQuantile { + double quantile = 1; + double value = 2; +} + +message Sketch { + message AgentDDSketch { + // Summary statistics for the samples in this sketch. + uint32 count = 1; + double min = 2; + double max = 3; + double sum = 4; + double avg = 5; + // The bins (buckets) of this sketch, where `k` and `n` are unzipped pairs. + // `k` is the list of bin indexes that are populated, and `n` is the count of samples + // within the given bin. + repeated sint32 k = 6; + repeated uint32 n = 7; + } + + oneof sketch { + AgentDDSketch agent_dd_sketch = 1; + } +} diff --git a/apps/message-office/internal/app/proto/vector.proto b/apps/message-office/internal/app/proto/vector.proto new file mode 100644 index 000000000..001ba9860 --- /dev/null +++ b/apps/message-office/internal/app/proto/vector.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +option go_package = "internal/app/proto-rpc"; + +import "internal/app/proto/event.proto"; + +package vector; + +message PushEventsRequest { + repeated EventWrapper events = 1; +} + +message PushEventsResponse {} + +enum ServingStatus { + SERVING = 0; + NOT_SERVING = 1; +} + +message HealthCheckRequest {} + +message HealthCheckResponse { + ServingStatus status = 1; +} + +service Vector { + rpc PushEvents(PushEventsRequest) returns (PushEventsResponse) {} + + rpc HealthCheck(HealthCheckRequest) returns (HealthCheckResponse); +} diff --git a/apps/message-office/internal/app/vector-proxy-server.go b/apps/message-office/internal/app/vector-proxy-server.go new file mode 100644 index 000000000..254f4667f --- /dev/null +++ b/apps/message-office/internal/app/vector-proxy-server.go @@ -0,0 +1,58 @@ +package app + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + + proto_rpc "github.com/kloudlite/api/apps/message-office/internal/app/proto-rpc" + "github.com/kloudlite/api/apps/message-office/internal/domain" + "github.com/kloudlite/api/pkg/logging" +) + +type vectorProxyServer struct { + proto_rpc.UnimplementedVectorServer + realVectorClient proto_rpc.VectorClient + logger logging.Logger + domain domain.Domain + tokenHashingSecret string + pushEventsCounter int + healthCheckCounter int +} + +func (v *vectorProxyServer) PushEvents(ctx context.Context, msg *proto_rpc.PushEventsRequest) (*proto_rpc.PushEventsResponse, error) { + accountName, clusterName, err := validateAndDecodeFromGrpcContext(ctx, v.tokenHashingSecret) + if err != nil { + return nil, errors.NewE(err) + } + + logger := v.logger.WithKV("accountName", accountName, "clusterName", clusterName) + v.pushEventsCounter++ + logger.Infof("[%v] received push-events message", v.pushEventsCounter) + defer logger.Infof("[%v] dispatched push-events message to vector aggregator", v.pushEventsCounter) + + per, err := v.realVectorClient.PushEvents(ctx, msg) + if err != nil { + logger.Errorf(err) + return nil, errors.NewE(err) + } + return per, nil +} + +func (v *vectorProxyServer) HealthCheck(ctx context.Context, msg *proto_rpc.HealthCheckRequest) (*proto_rpc.HealthCheckResponse, error) { + accountName, clusterName, err := validateAndDecodeFromGrpcContext(ctx, v.tokenHashingSecret) + if err != nil { + return nil, errors.NewE(err) + } + + logger := v.logger.WithKV("accountName", accountName, "clusterName", clusterName) + v.healthCheckCounter++ + logger.Infof("[%v] received health-check message", v.healthCheckCounter) + defer logger.Infof("[%v] dispatched health-check message to vector aggregator", v.healthCheckCounter) + + hcr, err := v.realVectorClient.HealthCheck(ctx, msg) + if err != nil { + logger.Errorf(err) + return nil, errors.NewE(err) + } + return hcr, nil +} diff --git a/apps/message-office/internal/domain/domain.go b/apps/message-office/internal/domain/domain.go index 9d83f4c8d..b79865e89 100644 --- a/apps/message-office/internal/domain/domain.go +++ b/apps/message-office/internal/domain/domain.go @@ -2,22 +2,22 @@ package domain import ( "context" - "fmt" - + "github.com/kloudlite/api/pkg/errors" "go.uber.org/fx" - "kloudlite.io/apps/message-office/internal/env" - fn "kloudlite.io/pkg/functions" - "kloudlite.io/pkg/repos" + "github.com/kloudlite/api/apps/message-office/internal/env" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/api/pkg/repos" ) type domain struct { moRepo repos.DbRepo[*MessageOfficeToken] env *env.Env accessTokenRepo repos.DbRepo[*AccessToken] + logger logging.Logger } -// ValidationAccessToken implements Domain func (d *domain) ValidateAccessToken(ctx context.Context, accessToken string, accountName string, clusterName string) error { r, err := d.accessTokenRepo.FindOne(ctx, repos.Filter{ "accessToken": accessToken, @@ -25,20 +25,23 @@ func (d *domain) ValidateAccessToken(ctx context.Context, accessToken string, ac "clusterName": clusterName, }) if err != nil { - return err + return errors.NewE(err) } if r == nil { - return fmt.Errorf("invalid access token") + return errors.Newf("invalid access token") } return nil } func (d *domain) getClusterToken(ctx context.Context, accountName string, clusterName string) (string, error) { + if accountName == "" || clusterName == "" { + return "", errors.Newf("accountName and/or clusterName cannot be empty") + } mot, err := d.moRepo.FindOne(ctx, repos.Filter{"accountName": accountName, "clusterName": clusterName}) if err != nil { - return "", err + return "", errors.NewE(err) } if mot == nil { return "", nil @@ -53,7 +56,7 @@ func (d *domain) GetClusterToken(ctx context.Context, accountName string, cluste func (d *domain) GenClusterToken(ctx context.Context, accountName, clusterName string) (string, error) { token, err := d.getClusterToken(ctx, accountName, clusterName) if err != nil { - return "", err + return "", errors.NewE(err) } if token != "" { return token, nil @@ -64,7 +67,7 @@ func (d *domain) GenClusterToken(ctx context.Context, accountName, clusterName s Token: fn.CleanerNanoidOrDie(40), }) if err != nil { - return "", err + return "", errors.NewE(err) } return record.Token, nil } @@ -72,17 +75,17 @@ func (d *domain) GenClusterToken(ctx context.Context, accountName, clusterName s func (d *domain) GenAccessToken(ctx context.Context, clusterToken string) (*AccessToken, error) { mot, err := d.moRepo.FindOne(ctx, repos.Filter{"token": clusterToken}) if err != nil { - return nil, err + return nil, errors.NewE(err) } + if mot == nil { - return nil, fmt.Errorf("no such cluster token found") + return nil, errors.Newf("no such cluster token found") } if mot.Granted != nil && *mot.Granted { - return nil, fmt.Errorf("a valid access-token has already been issued for this cluster token") + d.logger.Infof("a valid access-token has already been issued for this cluster token, granting a new one, and removing the old one") } - record, err := d.accessTokenRepo.Upsert(ctx, repos.Filter{ "accountName": mot.AccountName, "clusterName": mot.ClusterName, @@ -92,16 +95,16 @@ func (d *domain) GenAccessToken(ctx context.Context, clusterToken string) (*Acce AccessToken: fn.CleanerNanoidOrDie(40), }) if err != nil { - return nil, err + return nil, errors.NewE(err) } if record == nil { - return nil, fmt.Errorf("failed to upsert into accessToken collection") + return nil, errors.Newf("failed to upsert into accessToken collection") } mot.Granted = fn.New(true) if _, err := d.moRepo.UpdateById(ctx, mot.Id, mot); err != nil { - return nil, err + return nil, errors.NewE(err) } return record, nil @@ -112,10 +115,12 @@ var Module = fx.Module( fx.Provide(func( moRepo repos.DbRepo[*MessageOfficeToken], accessTokenRepo repos.DbRepo[*AccessToken], + logger logging.Logger, ) Domain { return &domain{ moRepo: moRepo, accessTokenRepo: accessTokenRepo, + logger: logger, } }), ) diff --git a/apps/message-office/internal/domain/entities.go b/apps/message-office/internal/domain/entities.go index 937d8c72f..8215ebb79 100644 --- a/apps/message-office/internal/domain/entities.go +++ b/apps/message-office/internal/domain/entities.go @@ -1,6 +1,6 @@ package domain -import "kloudlite.io/pkg/repos" +import "github.com/kloudlite/api/pkg/repos" type MessageOfficeToken struct { repos.BaseEntity `json:",inline"` diff --git a/apps/message-office/internal/env/env.go b/apps/message-office/internal/env/env.go index f9fcbceca..4d5c2e090 100644 --- a/apps/message-office/internal/env/env.go +++ b/apps/message-office/internal/env/env.go @@ -1,26 +1,26 @@ package env -import "github.com/codingconcepts/env" +import ( + "github.com/codingconcepts/env" +) type Env struct { - KafkaBrokers string `env:"KAFKA_BROKERS" required:"true"` - KafkaSaslUsername string `env:"KAFKA_SASL_USERNAME" required:"true"` - KafkaSaslPassword string `env:"KAFKA_SASL_PASSWORD" required:"true"` + NatsUrl string `env:"NATS_URL" required:"true"` + NatsStream string `env:"NATS_STREAM" required:"true"` - // for consumers - KafkaConsumerGroup string `env:"KAFKA_CONSUMER_GROUP" required:"true"` - KafkaTopicStatusUpdates string `env:"KAFKA_TOPIC_STATUS_UPDATES" required:"true"` - KafkaTopicInfraUpdates string `env:"KAFKA_TOPIC_INFRA_UPDATES" required:"true"` - KafkaTopicErrorOnApply string `env:"KAFKA_TOPIC_ERROR_ON_APPLY" required:"true"` - KafkaTopicBYOCClientUpdates string `env:"KAFKA_TOPIC_BYOC_CLIENT_UPDATES" required:"true"` + PlatformAccessToken string `env:"PLATFORM_ACCESS_TOKEN" required:"true"` - DbName string `env:"DB_NAME" required:"true"` - DbUri string `env:"DB_URI" required:"true"` + DbName string `env:"MONGO_DB_NAME" required:"true"` + DbUri string `env:"MONGO_URI" required:"true"` - GrpcPort uint16 `env:"GRPC_PORT" required:"true"` - HttpPort uint16 `env:"HTTP_PORT" required:"true"` + ExternalGrpcPort uint16 `env:"EXTERNAL_GRPC_PORT" required:"true"` + InternalGrpcPort uint16 `env:"INTERNAL_GRPC_PORT" required:"true"` + HttpPort uint16 `env:"HTTP_PORT" required:"true"` - // GrpcValidityHeader string `env:"GRPC_VALIDITY_HEADER" required:"true"` + VectorGrpcAddr string `env:"VECTOR_GRPC_ADDR" required:"true"` + + TokenHashingSecret string `env:"TOKEN_HASHING_SECRET" required:"true"` + IsDev bool } func LoadEnvOrDie() *Env { diff --git a/apps/message-office/internal/framework/framework.go b/apps/message-office/internal/framework/framework.go index b74379fd9..97e6aefcf 100644 --- a/apps/message-office/internal/framework/framework.go +++ b/apps/message-office/internal/framework/framework.go @@ -1,63 +1,115 @@ package framework import ( - "github.com/kloudlite/operator/pkg/kubectl" + "context" + "fmt" + "github.com/kloudlite/api/pkg/errors" + "go.uber.org/fx" - "k8s.io/client-go/rest" - - "kloudlite.io/apps/message-office/internal/app" - "kloudlite.io/apps/message-office/internal/env" - rpc "kloudlite.io/pkg/grpc" - httpServer "kloudlite.io/pkg/http-server" - "kloudlite.io/pkg/redpanda" - mongoDb "kloudlite.io/pkg/repos" + + "github.com/kloudlite/api/apps/message-office/internal/app" + "github.com/kloudlite/api/apps/message-office/internal/env" + "github.com/kloudlite/api/pkg/grpc" + httpServer "github.com/kloudlite/api/pkg/http-server" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/api/pkg/nats" + mongoDb "github.com/kloudlite/api/pkg/repos" ) type fm struct { *env.Env } -func (f *fm) GetBrokers() string { - return f.KafkaBrokers -} - func (f *fm) GetMongoConfig() (url string, dbName string) { return f.DbUri, f.DbName } -func (f *fm) GetKafkaSASLAuth() *redpanda.KafkaSASLAuth { - return nil - // return &redpanda.KafkaSASLAuth{ - // SASLMechanism: redpanda.ScramSHA256, - // User: f.KafkaSaslUsername, - // Password: f.KafkaSaslPassword, - // } -} - -func (f *fm) GetHttpPort() uint16 { - return f.HttpPort -} - func (f *fm) GetHttpCors() string { return "" } -func (e *fm) GetGRPCPort() uint16 { - return e.GrpcPort -} - var Module = fx.Module("framework", fx.Provide(func(ev *env.Env) *fm { return &fm{Env: ev} }), - redpanda.NewClientFx[*fm](), mongoDb.NewMongoClientFx[*fm](), - fx.Provide(func(restCfg *rest.Config) (*kubectl.YAMLClient, error) { - return kubectl.NewYAMLClient(restCfg) + fx.Provide(func(f *fm) (app.RealVectorGrpcClient, error) { + return grpc.NewGrpcClient(f.VectorGrpcAddr) + }), + + fx.Provide(func(ev *env.Env, logger logging.Logger) (*nats.JetstreamClient, error) { + nc, err := nats.NewClient(ev.NatsUrl, nats.ClientOpts{ + Name: "message-offfice", + Logger: logger, + }) + if err != nil { + return nil, errors.NewE(err) + } + + return nats.NewJetstreamClient(nc) }), app.Module, - rpc.NewGrpcServerFx[*fm](), - httpServer.NewHttpServerFx[*fm](), + + fx.Provide(func(logr logging.Logger) (app.InternalGrpcServer, error) { + return grpc.NewGrpcServer(grpc.ServerOpts{ + Logger: logr.WithName("internal-grpc-server"), + }) + }), + + fx.Invoke(func(lf fx.Lifecycle, logr logging.Logger, server app.InternalGrpcServer, ev *env.Env) { + lf.Append(fx.Hook{ + OnStart: func(context.Context) error { + go func() { + if err := server.Listen(fmt.Sprintf(":%d", ev.InternalGrpcPort)); err != nil { + logr.Errorf(err, "while starting internal grpc server") + } + }() + return nil + }, + OnStop: func(context.Context) error { + server.Stop() + return nil + }, + }) + }), + + fx.Provide(func(logr logging.Logger) (app.ExternalGrpcServer, error) { + return grpc.NewGrpcServer(grpc.ServerOpts{ + Logger: logr.WithName("external-grpc-server"), + }) + }), + + fx.Invoke(func(lf fx.Lifecycle,logr logging.Logger, server app.ExternalGrpcServer, ev *env.Env) { + lf.Append(fx.Hook{ + OnStart: func(context.Context) error { + go func() { + if err:=server.Listen(fmt.Sprintf(":%d", ev.ExternalGrpcPort)); err!=nil{ + logr.Errorf(err, "while starting external grpc server") + } + }() + return nil + }, + OnStop: func(context.Context) error { + server.Stop() + return nil + }, + }) + }), + + fx.Provide(func(logger logging.Logger, e *env.Env) httpServer.Server { + return httpServer.NewServer(httpServer.ServerArgs{Logger: logger, IsDev: e.IsDev}) + }), + + fx.Invoke(func(lf fx.Lifecycle, server httpServer.Server, ev *env.Env) { + lf.Append(fx.Hook{ + OnStart: func(context.Context) error { + return server.Listen(fmt.Sprintf(":%d", ev.HttpPort)) + }, + OnStop: func(context.Context) error { + return server.Close() + }, + }) + }), ) diff --git a/apps/message-office/main.go b/apps/message-office/main.go index 572cd450c..f100dac17 100644 --- a/apps/message-office/main.go +++ b/apps/message-office/main.go @@ -3,16 +3,17 @@ package main import ( "context" "flag" - "fmt" + "os" "time" "go.uber.org/fx" "k8s.io/client-go/rest" - env "kloudlite.io/apps/message-office/internal/env" - "kloudlite.io/apps/message-office/internal/framework" - "kloudlite.io/pkg/k8s" - "kloudlite.io/pkg/logging" + "github.com/kloudlite/api/apps/message-office/internal/env" + "github.com/kloudlite/api/apps/message-office/internal/framework" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/k8s" + "github.com/kloudlite/api/pkg/logging" ) func main() { @@ -20,6 +21,11 @@ func main() { flag.BoolVar(&isDev, "dev", false, "--dev") flag.Parse() + logger, err := logging.New(&logging.Options{Name: "message-office", Dev: true}) + if err != nil { + panic(err) + } + app := fx.New( fx.NopLogger, @@ -28,8 +34,8 @@ func main() { }), fx.Provide( - func() (logging.Logger, error) { - return logging.New(&logging.Options{Name: "message-office", Dev: isDev}) + func() logging.Logger { + return logger }, ), @@ -42,7 +48,6 @@ func main() { return k8s.RestInclusterConfig() }), - // fn.FxErrorHandler(), framework.Module, ) @@ -55,18 +60,11 @@ func main() { defer cancelFn() if err := app.Start(ctx); err != nil { - panic(err) + logger.Errorf(err, "message office startup errors") + logger.Infof("EXITING as errors encountered during startup") + os.Exit(1) } - fmt.Println( - ` -██████ ███████ █████ ██████ ██ ██ -██ ██ ██ ██ ██ ██ ██ ██ ██ -██████ █████ ███████ ██ ██ ████ -██ ██ ██ ██ ██ ██ ██ ██ -██ ██ ███████ ██ ██ ██████ ██ - `, - ) - + common.PrintReadyBanner() <-app.Done() } diff --git a/apps/nodecontroller/.dockerignore b/apps/nodecontroller/.dockerignore deleted file mode 100644 index c8899319b..000000000 --- a/apps/nodecontroller/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -*secrets diff --git a/apps/nodecontroller/Dockerfile b/apps/nodecontroller/Dockerfile deleted file mode 100644 index a867105fb..000000000 --- a/apps/nodecontroller/Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -# syntax=docker/dockerfile:1.4 -FROM golang:1.18.3-alpine3.16 AS base -USER 1001 -ENV GOPATH=/tmp/go -ENV GOCACHE=/tmp/go-cache -WORKDIR /tmp/app -COPY --chown=1001 --from=project-root ./go.mod ./go.sum ./tools.go ./ -RUN go mod download -x -COPY --chown=1001 --from=project-root pkg ./pkg -ARG APP -RUN mkdir -p ./apps/$APP -WORKDIR /tmp/app/apps/$APP -COPY --chown=1001 ./ ./ -RUN CGO_ENABLED=0 go build -tags musl -o /tmp/bin/$APP ./main.go -RUN chmod +x /tmp/bin/$APP - -#FROM gcr.io/distroless/static-debian11 -FROM alpine -RUN adduser -D -h /home/nonroot nonroot -RUN apk add curl git openssh-client -# RUN cd bin && curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && chmod +x kubectl -RUN cd bin && curl -o tf.zip https://releases.hashicorp.com/terraform/1.2.9/terraform_1.2.9_linux_amd64.zip && unzip tf.zip -# RUN cd bin && curl -L0 -o talosctl https://github.com/siderolabs/talos/releases/download/v1.2.3/talosctl-linux-amd64 && chmod +x talosctl -USER nonroot -WORKDIR /tmp/app -COPY --chown=nonroot --from=base /tmp/bin/nodecontroller ./nodecontroller -COPY --chown=nonroot --from=project-root ./pkg/infraClient/terraform /templates/terraform -# COPY --chown=nonroot --from=project-root ./pkg/infraClient/templates /tmp/app/pkg/infraClient/templates -CMD ["./nodecontroller"] diff --git a/apps/nodecontroller/Taskfile.yml b/apps/nodecontroller/Taskfile.yml deleted file mode 100644 index 3b0fb80a3..000000000 --- a/apps/nodecontroller/Taskfile.yml +++ /dev/null @@ -1,61 +0,0 @@ -version: "3" - -dotenv: - - .secrets/env - -tasks: - run: - sources: - - ./internal/**/*.go - - ./main.go - cmds: - # - go run -tags dynamic main.go --dev - - nodemon -e go --signal SIGKILL --exec 'go run main.go --dev || exit 1' - - docker-build: - vars: - APP: nodecontroller - IMAGE: registry.kloudlite.io/kloudlite/{{.EnvName}}/{{.APP}}:{{.Tag}} - preconditions: - - sh: '[[ -n "{{.Tag}}" ]]' - msg: 'var Tag must have a value' - - - sh: '[[ "{{.EnvName}}" == "development" ]] || [[ "{{.EnvName}}" == "staging" ]] || [[ "{{.EnvName}}" == "production" ]]' - msg: 'var EnvName must have one of [development, staging, production] as its value' - cmds: - - docker buildx build -f ./Dockerfile -t {{.IMAGE}} . --build-arg APP={{.APP}} --platform linux/amd64 --build-context project-root=../.. - - docker push {{.IMAGE}} - - local-build: - preconditions: - - sh: '[ -n "{{.EnvName}}" ]' - msg: 'var EnvName must have a value' - - sh: '[ -n "{{.Tag}}" ]' - msg: 'var Tag must have a value' - vars: - APP: nodecontroller - IMAGE: registry.kloudlite.io/kloudlite/{{.EnvName}}/{{.APP}}:{{.Tag}} - env: - CGO_ENABLED: 0 - GOOS: linux - GOARCH: amd64 - silent: true - cmds: - - |+ - lineNumbers=$(cat Dockerfile | grep -i '^FROM' -n | tail +2 | awk -F: '{print $1}') - - startLineNo=$(echo "$lineNumbers" | head -n+1) - finalLineNo=$(echo "$lineNumbers" | tail -1) - - tDir=$(mktemp -d) - - nDockerfile=$(cat Dockerfile | tail --lines=+$startLineNo | grep -i --invert-match 'from=base') - echo "$nDockerfile" | sed "1 i # syntax=docker/dockerfile:1.4" > $tDir/Dockerfile.base - - cat $tDir/Dockerfile.base | sed "10 i COPY --from=local-builder ./{{.APP}} ./{{.APP}}" > $tDir/Dockerfile - cat $tDir/Dockerfile - - CGO_ENABLED=0 go build -o $tDir/{{.APP}} . - - docker buildx build -f $tDir/Dockerfile -t {{.IMAGE}} . --build-context local-builder=${tDir} --build-context project-root=../.. - docker push {{.IMAGE}} diff --git a/apps/nodecontroller/internal/app/main.go b/apps/nodecontroller/internal/app/main.go deleted file mode 100644 index dec13f138..000000000 --- a/apps/nodecontroller/internal/app/main.go +++ /dev/null @@ -1,11 +0,0 @@ -package app - -import ( - "go.uber.org/fx" - "kloudlite.io/apps/nodecontroller/internal/domain" -) - -var Module = fx.Module( - "app", - domain.Module, -) diff --git a/apps/nodecontroller/internal/domain/aws.go b/apps/nodecontroller/internal/domain/aws.go deleted file mode 100644 index 73b7df7cb..000000000 --- a/apps/nodecontroller/internal/domain/aws.go +++ /dev/null @@ -1,86 +0,0 @@ -package domain - -import ( - "encoding/base64" - "errors" - - "gopkg.in/yaml.v3" - infraclient "kloudlite.io/pkg/infraClient" -) - -type awsConfig struct { - Version string `yaml:"version"` - Action string `yaml:"action"` - Provider string `yaml:"provider"` - Spec struct { - Provider struct { - AccessKey string `yaml:"accessKey"` - AccessSecret string `yaml:"accessSecret"` - AccountId string `yaml:"accountId"` - } `yaml:"provider"` - Node struct { - Region string `yaml:"region"` - InstanceType string `yaml:"instanceType"` - NodeId string `yaml:"nodeId"` - VPC string `yaml:"vpc"` - ImageId string `yaml:"imageId"` - } `yaml:"node"` - } `yaml:"spec"` -} - -func (d *domainI) doWithAWS() error { - - out, err := base64.StdEncoding.DecodeString(d.env.Config) - if err != nil { - return err - } - var awsConf awsConfig - e := yaml.Unmarshal(out, &awsConf) - if e != nil { - return e - } - klConf, err := d.getKlConf() - if err != nil { - return err - } - - awsProvider := infraclient.NewAWSProvider(infraclient.AWSProvider{ - AccessKey: awsConf.Spec.Provider.AccessKey, - AccessSecret: awsConf.Spec.Provider.AccessSecret, - AccountId: awsConf.Spec.Provider.AccountId, - }, infraclient.AWSProviderEnv{ - StorePath: klConf.Values.StorePath, - TfTemplates: klConf.Values.TfTemplates, - SSHPath: klConf.Values.SSHPath, - }) - - awsNode := infraclient.AWSNode{ - NodeId: awsConf.Spec.Node.NodeId, - Region: awsConf.Spec.Node.Region, - InstanceType: awsConf.Spec.Node.InstanceType, - VPC: awsConf.Spec.Node.VPC, - ImageId: awsConf.Spec.Node.ImageId, - } - - // return nil - - switch awsConf.Action { - case "create": - err = awsProvider.NewNode(awsNode) - if err != nil { - return err - } - - case "delete": - err = awsProvider.DeleteNode(awsNode) - - if err != nil { - return err - } - - default: - return errors.New("wrong action") - } - - return nil -} diff --git a/apps/nodecontroller/internal/domain/do.go b/apps/nodecontroller/internal/domain/do.go deleted file mode 100644 index b193522eb..000000000 --- a/apps/nodecontroller/internal/domain/do.go +++ /dev/null @@ -1,86 +0,0 @@ -package domain - -import ( - "encoding/base64" - "errors" - "fmt" - - "gopkg.in/yaml.v3" - infraclient "kloudlite.io/pkg/infraClient" -) - -type doConfig struct { - Version string `yaml:"version"` - Action string `yaml:"action"` - Provider string `yaml:"provider"` - Spec struct { - Provider struct { - ApiToken string `yaml:"apiToken"` - AccountId string `yaml:"accountId"` - } `yaml:"provider"` - Node struct { - Region string `yaml:"region"` - Size string `yaml:"size"` - NodeId string `yaml:"nodeId"` - ImageId string `yaml:"imageId"` - } `yaml:"node"` - } `yaml:"spec"` -} - -func (d *domainI) doWithDO() error { - - out, err := base64.StdEncoding.DecodeString(d.env.Config) - if err != nil { - fmt.Println("here") - return err - } - - var doConf doConfig - e := yaml.Unmarshal(out, &doConf) - if e != nil { - return e - } - klConf, err := d.getKlConf() - if err != nil { - fmt.Println("here") - return err - } - - doProvider := infraclient.NewDOProvider(infraclient.DoProvider{ - ApiToken: doConf.Spec.Provider.ApiToken, - AccountId: doConf.Spec.Provider.AccountId, - }, infraclient.DoProviderEnv{ - StorePath: klConf.Values.StorePath, - TfTemplates: klConf.Values.TfTemplates, - SSHPath: klConf.Values.SSHPath, - }) - - doNode := infraclient.DoNode{ - Region: doConf.Spec.Node.Region, - Size: doConf.Spec.Node.Size, - NodeId: doConf.Spec.Node.NodeId, - ImageId: doConf.Spec.Node.ImageId, - } - - // return nil - - switch doConf.Action { - case "create": - err = doProvider.NewNode(doNode) - if err != nil { - return err - } - - case "delete": - err = doProvider.DeleteNode(doNode) - - if err != nil { - return err - } - - default: - return errors.New("wrong action") - } - - return nil -} diff --git a/apps/nodecontroller/internal/domain/main.go b/apps/nodecontroller/internal/domain/main.go deleted file mode 100644 index 9ec955892..000000000 --- a/apps/nodecontroller/internal/domain/main.go +++ /dev/null @@ -1,88 +0,0 @@ -package domain - -import ( - "encoding/base64" - "errors" - "fmt" - - "gopkg.in/yaml.v3" - "kloudlite.io/pkg/config" - - "go.uber.org/fx" -) - -type domainI struct { - env *Env -} - -type KLConf struct { - Version string `yaml:"version"` - Values struct { - StorePath string `yaml:"storePath"` - TfTemplates string `yaml:"tfTemplatesPath"` - SSHPath string `yaml:"sshPath"` - PubKey string `yaml:"pubkey"` - } `yaml:"spec"` -} - -func (d *domainI) getKlConf() (*KLConf, error) { - out, err := base64.StdEncoding.DecodeString(d.env.KLConfig) - if err != nil { - fmt.Println("here") - return nil, err - } - - var klConf KLConf - e := yaml.Unmarshal(out, &klConf) - if e != nil { - - return nil, e - } - - return &klConf, nil -} - -// startJob implements Domain -func (d *domainI) StartJob() error { - - switch d.env.Provider { - case "do": - if err := d.doWithDO(); err != nil { - return err - } - - case "aws": - if err := d.doWithAWS(); err != nil { - return err - } - - default: - return errors.New("this type of provider not suported") - } - return nil -} - -func fxDomain(env *Env) Domain { - return &domainI{ - env: env, - } -} - -type Env struct { - Config string `env:"NODE_CONFIG" required:"true"` - Provider string `env:"PROVIDER" required:"true"` - KLConfig string `env:"KL_CONFIG" required:"true"` -} - -var Module = fx.Module( - "domain", - config.EnvFx[Env](), - fx.Provide(fxDomain), -) - -/* -main - -> framework () - -> app () - -> domain (main logic) -*/ diff --git a/apps/nodecontroller/internal/domain/port.go b/apps/nodecontroller/internal/domain/port.go deleted file mode 100644 index 184633284..000000000 --- a/apps/nodecontroller/internal/domain/port.go +++ /dev/null @@ -1,5 +0,0 @@ -package domain - -type Domain interface { - StartJob() error -} diff --git a/apps/nodecontroller/internal/framework/main.go b/apps/nodecontroller/internal/framework/main.go deleted file mode 100644 index 715725db1..000000000 --- a/apps/nodecontroller/internal/framework/main.go +++ /dev/null @@ -1,24 +0,0 @@ -package framework - -import ( - "fmt" - "os" - - "go.uber.org/fx" - "kloudlite.io/apps/nodecontroller/internal/app" - "kloudlite.io/apps/nodecontroller/internal/domain" -) - -var Module = fx.Module( - "framework", - app.Module, - fx.Invoke(func(d domain.Domain, shutdowner fx.Shutdowner) { - err := d.StartJob() - if err != nil { - fmt.Println(err) - os.Exit(1) - } else { - shutdowner.Shutdown() - } - }), -) diff --git a/apps/nodecontroller/main.go b/apps/nodecontroller/main.go deleted file mode 100644 index 08e57e786..000000000 --- a/apps/nodecontroller/main.go +++ /dev/null @@ -1,24 +0,0 @@ -package main - -import ( - "flag" - - "go.uber.org/fx" - "kloudlite.io/apps/nodecontroller/internal/framework" - "kloudlite.io/pkg/logging" -) - -func main() { - var isDev bool - flag.BoolVar(&isDev, "dev", false, "--dev") - flag.Parse() - fx.New( - framework.Module, - fx.Provide( - func() (logging.Logger, error) { - return logging.New(&logging.Options{Name: "auth", Dev: isDev}) - }, - ), - // fx.NopLogger, - ).Run() -} diff --git a/apps/nodecontroller/task.md b/apps/nodecontroller/task.md deleted file mode 100644 index 9ab842f47..000000000 --- a/apps/nodecontroller/task.md +++ /dev/null @@ -1,11 +0,0 @@ -# Tasks - -[ ] lib to create node - [ ] digital ocean - [ ] aws - [ ] azure - [ ] gcp -[ ] read message from kakfa -[ ] execute the message -[ ] commit the message as processed ( according to condition ) -[ ] apply the status in resource annotation of the resource diff --git a/apps/nodectrl/.dockerignore b/apps/nodectrl/.dockerignore deleted file mode 100644 index c8899319b..000000000 --- a/apps/nodectrl/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -*secrets diff --git a/apps/nodectrl/Dockerfile b/apps/nodectrl/Dockerfile deleted file mode 100644 index 57b0cf83b..000000000 --- a/apps/nodectrl/Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -# syntax=docker/dockerfile:1.4 -FROM golang:1.18.3-alpine3.16 AS base -USER 1001 -ENV GOPATH=/tmp/go -ENV GOCACHE=/tmp/go-cache -WORKDIR /tmp/app -COPY --chown=1001 --from=project-root ./go.mod ./go.sum ./tools.go ./ -RUN go mod download -x -COPY --chown=1001 --from=project-root pkg ./pkg -ARG APP -RUN mkdir -p ./apps/$APP -WORKDIR /tmp/app/apps/$APP -COPY --chown=1001 ./ ./ -RUN CGO_ENABLED=0 go build -tags musl -o /tmp/bin/$APP ./main.go -RUN chmod +x /tmp/bin/$APP - -#FROM gcr.io/distroless/static-debian11 -FROM alpine -RUN adduser -D -h /home/nonroot nonroot -RUN apk add curl git openssh-client -RUN cd bin && curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && chmod +x kubectl -RUN cd bin && curl -o tf.zip https://releases.hashicorp.com/terraform/1.2.9/terraform_1.2.9_linux_amd64.zip && unzip tf.zip -# RUN cd bin && curl -L0 -o talosctl https://github.com/siderolabs/talos/releases/download/v1.2.3/talosctl-linux-amd64 && chmod +x talosctl -USER nonroot -WORKDIR /tmp/app -COPY --chown=nonroot --from=base /tmp/bin/nodectrl ./nodectrl -COPY --chown=nonroot --from=project-root ./pkg/infraClient/terraform /templates/terraform -# COPY --chown=nonroot --from=project-root ./pkg/infraClient/templates /tmp/app/pkg/infraClient/templates -CMD ["./nodectrl"] diff --git a/apps/nodectrl/Taskfile.yml b/apps/nodectrl/Taskfile.yml deleted file mode 100644 index c19312618..000000000 --- a/apps/nodectrl/Taskfile.yml +++ /dev/null @@ -1,27 +0,0 @@ -version: "3" - -dotenv: - - .secrets/env - -tasks: - run: - sources: - - ./internal/**/*.go - - ./main.go - cmds: - # - go run -tags dynamic main.go --dev - - nodemon -e go --signal SIGKILL --exec 'go run main.go --dev || exit 1' - - docker-build: - vars: - APP: nodectrl - IMAGE: registry.kloudlite.io/kloudlite/{{.EnvName}}/{{.APP}}:{{.Tag}} - preconditions: - - sh: '[[ -n "{{.Tag}}" ]]' - msg: 'var Tag must have a value' - - - sh: '[[ "{{.EnvName}}" == "development" ]] || [[ "{{.EnvName}}" == "staging" ]] || [[ "{{.EnvName}}" == "production" ]]' - msg: 'var EnvName must have one of [development, staging, production] as its value' - cmds: - - docker buildx build -f ./Dockerfile -t {{.IMAGE}} . --build-arg APP={{.APP}} --platform linux/amd64 --build-context project-root=../.. - - docker push {{.IMAGE}} diff --git a/apps/nodectrl/internal/app/main.go b/apps/nodectrl/internal/app/main.go deleted file mode 100644 index dec13f138..000000000 --- a/apps/nodectrl/internal/app/main.go +++ /dev/null @@ -1,11 +0,0 @@ -package app - -import ( - "go.uber.org/fx" - "kloudlite.io/apps/nodecontroller/internal/domain" -) - -var Module = fx.Module( - "app", - domain.Module, -) diff --git a/apps/nodectrl/internal/domain/aws.go b/apps/nodectrl/internal/domain/aws.go deleted file mode 100644 index 4b324380c..000000000 --- a/apps/nodectrl/internal/domain/aws.go +++ /dev/null @@ -1,103 +0,0 @@ -package domain - -import ( - "encoding/base64" - "encoding/json" - "errors" - "fmt" - - "gopkg.in/yaml.v3" - infraclient "kloudlite.io/pkg/infraClient" -) - -type awsConfig struct { - Version string `yaml:"version"` - Action string `yaml:"action"` - Provider string `yaml:"provider"` - Spec struct { - Provider struct { - AccessKey string `yaml:"accessKey"` - AccessSecret string `yaml:"accessSecret"` - AccountId string `yaml:"accountId"` - } `yaml:"provider"` - Node struct { - Region string `yaml:"region"` - InstanceType string `yaml:"instanceType"` - NodeId string `yaml:"nodeId"` - VPC string `yaml:"vpc"` - } `yaml:"node"` - } `yaml:"spec"` -} - -func (d *domainI) doWithAWS() error { - - out, err := base64.StdEncoding.DecodeString(d.env.Config) - if err != nil { - return err - } - var awsConf awsConfig - e := yaml.Unmarshal(out, &awsConf) - if e != nil { - return e - } - klConf, err := d.getKlConf() - if err != nil { - return err - } - - labels := map[string]string{} - if e := json.Unmarshal([]byte(d.env.Labels), &labels); e != nil { - fmt.Println(e) - } - - taints := []string{} - if e := json.Unmarshal([]byte(d.env.Taints), &taints); e != nil { - fmt.Println(e) - } - - awsProvider := infraclient.NewAWSProvider(infraclient.AWSProvider{ - AccessKey: awsConf.Spec.Provider.AccessKey, - AccessSecret: awsConf.Spec.Provider.AccessSecret, - AccountId: awsConf.Spec.Provider.AccountId, - }, infraclient.AWSProviderEnv{ - StorePath: klConf.Values.StorePath, - TfTemplates: klConf.Values.TfTemplates, - Labels: labels, - Taints: taints, - Secrets: klConf.Values.Secrets, - SSHPath: klConf.Values.SSHPath, - }) - - awsNode := infraclient.AWSNode{ - NodeId: awsConf.Spec.Node.NodeId, - Region: awsConf.Spec.Node.Region, - InstanceType: awsConf.Spec.Node.InstanceType, - VPC: awsConf.Spec.Node.VPC, - } - - // return nil - - switch awsConf.Action { - case "create": - err = awsProvider.NewNode(awsNode) - if err != nil { - return err - } - err = awsProvider.AttachNode(awsNode) - if err != nil { - return err - } - - case "delete": - err = awsProvider.DeleteNode(awsNode) - - if err != nil { - return err - } - - default: - return errors.New("wrong action") - } - - return nil -} diff --git a/apps/nodectrl/internal/domain/do.go b/apps/nodectrl/internal/domain/do.go deleted file mode 100644 index d0bea72b4..000000000 --- a/apps/nodectrl/internal/domain/do.go +++ /dev/null @@ -1,106 +0,0 @@ -package domain - -import ( - "encoding/base64" - "encoding/json" - "errors" - "fmt" - - "gopkg.in/yaml.v3" - infraclient "kloudlite.io/pkg/infraClient" -) - -type doConfig struct { - Version string `yaml:"version"` - Action string `yaml:"action"` - Provider string `yaml:"provider"` - Spec struct { - Provider struct { - ApiToken string `yaml:"apiToken"` - AccountId string `yaml:"accountId"` - } `yaml:"provider"` - Node struct { - Region string `yaml:"region"` - Size string `yaml:"size"` - NodeId string `yaml:"nodeId"` - ImageId string `yaml:"imageId"` - } `yaml:"node"` - } `yaml:"spec"` -} - -func (d *domainI) doWithDO() error { - - out, err := base64.StdEncoding.DecodeString(d.env.Config) - if err != nil { - fmt.Println("here") - return err - } - - var doConf doConfig - e := yaml.Unmarshal(out, &doConf) - if e != nil { - return e - } - klConf, err := d.getKlConf() - if err != nil { - fmt.Println("here") - return err - } - - labels := map[string]string{} - if e := json.Unmarshal([]byte(d.env.Labels), &labels); e != nil { - fmt.Println(e) - } - - taints := []string{} - if e := json.Unmarshal([]byte(d.env.Taints), &taints); e != nil { - fmt.Println(e) - } - - doProvider := infraclient.NewDOProvider(infraclient.DoProvider{ - ApiToken: doConf.Spec.Provider.ApiToken, - AccountId: doConf.Spec.Provider.AccountId, - }, infraclient.DoProviderEnv{ - StorePath: klConf.Values.StorePath, - TfTemplates: klConf.Values.TfTemplates, - Secrets: klConf.Values.Secrets, - Labels: labels, - Taints: taints, - SSHPath: klConf.Values.SSHPath, - }) - - doNode := infraclient.DoNode{ - Region: doConf.Spec.Node.Region, - Size: doConf.Spec.Node.Size, - NodeId: doConf.Spec.Node.NodeId, - ImageId: doConf.Spec.Node.ImageId, - } - - // return nil - - switch doConf.Action { - case "create": - if err = doProvider.NewNode(doNode); err != nil { - return err - } - - if err = doProvider.AttachNode(doNode); err != nil { - return err - } - - case "delete": - - if err = doProvider.UnattachNode(doNode); err != nil { - return err - } - - if err = doProvider.DeleteNode(doNode); err != nil { - return err - } - - default: - return errors.New("wrong action") - } - - return nil -} diff --git a/apps/nodectrl/internal/domain/main.go b/apps/nodectrl/internal/domain/main.go deleted file mode 100644 index 2cb7dd50a..000000000 --- a/apps/nodectrl/internal/domain/main.go +++ /dev/null @@ -1,91 +0,0 @@ -package domain - -import ( - "encoding/base64" - "errors" - "fmt" - - "gopkg.in/yaml.v3" - "kloudlite.io/pkg/config" - - "go.uber.org/fx" -) - -type domainI struct { - env *Env -} - -type KLConf struct { - Version string `yaml:"version"` - Values struct { - StorePath string `yaml:"storePath"` - TfTemplates string `yaml:"tfTemplatesPath"` - Secrets string `yaml:"secrets"` - SSHPath string `yaml:"sshPath"` - PubKey string `yaml:"pubkey"` - } `yaml:"spec"` -} - -func (d *domainI) getKlConf() (*KLConf, error) { - out, err := base64.StdEncoding.DecodeString(d.env.KLConfig) - if err != nil { - fmt.Println("here") - return nil, err - } - - var klConf KLConf - e := yaml.Unmarshal(out, &klConf) - if e != nil { - - return nil, e - } - - return &klConf, nil -} - -// startJob implements Domain -func (d *domainI) StartJob() error { - - switch d.env.Provider { - case "do": - if err := d.doWithDO(); err != nil { - return err - } - - case "aws": - if err := d.doWithAWS(); err != nil { - return err - } - - default: - return errors.New("this type of provider not suported") - } - return nil -} - -func fxDomain(env *Env) Domain { - return &domainI{ - env: env, - } -} - -type Env struct { - Config string `env:"NODE_CONFIG" required:"true"` - Provider string `env:"PROVIDER" required:"true"` - KLConfig string `env:"KL_CONFIG" required:"true"` - Labels string `env:"LABELS" required:"true"` - Taints string `env:"TAINTS" required:"true"` -} - -var Module = fx.Module( - "domain", - config.EnvFx[Env](), - fx.Provide(fxDomain), -) - -/* -main - -> framework () - -> app () - -> domain (main logic) -*/ diff --git a/apps/nodectrl/internal/domain/port.go b/apps/nodectrl/internal/domain/port.go deleted file mode 100644 index 184633284..000000000 --- a/apps/nodectrl/internal/domain/port.go +++ /dev/null @@ -1,5 +0,0 @@ -package domain - -type Domain interface { - StartJob() error -} diff --git a/apps/nodectrl/internal/framework/main.go b/apps/nodectrl/internal/framework/main.go deleted file mode 100644 index 7dd720d14..000000000 --- a/apps/nodectrl/internal/framework/main.go +++ /dev/null @@ -1,24 +0,0 @@ -package framework - -import ( - "fmt" - "os" - - "go.uber.org/fx" - "kloudlite.io/apps/nodectrl/internal/app" - "kloudlite.io/apps/nodectrl/internal/domain" -) - -var Module = fx.Module( - "framework", - app.Module, - fx.Invoke(func(d domain.Domain, shutdowner fx.Shutdowner) { - err := d.StartJob() - if err != nil { - fmt.Println(err) - os.Exit(1) - } else { - shutdowner.Shutdown() - } - }), -) diff --git a/apps/nodectrl/main.go b/apps/nodectrl/main.go deleted file mode 100644 index 64ad2e0a2..000000000 --- a/apps/nodectrl/main.go +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "flag" - - "go.uber.org/fx" - "kloudlite.io/apps/nodectrl/internal/framework" - "kloudlite.io/pkg/logging" -) - -func main() { - var isDev bool - flag.BoolVar(&isDev, "dev", false, "--dev") - flag.Parse() - fx.New( - framework.Module, - fx.Provide( - func() (logging.Logger, error) { - return logging.New(&logging.Options{Name: "auth", Dev: isDev}) - }, - ), - // fx.NopLogger, - ).Run() -} - diff --git a/apps/nodectrl/task.md b/apps/nodectrl/task.md deleted file mode 100644 index 9ab842f47..000000000 --- a/apps/nodectrl/task.md +++ /dev/null @@ -1,11 +0,0 @@ -# Tasks - -[ ] lib to create node - [ ] digital ocean - [ ] aws - [ ] azure - [ ] gcp -[ ] read message from kakfa -[ ] execute the message -[ ] commit the message as processed ( according to condition ) -[ ] apply the status in resource annotation of the resource diff --git a/apps/proxy/Dockerfile b/apps/proxy/Dockerfile deleted file mode 100644 index 9eb63c3fc..000000000 --- a/apps/proxy/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -# context-dir: -FROM golang:1.18.3-alpine3.16 AS base -RUN apk add make gcc libc-dev -USER 1001 -ENV GOPATH=/tmp/go -ENV GOCACHE=/tmp/go-cache -WORKDIR /tmp/app -# COPY --chown=1001 ./go.mod ./go.sum ./tools.go pkg common grpc-interfaces ./ -COPY --chown=1001 ./ ./ -ARG APP_DIR -WORKDIR $APP_DIR -RUN go build -tags musl -o /tmp/bin/proxy ./main.go -RUN chmod +x /tmp/bin/proxy - -FROM golang:1.18.3-alpine3.16 -RUN mkdir /tmp/app -RUN chown -R 1001 /tmp/app -USER 1001 -WORKDIR /tmp/app -COPY --from=base --chown=1001 /tmp/bin/proxy ./ -ENTRYPOINT ["./proxy"] diff --git a/apps/proxy/Taskfile.yml b/apps/proxy/Taskfile.yml deleted file mode 100644 index ef74c4a3b..000000000 --- a/apps/proxy/Taskfile.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: "3" - -dotenv: [".secrets/env"] - -tasks: - gql: - dir: ./internal/app - cmds: - - go run -tags dynamic github.com/99designs/gqlgen generate - run: - env: - CONFIG_FILE: ./conf.json - sources: - - ./internal/**/*.go - - ./main.go - cmds: - - go version -# - nodemon -e go --signal SIGKILL --exec 'go run -tags dynamic main.go --dev || exit 1' - - go run -tags dynamic main.go --dev - - docker-build: - dir: ../.. - vars: - IMAGE: registry.kloudlite.io/public/kloudlite/{{.EnvName}}/proxy:{{.Tag}} - APP_DIR: ./apps/proxy - cmds: - - docker build -f ./{{.APP_DIR}}/Dockerfile -t {{.IMAGE}} . --platform linux/amd64 --build-arg APP_DIR={{.APP_DIR}} - - docker push {{.IMAGE}} diff --git a/apps/proxy/conf.json b/apps/proxy/conf.json deleted file mode 100644 index e234f43fe..000000000 --- a/apps/proxy/conf.json +++ /dev/null @@ -1 +0,0 @@ -{"services":[{"name":"localhost","servicePort":300,"proxyPort":3001},{"name":"localhost","servicePort":3002,"proxyPort":3003},{"name":"localhost","servicePort":3009,"proxyPort":3004}]} diff --git a/apps/proxy/main.go b/apps/proxy/main.go deleted file mode 100644 index 9557ff71b..000000000 --- a/apps/proxy/main.go +++ /dev/null @@ -1,138 +0,0 @@ -package main - -import ( - "encoding/json" - "fmt" - "github.com/gofiber/fiber/v2" - "io" - "net" - "os" - "sync" -) - -type Service struct { - Name string `json:"name"` - Target int `json:"servicePort"` - Port int `json:"proxyPort"` - Listener net.Listener - Closed bool -} - -var ServiceMap map[string]*Service - -func reloadConfig(configData []byte) error { - var data struct { - Services []Service `json:"services"` - } - if configData == nil { - confFile := os.Getenv("CONFIG_FILE") - configData, err := os.ReadFile(confFile) - if err != nil { - return err - } - err = json.Unmarshal(configData, &data) - } else { - err := json.Unmarshal(configData, &data) - if err != nil { - return err - } - } - oldServiceMap := make(map[string]*Service) - for _, service := range ServiceMap { - oldServiceMap[getKey(service)] = service - } - ServiceMap = make(map[string]*Service) - for key, _ := range data.Services { - s := data.Services[key] - if _, ok := oldServiceMap[getKey(&s)]; !ok { - ServiceMap[getKey(&s)] = &s - } else { - ServiceMap[getKey(&s)] = oldServiceMap[getKey(&s)] - } - } - for key, _ := range oldServiceMap { - s := oldServiceMap[key] - if _, ok := ServiceMap[key]; !ok { - err := stopService(s) - if err != nil { - return err - } - } - } - for key, _ := range ServiceMap { - s := ServiceMap[key] - if _, ok := oldServiceMap[getKey(s)]; !ok { - err := startService(s) - if err != nil { - return err - } - } - } - return nil -} -func getKey(service *Service) string { - return fmt.Sprint(service.Name, ":", service.Port, ":", service.Target) -} -func stopService(service *Service) error { - if service.Listener != nil { - err := service.Listener.Close() - service.Closed = true - fmt.Println("- stopping :: ", getKey(service)) - return err - } - return nil -} -func startService(service *Service) error { - listener, err := net.Listen("tcp", fmt.Sprintf(":%d", service.Port)) - if err != nil { - return err - } - service.Listener = listener - service.Closed = false - go runLoop(service) - return nil -} -func runLoop(service *Service) error { - fmt.Println("+ starting :: ", getKey(service)) - for { - if service.Closed || service.Listener == nil { - return nil - } - conn, err := service.Listener.Accept() - if err != nil { - return err - } - go func() { - upconn, err := net.Dial("tcp", fmt.Sprint(service.Name, ":", service.Target)) - if err != nil { - return - } - defer upconn.Close() - defer conn.Close() - go io.Copy(upconn, conn) - io.Copy(conn, upconn) - }() - } -} -func startApi() { - app := fiber.New() - app.Post("/post", func(c *fiber.Ctx) error { - err := reloadConfig(c.Body()) - if err != nil { - return err - } - c.Send([]byte("done")) - return nil - }) - app.Listen(":2999") -} -func main() { - go startApi() - err := reloadConfig(nil) - if err != nil { - panic(err) - } - var wg sync.WaitGroup - wg.Add(1) - wg.Wait() -} diff --git a/apps/proxy/old.txt b/apps/proxy/old.txt deleted file mode 100644 index 4fa797cf6..000000000 --- a/apps/proxy/old.txt +++ /dev/null @@ -1,78 +0,0 @@ -package main - -import ( - "encoding/json" - "fmt" - "io" - "io/ioutil" - "net" - "os" - "sync" -) - -func main() { - - type Service struct { - Name string `json:"name"` - Port int `json:"proxyPort"` - Target int `json:"servicePort"` - } - - var data struct { - Services []Service `json:"services"` - } - - confFile := os.Getenv("CONFIG_FILE") - configData, err := ioutil.ReadFile(confFile) - if err != nil { - fmt.Println("Error reading config file:", confFile, err) - } - - err = json.Unmarshal(configData, &data) - if err != nil { - fmt.Println("Error unmarshalling config file:", err) - } - - for _, service := range data.Services { - go func(service Service) { - - fmt.Println(fmt.Sprint(service.Name, ":", service.Target, "->", service.Port)) - - listener, err := net.Listen("tcp", fmt.Sprintf(":%d", service.Port)) - if err != nil { - fmt.Println("Error listening:", err) - return - } - defer listener.Close() - - for { - conn, err := listener.Accept() - if err != nil { - fmt.Println("Error accepting connection: ", err) - continue - } - upconn, err := net.Dial("tcp", fmt.Sprint(service.Name, ":", service.Target)) - if err != nil { - fmt.Println("Error dialing target: ", err) - conn.Close() - continue - } - go func() { - io.Copy(conn, upconn) - conn.Close() - upconn.Close() - }() - go func() { - io.Copy(upconn, conn) - upconn.Close() - conn.Close() - }() - } - }(service) - } - fmt.Println("running") - - var wg sync.WaitGroup - wg.Add(1) - wg.Wait() -} diff --git a/apps/slack-notifier/internal/app/slack.go b/apps/slack-notifier/internal/app/slack.go deleted file mode 100644 index 6a8d52726..000000000 --- a/apps/slack-notifier/internal/app/slack.go +++ /dev/null @@ -1,61 +0,0 @@ -package app - -import ( - "fmt" - - "github.com/gofiber/fiber/v2" - "github.com/slack-go/slack" - "go.uber.org/fx" - "kloudlite.io/apps/slack-notifier/internal/env" -) - -func fxSlackRoutes() fx.Option { - return fx.Invoke( - func(app *fiber.App, slackApi *slack.Client, ev *env.Env) { - app.Get( - "/", func(ctx *fiber.Ctx) error { - channels, _, err := slackApi.GetConversations(&slack.GetConversationsParameters{}) - if err != nil { - return err - } - return ctx.JSON(channels) - }, - ) - - app.Post( - "/chat", func(ctx *fiber.Ctx) error { - message, s, err := slackApi.PostMessage( - ev.SlackChannelID, slack.MsgOptionCompose( - slack.MsgOptionText("hi sample", true), - slack.MsgOptionBlocks( - slack.SectionBlock{ - Type: slack.MBTSection, - Text: &slack.TextBlockObject{ - Type: slack.MarkdownType, - Text: "## Hi\n**are you watching this**, _really_", - Emoji: false, - Verbatim: false, - }, - BlockID: "", - Fields: nil, - Accessory: nil, - }, - ), - ), - ) - if err != nil { - return err - } - fmt.Println(s) - return ctx.JSON(message) - }, - ) - - }, - ) -} - -var Module = fx.Module( - "app", - fxSlackRoutes(), -) diff --git a/apps/slack-notifier/internal/env/env.go b/apps/slack-notifier/internal/env/env.go deleted file mode 100644 index ceaf321e2..000000000 --- a/apps/slack-notifier/internal/env/env.go +++ /dev/null @@ -1,14 +0,0 @@ -package env - -type Env struct { - SlackAppToken string `env:"SLACK_APP_TOKEN" required:"true"` - SlackChannelID string `env:"SLACK_CHANNEL_ID" required:"true"` - HttpPort uint16 `env:"HTTP_PORT" required:"true"` - HttpCors string `env:"HTTP_CORS"` -} - -type DevMode bool - -func (m DevMode) Value() bool { - return bool(m) -} diff --git a/apps/slack-notifier/internal/framework/framework.go b/apps/slack-notifier/internal/framework/framework.go deleted file mode 100644 index 720c1952d..000000000 --- a/apps/slack-notifier/internal/framework/framework.go +++ /dev/null @@ -1,37 +0,0 @@ -package framework - -import ( - "github.com/slack-go/slack" - "go.uber.org/fx" - "kloudlite.io/apps/slack-notifier/internal/app" - "kloudlite.io/apps/slack-notifier/internal/env" - httpServer "kloudlite.io/pkg/http-server" -) - -type fm struct { - ev *env.Env -} - -func (f fm) GetHttpPort() uint16 { - return f.ev.HttpPort -} - -func (f fm) GetHttpCors() string { - return f.ev.HttpCors -} - -var Module = fx.Module( - "framework", - fx.Provide( - func(ev *env.Env) *fm { - return &fm{ev: ev} - }, - ), - fx.Provide( - func(ev *env.Env, devMode env.DevMode) *slack.Client { - return slack.New(ev.SlackAppToken, slack.OptionDebug(devMode.Value())) - }, - ), - httpServer.NewHttpServerFx[*fm](), - app.Module, -) diff --git a/apps/slack-notifier/main.go b/apps/slack-notifier/main.go deleted file mode 100644 index 35b6a7556..000000000 --- a/apps/slack-notifier/main.go +++ /dev/null @@ -1,56 +0,0 @@ -package main - -import ( - "context" - "flag" - "fmt" - "time" - - "go.uber.org/fx" - "kloudlite.io/apps/slack-notifier/internal/env" - "kloudlite.io/apps/slack-notifier/internal/framework" - "kloudlite.io/pkg/config" - fn "kloudlite.io/pkg/functions" - "kloudlite.io/pkg/logging" -) - -func main() { - var isDev bool - flag.BoolVar(&isDev, "dev", false, "--dev") - flag.Parse() - - app := fx.New( - fx.NopLogger, - fx.Provide( - func() (logging.Logger, error) { - return logging.New(&logging.Options{Name: "slack-notifier", Dev: isDev}) - }, - ), - config.EnvFx[env.Env](), - fx.Provide( - func() env.DevMode { - return env.DevMode(isDev) - }, - ), - framework.Module, - fn.FxErrorHandler(), - ) - - ctx, cancelFn := context.WithTimeout(context.Background(), 3*time.Second) - defer cancelFn() - if err := app.Start(ctx); err != nil { - panic(err) - } - - fmt.Println( - ` -██████ ███████ █████ ██████ ██ ██ -██ ██ ██ ██ ██ ██ ██ ██ ██ -██████ █████ ███████ ██ ██ ████ -██ ██ ██ ██ ██ ██ ██ ██ -██ ██ ███████ ██ ██ ██████ ██ - `, - ) - - <-app.Done() -} diff --git a/apps/finance/.dockerignore b/apps/tenant-agent/.dockerignore similarity index 75% rename from apps/finance/.dockerignore rename to apps/tenant-agent/.dockerignore index b30fec26f..bebf98b4b 100644 --- a/apps/finance/.dockerignore +++ b/apps/tenant-agent/.dockerignore @@ -1,3 +1,4 @@ ** -!main.go !internal +!main.go +!types diff --git a/apps/tenant-agent/Containerfile.local b/apps/tenant-agent/Containerfile.local new file mode 100644 index 000000000..aed8da8e5 --- /dev/null +++ b/apps/tenant-agent/Containerfile.local @@ -0,0 +1,6 @@ +# syntax=docker/dockerfile:1.4 +FROM gcr.io/distroless/static:nonroot +WORKDIR /app +ARG binpath +COPY --from=local-builder ${binpath} ./kloudlite-agent +ENTRYPOINT ["./kloudlite-agent"] diff --git a/apps/tenant-agent/Dockerfile b/apps/tenant-agent/Dockerfile new file mode 100644 index 000000000..c399d4bde --- /dev/null +++ b/apps/tenant-agent/Dockerfile @@ -0,0 +1,28 @@ +# syntax=docker/dockerfile:1.4 +FROM golang:1.18-alpine as builder +RUN apk add curl +WORKDIR /workspace +COPY --from=project ./go.mod ./go.mod +COPY --from=project ./go.sum ./go.sum +RUN ls -al +RUN go mod download -x + +COPY --from=project ./pkg/errors ./pkg/errors +COPY --from=project ./pkg/logging ./pkg/logging +COPY --from=project ./pkg/redpanda ./pkg/redpanda +COPY --from=project ./pkg/functions ./pkg/functions +COPY --from=project ./pkg/kubectl ./pkg/kubectl +WORKDIR ./agent +COPY ./main.go ./main.go +COPY ./internal ./internal + +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o /workspace/kloudlite-agent main.go +RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" > \ + ./kubectl && chmod +x ./kubectl + +# FROM gcr.io/distroless/static:nonroot +FROM alpine:latest +COPY --from=builder /workspace/kubectl /usr/local/bin/kubectl +COPY --from=builder /workspace/kloudlite-agent /kloudlite-agent +USER 65532:65532 +ENTRYPOINT ["/kloudlite-agent"] diff --git a/apps/tenant-agent/Taskfile.yml b/apps/tenant-agent/Taskfile.yml new file mode 100644 index 000000000..8a1862e15 --- /dev/null +++ b/apps/tenant-agent/Taskfile.yml @@ -0,0 +1,48 @@ +version: 3 + +tasks: + vector:proto: + cmds: + - protoc --go_out=. --go-grpc_out=. --go_opt=paths=import --go-grpc_opt=paths=import ./internal/proto/*.proto + + build: + env: + GOOS: linux + GOARCH: amd64 + CGO_ENABLED: 0 + vars: + BuiltAt: + sh: date | sed 's/\s/_/g' + + preconditions: + - sh: '[ -n "{{.Out}}" ]' + msg: var Out must have a value + cmds: + - go build -ldflags="-s -w -X 'github.com/kloudlite/api/common.BuiltAt={{.BuiltAt}}'" -o {{.Out}} + + run: + dotenv: + - .secrets/env + cmds: + - go run . --dev + + local-build: + preconditions: + - sh: '[ -n "{{.Tag}}" ]' + msg: 'var Tag must have a value' + vars: + Name: tenant-agent + Image: ghcr.io/kloudlite/api/{{.Name}}:{{.Tag}} + env: + CGO_ENABLED: 0 + GOOS: linux + GOARCH: amd64 + silent: true + cmds: + - |+ + task build Out=bin/{{.Name}} + echo "[#] building container image {{.Image}}" + podman buildx build -f ./Containerfile.local --build-context local-builder=bin --build-arg binpath=./{{.Name}} -t {{.Image}} . + echo "[#] pushing container image {{.Image}}" + podman push {{.Image}} + diff --git a/apps/tenant-agent/internal/env/env.go b/apps/tenant-agent/internal/env/env.go new file mode 100644 index 000000000..96ffae7ab --- /dev/null +++ b/apps/tenant-agent/internal/env/env.go @@ -0,0 +1,29 @@ +package env + +import ( + "github.com/codingconcepts/env" +) + +type Env struct { + GrpcAddr string `env:"GRPC_ADDR" required:"true"` + + ClusterToken string `env:"CLUSTER_TOKEN" required:"false"` + AccessToken string `env:"ACCESS_TOKEN" required:"false"` + AccessTokenSecretName string `env:"ACCESS_TOKEN_SECRET_NAME" required:"true"` + AccessTokenSecretNamespace string `env:"ACCESS_TOKEN_SECRET_NAMESPACE" required:"true"` + + ClusterName string `env:"CLUSTER_NAME" required:"true"` + AccountName string `env:"ACCOUNT_NAME" required:"true"` + + VectorProxyGrpcServerAddr string `env:"VECTOR_PROXY_GRPC_SERVER_ADDR" required:"true"` + ResourceWatcherName string `env:"RESOURCE_WATCHER_NAME" required:"true"` + ResourceWatcherNamespace string `env:"RESOURCE_WATCHER_NAMESPACE" required:"true"` +} + +func GetEnvOrDie() *Env { + var ev Env + if err := env.Set(&ev); err != nil { + panic(err) + } + return &ev +} diff --git a/apps/tenant-agent/internal/proto-rpc/event.pb.go b/apps/tenant-agent/internal/proto-rpc/event.pb.go new file mode 100644 index 000000000..842dd7ada --- /dev/null +++ b/apps/tenant-agent/internal/proto-rpc/event.pb.go @@ -0,0 +1,3109 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v4.23.3 +// source: internal/proto/event.proto + +package proto_rpc + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ValueNull int32 + +const ( + ValueNull_NULL_VALUE ValueNull = 0 +) + +// Enum value maps for ValueNull. +var ( + ValueNull_name = map[int32]string{ + 0: "NULL_VALUE", + } + ValueNull_value = map[string]int32{ + "NULL_VALUE": 0, + } +) + +func (x ValueNull) Enum() *ValueNull { + p := new(ValueNull) + *p = x + return p +} + +func (x ValueNull) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ValueNull) Descriptor() protoreflect.EnumDescriptor { + return file_internal_proto_event_proto_enumTypes[0].Descriptor() +} + +func (ValueNull) Type() protoreflect.EnumType { + return &file_internal_proto_event_proto_enumTypes[0] +} + +func (x ValueNull) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ValueNull.Descriptor instead. +func (ValueNull) EnumDescriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{0} +} + +type StatisticKind int32 + +const ( + StatisticKind_Histogram StatisticKind = 0 + StatisticKind_Summary StatisticKind = 1 +) + +// Enum value maps for StatisticKind. +var ( + StatisticKind_name = map[int32]string{ + 0: "Histogram", + 1: "Summary", + } + StatisticKind_value = map[string]int32{ + "Histogram": 0, + "Summary": 1, + } +) + +func (x StatisticKind) Enum() *StatisticKind { + p := new(StatisticKind) + *p = x + return p +} + +func (x StatisticKind) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (StatisticKind) Descriptor() protoreflect.EnumDescriptor { + return file_internal_proto_event_proto_enumTypes[1].Descriptor() +} + +func (StatisticKind) Type() protoreflect.EnumType { + return &file_internal_proto_event_proto_enumTypes[1] +} + +func (x StatisticKind) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use StatisticKind.Descriptor instead. +func (StatisticKind) EnumDescriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{1} +} + +type Metric_Kind int32 + +const ( + Metric_Incremental Metric_Kind = 0 + Metric_Absolute Metric_Kind = 1 +) + +// Enum value maps for Metric_Kind. +var ( + Metric_Kind_name = map[int32]string{ + 0: "Incremental", + 1: "Absolute", + } + Metric_Kind_value = map[string]int32{ + "Incremental": 0, + "Absolute": 1, + } +) + +func (x Metric_Kind) Enum() *Metric_Kind { + p := new(Metric_Kind) + *p = x + return p +} + +func (x Metric_Kind) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Metric_Kind) Descriptor() protoreflect.EnumDescriptor { + return file_internal_proto_event_proto_enumTypes[2].Descriptor() +} + +func (Metric_Kind) Type() protoreflect.EnumType { + return &file_internal_proto_event_proto_enumTypes[2] +} + +func (x Metric_Kind) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Metric_Kind.Descriptor instead. +func (Metric_Kind) EnumDescriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{10, 0} +} + +type EventArray struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Events: + // + // *EventArray_Logs + // *EventArray_Metrics + // *EventArray_Traces + Events isEventArray_Events `protobuf_oneof:"events"` +} + +func (x *EventArray) Reset() { + *x = EventArray{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventArray) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventArray) ProtoMessage() {} + +func (x *EventArray) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EventArray.ProtoReflect.Descriptor instead. +func (*EventArray) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{0} +} + +func (m *EventArray) GetEvents() isEventArray_Events { + if m != nil { + return m.Events + } + return nil +} + +func (x *EventArray) GetLogs() *LogArray { + if x, ok := x.GetEvents().(*EventArray_Logs); ok { + return x.Logs + } + return nil +} + +func (x *EventArray) GetMetrics() *MetricArray { + if x, ok := x.GetEvents().(*EventArray_Metrics); ok { + return x.Metrics + } + return nil +} + +func (x *EventArray) GetTraces() *TraceArray { + if x, ok := x.GetEvents().(*EventArray_Traces); ok { + return x.Traces + } + return nil +} + +type isEventArray_Events interface { + isEventArray_Events() +} + +type EventArray_Logs struct { + Logs *LogArray `protobuf:"bytes,1,opt,name=logs,proto3,oneof"` +} + +type EventArray_Metrics struct { + Metrics *MetricArray `protobuf:"bytes,2,opt,name=metrics,proto3,oneof"` +} + +type EventArray_Traces struct { + Traces *TraceArray `protobuf:"bytes,3,opt,name=traces,proto3,oneof"` +} + +func (*EventArray_Logs) isEventArray_Events() {} + +func (*EventArray_Metrics) isEventArray_Events() {} + +func (*EventArray_Traces) isEventArray_Events() {} + +type LogArray struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Logs []*Log `protobuf:"bytes,1,rep,name=logs,proto3" json:"logs,omitempty"` +} + +func (x *LogArray) Reset() { + *x = LogArray{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LogArray) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LogArray) ProtoMessage() {} + +func (x *LogArray) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LogArray.ProtoReflect.Descriptor instead. +func (*LogArray) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{1} +} + +func (x *LogArray) GetLogs() []*Log { + if x != nil { + return x.Logs + } + return nil +} + +type MetricArray struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Metrics []*Metric `protobuf:"bytes,1,rep,name=metrics,proto3" json:"metrics,omitempty"` +} + +func (x *MetricArray) Reset() { + *x = MetricArray{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MetricArray) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MetricArray) ProtoMessage() {} + +func (x *MetricArray) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MetricArray.ProtoReflect.Descriptor instead. +func (*MetricArray) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{2} +} + +func (x *MetricArray) GetMetrics() []*Metric { + if x != nil { + return x.Metrics + } + return nil +} + +type TraceArray struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Traces []*Trace `protobuf:"bytes,1,rep,name=traces,proto3" json:"traces,omitempty"` +} + +func (x *TraceArray) Reset() { + *x = TraceArray{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TraceArray) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TraceArray) ProtoMessage() {} + +func (x *TraceArray) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TraceArray.ProtoReflect.Descriptor instead. +func (*TraceArray) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{3} +} + +func (x *TraceArray) GetTraces() []*Trace { + if x != nil { + return x.Traces + } + return nil +} + +type EventWrapper struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Event: + // + // *EventWrapper_Log + // *EventWrapper_Metric + // *EventWrapper_Trace + Event isEventWrapper_Event `protobuf_oneof:"event"` +} + +func (x *EventWrapper) Reset() { + *x = EventWrapper{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventWrapper) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventWrapper) ProtoMessage() {} + +func (x *EventWrapper) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EventWrapper.ProtoReflect.Descriptor instead. +func (*EventWrapper) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{4} +} + +func (m *EventWrapper) GetEvent() isEventWrapper_Event { + if m != nil { + return m.Event + } + return nil +} + +func (x *EventWrapper) GetLog() *Log { + if x, ok := x.GetEvent().(*EventWrapper_Log); ok { + return x.Log + } + return nil +} + +func (x *EventWrapper) GetMetric() *Metric { + if x, ok := x.GetEvent().(*EventWrapper_Metric); ok { + return x.Metric + } + return nil +} + +func (x *EventWrapper) GetTrace() *Trace { + if x, ok := x.GetEvent().(*EventWrapper_Trace); ok { + return x.Trace + } + return nil +} + +type isEventWrapper_Event interface { + isEventWrapper_Event() +} + +type EventWrapper_Log struct { + Log *Log `protobuf:"bytes,1,opt,name=log,proto3,oneof"` +} + +type EventWrapper_Metric struct { + Metric *Metric `protobuf:"bytes,2,opt,name=metric,proto3,oneof"` +} + +type EventWrapper_Trace struct { + Trace *Trace `protobuf:"bytes,3,opt,name=trace,proto3,oneof"` +} + +func (*EventWrapper_Log) isEventWrapper_Event() {} + +func (*EventWrapper_Metric) isEventWrapper_Event() {} + +func (*EventWrapper_Trace) isEventWrapper_Event() {} + +type Log struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Deprecated, use value instead + Fields map[string]*Value `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Value *Value `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + Metadata *Value `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (x *Log) Reset() { + *x = Log{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Log) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Log) ProtoMessage() {} + +func (x *Log) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Log.ProtoReflect.Descriptor instead. +func (*Log) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{5} +} + +func (x *Log) GetFields() map[string]*Value { + if x != nil { + return x.Fields + } + return nil +} + +func (x *Log) GetValue() *Value { + if x != nil { + return x.Value + } + return nil +} + +func (x *Log) GetMetadata() *Value { + if x != nil { + return x.Metadata + } + return nil +} + +type Trace struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Fields map[string]*Value `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Metadata *Value `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (x *Trace) Reset() { + *x = Trace{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Trace) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Trace) ProtoMessage() {} + +func (x *Trace) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Trace.ProtoReflect.Descriptor instead. +func (*Trace) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{6} +} + +func (x *Trace) GetFields() map[string]*Value { + if x != nil { + return x.Fields + } + return nil +} + +func (x *Trace) GetMetadata() *Value { + if x != nil { + return x.Metadata + } + return nil +} + +type ValueMap struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Fields map[string]*Value `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *ValueMap) Reset() { + *x = ValueMap{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValueMap) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValueMap) ProtoMessage() {} + +func (x *ValueMap) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValueMap.ProtoReflect.Descriptor instead. +func (*ValueMap) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{7} +} + +func (x *ValueMap) GetFields() map[string]*Value { + if x != nil { + return x.Fields + } + return nil +} + +type ValueArray struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Items []*Value `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` +} + +func (x *ValueArray) Reset() { + *x = ValueArray{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValueArray) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValueArray) ProtoMessage() {} + +func (x *ValueArray) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValueArray.ProtoReflect.Descriptor instead. +func (*ValueArray) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{8} +} + +func (x *ValueArray) GetItems() []*Value { + if x != nil { + return x.Items + } + return nil +} + +type Value struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Kind: + // + // *Value_RawBytes + // *Value_Timestamp + // *Value_Integer + // *Value_Float + // *Value_Boolean + // *Value_Map + // *Value_Array + // *Value_Null + Kind isValue_Kind `protobuf_oneof:"kind"` +} + +func (x *Value) Reset() { + *x = Value{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Value) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Value) ProtoMessage() {} + +func (x *Value) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Value.ProtoReflect.Descriptor instead. +func (*Value) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{9} +} + +func (m *Value) GetKind() isValue_Kind { + if m != nil { + return m.Kind + } + return nil +} + +func (x *Value) GetRawBytes() []byte { + if x, ok := x.GetKind().(*Value_RawBytes); ok { + return x.RawBytes + } + return nil +} + +func (x *Value) GetTimestamp() *timestamppb.Timestamp { + if x, ok := x.GetKind().(*Value_Timestamp); ok { + return x.Timestamp + } + return nil +} + +func (x *Value) GetInteger() int64 { + if x, ok := x.GetKind().(*Value_Integer); ok { + return x.Integer + } + return 0 +} + +func (x *Value) GetFloat() float64 { + if x, ok := x.GetKind().(*Value_Float); ok { + return x.Float + } + return 0 +} + +func (x *Value) GetBoolean() bool { + if x, ok := x.GetKind().(*Value_Boolean); ok { + return x.Boolean + } + return false +} + +func (x *Value) GetMap() *ValueMap { + if x, ok := x.GetKind().(*Value_Map); ok { + return x.Map + } + return nil +} + +func (x *Value) GetArray() *ValueArray { + if x, ok := x.GetKind().(*Value_Array); ok { + return x.Array + } + return nil +} + +func (x *Value) GetNull() ValueNull { + if x, ok := x.GetKind().(*Value_Null); ok { + return x.Null + } + return ValueNull_NULL_VALUE +} + +type isValue_Kind interface { + isValue_Kind() +} + +type Value_RawBytes struct { + RawBytes []byte `protobuf:"bytes,1,opt,name=raw_bytes,json=rawBytes,proto3,oneof"` +} + +type Value_Timestamp struct { + Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3,oneof"` +} + +type Value_Integer struct { + Integer int64 `protobuf:"varint,4,opt,name=integer,proto3,oneof"` +} + +type Value_Float struct { + Float float64 `protobuf:"fixed64,5,opt,name=float,proto3,oneof"` +} + +type Value_Boolean struct { + Boolean bool `protobuf:"varint,6,opt,name=boolean,proto3,oneof"` +} + +type Value_Map struct { + Map *ValueMap `protobuf:"bytes,7,opt,name=map,proto3,oneof"` +} + +type Value_Array struct { + Array *ValueArray `protobuf:"bytes,8,opt,name=array,proto3,oneof"` +} + +type Value_Null struct { + Null ValueNull `protobuf:"varint,9,opt,name=null,proto3,enum=vector.ValueNull,oneof"` +} + +func (*Value_RawBytes) isValue_Kind() {} + +func (*Value_Timestamp) isValue_Kind() {} + +func (*Value_Integer) isValue_Kind() {} + +func (*Value_Float) isValue_Kind() {} + +func (*Value_Boolean) isValue_Kind() {} + +func (*Value_Map) isValue_Kind() {} + +func (*Value_Array) isValue_Kind() {} + +func (*Value_Null) isValue_Kind() {} + +type Metric struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + TagsV1 map[string]string `protobuf:"bytes,3,rep,name=tags_v1,json=tagsV1,proto3" json:"tags_v1,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + TagsV2 map[string]*TagValues `protobuf:"bytes,20,rep,name=tags_v2,json=tagsV2,proto3" json:"tags_v2,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Kind Metric_Kind `protobuf:"varint,4,opt,name=kind,proto3,enum=vector.Metric_Kind" json:"kind,omitempty"` + // Types that are assignable to Value: + // + // *Metric_Counter + // *Metric_Gauge + // *Metric_Set + // *Metric_Distribution1 + // *Metric_AggregatedHistogram1 + // *Metric_AggregatedSummary1 + // *Metric_Distribution2 + // *Metric_AggregatedHistogram2 + // *Metric_AggregatedSummary2 + // *Metric_Sketch + // *Metric_AggregatedHistogram3 + // *Metric_AggregatedSummary3 + Value isMetric_Value `protobuf_oneof:"value"` + Namespace string `protobuf:"bytes,11,opt,name=namespace,proto3" json:"namespace,omitempty"` + IntervalMs uint32 `protobuf:"varint,18,opt,name=interval_ms,json=intervalMs,proto3" json:"interval_ms,omitempty"` + Metadata *Value `protobuf:"bytes,19,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (x *Metric) Reset() { + *x = Metric{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Metric) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Metric) ProtoMessage() {} + +func (x *Metric) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Metric.ProtoReflect.Descriptor instead. +func (*Metric) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{10} +} + +func (x *Metric) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Metric) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +func (x *Metric) GetTagsV1() map[string]string { + if x != nil { + return x.TagsV1 + } + return nil +} + +func (x *Metric) GetTagsV2() map[string]*TagValues { + if x != nil { + return x.TagsV2 + } + return nil +} + +func (x *Metric) GetKind() Metric_Kind { + if x != nil { + return x.Kind + } + return Metric_Incremental +} + +func (m *Metric) GetValue() isMetric_Value { + if m != nil { + return m.Value + } + return nil +} + +func (x *Metric) GetCounter() *Counter { + if x, ok := x.GetValue().(*Metric_Counter); ok { + return x.Counter + } + return nil +} + +func (x *Metric) GetGauge() *Gauge { + if x, ok := x.GetValue().(*Metric_Gauge); ok { + return x.Gauge + } + return nil +} + +func (x *Metric) GetSet() *Set { + if x, ok := x.GetValue().(*Metric_Set); ok { + return x.Set + } + return nil +} + +func (x *Metric) GetDistribution1() *Distribution1 { + if x, ok := x.GetValue().(*Metric_Distribution1); ok { + return x.Distribution1 + } + return nil +} + +func (x *Metric) GetAggregatedHistogram1() *AggregatedHistogram1 { + if x, ok := x.GetValue().(*Metric_AggregatedHistogram1); ok { + return x.AggregatedHistogram1 + } + return nil +} + +func (x *Metric) GetAggregatedSummary1() *AggregatedSummary1 { + if x, ok := x.GetValue().(*Metric_AggregatedSummary1); ok { + return x.AggregatedSummary1 + } + return nil +} + +func (x *Metric) GetDistribution2() *Distribution2 { + if x, ok := x.GetValue().(*Metric_Distribution2); ok { + return x.Distribution2 + } + return nil +} + +func (x *Metric) GetAggregatedHistogram2() *AggregatedHistogram2 { + if x, ok := x.GetValue().(*Metric_AggregatedHistogram2); ok { + return x.AggregatedHistogram2 + } + return nil +} + +func (x *Metric) GetAggregatedSummary2() *AggregatedSummary2 { + if x, ok := x.GetValue().(*Metric_AggregatedSummary2); ok { + return x.AggregatedSummary2 + } + return nil +} + +func (x *Metric) GetSketch() *Sketch { + if x, ok := x.GetValue().(*Metric_Sketch); ok { + return x.Sketch + } + return nil +} + +func (x *Metric) GetAggregatedHistogram3() *AggregatedHistogram3 { + if x, ok := x.GetValue().(*Metric_AggregatedHistogram3); ok { + return x.AggregatedHistogram3 + } + return nil +} + +func (x *Metric) GetAggregatedSummary3() *AggregatedSummary3 { + if x, ok := x.GetValue().(*Metric_AggregatedSummary3); ok { + return x.AggregatedSummary3 + } + return nil +} + +func (x *Metric) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *Metric) GetIntervalMs() uint32 { + if x != nil { + return x.IntervalMs + } + return 0 +} + +func (x *Metric) GetMetadata() *Value { + if x != nil { + return x.Metadata + } + return nil +} + +type isMetric_Value interface { + isMetric_Value() +} + +type Metric_Counter struct { + Counter *Counter `protobuf:"bytes,5,opt,name=counter,proto3,oneof"` +} + +type Metric_Gauge struct { + Gauge *Gauge `protobuf:"bytes,6,opt,name=gauge,proto3,oneof"` +} + +type Metric_Set struct { + Set *Set `protobuf:"bytes,7,opt,name=set,proto3,oneof"` +} + +type Metric_Distribution1 struct { + Distribution1 *Distribution1 `protobuf:"bytes,8,opt,name=distribution1,proto3,oneof"` +} + +type Metric_AggregatedHistogram1 struct { + AggregatedHistogram1 *AggregatedHistogram1 `protobuf:"bytes,9,opt,name=aggregated_histogram1,json=aggregatedHistogram1,proto3,oneof"` +} + +type Metric_AggregatedSummary1 struct { + AggregatedSummary1 *AggregatedSummary1 `protobuf:"bytes,10,opt,name=aggregated_summary1,json=aggregatedSummary1,proto3,oneof"` +} + +type Metric_Distribution2 struct { + Distribution2 *Distribution2 `protobuf:"bytes,12,opt,name=distribution2,proto3,oneof"` +} + +type Metric_AggregatedHistogram2 struct { + AggregatedHistogram2 *AggregatedHistogram2 `protobuf:"bytes,13,opt,name=aggregated_histogram2,json=aggregatedHistogram2,proto3,oneof"` +} + +type Metric_AggregatedSummary2 struct { + AggregatedSummary2 *AggregatedSummary2 `protobuf:"bytes,14,opt,name=aggregated_summary2,json=aggregatedSummary2,proto3,oneof"` +} + +type Metric_Sketch struct { + Sketch *Sketch `protobuf:"bytes,15,opt,name=sketch,proto3,oneof"` +} + +type Metric_AggregatedHistogram3 struct { + AggregatedHistogram3 *AggregatedHistogram3 `protobuf:"bytes,16,opt,name=aggregated_histogram3,json=aggregatedHistogram3,proto3,oneof"` +} + +type Metric_AggregatedSummary3 struct { + AggregatedSummary3 *AggregatedSummary3 `protobuf:"bytes,17,opt,name=aggregated_summary3,json=aggregatedSummary3,proto3,oneof"` +} + +func (*Metric_Counter) isMetric_Value() {} + +func (*Metric_Gauge) isMetric_Value() {} + +func (*Metric_Set) isMetric_Value() {} + +func (*Metric_Distribution1) isMetric_Value() {} + +func (*Metric_AggregatedHistogram1) isMetric_Value() {} + +func (*Metric_AggregatedSummary1) isMetric_Value() {} + +func (*Metric_Distribution2) isMetric_Value() {} + +func (*Metric_AggregatedHistogram2) isMetric_Value() {} + +func (*Metric_AggregatedSummary2) isMetric_Value() {} + +func (*Metric_Sketch) isMetric_Value() {} + +func (*Metric_AggregatedHistogram3) isMetric_Value() {} + +func (*Metric_AggregatedSummary3) isMetric_Value() {} + +type TagValues struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Values []*TagValue `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` +} + +func (x *TagValues) Reset() { + *x = TagValues{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TagValues) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TagValues) ProtoMessage() {} + +func (x *TagValues) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TagValues.ProtoReflect.Descriptor instead. +func (*TagValues) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{11} +} + +func (x *TagValues) GetValues() []*TagValue { + if x != nil { + return x.Values + } + return nil +} + +type TagValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value *string `protobuf:"bytes,1,opt,name=value,proto3,oneof" json:"value,omitempty"` +} + +func (x *TagValue) Reset() { + *x = TagValue{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TagValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TagValue) ProtoMessage() {} + +func (x *TagValue) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TagValue.ProtoReflect.Descriptor instead. +func (*TagValue) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{12} +} + +func (x *TagValue) GetValue() string { + if x != nil && x.Value != nil { + return *x.Value + } + return "" +} + +type Counter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *Counter) Reset() { + *x = Counter{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Counter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Counter) ProtoMessage() {} + +func (x *Counter) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Counter.ProtoReflect.Descriptor instead. +func (*Counter) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{13} +} + +func (x *Counter) GetValue() float64 { + if x != nil { + return x.Value + } + return 0 +} + +type Gauge struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *Gauge) Reset() { + *x = Gauge{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Gauge) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Gauge) ProtoMessage() {} + +func (x *Gauge) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Gauge.ProtoReflect.Descriptor instead. +func (*Gauge) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{14} +} + +func (x *Gauge) GetValue() float64 { + if x != nil { + return x.Value + } + return 0 +} + +type Set struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Values []string `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` +} + +func (x *Set) Reset() { + *x = Set{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Set) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Set) ProtoMessage() {} + +func (x *Set) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Set.ProtoReflect.Descriptor instead. +func (*Set) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{15} +} + +func (x *Set) GetValues() []string { + if x != nil { + return x.Values + } + return nil +} + +type Distribution1 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Values []float64 `protobuf:"fixed64,1,rep,packed,name=values,proto3" json:"values,omitempty"` + SampleRates []uint32 `protobuf:"varint,2,rep,packed,name=sample_rates,json=sampleRates,proto3" json:"sample_rates,omitempty"` + Statistic StatisticKind `protobuf:"varint,3,opt,name=statistic,proto3,enum=vector.StatisticKind" json:"statistic,omitempty"` +} + +func (x *Distribution1) Reset() { + *x = Distribution1{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Distribution1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Distribution1) ProtoMessage() {} + +func (x *Distribution1) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Distribution1.ProtoReflect.Descriptor instead. +func (*Distribution1) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{16} +} + +func (x *Distribution1) GetValues() []float64 { + if x != nil { + return x.Values + } + return nil +} + +func (x *Distribution1) GetSampleRates() []uint32 { + if x != nil { + return x.SampleRates + } + return nil +} + +func (x *Distribution1) GetStatistic() StatisticKind { + if x != nil { + return x.Statistic + } + return StatisticKind_Histogram +} + +type Distribution2 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Samples []*DistributionSample `protobuf:"bytes,1,rep,name=samples,proto3" json:"samples,omitempty"` + Statistic StatisticKind `protobuf:"varint,2,opt,name=statistic,proto3,enum=vector.StatisticKind" json:"statistic,omitempty"` +} + +func (x *Distribution2) Reset() { + *x = Distribution2{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Distribution2) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Distribution2) ProtoMessage() {} + +func (x *Distribution2) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Distribution2.ProtoReflect.Descriptor instead. +func (*Distribution2) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{17} +} + +func (x *Distribution2) GetSamples() []*DistributionSample { + if x != nil { + return x.Samples + } + return nil +} + +func (x *Distribution2) GetStatistic() StatisticKind { + if x != nil { + return x.Statistic + } + return StatisticKind_Histogram +} + +type DistributionSample struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"` + Rate uint32 `protobuf:"varint,2,opt,name=rate,proto3" json:"rate,omitempty"` +} + +func (x *DistributionSample) Reset() { + *x = DistributionSample{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DistributionSample) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DistributionSample) ProtoMessage() {} + +func (x *DistributionSample) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DistributionSample.ProtoReflect.Descriptor instead. +func (*DistributionSample) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{18} +} + +func (x *DistributionSample) GetValue() float64 { + if x != nil { + return x.Value + } + return 0 +} + +func (x *DistributionSample) GetRate() uint32 { + if x != nil { + return x.Rate + } + return 0 +} + +type AggregatedHistogram1 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Buckets []float64 `protobuf:"fixed64,1,rep,packed,name=buckets,proto3" json:"buckets,omitempty"` + Counts []uint32 `protobuf:"varint,2,rep,packed,name=counts,proto3" json:"counts,omitempty"` + Count uint32 `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"` + Sum float64 `protobuf:"fixed64,4,opt,name=sum,proto3" json:"sum,omitempty"` +} + +func (x *AggregatedHistogram1) Reset() { + *x = AggregatedHistogram1{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AggregatedHistogram1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AggregatedHistogram1) ProtoMessage() {} + +func (x *AggregatedHistogram1) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AggregatedHistogram1.ProtoReflect.Descriptor instead. +func (*AggregatedHistogram1) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{19} +} + +func (x *AggregatedHistogram1) GetBuckets() []float64 { + if x != nil { + return x.Buckets + } + return nil +} + +func (x *AggregatedHistogram1) GetCounts() []uint32 { + if x != nil { + return x.Counts + } + return nil +} + +func (x *AggregatedHistogram1) GetCount() uint32 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *AggregatedHistogram1) GetSum() float64 { + if x != nil { + return x.Sum + } + return 0 +} + +type AggregatedHistogram2 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Buckets []*HistogramBucket `protobuf:"bytes,1,rep,name=buckets,proto3" json:"buckets,omitempty"` + Count uint32 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` + Sum float64 `protobuf:"fixed64,3,opt,name=sum,proto3" json:"sum,omitempty"` +} + +func (x *AggregatedHistogram2) Reset() { + *x = AggregatedHistogram2{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AggregatedHistogram2) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AggregatedHistogram2) ProtoMessage() {} + +func (x *AggregatedHistogram2) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AggregatedHistogram2.ProtoReflect.Descriptor instead. +func (*AggregatedHistogram2) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{20} +} + +func (x *AggregatedHistogram2) GetBuckets() []*HistogramBucket { + if x != nil { + return x.Buckets + } + return nil +} + +func (x *AggregatedHistogram2) GetCount() uint32 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *AggregatedHistogram2) GetSum() float64 { + if x != nil { + return x.Sum + } + return 0 +} + +type AggregatedHistogram3 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Buckets []*HistogramBucket3 `protobuf:"bytes,1,rep,name=buckets,proto3" json:"buckets,omitempty"` + Count uint64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` + Sum float64 `protobuf:"fixed64,3,opt,name=sum,proto3" json:"sum,omitempty"` +} + +func (x *AggregatedHistogram3) Reset() { + *x = AggregatedHistogram3{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AggregatedHistogram3) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AggregatedHistogram3) ProtoMessage() {} + +func (x *AggregatedHistogram3) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AggregatedHistogram3.ProtoReflect.Descriptor instead. +func (*AggregatedHistogram3) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{21} +} + +func (x *AggregatedHistogram3) GetBuckets() []*HistogramBucket3 { + if x != nil { + return x.Buckets + } + return nil +} + +func (x *AggregatedHistogram3) GetCount() uint64 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *AggregatedHistogram3) GetSum() float64 { + if x != nil { + return x.Sum + } + return 0 +} + +type HistogramBucket struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UpperLimit float64 `protobuf:"fixed64,1,opt,name=upper_limit,json=upperLimit,proto3" json:"upper_limit,omitempty"` + Count uint32 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *HistogramBucket) Reset() { + *x = HistogramBucket{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HistogramBucket) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HistogramBucket) ProtoMessage() {} + +func (x *HistogramBucket) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HistogramBucket.ProtoReflect.Descriptor instead. +func (*HistogramBucket) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{22} +} + +func (x *HistogramBucket) GetUpperLimit() float64 { + if x != nil { + return x.UpperLimit + } + return 0 +} + +func (x *HistogramBucket) GetCount() uint32 { + if x != nil { + return x.Count + } + return 0 +} + +type HistogramBucket3 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UpperLimit float64 `protobuf:"fixed64,1,opt,name=upper_limit,json=upperLimit,proto3" json:"upper_limit,omitempty"` + Count uint64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *HistogramBucket3) Reset() { + *x = HistogramBucket3{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HistogramBucket3) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HistogramBucket3) ProtoMessage() {} + +func (x *HistogramBucket3) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HistogramBucket3.ProtoReflect.Descriptor instead. +func (*HistogramBucket3) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{23} +} + +func (x *HistogramBucket3) GetUpperLimit() float64 { + if x != nil { + return x.UpperLimit + } + return 0 +} + +func (x *HistogramBucket3) GetCount() uint64 { + if x != nil { + return x.Count + } + return 0 +} + +type AggregatedSummary1 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Quantiles []float64 `protobuf:"fixed64,1,rep,packed,name=quantiles,proto3" json:"quantiles,omitempty"` + Values []float64 `protobuf:"fixed64,2,rep,packed,name=values,proto3" json:"values,omitempty"` + Count uint32 `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"` + Sum float64 `protobuf:"fixed64,4,opt,name=sum,proto3" json:"sum,omitempty"` +} + +func (x *AggregatedSummary1) Reset() { + *x = AggregatedSummary1{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AggregatedSummary1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AggregatedSummary1) ProtoMessage() {} + +func (x *AggregatedSummary1) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AggregatedSummary1.ProtoReflect.Descriptor instead. +func (*AggregatedSummary1) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{24} +} + +func (x *AggregatedSummary1) GetQuantiles() []float64 { + if x != nil { + return x.Quantiles + } + return nil +} + +func (x *AggregatedSummary1) GetValues() []float64 { + if x != nil { + return x.Values + } + return nil +} + +func (x *AggregatedSummary1) GetCount() uint32 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *AggregatedSummary1) GetSum() float64 { + if x != nil { + return x.Sum + } + return 0 +} + +type AggregatedSummary2 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Quantiles []*SummaryQuantile `protobuf:"bytes,1,rep,name=quantiles,proto3" json:"quantiles,omitempty"` + Count uint32 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` + Sum float64 `protobuf:"fixed64,3,opt,name=sum,proto3" json:"sum,omitempty"` +} + +func (x *AggregatedSummary2) Reset() { + *x = AggregatedSummary2{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AggregatedSummary2) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AggregatedSummary2) ProtoMessage() {} + +func (x *AggregatedSummary2) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AggregatedSummary2.ProtoReflect.Descriptor instead. +func (*AggregatedSummary2) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{25} +} + +func (x *AggregatedSummary2) GetQuantiles() []*SummaryQuantile { + if x != nil { + return x.Quantiles + } + return nil +} + +func (x *AggregatedSummary2) GetCount() uint32 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *AggregatedSummary2) GetSum() float64 { + if x != nil { + return x.Sum + } + return 0 +} + +type AggregatedSummary3 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Quantiles []*SummaryQuantile `protobuf:"bytes,1,rep,name=quantiles,proto3" json:"quantiles,omitempty"` + Count uint64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` + Sum float64 `protobuf:"fixed64,3,opt,name=sum,proto3" json:"sum,omitempty"` +} + +func (x *AggregatedSummary3) Reset() { + *x = AggregatedSummary3{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AggregatedSummary3) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AggregatedSummary3) ProtoMessage() {} + +func (x *AggregatedSummary3) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AggregatedSummary3.ProtoReflect.Descriptor instead. +func (*AggregatedSummary3) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{26} +} + +func (x *AggregatedSummary3) GetQuantiles() []*SummaryQuantile { + if x != nil { + return x.Quantiles + } + return nil +} + +func (x *AggregatedSummary3) GetCount() uint64 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *AggregatedSummary3) GetSum() float64 { + if x != nil { + return x.Sum + } + return 0 +} + +type SummaryQuantile struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Quantile float64 `protobuf:"fixed64,1,opt,name=quantile,proto3" json:"quantile,omitempty"` + Value float64 `protobuf:"fixed64,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *SummaryQuantile) Reset() { + *x = SummaryQuantile{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SummaryQuantile) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SummaryQuantile) ProtoMessage() {} + +func (x *SummaryQuantile) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SummaryQuantile.ProtoReflect.Descriptor instead. +func (*SummaryQuantile) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{27} +} + +func (x *SummaryQuantile) GetQuantile() float64 { + if x != nil { + return x.Quantile + } + return 0 +} + +func (x *SummaryQuantile) GetValue() float64 { + if x != nil { + return x.Value + } + return 0 +} + +type Sketch struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Sketch: + // + // *Sketch_AgentDdSketch + Sketch isSketch_Sketch `protobuf_oneof:"sketch"` +} + +func (x *Sketch) Reset() { + *x = Sketch{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Sketch) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Sketch) ProtoMessage() {} + +func (x *Sketch) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[28] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Sketch.ProtoReflect.Descriptor instead. +func (*Sketch) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{28} +} + +func (m *Sketch) GetSketch() isSketch_Sketch { + if m != nil { + return m.Sketch + } + return nil +} + +func (x *Sketch) GetAgentDdSketch() *Sketch_AgentDDSketch { + if x, ok := x.GetSketch().(*Sketch_AgentDdSketch); ok { + return x.AgentDdSketch + } + return nil +} + +type isSketch_Sketch interface { + isSketch_Sketch() +} + +type Sketch_AgentDdSketch struct { + AgentDdSketch *Sketch_AgentDDSketch `protobuf:"bytes,1,opt,name=agent_dd_sketch,json=agentDdSketch,proto3,oneof"` +} + +func (*Sketch_AgentDdSketch) isSketch_Sketch() {} + +type Sketch_AgentDDSketch struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Summary statistics for the samples in this sketch. + Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` + Min float64 `protobuf:"fixed64,2,opt,name=min,proto3" json:"min,omitempty"` + Max float64 `protobuf:"fixed64,3,opt,name=max,proto3" json:"max,omitempty"` + Sum float64 `protobuf:"fixed64,4,opt,name=sum,proto3" json:"sum,omitempty"` + Avg float64 `protobuf:"fixed64,5,opt,name=avg,proto3" json:"avg,omitempty"` + // The bins (buckets) of this sketch, where `k` and `n` are unzipped pairs. + // `k` is the list of bin indexes that are populated, and `n` is the count of samples + // within the given bin. + K []int32 `protobuf:"zigzag32,6,rep,packed,name=k,proto3" json:"k,omitempty"` + N []uint32 `protobuf:"varint,7,rep,packed,name=n,proto3" json:"n,omitempty"` +} + +func (x *Sketch_AgentDDSketch) Reset() { + *x = Sketch_AgentDDSketch{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_event_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Sketch_AgentDDSketch) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Sketch_AgentDDSketch) ProtoMessage() {} + +func (x *Sketch_AgentDDSketch) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_event_proto_msgTypes[34] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Sketch_AgentDDSketch.ProtoReflect.Descriptor instead. +func (*Sketch_AgentDDSketch) Descriptor() ([]byte, []int) { + return file_internal_proto_event_proto_rawDescGZIP(), []int{28, 0} +} + +func (x *Sketch_AgentDDSketch) GetCount() uint32 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *Sketch_AgentDDSketch) GetMin() float64 { + if x != nil { + return x.Min + } + return 0 +} + +func (x *Sketch_AgentDDSketch) GetMax() float64 { + if x != nil { + return x.Max + } + return 0 +} + +func (x *Sketch_AgentDDSketch) GetSum() float64 { + if x != nil { + return x.Sum + } + return 0 +} + +func (x *Sketch_AgentDDSketch) GetAvg() float64 { + if x != nil { + return x.Avg + } + return 0 +} + +func (x *Sketch_AgentDDSketch) GetK() []int32 { + if x != nil { + return x.K + } + return nil +} + +func (x *Sketch_AgentDDSketch) GetN() []uint32 { + if x != nil { + return x.N + } + return nil +} + +var File_internal_proto_event_proto protoreflect.FileDescriptor + +var file_internal_proto_event_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x76, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9d, 0x01, 0x0a, 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x41, + 0x72, 0x72, 0x61, 0x79, 0x12, 0x26, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x41, + 0x72, 0x72, 0x61, 0x79, 0x48, 0x00, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x12, 0x2f, 0x0a, 0x07, + 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, + 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x41, 0x72, 0x72, + 0x61, 0x79, 0x48, 0x00, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, 0x2c, 0x0a, + 0x06, 0x74, 0x72, 0x61, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, + 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x41, 0x72, 0x72, 0x61, + 0x79, 0x48, 0x00, 0x52, 0x06, 0x74, 0x72, 0x61, 0x63, 0x65, 0x73, 0x42, 0x08, 0x0a, 0x06, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x2b, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x41, 0x72, 0x72, 0x61, + 0x79, 0x12, 0x1f, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x0b, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x04, 0x6c, 0x6f, + 0x67, 0x73, 0x22, 0x37, 0x0a, 0x0b, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x41, 0x72, 0x72, 0x61, + 0x79, 0x12, 0x28, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x4d, 0x65, 0x74, 0x72, + 0x69, 0x63, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x22, 0x33, 0x0a, 0x0a, 0x54, + 0x72, 0x61, 0x63, 0x65, 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x72, 0x61, + 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x76, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x52, 0x06, 0x74, 0x72, 0x61, 0x63, 0x65, 0x73, + 0x22, 0x89, 0x01, 0x0a, 0x0c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, + 0x72, 0x12, 0x1f, 0x0a, 0x03, 0x6c, 0x6f, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, + 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x48, 0x00, 0x52, 0x03, 0x6c, + 0x6f, 0x67, 0x12, 0x28, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x4d, 0x65, 0x74, 0x72, + 0x69, 0x63, 0x48, 0x00, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12, 0x25, 0x0a, 0x05, + 0x74, 0x72, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x76, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x48, 0x00, 0x52, 0x05, 0x74, 0x72, + 0x61, 0x63, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x22, 0xd0, 0x01, 0x0a, + 0x03, 0x4c, 0x6f, 0x67, 0x12, 0x2f, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x6f, + 0x67, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x23, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x29, 0x0a, 0x08, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x76, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x48, 0x0a, 0x0b, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, + 0xaf, 0x01, 0x0a, 0x05, 0x54, 0x72, 0x61, 0x63, 0x65, 0x12, 0x31, 0x0a, 0x06, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x76, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x29, 0x0a, 0x08, + 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, + 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x48, 0x0a, 0x0b, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, + 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x22, 0x8a, 0x01, 0x0a, 0x08, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x61, 0x70, 0x12, 0x34, + 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, + 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x61, 0x70, + 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x73, 0x1a, 0x48, 0x0a, 0x0b, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x31, + 0x0a, 0x0a, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x23, 0x0a, 0x05, + 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x76, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, + 0x73, 0x22, 0xbb, 0x02, 0x0a, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1d, 0x0a, 0x09, 0x72, + 0x61, 0x77, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, + 0x52, 0x08, 0x72, 0x61, 0x77, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x09, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1a, 0x0a, 0x07, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x07, 0x69, 0x6e, 0x74, 0x65, 0x67, + 0x65, 0x72, 0x12, 0x16, 0x0a, 0x05, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x01, 0x48, 0x00, 0x52, 0x05, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x12, 0x1a, 0x0a, 0x07, 0x62, 0x6f, + 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x62, + 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x12, 0x24, 0x0a, 0x03, 0x6d, 0x61, 0x70, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x4d, 0x61, 0x70, 0x48, 0x00, 0x52, 0x03, 0x6d, 0x61, 0x70, 0x12, 0x2a, 0x0a, 0x05, + 0x61, 0x72, 0x72, 0x61, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x76, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x41, 0x72, 0x72, 0x61, 0x79, 0x48, + 0x00, 0x52, 0x05, 0x61, 0x72, 0x72, 0x61, 0x79, 0x12, 0x27, 0x0a, 0x04, 0x6e, 0x75, 0x6c, 0x6c, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4e, 0x75, 0x6c, 0x6c, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x75, 0x6c, + 0x6c, 0x42, 0x06, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, + 0x95, 0x0a, 0x0a, 0x06, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x38, + 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x61, 0x67, 0x73, + 0x5f, 0x76, 0x31, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x76, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x2e, 0x54, 0x61, 0x67, 0x73, 0x56, 0x31, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x74, 0x61, 0x67, 0x73, 0x56, 0x31, 0x12, 0x33, 0x0a, + 0x07, 0x74, 0x61, 0x67, 0x73, 0x5f, 0x76, 0x32, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x2e, 0x54, + 0x61, 0x67, 0x73, 0x56, 0x32, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x74, 0x61, 0x67, 0x73, + 0x56, 0x32, 0x12, 0x27, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x13, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, + 0x2e, 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x2b, 0x0a, 0x07, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x48, 0x00, 0x52, + 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x25, 0x0a, 0x05, 0x67, 0x61, 0x75, 0x67, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, + 0x2e, 0x47, 0x61, 0x75, 0x67, 0x65, 0x48, 0x00, 0x52, 0x05, 0x67, 0x61, 0x75, 0x67, 0x65, 0x12, + 0x1f, 0x0a, 0x03, 0x73, 0x65, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x76, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x48, 0x00, 0x52, 0x03, 0x73, 0x65, 0x74, + 0x12, 0x3d, 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x31, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, + 0x2e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x48, 0x00, + 0x52, 0x0d, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x12, + 0x53, 0x0a, 0x15, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x69, + 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x31, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, + 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x65, 0x64, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x31, 0x48, 0x00, 0x52, 0x14, + 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, + 0x72, 0x61, 0x6d, 0x31, 0x12, 0x4d, 0x0a, 0x13, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x31, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x31, 0x48, 0x00, 0x52, + 0x12, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x75, 0x6d, 0x6d, 0x61, + 0x72, 0x79, 0x31, 0x12, 0x3d, 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x32, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x76, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x2e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x32, 0x48, 0x00, 0x52, 0x0d, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x32, 0x12, 0x53, 0x0a, 0x15, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, + 0x5f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x32, 0x18, 0x0d, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x64, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x32, 0x48, + 0x00, 0x52, 0x14, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x48, 0x69, 0x73, + 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x32, 0x12, 0x4d, 0x0a, 0x13, 0x61, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x32, 0x18, 0x0e, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x67, + 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x32, + 0x48, 0x00, 0x52, 0x12, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x75, + 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x32, 0x12, 0x28, 0x0a, 0x06, 0x73, 0x6b, 0x65, 0x74, 0x63, 0x68, + 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, + 0x53, 0x6b, 0x65, 0x74, 0x63, 0x68, 0x48, 0x00, 0x52, 0x06, 0x73, 0x6b, 0x65, 0x74, 0x63, 0x68, + 0x12, 0x53, 0x0a, 0x15, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x68, + 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x33, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x65, 0x64, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x33, 0x48, 0x00, 0x52, + 0x14, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x48, 0x69, 0x73, 0x74, 0x6f, + 0x67, 0x72, 0x61, 0x6d, 0x33, 0x12, 0x4d, 0x0a, 0x13, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x33, 0x18, 0x11, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x33, 0x48, 0x00, + 0x52, 0x12, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x75, 0x6d, 0x6d, + 0x61, 0x72, 0x79, 0x33, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x5f, 0x6d, + 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, + 0x6c, 0x4d, 0x73, 0x12, 0x29, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x39, + 0x0a, 0x0b, 0x54, 0x61, 0x67, 0x73, 0x56, 0x31, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x4c, 0x0a, 0x0b, 0x54, 0x61, 0x67, + 0x73, 0x56, 0x32, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x76, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x25, 0x0a, 0x04, 0x4b, 0x69, 0x6e, 0x64, 0x12, + 0x0f, 0x0a, 0x0b, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x10, 0x00, + 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x10, 0x01, 0x42, 0x07, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x35, 0x0a, 0x09, 0x54, 0x61, 0x67, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x12, 0x28, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x61, + 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x2f, + 0x0a, 0x08, 0x54, 0x61, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x19, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x88, 0x01, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, + 0x1f, 0x0a, 0x07, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x22, 0x1d, 0x0a, 0x05, 0x47, 0x61, 0x75, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, + 0x1d, 0x0a, 0x03, 0x53, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x7f, + 0x0a, 0x0d, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x12, + 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x01, 0x52, + 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x0b, 0x73, + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x61, 0x74, 0x65, 0x73, 0x12, 0x33, 0x0a, 0x09, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, + 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, + 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x22, + 0x7a, 0x0a, 0x0d, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x32, + 0x12, 0x34, 0x0a, 0x07, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x44, 0x69, 0x73, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x07, 0x73, + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x12, 0x33, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, + 0x74, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x76, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x4b, 0x69, 0x6e, 0x64, + 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x22, 0x3e, 0x0a, 0x12, 0x44, + 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x74, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x72, 0x61, 0x74, 0x65, 0x22, 0x70, 0x0a, 0x14, 0x41, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, + 0x61, 0x6d, 0x31, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x01, 0x52, 0x07, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x12, 0x16, 0x0a, + 0x06, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x06, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x73, + 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x73, 0x75, 0x6d, 0x22, 0x71, 0x0a, + 0x14, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x48, 0x69, 0x73, 0x74, 0x6f, + 0x67, 0x72, 0x61, 0x6d, 0x32, 0x12, 0x31, 0x0a, 0x07, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, + 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, + 0x07, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x10, + 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x73, 0x75, 0x6d, + 0x22, 0x72, 0x0a, 0x14, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x48, 0x69, + 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x33, 0x12, 0x32, 0x0a, 0x07, 0x62, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x76, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x42, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x33, 0x52, 0x07, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, + 0x03, 0x73, 0x75, 0x6d, 0x22, 0x48, 0x0a, 0x0f, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, + 0x6d, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x70, 0x70, 0x65, 0x72, + 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x75, 0x70, + 0x70, 0x65, 0x72, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x49, + 0x0a, 0x10, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x42, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x33, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x70, 0x70, 0x65, 0x72, 0x5f, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x75, 0x70, 0x70, 0x65, 0x72, 0x4c, 0x69, + 0x6d, 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x72, 0x0a, 0x12, 0x41, 0x67, 0x67, + 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x31, 0x12, + 0x1c, 0x0a, 0x09, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x01, 0x52, 0x09, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x16, 0x0a, + 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x01, 0x52, 0x06, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x73, + 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x73, 0x75, 0x6d, 0x22, 0x73, 0x0a, + 0x12, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x75, 0x6d, 0x6d, 0x61, + 0x72, 0x79, 0x32, 0x12, 0x35, 0x0a, 0x09, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, + 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x52, + 0x09, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x10, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x73, + 0x75, 0x6d, 0x22, 0x73, 0x0a, 0x12, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, + 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x33, 0x12, 0x35, 0x0a, 0x09, 0x71, 0x75, 0x61, 0x6e, + 0x74, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x76, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x51, 0x75, 0x61, 0x6e, + 0x74, 0x69, 0x6c, 0x65, 0x52, 0x09, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x73, 0x12, + 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x01, 0x52, 0x03, 0x73, 0x75, 0x6d, 0x22, 0x43, 0x0a, 0x0f, 0x53, 0x75, 0x6d, 0x6d, 0x61, + 0x72, 0x79, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x71, 0x75, + 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x71, 0x75, + 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xe6, 0x01, 0x0a, + 0x06, 0x53, 0x6b, 0x65, 0x74, 0x63, 0x68, 0x12, 0x46, 0x0a, 0x0f, 0x61, 0x67, 0x65, 0x6e, 0x74, + 0x5f, 0x64, 0x64, 0x5f, 0x73, 0x6b, 0x65, 0x74, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x6b, 0x65, 0x74, 0x63, 0x68, + 0x2e, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x44, 0x44, 0x53, 0x6b, 0x65, 0x74, 0x63, 0x68, 0x48, 0x00, + 0x52, 0x0d, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x44, 0x64, 0x53, 0x6b, 0x65, 0x74, 0x63, 0x68, 0x1a, + 0x89, 0x01, 0x0a, 0x0d, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x44, 0x44, 0x53, 0x6b, 0x65, 0x74, 0x63, + 0x68, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x69, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x6d, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x61, 0x78, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x6d, 0x61, 0x78, 0x12, 0x10, 0x0a, 0x03, 0x73, + 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x73, 0x75, 0x6d, 0x12, 0x10, 0x0a, + 0x03, 0x61, 0x76, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x61, 0x76, 0x67, 0x12, + 0x0c, 0x0a, 0x01, 0x6b, 0x18, 0x06, 0x20, 0x03, 0x28, 0x11, 0x52, 0x01, 0x6b, 0x12, 0x0c, 0x0a, + 0x01, 0x6e, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x01, 0x6e, 0x42, 0x08, 0x0a, 0x06, 0x73, + 0x6b, 0x65, 0x74, 0x63, 0x68, 0x2a, 0x1b, 0x0a, 0x09, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4e, 0x75, + 0x6c, 0x6c, 0x12, 0x0e, 0x0a, 0x0a, 0x4e, 0x55, 0x4c, 0x4c, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, + 0x10, 0x00, 0x2a, 0x2b, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x4b, + 0x69, 0x6e, 0x64, 0x12, 0x0d, 0x0a, 0x09, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, + 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x10, 0x01, 0x42, + 0x14, 0x5a, 0x12, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2d, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_internal_proto_event_proto_rawDescOnce sync.Once + file_internal_proto_event_proto_rawDescData = file_internal_proto_event_proto_rawDesc +) + +func file_internal_proto_event_proto_rawDescGZIP() []byte { + file_internal_proto_event_proto_rawDescOnce.Do(func() { + file_internal_proto_event_proto_rawDescData = protoimpl.X.CompressGZIP(file_internal_proto_event_proto_rawDescData) + }) + return file_internal_proto_event_proto_rawDescData +} + +var file_internal_proto_event_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_internal_proto_event_proto_msgTypes = make([]protoimpl.MessageInfo, 35) +var file_internal_proto_event_proto_goTypes = []interface{}{ + (ValueNull)(0), // 0: vector.ValueNull + (StatisticKind)(0), // 1: vector.StatisticKind + (Metric_Kind)(0), // 2: vector.Metric.Kind + (*EventArray)(nil), // 3: vector.EventArray + (*LogArray)(nil), // 4: vector.LogArray + (*MetricArray)(nil), // 5: vector.MetricArray + (*TraceArray)(nil), // 6: vector.TraceArray + (*EventWrapper)(nil), // 7: vector.EventWrapper + (*Log)(nil), // 8: vector.Log + (*Trace)(nil), // 9: vector.Trace + (*ValueMap)(nil), // 10: vector.ValueMap + (*ValueArray)(nil), // 11: vector.ValueArray + (*Value)(nil), // 12: vector.Value + (*Metric)(nil), // 13: vector.Metric + (*TagValues)(nil), // 14: vector.TagValues + (*TagValue)(nil), // 15: vector.TagValue + (*Counter)(nil), // 16: vector.Counter + (*Gauge)(nil), // 17: vector.Gauge + (*Set)(nil), // 18: vector.Set + (*Distribution1)(nil), // 19: vector.Distribution1 + (*Distribution2)(nil), // 20: vector.Distribution2 + (*DistributionSample)(nil), // 21: vector.DistributionSample + (*AggregatedHistogram1)(nil), // 22: vector.AggregatedHistogram1 + (*AggregatedHistogram2)(nil), // 23: vector.AggregatedHistogram2 + (*AggregatedHistogram3)(nil), // 24: vector.AggregatedHistogram3 + (*HistogramBucket)(nil), // 25: vector.HistogramBucket + (*HistogramBucket3)(nil), // 26: vector.HistogramBucket3 + (*AggregatedSummary1)(nil), // 27: vector.AggregatedSummary1 + (*AggregatedSummary2)(nil), // 28: vector.AggregatedSummary2 + (*AggregatedSummary3)(nil), // 29: vector.AggregatedSummary3 + (*SummaryQuantile)(nil), // 30: vector.SummaryQuantile + (*Sketch)(nil), // 31: vector.Sketch + nil, // 32: vector.Log.FieldsEntry + nil, // 33: vector.Trace.FieldsEntry + nil, // 34: vector.ValueMap.FieldsEntry + nil, // 35: vector.Metric.TagsV1Entry + nil, // 36: vector.Metric.TagsV2Entry + (*Sketch_AgentDDSketch)(nil), // 37: vector.Sketch.AgentDDSketch + (*timestamppb.Timestamp)(nil), // 38: google.protobuf.Timestamp +} +var file_internal_proto_event_proto_depIdxs = []int32{ + 4, // 0: vector.EventArray.logs:type_name -> vector.LogArray + 5, // 1: vector.EventArray.metrics:type_name -> vector.MetricArray + 6, // 2: vector.EventArray.traces:type_name -> vector.TraceArray + 8, // 3: vector.LogArray.logs:type_name -> vector.Log + 13, // 4: vector.MetricArray.metrics:type_name -> vector.Metric + 9, // 5: vector.TraceArray.traces:type_name -> vector.Trace + 8, // 6: vector.EventWrapper.log:type_name -> vector.Log + 13, // 7: vector.EventWrapper.metric:type_name -> vector.Metric + 9, // 8: vector.EventWrapper.trace:type_name -> vector.Trace + 32, // 9: vector.Log.fields:type_name -> vector.Log.FieldsEntry + 12, // 10: vector.Log.value:type_name -> vector.Value + 12, // 11: vector.Log.metadata:type_name -> vector.Value + 33, // 12: vector.Trace.fields:type_name -> vector.Trace.FieldsEntry + 12, // 13: vector.Trace.metadata:type_name -> vector.Value + 34, // 14: vector.ValueMap.fields:type_name -> vector.ValueMap.FieldsEntry + 12, // 15: vector.ValueArray.items:type_name -> vector.Value + 38, // 16: vector.Value.timestamp:type_name -> google.protobuf.Timestamp + 10, // 17: vector.Value.map:type_name -> vector.ValueMap + 11, // 18: vector.Value.array:type_name -> vector.ValueArray + 0, // 19: vector.Value.null:type_name -> vector.ValueNull + 38, // 20: vector.Metric.timestamp:type_name -> google.protobuf.Timestamp + 35, // 21: vector.Metric.tags_v1:type_name -> vector.Metric.TagsV1Entry + 36, // 22: vector.Metric.tags_v2:type_name -> vector.Metric.TagsV2Entry + 2, // 23: vector.Metric.kind:type_name -> vector.Metric.Kind + 16, // 24: vector.Metric.counter:type_name -> vector.Counter + 17, // 25: vector.Metric.gauge:type_name -> vector.Gauge + 18, // 26: vector.Metric.set:type_name -> vector.Set + 19, // 27: vector.Metric.distribution1:type_name -> vector.Distribution1 + 22, // 28: vector.Metric.aggregated_histogram1:type_name -> vector.AggregatedHistogram1 + 27, // 29: vector.Metric.aggregated_summary1:type_name -> vector.AggregatedSummary1 + 20, // 30: vector.Metric.distribution2:type_name -> vector.Distribution2 + 23, // 31: vector.Metric.aggregated_histogram2:type_name -> vector.AggregatedHistogram2 + 28, // 32: vector.Metric.aggregated_summary2:type_name -> vector.AggregatedSummary2 + 31, // 33: vector.Metric.sketch:type_name -> vector.Sketch + 24, // 34: vector.Metric.aggregated_histogram3:type_name -> vector.AggregatedHistogram3 + 29, // 35: vector.Metric.aggregated_summary3:type_name -> vector.AggregatedSummary3 + 12, // 36: vector.Metric.metadata:type_name -> vector.Value + 15, // 37: vector.TagValues.values:type_name -> vector.TagValue + 1, // 38: vector.Distribution1.statistic:type_name -> vector.StatisticKind + 21, // 39: vector.Distribution2.samples:type_name -> vector.DistributionSample + 1, // 40: vector.Distribution2.statistic:type_name -> vector.StatisticKind + 25, // 41: vector.AggregatedHistogram2.buckets:type_name -> vector.HistogramBucket + 26, // 42: vector.AggregatedHistogram3.buckets:type_name -> vector.HistogramBucket3 + 30, // 43: vector.AggregatedSummary2.quantiles:type_name -> vector.SummaryQuantile + 30, // 44: vector.AggregatedSummary3.quantiles:type_name -> vector.SummaryQuantile + 37, // 45: vector.Sketch.agent_dd_sketch:type_name -> vector.Sketch.AgentDDSketch + 12, // 46: vector.Log.FieldsEntry.value:type_name -> vector.Value + 12, // 47: vector.Trace.FieldsEntry.value:type_name -> vector.Value + 12, // 48: vector.ValueMap.FieldsEntry.value:type_name -> vector.Value + 14, // 49: vector.Metric.TagsV2Entry.value:type_name -> vector.TagValues + 50, // [50:50] is the sub-list for method output_type + 50, // [50:50] is the sub-list for method input_type + 50, // [50:50] is the sub-list for extension type_name + 50, // [50:50] is the sub-list for extension extendee + 0, // [0:50] is the sub-list for field type_name +} + +func init() { file_internal_proto_event_proto_init() } +func file_internal_proto_event_proto_init() { + if File_internal_proto_event_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_internal_proto_event_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventArray); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_event_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LogArray); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_event_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MetricArray); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_event_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TraceArray); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_event_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventWrapper); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_event_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Log); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_event_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Trace); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_event_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValueMap); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_event_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValueArray); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_event_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Value); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_event_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Metric); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_event_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TagValues); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_event_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TagValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_event_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Counter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_event_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Gauge); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_event_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Set); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_event_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Distribution1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_event_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Distribution2); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_event_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DistributionSample); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_event_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AggregatedHistogram1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_event_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AggregatedHistogram2); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_event_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AggregatedHistogram3); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_event_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HistogramBucket); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_event_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HistogramBucket3); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_event_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AggregatedSummary1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_event_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AggregatedSummary2); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_event_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AggregatedSummary3); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_event_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SummaryQuantile); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_event_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Sketch); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_event_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Sketch_AgentDDSketch); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_internal_proto_event_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*EventArray_Logs)(nil), + (*EventArray_Metrics)(nil), + (*EventArray_Traces)(nil), + } + file_internal_proto_event_proto_msgTypes[4].OneofWrappers = []interface{}{ + (*EventWrapper_Log)(nil), + (*EventWrapper_Metric)(nil), + (*EventWrapper_Trace)(nil), + } + file_internal_proto_event_proto_msgTypes[9].OneofWrappers = []interface{}{ + (*Value_RawBytes)(nil), + (*Value_Timestamp)(nil), + (*Value_Integer)(nil), + (*Value_Float)(nil), + (*Value_Boolean)(nil), + (*Value_Map)(nil), + (*Value_Array)(nil), + (*Value_Null)(nil), + } + file_internal_proto_event_proto_msgTypes[10].OneofWrappers = []interface{}{ + (*Metric_Counter)(nil), + (*Metric_Gauge)(nil), + (*Metric_Set)(nil), + (*Metric_Distribution1)(nil), + (*Metric_AggregatedHistogram1)(nil), + (*Metric_AggregatedSummary1)(nil), + (*Metric_Distribution2)(nil), + (*Metric_AggregatedHistogram2)(nil), + (*Metric_AggregatedSummary2)(nil), + (*Metric_Sketch)(nil), + (*Metric_AggregatedHistogram3)(nil), + (*Metric_AggregatedSummary3)(nil), + } + file_internal_proto_event_proto_msgTypes[12].OneofWrappers = []interface{}{} + file_internal_proto_event_proto_msgTypes[28].OneofWrappers = []interface{}{ + (*Sketch_AgentDdSketch)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_internal_proto_event_proto_rawDesc, + NumEnums: 3, + NumMessages: 35, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_internal_proto_event_proto_goTypes, + DependencyIndexes: file_internal_proto_event_proto_depIdxs, + EnumInfos: file_internal_proto_event_proto_enumTypes, + MessageInfos: file_internal_proto_event_proto_msgTypes, + }.Build() + File_internal_proto_event_proto = out.File + file_internal_proto_event_proto_rawDesc = nil + file_internal_proto_event_proto_goTypes = nil + file_internal_proto_event_proto_depIdxs = nil +} diff --git a/apps/tenant-agent/internal/proto-rpc/vector.pb.go b/apps/tenant-agent/internal/proto-rpc/vector.pb.go new file mode 100644 index 000000000..311d13cbd --- /dev/null +++ b/apps/tenant-agent/internal/proto-rpc/vector.pb.go @@ -0,0 +1,385 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v4.23.3 +// source: internal/proto/vector.proto + +package proto_rpc + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ServingStatus int32 + +const ( + ServingStatus_SERVING ServingStatus = 0 + ServingStatus_NOT_SERVING ServingStatus = 1 +) + +// Enum value maps for ServingStatus. +var ( + ServingStatus_name = map[int32]string{ + 0: "SERVING", + 1: "NOT_SERVING", + } + ServingStatus_value = map[string]int32{ + "SERVING": 0, + "NOT_SERVING": 1, + } +) + +func (x ServingStatus) Enum() *ServingStatus { + p := new(ServingStatus) + *p = x + return p +} + +func (x ServingStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ServingStatus) Descriptor() protoreflect.EnumDescriptor { + return file_internal_proto_vector_proto_enumTypes[0].Descriptor() +} + +func (ServingStatus) Type() protoreflect.EnumType { + return &file_internal_proto_vector_proto_enumTypes[0] +} + +func (x ServingStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ServingStatus.Descriptor instead. +func (ServingStatus) EnumDescriptor() ([]byte, []int) { + return file_internal_proto_vector_proto_rawDescGZIP(), []int{0} +} + +type PushEventsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Events []*EventWrapper `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"` +} + +func (x *PushEventsRequest) Reset() { + *x = PushEventsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_vector_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PushEventsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PushEventsRequest) ProtoMessage() {} + +func (x *PushEventsRequest) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_vector_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PushEventsRequest.ProtoReflect.Descriptor instead. +func (*PushEventsRequest) Descriptor() ([]byte, []int) { + return file_internal_proto_vector_proto_rawDescGZIP(), []int{0} +} + +func (x *PushEventsRequest) GetEvents() []*EventWrapper { + if x != nil { + return x.Events + } + return nil +} + +type PushEventsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *PushEventsResponse) Reset() { + *x = PushEventsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_vector_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PushEventsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PushEventsResponse) ProtoMessage() {} + +func (x *PushEventsResponse) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_vector_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PushEventsResponse.ProtoReflect.Descriptor instead. +func (*PushEventsResponse) Descriptor() ([]byte, []int) { + return file_internal_proto_vector_proto_rawDescGZIP(), []int{1} +} + +type HealthCheckRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *HealthCheckRequest) Reset() { + *x = HealthCheckRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_vector_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HealthCheckRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HealthCheckRequest) ProtoMessage() {} + +func (x *HealthCheckRequest) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_vector_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HealthCheckRequest.ProtoReflect.Descriptor instead. +func (*HealthCheckRequest) Descriptor() ([]byte, []int) { + return file_internal_proto_vector_proto_rawDescGZIP(), []int{2} +} + +type HealthCheckResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status ServingStatus `protobuf:"varint,1,opt,name=status,proto3,enum=vector.ServingStatus" json:"status,omitempty"` +} + +func (x *HealthCheckResponse) Reset() { + *x = HealthCheckResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_proto_vector_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HealthCheckResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HealthCheckResponse) ProtoMessage() {} + +func (x *HealthCheckResponse) ProtoReflect() protoreflect.Message { + mi := &file_internal_proto_vector_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HealthCheckResponse.ProtoReflect.Descriptor instead. +func (*HealthCheckResponse) Descriptor() ([]byte, []int) { + return file_internal_proto_vector_proto_rawDescGZIP(), []int{3} +} + +func (x *HealthCheckResponse) GetStatus() ServingStatus { + if x != nil { + return x.Status + } + return ServingStatus_SERVING +} + +var File_internal_proto_vector_proto protoreflect.FileDescriptor + +var file_internal_proto_vector_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x76, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x1a, 0x1a, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x41, 0x0a, 0x11, 0x50, 0x75, 0x73, 0x68, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x52, 0x06, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x73, 0x22, 0x14, 0x0a, 0x12, 0x50, 0x75, 0x73, 0x68, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x0a, 0x12, 0x48, 0x65, + 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x22, 0x44, 0x0a, 0x13, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, + 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2a, 0x2d, 0x0a, 0x0d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x6e, + 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x45, 0x52, 0x56, 0x49, + 0x4e, 0x47, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x4e, 0x4f, 0x54, 0x5f, 0x53, 0x45, 0x52, 0x56, + 0x49, 0x4e, 0x47, 0x10, 0x01, 0x32, 0x97, 0x01, 0x0a, 0x06, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, + 0x12, 0x45, 0x0a, 0x0a, 0x50, 0x75, 0x73, 0x68, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x19, + 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x76, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x6c, 0x74, + 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x1a, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, + 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x48, 0x65, 0x61, 0x6c, + 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, + 0x14, 0x5a, 0x12, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2d, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_internal_proto_vector_proto_rawDescOnce sync.Once + file_internal_proto_vector_proto_rawDescData = file_internal_proto_vector_proto_rawDesc +) + +func file_internal_proto_vector_proto_rawDescGZIP() []byte { + file_internal_proto_vector_proto_rawDescOnce.Do(func() { + file_internal_proto_vector_proto_rawDescData = protoimpl.X.CompressGZIP(file_internal_proto_vector_proto_rawDescData) + }) + return file_internal_proto_vector_proto_rawDescData +} + +var file_internal_proto_vector_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_internal_proto_vector_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_internal_proto_vector_proto_goTypes = []interface{}{ + (ServingStatus)(0), // 0: vector.ServingStatus + (*PushEventsRequest)(nil), // 1: vector.PushEventsRequest + (*PushEventsResponse)(nil), // 2: vector.PushEventsResponse + (*HealthCheckRequest)(nil), // 3: vector.HealthCheckRequest + (*HealthCheckResponse)(nil), // 4: vector.HealthCheckResponse + (*EventWrapper)(nil), // 5: vector.EventWrapper +} +var file_internal_proto_vector_proto_depIdxs = []int32{ + 5, // 0: vector.PushEventsRequest.events:type_name -> vector.EventWrapper + 0, // 1: vector.HealthCheckResponse.status:type_name -> vector.ServingStatus + 1, // 2: vector.Vector.PushEvents:input_type -> vector.PushEventsRequest + 3, // 3: vector.Vector.HealthCheck:input_type -> vector.HealthCheckRequest + 2, // 4: vector.Vector.PushEvents:output_type -> vector.PushEventsResponse + 4, // 5: vector.Vector.HealthCheck:output_type -> vector.HealthCheckResponse + 4, // [4:6] is the sub-list for method output_type + 2, // [2:4] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_internal_proto_vector_proto_init() } +func file_internal_proto_vector_proto_init() { + if File_internal_proto_vector_proto != nil { + return + } + file_internal_proto_event_proto_init() + if !protoimpl.UnsafeEnabled { + file_internal_proto_vector_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PushEventsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_vector_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PushEventsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_vector_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HealthCheckRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_proto_vector_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HealthCheckResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_internal_proto_vector_proto_rawDesc, + NumEnums: 1, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_internal_proto_vector_proto_goTypes, + DependencyIndexes: file_internal_proto_vector_proto_depIdxs, + EnumInfos: file_internal_proto_vector_proto_enumTypes, + MessageInfos: file_internal_proto_vector_proto_msgTypes, + }.Build() + File_internal_proto_vector_proto = out.File + file_internal_proto_vector_proto_rawDesc = nil + file_internal_proto_vector_proto_goTypes = nil + file_internal_proto_vector_proto_depIdxs = nil +} diff --git a/apps/tenant-agent/internal/proto-rpc/vector_grpc.pb.go b/apps/tenant-agent/internal/proto-rpc/vector_grpc.pb.go new file mode 100644 index 000000000..7bb3304d1 --- /dev/null +++ b/apps/tenant-agent/internal/proto-rpc/vector_grpc.pb.go @@ -0,0 +1,146 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.23.3 +// source: internal/proto/vector.proto + +package proto_rpc + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Vector_PushEvents_FullMethodName = "/vector.Vector/PushEvents" + Vector_HealthCheck_FullMethodName = "/vector.Vector/HealthCheck" +) + +// VectorClient is the client API for Vector service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type VectorClient interface { + PushEvents(ctx context.Context, in *PushEventsRequest, opts ...grpc.CallOption) (*PushEventsResponse, error) + HealthCheck(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) +} + +type vectorClient struct { + cc grpc.ClientConnInterface +} + +func NewVectorClient(cc grpc.ClientConnInterface) VectorClient { + return &vectorClient{cc} +} + +func (c *vectorClient) PushEvents(ctx context.Context, in *PushEventsRequest, opts ...grpc.CallOption) (*PushEventsResponse, error) { + out := new(PushEventsResponse) + err := c.cc.Invoke(ctx, Vector_PushEvents_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *vectorClient) HealthCheck(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) { + out := new(HealthCheckResponse) + err := c.cc.Invoke(ctx, Vector_HealthCheck_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// VectorServer is the server API for Vector service. +// All implementations must embed UnimplementedVectorServer +// for forward compatibility +type VectorServer interface { + PushEvents(context.Context, *PushEventsRequest) (*PushEventsResponse, error) + HealthCheck(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) + mustEmbedUnimplementedVectorServer() +} + +// UnimplementedVectorServer must be embedded to have forward compatible implementations. +type UnimplementedVectorServer struct { +} + +func (UnimplementedVectorServer) PushEvents(context.Context, *PushEventsRequest) (*PushEventsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PushEvents not implemented") +} +func (UnimplementedVectorServer) HealthCheck(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method HealthCheck not implemented") +} +func (UnimplementedVectorServer) mustEmbedUnimplementedVectorServer() {} + +// UnsafeVectorServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to VectorServer will +// result in compilation errors. +type UnsafeVectorServer interface { + mustEmbedUnimplementedVectorServer() +} + +func RegisterVectorServer(s grpc.ServiceRegistrar, srv VectorServer) { + s.RegisterService(&Vector_ServiceDesc, srv) +} + +func _Vector_PushEvents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PushEventsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VectorServer).PushEvents(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Vector_PushEvents_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VectorServer).PushEvents(ctx, req.(*PushEventsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Vector_HealthCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HealthCheckRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VectorServer).HealthCheck(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Vector_HealthCheck_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VectorServer).HealthCheck(ctx, req.(*HealthCheckRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Vector_ServiceDesc is the grpc.ServiceDesc for Vector service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Vector_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "vector.Vector", + HandlerType: (*VectorServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "PushEvents", + Handler: _Vector_PushEvents_Handler, + }, + { + MethodName: "HealthCheck", + Handler: _Vector_HealthCheck_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "internal/proto/vector.proto", +} diff --git a/apps/tenant-agent/internal/proto/event.proto b/apps/tenant-agent/internal/proto/event.proto new file mode 100644 index 000000000..29e7163bc --- /dev/null +++ b/apps/tenant-agent/internal/proto/event.proto @@ -0,0 +1,215 @@ +syntax = "proto3"; +option go_package = "internal/proto-rpc"; + +import "google/protobuf/timestamp.proto"; + +package vector; + +message EventArray { + oneof events { + LogArray logs = 1; + MetricArray metrics = 2; + TraceArray traces = 3; + } +} + +message LogArray { + repeated Log logs = 1; +} + +message MetricArray { + repeated Metric metrics = 1; +} + +message TraceArray { + repeated Trace traces = 1; +} + +message EventWrapper { + oneof event { + Log log = 1; + Metric metric = 2; + Trace trace = 3; + } +} + +message Log { + // Deprecated, use value instead + map fields = 1; + Value value = 2; + Value metadata = 3; +} + +message Trace { + map fields = 1; + Value metadata = 2; +} + +message ValueMap { + map fields = 1; +} + +message ValueArray { + repeated Value items = 1; +} + +enum ValueNull { + NULL_VALUE = 0; +} + +message Value { + reserved 3; + oneof kind { + bytes raw_bytes = 1; + google.protobuf.Timestamp timestamp = 2; + int64 integer = 4; + double float = 5; + bool boolean = 6; + ValueMap map = 7; + ValueArray array = 8; + ValueNull null = 9; + } +} + +message Metric { + string name = 1; + google.protobuf.Timestamp timestamp = 2; + map tags_v1 = 3; + map tags_v2 = 20; + enum Kind { + Incremental = 0; + Absolute = 1; + } + Kind kind = 4; + oneof value { + Counter counter = 5; + Gauge gauge = 6; + Set set = 7; + Distribution1 distribution1 = 8; + AggregatedHistogram1 aggregated_histogram1 = 9; + AggregatedSummary1 aggregated_summary1 = 10; + Distribution2 distribution2 = 12; + AggregatedHistogram2 aggregated_histogram2 = 13; + AggregatedSummary2 aggregated_summary2 = 14; + Sketch sketch = 15; + AggregatedHistogram3 aggregated_histogram3 = 16; + AggregatedSummary3 aggregated_summary3 = 17; + } + string namespace = 11; + uint32 interval_ms = 18; + Value metadata = 19; +} + +message TagValues { + repeated TagValue values = 1; +} + +message TagValue { + optional string value = 1; +} + +message Counter { + double value = 1; +} + +message Gauge { + double value = 1; +} + +message Set { + repeated string values = 1; +} + +enum StatisticKind { + Histogram = 0; + Summary = 1; +} + +message Distribution1 { + repeated double values = 1; + repeated uint32 sample_rates = 2; + StatisticKind statistic = 3; +} + +message Distribution2 { + repeated DistributionSample samples = 1; + StatisticKind statistic = 2; +} + +message DistributionSample { + double value = 1; + uint32 rate = 2; +} + +message AggregatedHistogram1 { + repeated double buckets = 1; + repeated uint32 counts = 2; + uint32 count = 3; + double sum = 4; +} + +message AggregatedHistogram2 { + repeated HistogramBucket buckets = 1; + uint32 count = 2; + double sum = 3; +} + +message AggregatedHistogram3 { + repeated HistogramBucket3 buckets = 1; + uint64 count = 2; + double sum = 3; +} + +message HistogramBucket { + double upper_limit = 1; + uint32 count = 2; +} + +message HistogramBucket3 { + double upper_limit = 1; + uint64 count = 2; +} + +message AggregatedSummary1 { + repeated double quantiles = 1; + repeated double values = 2; + uint32 count = 3; + double sum = 4; +} + +message AggregatedSummary2 { + repeated SummaryQuantile quantiles = 1; + uint32 count = 2; + double sum = 3; +} + +message AggregatedSummary3 { + repeated SummaryQuantile quantiles = 1; + uint64 count = 2; + double sum = 3; +} + +message SummaryQuantile { + double quantile = 1; + double value = 2; +} + +message Sketch { + message AgentDDSketch { + // Summary statistics for the samples in this sketch. + uint32 count = 1; + double min = 2; + double max = 3; + double sum = 4; + double avg = 5; + // The bins (buckets) of this sketch, where `k` and `n` are unzipped pairs. + // `k` is the list of bin indexes that are populated, and `n` is the count of samples + // within the given bin. + repeated sint32 k = 6; + repeated uint32 n = 7; + } + + oneof sketch { + AgentDDSketch agent_dd_sketch = 1; + } +} diff --git a/apps/tenant-agent/internal/proto/vector.proto b/apps/tenant-agent/internal/proto/vector.proto new file mode 100644 index 000000000..6fd5928ef --- /dev/null +++ b/apps/tenant-agent/internal/proto/vector.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +option go_package = "internal/proto-rpc"; + +import "internal/proto/event.proto"; + +package vector; + +message PushEventsRequest { + repeated EventWrapper events = 1; +} + +message PushEventsResponse {} + +enum ServingStatus { + SERVING = 0; + NOT_SERVING = 1; +} + +message HealthCheckRequest {} + +message HealthCheckResponse { + ServingStatus status = 1; +} + +service Vector { + rpc PushEvents(PushEventsRequest) returns (PushEventsResponse) {} + + rpc HealthCheck(HealthCheckRequest) returns (HealthCheckResponse); +} diff --git a/apps/tenant-agent/main.go b/apps/tenant-agent/main.go new file mode 100644 index 000000000..810a8f226 --- /dev/null +++ b/apps/tenant-agent/main.go @@ -0,0 +1,352 @@ +package main + +import ( + "context" + "encoding/json" + "flag" + "log" + "os" + "strings" + "time" + + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/constants" + "github.com/kloudlite/api/pkg/errors" + + "google.golang.org/grpc" + "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/metadata" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/client-go/rest" + "sigs.k8s.io/yaml" + + "github.com/kloudlite/api/apps/tenant-agent/internal/env" + proto_rpc "github.com/kloudlite/api/apps/tenant-agent/internal/proto-rpc" + t "github.com/kloudlite/api/apps/tenant-agent/types" + "github.com/kloudlite/operator/grpc-interfaces/grpc/messages" + libGrpc "github.com/kloudlite/operator/pkg/grpc" + "github.com/kloudlite/operator/pkg/kubectl" + + "github.com/kloudlite/operator/pkg/logging" + apiErrors "k8s.io/apimachinery/pkg/api/errors" +) + +type grpcHandler struct { + inMemCounter int64 + yamlClient kubectl.YAMLClient + logger logging.Logger + ev *env.Env + msgDispatchCli messages.MessageDispatchServiceClient + isDev bool +} + +func (g *grpcHandler) handleErrorOnApply(ctx context.Context, err error, msg t.AgentMessage) error { + g.logger.Debugf("[ERROR]: %s", err.Error()) + + b, err := json.Marshal(t.AgentErrMessage{ + AccountName: msg.AccountName, + ClusterName: msg.ClusterName, + Error: err.Error(), + Action: msg.Action, + Object: msg.Object, + }) + if err != nil { + return errors.NewE(err) + } + + _, err = g.msgDispatchCli.ReceiveError(ctx, &messages.ErrorData{ + AccountName: msg.AccountName, + ClusterName: msg.ClusterName, + AccessToken: g.ev.AccessToken, + Message: b, + }) + return err +} + +func (g *grpcHandler) handleMessage(msg t.AgentMessage) error { + g.inMemCounter++ + ctx, cf := func() (context.Context, context.CancelFunc) { + if g.isDev { + return context.WithCancel(context.TODO()) + } + return context.WithTimeout(context.TODO(), 3*time.Second) + }() + defer cf() + + if msg.Object == nil { + g.logger.Infof("msg.Object is nil, could not process anything out of this kafka message, ignoring ...") + return nil + } + + obj := unstructured.Unstructured{Object: msg.Object} + mLogger := g.logger.WithKV("gvk", obj.GetObjectKind().GroupVersionKind().String()).WithKV("clusterName", msg.ClusterName).WithKV("accountName", msg.AccountName).WithKV("action", msg.Action) + + mLogger.Infof("[%d] received message", g.inMemCounter) + + if len(strings.TrimSpace(msg.AccountName)) == 0 { + return g.handleErrorOnApply(ctx, errors.Newf("field 'accountName' must be defined in message"), msg) + } + + switch msg.Action { + case t.ActionApply: + { + ann := obj.GetAnnotations() + if ann == nil { + ann = make(map[string]string, 2) + } + + ann[constants.ObservabilityAccountNameKey] = g.ev.AccountName + ann[constants.ObservabilityClusterNameKey] = g.ev.ClusterName + obj.SetAnnotations(ann) + + b, err := yaml.Marshal(msg.Object) + if err != nil { + return g.handleErrorOnApply(ctx, err, msg) + } + + if _, err := g.yamlClient.ApplyYAML(ctx, b); err != nil { + mLogger.Infof("[%d] [error-on-apply]: %s", g.inMemCounter, err.Error()) + mLogger.Infof("[%d] failed to process message", g.inMemCounter) + return g.handleErrorOnApply(ctx, err, msg) + } + mLogger.Infof("[%d] processed message", g.inMemCounter) + } + case t.ActionDelete: + { + if err := g.yamlClient.DeleteResource(ctx, &obj); err != nil { + mLogger.Infof("[%d] [error-on-delete]: %v", g.inMemCounter, err) + if apiErrors.IsNotFound(err) { + mLogger.Infof("[%d] processed message, resource does not exist, might already be deleted", g.inMemCounter) + return g.handleErrorOnApply(ctx, err, msg) + } + mLogger.Infof("[%d] failed to process message", g.inMemCounter) + } + mLogger.Infof("[%d] processed message", g.inMemCounter) + } + case t.ActionRestart: + { + if err := g.yamlClient.RolloutRestart(ctx, kubectl.Deployment, obj.GetNamespace(), obj.GetLabels()); err != nil { + return err + } + mLogger.Infof("[%d] rolled out deployments", g.inMemCounter) + + if err := g.yamlClient.RolloutRestart(ctx, kubectl.StatefulSet, obj.GetNamespace(), obj.GetLabels()); err != nil { + return err + } + + mLogger.Infof("[%d] rolled out statefulsets", g.inMemCounter) + mLogger.Infof("[%d] processed message", g.inMemCounter) + } + default: + { + err := errors.Newf("invalid action (%s)", msg.Action) + mLogger.Infof("[%d] [error]: %s", err.Error()) + mLogger.Infof("[%d] failed to process message", g.inMemCounter) + return g.handleErrorOnApply(ctx, err, msg) + } + } + + return nil +} + +func (g *grpcHandler) ensureAccessToken() error { + ctx, cf := context.WithTimeout(context.TODO(), 50*time.Second) + defer cf() + if g.ev.AccessToken == "" { + g.logger.Infof("waiting on clusterToken exchange for accessToken") + } + + validationOut, err := g.msgDispatchCli.ValidateAccessToken(ctx, &messages.ValidateAccessTokenIn{ + AccountName: g.ev.AccountName, + ClusterName: g.ev.ClusterName, + AccessToken: g.ev.AccessToken, + }) + + if err != nil || validationOut == nil || !validationOut.Valid { + g.logger.Infof("accessToken is invalid, requesting new accessToken ...") + } + + if validationOut != nil && validationOut.Valid { + g.logger.Infof("accessToken is valid, proceeding with it ...") + return nil + } + + out, err := g.msgDispatchCli.GetAccessToken(ctx, &messages.GetClusterTokenIn{ + AccountName: g.ev.AccountName, + ClusterName: g.ev.ClusterName, + ClusterToken: g.ev.ClusterToken, + }) + if err != nil { + return errors.NewE(err) + } + + g.logger.Infof("valid access token has been obtained, persisting it in k8s secret (%s/%s)...", g.ev.AccessTokenSecretNamespace, g.ev.AccessTokenSecretName) + + s, err := g.yamlClient.Client().CoreV1().Secrets(g.ev.AccessTokenSecretNamespace).Get(context.TODO(), g.ev.AccessTokenSecretName, metav1.GetOptions{}) + if err != nil { + return errors.NewE(err) + } + + if s.Data == nil { + s.Data = make(map[string][]byte, 1) + } + s.Data["ACCESS_TOKEN"] = []byte(out.AccessToken) + _, err = g.yamlClient.Client().CoreV1().Secrets(g.ev.AccessTokenSecretNamespace).Update(context.TODO(), s, metav1.UpdateOptions{}) + if err != nil { + return errors.NewE(err) + } + + g.ev.AccessToken = out.AccessToken + + if g.ev.ResourceWatcherNamespace != "" { + // need to restart resource watcher + d, err := g.yamlClient.Client().AppsV1().Deployments(g.ev.ResourceWatcherNamespace).Get(ctx, g.ev.ResourceWatcherName, metav1.GetOptions{}) + if err != nil { + return errors.NewE(err) + } + podLabelSelector := metav1.LabelSelector{} + for k, v := range d.Spec.Selector.MatchLabels { + metav1.AddLabelToSelector(&podLabelSelector, k, v) + } + + if err := g.yamlClient.Client().CoreV1().Pods(g.ev.ResourceWatcherNamespace).DeleteCollection(ctx, metav1.DeleteOptions{}, metav1.ListOptions{LabelSelector: metav1.FormatLabelSelector(&podLabelSelector)}); err != nil { + g.logger.Errorf(err, "failed to delete pods for resource watcher") + } + g.logger.Infof("deleted all pods for resource watcher, they will be recreated") + } + + return nil +} + +func (g *grpcHandler) run() error { + ctx, cf := context.WithCancel(context.TODO()) + defer cf() + + outgoingCtx := metadata.NewOutgoingContext(ctx, metadata.Pairs("authorization", g.ev.AccessToken)) + + g.logger.Infof("asking message office to start sending actions") + msgActionsCli, err := g.msgDispatchCli.SendActions(outgoingCtx, &messages.Empty{}) + if err != nil { + return errors.NewE(err) + } + + for { + if err := ctx.Err(); err != nil { + g.logger.Infof("connection context cancelled, will retry now...") + return errors.NewE(err) + } + + var msg t.AgentMessage + a, err := msgActionsCli.Recv() + if err != nil { + g.logger.Errorf(err, "[ERROR] while receiving message") + return errors.NewE(err) + } + + if err := json.Unmarshal(a.Message, &msg); err != nil { + g.logger.Errorf(err, "[ERROR] while json unmarshal") + return errors.NewE(err) + } + + if err := g.handleMessage(msg); err != nil { + g.logger.Errorf(err, "[ERROR] while handling message") + return errors.NewE(err) + } + } +} + +func main() { + var isDev bool + flag.BoolVar(&isDev, "dev", false, "--dev") + flag.Parse() + + ev := env.GetEnvOrDie() + + logger := logging.NewOrDie(&logging.Options{Name: "kloudlite-agent", Dev: isDev}) + + logger.Infof("waiting for GRPC connection to happen") + + yamlClient := func() kubectl.YAMLClient { + if isDev { + logger.Debugf("connecting to k8s over host addr (%s)", "localhost:8081") + return kubectl.NewYAMLClientOrDie(&rest.Config{Host: "localhost:8081"}, kubectl.YAMLClientOpts{Logger: logger}) + } + config, err := rest.InClusterConfig() + if err != nil { + panic(err) + } + return kubectl.NewYAMLClientOrDie(config, kubectl.YAMLClientOpts{Logger: logger}) + }() + + g := grpcHandler{ + inMemCounter: 0, + yamlClient: yamlClient, + logger: logger, + ev: ev, + isDev: isDev, + } + + vps := &vectorGrpcProxyServer{ + realVectorClient: nil, + logger: logger, + accessToken: ev.AccessToken, + accountName: ev.AccountName, + clusterName: ev.ClusterName, + } + + gs := libGrpc.NewGrpcServer(libGrpc.GrpcServerOpts{Logger: logger}) + proto_rpc.RegisterVectorServer(gs.GrpcServer, vps) + + go func() { + err := gs.Listen(ev.VectorProxyGrpcServerAddr) + if err != nil { + logger.Error(err) + os.Exit(1) + } + }() + + common.PrintReadyBanner() + + for { + logger.Infof("trying to connect to message office grpc (%s)", ev.GrpcAddr) + cc, err := func() (*grpc.ClientConn, error) { + // if isDev { + // logger.Infof("attempting grpc connect over %s", ev.GrpcAddr) + // return libGrpc.Connect(ev.GrpcAddr, libGrpc.ConnectOpts{ + // SecureConnect: false, + // Timeout: 20 * time.Second, + // }) + // } + logger.Infof("attempting grpc connect over %s", ev.GrpcAddr) + return libGrpc.ConnectSecure(ev.GrpcAddr) + }() + if err != nil { + log.Fatalf("Failed to connect after retries: %v", err) + } + + logger.Infof("GRPC connection to message-office (%s) successful", ev.GrpcAddr) + + g.msgDispatchCli = messages.NewMessageDispatchServiceClient(cc) + + if err := g.ensureAccessToken(); err != nil { + logger.Errorf(err, "ensuring access token") + } + + vps.accessToken = g.ev.AccessToken + vps.realVectorClient = proto_rpc.NewVectorClient(cc) + + if err := g.run(); err != nil { + logger.Errorf(err, "running grpc sendActions") + } + + connState := cc.GetState() + for connState != connectivity.Ready && connState != connectivity.Shutdown { + log.Printf("Connection lost, trying to reconnect...") + break + } + if err = cc.Close(); err != nil { + log.Fatalf("Failed to close connection: %v", err) + } + } +} diff --git a/apps/tenant-agent/types/types.go b/apps/tenant-agent/types/types.go new file mode 100644 index 000000000..5415b8810 --- /dev/null +++ b/apps/tenant-agent/types/types.go @@ -0,0 +1,28 @@ +package types + +type Action string + +const ( + ActionApply Action = "apply" + ActionDelete Action = "delete" + ActionRestart Action = "restart" +) + +type AgentMessage struct { + AccountName string `json:"accountName"` + ClusterName string `json:"clusterName"` + + Action Action `json:"action"` + // Yamls []byte `json:"yamls,omitempty"` + Object map[string]any `json:"object"` +} + +type AgentErrMessage struct { + AccountName string `json:"accountName"` + ClusterName string `json:"clusterName"` + + Error string `json:"error"` + Action Action `json:"action"` + Object map[string]any `json:"object"` + // Yamls []byte `json:"yamls"` +} diff --git a/apps/tenant-agent/vector-grpc-proxy-server.go b/apps/tenant-agent/vector-grpc-proxy-server.go new file mode 100644 index 000000000..5f48b8484 --- /dev/null +++ b/apps/tenant-agent/vector-grpc-proxy-server.go @@ -0,0 +1,60 @@ +package main + +import ( + "context" + proto_rpc "github.com/kloudlite/api/apps/tenant-agent/internal/proto-rpc" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/operator/pkg/logging" + "google.golang.org/grpc/metadata" +) + +type vectorGrpcProxyServer struct { + proto_rpc.UnimplementedVectorServer + realVectorClient proto_rpc.VectorClient + logger logging.Logger + + accessToken string + accountName string + clusterName string + + pushEventsCounter int + healthCheckCounter int +} + +func (v *vectorGrpcProxyServer) PushEvents(ctx context.Context, msg *proto_rpc.PushEventsRequest) (*proto_rpc.PushEventsResponse, error) { + if v.realVectorClient == nil { + return nil, errors.Newf("vector client is not yet connected to message-office") + } + + outgoingCtx := metadata.NewOutgoingContext(ctx, metadata.Pairs("authorization", v.accessToken)) + + v.pushEventsCounter++ + v.logger.Infof("[%v] received push-events message", v.pushEventsCounter) + defer v.logger.Infof("[%v] dispatched push-events message", v.pushEventsCounter) + + per, err := v.realVectorClient.PushEvents(outgoingCtx, msg) + if err != nil { + v.logger.Error(err) + return nil, errors.NewE(err) + } + return per, nil + +} + +func (v *vectorGrpcProxyServer) HealthCheck(ctx context.Context, msg *proto_rpc.HealthCheckRequest) (*proto_rpc.HealthCheckResponse, error) { + if v.realVectorClient == nil { + return nil, errors.Newf("vector client is not yet connected to message-office") + } + + outgoingCtx := metadata.NewOutgoingContext(ctx, metadata.Pairs("authorization", v.accessToken)) + + v.healthCheckCounter++ + v.logger.Infof("[%v] received health-check message", v.healthCheckCounter) + defer v.logger.Infof("[%v] dispatched health-check message", v.healthCheckCounter) + hcr, err := v.realVectorClient.HealthCheck(outgoingCtx, msg) + if err != nil { + v.logger.Error(err) + return nil, errors.NewE(err) + } + return hcr, nil +} diff --git a/apps/ci/.dockerignore b/apps/webhook/.dockerignore similarity index 100% rename from apps/ci/.dockerignore rename to apps/webhook/.dockerignore diff --git a/apps/finance/Dockerfile b/apps/webhook/Dockerfile similarity index 85% rename from apps/finance/Dockerfile rename to apps/webhook/Dockerfile index c85dfa2ef..8d38cb2a4 100644 --- a/apps/finance/Dockerfile +++ b/apps/webhook/Dockerfile @@ -17,7 +17,6 @@ RUN CGO_ENABLED=0 go build -tags musl -o /tmp/bin/$APP ./main.go RUN chmod +x /tmp/bin/$APP FROM gcr.io/distroless/static-debian11 -USER 1001 -WORKDIR /tmp/app -COPY --from=base --chown=1001 /tmp/bin/finance ./finance -CMD ["./finance"] +ARG APP +COPY --from=base --chown=1001 /tmp/bin/$APP /webhook +CMD ["/webhook"] diff --git a/apps/webhooks/Taskfile.yml b/apps/webhook/Taskfile.yml similarity index 70% rename from apps/webhooks/Taskfile.yml rename to apps/webhook/Taskfile.yml index b88033e92..708068697 100644 --- a/apps/webhooks/Taskfile.yml +++ b/apps/webhook/Taskfile.yml @@ -1,10 +1,34 @@ -version: 3 +version: "3" + +dotenv: + - .secrets/env + +vars: + ImagePrefix: "ghcr.io/kloudlite/platform/apis" tasks: + gql: + dir: ./internal/app + cmds: + - go run -tags dynamic github.com/99designs/gqlgen generate + # - rm "./graph/scalars.resolvers.go" + + build: + env: + CGO_ENABLED: 0 + GOOS: linux + GOARCH: amd64 + preconditions: + - sh: '[ -n "{{.Out}}" ]' + msg: var Out must have a value + cmds: + - go build -ldflags="-s -w" -o {{.Out}} + - upx {{.Out}} + docker-build: vars: - APP: webhooks - IMAGE: registry.kloudlite.io/kloudlite/{{.EnvName}}/{{.APP}}:{{.Tag}} + APP: webhook + IMAGE: registry.kloudlite.io/kloudlite/{{.EnvName}}/{{.APP}}-api:{{.Tag}} preconditions: - sh: '[[ -n "{{.Tag}}" ]]' msg: 'var Tag must have a value' @@ -15,29 +39,14 @@ tasks: - docker buildx build -f ./Dockerfile -t {{.IMAGE}} . --build-arg APP={{.APP}} --platform linux/amd64 --build-context project-root=../.. - docker push {{.IMAGE}} - build: - env: - CGO_ENABLED: 0 - preconditions: - - sh: '[ -n "{{.Out}}" ]' - msg: var Out must have a value - cmds: - - go build -ldflags="-s -w" -o {{.Out}} - - upx {{.Out}} local-build: preconditions: - - sh: '[ -n "{{.EnvName}}" ]' - msg: 'var EnvName must have a value' - sh: '[ -n "{{.Tag}}" ]' msg: 'var Tag must have a value' vars: - APP: webhooks - IMAGE: registry.kloudlite.io/kloudlite/{{.EnvName}}/{{.APP}}-api:{{.Tag}} - env: - CGO_ENABLED: 0 - GOOS: linux - GOARCH: amd64 + APP: webhook + IMAGE: "{{.ImagePrefix}}/{{.APP}}:{{.Tag}}" silent: true cmds: - |+ @@ -48,25 +57,27 @@ tasks: tDir=$(mktemp -d) - nDockerfile=$(cat Dockerfile | tail --lines=+$startLineNo) + nDockerfile=$(cat Dockerfile | tail --lines=+$startLineNo | grep -i --invert-match 'from=base') echo "$nDockerfile" | sed "1 i # syntax=docker/dockerfile:1.4" > $tDir/Dockerfile.base - # cat $tDir/Dockerfile.base - - builderLine=$(cat $tDir/Dockerfile.base | grep -i -n 'from=base' | awk -F: '{print $1}') - echo $builderLine - - cat $tDir/Dockerfile.base | sed "${builderLine}s|.*|COPY --from=local-builder ./{{.APP}} ./{{.APP}}|" > $tDir/Dockerfile + cat $tDir/Dockerfile.base | sed "4 i COPY --from=local-builder ./{{.APP}} /{{.APP}}" > $tDir/Dockerfile cat $tDir/Dockerfile - echo "building application ..." + task build Out=$tDir/{{.APP}} docker buildx build -f $tDir/Dockerfile -t {{.IMAGE}} . --build-context local-builder=${tDir} docker push {{.IMAGE}} rm -rf $tDir - dev:live: - dir: .kl + run: + vars: + Name: webhook + dotenv: + - .secrets/env + env: + CGO_ENABLED: 0 cmds: - - kubectl apply -f . + - go build -o /tmp/{{.Name}} ./main.go + # - dlv exec -l 127.0.0.1:31117 --headless /tmp/webhook -- --dev + - /tmp/{{.Name}} --dev diff --git a/apps/webhook/internal/app/app.go b/apps/webhook/internal/app/app.go new file mode 100644 index 000000000..9e74243b0 --- /dev/null +++ b/apps/webhook/internal/app/app.go @@ -0,0 +1,17 @@ +package app + +import ( + "github.com/kloudlite/api/pkg/messaging" + msgnats "github.com/kloudlite/api/pkg/messaging/nats" + "github.com/kloudlite/api/pkg/nats" + "go.uber.org/fx" +) + +var Module = fx.Module( + "app", + fx.Provide(func(client *nats.JetstreamClient) messaging.Producer { + return msgnats.NewJetstreamProducer(client) + }), + + LoadGitWebhook(), +) diff --git a/apps/webhooks/internal/app/git-webhook.go b/apps/webhook/internal/app/git-webhook.go similarity index 74% rename from apps/webhooks/internal/app/git-webhook.go rename to apps/webhook/internal/app/git-webhook.go index 08fc1e975..d4d8c9fac 100644 --- a/apps/webhooks/internal/app/git-webhook.go +++ b/apps/webhook/internal/app/git-webhook.go @@ -6,23 +6,28 @@ import ( "encoding/hex" "encoding/json" "fmt" - "kloudlite.io/constants" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/constants" + httpServer "github.com/kloudlite/api/pkg/http-server" + "github.com/kloudlite/api/pkg/messaging" + types2 "github.com/kloudlite/api/pkg/messaging/types" "net/http" + "time" "github.com/gofiber/fiber/v2" + "github.com/kloudlite/api/apps/webhook/internal/env" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/logging" + + "github.com/kloudlite/api/pkg/types" "github.com/xanzy/go-gitlab" "go.uber.org/fx" - "kloudlite.io/apps/webhooks/internal/env" - "kloudlite.io/pkg/errors" - "kloudlite.io/pkg/logging" - "kloudlite.io/pkg/redpanda" - "kloudlite.io/pkg/types" ) func validateGithubHook(ctx *fiber.Ctx, envVars *env.Env) (bool, error) { headers := ctx.GetReqHeaders() if v, ok := headers["X-Kloudlite-Trigger"]; ok { - if len(v) != len(envVars.KlHookTriggerAuthzSecret) || v != envVars.KlHookTriggerAuthzSecret { + if len(v) != len(envVars.KlHookTriggerAuthzSecret) || v[0] != envVars.KlHookTriggerAuthzSecret { return false, errors.Newf("signature (%s) is invalid, sorry would need to drop the message", v) } return true, nil @@ -33,7 +38,7 @@ func validateGithubHook(ctx *fiber.Ctx, envVars *env.Env) (bool, error) { cHash := "sha256=" + hex.EncodeToString(hash.Sum(nil)) ghSignature := headers["X-Hub-Signature-256"] - if len(cHash) != len(ghSignature) || cHash != ghSignature { + if len(cHash) != len(ghSignature[0]) || cHash != ghSignature[0] { return false, errors.Newf("signature (%s) is invalid, sorry would need to drop the message", ghSignature) } return true, nil @@ -42,14 +47,14 @@ func validateGithubHook(ctx *fiber.Ctx, envVars *env.Env) (bool, error) { func validateGitlabHook(ctx *fiber.Ctx, envVars *env.Env) (bool, error) { headers := ctx.GetReqHeaders() if v, ok := headers["X-Kloudlite-Trigger"]; ok { - if len(v) != len(envVars.KlHookTriggerAuthzSecret) || v != envVars.KlHookTriggerAuthzSecret { + if len(v) != len(envVars.KlHookTriggerAuthzSecret) || v[0] != envVars.KlHookTriggerAuthzSecret { return false, errors.Newf("signature (%s) is invalid, sorry would need to drop the message", v) } return true, nil } gToken := headers["X-Gitlab-Token"] - if len(envVars.GitlabAuthzSecret) != len(gToken) || envVars.GitlabAuthzSecret != gToken { + if len(envVars.GitlabAuthzSecret) != len(gToken) || envVars.GitlabAuthzSecret != gToken[0] { return false, errors.Newf("signature (%s) is invalid, sorry would need to drop the message", gToken) } return true, nil @@ -75,7 +80,7 @@ func gitRepoUrl(provider string, hookBody []byte) (string, error) { // Repo *github.Repository `json:"repository,omitempty"` } if err := json.Unmarshal(hookBody, &evt); err != nil { - return "", err + return "", errors.NewE(err) } return evt.Repo.HtmlUrl, nil } @@ -86,7 +91,7 @@ func gitRepoUrl(provider string, hookBody []byte) (string, error) { Repo gitlab.Repository `json:"repository"` } if err := json.Unmarshal(hookBody, &ev); err != nil { - return "", err + return "", errors.NewE(err) } return ev.Repo.GitHTTPURL, nil @@ -97,7 +102,8 @@ func gitRepoUrl(provider string, hookBody []byte) (string, error) { func LoadGitWebhook() fx.Option { return fx.Invoke( - func(app *fiber.App, envVars *env.Env, producer redpanda.Producer, logr logging.Logger) error { + func(server httpServer.Server, envVars *env.Env, producer messaging.Producer, logr logging.Logger) error { + app := server.Raw() app.Post( "/git/:provider", func(ctx *fiber.Ctx) error { logger := logr.WithName("git-webhook") @@ -123,7 +129,7 @@ func LoadGitWebhook() fx.Option { repoUrl, err := gitRepoUrl(gitProvider, ctx.Body()) if err != nil { - return err + return errors.NewE(err) } logger = logger.WithKV("provider", gitProvider, "repo", repoUrl, "user-agent", ctx.GetReqHeaders()["User-Agent"]) logger.Infof("received webhook") @@ -139,10 +145,17 @@ func LoadGitWebhook() fx.Option { } b, err := json.Marshal(gitHook) if err != nil { - return err + return errors.NewE(err) + } + + err = producer.Produce(ctx.Context(), types2.ProduceMsg{ + Subject: string(common.GitWebhookTopicName), + Payload: b, + }) + if err != nil { + return errors.NewE(err) } - msg, err := producer.Produce(ctx.Context(), envVars.GitWebhooksTopic, repoUrl, b) if err != nil { errMsg := fmt.Sprintf("could not produce message to topic %s", gitProvider) logger.Errorf(err, errMsg) @@ -150,11 +163,10 @@ func LoadGitWebhook() fx.Option { } logger.WithKV( - "produced.offset", msg.Offset, - "produced.topic", msg.Topic, - "produced.timestamp", msg.Timestamp, + "produced.subject", string(common.GitWebhookTopicName), + "produced.timestamp", time.Now(), ).Infof("queued webhook") - return ctx.Status(http.StatusAccepted).JSON(msg) + return ctx.Status(http.StatusAccepted).JSON(map[string]string{"status": "ok"}) }, ) return nil diff --git a/apps/webhook/internal/env/env.go b/apps/webhook/internal/env/env.go new file mode 100644 index 000000000..190c34bf0 --- /dev/null +++ b/apps/webhook/internal/env/env.go @@ -0,0 +1,12 @@ +package env + +type Env struct { + HttpPort uint16 `env:"HTTP_PORT" required:"true"` + + KlHookTriggerAuthzSecret string `env:"KL_HOOK_TRIGGER_AUTHZ_SECRET" required:"true"` + + GitWebhooksTopic string `env:"GIT_WEBHOOKS_TOPIC" required:"false"` + GithubAuthzSecret string `env:"GITHUB_AUTHZ_SECRET" required:"false"` + GitlabAuthzSecret string `env:"GITLAB_AUTHZ_SECRET" required:"false"` + NatsURL string `env:"NATS_URL" required:"false"` +} diff --git a/apps/webhook/internal/framework/main.go b/apps/webhook/internal/framework/main.go new file mode 100644 index 000000000..c5f327261 --- /dev/null +++ b/apps/webhook/internal/framework/main.go @@ -0,0 +1,63 @@ +package framework + +import ( + "context" + "fmt" + "github.com/kloudlite/api/apps/webhook/internal/app" + "github.com/kloudlite/api/apps/webhook/internal/env" + "github.com/kloudlite/api/pkg/errors" + httpServer "github.com/kloudlite/api/pkg/http-server" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/api/pkg/nats" + "go.uber.org/fx" +) + +type fm struct { + *env.Env +} + +func (f fm) GetHttpPort() uint16 { + return f.HttpPort +} + +func (f fm) GetHttpCors() string { + return "" +} + +var Module = fx.Module( + "framework", + fx.Provide( + func(vars *env.Env) *fm { + return &fm{Env: vars} + }, + ), + + fx.Provide(func(ev *env.Env, logger logging.Logger) (*nats.JetstreamClient, error) { + name := "webhook:jetstream-client" + nc, err := nats.NewClient(ev.NatsURL, nats.ClientOpts{ + Name: name, + Logger: logger, + }) + if err != nil { + return nil, errors.NewE(err) + } + + return nats.NewJetstreamClient(nc) + }), + + fx.Provide(func(logger logging.Logger) httpServer.Server { + return httpServer.NewServer(httpServer.ServerArgs{Logger: logger}) + }), + + fx.Invoke(func(lf fx.Lifecycle, server httpServer.Server, ev *env.Env) { + lf.Append(fx.Hook{ + OnStart: func(context.Context) error { + return server.Listen(fmt.Sprintf(":%d", ev.HttpPort)) + }, + OnStop: func(context.Context) error { + return server.Close() + }, + }) + }), + app.Module, +) diff --git a/apps/webhooks/main.go b/apps/webhook/main.go similarity index 60% rename from apps/webhooks/main.go rename to apps/webhook/main.go index 44e78a3db..ffb9378b1 100644 --- a/apps/webhooks/main.go +++ b/apps/webhook/main.go @@ -3,12 +3,12 @@ package main import ( "flag" + "github.com/kloudlite/api/apps/webhook/internal/env" + "github.com/kloudlite/api/apps/webhook/internal/framework" + "github.com/kloudlite/api/pkg/config" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/logging" "go.uber.org/fx" - "kloudlite.io/apps/webhooks/internal/env" - "kloudlite.io/apps/webhooks/internal/framework" - "kloudlite.io/pkg/config" - fn "kloudlite.io/pkg/functions" - "kloudlite.io/pkg/logging" ) func main() { @@ -25,6 +25,5 @@ func main() { fn.FxErrorHandler(), config.EnvFx[env.Env](), framework.Module, - // fx.NopLogger, ).Run() } diff --git a/apps/webhooks/.dockerignore b/apps/webhooks/.dockerignore deleted file mode 100644 index b30fec26f..000000000 --- a/apps/webhooks/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -** -!main.go -!internal diff --git a/apps/webhooks/Dockerfile b/apps/webhooks/Dockerfile deleted file mode 100644 index bcb31c254..000000000 --- a/apps/webhooks/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -# syntax=docker/dockerfile:1.4 -FROM golang:1.18.3-alpine3.16 AS base -USER 1001 -ENV GOPATH=/tmp/go -ENV GOCACHE=/tmp/go-cache -WORKDIR /tmp/app -COPY --chown=1001 --from=project-root ./go.mod ./go.sum ./tools.go ./ -COPY --chown=1001 --from=project-root common ./common -COPY --chown=1001 --from=project-root pkg ./pkg -RUN go mod download -x -ARG APP -RUN mkdir -p ./apps/$APP -WORKDIR /tmp/app/apps/$APP -COPY --chown=1001 ./ ./ -RUN CGO_ENABLED=0 go build -tags musl -o /tmp/bin/$APP ./main.go -RUN chmod +x /tmp/bin/$APP - -# FROM golang:1.18-alpine -FROM gcr.io/distroless/static-debian11 -USER 1001 -WORKDIR /tmp/app -ARG APP -COPY --from=base --chown=1001 /tmp/bin/$APP ./webhooks -CMD ["./webhooks"] diff --git a/apps/webhooks/internal/app/app.go b/apps/webhooks/internal/app/app.go deleted file mode 100644 index 29aa4568e..000000000 --- a/apps/webhooks/internal/app/app.go +++ /dev/null @@ -1,14 +0,0 @@ -package app - -import ( - "go.uber.org/fx" - "kloudlite.io/pkg/redpanda" -) - -var Module = fx.Module( - "app", - redpanda.NewProducerFx[redpanda.Client](), - - PublisherFX(), - LoadHarborWebhook(), -) diff --git a/apps/webhooks/internal/app/harbor-webhook.go b/apps/webhooks/internal/app/harbor-webhook.go deleted file mode 100644 index 906c03976..000000000 --- a/apps/webhooks/internal/app/harbor-webhook.go +++ /dev/null @@ -1,80 +0,0 @@ -package app - -import ( - "encoding/json" - "net/http" - - "github.com/gofiber/fiber/v2" - "go.uber.org/fx" - "kloudlite.io/apps/webhooks/internal/env" - "kloudlite.io/pkg/harbor" - "kloudlite.io/pkg/logging" - "kloudlite.io/pkg/redpanda" - "kloudlite.io/pkg/types" -) - -func getMsgKey(body []byte) string { - var whBody harbor.WebhookBody - if err := json.Unmarshal(body, &whBody); err != nil { - return "" - } - return whBody.EventData.Repository.RepoFullName -} - -func LoadHarborWebhook() fx.Option { - return fx.Invoke( - func(app *fiber.App, envVars *env.Env, producer redpanda.Producer, logr logging.Logger, p *publisher) error { - app.Post( - "/harbor", func(ctx *fiber.Ctx) error { - logger := logr.WithName("harbor-webhook") - - logger.Infof("received webhook") - - headers := ctx.GetReqHeaders() - if authz, ok := headers["Authorization"]; !ok || authz != envVars.HarborAuthzSecret { - logger.Infof("bad authorization code, dropping request...") - return ctx.Status(http.StatusUnauthorized).JSON("bad authorization token") - } - - httpHook := types.HttpHook{ - Body: ctx.Body(), - Headers: headers, - Url: ctx.Request().URI().String(), - QueryParams: ctx.Request().URI().QueryString(), - } - - b, err := json.Marshal(httpHook) - if err != nil { - return ctx.Status(http.StatusBadRequest).JSON(err.Error()) - } - - p.publishMessage(PublishMessage{ - Message: b, - Topic: envVars.HarborWebhookTopic, - Key: getMsgKey(httpHook.Body), - }) - - return ctx.SendStatus(http.StatusAccepted) - - // // tctx, cancelFunc := context.WithTimeout(ctx.Context(), 5*time.Second) - // tctx, cancelFunc := context.WithTimeout(context.TODO(), 5*time.Second) - // defer cancelFunc() - // msg, err := producer.Produce(tctx, envVars.HarborWebhookTopic, getMsgKey(httpHook.Body), b) - // if err != nil { - // wErr := errors.NewEf(err, "could not produce message to topic %s", envVars.HarborWebhookTopic) - // logger.Infof(wErr.Error()) - // return ctx.Status(http.StatusInternalServerError).JSON(wErr.Error()) - // } - // logger = logger.WithKV( - // "produced.offset", msg.Offset, - // "produced.topic", msg.Topic, - // "produced.timestamp", msg.Timestamp, - // ) - // logger.Infof("queued webhook") - // return ctx.Status(http.StatusAccepted).JSON(msg) - }, - ) - return nil - }, - ) -} diff --git a/apps/webhooks/internal/app/publish-message.go b/apps/webhooks/internal/app/publish-message.go deleted file mode 100644 index b7f33b68a..000000000 --- a/apps/webhooks/internal/app/publish-message.go +++ /dev/null @@ -1,75 +0,0 @@ -package app - -import ( - "context" - "time" - - "go.uber.org/fx" - "kloudlite.io/pkg/errors" - "kloudlite.io/pkg/logging" - "kloudlite.io/pkg/redpanda" -) - -type PublishMessage struct { - Message []byte - Topic string - Key string -} - -type publisher struct { - logger logging.Logger - msgChan chan PublishMessage - producer redpanda.Producer -} - -func (p *publisher) publishMessage(pm PublishMessage) { - p.msgChan <- pm -} - -func (p *publisher) startPublishing() { - for { - pm, ok := <-p.msgChan - if !ok { - panic("message channel is closed") - } - ctx, _ := context.WithTimeout(context.TODO(), 5*time.Second) - out, err := p.producer.Produce(ctx, pm.Topic, pm.Key, pm.Message) - if err != nil { - wErr := errors.NewEf(err, "could not produce message to topic %s", pm.Topic) - p.logger.Infof(wErr.Error()) - continue - } - p.logger.WithKV( - "produced.offset", out.Offset, - "produced.topic", out.Topic, - "produced.timestamp", out.Timestamp, - ).Infof("queued webhook") - } -} - -func PublisherFX() fx.Option { - return fx.Module( - "publisher", - - fx.Provide(func(logger logging.Logger, producer redpanda.Producer) *publisher { - return &publisher{ - logger: logger, - msgChan: make(chan PublishMessage), - producer: producer, - } - }), - - fx.Invoke(func(lf fx.Lifecycle, p *publisher) { - lf.Append(fx.Hook{ - OnStart: func(context.Context) error { - go p.startPublishing() - return nil - }, - OnStop: func(context.Context) error { - close(p.msgChan) - return nil - }, - }) - }), - ) -} diff --git a/apps/webhooks/internal/env/env.go b/apps/webhooks/internal/env/env.go deleted file mode 100644 index ffc293db1..000000000 --- a/apps/webhooks/internal/env/env.go +++ /dev/null @@ -1,18 +0,0 @@ -package env - -type Env struct { - HttpPort uint16 `env:"HTTP_PORT" required:"true"` - - KafkaUsername string `env:"KAFKA_USERNAME" required:"false"` - KafkaPassword string `env:"KAFKA_PASSWORD" required:"false"` - KafkaBrokers string `env:"KAFKA_BROKERS" required:"true"` - - KlHookTriggerAuthzSecret string `env:"KL_HOOK_TRIGGER_AUTHZ_SECRET" required:"true"` - - GitWebhooksTopic string `env:"GIT_WEBHOOKS_TOPIC" required:"false"` - GithubAuthzSecret string `env:"GITHUB_AUTHZ_SECRET" required:"false"` - GitlabAuthzSecret string `env:"GITLAB_AUTHZ_SECRET" required:"false"` - - HarborWebhookTopic string `env:"HARBOR_WEBHOOK_TOPIC" required:"true"` - HarborAuthzSecret string `env:"HARBOR_AUTHZ_SECRET" required:"true"` -} diff --git a/apps/webhooks/internal/framework/main.go b/apps/webhooks/internal/framework/main.go deleted file mode 100644 index f2e0eaf97..000000000 --- a/apps/webhooks/internal/framework/main.go +++ /dev/null @@ -1,47 +0,0 @@ -package framework - -import ( - "go.uber.org/fx" - "kloudlite.io/apps/webhooks/internal/app" - "kloudlite.io/apps/webhooks/internal/env" - httpServer "kloudlite.io/pkg/http-server" - "kloudlite.io/pkg/redpanda" -) - -type fm struct { - *env.Env -} - -func (f fm) GetKafkaSASLAuth() *redpanda.KafkaSASLAuth { - return nil - // return &redpanda.KafkaSASLAuth{ - // SASLMechanism: redpanda.ScramSHA256, - // User: v.KafkaUsername, - // Password: v.KafkaPassword, - // } -} - -func (f fm) GetBrokers() string { - return f.KafkaBrokers -} - -func (f fm) GetHttpPort() uint16 { - return f.HttpPort -} - -func (f fm) GetHttpCors() string { - return "" -} - -var Module = fx.Module( - "framework", - fx.Provide( - func(vars *env.Env) *fm { - return &fm{Env: vars} - }, - ), - - redpanda.NewClientFx[*fm](), - httpServer.NewHttpServerFx[*fm](), - app.Module, -) diff --git a/apps/websocket-server/Containerfile.local b/apps/websocket-server/Containerfile.local new file mode 100644 index 000000000..07e5e5250 --- /dev/null +++ b/apps/websocket-server/Containerfile.local @@ -0,0 +1,7 @@ +# syntax=docker/dockerfile:1.4 +FROM gcr.io/distroless/static:nonroot +WORKDIR /tmp +USER 1001:1001 +ARG APP +COPY --from=builder $APP ./websocket-server +CMD ["./websocket-server"] diff --git a/apps/websocket-server/Taskfile.yml b/apps/websocket-server/Taskfile.yml new file mode 100644 index 000000000..f7566450c --- /dev/null +++ b/apps/websocket-server/Taskfile.yml @@ -0,0 +1,61 @@ +version: "3" + +dotenv: + - .secrets/env + +vars: + ImagePrefix: "ghcr.io/kloudlite/platform/apis" + +tasks: + build: + env: + CGO_ENABLED: 0 + GOOS: linux + GOARCH: amd64 + vars: + BuiltAt: + sh: date | sed 's/\s/_/g' + preconditions: + - sh: '[ -n "{{.Out}}" ]' + msg: var Out must have a value + cmds: + - go build -ldflags="-s -w -X kloudlite.io/common.BuiltAt=\"{{.BuiltAt}}\"" -o {{.Out}} + - upx {{.Out}} + + run: + dotenv: + - .secrets/env + cmds: + - go run main.go --dev + + docker-build: + vars: + APP: finance + IMAGE: registry.kloudlite.io/kloudlite/{{.EnvName}}/{{.APP}}-api:{{.Tag}} + preconditions: + - sh: '[[ -n "{{.Tag}}" ]]' + msg: 'var Tag must have a value' + + - sh: '[[ "{{.EnvName}}" == "development" ]] || [[ "{{.EnvName}}" == "staging" ]] || [[ "{{.EnvName}}" == "production" ]]' + msg: 'var EnvName must have one of [development, staging, production] as its value' + cmds: + - docker buildx build -f ./Dockerfile -t {{.IMAGE}} . --build-arg APP={{.APP}} --platform linux/amd64 --build-context project-root=../.. + - docker push {{.IMAGE}} + + local-build: + preconditions: + - sh: '[ -n "{{.Tag}}" ]' + msg: 'var Tag must have a value' + vars: + Dockerfile: "./Containerfile.local" + APP: websocket-server + Image: "{{.ImagePrefix}}/{{.APP}}:{{.Tag}}" + cmds: + - |+ + dir=$(mktemp -d) + task build Out=$dir/{{.APP}} + + podman buildx build -t {{.Image}} -f {{.Dockerfile}} . --build-context builder=$dir --build-arg APP={{.APP}} + podman push {{.Image}} + rm -rf $dir + diff --git a/apps/websocket-server/internal/app/app.go b/apps/websocket-server/internal/app/app.go new file mode 100644 index 000000000..e05eb5d6f --- /dev/null +++ b/apps/websocket-server/internal/app/app.go @@ -0,0 +1,94 @@ +package app + +import ( + "github.com/gofiber/fiber/v2" + "github.com/gofiber/websocket/v2" + "github.com/kloudlite/api/apps/websocket-server/internal/domain" + "github.com/kloudlite/api/apps/websocket-server/internal/env" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/constants" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" + "github.com/kloudlite/api/pkg/grpc" + httpServer "github.com/kloudlite/api/pkg/http-server" + "github.com/kloudlite/api/pkg/kv" + "github.com/kloudlite/api/pkg/logging" + "go.uber.org/fx" +) + +type AuthCacheClient kv.Client + +type AuthClient grpc.Client + +type ( + ContainerRegistryClient grpc.Client + IAMClient grpc.Client +) + +var Module = fx.Module("app", + + // grpc clients + fx.Provide(func(conn IAMClient) iam.IAMClient { + return iam.NewIAMClient(conn) + }), + + domain.Module, + + fx.Invoke( + func(server httpServer.Server, d domain.Domain, env *env.Env, + logr logging.Logger, + sessionRepo kv.Repo[*common.AuthSession], + ) { + + a := server.Raw() + + a.Use( + httpServer.NewSessionMiddleware( + sessionRepo, + constants.CookieName, + env.CookieDomain, + constants.CacheSessionPrefix, + ), + ) + + setUpgradable := func(c *fiber.Ctx) error { + if websocket.IsWebSocketUpgrade(c) { + return c.Next() + } + return fiber.ErrUpgradeRequired + } + + // Web socket route + a.Use("/ws", setUpgradable) + a.Use("/logs", setUpgradable) + + a.Use("/logs", func(c *fiber.Ctx) error { + ctx := c.Context() + + return websocket.New(func(sockConn *websocket.Conn) { + if err := d.HandleWebSocketForLogs(ctx, sockConn); err != nil { + logr.Errorf(err, "while handling websocket for logs") + } + })(c) + }) + + a.Use("/ws", func(c *fiber.Ctx) error { + ctx := c.Context() + + return websocket.New(func(sockConn *websocket.Conn) { + if err := d.HandleWebSocketForRUpdate(ctx, sockConn); err != nil { + logr.Errorf(err, "while handling websocket for resource update") + } + })(c) + }) + + a.Get("/healthy", func(c *fiber.Ctx) error { + return c.SendString("OK") + }) + + a.All("*", func(c *fiber.Ctx) error { + return c.SendStatus(fiber.StatusNotFound) + }) + + }, + ), +) diff --git a/apps/websocket-server/internal/domain/commons.go b/apps/websocket-server/internal/domain/commons.go new file mode 100644 index 000000000..ecf1de012 --- /dev/null +++ b/apps/websocket-server/internal/domain/commons.go @@ -0,0 +1,40 @@ +package domain + +import ( + "context" + + iamT "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" +) + +type UserContext struct { + context.Context + UserId repos.ID + UserName string + UserEmail string +} + +func (d *domain) checkAccountAccess(ctx context.Context, accountName string, userId repos.ID, action iamT.Action) error { + co, err := d.iamClient.Can(ctx, &iam.CanIn{ + UserId: string(userId), + ResourceRefs: []string{iamT.NewResourceRef(accountName, iamT.ResourceAccount, accountName)}, + Action: string(action), + }) + + // if err != nil { + // return err + // } + + if err != nil { + d.logger.Errorf(err, "iam.can check for action: ", action) + return errors.Newf("unauthorized to perform action: %s", action) + } + + if !co.Status { + return errors.Newf("unauthorized to perform action: %s", action) + } + + return nil +} diff --git a/apps/websocket-server/internal/domain/domain.go b/apps/websocket-server/internal/domain/domain.go new file mode 100644 index 000000000..46cf781e5 --- /dev/null +++ b/apps/websocket-server/internal/domain/domain.go @@ -0,0 +1,51 @@ +package domain + +import ( + "context" + + "github.com/gofiber/websocket/v2" + + "github.com/kloudlite/api/apps/websocket-server/internal/env" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/api/pkg/nats" + "go.uber.org/fx" +) + +type SocketService interface { + HandleWebSocketForRUpdate(ctx context.Context, c *websocket.Conn) error + HandleWebSocketForLogs(ctx context.Context, c *websocket.Conn) error +} + +type Domain interface { + SocketService +} + +type domain struct { + iamClient iam.IAMClient + natsClient *nats.Client + jetStreamClient *nats.JetstreamClient + env *env.Env + + logger logging.Logger +} + +func NewDomain( + iamCli iam.IAMClient, + env *env.Env, + + logger logging.Logger, + natsClient *nats.Client, + jetStreamClient *nats.JetstreamClient, +) Domain { + return &domain{ + iamClient: iamCli, + natsClient: natsClient, + jetStreamClient: jetStreamClient, + + env: env, + logger: logger, + } +} + +var Module = fx.Module("domain", fx.Provide(NewDomain)) diff --git a/apps/websocket-server/internal/domain/logs.go b/apps/websocket-server/internal/domain/logs.go new file mode 100644 index 000000000..513b7b947 --- /dev/null +++ b/apps/websocket-server/internal/domain/logs.go @@ -0,0 +1,317 @@ +package domain + +import ( + "context" + "crypto/md5" + "encoding/json" + "fmt" + "strconv" + "time" + + "github.com/gofiber/websocket/v2" + "github.com/google/uuid" + iamT "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/errors" + httpServer "github.com/kloudlite/api/pkg/http-server" + msg_nats "github.com/kloudlite/api/pkg/messaging/nats" + "github.com/kloudlite/api/pkg/messaging/types" + "github.com/kloudlite/api/pkg/repos" + "github.com/nats-io/nats.go/jetstream" +) + +func parseTime(since string) (time.Time, error) { + now := time.Now() + + // Split the string into the numeric and duration type parts + length := len(since) + if length < 2 { + return now, fmt.Errorf("invalid expiration format") + } + + durationValStr := since[:length-1] + durationVal, err := strconv.Atoi(durationValStr) + if err != nil { + return now, fmt.Errorf("invalid duration value: %v", err) + } + + durationType := since[length-1] + + switch durationType { + case 'm': + return now.Add(-time.Duration(durationVal) * time.Minute), nil + case 'h': + return now.Add(-time.Duration(durationVal) * time.Hour), nil + case 'd': + return now.AddDate(0, 0, -durationVal), nil + case 'w': + return now.AddDate(0, 0, -durationVal*7), nil + case 'M': + return now.AddDate(0, -durationVal, 0), nil + default: + return now, fmt.Errorf("invalid duration type: %v, available types: m, h, d, w, M", durationType) + } +} + +func parseSince(since *string) (*time.Time, error) { + if since == nil { + return nil, nil + } + + if *since == "" { + return nil, nil + } + + t, err := parseTime(*since) + if err != nil { + return nil, errors.NewE(err) + } + + return &t, nil +} + +type LogsReqData struct { + AccountName string `json:"account"` + ClusterName string `json:"cluster"` + TrackingId string `json:"trackingId"` + Since *string `json:"since,omitempty"` +} + +func (d *domain) newJetstreamConsumerForLog(ctx context.Context, subject string, consumetId string, since *string) (*msg_nats.JetstreamConsumer, error) { + t, err := parseSince(since) + if err != nil { + return nil, errors.NewE(err) + } + + if t != nil { + return msg_nats.NewJetstreamConsumer(ctx, d.jetStreamClient, msg_nats.JetstreamConsumerArgs{ + Stream: d.env.LogsStreamName, + ConsumerConfig: msg_nats.ConsumerConfig{ + DeliverPolicy: jetstream.DeliverByStartTimePolicy, + OptStartTime: t, + Name: consumetId, + Description: "this is an ephemeral consumer which dispatches logs to a websocket client", + FilterSubjects: []string{ + subject, + }, + }, + }) + } + + return msg_nats.NewJetstreamConsumer(ctx, d.jetStreamClient, msg_nats.JetstreamConsumerArgs{ + Stream: d.env.LogsStreamName, + ConsumerConfig: msg_nats.ConsumerConfig{ + Name: consumetId, + Description: "this is an ephemeral consumer which dispatches logs to a websocket client", + FilterSubjects: []string{ + subject, + }, + }, + }) +} + +func getLogHash(ld LogsReqData, userId repos.ID) string { + uuid := uuid.New().String() + return fmt.Sprintf("%x", md5.Sum([]byte(fmt.Sprintf("%s-%s-%s-%s-%s", ld.AccountName, ld.ClusterName, ld.TrackingId, userId, uuid)))) +} + +func (d *domain) getLogSubsId(ld LogsReqData) string { + return fmt.Sprintf("%s.%s.%s.%s", d.env.LogsStreamName, ld.AccountName, ld.ClusterName, ld.TrackingId) +} + +func (d *domain) HandleWebSocketForLogs(ctx context.Context, c *websocket.Conn) error { + sess := httpServer.GetSession[*common.AuthSession](ctx) + if sess == nil { + return errors.NewE(fmt.Errorf("session not found")) + } + + defer func() { + if err := c.Close(); err != nil { + d.logger.Warnf("websocket close: %w", err) + } + }() + + log := d.logger + + type Subscription struct { + resource LogsReqData + jc *msg_nats.JetstreamConsumer + open bool + } + + resources := make(map[string]*Subscription) + + type Message struct { + Event string `json:"event"` + Data LogsReqData `json:"data"` + } + + type MessageType string + + const ( + MessageTypeError MessageType = "error" + MessageTypeUpdate MessageType = "update" + MessageTypeInfo MessageType = "info" + MessageTypeLog MessageType = "log" + ) + + type MessageResponse struct { + Timestamp time.Time `json:"timestamp"` + Message string `json:"message"` + Type MessageType `json:"type"` + } + + closed := false + + writeError := func(c *websocket.Conn, err error) error { + if c != nil { + return c.WriteJSON(MessageResponse{ + Type: MessageTypeError, + Message: err.Error(), + }) + } + return nil + } + + writeInfo := func(c *websocket.Conn, msg string) error { + if c != nil { + return c.WriteJSON(MessageResponse{ + Type: MessageTypeInfo, + Message: msg, + }) + } + return nil + } + + for { + if closed { + break + } + + var msg Message + if err := c.ReadJSON(&msg); err != nil { + + if websocket.IsCloseError(err, websocket.CloseGoingAway) { + break + } + if websocket.IsCloseError(err, websocket.CloseAbnormalClosure) { + break + } + + if err := writeError(c, err); err != nil { + log.Warnf("websocket write: %w", err) + } + + continue + } + + if err := d.checkAccountAccess(ctx, msg.Data.AccountName, sess.UserId, iamT.GetAccount); err != nil { + if err := writeError(c, err); err != nil { + log.Warnf("websocket write: %w", err) + } + continue + } + + hash := getLogHash(msg.Data, sess.UserId) + + switch msg.Event { + case "subscribe": + + if _, ok := resources[hash]; ok { + if err := writeError( + c, errors.Newf("already subscribed to logs for account: %s, cluster: %s, trackingId: %s", + msg.Data.AccountName, msg.Data.ClusterName, msg.Data.TrackingId, + ), + ); err != nil { + log.Warnf("websocket write: %w", err) + } + continue + } + + jc, err := d.newJetstreamConsumerForLog(ctx, d.getLogSubsId(msg.Data), hash, msg.Data.Since) + if err != nil { + if err := writeError(c, err); err != nil { + log.Warnf("websocket write: %w", err) + } + continue + } + + if err := jc.Consume( + func(msg *types.ConsumeMsg) error { + if c != nil { + + var resp MessageResponse + if err := json.Unmarshal(msg.Payload, &resp); err != nil { + if err := writeError(c, err); err != nil { + log.Warnf("websocket write: %w", err) + } + } + + resp.Type = MessageTypeLog + if err := c.WriteJSON(resp); err != nil { + log.Warnf("websocket write: %w", err) + } + } + + return nil + }, + types.ConsumeOpts{ + OnError: func(err error) error { + if err := writeError(c, err); err != nil { + log.Warnf("websocket write: %w", err) + } + + return err + }, + }, + ); err != nil { + if err := writeError(c, err); err != nil { + log.Warnf("websocket write: %w", err) + } + + continue + } + + if err := writeInfo(c, "subscribed to logs"); err != nil { + log.Warnf("websocket write: %w", err) + } + + resources[hash] = &Subscription{ + resource: msg.Data, + jc: jc, + open: true, + } + + case "unsubscribe": + if _, ok := resources[hash]; !ok { + if err := writeError( + c, errors.Newf("not subscribed to logs for account: %s, cluster: %s, trackingId: %s", + msg.Data.AccountName, msg.Data.ClusterName, msg.Data.TrackingId, + ), + ); err != nil { + log.Warnf("websocket write: %w", err) + } + + continue + } + + if resources[hash].jc != nil { + if err := resources[hash].jc.Stop(ctx); err != nil { + if err := writeError(c, err); err != nil { + log.Warnf("websocket write: %w", err) + } + } + } + + default: + if err := writeError( + c, errors.Newf("invalid event: %s, available events: subscribe, unsubscribe", msg.Event), + ); err != nil { + log.Warnf("websocket write: %w", err) + } + } + + } + + return nil +} diff --git a/apps/websocket-server/internal/domain/resource-update.go b/apps/websocket-server/internal/domain/resource-update.go new file mode 100644 index 000000000..a1cbcac20 --- /dev/null +++ b/apps/websocket-server/internal/domain/resource-update.go @@ -0,0 +1,290 @@ +package domain + +import ( + "context" + "fmt" + "strings" + + "github.com/gofiber/websocket/v2" + iamT "github.com/kloudlite/api/apps/iam/types" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" + "github.com/kloudlite/api/pkg/errors" + httpServer "github.com/kloudlite/api/pkg/http-server" + "github.com/kloudlite/api/pkg/repos" + mnats "github.com/nats-io/nats.go" +) + +type RUpdateReqData struct { + AccountName string `json:"account"` + ProjectName string `json:"project"` + + // ResourceName string `json:"resource"` + // ResourceType string `json:"resource_type"` + Topic string `json:"topic"` + ReqTopic string `json:"req_topic"` +} + +func (d *domain) checkAccess(ctx context.Context, rdata *RUpdateReqData, userId repos.ID) error { + co, err := d.iamClient.Can(ctx, &iam.CanIn{ + UserId: string(userId), + ResourceRefs: func() []string { + var refs []string + + if rdata.ProjectName != "" { + refs = append(refs, iamT.NewResourceRef(rdata.AccountName, iamT.ResourceProject, rdata.ProjectName)) + } + + refs = append(refs, iamT.NewResourceRef(rdata.AccountName, iamT.ResourceAccount, rdata.AccountName)) + + return refs + + }(), + Action: string(func() iamT.Action { + if rdata.ProjectName != "" { + return iamT.GetAccount + } else { + return iamT.GetProject + } + }()), + }) + + if err != nil { + return err + } + + if !co.Status { + return fmt.Errorf("access denied") + } + + return nil +} + +func (d *domain) parseRUpdateReq(rt string) (*RUpdateReqData, error) { + + entriesStrs := strings.Split(rt, ".") + + rdata := &RUpdateReqData{} + + nTopics := "res-updates" + + for _, entryStr := range entriesStrs { + entry := strings.Split(entryStr, ":") + + if len(entry) != 2 { + nTopics += fmt.Sprintf(".%s.*", entry[0]) + } else { + nTopics += fmt.Sprintf(".%s.%s", entry[0], entry[1]) + } + + if (entry[0] == "account" || entry[0] == "project") && len(entry) == 2 { + if entry[0] == "account" { + rdata.AccountName = entry[1] + } + if entry[0] == "project" { + rdata.ProjectName = entry[1] + } + } + + } + + rdata.Topic = nTopics + rdata.ReqTopic = rt + if rdata.AccountName == "" { + return nil, fmt.Errorf("invalid topic %s", rt) + } + + return rdata, nil +} + +func (d *domain) HandleWebSocketForRUpdate(ctx context.Context, c *websocket.Conn) error { + + sess := httpServer.GetSession[*common.AuthSession](ctx) + if sess == nil { + return errors.NewE(fmt.Errorf("session not found")) + } + + defer func() { + if err := c.Close(); err != nil { + d.logger.Warnf("websocket close: %w", err) + } + }() + log := d.logger + + type Subscription struct { + resource RUpdateReqData + sub *mnats.Subscription + open bool + } + + resources := make(map[string]*Subscription) + + type Message struct { + Event string `json:"event"` + Data string `json:"data"` + } + + // "account:accid.cluster:clusterid.nodepool:nodepoolid" + + type MessageType string + + const ( + MessageTypeError MessageType = "error" + MessageTypeUpdate MessageType = "update" + MessageTypeInfo MessageType = "info" + ) + + type MessageResponse struct { + Topic string `json:"topic"` + Message string `json:"message"` + Type MessageType `json:"type"` + } + + closed := false + + c.SetCloseHandler(func(_ int, _ string) error { + closed = true + return nil + }) + + defer func() { + for _, r := range resources { + if err := r.sub.Unsubscribe(); err != nil { + log.Warnf("websocket unsubscribe: %w", err) + } + } + }() + + writeError := func(c *websocket.Conn, err error) error { + if c != nil { + return c.WriteJSON(MessageResponse{ + Type: MessageTypeError, + Message: err.Error(), + }) + } + return nil + } + + writeInfo := func(c *websocket.Conn, msg string) error { + if c != nil { + return c.WriteJSON(MessageResponse{ + Type: MessageTypeInfo, + Message: msg, + }) + } + return nil + } + + // Keep the connection open + for { + + if closed { + break + } + + var message Message + if err := c.ReadJSON(&message); err != nil { + + if websocket.IsCloseError(err, websocket.CloseGoingAway) { + break + } + if websocket.IsCloseError(err, websocket.CloseAbnormalClosure) { + break + } + + if err := writeError(c, err); err != nil { + log.Warnf("websocket write: %w", err) + } + + continue + } + + rd, err := d.parseRUpdateReq(message.Data) + if err != nil { + + if err := writeError(c, err); err != nil { + log.Warnf("websocket write: %w", err) + } + + continue + } + + if err := d.checkAccess(ctx, rd, sess.UserId); err != nil { + + if err := writeError(c, err); err != nil { + log.Warnf("websocket write: %w", err) + } + + continue + } + + switch message.Event { + case "subscribe": + if _, ok := resources[message.Data]; ok { + if err := writeError(c, fmt.Errorf("resource already subscribed")); err != nil { + log.Warnf("websocket write: %w", err) + } + } + + sub, err := d.natsClient.Conn.Subscribe(rd.Topic, func(_ *mnats.Msg) { + + rmessage := MessageResponse{ + Topic: rd.ReqTopic, + Message: resources[rd.Topic].resource.ReqTopic, + Type: MessageTypeUpdate, + } + + if c != nil && resources[rd.Topic] != nil && resources[rd.Topic].open { + if err := c.WriteJSON(rmessage); err != nil { + log.Warnf("websocket write: %w", err) + } + } + + }) + + if err != nil { + if err := writeError(c, err); err != nil { + log.Warnf("websocket write: %w", err) + } + + continue + } + + if err := writeInfo(c, fmt.Sprintf("subscribed to %s", rd.Topic)); err != nil { + log.Warnf("websocket write: %w", err) + } + + resources[rd.Topic] = &Subscription{ + resource: *rd, + sub: sub, + open: true, + } + + case "unsubscribe": + if _, ok := resources[message.Data]; !ok { + if err := writeError(c, fmt.Errorf("resource not subscribed")); err != nil { + log.Warnf("websocket write: %w", err) + } + + continue + } + + if resources[rd.Topic].sub != nil { + if err := resources[rd.Topic].sub.Unsubscribe(); err != nil { + if err := writeError(c, err); err != nil { + log.Warnf("websocket write: %w", err) + } + break + } + + delete(resources, message.Data) + } + + default: + log.Errorf(fmt.Errorf("websocket read: invalid event %s", message.Event)) + } + + } + + return nil +} diff --git a/apps/websocket-server/internal/domain/suite_test.go b/apps/websocket-server/internal/domain/suite_test.go new file mode 100644 index 000000000..8d0d2e733 --- /dev/null +++ b/apps/websocket-server/internal/domain/suite_test.go @@ -0,0 +1 @@ +package domain_test diff --git a/apps/websocket-server/internal/env/env.go b/apps/websocket-server/internal/env/env.go new file mode 100644 index 000000000..9dd54f3f1 --- /dev/null +++ b/apps/websocket-server/internal/env/env.go @@ -0,0 +1,40 @@ +package env + +import ( + "github.com/codingconcepts/env" + "github.com/kloudlite/api/pkg/errors" +) + +type Env struct { + SocketPort uint16 `env:"SOCKET_PORT" required:"true"` + + IamGrpcAddr string `env:"IAM_GRPC_ADDR" required:"true"` + CookieDomain string `env:"COOKIE_DOMAIN" required:"true"` + + SessionKVBucket string `env:"SESSION_KV_BUCKET" required:"true"` + NatsURL string `env:"NATS_URL" required:"true"` + IsDev bool + + LogsStreamName string `env:"LOGS_STREAM_NAME" default:"logs"` + + // HttpPort uint16 `env:"HTTP_PORT" required:"true"` + // HttpCors string `env:"CORS_ORIGINS" required:"false"` + // GrpcPort uint16 `env:"GRPC_PORT" required:"true"` + // + // DBName string `env:"MONGO_DB_NAME" required:"true"` + // DBUrl string `env:"MONGO_URI" required:"true"` + // + // + // CommsGrpcAddr string `env:"COMMS_GRPC_ADDR" required:"true"` + // ContainerRegistryGrpcAddr string `env:"CONTAINER_REGISTRY_GRPC_ADDR" required:"true"` + // ConsoleGrpcAddr string `env:"CONSOLE_GRPC_ADDR" required:"true"` + // KubernetesApiProxy string `env:"KUBERNETES_API_PROXY"` +} + +func LoadEnv() (*Env, error) { + var ev Env + if err := env.Set(&ev); err != nil { + return nil, errors.NewE(err) + } + return &ev, nil +} diff --git a/apps/websocket-server/internal/framework/framework.go b/apps/websocket-server/internal/framework/framework.go new file mode 100644 index 000000000..334b97239 --- /dev/null +++ b/apps/websocket-server/internal/framework/framework.go @@ -0,0 +1,82 @@ +package framework + +import ( + "context" + "fmt" + + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/nats" + + "github.com/kloudlite/api/pkg/kv" + + "github.com/kloudlite/api/pkg/logging" + + "github.com/kloudlite/api/apps/websocket-server/internal/app" + "github.com/kloudlite/api/apps/websocket-server/internal/env" + "github.com/kloudlite/api/pkg/grpc" + httpServer "github.com/kloudlite/api/pkg/http-server" + "go.uber.org/fx" +) + +type fm struct { + env *env.Env +} + +var Module = fx.Module("framework", + fx.Provide(func(ev *env.Env) *fm { + return &fm{env: ev} + }), + + fx.Provide(func(ev *env.Env, logger logging.Logger) (*nats.Client, error) { + name := "RUP:nat-client" + return nats.NewClient(ev.NatsURL, nats.ClientOpts{ + Name: name, + Logger: logger, + }) + }), + + fx.Provide(func(ev *env.Env, logger logging.Logger, cli *nats.Client) (*nats.JetstreamClient, error) { + return nats.NewJetstreamClient(cli) + }), + + fx.Provide( + func(ev *env.Env, jc *nats.JetstreamClient) (kv.Repo[*common.AuthSession], error) { + cxt := context.TODO() + return kv.NewNatsKVRepo[*common.AuthSession](cxt, ev.SessionKVBucket, jc) + }, + ), + + fx.Provide(func(ev *env.Env) (app.IAMClient, error) { + return grpc.NewGrpcClient(ev.IamGrpcAddr) + }), + + app.Module, + + fx.Invoke(func(c2 app.IAMClient, lf fx.Lifecycle) { + lf.Append(fx.Hook{ + OnStop: func(context.Context) error { + if err := c2.Close(); err != nil { + return errors.NewE(err) + } + return nil + }, + }) + }), + + fx.Provide(func(logger logging.Logger, e *env.Env) httpServer.Server { + return httpServer.NewServer(httpServer.ServerArgs{Logger: logger, IsDev: e.IsDev}) + }), + + // have to create socket server here + fx.Invoke(func(lf fx.Lifecycle, server httpServer.Server, ev *env.Env) { + lf.Append(fx.Hook{ + OnStart: func(context.Context) error { + return server.Listen(fmt.Sprintf(":%d", ev.SocketPort)) + }, + OnStop: func(context.Context) error { + return server.Close() + }, + }) + }), +) diff --git a/apps/websocket-server/main.go b/apps/websocket-server/main.go new file mode 100644 index 000000000..b8deadd7f --- /dev/null +++ b/apps/websocket-server/main.go @@ -0,0 +1,63 @@ +package main + +import ( + "context" + "flag" + "github.com/kloudlite/api/pkg/errors" + "os" + "time" + + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/logging" + "go.uber.org/fx" + + "github.com/kloudlite/api/apps/websocket-server/internal/env" + "github.com/kloudlite/api/apps/websocket-server/internal/framework" +) + +func main() { + var isDev bool + flag.BoolVar(&isDev, "dev", false, "--dev") + flag.Parse() + + logger, err := logging.New(&logging.Options{Name: "RUP", Dev: isDev}) + if err != nil { + panic(err) + } + + app := fx.New( + fx.NopLogger, + + fx.Provide(func() logging.Logger { + return logger + }), + + fx.Provide(func() (*env.Env, error) { + if e, err := env.LoadEnv(); err != nil { + return nil, errors.NewE(err) + } else { + e.IsDev = isDev + return e, nil + } + }), + + framework.Module, + ) + + ctx, cancelFunc := func() (context.Context, context.CancelFunc) { + if isDev { + return context.WithTimeout(context.TODO(), 20*time.Second) + } + return context.WithTimeout(context.TODO(), 5*time.Second) + }() + defer cancelFunc() + + if err := app.Start(ctx); err != nil { + logger.Errorf(err, "error starting websocket-server app") + logger.Infof("EXITING as errors encountered during startup") + os.Exit(1) + } + + common.PrintReadyBanner() + <-app.Done() +} diff --git a/apps/wg-restart/.dockerignore b/apps/wg-restart/.dockerignore deleted file mode 100644 index 94143827e..000000000 --- a/apps/wg-restart/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -Dockerfile diff --git a/apps/wg-restart/Dockerfile b/apps/wg-restart/Dockerfile deleted file mode 100644 index afd4c6cd6..000000000 --- a/apps/wg-restart/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -# context-dir: -FROM golang:1.18.3-alpine3.16 AS base -RUN apk add make gcc libc-dev -USER root -ENV GOPATH=/tmp/go -ENV GOCACHE=/tmp/go-cache -WORKDIR /tmp/app -# COPY --chown=1001 ./go.mod ./go.sum ./tools.go pkg common grpc-interfaces ./ -COPY --chown=1001 ./ ./ -ARG APP_DIR -WORKDIR $APP_DIR -ENV CGO_ENABLED=0 -RUN go build -tags musl -o /tmp/bin/wg-restart ./main.go -RUN chmod +x /tmp/bin/wg-restart - -FROM ghcr.io/linuxserver/wireguard:latest -WORKDIR /tmp/bin -COPY --from=base /tmp/bin/wg-restart ./ -ENTRYPOINT ["./wg-restart"] diff --git a/apps/wg-restart/Taskfile.yml b/apps/wg-restart/Taskfile.yml deleted file mode 100644 index 0e24a128d..000000000 --- a/apps/wg-restart/Taskfile.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: "3" - -dotenv: [".secrets/env"] - -tasks: - gql: - dir: ./internal/app - cmds: - - go run -tags dynamic github.com/99designs/gqlgen generate - run: - env: - CONFIG_FILE: ./conf.json - sources: - - ./internal/**/*.go - - ./main.go - cmds: - - go version -# - nodemon -e go --signal SIGKILL --exec 'go run -tags dynamic main.go --dev || exit 1' - - go run -tags dynamic main.go --dev - - docker-build: - dir: ../.. - vars: - IMAGE: registry.kloudlite.io/public/kloudlite/{{.EnvName}}/wg-restart:{{.Tag}} - APP_DIR: ./apps/wg-restart - cmds: - - docker build -f ./{{.APP_DIR}}/Dockerfile -t {{.IMAGE}} . --platform linux/amd64 --build-arg APP_DIR={{.APP_DIR}} - - docker push {{.IMAGE}} diff --git a/apps/wg-restart/main.go b/apps/wg-restart/main.go deleted file mode 100644 index 223fd3017..000000000 --- a/apps/wg-restart/main.go +++ /dev/null @@ -1,104 +0,0 @@ -package main - -import ( - "fmt" - "io/fs" - "io/ioutil" - "net" - "os" - "os/exec" - "strings" - "sync" - - "github.com/gofiber/fiber/v2" -) - -type Service struct { - Name string `json:"name"` - Target int `json:"servicePort"` - Port int `json:"proxyPort"` - Listener net.Listener - Closed bool -} - -const ( - WgFileName = "wg0" - WgFileNameSecondary = "sample" - WgFile = "/etc/wireguard/" + WgFileName + ".conf" - WgFileSecondary = "/etc/wireguard/" + WgFileNameSecondary + ".conf" -) - -func reloadConfig(conf []byte) error { - fmt.Println("\n================== Restart ==================") - if conf == nil { - var err error - conf, err = os.ReadFile(WgFile) - if err != nil { - return err - } - } - // cmds := strings.Fields("chmod +rwx /etc/wireguard") - // cmd := exec.Command(cmds[0], cmds[1:]...) - // cmd.Run() - - err := ioutil.WriteFile(WgFileSecondary, conf, fs.ModeAppend) - if err != nil { - return err - } - - cmds := strings.Fields("wg-quick down " + WgFileNameSecondary) - - cmd := exec.Command(cmds[0], cmds[1:]...) - cmd.Stdout = os.Stdout - cmd.Stdin = os.Stdin - cmd.Stderr = os.Stderr - - err = cmd.Run() - if err != nil { - fmt.Println(err) - } - - cmds = strings.Fields("wg-quick up " + WgFileNameSecondary) - - cmd = exec.Command(cmds[0], cmds[1:]...) - cmd.Stdout = os.Stdout - cmd.Stdin = os.Stdin - cmd.Stderr = os.Stderr - - err = cmd.Run() - - return err -} - -func startApi() error { - app := fiber.New() - app.Post("/post", func(c *fiber.Ctx) error { - err := reloadConfig(c.Body()) - if err != nil { - return err - } - err = c.Send([]byte("done")) - if err != nil { - return err - } - return nil - }) - err := app.Listen(":2998") - if err != nil { - return err - } - return nil -} - -func main() { - go func() { - _ = startApi() - }() - err := reloadConfig(nil) - if err != nil { - panic(err) - } - var wg sync.WaitGroup - wg.Add(1) - wg.Wait() -} diff --git a/apps/worker-audit-logging/Taskfile.yml b/apps/worker-audit-logging/Taskfile.yml index bf67b63e1..fd84e5391 100644 --- a/apps/worker-audit-logging/Taskfile.yml +++ b/apps/worker-audit-logging/Taskfile.yml @@ -1,6 +1,18 @@ version: 3 tasks: + build: + env: + CGO_ENABLED: 0 + GOOS: linux + GOARCH: amd64 + preconditions: + - sh: '[ -n "{{.Out}}" ]' + msg: var Out must have a value + cmds: + - go build -ldflags="-s -w" -o {{.Out}} + - upx {{.Out}} + local-build: preconditions: - sh: '[ -n "{{.EnvName}}" ]' diff --git a/apps/worker-audit-logging/internal/app/app.go b/apps/worker-audit-logging/internal/app/app.go index ffb671f0c..073ea5940 100644 --- a/apps/worker-audit-logging/internal/app/app.go +++ b/apps/worker-audit-logging/internal/app/app.go @@ -3,55 +3,63 @@ package app import ( "context" "encoding/json" + "github.com/kloudlite/api/apps/worker-audit-logging/internal/domain" + "github.com/kloudlite/api/apps/worker-audit-logging/internal/env" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/api/pkg/messaging" + msg_nats "github.com/kloudlite/api/pkg/messaging/nats" + "github.com/kloudlite/api/pkg/messaging/types" + "github.com/kloudlite/api/pkg/nats" + + "github.com/kloudlite/api/pkg/repos" "go.uber.org/fx" - "kloudlite.io/apps/worker-audit-logging/internal/domain" - "kloudlite.io/pkg/logging" - "kloudlite.io/pkg/redpanda" - "kloudlite.io/pkg/repos" - "time" ) -type EventLogConsumer redpanda.Consumer +type EventLogConsumer messaging.Consumer var Module = fx.Module("app", repos.NewFxMongoRepo[*domain.EventLog]("events", "ev", domain.EventLogIndices), - fx.Invoke(func(consumer redpanda.Consumer, logr logging.Logger, d domain.Domain) { - consumer.StartConsuming(func(msg []byte, _ time.Time, offset int64) error { - logger := logr.WithName("audit-events").WithKV("offset", offset) + fx.Provide(func(jc *nats.JetstreamClient, ev *env.Env, logger logging.Logger) (EventLogConsumer, error) { + topic := common.AuditEventLogTopicName + consumerName := "worker-audit-logging:event-log" + return msg_nats.NewJetstreamConsumer(context.TODO(), jc, msg_nats.JetstreamConsumerArgs{ + Stream: ev.EventLogNatsStream, + ConsumerConfig: msg_nats.ConsumerConfig{ + Name: consumerName, + Durable: consumerName, + Description: "this consumer reads message from a subject dedicated to errors, that occurred when the resource was applied at the agent", + FilterSubjects: []string{string(topic)}, + }, + }) + }), + + fx.Invoke(func(consumer EventLogConsumer, logr logging.Logger, d domain.Domain) error { + if err := consumer.Consume(func(msg *types.ConsumeMsg) error { + logger := logr.WithName("audit-events") logger.Infof("started processing") defer func() { logger.Infof("finished processing") }() var el domain.EventLog - if err := json.Unmarshal(msg, &el); err != nil { - return err + if err := json.Unmarshal(msg.Payload, &el); err != nil { + return errors.NewE(err) } event, err := d.PushEvent(context.TODO(), &el) if err != nil { - return err + return errors.NewE(err) } logger.WithKV("event-id", event.Id).Infof("pushed event to mongo") return nil - }) + }, types.ConsumeOpts{}); err != nil { + logr.Errorf(err, "error consuming messages") + return errors.NewE(err) + } + return nil }), domain.Module, - //fx.Invoke(func(lf fx.Lifecycle, producer redpanda.Producer, logger logging.Logger) { - // lf.Append(fx.Hook{ - // OnStart: func(ctx context.Context) error { - // go func() { - // time.AfterFunc(5*time.Second, func() { - // bkon := beacon.NewBeacon(producer, "kl-events") - // if err := bkon.TriggerEvent(ctx, beacon.NewAuditLogEvent("sample", "user-asdf", "created", "creating a project asdjfkadsklf")); err != nil { - // logger.Errorf(err, "error triggering event") - // } - // logger.Infof("produced message") - // }) - // }() - // return nil - // }, - // }) - //}), ) diff --git a/apps/worker-audit-logging/internal/domain/domain.go b/apps/worker-audit-logging/internal/domain/domain.go index b31191061..31fd96783 100644 --- a/apps/worker-audit-logging/internal/domain/domain.go +++ b/apps/worker-audit-logging/internal/domain/domain.go @@ -2,8 +2,8 @@ package domain import ( "context" + "github.com/kloudlite/api/pkg/repos" "go.uber.org/fx" - "kloudlite.io/pkg/repos" ) type domain struct { diff --git a/apps/worker-audit-logging/internal/domain/entities.go b/apps/worker-audit-logging/internal/domain/entities.go index 7d60c1cc7..f8b18199d 100644 --- a/apps/worker-audit-logging/internal/domain/entities.go +++ b/apps/worker-audit-logging/internal/domain/entities.go @@ -1,8 +1,8 @@ package domain import ( - "kloudlite.io/pkg/beacon" - "kloudlite.io/pkg/repos" + "github.com/kloudlite/api/pkg/beacon" + "github.com/kloudlite/api/pkg/repos" ) type EventLog struct { diff --git a/apps/worker-audit-logging/internal/env/env.go b/apps/worker-audit-logging/internal/env/env.go index 1f767867d..1f8072745 100644 --- a/apps/worker-audit-logging/internal/env/env.go +++ b/apps/worker-audit-logging/internal/env/env.go @@ -1,11 +1,8 @@ package env type Env struct { - KafkaBrokers string `env:"KAFKA_BROKERS" required:"true"` - KafkaUsername string `env:"KAFKA_USERNAME" required:"true"` - KafkaPassword string `env:"KAFKA_PASSWORD" required:"true"` - KafkaSubscriptionTopics string `env:"KAFKA_SUBSCRIPTION_TOPICS" required:"true"` - KafkaConsumerGroupId string `env:"KAFKA_CONSUMER_GROUP_ID" required:"true"` - EventsDbUri string `env:"EVENTS_DB_URI" required:"true"` - EventsDbName string `env:"EVENTS_DB_NAME" required:"true"` + EventsDbUri string `env:"DB_URI" required:"true"` + EventsDbName string `env:"DB_NAME" required:"true"` + NatsURL string `env:"NATS_URL" required:"true"` + EventLogNatsStream string `env:"EVENT_LOG_NATS_STREAM" required:"true"` } diff --git a/apps/worker-audit-logging/internal/framework/framework.go b/apps/worker-audit-logging/internal/framework/framework.go index 77c97e719..f667dc202 100644 --- a/apps/worker-audit-logging/internal/framework/framework.go +++ b/apps/worker-audit-logging/internal/framework/framework.go @@ -1,38 +1,19 @@ package framework import ( + "github.com/kloudlite/api/apps/worker-audit-logging/internal/app" + "github.com/kloudlite/api/apps/worker-audit-logging/internal/env" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/api/pkg/nats" + repos "github.com/kloudlite/api/pkg/repos" "go.uber.org/fx" - "kloudlite.io/apps/worker-audit-logging/internal/app" - "kloudlite.io/apps/worker-audit-logging/internal/env" - "kloudlite.io/pkg/redpanda" - repos "kloudlite.io/pkg/repos" - "strings" ) type redpandaCfg struct { ev *env.Env } -func (r redpandaCfg) GetSubscriptionTopics() []string { - return strings.Split(r.ev.KafkaSubscriptionTopics, ",") -} - -func (r redpandaCfg) GetConsumerGroupId() string { - return r.ev.KafkaConsumerGroupId -} - -func (r redpandaCfg) GetBrokers() (brokers string) { - return r.ev.KafkaBrokers -} - -func (r redpandaCfg) GetKafkaSASLAuth() *redpanda.KafkaSASLAuth { - return &redpanda.KafkaSASLAuth{ - SASLMechanism: redpanda.ScramSHA256, - User: r.ev.KafkaUsername, - Password: r.ev.KafkaPassword, - } -} - type eventsDbCfg struct { ev *env.Env } @@ -45,9 +26,18 @@ var Module fx.Option = fx.Module("framework", fx.Provide(func(ev *env.Env) *redpandaCfg { return &redpandaCfg{ev: ev} }), - redpanda.NewClientFx[*redpandaCfg](), - redpanda.NewConsumerFx[*redpandaCfg](), - redpanda.NewProducerFx[redpanda.Client](), + + fx.Provide(func(ev *env.Env, logger logging.Logger) (*nats.JetstreamClient, error) { + name := "audit-worker:jetstream-client" + nc, err := nats.NewClient(ev.NatsURL, nats.ClientOpts{ + Name: name, + Logger: logger, + }) + if err != nil { + return nil, errors.NewE(err) + } + return nats.NewJetstreamClient(nc) + }), fx.Provide(func(ev *env.Env) *eventsDbCfg { return &eventsDbCfg{ev: ev} diff --git a/apps/worker-audit-logging/main.go b/apps/worker-audit-logging/main.go index 6b64b0bef..b62561146 100644 --- a/apps/worker-audit-logging/main.go +++ b/apps/worker-audit-logging/main.go @@ -4,12 +4,12 @@ import ( "context" "flag" "fmt" + "github.com/kloudlite/api/apps/worker-audit-logging/internal/env" + "github.com/kloudlite/api/apps/worker-audit-logging/internal/framework" + "github.com/kloudlite/api/pkg/config" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/logging" "go.uber.org/fx" - "kloudlite.io/apps/worker-audit-logging/internal/env" - "kloudlite.io/apps/worker-audit-logging/internal/framework" - "kloudlite.io/pkg/config" - fn "kloudlite.io/pkg/functions" - "kloudlite.io/pkg/logging" "time" ) diff --git a/cmd/ast-parser/main.go b/cmd/ast-parser/main.go new file mode 100644 index 000000000..b8790ab4f --- /dev/null +++ b/cmd/ast-parser/main.go @@ -0,0 +1,49 @@ +package main + +import ( + "fmt" + "go/types" + + "golang.org/x/tools/go/packages" +) + +func main() { + packagePath := "kloudlite.io/apps/iam/types" + + cfg := &packages.Config{ + Mode: packages.NeedTypes | packages.NeedSyntax, + // Mode: packages.LoadSyntax, + } + + pkgs, err := packages.Load(cfg, packagePath) + if err != nil { + panic(err) + } + + if len(pkgs) == 0 { + panic(fmt.Errorf("no packages were loaded")) + } + + for _, pkg := range pkgs { + scope := pkg.Types.Scope() + + obj := scope.Lookup("Role") + if obj == nil { + continue + } + + for _, name := range scope.Names() { + varObj := scope.Lookup(name) + if varObj == nil || varObj.Type() == nil { + continue + } + + if varObj.Type().String() == obj.Type().String() { + if val, ok := varObj.(*types.Const); ok { + //fmt.Println(varObj.Name()) + fmt.Println(val.Val()) + } + } + } + } +} diff --git a/cmd/crd-to-gql/lib.go b/cmd/crd-to-gql/lib.go deleted file mode 100644 index 05d788178..000000000 --- a/cmd/crd-to-gql/lib.go +++ /dev/null @@ -1,250 +0,0 @@ -package main - -import ( - "bytes" - "fmt" - "strings" - - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" -) - -func gqlTypeMap(jsonType string) string { - switch jsonType { - case "boolean": - return "Boolean" - case "integer": - return "Int" - case "object": - return "Object" - case "string": - return "String" - case "array": - return "Array" - default: - return "Any" - } -} - -func genTypeName(n string) string { - return strings.ToUpper(n[0:1]) + n[1:] -} - -func genFieldEntry(k string, t string, required bool) string { - if required { - return fmt.Sprintf("\t%s: %s!\n", k, t) - } - return fmt.Sprintf("\t%s: %s\n", k, t) -} - -func navigateTree(tree *v1.JSONSchemaProps, name string, schemas map[string]string, depth ...int) { - currDepth := func() int { - if len(depth) == 0 { - return 1 - } - return depth[0] - }() - - m := map[string]bool{} - for i := range tree.Required { - m[tree.Required[i]] = true - } - - typeName := genTypeName(name) - - var tVar, iVar string - - tVar = fmt.Sprintf("type %s @shareable {\n", typeName) - iVar = fmt.Sprintf("input %sIn {\n", typeName) - - //fmt.Printf("%q type: %s\n", typeName, tree.Type) - - hasAddedSyncStatus := false - - for k, v := range tree.Properties { - //fmt.Printf("[properties] %q type: %s\n", k, v.Type) - - if v.Type == "array" { - if v.Items.Schema != nil && v.Items.Schema.Type == "object" { - tVar += genFieldEntry(k, fmt.Sprintf("[%s]", typeName+genTypeName(k)), m[k]) - iVar += genFieldEntry(k, fmt.Sprintf("[%s]", typeName+genTypeName(k)+"In"), m[k]) - - navigateTree(v.Items.Schema, typeName+genTypeName(k), schemas, currDepth+1) - continue - } - tVar += genFieldEntry(k, fmt.Sprintf("[%s]", genTypeName(v.Items.Schema.Type)), m[k]) - iVar += genFieldEntry(k, fmt.Sprintf("[%s]", genTypeName(v.Items.Schema.Type)), m[k]) - //schemas[name] += fmt.Sprintf("\t%s: [%s]\n", k, genTypeName(v.Items.Schema.Type)) - continue - } - - if v.Type == "object" { - if currDepth == 1 { - if k == "metadata" { - tVar += genFieldEntry(k, "Metadata! @goField(name: \"objectMeta\")", m[k]) - iVar += genFieldEntry(k, "MetadataIn! @goField(name: \"objectMeta\")", m[k]) - continue - } - - if k == "status" { - tVar += genFieldEntry(k, "Status", m[k]) - // INFO: removed as status is never going to be set via GraphQL - //iVar += genFieldEntry(k, "StatusIn", m[k]) - continue - } - - if k == "overrides" { - tVar += genFieldEntry(k, "Overrides", m[k]) - iVar += genFieldEntry(k, "OverridesIn", m[k]) - continue - } - - if !hasAddedSyncStatus { - // TODO: added a custom sync status for everything k8s related - tVar += genFieldEntry("syncStatus", "SyncStatus", false) - hasAddedSyncStatus = true - } - } - - if len(v.Properties) == 0 { - tVar += genFieldEntry(k, "Map", m[k]) - iVar += genFieldEntry(k, "Map", m[k]) - continue - } - - tVar += genFieldEntry(k, typeName+genTypeName(k), m[k]) - iVar += genFieldEntry(k, typeName+genTypeName(k)+"In", m[k]) - //schemas[name] += fmt.Sprintf("\t%s: %s!\n", k, typeName+genTypeName(k)) - navigateTree(&v, typeName+genTypeName(k), schemas, currDepth+1) - continue - } - - tVar += genFieldEntry(k, gqlTypeMap(v.Type), m[k]) - iVar += genFieldEntry(k, gqlTypeMap(v.Type), m[k]) - } - tVar += "}" - iVar += "}" - - schemas[name] = tVar - schemas["input-"+name] = iVar -} - -func ScalarTypes() ([]byte, error) { - scalars := ` -scalar Any -scalar Json -scalar Map -scalar Date -` - - metadata := ` -type Metadata @shareable { - name: String! - namespace: String - labels: Json - annotations: Json - creationTimestamp: Date! - deletionTimestamp: Date - generation: Int! -} - -input MetadataIn { - name: String! - namespace: String - labels: Json - annotations: Json -} -` - - status := ` -type Status @shareable { - isReady: Boolean! - checks: Map - displayVars: Json -} - -type Check @shareable { - status: Boolean - message: String - generation: Int -} -` - - overrides := ` -type Patch @shareable { - op: String! - path: String! - value: Any -} - -type Overrides @shareable{ - applied: Boolean - patches: [Patch!] -} - -input PatchIn { - op: String! - path: String! - value: Any -} - -input OverridesIn{ - patches: [PatchIn!] -} -` - - syncStatus := ` -enum SyncAction { - APPLY - DELETE -} - -enum SyncState { - IDLE - IN_PROGRESS - READY - NOT_READY -} - -type SyncStatus @shareable{ - syncScheduledAt: Date! - lastSyncedAt: Date - action: SyncAction! - generation: Int! - state: SyncState! - error: String -} -` - - b := bytes.NewBuffer(nil) - b.WriteString(scalars) - b.WriteString(metadata) - b.WriteString(status) - b.WriteString(overrides) - b.WriteString(syncStatus) - - return b.Bytes(), nil -} - -func Directives() ([]byte, error) { - directives := ` -extend schema @link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@key", "@shareable"]) - -directive @goField( - forceResolver: Boolean - name: String -) on INPUT_FIELD_DEFINITION | FIELD_DEFINITION -` - return []byte(directives), nil -} - -func Convert(schema *v1.JSONSchemaProps, name string) ([]byte, error) { - schemas := map[string]string{} - navigateTree(schema, name, schemas) - b := bytes.NewBuffer(nil) - //b.WriteString("scalar Any\n") - for s := range schemas { - b.WriteString(schemas[s]) - b.WriteString("\n\n") - } - return b.Bytes(), nil -} diff --git a/cmd/crd-to-gql/main.go b/cmd/crd-to-gql/main.go deleted file mode 100644 index 0f458dfc5..000000000 --- a/cmd/crd-to-gql/main.go +++ /dev/null @@ -1,107 +0,0 @@ -package main - -import ( - "context" - "flag" - "fmt" - "golang.org/x/sync/errgroup" - "k8s.io/client-go/rest" - "kloudlite.io/pkg/k8s" - "os" - "path" - "strings" -) - -type arrayFlags []string - -func (i *arrayFlags) String() string { - return "" -} - -func (i *arrayFlags) Set(value string) error { - *i = append(*i, value) - return nil -} - -func main() { - var isDev bool - var outputDir string - var crds arrayFlags - - flag.BoolVar(&isDev, "dev", false, "--dev") - flag.StringVar(&outputDir, "output", "./", "--outputDir ") - - flag.Var(&crds, "crd", "--crd item1 --crd item2") - flag.Parse() - - kCli, err := func() (k8s.ExtendedK8sClient, error) { - if isDev { - return k8s.NewExtendedK8sClient(&rest.Config{Host: "localhost:8080"}) - } - config, err := rest.InClusterConfig() - if err != nil { - return nil, err - } - return k8s.NewExtendedK8sClient(config) - }() - - if err != nil { - panic(err) - } - - crdsMap := make(map[string]string, len(crds)) - - for i := range crds { - sp := strings.Split(crds[i], "=") - crdsMap[sp[0]] = sp[1] - } - - // crdsMap := map[string]string{ - // "CloudProvider": "cloudproviders.infra.kloudlite.io", - // "Edge": "edges.infra.kloudlite.io", - // "NodePool": "nodepools.infra.kloudlite.io", - // "WorkerNode": "workernodes.infra.kloudlite.io", - // "Cluster": "clusters.cmgr.kloudlite.io", - // "MasterNode": "masternodes.cmgr.kloudlite.io", - // } - - g, ctx := errgroup.WithContext(context.TODO()) - for k := range crdsMap { - x := k - g.Go(func() error { - schema, err := kCli.GetCRDJsonSchema(ctx, crdsMap[x]) - if err != nil { - return err - } - - fmt.Println("calling Convert(", x, ")") - gqlSchema, err := Convert(schema, x) - if err != nil { - return err - } - return os.WriteFile(path.Join(outputDir, strings.ToLower(x)+".graphqls"), gqlSchema, 0644) - }) - } - - g.Go(func() error { - gqlSchema, err := ScalarTypes() - if err != nil { - return err - } - return os.WriteFile(path.Join(outputDir, "scalars.graphqls"), gqlSchema, 0644) - }) - - g.Go(func() error { - gqlSchema, err := Directives() - if err != nil { - return err - } - return os.WriteFile(path.Join(outputDir, "directives.graphqls"), gqlSchema, 0644) - }) - - if err := g.Wait(); err != nil { - panic(err) - } - - fmt.Println("completed ...") -} diff --git a/cmd/mocki/Taskfile.yml b/cmd/mocki/Taskfile.yml new file mode 100644 index 000000000..712457faf --- /dev/null +++ b/cmd/mocki/Taskfile.yml @@ -0,0 +1,27 @@ +version: 3 + +tasks: + install: + dir: ../.. + cmds: + - mkdir -p bin + - go build -o ./bin/mocki ./cmd/mocki + - ln -sf $PWD/bin/mocki ~/.local/bin/mocki + + build: + cmds: + - go build -ldflags="-s -w" -o bin/mocki . + + example: + cmds: + - mkdir -p internal/example-types/mocks + - go run ./main.go --package kloudlite.io/cmd/mocki/internal/example-types --interface Sample > internal/example-types/mocks/sample.go + + test: + cmds: + - go test -v ./internal/parser + + coverage: + cmds: + - go test -v -coverprofile=/tmp/coverprofile.out ./internal/parser + - go tool cover -html=/tmp/coverprofile.out diff --git a/cmd/mocki/internal/example-types/mocks/sample.go b/cmd/mocki/internal/example-types/mocks/sample.go new file mode 100644 index 000000000..0004eb042 --- /dev/null +++ b/cmd/mocki/internal/example-types/mocks/sample.go @@ -0,0 +1,70 @@ +package mocks + +import ( + example_types "github.com/kloudlite/api/cmd/mocki/internal/example-types" + io2 "io" +) + +type SampleCallerInfo struct { + Args []any +} + +type Sample[T any, K any] struct { + Calls map[string][]SampleCallerInfo + MockAge func() int + MockName func() string + MockSetAndGetUser func(name string, age int, ex example_types.Example) *example_types.User + MockSetName func(name string) + MockSetUser func(name string, age int, ex example_types.Example, writer io2.Writer) +} + +func (m *Sample[T, K]) registerCall(funcName string, args ...any) { + if m.Calls == nil { + m.Calls = map[string][]SampleCallerInfo{} + } + m.Calls[funcName] = append(m.Calls[funcName], SampleCallerInfo{Args: args}) +} + +func (sMock *Sample[T, K]) Age() int { + if sMock.MockAge != nil { + sMock.registerCall("Age") + return sMock.MockAge() + } + panic("method 'Age' not implemented, yet") +} + +func (sMock *Sample[T, K]) Name() string { + if sMock.MockName != nil { + sMock.registerCall("Name") + return sMock.MockName() + } + panic("method 'Name' not implemented, yet") +} + +func (sMock *Sample[T, K]) SetAndGetUser(name string, age int, ex example_types.Example) *example_types.User { + if sMock.MockSetAndGetUser != nil { + sMock.registerCall("SetAndGetUser", name, age, ex) + return sMock.MockSetAndGetUser(name, age, ex) + } + panic("method 'SetAndGetUser' not implemented, yet") +} + +func (sMock *Sample[T, K]) SetName(name string) { + if sMock.MockSetName != nil { + sMock.registerCall("SetName", name) + sMock.MockSetName(name) + } + panic("method 'SetName' not implemented, yet") +} + +func (sMock *Sample[T, K]) SetUser(name string, age int, ex example_types.Example, writer io2.Writer) { + if sMock.MockSetUser != nil { + sMock.registerCall("SetUser", name, age, ex, writer) + sMock.MockSetUser(name, age, ex, writer) + } + panic("method 'SetUser' not implemented, yet") +} + +func NewSample[T any, K any]() *Sample[T, K] { + return &Sample[T, K]{} +} diff --git a/cmd/mocki/internal/example-types/types.go b/cmd/mocki/internal/example-types/types.go new file mode 100644 index 000000000..63e2d2d48 --- /dev/null +++ b/cmd/mocki/internal/example-types/types.go @@ -0,0 +1,27 @@ +package example_types + +import ( + io2 "io" +) + +type Example interface { + ex1() string + Ex2() string +} + +type User struct { + Name string +} + +type Sample[T any, K any] interface { + Name() string + Age() int + hello() string + SetName(name string) + SetUser(name string, age int, ex Example, writer io2.Writer) + //SetAndGetUser(name string, age int, ex kloudlite.io/cmd/interface-impl/types.Example) (*User, error) + SetAndGetUser(name string, age int, ex Example) *User + // SetAndGetUser2(name string, age int, ex Example) (user types2.Sample) + // SetAndGetUser3(name string, age int, ex Example, s1 T, s2 K) (user types2.Sample) + // Example +} diff --git a/cmd/mocki/internal/parser/parser.go b/cmd/mocki/internal/parser/parser.go new file mode 100644 index 000000000..24f754ed9 --- /dev/null +++ b/cmd/mocki/internal/parser/parser.go @@ -0,0 +1,392 @@ +package parser + +import ( + "bytes" + "fmt" + "go/types" + "strconv" + "strings" + "text/template" + + "github.com/Masterminds/sprig/v3" + "golang.org/x/tools/go/packages" +) + +type ImportInfo struct { + Alias string + PackagePath string +} + +type Parser struct { + pkgImports map[string]ImportInfo + Imports map[string]ImportInfo + counter int + charCounter int +} + +func NewParser() *Parser { + return &Parser{ + pkgImports: map[string]ImportInfo{}, + Imports: map[string]ImportInfo{}, + counter: 1, + charCounter: 97, + } +} + +type Info struct { + Imports map[string]ImportInfo + Implementations []string + MockFunctions []string + StructName string + ReceiverStructName string +} + +func (p *Parser) getCharVariable() string { + defer func() { p.charCounter++ }() + return fmt.Sprintf("k%c", p.charCounter) +} + +func (p *Parser) getCounter() int { + defer func() { p.counter++ }() + return p.counter +} + +func (p *Parser) ExtractGenericConstraints(t types.Type) ([]string, []string, error) { + named, ok := t.(*types.Named) + if !ok { + return nil, nil, fmt.Errorf("not a named type: %s", t.String()) + } + + tp := named.TypeParams() + + constraints := make([]string, 0, tp.Len()) + constraintVars := make([]string, 0, tp.Len()) + + for i := 0; i < tp.Len(); i++ { + constraint := tp.At(i).Obj().Name() + constraintVars = append(constraintVars, constraint) + + ct, err := p.TypeExtracter(tp.At(i).Constraint(), false) + if err != nil { + return nil, nil, err + } + + constraints = append(constraints, fmt.Sprintf("%s %s", constraint, ct)) + } + + return constraints, constraintVars, nil +} + +func (p *Parser) TypeExtracter(ut types.Type, variadic bool) (string, error) { + switch t := ut.(type) { + case *types.Named: + if t.Obj().Pkg() != nil { + pkgPath := t.Obj().Pkg().Path() + pkgName := t.Obj().Pkg().Name() + + alias := pkgName + + if _, ok := p.Imports[pkgPath]; !ok { + v, ok2 := p.pkgImports[pkgPath] + if ok2 { + if v.Alias != "" { + alias = v.Alias + } + } + + // pkgName = fmt.Sprintf("%s%d", pkgName, p.getCounter()) + p.Imports[pkgPath] = ImportInfo{PackagePath: pkgPath, Alias: alias} + } + + targs := make([]string, 0, t.TypeArgs().Len()) + for i := 0; i < t.TypeArgs().Len(); i++ { + ta, err := p.TypeExtracter(t.TypeArgs().At(i), false) + if err != nil { + return "", err + } + targs = append(targs, ta) + } + + if len(targs) > 0 { + return fmt.Sprintf("%s.%s[%s]", alias, t.Obj().Name(), strings.Join(targs, ", ")), nil + } + return fmt.Sprintf("%s.%s", alias, t.Obj().Name()), nil + } + + return t.Obj().Name(), nil + case *types.Pointer: + t2, err := p.TypeExtracter(t.Elem(), variadic) + if err != nil { + return "", err + } + return "*" + t2, nil + case *types.Slice: + t2, err := p.TypeExtracter(t.Elem(), variadic) + if err != nil { + return "", err + } + + if variadic && !strings.HasPrefix(t2, "...") { + return "..." + t2, nil + } + + if strings.HasPrefix(t2, "...") { + return "...[]" + strings.Replace(t2, "...", "", 1), nil + } + return "[]" + t2, nil + case *types.Map: + k, err := p.TypeExtracter(t.Elem(), false) + if err != nil { + return "", err + } + return fmt.Sprintf("map[%s]%s", t.Key(), k), nil + default: + return t.String(), nil + } +} + +func (p *Parser) ExtractResults(signature *types.Signature) ([]string, error) { + results := signature.Results() + res := make([]string, 0, results.Len()) + for i := 0; i < results.Len(); i++ { + // variadic is false, as result arguments cannot be variadic + t, err := p.TypeExtracter(results.At(i).Type(), false) + if err != nil { + return nil, err + } + res = append(res, t) + } + + return res, nil +} + +func (p *Parser) ExtractParameters(signature *types.Signature) ([]string, []string, error) { + // typeParams := signature.TypeParams() + params := signature.Params() + plist := make([]string, 0, params.Len()) + callVarsList := make([]string, 0, params.Len()) + + for i := 0; i < params.Len(); i++ { + pt := params.At(i) + x := pt.String() + + // because, only last element in parameter list, can be variadic + variadic := i == params.Len()-1 && signature.Variadic() + + _ = x + + t, err := p.TypeExtracter(pt.Type(), variadic) + if err != nil { + return nil, nil, err + } + + name := pt.Name() + + if name == "" { + name = p.getCharVariable() + } + + callVarsList = append(callVarsList, func() string { + if variadic { + return fmt.Sprintf("%s...", name) + } + return name + }()) + plist = append(plist, fmt.Sprintf("%s %s", name, t)) + } + + return plist, callVarsList, nil +} + +type ImplementationArgs struct { + ReceiverName string + StructName string + ReceiverStructName string + FunctionName string + FunctionParams string + FunctionReturns []string + FunctionCallArgs []string + MockFunctionName string +} + +func (args *ImplementationArgs) FormatReturnValues() string { + if len(args.FunctionReturns) == 0 { + return "" + } + + if len(args.FunctionReturns) == 1 { + return args.FunctionReturns[0] + } + + return fmt.Sprintf("(%s)", strings.Join(args.FunctionReturns, ", ")) +} + +func GenerateImplementation(args ImplementationArgs) (string, error) { + buff := new(bytes.Buffer) + tt := template.New("impl_gen") + tt.Funcs(sprig.TxtFuncMap()) + + if _, err := tt.Parse(`func ({{.ReceiverName}} *{{.ReceiverStructName}}) {{.FunctionName}}{{.FunctionParams}}{{- if .FunctionReturns }} {{.FunctionReturns}} {{- end}} { + if {{.ReceiverName}}.{{.MockFunctionName}} != nil { + {{.ReceiverName}}.registerCall("{{.FunctionName}}" {{- if .FunctionCallArgs}}, {{end}} {{- .FunctionCallArgs | join ", " | replace "..." "" }}) + {{if .FunctionReturns}}return {{end}}{{.ReceiverName}}.{{.MockFunctionName}}({{.FunctionCallArgs | join ", "}}) + } + panic("{{.ReceiverStructName}}: method '{{.FunctionName}}' not implemented, yet") +}`); err != nil { + return "", err + } + + if err := tt.ExecuteTemplate(buff, "impl_gen", map[string]any{ + "ReceiverName": args.ReceiverName, + "StructName": args.StructName, + "ReceiverStructName": args.ReceiverStructName, + "FunctionName": args.FunctionName, + "FunctionParams": args.FunctionParams, + "FunctionReturns": args.FormatReturnValues(), + "FunctionCallArgs": args.FunctionCallArgs, + "MockFunctionName": args.MockFunctionName, + }); err != nil { + return "", err + } + + return buff.String(), nil +} + +func extractPackageImports(pkg *packages.Package) (map[string]ImportInfo, error) { + imports := make(map[string]ImportInfo) + + for _, file := range pkg.Syntax { + for _, importSpec := range file.Imports { + pkgPath, err := strconv.Unquote(importSpec.Path.Value) + if err != nil { + return nil, err + } + importInfo := ImportInfo{PackagePath: pkgPath} + if importSpec.Name != nil && importSpec.Name.Name != "" { + importInfo.Alias = importSpec.Name.Name + } + if _, ok := imports[pkgPath]; !ok { + imports[pkgPath] = importInfo + } + } + } + + return imports, nil +} + +func findNamedType(packagePath string, interfaceName string) (types.Type, map[string]ImportInfo, error) { + cfg := &packages.Config{ + Mode: packages.NeedTypes | packages.NeedSyntax, + // Mode: packages.LoadSyntax, + } + + pkgs, err := packages.Load(cfg, packagePath) + if err != nil { + return nil, nil, err + } + + if len(pkgs) == 0 { + return nil, nil, fmt.Errorf("no packages were loaded") + } + + for _, pkg := range pkgs { + pkgImports, err := extractPackageImports(pkg) + if err != nil { + return nil, nil, err + } + + scope := pkg.Types.Scope() + obj := scope.Lookup(interfaceName) + + if obj == nil { + continue + } + + return obj.Type(), pkgImports, nil + } + + return nil, nil, fmt.Errorf("could not find named type %q in package path %q", interfaceName, packagePath) +} + +func (p *Parser) FindAndParseInterface(packagePath string, interfaceName string) (*Info, error) { + info := Info{} + + namedType, pkgImports, err := findNamedType(packagePath, interfaceName) + if err != nil { + return nil, err + } + + interfaceType, ok := namedType.Underlying().(*types.Interface) + if !ok { + return nil, fmt.Errorf("not an interface: %s", interfaceName) + } + + p.pkgImports = pkgImports + + genericConstraints, constraintVars, err := p.ExtractGenericConstraints(namedType) + if err != nil { + return nil, err + } + + info.StructName = interfaceName + if len(genericConstraints) > 0 { + info.StructName = info.StructName + "[" + strings.Join(genericConstraints, ", ") + "]" + } + + receiverName := fmt.Sprintf("%sMock", strings.ToLower(string(info.StructName[0]))) + info.ReceiverStructName = interfaceName + + // can be of format: Sample, Sample[T any, K any] etc. + if len(constraintVars) > 0 { + info.ReceiverStructName = fmt.Sprintf("%s[%s]", interfaceName, strings.Join(constraintVars, ", ")) + } + + for i := 0; i < interfaceType.NumMethods(); i++ { + method := interfaceType.Method(i) + if !method.Exported() { + continue + } + + signature, ok := method.Type().(*types.Signature) + if !ok { + return nil, fmt.Errorf("not a signature type: %s", method.Type().String()) + } + + parameters, paramCallArgs, err := p.ExtractParameters(signature) + if err != nil { + return nil, err + } + + results, err := p.ExtractResults(signature) + if err != nil { + return nil, err + } + + iArgs := ImplementationArgs{ + ReceiverName: receiverName, + StructName: info.StructName, + ReceiverStructName: info.ReceiverStructName, + FunctionName: method.Name(), + FunctionParams: fmt.Sprintf("(%s)", strings.Join(parameters, ", ")), + FunctionReturns: results, + FunctionCallArgs: paramCallArgs, + MockFunctionName: fmt.Sprintf("Mock%s", method.Name()), + } + + implementation, err := GenerateImplementation(iArgs) + if err != nil { + return nil, err + } + + info.Implementations = append(info.Implementations, implementation) + info.MockFunctions = append(info.MockFunctions, func() string { + if iArgs.FormatReturnValues() == "" { + return fmt.Sprintf("%s func%s", "Mock"+method.Name(), iArgs.FunctionParams) + } + return fmt.Sprintf("%s func%s %s", "Mock"+method.Name(), iArgs.FunctionParams, iArgs.FormatReturnValues()) + }()) + } + + info.Imports = p.Imports + return &info, nil +} diff --git a/cmd/mocki/internal/parser/parser_test.go b/cmd/mocki/internal/parser/parser_test.go new file mode 100644 index 000000000..08abe9ed9 --- /dev/null +++ b/cmd/mocki/internal/parser/parser_test.go @@ -0,0 +1,263 @@ +package parser_test + +import ( + "strings" + "testing" + + "github.com/google/go-cmp/cmp" + parser "github.com/kloudlite/api/cmd/mocki/internal/parser" +) + +func TestFindAndParseInterface(t *testing.T) { + type args struct { + packagePath string + interfaceName string + } + tests := []struct { + name string + args args + want *parser.Info + wantErr bool + }{ + { + name: "test 1: normal interface", + args: args{ + packagePath: "kloudlite.io/cmd/mocki/internal/parser/test_data", + interfaceName: "Type1", + }, + want: &parser.Info{ + Imports: map[string]parser.ImportInfo{}, + Implementations: []string{ + `func (tMock *Type1) Method1() string { + if tMock.MockMethod1 != nil { + tMock.registerCall("Method1") + return tMock.MockMethod1() + } + panic("Type1: method 'Method1' not implemented, yet") +}`, + }, + MockFunctions: []string{ + `MockMethod1 func() string`, + }, + StructName: "Type1", + ReceiverStructName: "Type1", + }, + wantErr: false, + }, + { + name: "test 2: generic interface, with any constraint", + args: args{ + packagePath: "kloudlite.io/cmd/mocki/internal/parser/test_data", + interfaceName: "Type2", + }, + want: &parser.Info{ + Imports: map[string]parser.ImportInfo{ + "kloudlite.io/cmd/mocki/internal/parser/test_data": { + Alias: "test_data", + PackagePath: "kloudlite.io/cmd/mocki/internal/parser/test_data", + }, + "kloudlite.io/pkg/repos": { + Alias: "repos", + PackagePath: "kloudlite.io/pkg/repos", + }, + }, + Implementations: []string{ + `func (tMock *Type2[T]) Method1() T { + if tMock.MockMethod1 != nil { + tMock.registerCall("Method1") + return tMock.MockMethod1() + } + panic("Type2[T]: method 'Method1' not implemented, yet") +}`, + + `func (tMock *Type2[T]) Method2(x int, y ...[]byte) string { + if tMock.MockMethod2 != nil { + tMock.registerCall("Method2", x, y) + return tMock.MockMethod2(x, y...) + } + panic("Type2[T]: method 'Method2' not implemented, yet") +}`, + + `func (tMock *Type2[T]) Method3(x int, y *int, z T, p *repos.DbRepo[test_data.X], q map[string]test_data.X, r *test_data.X, s []int, u ...test_data.X) string { + if tMock.MockMethod3 != nil { + tMock.registerCall("Method3", x, y, z, p, q, r, s, u) + return tMock.MockMethod3(x, y, z, p, q, r, s, u...) + } + panic("Type2[T]: method 'Method3' not implemented, yet") +}`, + }, + MockFunctions: []string{ + `MockMethod1 func() T`, + `MockMethod2 func(x int, y ...[]byte) string`, + `MockMethod3 func(x int, y *int, z T, p *repos.DbRepo[test_data.X], q map[string]test_data.X, r *test_data.X, s []int, u ...test_data.X) string`, + }, + StructName: "Type2[T any]", + ReceiverStructName: "Type2[T]", + }, + wantErr: false, + }, + { + name: "test 3: generic interface with another interface as constraint", + args: args{ + packagePath: "kloudlite.io/cmd/mocki/internal/parser/test_data", + interfaceName: "Type3", + }, + want: &parser.Info{ + Imports: map[string]parser.ImportInfo{ + "kloudlite.io/cmd/mocki/internal/parser/test_data": { + Alias: "test_data", + PackagePath: "kloudlite.io/cmd/mocki/internal/parser/test_data", + }, + }, + Implementations: []string{ + `func (tMock *Type3[T]) Method1() T { + if tMock.MockMethod1 != nil { + tMock.registerCall("Method1") + return tMock.MockMethod1() + } + panic("Type3[T]: method 'Method1' not implemented, yet") +}`, + }, + MockFunctions: []string{ + `MockMethod1 func() T`, + }, + StructName: "Type3[T test_data.Entity]", + ReceiverStructName: "Type3[T]", + }, + wantErr: false, + }, + { + name: "test 4: normal interface with methods having no named arguments", + args: args{ + packagePath: "kloudlite.io/cmd/mocki/internal/parser/test_data", + interfaceName: "Type4", + }, + want: &parser.Info{ + Imports: map[string]parser.ImportInfo{ + "context": { + Alias: "context", + PackagePath: "context", + }, + }, + Implementations: []string{ + `func (tMock *Type4) Method1(ka context.Context, kb int) string { + if tMock.MockMethod1 != nil { + tMock.registerCall("Method1", ka, kb) + return tMock.MockMethod1(ka, kb) + } + panic("Type4: method 'Method1' not implemented, yet") +}`, + }, + MockFunctions: []string{ + `MockMethod1 func(ka context.Context, kb int) string`, + }, + StructName: "Type4", + ReceiverStructName: "Type4", + }, + wantErr: false, + }, + { + name: "test 5: interface with methods having no return values", + args: args{ + packagePath: "kloudlite.io/cmd/mocki/internal/parser/test_data", + interfaceName: "Type5", + }, + want: &parser.Info{ + Imports: map[string]parser.ImportInfo{}, + Implementations: []string{ + `func (tMock *Type5) Method1() { + if tMock.MockMethod1 != nil { + tMock.registerCall("Method1") + tMock.MockMethod1() + } + panic("Type5: method 'Method1' not implemented, yet") +}`, + + `func (tMock *Type5) Method2(x int) { + if tMock.MockMethod2 != nil { + tMock.registerCall("Method2", x) + tMock.MockMethod2(x) + } + panic("Type5: method 'Method2' not implemented, yet") +}`, + }, + MockFunctions: []string{ + `MockMethod1 func()`, + `MockMethod2 func(x int)`, + }, + StructName: "Type5", + ReceiverStructName: "Type5", + }, + wantErr: false, + }, + + { + name: "test 6: interface with methods having aliases imported types", + args: args{ + packagePath: "kloudlite.io/cmd/mocki/internal/parser/test_data", + interfaceName: "Type6", + }, + want: &parser.Info{ + Imports: map[string]parser.ImportInfo{ + "io": { + Alias: "io2", + PackagePath: "io", + }, + }, + Implementations: []string{ + `func (tMock *Type6) Method1(writer io2.Writer) { + if tMock.MockMethod1 != nil { + tMock.registerCall("Method1", writer) + tMock.MockMethod1(writer) + } + panic("Type6: method 'Method1' not implemented, yet") +}`, + }, + MockFunctions: []string{ + `MockMethod1 func(writer io2.Writer)`, + }, + StructName: "Type6", + ReceiverStructName: "Type6", + }, + wantErr: false, + }, + + { + name: "test 7: non existent interface, should throw error", + args: args{ + packagePath: "kloudlite.io/cmd/mocki/internal/parser/test_data", + interfaceName: "DoesNotExist", + }, + want: &parser.Info{ + Imports: map[string]parser.ImportInfo{}, + }, + wantErr: true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + p := parser.NewParser() + got, err := p.FindAndParseInterface(tt.args.packagePath, tt.args.interfaceName) + if err != nil { + if !tt.wantErr { + t.Errorf("FindAndParseInterface() error = %v, wantErr %v", err, tt.wantErr) + return + } + return + } + + for i := range tt.want.Implementations { + tt.want.Implementations[i] = strings.Replace(tt.want.Implementations[i], "\n", " ", -1) + } + + for i := range got.Implementations { + got.Implementations[i] = strings.Replace(got.Implementations[i], "\n", " ", -1) + } + + if !cmp.Equal(got, tt.want) { + t.Errorf("FindAndParseInterface(), got=\n%s\n\nwant:\n%s\n", got, tt.want) + } + }) + } +} diff --git a/cmd/mocki/internal/parser/test_data/types.go b/cmd/mocki/internal/parser/test_data/types.go new file mode 100644 index 000000000..9bce15a67 --- /dev/null +++ b/cmd/mocki/internal/parser/test_data/types.go @@ -0,0 +1,46 @@ +package test_data + +import ( + "context" + io2 "io" + + "github.com/kloudlite/api/pkg/repos" +) + +type Type1 interface { + Method1() string +} + +//type DbRepo[T Entity] interface { +// NewId() int +//} + +type X struct { + *repos.BaseEntity +} + +type Type2[T any] interface { + Method1() T + Method2(x int, y ...[]byte) string + Method3(x int, y *int, z T, p *repos.DbRepo[X], q map[string]X, r *X, s []int, u ...X) string + // Method2(x int, y *int, z T, p *repos.DbRepo[X], q X, r *X, s []int, t []*X, u ...X) (int, string, *int, T, *repos.DbRepo[X], X, *X) +} + +type Entity interface{} + +type Type3[T Entity] interface { + Method1() T +} + +type Type4 interface { + Method1(context.Context, int) string +} + +type Type5 interface { + Method1() + Method2(x int) +} + +type Type6 interface { + Method1(writer io2.Writer) +} diff --git a/cmd/mocki/main.go b/cmd/mocki/main.go new file mode 100644 index 000000000..935393ae8 --- /dev/null +++ b/cmd/mocki/main.go @@ -0,0 +1,106 @@ +package main + +import ( + "bytes" + "flag" + "fmt" + "go/format" + "log" + "os" + "text/template" + + "github.com/kloudlite/api/cmd/mocki/internal/parser" + + "github.com/Masterminds/sprig/v3" +) + +func main() { + var interfaceName string + + var packagePath string + flag.StringVar(&interfaceName, "interface", "", "--interface ") + flag.StringVar(&packagePath, "package", "", "--package ") + flag.Parse() + + if interfaceName == "" || packagePath == "" { + fmt.Println("Invalid values for flags") + flag.Usage() + os.Exit(1) + } + + p := parser.NewParser() + + info, err := p.FindAndParseInterface(packagePath, interfaceName) + if err != nil { + log.Fatal(err) + } + + t := template.New("code_gen") + t.Funcs(sprig.TxtFuncMap()) + + _, err =t.Parse(`package {{ .Package }} + +import ( + {{- range .Imports }} + {{.}} + {{- end }} +) + +type {{.InterfaceName}}CallerInfo struct { + Args []any +} + +type {{.StructName}} struct { + Calls map[string][]{{.InterfaceName}}CallerInfo + {{- range .MockFunctions }} + {{ . }} + {{- end }} +} + +func (m *{{.ReceiverStructName}}) registerCall(funcName string, args ...any) { + if m.Calls == nil { + m.Calls = map[string][]{{.InterfaceName}}CallerInfo{} + } + m.Calls[funcName] = append(m.Calls[funcName], {{.InterfaceName}}CallerInfo{Args: args}) +} + +{{- "\n" }} +{{- range .Implementations }} +{{ . }} +{{- "\n" }} +{{- end }} + +func New{{.StructName}}() *{{.ReceiverStructName}} { + return &{{.ReceiverStructName}}{} +} +`) + if err != nil { + log.Fatal(err) + } + + imports := make([]string, 0, len(info.Imports)) + for _, v := range info.Imports { + imports = append(imports, fmt.Sprintf("%s %q", v.Alias, v.PackagePath)) + } + + buff := new(bytes.Buffer) + if err := t.ExecuteTemplate(buff, "code_gen", map[string]any{ + "Package": "mocks", + "Implementations": info.Implementations, + "StructName": info.StructName, + "ReceiverStructName": info.ReceiverStructName, + "InterfaceName": interfaceName, + "MockFunctions": info.MockFunctions, + "Imports": imports, + }); err != nil { + log.Fatal(err) + } + + source, err := format.Source(buff.Bytes()) + if err != nil { + log.Println("error formatting source:") + log.Println(buff.String()) + log.Fatal(err) + } + fmt.Fprintf(os.Stdout, "%s", source) +} diff --git a/cmd/struct-json-path/Taskfile.yml b/cmd/struct-json-path/Taskfile.yml new file mode 100644 index 000000000..63f9a6b31 --- /dev/null +++ b/cmd/struct-json-path/Taskfile.yml @@ -0,0 +1,14 @@ +version: 3 + +tasks: + run: + cmds: + - go run . --struct github.com/kloudlite/api/cmd/struct-json-path/test_data.Sample --out /tmp/struct-json-path.go + build: + cmds: + - go build -o /tmp/struct-jp . + + coverage: + cmds: + - go-test-cover.sh ./... + diff --git a/cmd/struct-json-path/ast-parser/main.go b/cmd/struct-json-path/ast-parser/main.go new file mode 100644 index 000000000..c977cac1d --- /dev/null +++ b/cmd/struct-json-path/ast-parser/main.go @@ -0,0 +1,87 @@ +package ast_parser + +import ( + "fmt" + "go/types" + "golang.org/x/tools/go/packages" +) + +type Parser struct { + cfg *packages.Config +} + +func (p *Parser) FindStruct(pkgPath string, structName string) (*types.Struct, error) { + pkgs, err := packages.Load(p.cfg, pkgPath) + if err != nil { + return nil, err + } + + if len(pkgs) == 0 { + return nil, fmt.Errorf("no packages were loaded") + } + + for _, pkg := range pkgs { + scope := pkg.Types.Scope() + + obj := scope.Lookup(structName) + if obj == nil { + continue + } + + structObj, ok := obj.Type().Underlying().(*types.Struct) + if !ok { + return nil, fmt.Errorf("not a struct type") + } + + return structObj, nil + } + + return nil, fmt.Errorf("not found") +} + +type Struct struct { + Name string + *types.Struct +} + +func (p *Parser) FindAllStructs(pkgPath string) ([]Struct, error) { + pkgs, err := packages.Load(p.cfg, pkgPath) + if err != nil { + return nil, err + } + + if len(pkgs) == 0 { + return nil, fmt.Errorf("no packages were loaded") + } + + var structObjs []Struct + + for _, pkg := range pkgs { + scope := pkg.Types.Scope() + + for _, name := range scope.Names() { + obj := scope.Lookup(name) + structObj, ok := obj.Type().Underlying().(*types.Struct) + if !ok { + continue + } + + structObjs = append(structObjs, Struct{ + Name: name, + Struct: structObj, + }) + } + } + + return structObjs, nil +} + +func NewASTParser() *Parser { + cfg := &packages.Config{ + Mode: packages.NeedTypes | packages.NeedSyntax, + } + + return &Parser{ + cfg: cfg, + } +} diff --git a/cmd/struct-json-path/main.go b/cmd/struct-json-path/main.go new file mode 100644 index 000000000..6717ce9f1 --- /dev/null +++ b/cmd/struct-json-path/main.go @@ -0,0 +1,342 @@ +package main + +import ( + "bytes" + "fmt" + "go/format" + "go/types" + "io" + "log" + "os" + "sort" + "strings" + + ast_parser "github.com/kloudlite/api/cmd/struct-json-path/ast-parser" + + fn "github.com/kloudlite/api/pkg/functions" + flag "github.com/spf13/pflag" +) + +const ( + StructJsonpathKey = "struct-json-path" + IgnoreTagValue = "ignore" + IgnoreNestingTagValue = "ignore-nesting" +) + +type Tag struct { + Value string + Params map[string]struct{} +} + +func extractTag(tagstr string) map[string]Tag { + tags := strings.Split(tagstr, " ") + m := make(map[string]Tag, len(tags)) + for i := range tags { + sp := strings.SplitN(tags[i], ":", 2) + if len(sp) != 2 { + continue + } + + tagparams := strings.Split(sp[1][1:len(sp[1])-1], ",") + + tag := Tag{Value: tagparams[0], Params: map[string]struct{}{}} + for i := 1; i < len(tagparams); i++ { + tag.Params[tagparams[i]] = struct{}{} + } + + m[sp[0]] = tag + } + + return m +} + +func flattenChildKeys(child map[string][]string) []string { + keys := make([]string, 0, len(child)*2) + m := make(map[string]struct{}) + for key, values := range child { + if key != "" { + keys = append(keys, key) + } + for _, name := range values { + if _, ok := m[name]; ok { + continue + } + nameref := fmt.Sprintf("%s.%s", key, name) + if key == "" { + nameref = name + } + keys = append(keys, nameref) + } + } + return keys +} + +func mergeUniqueKeys(keys1 []string, keys2 []string) []string { + m := make(map[string]struct{}) + for _, v := range keys1 { + m[v] = struct{}{} + } + + for _, v := range keys2 { + m[v] = struct{}{} + } + + keys := make([]string, 0, len(m)) + for k := range m { + keys = append(keys, k) + } + + return keys +} + +func filterCommonPaths(keys []string, commonPaths []string) (commonKeys []string, others []string) { + for i := range keys { + hasFound := false + + for k := range commonPaths { + if strings.HasPrefix(keys[i], commonPaths[k]) { + hasFound = true + commonKeys = append(commonKeys, keys[i]) + break + } + } + + if !hasFound { + others = append(others, keys[i]) + } + } + + return commonKeys, others +} + +func extractEmbeddedStruct(field *types.Var) (*types.Struct, bool) { + if es, ok := field.Type().Underlying().(*types.Struct); ok { + return es, true + } + + if tp, ok := field.Type().Underlying().(*types.Pointer); ok { + if es, ok := tp.Elem().Underlying().(*types.Struct); ok { + return es, true + } + } + + return nil, false +} + +func getFieldPackagePath(field *types.Var) (string, bool) { + if origin, ok := field.Origin().Type().(*types.Named); ok { + pkgName := origin.Obj().Pkg().Path() + typeName := origin.Obj().Name() + + pkgPath := fmt.Sprintf("%s.%s", pkgName, typeName) + if pkgName == "" { + pkgPath = typeName + } + + return pkgPath, true + } + + if tp, ok := field.Origin().Type().(*types.Pointer); ok { + if named, ok := tp.Elem().(*types.Named); ok { + pkgName := named.Obj().Pkg().Path() + typeName := named.Obj().Name() + + pkgPath := fmt.Sprintf("%s.%s", pkgName, typeName) + if pkgName == "" { + pkgPath = typeName + } + + return pkgPath, true + } + } + + return "", false +} + +func traverseStruct(s *types.Struct, ignoreNestingForPkgs map[string]struct{}) map[string][]string { + paths := make(map[string][]string) + + ignoredNesting := make(map[string]struct{}, len(ignoreNestingForPkgs)) + for k, v := range ignoreNestingForPkgs { + ignoredNesting[k] = v + } + + for i := 0; i < s.NumFields(); i++ { + field := s.Field(i) + fieldName := field.Name() + + tags := extractTag(s.Tag(i)) + jsonTag, ok := tags["json"] + if ok { + fieldName = jsonTag.Value + } + + if strings.TrimSpace(jsonTag.Value) == "-" { + // ignore this field, as this does not convert into a json field + continue + } + + if _, ok := jsonTag.Params["inline"]; ok { + fieldName = "" + } + + if structToJsonpathTag, ok := tags[StructJsonpathKey]; ok { + if _, ignore := structToJsonpathTag.Params[IgnoreTagValue]; ignore { + continue + } + + if _, ok := structToJsonpathTag.Params[IgnoreNestingTagValue]; ok { + if pkgPath, ok := getFieldPackagePath(field); ok { + ignoredNesting[pkgPath] = struct{}{} + } + } + } + + if paths[fieldName] == nil { + paths[fieldName] = []string{} + } + + if pkgPath, ok := getFieldPackagePath(field); ok { + if _, ok := ignoredNesting[pkgPath]; ok { + continue + } + } + + if es, ok := extractEmbeddedStruct(field); ok { + childKeys := flattenChildKeys(traverseStruct(es, ignoreNestingForPkgs)) + paths[fieldName] = mergeUniqueKeys(childKeys, paths[fieldName]) + } + } + + return paths +} + +func generateVariableName(value string) string { + splits := strings.Split(value, "") + result := make([]string, 0, len(splits)) + result = append(result, strings.ToUpper(splits[0])) + for prev, curr := 0, 1; curr < len(value); prev, curr = prev+1, curr+1 { + v := splits[curr] + + if splits[curr] == "." || splits[curr] == "_" { + continue + } + + if splits[prev] == "." || splits[prev] == "_" { + v = strings.ToUpper(v) + } + result = append(result, v) + } + + return strings.Join(result, "") +} + +func genVariables(out io.Writer, structName string, jsonPaths []string) { + fmt.Fprintf(out, ` +// constant vars generated for struct %s +const ( +`, structName) + + sort.Strings(jsonPaths) + for i := range jsonPaths { + varName := structName + "." + jsonPaths[i] + if structName == "" { + varName = jsonPaths[i] + } + fmt.Fprintf(out, "%s = %q\n", generateVariableName(varName), jsonPaths[i]) + } + + fmt.Fprintf(out, ")") +} + +func main() { + var structPaths []string + var pkg string + var outFile string + var banner string + var ignoreNestingForPkgs []string + + var commonPaths []string + + flag.StringSliceVar(&structPaths, "struct", nil, "--struct .") + flag.StringVar(&pkg, "pkg", "", "--pkg ") + flag.StringVar(&outFile, "out-file", "", "--out-file") + flag.StringVar(&banner, "banner", "", "--banner") + flag.StringSliceVar(&ignoreNestingForPkgs, "ignore-nesting", nil, "--ignore-nesting") + flag.StringSliceVar(&commonPaths, "common-path", nil, "--common-path") + flag.Parse() + + nestingIgnored := make(map[string]struct{}) + for i := range ignoreNestingForPkgs { + nestingIgnored[ignoreNestingForPkgs[i]] = struct{}{} + } + + parser := ast_parser.NewASTParser() + + buff := new(bytes.Buffer) + buff.WriteString(fmt.Sprintf(` +// DO NOT EDIT. generated by "github.com/kloudlite/api/cmd/struct-json-path" + +%s +`, banner)) + + globalCommonKeys := make(map[string]struct{}) + + for i := range structPaths { + sp := strings.SplitN(fn.StringReverse(structPaths[i]), ".", 2) + if len(sp) != 2 { + panic("invalid struct path") + } + + structName, pkgPath := fn.StringReverse(sp[0]), fn.StringReverse(sp[1]) + + structObj, err := parser.FindStruct(pkgPath, structName) + if err != nil { + panic(err) + } + + m := traverseStruct(structObj, nestingIgnored) + commonKeys, others := filterCommonPaths(flattenChildKeys(m), commonPaths) + for _, k := range commonKeys { + globalCommonKeys[k] = struct{}{} + } + genVariables(buff, structName, others) + } + + if pkg != "" { + structObjs, err := parser.FindAllStructs(pkg) + if err != nil { + panic(err) + } + + for i := range structObjs { + m := traverseStruct(structObjs[i].Struct, nestingIgnored) + commonKeys, others := filterCommonPaths(flattenChildKeys(m), commonPaths) + for _, k := range commonKeys { + globalCommonKeys[k] = struct{}{} + } + genVariables(buff, structObjs[i].Name, others) + } + } + + commonKeys := make([]string, 0, len(globalCommonKeys)) + for k := range globalCommonKeys { + commonKeys = append(commonKeys, k) + } + + genVariables(buff, "", commonKeys) + + source, err := format.Source(buff.Bytes()) + if err != nil { + log.Println("error formatting source:") + log.Println(buff.String()) + log.Fatal(err) + } + + file, err := os.Create(outFile) + if err != nil { + panic(err) + } + defer file.Close() + fmt.Fprintf(file, "%s", source) +} diff --git a/cmd/struct-json-path/main_test.go b/cmd/struct-json-path/main_test.go new file mode 100644 index 000000000..ddc45d346 --- /dev/null +++ b/cmd/struct-json-path/main_test.go @@ -0,0 +1,242 @@ +package main + +import ( + ast_parser "github.com/kloudlite/api/cmd/struct-json-path/ast-parser" + "github.com/kloudlite/api/cmd/struct-json-path/test_data" + "reflect" + "sort" + "testing" +) + +func Test_extractTag(t *testing.T) { + type args struct { + tagstr string + } + tests := []struct { + name string + args args + want map[string]Tag + }{ + { + name: "1. json tag with name", + args: args{tagstr: `json:"hello"`}, + want: map[string]Tag{ + "json": {Value: "hello", Params: map[string]struct{}{}}, + }, + }, + + { + name: "2. json tag with name and inline", + args: args{tagstr: `json:"hello,inline"`}, + want: map[string]Tag{ + "json": {Value: "hello", Params: map[string]struct{}{"inline": {}}}, + }, + }, + + { + name: "3. json tag with empty name but inline", + args: args{tagstr: `json:",inline"`}, + want: map[string]Tag{ + "json": {Value: "", Params: map[string]struct{}{"inline": {}}}, + }, + }, + + { + name: "3. json tag with empty value", + args: args{tagstr: `json:""`}, + want: map[string]Tag{ + "json": {Value: "", Params: map[string]struct{}{}}, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := extractTag(tt.args.tagstr); !reflect.DeepEqual(got, tt.want) { + t.Errorf("extractTag() = %v, want %v", got, tt.want) + } + }) + } +} + +func Test_flattenChildKeys(t *testing.T) { + type args struct { + child map[string][]string + } + tests := []struct { + name string + args args + want []string + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := flattenChildKeys(tt.args.child); !reflect.DeepEqual(got, tt.want) { + t.Errorf("flattenChildKeys() = %v, want %v", got, tt.want) + } + }) + } +} + +func Test_traverseStruct(t *testing.T) { + type args struct { + pkgPath string + structName string + ignoreNesting map[string]struct{} + } + tests := []struct { + name string + args args + want map[string][]string + }{ + // TODO: Add test cases. + { + name: "1. struct with fields with no json tag", + args: args{ + pkgPath: test_data.PkgPath, + structName: test_data.Test1Input, + }, + want: test_data.Test1Output, + }, + { + name: "2. struct with fields with json tag, with value", + args: args{ + pkgPath: test_data.PkgPath, + structName: test_data.Test2Input, + }, + want: test_data.Test2Output, + }, + { + name: "3. struct with fields with both a json tag, and without json tag", + args: args{ + pkgPath: test_data.PkgPath, + structName: test_data.Test3Input, + }, + want: test_data.Test3Output, + }, + { + name: "4. struct with an embedded struct, without json tag", + args: args{ + pkgPath: test_data.PkgPath, + structName: test_data.Test4Input, + }, + want: test_data.Test4Output, + }, + { + name: "5. struct with an embedded struct, with one without a tag, and other one with a json tag value", + args: args{ + pkgPath: test_data.PkgPath, + structName: test_data.Test5Input, + }, + want: test_data.Test5Output, + }, + { + name: "6. struct with an embedded struct, with one inline struct", + args: args{ + pkgPath: test_data.PkgPath, + structName: test_data.Test6Input, + }, + want: test_data.Test6Output, + }, + { + name: "7. struct with an embedded struct, with 2 inline structs with a common field", + args: args{ + pkgPath: test_data.PkgPath, + structName: test_data.Test7Input, + }, + want: test_data.Test7Output, + }, + { + name: "8. struct with non-embedded struct with json tag", + args: args{ + pkgPath: test_data.PkgPath, + structName: test_data.Test8Input, + }, + want: test_data.Test8Output, + }, + { + name: "9. struct with non-embedded struct with json tag, but with one value with json tag -", + args: args{ + pkgPath: test_data.PkgPath, + structName: test_data.Test9Input, + }, + want: test_data.Test9Output, + }, + { + name: "9. struct with non-embedded struct with json tag, but with one value with json tag -", + args: args{ + pkgPath: test_data.PkgPath, + structName: test_data.Test9Input, + }, + want: test_data.Test9Output, + }, + { + name: "10. struct with struct embedded without field name", + args: args{ + pkgPath: test_data.PkgPath, + structName: test_data.Test10Input, + }, + want: test_data.Test10Output, + }, + { + name: "11. struct with field having struct-json-path set to ignore", + args: args{ + pkgPath: test_data.PkgPath, + structName: test_data.Test11Input, + }, + want: test_data.Test11Output, + }, + { + name: "12. struct with field having ignored nesting for packages", + args: args{ + pkgPath: test_data.PkgPath, + structName: test_data.Test12Input, + ignoreNesting: map[string]struct{}{ + "time.Time": {}, + }, + }, + want: test_data.Test12Output, + }, + { + name: "13. struct with fields having ignored-nesting tag on struct field", + args: args{ + pkgPath: test_data.PkgPath, + structName: test_data.Test13Input, + }, + want: test_data.Test13Output, + }, + { + name: "14. struct with fields having a custom string like type", + args: args{ + pkgPath: test_data.PkgPath, + structName: test_data.Test14Input, + }, + want: test_data.Test14Output, + }, + } + + parser := ast_parser.NewASTParser() + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + structObj, err := parser.FindStruct(tt.args.pkgPath, tt.args.structName) + if err != nil { + t.Errorf("no struct found with pkgpath (%s) and type (%s)", tt.args.pkgPath, tt.args.structName) + } + + got := traverseStruct(structObj, tt.args.ignoreNesting) + for k := range got { + sort.Strings(got[k]) + } + + for k := range tt.want { + sort.Strings(tt.want[k]) + } + + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("traverseStruct() = %v, want %v", got, tt.want) + } + }) + } +} diff --git a/cmd/struct-json-path/test_data/sample.go b/cmd/struct-json-path/test_data/sample.go new file mode 100644 index 000000000..7496748f8 --- /dev/null +++ b/cmd/struct-json-path/test_data/sample.go @@ -0,0 +1,29 @@ +package test_data + +import corev1 "k8s.io/api/core/v1" + +type EmbeddedStruct struct { + Hi string `json:"hi"` +} + +type InlineStruct struct { + Value string `json:"value"` + EmbeddedStruct `json:"embedded2"` +} + +//go:generate go run ../ --struct github.com/kloudlite/api/cmd/struct-json-path/test_data.Sample --struct github.com/kloudlite/api/cmd/struct-json-path/test_data.Sample2 --common-path "metadata" --common-path "apiVersion" --common-path "kind" --ignore-nesting "time.Time" --out-file ./generated_jsonpath.go --banner "package test_data" +type Sample struct { + Hello string `json:"hello" asdfas:"Asdfasdfa"` + corev1.ConfigMap `json:",inline"` + Embedded EmbeddedStruct `json:"embedded"` + Example string + Inline InlineStruct `json:",inline"` +} + +type Sample2 struct { + Hello string `json:"hello" asdfas:"Asdfasdfa"` + corev1.Secret `json:",inline"` + Embedded EmbeddedStruct `json:"embedded"` + Example string + Inline InlineStruct `json:",inline"` +} diff --git a/cmd/struct-json-path/test_data/test_types.go b/cmd/struct-json-path/test_data/test_types.go new file mode 100644 index 000000000..0f2dbcc02 --- /dev/null +++ b/cmd/struct-json-path/test_data/test_types.go @@ -0,0 +1,284 @@ +package test_data + +import "time" + +var PkgPath = "github.com/kloudlite/api/cmd/struct-json-path/test_data" + +type Test1 struct { + Sample string +} + +var Test1Input = "Test1" +var Test1Output = map[string][]string{ + "Sample": {}, +} + +type Test2 struct { + Sample string `json:"sample"` +} + +var Test2Input = "Test2" +var Test2Output = map[string][]string{ + "sample": {}, +} + +type Test3 struct { + Sample string `json:"sample"` + Example string +} + +var Test3Input = "Test3" +var Test3Output = map[string][]string{ + "sample": {}, + "Example": {}, +} + +type Test4 struct { + Sample string `json:"sample"` + Example struct { + ExampleA string `json:"example-a"` + ExampleB string `json:"example-b"` + ExampleC string + } +} + +var Test4Input = "Test4" +var Test4Output = map[string][]string{ + "sample": {}, + "Example": { + "example-a", + "example-b", + "ExampleC", + }, +} + +type Test5 struct { + Sample string `json:"sample"` + Example struct { + ExampleA string `json:"example-a"` + ExampleB string `json:"example-b"` + ExampleC string + } + Example2 struct { + ExampleA string `json:"example-a"` + ExampleB string `json:"example-b"` + ExampleC string + } `json:"example2"` +} + +var Test5Input = "Test5" +var Test5Output = map[string][]string{ + "sample": {}, + "Example": { + "example-a", + "example-b", + "ExampleC", + }, + "example2": { + "example-a", + "example-b", + "ExampleC", + }, +} + +type Test6 struct { + Sample string `json:"sample"` + Example struct { + ExampleA string `json:"example-a"` + ExampleB string `json:"example-b"` + ExampleC string + } + Example2 struct { + ExampleA string `json:"example-a"` + ExampleB string `json:"example-b"` + ExampleC string + } `json:",inline"` +} + +var Test6Input = "Test6" +var Test6Output = map[string][]string{ + "sample": {}, + "Example": { + "example-a", + "example-b", + "ExampleC", + }, + "": { + "example-a", + "example-b", + "ExampleC", + }, +} + +type Test7 struct { + Sample string `json:"sample"` + Example struct { + ExampleA string `json:"example-a"` + ExampleB string `json:"example-b"` + ExampleC string + } + Example2 struct { + ExampleA string `json:"example-a"` + ExampleB string `json:"example-b"` + ExampleC string + } `json:",inline"` + Example3 struct { + ExampleA string `json:"example-c"` + ExampleB string `json:"example-d"` + ExampleC string + } `json:",inline"` +} + +var Test7Input = "Test7" +var Test7Output = map[string][]string{ + "sample": {}, + "Example": { + "example-a", + "example-b", + "ExampleC", + }, + "": { + "example-a", + "example-b", + "example-c", + "example-d", + "ExampleC", + }, +} + +type Test8Example struct { + Hello string `json:"hello"` + World string `json:"world"` +} + +type Test8 struct { + Example Test8Example `json:"example"` +} + +var Test8Input = "Test8" +var Test8Output = map[string][]string{ + "example": { + "hello", + "world", + }, +} + +type Test9Example struct { + Hello string `json:"hello"` + World string `json:"-"` +} + +type Test9 struct { + Example Test9Example `json:"example"` +} + +var Test9Input = "Test9" +var Test9Output = map[string][]string{ + "example": { + "hello", + }, +} + +type Test10Example struct { + Hello string `json:"hello"` +} +type Test10Example2 struct { + World string `json:"world"` +} + +type Test10 struct { + Test10Example `json:"example"` + Test10Example2 +} + +var Test10Input = "Test10" +var Test10Output = map[string][]string{ + "example": { + "hello", + }, + "Test10Example2": { + "world", + }, +} + +type Test11Example struct { + Hello string `json:"hello"` +} + +type Test11 struct { + _Id string `json:"_id" struct-json-path:",ignore"` + Id string `json:"id"` + Test11Example +} + +var Test11Input = "Test11" +var Test11Output = map[string][]string{ + "id": {}, + "Test11Example": { + "hello", + }, +} + +type Test12Sample struct { + Timestamp time.Time `json:"timestamp"` +} + +type Test12 struct { + Id string `json:"id"` + //Timestamp time.Time `json:"timestamp"` + time.Time `json:"timestamp"` + Sample Test12Sample `json:"sample"` +} + +var Test12Input = "Test12" +var Test12Output = map[string][]string{ + "id": {}, + "timestamp": {}, + "sample": { + "timestamp", + }, +} + +type Test13Sample struct { + Timestamp time.Time `json:"timestamp" struct-json-path:",ignore-nesting"` +} + +type Test13 struct { + Id string `json:"id"` + //Timestamp time.Time `json:"timestamp"` + time.Time `json:"timestamp" struct-json-path:",ignore-nesting"` + Sample Test13Sample `json:"sample"` +} + +var Test13Input = "Test13" +var Test13Output = map[string][]string{ + "id": {}, + "timestamp": {}, + "sample": { + "timestamp", + }, +} + +type Test14Sample struct { + Hello string `json:"hello"` +} + +type Test14SampleStr string + +const ( + Test14SampleStrHello Test14SampleStr = "hello" + Test14SampleStrWorld Test14SampleStr = "world" +) + +type Test14 struct { + Id string `json:"id"` + TestStr Test14SampleStr `json:"testStr"` + Sample *Test14Sample `json:"sample" struct-json-path:",ignore-nesting"` +} + +var Test14Input = "Test14" +var Test14Output = map[string][]string{ + "id": {}, + "testStr": {}, + "sample": {}, +} diff --git a/cmd/struct-to-graphql/Taskfile.yml b/cmd/struct-to-graphql/Taskfile.yml new file mode 100644 index 000000000..44ea30e6b --- /dev/null +++ b/cmd/struct-to-graphql/Taskfile.yml @@ -0,0 +1,18 @@ +version: 3 + +tasks: + test: + cmds: + - go test ./pkg/parser/... -v -failfast + # - go test ./pkg/parser/... --count=1 + + example:gen: + cmds: +# - go run ./main.go -f ./examples/structs.go -o ./examples/structs.graphql + - go run ./main.go --struct "kloudlite.io/cmd/struct-to-graphql/internal/example/types".Example > ./internal/example/parser-entrypoint.go + + coverage: + cmds: + - go-test-cover.sh ./pkg/parser/... + + diff --git a/cmd/struct-to-graphql/internal/example/parser-entrypoint.go b/cmd/struct-to-graphql/internal/example/parser-entrypoint.go new file mode 100644 index 000000000..bf9a7eb9e --- /dev/null +++ b/cmd/struct-to-graphql/internal/example/parser-entrypoint.go @@ -0,0 +1,143 @@ +package main + +import ( + "context" + "flag" + "fmt" + klrrhlzjw8qccqgbl5gspxq6cqh4zbp2 "github.com/kloudlite/api/cmd/struct-to-graphql/internal/example/types" + "github.com/kloudlite/api/cmd/struct-to-graphql/pkg/parser" + "golang.org/x/sync/errgroup" + "k8s.io/client-go/rest" + "os" + "path" + "strings" + + "encoding/json" + "io" + "net/http" + "time" + + apiExtensionsV1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type schemaClient struct { + kcli *clientset.Clientset +} + +func (s schemaClient) GetK8sJsonSchema(name string) (*apiExtensionsV1.JSONSchemaProps, error) { + ctx, cf := context.WithTimeout(context.TODO(), 2*time.Second) + defer cf() + crd, err := s.kcli.ApiextensionsV1().CustomResourceDefinitions().Get(ctx, name, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return crd.Spec.Versions[0].Schema.OpenAPIV3Schema, nil +} + +func (s schemaClient) GetHttpJsonSchema(url string) (*apiExtensionsV1.JSONSchemaProps, error) { + req, err := http.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := http.DefaultClient.Do(req) + if err != nil { + return nil, err + } + + b, err := io.ReadAll(resp.Body) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var m apiExtensionsV1.JSONSchemaProps + if err := json.Unmarshal(b, &m); err != nil { + return nil, err + } + return &m, nil +} + +func main() { + var isDev bool + var outDir string + var withPagination string + + flag.BoolVar(&isDev, "dev", false, "--dev") + flag.StringVar(&outDir, "out-dir", "struct-to-graphql", "--out-dir ") + flag.StringVar(&withPagination, "with-pagination", "", "--with-pagination ") + flag.Parse() + + stat, err := os.Stat(outDir) + if err != nil { + if os.IsNotExist(err) { + if err := os.MkdirAll(outDir, 0755); err != nil { + panic(err) + } + } + } + + if stat != nil && !stat.IsDir() { + panic(fmt.Errorf("out-dir (%s) is not a directory", outDir)) + } + + types := map[string]any{ + "Example": &klrrhlzjw8qccqgbl5gspxq6cqh4zbp2.Example{}, + } + + kcli, err := func() (*clientset.Clientset, error) { + if isDev { + return clientset.NewForConfig(&rest.Config{Host: "localhost:8080"}) + } + + cfg, err := rest.InClusterConfig() + if err != nil { + return nil, err + } + return clientset.NewForConfig(cfg) + }() + if err != nil { + panic(err) + } + + if err != nil { + panic(err) + } + + g, _ := errgroup.WithContext(context.TODO()) + + g.Go(func() error { + directives, err := parser.Directives() + if err != nil { + return err + } + return os.WriteFile(path.Join(outDir, "directives.graphqls"), directives, 0644) + }) + + g.Go(func() error { + scalarTypes, err := parser.ScalarTypes() + if err != nil { + panic(err) + } + return os.WriteFile(path.Join(outDir, "scalars.graphqls"), scalarTypes, 0644) + }) + + p := parser.NewParser(&schemaClient{kcli: kcli}) + + for k, v := range types { + p.LoadStruct(k, v) + } + + if err := g.Wait(); err != nil { + panic(err) + } + + p.WithPagination(strings.Split(withPagination, ",")) + + if err := p.DumpSchema(outDir); err != nil { + panic(err) + } +} diff --git a/cmd/struct-to-graphql/internal/example/types/types.go b/cmd/struct-to-graphql/internal/example/types/types.go new file mode 100644 index 000000000..fdc03b1e6 --- /dev/null +++ b/cmd/struct-to-graphql/internal/example/types/types.go @@ -0,0 +1,13 @@ +package types + +type Example struct { + Message string `json:"message"` +} + +type SampleString string + +const ( + Item1 SampleString = "item_1" + Item2 SampleString = "item_2" + Item3 SampleString = "item_3" +) diff --git a/cmd/struct-to-graphql/main.go b/cmd/struct-to-graphql/main.go new file mode 100644 index 000000000..09def4848 --- /dev/null +++ b/cmd/struct-to-graphql/main.go @@ -0,0 +1,60 @@ +package main + +import ( + _ "embed" + "fmt" + "log" + "os" + "strings" + "text/template" + + "github.com/Masterminds/sprig/v3" + _ "github.com/kloudlite/operator/pkg/operator" + "k8s.io/apimachinery/pkg/util/rand" + + fn "github.com/kloudlite/api/pkg/functions" + "github.com/spf13/pflag" +) + +//go:embed parser-entrypoint.go.tmpl +var parserEntrypoint string + +func main() { + var structPaths []string + pflag.StringSliceVar(&structPaths, "struct", nil, "--struct github.com/kloudlite/sample.Main") + pflag.Parse() + + if len(structPaths) == 0 { + panic("no struct paths specified, they should be specified like `--struct github.com/kloudlite/sample.Main`") + } + + imports := make(map[string]string, len(structPaths)) + values := make(map[string]any, len(structPaths)) + for _, p := range structPaths { + sp := strings.SplitN(fn.StringReverse(p), ".", 2) + if len(sp) != 2 { + panic("invalid struct path") + } + sp[0] = fn.StringReverse(sp[0]) + sp[1] = fn.StringReverse(sp[1]) + + alias := "kl" + rand.String(30) + existingAlias, ok := imports[sp[1]] + if ok { + alias = existingAlias + } else { + imports[sp[1]] = alias + } + + values[sp[0]] = fmt.Sprintf("&%s.%s{}", alias, sp[0]) + } + + t2 := template.Must(template.New("code_gen").Funcs(sprig.TxtFuncMap()).Parse(parserEntrypoint)) + + if err := t2.Execute(os.Stdout, map[string]any{ + "Imports": imports, + "Types": values, + }); err != nil { + log.Fatal(err) + } +} diff --git a/cmd/struct-to-graphql/parser-entrypoint.go.tmpl b/cmd/struct-to-graphql/parser-entrypoint.go.tmpl new file mode 100644 index 000000000..b1d0f7616 --- /dev/null +++ b/cmd/struct-to-graphql/parser-entrypoint.go.tmpl @@ -0,0 +1,149 @@ +package main + +import ( + {{- range $key, $value := .Imports}} + {{$value}} {{$key | quote}} + {{- end }} + "github.com/kloudlite/api/cmd/struct-to-graphql/pkg/parser" + "k8s.io/client-go/rest" + "os" + "golang.org/x/sync/errgroup" + "context" + "path" + "flag" + "fmt" + "strings" + + "time" + "net/http" + "io" + "encoding/json" + + "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" + apiExtensionsV1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type schemaClient struct { + kcli *clientset.Clientset +} + +func (s schemaClient) GetK8sJsonSchema(name string) (*apiExtensionsV1.JSONSchemaProps, error) { + ctx, cf := context.WithTimeout(context.TODO(), 2*time.Second) + defer cf() + crd, err := s.kcli.ApiextensionsV1().CustomResourceDefinitions().Get(ctx, name, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return crd.Spec.Versions[0].Schema.OpenAPIV3Schema, nil +} + +func (s schemaClient) GetHttpJsonSchema(url string) (*apiExtensionsV1.JSONSchemaProps, error) { + req, err := http.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := http.DefaultClient.Do(req) + if err != nil { + return nil, err + } + + b, err := io.ReadAll(resp.Body) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var m apiExtensionsV1.JSONSchemaProps + if err := json.Unmarshal(b, &m); err != nil { + return nil, err + } + return &m, nil +} + + +func main() { + var isDev bool + var outDir string + var withPagination string + + flag.BoolVar(&isDev, "dev", false, "--dev") + flag.StringVar(&outDir, "out-dir", "struct-to-graphql", "--out-dir ") + flag.StringVar(&withPagination, "with-pagination", "", "--with-pagination ") + flag.Parse() + + stat, err := os.Stat(outDir) + if err != nil { + if os.IsNotExist(err) { + if err := os.MkdirAll(outDir, 0755); err != nil { + panic(err) + } + } + } + + if stat != nil && !stat.IsDir() { + panic(fmt.Errorf("out-dir (%s) is not a directory", outDir)) + } + + types := map[string]any{ + {{- range $key, $value := .Types}} + "{{$key}}": {{$value}}, + {{- end }} + } + + kcli, err := func() (*clientset.Clientset, error) { + if isDev { + return clientset.NewForConfig(&rest.Config{Host: "localhost:8080"}) + } + + cfg, err := rest.InClusterConfig() + if err != nil { + return nil, err + } + return clientset.NewForConfig(cfg) + }() + if err != nil { + panic(err) + } + + + if err != nil { + panic(err) + } + + g, _ := errgroup.WithContext(context.TODO()) + + g.Go(func() error { + directives, err := parser.Directives() + if err != nil { + return err + } + return os.WriteFile(path.Join(outDir, "directives.graphqls"), directives, 0644) + }) + + g.Go(func() error { + scalarTypes, err := parser.ScalarTypes() + if err != nil { + panic(err) + } + return os.WriteFile(path.Join(outDir, "scalars.graphqls"), scalarTypes, 0644) + }) + + p := parser.NewParser(&schemaClient{kcli: kcli}) + + for k, v := range types { + p.LoadStruct(k, v) + } + + if err := g.Wait(); err != nil { + panic(err) + } + + p.WithPagination(strings.Split(withPagination, ",")) + + if err := p.DumpSchema(outDir); err != nil { + panic(err) + } +} diff --git a/cmd/struct-to-graphql/pkg/parser/ast-parser.go b/cmd/struct-to-graphql/pkg/parser/ast-parser.go new file mode 100644 index 000000000..46e6bd07b --- /dev/null +++ b/cmd/struct-to-graphql/pkg/parser/ast-parser.go @@ -0,0 +1,54 @@ +package parser + +import ( + "fmt" + "go/constant" + "go/types" + "golang.org/x/tools/go/packages" + "strings" +) + +func parseConstantsFromPkg(packagePath string, typeName string) ([]string, error) { + cfg := &packages.Config{ + Mode: packages.NeedTypes | packages.NeedSyntax, + } + + pkgs, err := packages.Load(cfg, packagePath) + if err != nil { + return nil, err + } + + if len(pkgs) == 0 { + return nil, fmt.Errorf("no packages were loaded") + } + + var enums []string + + for _, pkg := range pkgs { + scope := pkg.Types.Scope() + + obj := scope.Lookup(typeName) + if obj == nil { + continue + } + + for _, name := range scope.Names() { + varObj := scope.Lookup(name) + if varObj == nil || varObj.Type() == nil { + continue + } + + if varObj.Type().String() == obj.Type().String() { + if val, ok := varObj.(*types.Const); ok { + vstr := val.Val().ExactString() + if strings.HasPrefix(vstr, "\"") { + vstr = constant.StringVal(val.Val()) + } + enums = append(enums, vstr) + } + } + } + } + + return enums, nil +} diff --git a/cmd/struct-to-graphql/pkg/parser/depricated.go b/cmd/struct-to-graphql/pkg/parser/depricated.go new file mode 100644 index 000000000..114b10d60 --- /dev/null +++ b/cmd/struct-to-graphql/pkg/parser/depricated.go @@ -0,0 +1,149 @@ +package parser + +import ( + "encoding/json" + "fmt" + rApi "github.com/kloudlite/operator/pkg/operator" + apiExtensionsV1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "reflect" +) + +func (p *parser) NavigateTree(s *Struct, name string, tree *apiExtensionsV1.JSONSchemaProps, depth ...int) error { + currDepth := func() int { + if len(depth) == 0 { + return 1 + } + return depth[0] + }() + + m := map[string]bool{} + for i := range tree.Required { + m[tree.Required[i]] = true + } + + typeName := genTypeName(name) + + fields := make([]string, 0, len(tree.Properties)) + inputFields := make([]string, 0, len(tree.Properties)) + + for k, v := range tree.Properties { + if currDepth == 1 { + if k == "apiVersion" || k == "kind" { + // fields = append(fields, genFieldEntry(k, "String", m[k])) + fields = append(fields, genFieldEntry(k, "String", true)) + // inputFields = append(inputFields, genFieldEntry(k, "String", m[k])) + inputFields = append(inputFields, genFieldEntry(k, "String", m[k])) + continue + } + } + + if v.Type == "array" { + if v.Items.Schema != nil && v.Items.Schema.Type == "object" { + fields = append(fields, genFieldEntry(k, fmt.Sprintf("[%s!]", typeName+genTypeName(k)), m[k])) + inputFields = append(inputFields, genFieldEntry(k, fmt.Sprintf("[%sIn!]", typeName+genTypeName(k)), m[k])) + if err := p.NavigateTree(s, typeName+genTypeName(k), v.Items.Schema, currDepth+1); err != nil { + return err + } + continue + } + + fields = append(fields, genFieldEntry(k, fmt.Sprintf("[%s!]", genTypeName(v.Items.Schema.Type)), m[k])) + inputFields = append(inputFields, genFieldEntry(k, fmt.Sprintf("[%s!]", genTypeName(v.Items.Schema.Type)), m[k])) + continue + } + + if v.Type == "object" { + if currDepth == 1 { + // these types are common across all the types that will be generated + if k == "metadata" { + fields = append(fields, genFieldEntry(k, "Metadata! @goField(name: \"objectMeta\")", false)) + // fields = append(fields, genFieldEntry(k, "Metadata!", false)) + inputFields = append(inputFields, genFieldEntry(k, "MetadataIn!", false)) + + metadata := struct { + Name string `json:"name"` + Namespace string `json:"namespace,omitempty"` + Labels map[string]string `json:"labels,omitempty"` + Annotations map[string]string `json:"annotations,omitempty"` + Generation int64 `json:"generation" graphql:"noinput"` + CreationTimestamp metav1.Time `json:"creationTimestamp" graphql:"noinput"` + DeletionTimestamp *metav1.Time `json:"deletionTimestamp,omitempty" graphql:"noinput"` + }{} + if err := p.GenerateGraphQLSchema(commonLabel, "Metadata", reflect.TypeOf(metadata), GraphqlTag{}); err != nil { + return err + } + continue + } + + if k == "status" { + pkgPath := SanitizePackagePath("github.com/kloudlite/operator/pkg/operator") + + gType := genTypeName(pkgPath + "_" + "Status") + + fields = append(fields, genFieldEntry(k, gType, m[k])) + + p2 := newParser(p.schemaCli) + if err := p2.GenerateGraphQLSchema(commonLabel, gType, reflect.TypeOf(rApi.Status{}), GraphqlTag{}); err != nil { + return err + } + + for _, v := range p2.structs { + for k, v2 := range v.Types { + p.structs[commonLabel].Types[k] = v2 + } + for k, v2 := range v.Enums { + p.structs[commonLabel].Enums[k] = v2 + } + } + + continue + } + } + + if len(v.Properties) == 0 { + fields = append(fields, genFieldEntry(k, "Map", m[k])) + inputFields = append(inputFields, genFieldEntry(k, "Map", m[k])) + continue + } + + fields = append(fields, genFieldEntry(k, typeName+genTypeName(k), m[k])) + inputFields = append(inputFields, genFieldEntry(k, typeName+genTypeName(k)+"In", m[k])) + if err := p.NavigateTree(s, typeName+genTypeName(k), &v, currDepth+1); err != nil { + return err + } + continue + } + + if v.Type == "string" { + if len(v.Enum) > 0 { + fqtn := typeName + genTypeName(k) + fields = append(fields, genFieldEntry(k, fqtn, m[k])) + inputFields = append(inputFields, genFieldEntry(k, fqtn, m[k])) + + enums := make([]string, len(v.Enum)) + for i := range v.Enum { + vjson, _ := v.Enum[i].MarshalJSON() + var v string + if err := json.Unmarshal(vjson, &v); err != nil { + return nil + } + enums[i] = v + } + s.Enums[fqtn] = enums + continue + } + } + + fields = append(fields, genFieldEntry(k, gqlTypeMap(v.Type), m[k])) + inputFields = append(inputFields, genFieldEntry(k, gqlTypeMap(v.Type), m[k])) + } + + s.Types[typeName] = fields + s.Inputs[typeName+"In"] = inputFields + return nil +} + +func (p *parser) GenerateFromJsonSchema(s *Struct, name string, schema *apiExtensionsV1.JSONSchemaProps) error { + return p.NavigateTree(s, name, schema) +} diff --git a/cmd/struct-to-graphql/pkg/parser/graphql-defaults.go b/cmd/struct-to-graphql/pkg/parser/graphql-defaults.go new file mode 100644 index 000000000..2edb87383 --- /dev/null +++ b/cmd/struct-to-graphql/pkg/parser/graphql-defaults.go @@ -0,0 +1,78 @@ +package parser + +import ( + "bytes" + "strings" +) + +func Directives() ([]byte, error) { + directives := `extend schema @link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@key", "@shareable", "@external"]) + +directive @goField( + forceResolver: Boolean + name: String +) on INPUT_FIELD_DEFINITION | FIELD_DEFINITION +` + return []byte(directives), nil +} + +func ScalarTypes() ([]byte, error) { + scalars := `scalar Any +scalar Json +scalar Map +scalar Date +` + + b := bytes.NewBuffer(nil) + b.WriteString(scalars) + + return b.Bytes(), nil +} + +func KloudliteK8sTypes() ([]byte, error) { + metadata := ` +type Metadata @shareable { + name: String! + namespace: String + labels: Json + annotations: Json + creationTimestamp: Date! + deletionTimestamp: Date + generation: Int! +} + +input MetadataIn { + name: String! + namespace: String + labels: Json + annotations: Json +} +` + + // overrides := ` + // type Patch @shareable { + // op: String! + // path: String! + // value: Any + // } + // + // type Overrides @shareable{ + // applied: Boolean + // patches: [Patch!] + // } + // + // input PatchIn { + // op: String! + // path: String! + // value: Any + // } + // + // input OverridesIn { + // patches: [PatchIn!] + // } + + b := bytes.NewBuffer(nil) + b.WriteString(strings.TrimSpace(metadata)) + b.WriteString("\n") + return b.Bytes(), nil +} diff --git a/cmd/struct-to-graphql/pkg/parser/json-schema-parsing.go b/cmd/struct-to-graphql/pkg/parser/json-schema-parsing.go new file mode 100644 index 000000000..5e3dc46c5 --- /dev/null +++ b/cmd/struct-to-graphql/pkg/parser/json-schema-parsing.go @@ -0,0 +1,34 @@ +package parser + +import ( + "fmt" + "strings" +) + +func gqlTypeMap(jsonType string) string { + switch jsonType { + case "boolean": + return "Boolean" + case "integer": + return "Int" + case "object": + return "Object" + case "string": + return "String" + case "array": + return "Array" + default: + return "Any" + } +} + +func genTypeName(n string) string { + return strings.ToUpper(n[0:1]) + n[1:] +} + +func genFieldEntry(k string, t string, required bool) string { + if required { + return fmt.Sprintf("%s: %s!", k, t) + } + return fmt.Sprintf("%s: %s", k, t) +} diff --git a/cmd/struct-to-graphql/pkg/parser/parser.go b/cmd/struct-to-graphql/pkg/parser/parser.go new file mode 100644 index 000000000..63e5ecf8e --- /dev/null +++ b/cmd/struct-to-graphql/pkg/parser/parser.go @@ -0,0 +1,591 @@ +package parser + +import ( + "encoding/json" + "fmt" + "io" + "os" + "path/filepath" + "reflect" + "sort" + "strings" + "time" + + "github.com/sanity-io/litter" + apiExtensionsV1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type Parser interface { + GenerateGraphQLSchema(structName string, name string, t reflect.Type, parentTag GraphqlTag) error + LoadStruct(name string, data any) error + + PrintTypes(w io.Writer) + PrintCommonTypes(w io.Writer) + + DebugSchema(w io.Writer) + DumpSchema(dir string) error + WithPagination(types []string) +} + +type GraphqlType string + +const ( + Type GraphqlType = "type" + Input GraphqlType = "input" + Enum GraphqlType = "enum" +) + +var scalarMappings = map[reflect.Type]string{ + reflect.TypeOf(metav1.Time{}): "Date", + reflect.TypeOf(&metav1.Time{}): "Date", + reflect.TypeOf(time.Time{}): "Date", + reflect.TypeOf(&time.Time{}): "Date", + reflect.TypeOf(json.RawMessage{}): "Any", + reflect.TypeOf(&json.RawMessage{}): "Any", +} + +var kindMap = map[reflect.Kind]string{ + reflect.Int: "Int", + reflect.Int8: "Int", + reflect.Int16: "Int", + reflect.Int32: "Int", + reflect.Int64: "Int", + + reflect.Uint: "Int", + reflect.Uint8: "Int", + reflect.Uint16: "Int", + reflect.Uint32: "Int", + reflect.Uint64: "Int", + + reflect.Float32: "Float", + reflect.Float64: "Float", + + reflect.Bool: "Boolean", + reflect.Interface: "Any", + + reflect.String: "String", +} + +type Struct struct { + Types map[string][]string + Inputs map[string][]string + Enums map[string][]string +} + +func newStruct() *Struct { + return &Struct{ + Types: map[string][]string{}, + Inputs: map[string][]string{}, + Enums: map[string][]string{}, + } +} + +type Field struct { + ParentName string + Name string + PkgPath string + Type reflect.Type + StructName string + Fields *[]string + InputFields *[]string + + Parser *parser + + JsonTag + GraphqlTag +} + +const ( + commonLabel = "common-types" +) + +type parser struct { + structs map[string]*Struct + // schemaCli k8s.ExtendedK8sClient + schemaCli SchemaClient +} + +type JsonTag struct { + Value string + OmitEmpty bool + Inline bool +} + +var sanitizers map[string]string = map[string]string{ + ".": "__", + "/": "___", + "-": "____", +} + +func SanitizePackagePath(pkgPath string) string { + replacements := make([]string, 0, len(sanitizers)*2) + for k, v := range sanitizers { + replacements = append(replacements, k, v) + } + + return strings.NewReplacer(replacements...).Replace(pkgPath) +} + +func RestoreSanitizedPackagePath(sanitizedPath string) string { + replacements := make([]string, 0, len(sanitizers)*2) + for k, v := range sanitizers { + replacements = append(replacements, v, k) + } + + return strings.NewReplacer(replacements...).Replace(sanitizedPath) +} + +func parseJsonTag(field reflect.StructField) JsonTag { + jsonTag := field.Tag.Get("json") + if jsonTag == "" { + return JsonTag{Value: field.Name, OmitEmpty: false, Inline: false} + } + + var jt JsonTag + sp := strings.Split(jsonTag, ",") + jt.Value = sp[0] + + if jt.Value == "" { + jt.Value = field.Name + } + + for i := 1; i < len(sp); i++ { + if sp[i] == "omitempty" { + jt.OmitEmpty = true + } + if sp[i] == "inline" { + jt.Inline = true + } + } + + return jt +} + +type schemaFormat string + +type GraphqlTag struct { + Uri *string + Enum []string + Ignore bool + NoInput bool + OnlyInput bool + InputOmitEmpty bool + DefaultValue any + ChildrenRequired bool + ChildrenOmitEmpty bool +} + +func parseGraphqlTag(field reflect.StructField) (GraphqlTag, error) { + tag := field.Tag.Get("graphql") + if tag == "" { + return GraphqlTag{}, nil + } + + var gt GraphqlTag + sp := strings.Split(tag, ",") + for i := range sp { + kv := strings.Split(sp[i], "=") + + switch kv[0] { + case "uri": + { + if len(kv) != 2 { + return GraphqlTag{}, fmt.Errorf("invalid graphql tag %s, must be of form key=value", tag) + } + gt.Uri = &kv[1] + } + case "enum": + { + if len(kv) != 2 { + return GraphqlTag{}, fmt.Errorf("invalid graphql tag %s, must be of form key=value", tag) + } + enumVals := strings.Split(kv[1], ";") + + gt.Enum = make([]string, 0, len(enumVals)) + for k := range enumVals { + if enumVals[k] != "" { + gt.Enum = append(gt.Enum, enumVals[k]) + } + } + } + case "noinput": + { + gt.NoInput = true + } + case "onlyinput": + { + gt.OnlyInput = true + } + + case "inputomitempty": + { + gt.InputOmitEmpty = true + } + case "children-required": + { + gt.ChildrenRequired = true + } + case "children-omitempty": + { + gt.ChildrenOmitEmpty = true + } + + case "ignore": + { + gt.Ignore = true + } + case "default": + { + if strings.HasPrefix(kv[1], "'") { + return gt, fmt.Errorf("graphql string value can not start with single-quote, use double-quotes") + } + gt.DefaultValue = kv[1] + } + default: + { + return GraphqlTag{}, fmt.Errorf("unknown graphql tag %s", kv[0]) + } + } + } + + return gt, nil +} + +func toFieldType(fieldType string, isRequired bool) string { + if isRequired { + return fieldType + "!" + } + return fieldType +} + +func (s *Struct) mergeParser(other *Struct, overKey string) (fields []string, inputFields []string) { + for k, v := range other.Types { + if k == overKey { + fields = append(fields, v...) + continue + } + s.Types[k] = v + } + + for k, v := range other.Inputs { + if k == overKey+"In" { + inputFields = append(inputFields, v...) + continue + } + s.Inputs[k] = v + } + + for k, v := range other.Enums { + s.Enums[k] = v + } + + return fields, inputFields +} + +func (p *parser) GenerateGraphQLSchema(structName string, name string, t reflect.Type, parentTag GraphqlTag) error { + var fields []string + var inputFields []string + + if _, ok := p.structs[structName]; !ok { + p.structs[structName] = newStruct() + } + + for i := 0; i < t.NumField(); i++ { + field := t.Field(i) + + if !field.IsExported() { + continue + } + + jt := parseJsonTag(field) + if jt.Value == "-" { + continue + } + + gt, err := parseGraphqlTag(field) + if err != nil { + return err + } + + if gt.Ignore { + continue + } + + if parentTag.ChildrenRequired { + jt.OmitEmpty = false + } + + if parentTag.ChildrenOmitEmpty { + jt.OmitEmpty = true + } + + var fieldType string + var inputFieldType string + + if scalar, ok := scalarMappings[field.Type]; ok { + fieldType = toFieldType(scalar, !jt.OmitEmpty) + inputFieldType = toFieldType(scalar, !jt.OmitEmpty) + } + + if field.Type.Kind() != reflect.String { + if v, ok := kindMap[field.Type.Kind()]; ok { + fieldType = toFieldType(v, !jt.OmitEmpty) + inputFieldType = toFieldType(v, !jt.OmitEmpty) + } + } + + f := Field{ + ParentName: name, + Name: field.Name, + PkgPath: field.Type.PkgPath(), + Type: field.Type, + StructName: structName, + Fields: &fields, + InputFields: &inputFields, + Parser: p, + JsonTag: jt, + GraphqlTag: gt, + } + + if fieldType == "" { + switch field.Type.Kind() { + case reflect.String: + { + fieldType, inputFieldType, err = f.handleString() + if err != nil { + panic(err) + } + } + case reflect.Struct: + { + fieldType, inputFieldType, err = f.handleStruct() + if err != nil { + panic(err) + } + } + case reflect.Slice: + { + fieldType, inputFieldType, err = f.handleSlice() + if err != nil { + panic(err) + } + } + case reflect.Ptr: + { + fieldType, inputFieldType, err = f.handlePtr() + if err != nil { + panic(err) + } + } + case reflect.Map: + { + fieldType, inputFieldType, err = f.handleMap() + if err != nil { + panic(err) + } + } + default: + { + fmt.Printf("default: name: %v (field-name: %v), type: %v, kind: %v\n", jt.Value, field.Name, field.Type, field.Type.Kind()) + } + } + } + + if fieldType != "" && !gt.OnlyInput { + fields = append(fields, fmt.Sprintf("%s: %s", jt.Value, fieldType)) + } + if inputFieldType != "" && !gt.NoInput { + if gt.DefaultValue == nil { + inputFields = append(inputFields, fmt.Sprintf("%s: %s", jt.Value, inputFieldType)) + } else { + inputFields = append(inputFields, fmt.Sprintf("%s: %s = %v", jt.Value, inputFieldType, gt.DefaultValue)) + } + } + } + + if len(fields) > 0 { + p.structs[structName].Types[name] = fields + } + + if len(inputFields) > 0 { + p.structs[structName].Inputs[name+"In"] = inputFields + } + return nil +} + +func (p *parser) LoadStruct(name string, data any) error { + ty := reflect.TypeOf(data) + if ty.Kind() == reflect.Ptr { + ty = ty.Elem() + } + + return p.GenerateGraphQLSchema(name, name, ty, GraphqlTag{}) +} + +func (s *Struct) WriteSchema(w io.Writer) { + keys := make([]string, 0, len(s.Types)) + for k := range s.Types { + keys = append(keys, k) + } + + sort.Strings(keys) + for i := range keys { + io.WriteString(w, fmt.Sprintf("type %s @shareable {\n", keys[i])) + sort.Slice(s.Types[keys[i]], func(p, q int) bool { + return strings.ToLower(s.Types[keys[i]][p]) < strings.ToLower(s.Types[keys[i]][q]) + }) + io.WriteString(w, fmt.Sprintf(" %s\n", strings.Join(s.Types[keys[i]], "\n "))) + io.WriteString(w, "}\n\n") + } + + keys = make([]string, 0, len(s.Inputs)) + for k := range s.Inputs { + keys = append(keys, k) + } + + sort.Strings(keys) + for i := range keys { + io.WriteString(w, fmt.Sprintf("input %s {\n", keys[i])) + sort.Slice(s.Inputs[keys[i]], func(p, q int) bool { + return strings.ToLower(s.Inputs[keys[i]][p]) < strings.ToLower(s.Inputs[keys[i]][q]) + }) + io.WriteString(w, fmt.Sprintf(" %s\n", strings.Join(s.Inputs[keys[i]], "\n "))) + io.WriteString(w, "}\n\n") + } + + keys = make([]string, 0, len(s.Enums)) + for k := range s.Enums { + keys = append(keys, k) + } + + sort.Strings(keys) + for i := range keys { + io.WriteString(w, fmt.Sprintf("enum %s {\n", keys[i])) + sort.Slice(s.Enums[keys[i]], func(p, q int) bool { + return strings.ToLower(s.Enums[keys[i]][p]) < strings.ToLower(s.Enums[keys[i]][q]) + }) + io.WriteString(w, fmt.Sprintf(" %s\n", strings.Join(s.Enums[keys[i]], "\n "))) + io.WriteString(w, "}\n\n") + } +} + +func (p *parser) PrintTypes(w io.Writer) { + keys := make([]string, 0, len(p.structs)) + for k := range p.structs { + keys = append(keys, k) + } + + for _, v := range keys { + if v != commonLabel { + p.structs[v].WriteSchema(w) + } + } +} + +func (p *parser) PrintCommonTypes(w io.Writer) { + if v, ok := p.structs[commonLabel]; ok { + v.WriteSchema(w) + } +} + +func (p *parser) WithPagination(types []string) { + for i := range types { + k := types[i] + v, ok := p.structs[types[i]] + if !ok { + continue + } + + paginatedTypes := map[string][]string{ + fmt.Sprintf("%sPaginatedRecords", k): { + "totalCount: Int!", + fmt.Sprintf("edges: [%sEdge!]!", k), + "pageInfo: PageInfo!", + }, + fmt.Sprintf("%sEdge", k): { + fmt.Sprintf("node: %v!", k), + "cursor: String!", + }, + } + + for i := range paginatedTypes { + v.Types[i] = paginatedTypes[i] + } + + if _, ok := p.structs[commonLabel]; !ok { + p.structs[commonLabel] = newStruct() + } + } + + if len(types) > 0 { + if p.structs[commonLabel] == nil { + p.structs[commonLabel] = newStruct() + } + + p.structs[commonLabel].Types["PageInfo"] = []string{ + "hasNextPage: Boolean", + "hasPreviousPage: Boolean", + "startCursor: String", + "endCursor: String", + } + } +} + +func (p *parser) DebugSchema(w io.Writer) { + for k, v := range p.structs { + io.WriteString(w, fmt.Sprintf("struct: %v\n", k)) + io.WriteString(w, litter.Sdump(v)) + io.WriteString(w, "\n") + } +} + +func (p *parser) DumpSchema(dir string) error { + if _, err := os.Stat(dir); err != nil { + if !os.IsNotExist(err) { + return err + } + if err := os.MkdirAll(dir, 0o766); err != nil { + return err + } + } + + for k, v := range p.structs { + f, err := os.Create(filepath.Join(dir, strings.ToLower(k)+".graphqls")) + if err != nil { + return err + } + + v.WriteSchema(f) + f.Close() + } + return nil +} + +type SchemaClient interface { + GetK8sJsonSchema(name string) (*apiExtensionsV1.JSONSchemaProps, error) + GetHttpJsonSchema(url string) (*apiExtensionsV1.JSONSchemaProps, error) +} + +func newParser(schemaCli SchemaClient) *parser { + return &parser{ + structs: map[string]*Struct{ + commonLabel: { + Types: map[string][]string{}, + Inputs: map[string][]string{}, + Enums: map[string][]string{}, + }, + }, + schemaCli: schemaCli, + } +} + +func NewParser(cli SchemaClient) Parser { + return newParser(cli) +} + +func NewUnsafeParser(strucs map[string]*Struct, cli SchemaClient) Parser { + return &parser{ + structs: strucs, + } +} diff --git a/cmd/struct-to-graphql/pkg/parser/parser_helpers.go b/cmd/struct-to-graphql/pkg/parser/parser_helpers.go new file mode 100644 index 000000000..0771c45af --- /dev/null +++ b/cmd/struct-to-graphql/pkg/parser/parser_helpers.go @@ -0,0 +1,278 @@ +package parser + +import ( + "fmt" + "reflect" + "strings" + + "github.com/kloudlite/api/cmd/struct-to-graphql/pkg/parser/types" + apiExtensionsV1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" +) + +func sanitizeEnums(enums []string) []string { + for i := range enums { + enums[i] = SanitizePackagePath(enums[i]) + } + return enums +} + +func (f *Field) handleString() (fieldType string, inputType string, err error) { + childType := f.ParentName + f.Name + if f.Enum != nil { + f.Parser.structs[f.StructName].Enums[childType] = sanitizeEnums(f.Enum) + return toFieldType(childType, !f.OmitEmpty), toFieldType(childType, !f.OmitEmpty), err + } + + if f.PkgPath != "" { + enums, err := parseConstantsFromPkg(f.PkgPath, f.Type.Name()) + if err != nil { + return "", "", err + } + + childType = genTypeName(SanitizePackagePath(f.PkgPath + "." + f.Type.Name())) + + if len(enums) > 0 { + f.Parser.structs[commonLabel].Enums[childType] = sanitizeEnums(enums) + return toFieldType(childType, !f.OmitEmpty), toFieldType(childType, !f.OmitEmpty && !f.InputOmitEmpty), err + } + } + + return toFieldType("String", !f.OmitEmpty), toFieldType("String", !f.OmitEmpty && !f.InputOmitEmpty), err +} + +// all the field level structs, need to drop to the common-types, as +// we never know, this filed has been used in other top-level structs +func (f *Field) handleStruct() (fieldType string, inputFieldType string, err error) { + childType := func() string { + if f.PkgPath != "" { + return genTypeName(SanitizePackagePath(f.PkgPath + "." + f.Type.Name())) + } + return genTypeName(f.ParentName + f.Name) + }() + + structName := func() string { + if f.PkgPath == "" { + return f.StructName + } + return commonLabel + }() + + if f.Uri != nil && false { + jsonSchema, err := func() (*apiExtensionsV1.JSONSchemaProps, error) { + if strings.HasPrefix(*f.Uri, "http://") || strings.HasPrefix(*f.Uri, "https://") { + return f.Parser.schemaCli.GetHttpJsonSchema(*f.Uri) + } + + if strings.HasPrefix(*f.Uri, "k8s://") { + k8sCrdName := strings.Split(*f.Uri, "k8s://")[1] + return f.Parser.schemaCli.GetK8sJsonSchema(k8sCrdName) + } + + return nil, fmt.Errorf("unknown schema for schema uri %q", *f.Uri) + }() + if err != nil { + panic(err) + } + + if f.Parser.structs[structName] == nil { + f.Parser.structs[structName] = newStruct() + } + + if f.Inline { + p2 := newParser(f.Parser.schemaCli) + p2.structs[structName] = newStruct() + + if err := p2.GenerateFromJsonSchema(p2.structs[structName], childType, jsonSchema); err != nil { + return "", "", err + } + + fields2, inputFields2 := f.Parser.structs[structName].mergeParser(p2.structs[structName], childType) + + if !f.GraphqlTag.OnlyInput { + *f.Fields = append(*f.Fields, fields2...) + } + if !f.GraphqlTag.NoInput { + *f.InputFields = append(*f.InputFields, inputFields2...) + } + + return "", "", err + } + + fieldType = toFieldType(childType, !f.OmitEmpty) + inputFieldType = toFieldType(childType+"In", !f.OmitEmpty && !f.InputOmitEmpty) + if err := f.Parser.GenerateFromJsonSchema(f.Parser.structs[structName], childType, jsonSchema); err != nil { + return "", "", err + } + return fieldType, inputFieldType, err + } + + p2 := newParser(f.Parser.schemaCli) + + p2.structs[structName] = newStruct() + + if f.Name == "ObjectMeta" && f.PkgPath == "k8s.io/apimachinery/pkg/apis/meta/v1" && f.Type.String() == "v1.ObjectMeta" { + if err := p2.GenerateGraphQLSchema(structName, "Metadata", reflect.TypeOf(types.Metadata{}), f.GraphqlTag); err != nil { + return "", "", err + } + fieldType = types.MetadataToGraphqlFieldEntry(f.OmitEmpty) + inputFieldType = types.MetadataToGraphqlInputEntry(f.OmitEmpty) + } else { + if err := p2.GenerateGraphQLSchema(structName, childType, f.Type, f.GraphqlTag); err != nil { + return "", "", err + } + + if f.Inline { + fields2, inputFields2 := f.Parser.structs[structName].mergeParser(p2.structs[structName], childType) + // fmt.Printf("f.Parser.structs[%s]: %#v\n", f.StructName, f.Parser.structs[structName]) + if !f.OnlyInput { + *f.Fields = append(*f.Fields, fields2...) + } + + if !f.NoInput { + *f.InputFields = append(*f.InputFields, inputFields2...) + } + + return "", "", err + } + + if !f.OnlyInput { + fieldType = toFieldType(childType, !f.OmitEmpty) + } + if !f.NoInput { + inputFieldType = toFieldType(childType+"In", !f.OmitEmpty && !f.InputOmitEmpty) + } + } + + for k, v := range p2.structs { + if _, ok := f.Parser.structs[k]; !ok { + f.Parser.structs[k] = newStruct() + } + + if !f.OnlyInput { + for k2, v2 := range v.Types { + f.Parser.structs[k].Types[k2] = v2 + } + } + + for k2, v2 := range v.Enums { + f.Parser.structs[k].Enums[k2] = v2 + } + + if !f.NoInput { + for k2, v2 := range v.Inputs { + f.Parser.structs[k].Inputs[k2] = v2 + } + } + } + + return fieldType, inputFieldType, err +} + +func (f *Field) handleSlice() (fieldType string, inputFieldType string, err error) { + if f.Type.Elem().Kind() == reflect.Struct { + f2 := Field{ + ParentName: f.ParentName, + Name: f.Name, + PkgPath: f.Type.Elem().PkgPath(), + Type: f.Type.Elem(), + StructName: f.StructName, + Fields: f.Fields, + InputFields: f.InputFields, + Parser: f.Parser, + JsonTag: JsonTag{ + Value: f.JsonTag.Value, + OmitEmpty: false, + Inline: false, + }, + GraphqlTag: f.GraphqlTag, + } + + fieldType, inputFieldType, _ := f2.handleStruct() + + return toFieldType(fmt.Sprintf("[%s]", fieldType), !f.OmitEmpty), toFieldType(fmt.Sprintf("[%s]", inputFieldType), !f.OmitEmpty && !f.InputOmitEmpty), err + } + + if f.Type.Elem().Kind() == reflect.Ptr { + f2 := Field{ + ParentName: f.ParentName, + Name: f.Name, + PkgPath: f.Type.Elem().PkgPath(), + Type: f.Type.Elem(), + StructName: f.StructName, + Fields: f.Fields, + InputFields: f.InputFields, + Parser: f.Parser, + JsonTag: JsonTag{ + Value: f.JsonTag.Value, + OmitEmpty: true, + Inline: false, + }, + GraphqlTag: f.GraphqlTag, + } + + fieldType, inputFieldType, _ := f2.handlePtr() + return toFieldType(fmt.Sprintf("[%s]", fieldType), !f.OmitEmpty), toFieldType(fmt.Sprintf("[%s]", inputFieldType), !f.OmitEmpty && !f.InputOmitEmpty), err + } + + fieldType = toFieldType(fmt.Sprintf("[%s]", toFieldType(kindMap[f.Type.Elem().Kind()], true)), !f.OmitEmpty) + inputFieldType = toFieldType(fmt.Sprintf("[%s]", toFieldType(kindMap[f.Type.Elem().Kind()], true)), !f.OmitEmpty && !f.InputOmitEmpty) + return fieldType, inputFieldType, err +} + +func (f *Field) handleMap() (fieldType string, inputFieldType string, err error) { + if f.Type.Elem().Kind() == reflect.Struct { + pkgPath := f.Type.Elem().PkgPath() + + f2 := Field{ + ParentName: f.ParentName, + Name: f.Name, + PkgPath: pkgPath, + Type: f.Type.Elem(), + Fields: f.Fields, + InputFields: f.InputFields, + Parser: f.Parser, + JsonTag: JsonTag{ + Value: f.JsonTag.Value, + OmitEmpty: false, + Inline: false, + }, + GraphqlTag: f.GraphqlTag, + } + if _, _, err := f2.handleStruct(); err != nil { + return "", "", err + } + } + + return toFieldType("Map", !f.OmitEmpty), toFieldType("Map", !f.OmitEmpty && !f.InputOmitEmpty), err +} + +func (f *Field) handlePtr() (fieldType string, inputFieldType string, err error) { + if f.Type.Elem().Kind() == reflect.Struct { + pkgPath := f.Type.Elem().PkgPath() + + f2 := Field{ + ParentName: f.ParentName, + Name: f.Name, + PkgPath: pkgPath, + Type: f.Type.Elem(), + Fields: f.Fields, + InputFields: f.InputFields, + Parser: f.Parser, + JsonTag: JsonTag{ + Value: f.JsonTag.Value, + OmitEmpty: true, // because it is a pointer type + Inline: false, + }, + GraphqlTag: f.GraphqlTag, + } + + if pkgPath == "" { + f2.StructName = f.StructName + return f2.handleStruct() + } + f2.StructName = commonLabel + return f2.handleStruct() + } + + return kindMap[f.Type.Elem().Kind()], kindMap[f.Type.Elem().Kind()], err +} diff --git a/cmd/struct-to-graphql/pkg/parser/parser_test.go b/cmd/struct-to-graphql/pkg/parser/parser_test.go new file mode 100644 index 000000000..310f75f95 --- /dev/null +++ b/cmd/struct-to-graphql/pkg/parser/parser_test.go @@ -0,0 +1,1487 @@ +package parser_test + +import ( + "bytes" + "encoding/json" + "fmt" + "os" + "os/exec" + "path/filepath" + "strings" + "testing" + + rApi "github.com/kloudlite/operator/pkg/operator" + apiExtensionsV1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + + "sigs.k8s.io/yaml" + + exampleTypes "github.com/kloudlite/api/cmd/struct-to-graphql/internal/example/types" + "github.com/kloudlite/api/cmd/struct-to-graphql/pkg/parser" + types2 "github.com/kloudlite/api/cmd/struct-to-graphql/pkg/parser/testdata/types" + "github.com/kloudlite/api/pkg/types" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type ExampleJson struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata"` + Spec struct { + ClusterName string `json:"clusterName"` + NodePoolName string `json:"nodePoolName"` + NodeType string `json:"nodeType" graphql:"enum=worker;master;cluster"` + Taints []string `json:"taints"` + } +} + +type ProjectSpec struct { + AccountName string `json:"accountName"` + ClusterName string `json:"clusterName"` + DisplayName exampleTypes.SampleString `json:"displayName,omitempty"` + TargetNamespace string `json:"targetNamespace"` + Logo string `json:"logo,omitempty"` +} + +type Project struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata"` + Spec ProjectSpec `json:"spec"` + Status rApi.Status `json:"status,omitempty" graphql:"noinput"` +} + +func exampleJsonSchema() ([]byte, error) { + x := `description: Node is the Schema for the nodes API +properties: + apiVersion: + description: 'sample description' + type: string + kind: + description: 'sample description' + type: string + metadata: + type: object + spec: + properties: + clusterName: + type: string + nodePoolName: + type: string + nodeType: + enum: + - worker + - master + - cluster + type: string + taints: + items: + type: string + type: array + required: + - nodeType + - clusterName + - nodePoolName + type: object +required: + - spec +type: object +` + + return yaml.YAMLToJSON([]byte(x)) +} + +func exampleProjectCRD() ([]byte, error) { + x := `apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.8.0 + creationTimestamp: "2023-06-27T06:11:21Z" + generation: 5 + name: projects.crds.kloudlite.io + resourceVersion: "141980035" + uid: ba912e2c-1211-4e1c-bc26-84c11de0c46c +spec: + conversion: + strategy: None + group: crds.kloudlite.io + names: + kind: Project + listKind: ProjectList + plural: projects + singular: project + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .spec.accountName + name: AccountName + type: string + - jsonPath: .spec.clusterName + name: ClusterName + type: string + - jsonPath: .spec.targetNamespace + name: target-namespace + type: string + - jsonPath: .status.isReady + name: Ready + type: boolean + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1 + schema: + openAPIV3Schema: + description: Project is the Schema for the projects API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: ProjectSpec defines the desired state of Project + properties: + accountName: + type: string + clusterName: + type: string + displayName: + type: string + logo: + type: string + targetNamespace: + type: string + required: + - accountName + - clusterName + - targetNamespace + type: object + status: + properties: + checks: + additionalProperties: + properties: + generation: + format: int64 + type: integer + message: + type: string + status: + type: boolean + required: + - status + type: object + type: object + isReady: + type: boolean + lastReconcileTime: + format: date-time + type: string + message: + type: object + x-kubernetes-preserve-unknown-fields: true + resources: + items: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this + representation of an object. Servers should convert recognized + schemas to the latest internal value, and may reject unrecognized + values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource + this object represents. Servers may infer this from the endpoint + the client submits requests to. Cannot be updated. In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + type: string + namespace: + type: string + required: + - name + - namespace + type: object + type: array + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} +` + + return yaml.YAMLToJSON([]byte(x)) +} + +type schemaClient struct{} + +func (s schemaClient) GetK8sJsonSchema(name string) (*apiExtensionsV1.JSONSchemaProps, error) { + if name == "projects.crds.kloudlite.io" { + b, err := exampleProjectCRD() + if err != nil { + return nil, err + } + + crd := apiExtensionsV1.CustomResourceDefinition{} + if err := json.Unmarshal(b, &crd); err != nil { + return nil, err + } + + b2, err := json.Marshal(crd.Spec.Versions[0].Schema.OpenAPIV3Schema) + if err != nil { + return nil, err + } + + var m apiExtensionsV1.JSONSchemaProps + if err := json.Unmarshal(b2, &m); err != nil { + return nil, err + } + return &m, nil + } + + panic("unknown k8s crd resource name") +} + +func (s schemaClient) GetHttpJsonSchema(url string) (*apiExtensionsV1.JSONSchemaProps, error) { + if strings.HasSuffix(url, "example-json-schema") { + schema, err := exampleJsonSchema() + if err != nil { + return nil, err + } + + var m apiExtensionsV1.JSONSchemaProps + if err := json.Unmarshal(schema, &m); err != nil { + return nil, err + } + return &m, nil + } + panic("unknown http route") +} + +func Test_GeneratedGraphqlSchema(t *testing.T) { + schemaCli := &schemaClient{} + + type fields struct { + structs map[string]*parser.Struct + schemaCli parser.SchemaClient + } + + type args struct { + name string + data any + withPagination []string + } + tests := []struct { + name string + fields fields + args args + want map[string]*parser.Struct + wantErr bool + }{ + { + name: "test 1. without any json tag", + fields: fields{ + structs: map[string]*parser.Struct{}, + schemaCli: schemaCli, + }, + args: args{ + name: "User", + data: struct { + ID int + Username string + Gender string + }{}, + }, + want: map[string]*parser.Struct{ + "User": { + Types: map[string][]string{ + "User": { + "ID: Int!", + "Username: String!", + "Gender: String!", + }, + }, + Inputs: map[string][]string{ + "UserIn": { + "ID: Int!", + "Username: String!", + "Gender: String!", + }, + }, + Enums: map[string][]string{}, + }, + }, + }, + { + name: "test 2. with json tags, for naming", + fields: fields{ + structs: map[string]*parser.Struct{}, + schemaCli: schemaCli, + }, + args: args{ + name: "User", + data: struct { + ID int `json:"id,omitempty"` + Username string `json:"username"` + Gender string `json:"gender"` + }{}, + }, + want: map[string]*parser.Struct{ + "User": { + Types: map[string][]string{ + "User": { + "id: Int", + "username: String!", + "gender: String!", + }, + }, + Inputs: map[string][]string{ + "UserIn": { + "id: Int", + "username: String!", + "gender: String!", + }, + }, + Enums: map[string][]string{}, + }, + }, + }, + { + name: "test 3. with json tags for naming, and graphql enum tags", + fields: fields{ + structs: map[string]*parser.Struct{}, + schemaCli: schemaCli, + }, + args: args{ + name: "User", + data: struct { + ID int `json:"id,omitempty"` + Username string `json:"username"` + Gender string `json:"gender" graphql:"enum=MALE;FEMALE"` + }{}, + }, + want: map[string]*parser.Struct{ + "User": { + Types: map[string][]string{ + "User": { + "id: Int", + "username: String!", + "gender: UserGender!", + }, + }, + Inputs: map[string][]string{ + "UserIn": { + "id: Int", + "username: String!", + "gender: UserGender!", + }, + }, + Enums: map[string][]string{ + "UserGender": { + "FEMALE", + "MALE", + }, + }, + }, + }, + }, + { + name: "test 4. with struct containing slice field", + fields: fields{ + structs: map[string]*parser.Struct{}, + schemaCli: schemaCli, + }, + args: args{ + name: "Post", + data: struct { + ID int + Title string + Content string + Tags []string + }{}, + }, + want: map[string]*parser.Struct{ + "Post": { + Types: map[string][]string{ + "Post": { + "ID: Int!", + "Title: String!", + "Content: String!", + "Tags: [String!]!", + }, + }, + Inputs: map[string][]string{ + "PostIn": { + "ID: Int!", + "Title: String!", + "Content: String!", + "Tags: [String!]!", + }, + }, + Enums: map[string][]string{}, + }, + }, + }, + { + name: "test 5. with struct containing pointer field", + fields: fields{ + structs: map[string]*parser.Struct{}, + schemaCli: schemaCli, + }, + args: args{ + name: "Address", + data: struct { + Street string + City string + Country *string + }{}, + }, + want: map[string]*parser.Struct{ + "Address": { + Types: map[string][]string{ + "Address": { + "Street: String!", + "City: String!", + "Country: String", + }, + }, + Inputs: map[string][]string{ + "AddressIn": { + "Street: String!", + "City: String!", + "Country: String", + }, + }, + Enums: map[string][]string{}, + }, + }, + }, + { + name: "test 6. with struct containing nested anonymous struct field", + fields: fields{ + structs: map[string]*parser.Struct{}, + schemaCli: schemaCli, + }, + args: args{ + name: "Employee", + data: struct { + ID int + Name string + Address struct { + Street string + City string + } + }{}, + }, + want: map[string]*parser.Struct{ + "Employee": { + Types: map[string][]string{ + "Employee": { + "ID: Int!", + "Name: String!", + "Address: EmployeeAddress!", + }, + "EmployeeAddress": { + "Street: String!", + "City: String!", + }, + }, + Inputs: map[string][]string{ + "EmployeeIn": { + "ID: Int!", + "Name: String!", + "Address: EmployeeAddressIn!", + }, + "EmployeeAddressIn": { + "Street: String!", + "City: String!", + }, + }, + Enums: map[string][]string{}, + }, + }, + }, + { + name: "test 7. with struct containing nested struct field with json tags", + fields: fields{ + structs: map[string]*parser.Struct{}, + schemaCli: schemaCli, + }, + args: args{ + name: "Employee", + data: struct { + ID int + Name string + Address struct { + Street string `json:"street"` + City string `json:"city"` + } `json:"address"` + }{}, + }, + want: map[string]*parser.Struct{ + "Employee": { + Types: map[string][]string{ + "Employee": { + "ID: Int!", + "Name: String!", + "address: EmployeeAddress!", + }, + "EmployeeAddress": { + "street: String!", + "city: String!", + }, + }, + Inputs: map[string][]string{ + "EmployeeIn": { + "ID: Int!", + "Name: String!", + "address: EmployeeAddressIn!", + }, + "EmployeeAddressIn": { + "street: String!", + "city: String!", + }, + }, + Enums: map[string][]string{}, + }, + }, + }, + { + name: "test 8. with struct containing struct pointer field", + fields: fields{ + structs: map[string]*parser.Struct{}, + schemaCli: schemaCli, + }, + args: args{ + name: "Company", + data: struct { + ID int + Name string + Address *struct { + Street string + City string + } + }{}, + }, + want: map[string]*parser.Struct{ + "Company": { + Types: map[string][]string{ + "Company": { + "ID: Int!", + "Name: String!", + "Address: CompanyAddress", + }, + "CompanyAddress": { + "Street: String!", + "City: String!", + }, + }, + Inputs: map[string][]string{ + "CompanyIn": { + "ID: Int!", + "Name: String!", + "Address: CompanyAddressIn", + }, + "CompanyAddressIn": { + "Street: String!", + "City: String!", + }, + }, + Enums: map[string][]string{}, + }, + }, + }, + { + name: "test 9. with struct containing struct slice field", + fields: fields{ + structs: map[string]*parser.Struct{}, + schemaCli: schemaCli, + }, + args: args{ + name: "Organization", + data: struct { + ID int + Name string + Employees []struct { + ID int + Name string + } + }{}, + }, + want: map[string]*parser.Struct{ + "Organization": { + Types: map[string][]string{ + "Organization": { + "ID: Int!", + "Name: String!", + "Employees: [OrganizationEmployees!]!", + }, + "OrganizationEmployees": { + "ID: Int!", + "Name: String!", + }, + }, + Inputs: map[string][]string{ + "OrganizationIn": { + "ID: Int!", + "Name: String!", + "Employees: [OrganizationEmployeesIn!]!", + }, + "OrganizationEmployeesIn": { + "ID: Int!", + "Name: String!", + }, + }, + Enums: map[string][]string{}, + }, + }, + }, + { + name: "test 10. with struct containing struct slice field with json tags", + fields: fields{ + structs: map[string]*parser.Struct{}, + schemaCli: schemaCli, + }, + args: args{ + name: "Organization", + data: struct { + ID int + Name string + Employees []struct { + ID int `json:"employee_id"` + Name string `json:"employee_name"` + } `json:"employees"` + }{}, + }, + want: map[string]*parser.Struct{ + "Organization": { + Types: map[string][]string{ + "Organization": { + "ID: Int!", + "Name: String!", + "employees: [OrganizationEmployees!]!", + }, + "OrganizationEmployees": { + "employee_id: Int!", + "employee_name: String!", + }, + }, + Inputs: map[string][]string{ + "OrganizationIn": { + "ID: Int!", + "Name: String!", + "employees: [OrganizationEmployeesIn!]!", + }, + "OrganizationEmployeesIn": { + "employee_id: Int!", + "employee_name: String!", + }, + }, + Enums: map[string][]string{}, + }, + }, + }, + { + name: "test 11. with struct containing enum field", + fields: fields{ + structs: map[string]*parser.Struct{}, + schemaCli: schemaCli, + }, + args: args{ + name: "Product", + data: struct { + ID int + Name string + Category string `graphql:"enum=ELECTRONICS;FASHION;SPORTS"` + }{}, + }, + want: map[string]*parser.Struct{ + "Product": { + Types: map[string][]string{ + "Product": { + "ID: Int!", + "Name: String!", + "Category: ProductCategory!", + }, + }, + Inputs: map[string][]string{ + "ProductIn": { + "ID: Int!", + "Name: String!", + "Category: ProductCategory!", + }, + }, + Enums: map[string][]string{ + "ProductCategory": { + "ELECTRONICS", + "FASHION", + "SPORTS", + }, + }, + }, + }, + }, + { + name: "test 12. with struct containing struct slice to pointer of a inline struct", + fields: fields{ + structs: map[string]*parser.Struct{}, + schemaCli: schemaCli, + }, + args: args{ + name: "Organization", + data: struct { + ID int + Name string + Employees []*struct { + ID int `json:"employee_id"` + Name string `json:"employee_name"` + } `json:"employees"` + }{}, + }, + want: map[string]*parser.Struct{ + "Organization": { + Types: map[string][]string{ + "Organization": { + "ID: Int!", + "Name: String!", + "employees: [OrganizationEmployees]!", + }, + "OrganizationEmployees": { + "employee_id: Int!", + "employee_name: String!", + }, + }, + Inputs: map[string][]string{ + "OrganizationIn": { + "ID: Int!", + "Name: String!", + "employees: [OrganizationEmployeesIn]!", + }, + "OrganizationEmployeesIn": { + "employee_id: Int!", + "employee_name: String!", + }, + }, + Enums: map[string][]string{}, + }, + }, + }, + { + name: "test 13. with struct containing map field", + fields: fields{ + structs: map[string]*parser.Struct{}, + schemaCli: schemaCli, + }, + args: args{ + name: "User", + data: struct { + ID int + Name string + Email string + Tags map[string]string + KVs map[string]any `json:"kvs"` + }{}, + }, + want: map[string]*parser.Struct{ + "User": { + Types: map[string][]string{ + "User": { + "ID: Int!", + "Name: String!", + "Email: String!", + "Tags: Map!", + "kvs: Map!", + }, + }, + Inputs: map[string][]string{ + "UserIn": { + "ID: Int!", + "Name: String!", + "Email: String!", + "Tags: Map!", + "kvs: Map!", + }, + }, + Enums: map[string][]string{}, + }, + }, + }, + { + name: "test 14. with struct containing nested kloudlite CRD", + fields: fields{ + structs: map[string]*parser.Struct{}, + schemaCli: schemaCli, + }, + args: args{ + name: "Project", + data: struct { + AccountName string + Project Project `json:",inline"` + }{}, + }, + want: map[string]*parser.Struct{ + "Project": { + Types: map[string][]string{ + "Project": { + "AccountName: String!", + "apiVersion: String", + "kind: String", + "metadata: Metadata! @goField(name: \"objectMeta\")", + "spec: Github__com___kloudlite___api___cmd___struct____to____graphql___pkg___parser_test__ProjectSpec!", + "status: Github__com___kloudlite___operator___pkg___operator__Status", + }, + }, + Inputs: map[string][]string{ + "ProjectIn": { + "apiVersion: String", + "kind: String", + "AccountName: String!", + "metadata: MetadataIn!", + "spec: Github__com___kloudlite___api___cmd___struct____to____graphql___pkg___parser_test__ProjectSpecIn!", + }, + }, + Enums: map[string][]string{}, + }, + "common-types": { + Types: map[string][]string{ + "Github__com___kloudlite___api___cmd___struct____to____graphql___pkg___parser_test__ProjectSpec": { + "accountName: String!", + "clusterName: String!", + "displayName: Github__com___kloudlite___api___cmd___struct____to____graphql___internal___example___types__SampleString", + "logo: String", + "targetNamespace: String!", + }, + "Github__com___kloudlite___operator___pkg___operator__Check": { + "status: Boolean!", + "message: String", + "generation: Int", + }, + "Github__com___kloudlite___operator___pkg___operator__ResourceRef": { + "apiVersion: String", + "kind: String", + "namespace: String!", + "name: String!", + }, + "Github__com___kloudlite___operator___pkg___operator__Status": { + "isReady: Boolean!", + "resources: [Github__com___kloudlite___operator___pkg___operator__ResourceRef!]", + "message: Github__com___kloudlite___operator___pkg___raw____json__RawJson", + "checks: Map", + "lastReadyGeneration: Int", + "lastReconcileTime: Date", + }, + "Github__com___kloudlite___operator___pkg___raw____json__RawJson": { + "RawMessage: Any", + }, + "Metadata": { + "name: String!", + "namespace: String", + "labels: Map", + "annotations: Map", + "generation: Int!", + "creationTimestamp: Date!", + "deletionTimestamp: Date", + }, + }, + Inputs: map[string][]string{ + "Github__com___kloudlite___api___cmd___struct____to____graphql___pkg___parser_test__ProjectSpecIn": { + "accountName: String!", + "clusterName: String!", + "displayName: Github__com___kloudlite___api___cmd___struct____to____graphql___internal___example___types__SampleString", + "logo: String", + "targetNamespace: String!", + }, + "MetadataIn": { + "name: String!", + "namespace: String", + "labels: Map", + "annotations: Map", + }, + }, + Enums: map[string][]string{ + "Github__com___kloudlite___api___cmd___struct____to____graphql___internal___example___types__SampleString": { + "item_1", + "item_2", + "item_3", + }, + }, + }, + }, + }, + { + name: "test 15. with pagination enabled", + fields: fields{ + structs: map[string]*parser.Struct{}, + schemaCli: schemaCli, + }, + args: args{ + name: "User", + data: struct { + ID int + Username string + Gender string + }{}, + withPagination: []string{"User"}, + }, + want: map[string]*parser.Struct{ + "User": { + Types: map[string][]string{ + "User": { + "ID: Int!", + "Username: String!", + "Gender: String!", + }, + "UserPaginatedRecords": { + "totalCount: Int!", + "edges: [UserEdge!]!", + "pageInfo: PageInfo!", + }, + "UserEdge": { + "node: User!", + "cursor: String!", + }, + }, + Inputs: map[string][]string{ + "UserIn": { + "ID: Int!", + "Username: String!", + "Gender: String!", + }, + }, + Enums: map[string][]string{}, + }, + "common-types": { + Types: map[string][]string{ + "PageInfo": { + "hasNextPage: Boolean", + "hasPreviousPage: Boolean", + "startCursor: String", + "endCursor: String", + }, + }, + }, + }, + }, + { + name: "test 16. (with graphql (noinput))", + fields: fields{ + structs: map[string]*parser.Struct{}, + schemaCli: schemaCli, + }, + args: args{ + name: "User", + data: struct { + SyncStatus types.SyncStatus `json:"syncStatus" graphql:"noinput"` + }{}, + }, + want: map[string]*parser.Struct{ + "User": { + Types: map[string][]string{ + "User": { + "syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus!", + }, + }, + Inputs: map[string][]string{}, + Enums: map[string][]string{}, + }, + "common-types": { + Types: map[string][]string{ + "Github__com___kloudlite___api___pkg___types__SyncStatus": { + "action: Github__com___kloudlite___api___pkg___types__SyncAction!", + "error: String", + "recordVersion: Int!", + "lastSyncedAt: Date", + "state: Github__com___kloudlite___api___pkg___types__SyncState!", + "syncScheduledAt: Date", + }, + }, + Enums: map[string][]string{ + "Github__com___kloudlite___api___pkg___types__SyncAction": { + "APPLY", + "DELETE", + }, + "Github__com___kloudlite___api___pkg___types__SyncState": { + "IDLE", + "IN_QUEUE", + "APPLIED_AT_AGENT", + "ERRORED_AT_AGENT", + "UPDATED_AT_AGENT", + "DELETING_AT_AGENT", + "DELETED_AT_AGENT", + }, + }, + }, + }, + }, + { + name: "test 17. with json schema http uri, and Spec field with no json tag", + fields: fields{ + structs: map[string]*parser.Struct{}, + schemaCli: schemaCli, + }, + args: args{ + name: "Example", + data: struct { + Example ExampleJson `json:"example"` + }{}, + }, + want: map[string]*parser.Struct{ + "Example": { + Types: map[string][]string{ + "Example": { + "example: Github__com___kloudlite___api___cmd___struct____to____graphql___pkg___parser_test__ExampleJson!", + }, + }, + Inputs: map[string][]string{ + "ExampleIn": { + "example: Github__com___kloudlite___api___cmd___struct____to____graphql___pkg___parser_test__ExampleJsonIn!", + }, + }, + Enums: map[string][]string{}, + }, + "common-types": { + Types: map[string][]string{ + "Github__com___kloudlite___api___cmd___struct____to____graphql___pkg___parser_test__ExampleJson": { + "apiVersion: String", + "kind: String", + "metadata: Metadata! @goField(name: \"objectMeta\")", + "Spec: Github__com___kloudlite___api___cmd___struct____to____graphql___pkg___parser_test__ExampleJsonSpec!", + }, + "Github__com___kloudlite___api___cmd___struct____to____graphql___pkg___parser_test__ExampleJsonSpec": { + "clusterName: String!", + "nodePoolName: String!", + "nodeType: Github__com___kloudlite___api___cmd___struct____to____graphql___pkg___parser_test__ExampleJsonSpecNodeType!", + "taints: [String!]!", + }, + "Metadata": { + "annotations: Map", + "labels: Map", + "name: String!", + "namespace: String", + "creationTimestamp: Date!", + "deletionTimestamp: Date", + "generation: Int!", + }, + }, + Inputs: map[string][]string{ + "Github__com___kloudlite___api___cmd___struct____to____graphql___pkg___parser_test__ExampleJsonIn": { + "apiVersion: String", + "kind: String", + "metadata: MetadataIn!", + "Spec: Github__com___kloudlite___api___cmd___struct____to____graphql___pkg___parser_test__ExampleJsonSpecIn!", + }, + "Github__com___kloudlite___api___cmd___struct____to____graphql___pkg___parser_test__ExampleJsonSpecIn": { + "clusterName: String!", + "nodePoolName: String!", + "nodeType: Github__com___kloudlite___api___cmd___struct____to____graphql___pkg___parser_test__ExampleJsonSpecNodeType!", + "taints: [String!]!", + }, + "MetadataIn": { + "annotations: Map", + "labels: Map", + "name: String!", + "namespace: String", + }, + }, + Enums: map[string][]string{ + "Github__com___kloudlite___api___cmd___struct____to____graphql___pkg___parser_test__ExampleJsonSpecNodeType": { + "worker", + "master", + "cluster", + }, + }, + }, + }, + }, + { + name: "test 18. with some empty enums", + fields: fields{ + structs: map[string]*parser.Struct{}, + schemaCli: schemaCli, + }, + args: args{ + name: "User", + data: struct { + Example string `json:"example" graphql:"enum=e1;e2;;e3;;e4"` + }{}, + }, + want: map[string]*parser.Struct{ + "Example": { + Types: map[string][]string{ + "User": { + "example: UserExample!", + }, + }, + Inputs: map[string][]string{ + "UserIn": { + "example: UserExample!", + }, + }, + Enums: map[string][]string{ + "UserExample": { + "e1", + "e2", + "e3", + "e4", + }, + }, + }, + }, + }, + { + name: "test 19. with default values for fields, with single-quoted string as default", + fields: fields{ + structs: map[string]*parser.Struct{}, + schemaCli: schemaCli, + }, + args: args{ + name: "Account", + data: struct { + IsActive bool `json:"isActive" graphql:"default=true"` + Country string `json:"country" graphql:"default='INDIA'"` + Region string `json:"region" graphql:"default=\"us-east-1\""` + }{}, + }, + wantErr: true, + want: map[string]*parser.Struct{ + "Account": { + Types: map[string][]string{ + "Account": { + "isActive: Boolean!", + "country: String!", + "region: String!", + }, + }, + Inputs: map[string][]string{ + "AccountIn": { + "isActive: Boolean! = true", + "country: String! = 'INDIA'", + "region: String! = \"us-east-1\"", + }, + }, + Enums: map[string][]string{}, + }, + }, + }, + + { + name: "test 20. with default values for fields, with correct defaults", + fields: fields{ + structs: map[string]*parser.Struct{}, + schemaCli: schemaCli, + }, + args: args{ + name: "Account", + data: struct { + IsActive bool `json:"isActive" graphql:"default=true"` + Country string `json:"country" graphql:"default=\"INDIA\""` + Region string `json:"region" graphql:"default=\"us-east-1\""` + }{}, + }, + want: map[string]*parser.Struct{ + "Account": { + Types: map[string][]string{ + "Account": { + "isActive: Boolean!", + "country: String!", + "region: String!", + }, + }, + Inputs: map[string][]string{ + "AccountIn": { + "isActive: Boolean! = true", + "country: String! = \"INDIA\"", + "region: String! = \"us-east-1\"", + }, + }, + Enums: map[string][]string{}, + }, + }, + }, + + { + name: "test 21. embedded struct with json inline tags", + fields: fields{structs: map[string]*parser.Struct{}, schemaCli: schemaCli}, + args: args{ + name: "Sample", + data: struct { + Name string `json:"name"` + ProjectSpec `json:",inline"` + }{}, + }, + want: map[string]*parser.Struct{ + "Sample": { + Types: map[string][]string{ + "Sample": { + "name: String!", + "accountName: String!", + "clusterName: String!", + "displayName: Github__com___kloudlite___api___cmd___struct____to____graphql___internal___example___types__SampleString", + "logo: String", + "targetNamespace: String!", + }, + }, + Inputs: map[string][]string{ + "SampleIn": { + "name: String!", + "accountName: String!", + "clusterName: String!", + "displayName: Github__com___kloudlite___api___cmd___struct____to____graphql___internal___example___types__SampleString", + "logo: String", + "targetNamespace: String!", + }, + }, + }, + "common-types": { + Enums: map[string][]string{ + "Github__com___kloudlite___api___cmd___struct____to____graphql___internal___example___types__SampleString": { + "item_1", + "item_2", + "item_3", + }, + }, + }, + }, + wantErr: false, + }, + + { + name: "test 22. embedded struct (imported from other package) with json inline tags", + fields: fields{structs: map[string]*parser.Struct{}, schemaCli: schemaCli}, + args: args{ + name: "Sample", + data: struct { + Name string `json:"name"` + types2.Sample `json:",inline"` + }{}, + }, + want: map[string]*parser.Struct{ + "Sample": { + Types: map[string][]string{ + "Sample": { + "name: String!", + "displayName: String!", + "age: Int!", + "createdBy: Github__com___kloudlite___api___cmd___struct____to____graphql___pkg___parser___testdata___types__ActionMeta!", + "updatedBy: Github__com___kloudlite___api___cmd___struct____to____graphql___pkg___parser___testdata___types__ActionMeta!", + }, + }, + Inputs: map[string][]string{ + "SampleIn": { + "name: String!", + "displayName: String!", + "age: Int!", + "createdBy: Github__com___kloudlite___api___cmd___struct____to____graphql___pkg___parser___testdata___types__ActionMetaIn!", + "updatedBy: Github__com___kloudlite___api___cmd___struct____to____graphql___pkg___parser___testdata___types__ActionMetaIn!", + }, + }, + }, + "common-types": { + Types: map[string][]string{ + "Github__com___kloudlite___api___cmd___struct____to____graphql___pkg___parser___testdata___types__ActionMeta": { + "firstName: String!", + "lastName: String!", + }, + }, + Inputs: map[string][]string{ + "Github__com___kloudlite___api___cmd___struct____to____graphql___pkg___parser___testdata___types__ActionMetaIn": { + "firstName: String!", + "lastName: String!", + }, + }, + }, + }, + wantErr: false, + }, + + { + name: "test 23. string type as an enum of constants defined in pkg", + fields: fields{structs: map[string]*parser.Struct{}, schemaCli: schemaCli}, + args: args{ + name: "Sample", + data: struct { + Name string `json:"name"` + SampleName exampleTypes.SampleString `json:"sampleName,omitempty"` + }{}, + }, + want: map[string]*parser.Struct{ + "Sample": { + Types: map[string][]string{ + "Sample": { + "name: String!", + "sampleName: Github__com___kloudlite___api___cmd___struct____to____graphql___internal___example___types__SampleString", + }, + }, + Inputs: map[string][]string{ + "SampleIn": { + "name: String!", + "sampleName: Github__com___kloudlite___api___cmd___struct____to____graphql___internal___example___types__SampleString", + }, + }, + }, + "common-types": { + Enums: map[string][]string{ + "Github__com___kloudlite___api___cmd___struct____to____graphql___internal___example___types__SampleString": { + "item_1", + "item_2", + "item_3", + }, + }, + }, + }, + wantErr: false, + }, + + { + name: "test 24. overriding struct's omitempty json tags, with inline specified", + fields: fields{structs: map[string]*parser.Struct{}, schemaCli: schemaCli}, + args: args{ + name: "Sample", + data: struct { + //Type1 metav1.TypeMeta `json:"type1"` + //Type2 metav1.TypeMeta `json:"inline" graphql:"children-required"` + metav1.TypeMeta `json:",inline" graphql:"children-required"` + }{}, + }, + want: map[string]*parser.Struct{ + "Sample": { + Types: map[string][]string{ + "Sample": { + "apiVersion: String!", + "kind: String!", + }, + }, + Inputs: map[string][]string{ + "SampleIn": { + "apiVersion: String!", + "kind: String!", + }, + }, + }, + "common-types": {}, + }, + wantErr: false, + }, + + { + name: "test 25. overriding struct's omitempty json tags, with inline specified", + fields: fields{structs: map[string]*parser.Struct{}, schemaCli: schemaCli}, + args: args{ + name: "Sample", + data: struct { + metav1.TypeMeta `json:",inline"` + }{}, + }, + want: map[string]*parser.Struct{ + "Sample": { + Types: map[string][]string{ + "Sample": { + "apiVersion: String", + "kind: String", + }, + }, + Inputs: map[string][]string{ + "SampleIn": { + "apiVersion: String", + "kind: String", + }, + }, + }, + "common-types": {}, + }, + wantErr: false, + }, + } + + for _idx, _tt := range tests { + idx := _idx + tt := _tt + + t.Run(tt.name, func(t *testing.T) { + // t.Parallel() + + p := parser.NewParser(tt.fields.schemaCli) + err := p.LoadStruct(tt.args.name, tt.args.data) + if err != nil { + if tt.wantErr { + return + } + t.Error(err) + } + + p.WithPagination(tt.args.withPagination) + + testDir := filepath.Join(os.TempDir(), fmt.Sprintf("struct-to-graphql-testcase-%d", idx+1)) + os.Mkdir(testDir, 0o755) + t.Logf("testcase output directory: %s", testDir) + + gbuft := new(bytes.Buffer) + gbufc := new(bytes.Buffer) + p.PrintTypes(gbuft) + p.PrintCommonTypes(gbufc) + gotTypes := gbuft.String() + gotCommonTypes := gbufc.String() + + wantParser := parser.NewUnsafeParser(tt.want, nil) + wbuft := new(bytes.Buffer) + wbufc := new(bytes.Buffer) + wantParser.PrintTypes(wbuft) + wantParser.PrintCommonTypes(wbufc) + wantTypes := wbuft.String() + wantCommonTypes := wbufc.String() + + g, err := os.Create(filepath.Join(testDir, "./got.types.graphql")) + if err != nil { + t.Error(err) + } + g.WriteString(gotTypes) + + w, err := os.Create(filepath.Join(testDir, "./want.types.graphql")) + if err != nil { + t.Error(err) + } + w.WriteString(wantTypes) + + if gotTypes != wantTypes { + t.Logf("diff %s %s", g.Name(), w.Name()) + b, err := exec.Command("diff", g.Name(), w.Name()).CombinedOutput() + if err != nil { + t.Error(err) + } + + t.Errorf("diff output: \n%s\n", b) + } + + g, err = os.Create(filepath.Join(testDir, "./got.common-types.graphql")) + if err != nil { + t.Error(err) + } + g.WriteString(gotCommonTypes) + + w, err = os.Create(filepath.Join(testDir, "./want.common-types.graphql")) + if err != nil { + t.Error(err) + } + w.WriteString(wantCommonTypes) + + if gotCommonTypes != wantCommonTypes { + t.Logf("diff %s %s", g.Name(), w.Name()) + b, err := exec.Command("diff", g.Name(), w.Name()).CombinedOutput() + if err != nil { + t.Error(err) + } + + t.Errorf("diff output: \n%s\n", b) + } + }) + } +} diff --git a/cmd/struct-to-graphql/pkg/parser/testdata/types/types.go b/cmd/struct-to-graphql/pkg/parser/testdata/types/types.go new file mode 100644 index 000000000..ec70c8fc5 --- /dev/null +++ b/cmd/struct-to-graphql/pkg/parser/testdata/types/types.go @@ -0,0 +1,13 @@ +package types + +type ActionMeta struct { + FirstName string `json:"firstName"` + LastName string `json:"lastName"` +} + +type Sample struct { + DisplayName string `json:"displayName"` + CreatedBy ActionMeta `json:"createdBy"` + UpdatedBy ActionMeta `json:"updatedBy"` + Age int `json:"age"` +} diff --git a/cmd/struct-to-graphql/pkg/parser/types/kloudlite-custom-types.go b/cmd/struct-to-graphql/pkg/parser/types/kloudlite-custom-types.go new file mode 100644 index 000000000..de89391d3 --- /dev/null +++ b/cmd/struct-to-graphql/pkg/parser/types/kloudlite-custom-types.go @@ -0,0 +1,35 @@ +package types + +import ( + "fmt" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type Metadata struct { + Name string `json:"name"` + Namespace string `json:"namespace,omitempty"` + + Labels map[string]string `json:"labels,omitempty"` + Annotations map[string]string `json:"annotations,omitempty"` + + Generation int64 `json:"generation" graphql:"noinput"` + CreationTimestamp metav1.Time `json:"creationTimestamp" graphql:"noinput"` + DeletionTimestamp *metav1.Time `json:"deletionTimestamp,omitempty" graphql:"noinput"` +} + +func MetadataToGraphqlFieldEntry(omitEmpty bool) string { + required := "" + if !omitEmpty { + required = "!" + } + return fmt.Sprintf(`Metadata%s @goField(name: "objectMeta")`, required) +} + +func MetadataToGraphqlInputEntry(omitEmpty bool) string { + required := "" + if !omitEmpty { + required = "!" + } + return fmt.Sprintf(`MetadataIn%s`, required) +} diff --git a/common/banner.go b/common/banner.go new file mode 100644 index 000000000..bb96916f9 --- /dev/null +++ b/common/banner.go @@ -0,0 +1,30 @@ +package common + +import "fmt" + +var BuiltAt string + +const KloudliteBanner = ` + , + ##### + ######## + ######## + ######## ##### + ######## *######### ██╗ ██╗██╗ ██████╗ ██╗ ██╗██████╗ ██╗ ██╗████████╗███████╗ + ######## ############### ██║ ██╔╝██║ ██╔═══██╗██║ ██║██╔══██╗██║ ██║╚══██╔══╝██╔════╝ + ######## *################### █████╔╝ ██║ ██║ ██║██║ ██║██║ ██║██║ ██║ ██║ █████╗ + #######/ ######################## ██╔═██╗ ██║ ██║ ██║██║ ██║██║ ██║██║ ██║ ██║ ██╔══╝ + #######( ################### ██║ ██╗███████╗╚██████╔╝╚██████╔╝██████╔╝███████╗██║ ██║ ███████╗ + (#######. ##############* ╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝ ╚══════╝ + ######## #(####### + (#######. ####* __ ___ __ + ######## |__) |__ /\ | \ \ / + /######(. | \ |___ /~~\ |__/ | BuiltAt: %s + ##### + , + +` + +func PrintReadyBanner() { + fmt.Printf(KloudliteBanner, BuiltAt) +} diff --git a/common/fields/patch-constants.go b/common/fields/patch-constants.go new file mode 100644 index 000000000..85e6739ca --- /dev/null +++ b/common/fields/patch-constants.go @@ -0,0 +1,56 @@ +package fields + +// constant vars generated for struct +const ( + AccountName = "accountName" + ApiVersion = "apiVersion" + ClusterName = "clusterName" + CreatedBy = "createdBy" + CreatedByUserEmail = "createdBy.userEmail" + CreatedByUserId = "createdBy.userId" + CreatedByUserName = "createdBy.userName" + CreationTime = "creationTime" + DisplayName = "displayName" + EnvironmentName = "environmentName" + Id = "id" + Kind = "kind" + LastUpdatedBy = "lastUpdatedBy" + LastUpdatedByUserEmail = "lastUpdatedBy.userEmail" + LastUpdatedByUserId = "lastUpdatedBy.userId" + LastUpdatedByUserName = "lastUpdatedBy.userName" + MarkedForDeletion = "markedForDeletion" + Metadata = "metadata" + MetadataAnnotations = "metadata.annotations" + MetadataCreationTimestamp = "metadata.creationTimestamp" + MetadataDeletionGracePeriodSeconds = "metadata.deletionGracePeriodSeconds" + MetadataDeletionTimestamp = "metadata.deletionTimestamp" + MetadataFinalizers = "metadata.finalizers" + MetadataGenerateName = "metadata.generateName" + MetadataGeneration = "metadata.generation" + MetadataLabels = "metadata.labels" + MetadataManagedFields = "metadata.managedFields" + MetadataName = "metadata.name" + MetadataNamespace = "metadata.namespace" + MetadataOwnerReferences = "metadata.ownerReferences" + MetadataResourceVersion = "metadata.resourceVersion" + MetadataSelfLink = "metadata.selfLink" + MetadataUid = "metadata.uid" + ProjectName = "projectName" + RecordVersion = "recordVersion" + Status = "status" + StatusChecks = "status.checks" + StatusIsReady = "status.isReady" + StatusLastReadyGeneration = "status.lastReadyGeneration" + StatusLastReconcileTime = "status.lastReconcileTime" + StatusMessage = "status.message" + StatusMessageItems = "status.message.items" + StatusResources = "status.resources" + SyncStatus = "syncStatus" + SyncStatusAction = "syncStatus.action" + SyncStatusError = "syncStatus.error" + SyncStatusLastSyncedAt = "syncStatus.lastSyncedAt" + SyncStatusRecordVersion = "syncStatus.recordVersion" + SyncStatusState = "syncStatus.state" + SyncStatusSyncScheduledAt = "syncStatus.syncScheduledAt" + UpdateTime = "updateTime" +) diff --git a/common/graphql-scalar-resolvers.go b/common/graphql-scalar-resolvers.go index 0202d5558..514349e74 100644 --- a/common/graphql-scalar-resolvers.go +++ b/common/graphql-scalar-resolvers.go @@ -4,17 +4,20 @@ import ( "context" "encoding/json" "fmt" + "time" + + fn "github.com/kloudlite/api/pkg/functions" + t "github.com/kloudlite/api/pkg/types" json_patch "github.com/kloudlite/operator/pkg/json-patch" "github.com/kloudlite/operator/pkg/operator" "k8s.io/apimachinery/pkg/apis/meta/v1" - fn "kloudlite.io/pkg/functions" - t "kloudlite.io/pkg/types" - "time" ) -type MetadataResolver struct{} -type StatusResolver struct{} -type MetadataInResolver struct{} +type ( + MetadataResolver struct{} + StatusResolver struct{} + MetadataInResolver struct{} +) type PatchResolver struct{} @@ -96,20 +99,23 @@ func (*StatusResolver) Checks(ctx context.Context, obj *operator.Status) (map[st } func (*StatusResolver) DisplayVars(ctx context.Context, obj *operator.Status) (map[string]interface{}, error) { - if obj == nil || obj.DisplayVars == nil { - return nil, nil - } - var m map[string]any - b, err := obj.DisplayVars.MarshalJSON() - if err != nil { - return nil, err - } - if err := json.Unmarshal(b, &m); err != nil { - return nil, err - } - return m, nil + return nil, nil } +// if obj == nil || obj.DisplayVars == nil { +// return nil, nil +// } +// var m map[string]any +// b, err := obj.DisplayVars.MarshalJSON() +// if err != nil { +// return nil, err +// } +// if err := json.Unmarshal(b, &m); err != nil { +// return nil, err +// } +// return m, nil +// } + func (*MetadataResolver) Labels(ctx context.Context, obj *v1.ObjectMeta) (map[string]interface{}, error) { if obj == nil { return nil, nil diff --git a/common/k8s-functions.go b/common/k8s-functions.go new file mode 100644 index 000000000..112d55c59 --- /dev/null +++ b/common/k8s-functions.go @@ -0,0 +1,28 @@ +package common + +import ( + "context" + "fmt" + + "github.com/kloudlite/api/constants" + corev1 "k8s.io/api/core/v1" + apiLabels "k8s.io/apimachinery/pkg/labels" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +func FindNamespaceForAccount(ctx context.Context, k8sCli client.Client, accountName string) (*corev1.Namespace, error) { + var nsList corev1.NamespaceList + if err := k8sCli.List(ctx, &nsList, &client.ListOptions{ + LabelSelector: apiLabels.SelectorFromValidatedSet(map[string]string{ + constants.AccountNameKey: accountName, + }), + }); err != nil { + return nil, err + } + + if len(nsList.Items) > 1 { + return nil, fmt.Errorf("multiple namespaces with label (%s: %s) found, there should have been only one", constants.AccountNameKey, accountName) + } + + return &nsList.Items[0], nil +} diff --git a/common/kafka-topic-name.go b/common/kafka-topic-name.go index 2eb8da763..8645bf5a5 100644 --- a/common/kafka-topic-name.go +++ b/common/kafka-topic-name.go @@ -2,6 +2,39 @@ package common import "fmt" +type topicName string + +const ( + GitWebhookTopicName topicName = "events.webhooks.git" + AuditEventLogTopicName topicName = "events.audit.event-log" +) + func GetKafkaTopicName(accountName string, clusterName string) string { - return fmt.Sprintf("clus-%s-%s-incoming", accountName, clusterName) + return fmt.Sprintf("kl-send-to-acc-%s-clus-%s", accountName, clusterName) +} + +func GetTenantClusterMessagingTopic(accountName string, clusterName string) string { + return fmt.Sprintf("resource-sync.account-%s.cluster-%s.tenant", accountName, clusterName) +} + +type platformEvent string + +const ( + EventErrorOnApply platformEvent = "error-on-apply" + EventResourceUpdate platformEvent = "resource-update" +) + +type messageReceiver string + +const ( + ConsoleReceiver messageReceiver = "kloudlite-console" + InfraReceiver messageReceiver = "kloudlite-infra" + ContainerRegistryReceiver messageReceiver = "kloudlite-cr" +) + +func GetPlatformClusterMessagingTopic(accountName string, clusterName string, controller messageReceiver, ev platformEvent) string { + if accountName == "*" && clusterName == "*" { + return fmt.Sprintf("resource-sync.*.*.platform.%s.%s", controller, ev) + } + return fmt.Sprintf("resource-sync.account-%s.cluster-%s.platform.%s.%s", accountName, clusterName, controller, ev) } diff --git a/common/patch-util.go b/common/patch-util.go new file mode 100644 index 000000000..7b1c0d69a --- /dev/null +++ b/common/patch-util.go @@ -0,0 +1,125 @@ +package common + +import ( + "maps" + "time" + + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/repos" + t "github.com/kloudlite/api/pkg/types" + "github.com/kloudlite/operator/operators/resource-watcher/types" + rApi "github.com/kloudlite/operator/pkg/operator" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type PatchOpts struct { + MessageTimestamp time.Time + XPatch repos.Document +} + +type ResourceForSync interface { + GetName() string + GetNamespace() string + GetCreationTimestamp() metav1.Time + GetLabels() map[string]string + GetDisplayName() string + GetAnnotations() map[string]string + GetGeneration() int64 + GetStatus() rApi.Status + GetRecordVersion() int +} + +type ResourceUpdateContext interface { + GetUserId() repos.ID + GetUserEmail() string + GetUserName() string +} + +func PatchForSyncFromAgent( + res ResourceForSync, + recordVersion int, + status types.ResourceStatus, + opts PatchOpts, +) repos.Document { + generatedPatch := repos.Document{ + fields.MetadataCreationTimestamp: res.GetCreationTimestamp(), + fields.MetadataLabels: res.GetLabels(), + fields.MetadataAnnotations: res.GetAnnotations(), + fields.MetadataGeneration: res.GetGeneration(), + fields.Status: res.GetStatus(), + fields.SyncStatusState: func() t.SyncState { + if status == types.ResourceStatusDeleting { + return t.SyncStateDeletingAtAgent + } + return t.SyncStateUpdatedAtAgent + }(), + fields.SyncStatusRecordVersion: recordVersion, + fields.SyncStatusLastSyncedAt: opts.MessageTimestamp, + fields.SyncStatusError: nil, + } + var patch repos.Document = nil + patch = opts.XPatch + if patch == nil { + return generatedPatch + } + maps.Copy(patch, generatedPatch) + return patch +} + +func PatchForErrorFromAgent(errMsg string, opts PatchOpts) repos.Document { + return repos.Document{ + fields.SyncStatusState: t.SyncStateErroredAtAgent, + fields.SyncStatusLastSyncedAt: opts.MessageTimestamp, + fields.SyncStatusError: errMsg, + } +} + +func PatchForMarkDeletion(opts ...PatchOpts) repos.Document { + generatedPatch := repos.Document{ + fields.MarkedForDeletion: true, + fields.SyncStatusSyncScheduledAt: time.Now(), + fields.SyncStatusAction: t.SyncActionDelete, + fields.SyncStatusState: t.SyncStateIdle, + } + var patch repos.Document = nil + if len(opts) > 0 { + patch = opts[0].XPatch + } + if patch == nil { + return generatedPatch + } + maps.Copy(patch, generatedPatch) + return patch +} + +func PatchForUpdate( + ctx ResourceUpdateContext, + res ResourceForSync, + opts ...PatchOpts, +) repos.Document { + generatedPatch := repos.Document{ + fields.MetadataLabels: res.GetLabels(), + fields.MetadataAnnotations: res.GetAnnotations(), + fields.DisplayName: res.GetDisplayName(), + fields.LastUpdatedBy: CreatedOrUpdatedBy{ + UserId: ctx.GetUserId(), + UserName: ctx.GetUserName(), + UserEmail: ctx.GetUserEmail(), + }, + fields.SyncStatusSyncScheduledAt: time.Now(), + fields.SyncStatusState: t.SyncStateInQueue, + fields.SyncStatusAction: t.SyncActionApply, + "$inc": repos.Document{ + fields.RecordVersion: 1, + }, + } + var patch repos.Document + if len(opts) > 0 { + patch = opts[0].XPatch + } + if patch == nil { + return generatedPatch + } + maps.Copy(patch, generatedPatch) + return patch +} diff --git a/common/session.go b/common/session.go index a4e79187f..3e73cc1b8 100644 --- a/common/session.go +++ b/common/session.go @@ -1,40 +1,16 @@ package common import ( - "fmt" - "strings" - - "kloudlite.io/pkg/functions" - "kloudlite.io/pkg/repos" + "github.com/kloudlite/api/pkg/repos" ) type AuthSession struct { repos.BaseEntity `json:",inline"` UserId repos.ID `json:"user_id"` UserEmail string `json:"user_email"` + UserName string `json:"user_name"` UserVerified bool `json:"user_verified"` LoginMethod string `json:"login_method"` } -type Json map[string]any - -func NewSession( - UserId repos.ID, - UserEmail string, - UserVerified bool, - LoginMethod string, -) *AuthSession { - id, e := functions.CleanerNanoid(28) - if e != nil { - panic(fmt.Errorf("could not get cleanerNanoid()")) - } - sessionId := fmt.Sprintf("ses-%s", strings.ToLower(id)) - s := &AuthSession{ - UserId: UserId, - UserEmail: UserEmail, - UserVerified: UserVerified, - LoginMethod: LoginMethod, - } - s.SetId(repos.ID(sessionId)) - return s -} +type Json map[string]any \ No newline at end of file diff --git a/common/types.go b/common/types.go new file mode 100644 index 000000000..1fca91869 --- /dev/null +++ b/common/types.go @@ -0,0 +1,45 @@ +package common + +import ( + "encoding/json" + + "github.com/kloudlite/api/pkg/repos" +) + +type CreatedOrUpdatedBy struct { + UserId repos.ID `json:"userId"` + UserName string `json:"userName"` + UserEmail string `json:"userEmail"` +} + +type ResourceMetadata struct { + DisplayName string `json:"displayName"` + + CreatedBy CreatedOrUpdatedBy `json:"createdBy" graphql:"noinput"` + LastUpdatedBy CreatedOrUpdatedBy `json:"lastUpdatedBy" graphql:"noinput"` +} + +type ValidationError struct { + Label string + Errors []string +} + +func (v ValidationError) Error() string { + b, _ := json.Marshal(map[string]any{ + "label": v.Label, + "errors": v.Errors, + }) + return string(b) +} + +const ( + CreatedByResourceSyncUsername string = "created-by-resource-sync-user-name" + CreatedByResourceSyncUserEmail string = "created-by-resource-sync-user-email" + CreatedByResourceSyncUserId string = "created-by-resource-sync-user-id" +) + +var CreatedOrUpdatedByResourceSync = CreatedOrUpdatedBy{ + UserId: repos.ID(CreatedByResourceSyncUserId), + UserName: CreatedByResourceSyncUsername, + UserEmail: CreatedByResourceSyncUserEmail, +} diff --git a/constants/constants.go b/constants/constants.go index 3c0996a16..2d1d6e59b 100644 --- a/constants/constants.go +++ b/constants/constants.go @@ -23,10 +23,15 @@ const ( ) const ( - CacheSessionPrefix = "redis-auth" + CacheSessionPrefix = "sessions" CookieName = "hotspot-session" ) +const ( + // source: kubectl apply with an incorrect resource name + K8sNameValidatorRegex = `^[a-z0-9]([-a-z0-9]*[a-z0-9])?([.][a-z0-9]([-a-z0-9]*[a-z0-9])?)*$` +) + const ( ProviderGithub = "github" ProviderGitlab = "gitlab" @@ -118,11 +123,15 @@ var ActionMap = map[Action][]Role{ PayBill: {AccountOwner, AccountAdmin, AccountBiller}, CreateProject: {AccountOwner, AccountAdmin}, - ReadProject: {AccountOwner, AccountAdmin, AccountMember, ProjectAdmin, - ProjectMember, ProjectGuest}, + ReadProject: { + AccountOwner, AccountAdmin, AccountMember, ProjectAdmin, + ProjectMember, ProjectGuest, + }, - UpdateProject: {AccountOwner, AccountAdmin, ProjectAdmin, - ProjectMember}, + UpdateProject: { + AccountOwner, AccountAdmin, ProjectAdmin, + ProjectMember, + }, DeleteProject: {AccountOwner, AccountAdmin, ProjectAdmin}, InviteProjectMember: {AccountOwner, AccountAdmin, ProjectAdmin}, @@ -135,4 +144,15 @@ const ( const ( ClusterNameKey string = "kloudlite.io/cluster.name" EdgeNameKey string = "kloudlite.io/edge.name" + AccountNameKey string = "kloudlite.io/account.name" + + EnvNameKey string = "kloudlite.io/env.name" + + RecordVersionKey string = "kloudlite.io/record-version" + + ObservabilityTrackingKey string = "kloudlite.io/observability.tracking.id" + ObservabilityAccountNameKey string = "kloudlite.io/observability.account.name" + ObservabilityClusterNameKey string = "kloudlite.io/observability.cluster.name" + + ManagedByKloudlite string = "kloudlite.io/managed-by.kloudlite" ) diff --git a/flake.lock b/flake.lock new file mode 100644 index 000000000..db7c35cdb --- /dev/null +++ b/flake.lock @@ -0,0 +1,60 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "id": "flake-utils", + "type": "indirect" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1705856552, + "narHash": "sha256-JXfnuEf5Yd6bhMs/uvM67/joxYKoysyE3M2k6T3eWbg=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "612f97239e2cc474c13c9dafa0df378058c5ad8d", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 000000000..dfb7605a2 --- /dev/null +++ b/flake.nix @@ -0,0 +1,69 @@ +{ + description = "kloudlite api dev environment"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + in + { + packages = { + mocki = pkgs.writeScriptBin "mocki" '' + $PROJECT_ROOT/cmd/mocki/bin/mocki "$@" + ''; + nats-manager = pkgs.writeScriptBin "nats-manager" '' + $PROJECT_ROOT/cmd/nats-manager/bin/nats-manager --url "nats://nats.kloudlite.svc.cluster.local:4222" --stream "resource-sync" "$@" + ''; + }; + devShells.default = pkgs.mkShell { + packages = [ + self.packages.${system}.mocki + self.packages.${system}.nats-manager + ]; + hardeningDisable = [ "all" ]; + buildInputs = with pkgs; [ + # cli tools + curl + jq + yq + go-task + + # source version control + git + pre-commit + (python312.withPackages(ps: with ps; [ + ggshield + ])) + + # programming tools + go_1_21 + operator-sdk + mongosh + natscli + + # kubernetes specific tools + k9s + kubectl + kubernetes-helm + + # grpc tools + protobuf + protoc-gen-go + protoc-gen-go-grpc + + # build tools + podman + upx + ]; + + shellHook = '' + export PROJECT_ROOT="$PWD" + ''; + }; + } + ); +} diff --git a/go.mod b/go.mod index dbdc93e5d..a8106c511 100644 --- a/go.mod +++ b/go.mod @@ -1,180 +1,164 @@ -module kloudlite.io +module github.com/kloudlite/api -go 1.18 +go 1.21.1 require ( github.com/99designs/gqlgen v0.17.28 github.com/Masterminds/sprig/v3 v3.2.3 + github.com/aws/aws-sdk-go v1.45.11 github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/codingconcepts/env v0.0.0-20200821220118-a8fbf8d84482 github.com/go-redis/redis/v8 v8.11.5 github.com/gobuffalo/flect v1.0.2 github.com/gofiber/adaptor/v2 v2.1.23 - github.com/gofiber/fiber/v2 v2.32.0 + github.com/gofiber/fiber/v2 v2.51.0 github.com/gofiber/websocket/v2 v2.0.21 github.com/google/go-github/v43 v43.0.0 github.com/google/go-github/v45 v45.2.0 github.com/gorilla/websocket v1.5.0 - github.com/kloudlite/cluster-operator v0.0.0-20230329090334-40fc9f00d55e - github.com/kloudlite/operator v0.0.0-20230510120745-e9e57e63e0e6 - github.com/kloudlite/wg-operator v0.0.0-20230329090407-183297dc23b8 github.com/matoous/go-nanoid/v2 v2.0.0 - github.com/miekg/dns v1.1.41 github.com/pkg/errors v0.9.1 + github.com/rs/zerolog v1.29.1 github.com/sendgrid/sendgrid-go v3.11.1+incompatible - github.com/signintech/gopdf v0.12.0 - github.com/slack-go/slack v0.11.4 - github.com/stripe/stripe-go v70.15.0+incompatible - github.com/tektoncd/triggers v0.22.1 - github.com/twmb/franz-go v1.6.0 github.com/vektah/gqlparser/v2 v2.5.1 github.com/xanzy/go-gitlab v0.63.0 github.com/xeipuuv/gojsonschema v1.2.0 - github.com/yext/yerrors v0.0.0-20201026182705-b30cf71caa54 - go.mongodb.org/mongo-driver v1.9.1 + github.com/yext/yerrors v0.0.0-20230716030415-7ebf68e23868 // indirect + go.mongodb.org/mongo-driver v1.12.1 go.uber.org/fx v1.17.1 - go.uber.org/zap v1.24.0 - golang.org/x/oauth2 v0.3.0 - golang.org/x/sync v0.1.0 - golang.zx2c4.com/wireguard/wgctrl v0.0.0-20221104135756-97bc4ad4a1cb - google.golang.org/grpc v1.51.0 - google.golang.org/protobuf v1.28.1 - gopkg.in/yaml.v2 v2.4.0 - gopkg.in/yaml.v3 v3.0.1 - k8s.io/api v0.26.1 - k8s.io/apiextensions-apiserver v0.26.0 - k8s.io/apimachinery v0.26.1 - k8s.io/client-go v0.26.1 - rogchap.com/v8go v0.8.0 - sigs.k8s.io/controller-runtime v0.13.1 + go.uber.org/zap v1.26.0 + golang.org/x/oauth2 v0.13.0 + golang.org/x/sync v0.4.0 + google.golang.org/grpc v1.58.3 + google.golang.org/protobuf v1.31.0 + gopkg.in/yaml.v2 v2.4.0 // indirect + k8s.io/api v0.28.3 + k8s.io/apiextensions-apiserver v0.28.3 + k8s.io/apimachinery v0.28.3 + k8s.io/client-go v0.28.3 + sigs.k8s.io/controller-runtime v0.16.3 sigs.k8s.io/yaml v1.3.0 ) require ( - github.com/emicklei/go-restful/v3 v3.9.0 // indirect - github.com/google/gnostic v0.6.9 // indirect + github.com/kloudlite/container-registry-authorizer v0.0.0-20231021122509-161dc30fde55 + github.com/kloudlite/operator v0.0.0-20240125192852-5c63464fe989 + github.com/nats-io/nats.go v1.31.0 + github.com/onsi/ginkgo/v2 v2.12.0 + github.com/onsi/gomega v1.27.10 + github.com/stretchr/testify v1.8.4 + github.com/ztrue/tracerr v0.4.0 + golang.org/x/net v0.17.0 +) + +require ( + github.com/emicklei/go-restful/v3 v3.11.0 // indirect + github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect + github.com/google/gnostic-models v0.6.8 // indirect + github.com/google/pprof v0.0.0-20230509042627-b1315fad0c5a // indirect + github.com/hashicorp/go-hclog v1.4.0 // indirect + github.com/jmespath/go-jmespath v0.4.0 // indirect + github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/nats-io/nkeys v0.4.6 // indirect + github.com/nats-io/nuid v1.0.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/rivo/uniseg v0.4.2 // indirect + github.com/sergi/go-diff v1.3.1 // indirect + github.com/stretchr/objx v0.5.0 // indirect + golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) require ( - cloud.google.com/go/compute v1.12.1 // indirect - cloud.google.com/go/compute/metadata v0.2.1 // indirect - contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200907061046-05415f1de66d // indirect - contrib.go.opencensus.io/exporter/prometheus v0.4.0 // indirect + cloud.google.com/go/compute v1.23.0 // indirect + cloud.google.com/go/compute/metadata v0.2.3 // indirect github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/semver/v3 v3.2.0 // indirect github.com/agnivade/levenshtein v1.1.1 // indirect - github.com/andybalholm/brotli v1.0.4 // indirect + github.com/andybalholm/brotli v1.0.5 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/blendle/zapdriver v1.3.1 // indirect - github.com/census-instrumentation/opencensus-proto v0.3.0 // indirect - github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect - github.com/evanphx/json-patch/v5 v5.6.0 // indirect + github.com/evanphx/json-patch/v5 v5.7.0 // indirect github.com/fasthttp/websocket v1.5.0 // indirect - github.com/fatih/color v1.14.1 // indirect + github.com/fatih/color v1.15.0 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/go-kit/log v0.2.0 // indirect - github.com/go-logfmt/logfmt v0.5.1 // indirect - github.com/go-logr/logr v1.2.3 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.20.0 // indirect + github.com/go-logr/logr v1.2.4 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/swag v0.22.3 // indirect - github.com/go-stack/stack v1.8.1 // indirect github.com/gofiber/utils v0.1.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang-jwt/jwt/v4 v4.4.2 // indirect + github.com/golang-jwt/jwt/v4 v4.5.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.2 // indirect + github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/google/go-cmp v0.5.9 // indirect - github.com/google/go-containerregistry v0.12.1 // indirect + github.com/google/go-cmp v0.6.0 github.com/google/go-github/v41 v41.0.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect - github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/google/uuid v1.4.0 github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-retryablehttp v0.7.1 // indirect - github.com/hashicorp/go-uuid v1.0.3 // indirect + github.com/hashicorp/go-retryablehttp v0.7.2 // indirect github.com/hashicorp/golang-lru/v2 v2.0.1 // indirect - github.com/huandu/xstrings v1.3.3 // indirect + github.com/huandu/xstrings v1.4.0 // indirect github.com/imdario/mergo v0.3.13 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.15.11 // indirect + github.com/klauspost/compress v1.17.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.17 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/phpdave11/gofpdi v1.0.11 // indirect - github.com/pierrec/lz4/v4 v4.1.14 // indirect - github.com/prometheus/client_golang v1.14.0 // indirect - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.37.0 // indirect - github.com/prometheus/procfs v0.8.0 // indirect - github.com/prometheus/statsd_exporter v0.21.0 // indirect + github.com/prometheus/client_golang v1.17.0 // indirect + github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect + github.com/prometheus/common v0.44.0 // indirect + github.com/prometheus/procfs v0.11.1 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/sanity-io/litter v1.5.5 github.com/savsgio/gotils v0.0.0-20211223103454-d0aaa54c5899 // indirect - github.com/seancfoley/bintree v1.2.1 // indirect - github.com/seancfoley/ipaddress-go v1.5.3 // indirect github.com/sendgrid/rest v2.6.9+incompatible // indirect github.com/shopspring/decimal v1.3.1 // indirect github.com/spf13/cast v1.5.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/tektoncd/pipeline v0.43.2 // indirect - github.com/twmb/franz-go/pkg/kmsg v1.1.0 // indirect - github.com/urfave/cli/v2 v2.24.4 // indirect + github.com/spf13/pflag v1.0.5 + github.com/urfave/cli/v2 v2.25.7 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.35.0 // indirect + github.com/valyala/fasthttp v1.50.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect - github.com/xdg-go/scram v1.0.2 // indirect - github.com/xdg-go/stringprep v1.0.2 // indirect + github.com/xdg-go/scram v1.1.2 // indirect + github.com/xdg-go/stringprep v1.0.4 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect - go.opencensus.io v0.24.0 // indirect - go.uber.org/atomic v1.10.0 // indirect go.uber.org/dig v1.14.0 // indirect - go.uber.org/multierr v1.8.0 // indirect - golang.org/x/crypto v0.5.0 // indirect - golang.org/x/mod v0.8.0 // indirect - golang.org/x/net v0.8.0 // indirect - golang.org/x/sys v0.6.0 // indirect - golang.org/x/term v0.6.0 // indirect - golang.org/x/text v0.8.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/crypto v0.17.0 // indirect + golang.org/x/mod v0.13.0 // indirect + golang.org/x/sys v0.15.0 // indirect + golang.org/x/term v0.15.0 // indirect + golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.6.0 // indirect + golang.org/x/tools v0.14.0 golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect - gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect - google.golang.org/api v0.103.0 // indirect + gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20221111202108-142d8a6fa32e // indirect gopkg.in/inf.v0 v0.9.1 // indirect - k8s.io/component-base v0.26.0 // indirect - k8s.io/klog/v2 v2.80.1 // indirect - k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect - k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect - knative.dev/pkg v0.0.0-20221011175852-714b7630a836 // indirect - sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect + k8s.io/component-base v0.28.3 // indirect + k8s.io/klog/v2 v2.100.1 // indirect + k8s.io/kube-openapi v0.0.0-20230905202853-d090da108d2f // indirect + k8s.io/utils v0.0.0-20230726121419-3b25d923346b + sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect ) - -// replace github.com/kloudlite/operator v0.0.0-20230510063950-30b6ae214d30 => /home/nxtcoder17/workspace/kloudlite-forks/kloudlite-operator - -// replace github.com/kloudlite/cluster-operator v0.0.0-20230213105023-96cd6d1e38d3 => /home/vision/kloudlite/cluster-operator -// replace github.com/kloudlite/cluster-operator v0.0.0-20230213105023-96cd6d1e38d3 => /home/nxtcoder17/workspace/kloudlite/cluster-operator - -replace sigs.k8s.io/controller-runtime v0.13.1 => sigs.k8s.io/controller-runtime v0.14.1 diff --git a/go.sum b/go.sum index a4a3ab21f..f917dba56 100644 --- a/go.sum +++ b/go.sum @@ -1,232 +1,116 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/compute v1.12.1 h1:gKVJMEyqV5c/UnpzjjQbo3Rjvvqpr9B1DFSbJC4OXr0= -cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= -cloud.google.com/go/compute/metadata v0.2.1 h1:efOwf5ymceDhK6PKMnnrTHP4pppY5L22mle96M1yP48= -cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200907061046-05415f1de66d h1:LblfooH1lKOpp1hIhukktmSAxFkqMPFk9KR6iZ0MJNI= -contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200907061046-05415f1de66d/go.mod h1:IshRmMJBhDfFj5Y67nVhMYTTIze91RUeT73ipWKs/GY= -contrib.go.opencensus.io/exporter/prometheus v0.4.0 h1:0QfIkj9z/iVZgK31D9H9ohjjIDApI2GOPScCKwxedbs= -contrib.go.opencensus.io/exporter/prometheus v0.4.0/go.mod h1:o7cosnyfuPVK0tB8q0QmaQNhGnptITnPQB+z1+qeFB0= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY= +cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= github.com/99designs/gqlgen v0.17.28 h1:kbc1RhvwMltFVCb6drIrfQcxS9iKybyNwaJkgJZd5ao= github.com/99designs/gqlgen v0.17.28/go.mod h1:i4rEatMrzzu6RXaHydq1nmEPZkb3bKQsnxNRHS4DQB4= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8= github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= 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/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 h1:yL7+Jz0jTC6yykIK/Wh74gnTJnrGr5AyrNMXuA0gves= +github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= +github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= 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/aws/aws-sdk-go v1.45.11 h1:8qiSrA12+NRr+2MVpMApi3JxtiFFjDVU1NeWe+80bYg= +github.com/aws/aws-sdk-go v1.45.11/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= 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/blendle/zapdriver v1.3.1 h1:C3dydBOWYRiOk+B8X9IVZ5IOe+7cl+tGOexN4QqHfpE= -github.com/blendle/zapdriver v1.3.1/go.mod h1:mdXfREi6u5MArG4j9fewC+FGnXaBR+T4Ox4J2u4eHCc= github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 h1:tXKVfhE7FcSkhkv0UwkLvPDeZ4kz6OXd0PKPlFqf81M= github.com/bradleyfalzon/ghinstallation/v2 v2.0.4/go.mod h1:B40qPqJxWE0jDZgOR1JmaMy+4AY1eBP+IByOvqyAKp0= -github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/census-instrumentation/opencensus-proto v0.3.0 h1:t/LhUZLVitR1Ow2YOnduCsavhwFUklBMoGVYUCqmCqk= -github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudevents/sdk-go/v2 v2.12.0 h1:p1k+ysVOZtNiXfijnwB3WqZNA3y2cGOiKQygWkUHCEI= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/codingconcepts/env v0.0.0-20200821220118-a8fbf8d84482 h1:5/aEFreBh9hH/0G+33xtczJCvMaulqsm9nDuu2BZUEo= github.com/codingconcepts/env v0.0.0-20200821220118-a8fbf8d84482/go.mod h1:TM9ug+H/2cI3EjyIDr5xKCkFGyNE59URgH1wu5NyU8E= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v0.0.0-20161028175848-04cdfd42973b/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 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/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48 h1:fRzb/w+pyskVMQ+UbP35JkH8yB7MYb4q/qhBarqZE6g= github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= -github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= +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.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= -github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= -github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= +github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch/v5 v5.7.0 h1:nJqP7uwL84RJInrohHfW0Fx3awjbm8qZeFv0nW9SYGc= +github.com/evanphx/json-patch/v5 v5.7.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= github.com/fasthttp/websocket v1.5.0 h1:B4zbe3xXyvIdnqjOZrafVFklCUq5ZLo/TqCt5JA1wLE= github.com/fasthttp/websocket v1.5.0/go.mod h1:n0BlOQvJdPbTuBkZT0O5+jk/sp/1/VCzquR1BehI2F4= -github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w= -github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg= -github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= +github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-kit/log v0.2.0 h1:7i2K3eKTos3Vc0enKCfnVcgHh2olr/MyfboYq7cAcFw= -github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= -github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo= +github.com/go-logr/zapr v1.2.4/go.mod h1:FyHWQIzQORZ0QVE1BtVHv3cKtNLuXsbNLtpuhNapBOA= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= -github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= -github.com/go-test/deep v1.0.4 h1:u2CU3YKy9I2pmu9pX0eq50wCgjfGIt539SqR7FbHiho= -github.com/go-test/deep v1.0.4/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/gobuffalo/flect v1.0.2 h1:eqjPGSo2WmjgY2XlpGwo2NXgL3RucAKo4k4qQMNA5sA= github.com/gobuffalo/flect v1.0.2/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofiber/adaptor/v2 v2.1.23 h1:VG0yAPnB2EJZjxy4Ul+Ra9e92PnqwXE97SUVuPGuoAA= github.com/gofiber/adaptor/v2 v2.1.23/go.mod h1:hnYEQBPF2x1JaBHygutJJF5d0+J2eYnKKsUMCSsfxKk= -github.com/gofiber/fiber/v2 v2.32.0 h1:lpgcGEq1UENv27uVuOaufAhU8wUKnX8yb9L7559Neec= github.com/gofiber/fiber/v2 v2.32.0/go.mod h1:CMy5ZLiXkn6qwthrl03YMyW1NLfj0rhxz2LKl4t7ZTY= +github.com/gofiber/fiber/v2 v2.51.0 h1:JNACcZy5e2tGApWB2QrRpenTWn0fq0hkFm6k0C86gKQ= +github.com/gofiber/fiber/v2 v2.51.0/go.mod h1:xaQRZQJGqnKOQnbQw+ltvku3/h8QxvNi8o6JiJ7Ll0U= github.com/gofiber/utils v0.1.2 h1:1SH2YEz4RlNS0tJlMJ0bGwO0JkqPqvq6TbHK9tXZKtk= github.com/gofiber/utils v0.1.2/go.mod h1:pacRFtghAE3UoknMOUiXh2Io/nLWSUHtQCi/3QASsOc= github.com/gofiber/websocket/v2 v2.0.21 h1:mQEiLXBqFsNNlJc5dzFgSGeoqoEXYvIcdBQzAZBdbL0= github.com/gofiber/websocket/v2 v2.0.21/go.mod h1:AOdLDGRGMr9MXH0GjHD43xR17x5lzs0pd5E0/cEKYX8= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= -github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= +github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/cel-go v0.12.5 h1:DmzaiSgoaqGCjtpPQWl26/gND+yRpim56H1jCVev6d8= -github.com/google/gnostic v0.6.9 h1:ZK/5VhkoX835RikCHpSUJV9a+S3e1zLh59YnyWeBW+0= -github.com/google/gnostic v0.6.9/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= +github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-containerregistry v0.12.1 h1:W1mzdNUTx4Zla4JaixCRLhORcR7G6KxE5hHl5fkPsp8= -github.com/google/go-containerregistry v0.12.1/go.mod h1:sdIK+oHQO7B93xI8UweYdl887YhuIwg9vz8BSLH3+8k= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github/v41 v41.0.0 h1:HseJrM2JFf2vfiZJ8anY2hqBjdfY1Vlj/K27ueww4gg= github.com/google/go-github/v41 v41.0.0/go.mod h1:XgmCA5H323A9rtgExdTcnDkcqp6S30AVACCBDOonIxg= github.com/google/go-github/v43 v43.0.0 h1:y+GL7LIsAIF2NZlJ46ZoC/D1W1ivZasT0lnWHMYPZ+U= @@ -238,107 +122,78 @@ github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17 github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/pprof v0.0.0-20230509042627-b1315fad0c5a h1:PEOGDI1kkyW37YqPWHLHc+D20D9+87Wt12TCcfTUo5Q= +github.com/google/pprof v0.0.0-20230509042627-b1315fad0c5a/go.mod h1:79YE0hCXdHag9sBkw2o+N/YnZtTkXi0UT9Nnixa5eYk= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= +github.com/google/uuid v1.4.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 v1.14.6/go.mod h1:zdiPV4Yse/1gnckTHtghG4GkDEdKCRJduHpTxT3/jcw= -github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= -github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-hclog v1.3.1 h1:vDwF1DFNZhntP4DAjuTpOw3uEgMUpXh1pB5fW9DqHpo= -github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= -github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-retryablehttp v0.7.1 h1:sUiuQAnLlbvmExtFQs72iFW/HXeUn8Z1aJLQ4LJJbTQ= -github.com/hashicorp/go-retryablehttp v0.7.1/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= -github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= +github.com/hashicorp/go-hclog v1.4.0 h1:ctuWFGrhFha8BnnzxqeRGidlEcQkDyL5u8J8t5eA11I= +github.com/hashicorp/go-hclog v1.4.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-retryablehttp v0.7.2 h1:AcYqCvkpalPnPF2pn0KamgwamS42TqUDDYFRKq/RAd0= +github.com/hashicorp/go-retryablehttp v0.7.2/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/golang-lru/v2 v2.0.1 h1:5pv5N1lT1fjLg2VQ5KWc7kmucp2x/kvFOnxuVTqZ6x4= github.com/hashicorp/golang-lru/v2 v2.0.1/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= -github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU= +github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.14.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.15.4/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= -github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c= -github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/kloudlite/cluster-operator v0.0.0-20230329090334-40fc9f00d55e h1:GkOuSFWhsl2AINzhIHc67XOydGGha3sSHOIRr72Id1M= -github.com/kloudlite/cluster-operator v0.0.0-20230329090334-40fc9f00d55e/go.mod h1:TYrwSdXGOXd3SVBlzm6BDr3+zItMEls6HfuidhqjvMo= -github.com/kloudlite/operator v0.0.0-20230510120745-e9e57e63e0e6 h1:G6VJOmczDhejHjXTNQrAh/gv3pNuqmFHwm5T3zdr4SE= -github.com/kloudlite/operator v0.0.0-20230510120745-e9e57e63e0e6/go.mod h1:/CqeaKgLhs+sYUYwWYOSrZyvyG+W06Lwo5bQvSwoNzw= -github.com/kloudlite/wg-operator v0.0.0-20230329090407-183297dc23b8 h1:0UbZxVwxBCfA0JisDLfyNXOxMxqa5ED3lYqwA3QVxmE= -github.com/kloudlite/wg-operator v0.0.0-20230329090407-183297dc23b8/go.mod h1:lUm/88hKhQqZeJXQjyr27iV37LS8ckR1VZMHq0pnvX0= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM= +github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/kloudlite/container-registry-authorizer v0.0.0-20231021122509-161dc30fde55 h1:YnZh3TL6AG4EfoInx1/L5zcPHd2QxgLKseJB1KtHjdQ= +github.com/kloudlite/container-registry-authorizer v0.0.0-20231021122509-161dc30fde55/go.mod h1:GZj3wZmIw/qCciclRhgQTgmGiqe8wxoVzMXQjbOfnbc= +github.com/kloudlite/operator v0.0.0-20240116073010-358659b6c673 h1:t3e61wr+c2jUzsNmAJx1aPsev5L+yL1rOtIj1KNZ9g0= +github.com/kloudlite/operator v0.0.0-20240116073010-358659b6c673/go.mod h1:eD8xKzwOVtajAglELcEHn2XL4H22ERBLT2uaisA6SzQ= +github.com/kloudlite/operator v0.0.0-20240124071634-f1e66969c02c h1:oo6k+eLZ8EULnjLtO0iGTLrw9pcBfWhqYnB8dGBaSvE= +github.com/kloudlite/operator v0.0.0-20240124071634-f1e66969c02c/go.mod h1:eD8xKzwOVtajAglELcEHn2XL4H22ERBLT2uaisA6SzQ= +github.com/kloudlite/operator v0.0.0-20240125192852-5c63464fe989 h1:mHshQnMCWiqpHwYn87ARpYRVyN57q0ksOKCM4wXmeHc= +github.com/kloudlite/operator v0.0.0-20240125192852-5c63464fe989/go.mod h1:eD8xKzwOVtajAglELcEHn2XL4H22ERBLT2uaisA6SzQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/matoous/go-nanoid v1.5.0/go.mod h1:zyD2a71IubI24efhpvkJz+ZwfwagzgSO6UNiFsZKN7U= github.com/matoous/go-nanoid/v2 v2.0.0 h1:d19kur2QuLeHmJBkvYkFdhFBzLoo1XVm2GgTpL+9Tj0= github.com/matoous/go-nanoid/v2 v2.0.0/go.mod h1:FtS4aGPVfEkxKxhdWPAspZpZSh1cOjtM7Ej/So3hR0g= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= +github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY= -github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= 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= @@ -350,130 +205,92 @@ github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe h1:iruDEfMl2E6fbMZ9s0scYfZQ84/6SPL6zC8ACM2oIL0= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/nats-io/nats.go v1.31.0 h1:/WFBHEc/dOKBF6qf1TZhrdEfTmOZ5JzdJ+Y3m6Y/p7E= +github.com/nats-io/nats.go v1.31.0/go.mod h1:di3Bm5MLsoB4Bx61CBTsxuarI36WbhAwOm8QrW39+i8= +github.com/nats-io/nkeys v0.4.6 h1:IzVe95ru2CT6ta874rt9saQRkWfe2nFj1NtvYSLqMzY= +github.com/nats-io/nkeys v0.4.6/go.mod h1:4DxZNzenSVd1cYQoAa8948QY3QDjrHfcfVADymtkpts= +github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= +github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.6.0 h1:9t9b9vRUbFq3C4qKFCGkVuq/fIHji802N1nrtkh1mNc= -github.com/onsi/gomega v1.24.1 h1:KORJXNNTzJXzu4ScJWssJfJMnJ+2QJqhoQSRwNlze9E= -github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= -github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/openzipkin/zipkin-go v0.3.0 h1:XtuXmOLIXLjiU2XduuWREDT0LOKtSgos/g7i7RYyoZQ= -github.com/phpdave11/gofpdi v1.0.11 h1:wsBNx+3S0wy1dEp6fzv281S74ogZGgIdYWV2PugWgho= -github.com/phpdave11/gofpdi v1.0.11/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= -github.com/pierrec/lz4/v4 v4.1.14 h1:+fL8AQEZtz/ijeNnpduH0bROTu0O3NZAlPjQxGn8LwE= -github.com/pierrec/lz4/v4 v4.1.14/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.12.0 h1:UIVDowFPwpg6yMUpPjGkYvf06K3RAiJXUhCxEwQVHRI= +github.com/onsi/ginkgo/v2 v2.12.0/go.mod h1:ZNEzXISYlqpb8S36iN71ifqLi3vVD1rVJGvWRCJOUpQ= +github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= +github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= -github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.28.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= -github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= -github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= -github.com/prometheus/statsd_exporter v0.21.0 h1:hA05Q5RFeIjgwKIYEdFd59xu5Wwaznf33yKI+pyX6T8= -github.com/prometheus/statsd_exporter v0.21.0/go.mod h1:rbT83sZq2V+p73lHhPZfMc3MLCHmSHelCh9hSGYNLTQ= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= +github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= +github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM= +github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= +github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= +github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.2 h1:YwD0ulJSJytLpiaWua0sBDusfsCZohxjxzVTYjwxfV8= +github.com/rivo/uniseg v0.4.2/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc= +github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/sanity-io/litter v1.5.5 h1:iE+sBxPBzoK6uaEP5Lt3fHNgpKcHXc/A2HGETy0uJQo= +github.com/sanity-io/litter v1.5.5/go.mod h1:9gzJgR2i4ZpjZHsKvUXIRQVk7P+yM3e+jAF7bU2UI5U= github.com/savsgio/gotils v0.0.0-20211223103454-d0aaa54c5899 h1:Orn7s+r1raRTBKLSc9DmbktTT04sL+vkzsbRD2Q8rOI= github.com/savsgio/gotils v0.0.0-20211223103454-d0aaa54c5899/go.mod h1:oejLrk1Y/5zOF+c/aHtXqn3TFlzzbAgPWg8zBiAHDas= -github.com/seancfoley/bintree v1.2.1 h1:Z/iNjRKkXnn0CTW7jDQYtjW5fz2GH1yWvOTJ4MrMvdo= -github.com/seancfoley/bintree v1.2.1/go.mod h1:hIUabL8OFYyFVTQ6azeajbopogQc2l5C/hiXMcemWNU= -github.com/seancfoley/ipaddress-go v1.5.3 h1:fLnn4nsatd2rp3IJsVWriXv5gXn2Qiy8uxjxe4iZtTg= -github.com/seancfoley/ipaddress-go v1.5.3/go.mod h1:fpvVPC+Jso+YEhNcNiww8HQmBgKP8T4T6BTp1SLxxIo= github.com/sendgrid/rest v2.6.9+incompatible h1:1EyIcsNdn9KIisLW50MKwmSRSK+ekueiEMJ7NEoxJo0= github.com/sendgrid/rest v2.6.9+incompatible/go.mod h1:kXX7q3jZtJXK5c5qK83bSGMdV6tsOE70KbHoqJls4lE= github.com/sendgrid/sendgrid-go v3.11.1+incompatible h1:ai0+woZ3r/+tKLQExznak5XerOFoD6S7ePO0lMV8WXo= github.com/sendgrid/sendgrid-go v3.11.1+incompatible/go.mod h1:QRQt+LX/NmgVEvmdRw0VT/QgUn499+iza2FnDca9fg8= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= +github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= +github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/signintech/gopdf v0.12.0 h1:WxwRsrSqU1j3HAlafDYz4jSvLNUGDd6DAb9IrWbTc3U= -github.com/signintech/gopdf v0.12.0/go.mod h1:a+E8HlIuBwghPyoo7UaoB5UaL7zklDzmYVIAHoW/Rlw= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= -github.com/slack-go/slack v0.11.4 h1:ojSa7KlPm3PqY2AomX4VTxEsK5eci5JaxCjlzGV5zoM= -github.com/slack-go/slack v0.11.4/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= 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/stoewer/go-strcase v1.2.0 h1:Z2iHWqGXH00XYgqDmNgQbIBxf3wrNq0F3feEy0ainaU= -github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v0.0.0-20161117074351-18a02ba4a312/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/stripe/stripe-go v70.15.0+incompatible h1:hNML7M1zx8RgtepEMlxyu/FpVPrP7KZm1gPFQquJQvM= -github.com/stripe/stripe-go v70.15.0+incompatible/go.mod h1:A1dQZmO/QypXmsL0T8axYZkSN/uA/T/A64pfKdBAMiY= -github.com/tektoncd/pipeline v0.43.2 h1:4ia0gBE7YEcbclbI7yO4rwNH37IhxOhfI/cSs89qdm8= -github.com/tektoncd/pipeline v0.43.2/go.mod h1:KEnQsGxxeK7UjVMzVt62CEa7VZ6GUuMJfUHAaEpVP+E= -github.com/tektoncd/triggers v0.22.1 h1:D00BoTf5pS2kFC5RSly010b5qMuQbGhyK7rT/WZc1m0= -github.com/tektoncd/triggers v0.22.1/go.mod h1:lYxFl8cKbr+DaHMQa47U4Y7uyhTAMsRAT0uOOY8xiGE= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= -github.com/twmb/franz-go v1.6.0 h1:yri7YsVBe/k1LKcoZSLILgUI3U14e82qtD9i4VOcs9c= -github.com/twmb/franz-go v1.6.0/go.mod h1:xdMwpUIQL/JDKKwerc5qJQG8TU1SNIddfjKJJyqRJIg= -github.com/twmb/franz-go/pkg/kmsg v1.1.0 h1:csckTxG48q7Tem7ZwMxe2jAb0ehDNglxZccGnpqe4RU= -github.com/twmb/franz-go/pkg/kmsg v1.1.0/go.mod h1:SxG/xJKhgPu25SamAq0rrucfp7lbzCpEXOC+vH/ELrY= -github.com/urfave/cli/v2 v2.24.4 h1:0gyJJEBYtCV87zI/x2nZCPyDxD51K6xM8SkwjHFCNEU= -github.com/urfave/cli/v2 v2.24.4/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs= +github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.33.0/go.mod h1:KJRK/MXx0J+yd0c5hlR+s1tIHD72sniU8ZJjl97LIw4= -github.com/valyala/fasthttp v1.35.0 h1:wwkR8mZn2NbigFsaw2Zj5r+xkmzjbrA/lyTmiSlal/Y= github.com/valyala/fasthttp v1.35.0/go.mod h1:t/G+3rLek+CyY9bnIE+YlMRddxVAAGjhxndDB4i4C0I= +github.com/valyala/fasthttp v1.50.0 h1:H7fweIlBm0rXLs2q0XbalvJ6r0CUPFWK3/bB4N13e9M= +github.com/valyala/fasthttp v1.50.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= github.com/vektah/gqlparser/v2 v2.5.1 h1:ZGu+bquAY23jsxDRcYpWjttRZrUz07LbiY77gUOHcr4= @@ -482,10 +299,10 @@ github.com/xanzy/go-gitlab v0.63.0 h1:a9fXpKWykUS6dowapFej/2Wjf4aOAEFC1q2ZIcz4Ip github.com/xanzy/go-gitlab v0.63.0/go.mod h1:F0QEXwmqiBUxCgJm8fE9S+1veX4XC9Z4cfaAbqwk4YM= github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.0.2 h1:akYIkZ28e6A96dkWNJQu3nmCzH3YfwMPQExUYDaRv7w= -github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= -github.com/xdg-go/stringprep v1.0.2 h1:6iq84/ryjjeRmMJwxutI51F2GIPlP5BfTvXHeYjyhBc= -github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= +github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY= +github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= +github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8= +github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= @@ -495,443 +312,176 @@ github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17 github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= -github.com/yext/yerrors v0.0.0-20201026182705-b30cf71caa54 h1:z5gy1zjJhg6cmAJ9SkptKnQklqiRTFlGnDA7AmK6nrY= -github.com/yext/yerrors v0.0.0-20201026182705-b30cf71caa54/go.mod h1:zhIgUGzifKsRLyFziQsd8PudAFXXsXaAckJ9+3MojNg= +github.com/yext/yerrors v0.0.0-20230716030415-7ebf68e23868 h1:WHNghr01OczJetcg4v+Znzb1GhGsocXm+bMjRMhRv1c= +github.com/yext/yerrors v0.0.0-20230716030415-7ebf68e23868/go.mod h1:zhIgUGzifKsRLyFziQsd8PudAFXXsXaAckJ9+3MojNg= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a h1:fZHgsYlfvtyqToslyjUt3VOPF4J7aK/3MPcK7xp3PDk= github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a/go.mod h1:ul22v+Nro/R083muKhosV54bj5niojjWZvU8xrevuH4= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.mongodb.org/mongo-driver v1.9.1 h1:m078y9v7sBItkt1aaoe2YlvWEXcD263e1a4E1fBrJ1c= -go.mongodb.org/mongo-driver v1.9.1/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= -go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +github.com/ztrue/tracerr v0.4.0 h1:vT5PFxwIGs7rCg9ZgJ/y0NmOpJkPCPFK8x0vVIYzd04= +github.com/ztrue/tracerr v0.4.0/go.mod h1:PaFfYlas0DfmXNpo7Eay4MFhZUONqvXM+T2HyGPpngk= +go.mongodb.org/mongo-driver v1.12.1 h1:nLkghSU8fQNaK7oUmDhQFsnrtcoNy7Z6LVFKsEecqgE= +go.mongodb.org/mongo-driver v1.12.1/go.mod h1:/rGBTebI3XYboVmgz+Wv3Bcbl3aD0QF9zl6kDDw18rQ= go.uber.org/dig v1.14.0 h1:VmGvIH45/aapXPQkaOrK5u4B5B7jxZB98HM/utx0eME= go.uber.org/dig v1.14.0/go.mod h1:jHAn/z1Ld1luVVyGKOAIFYz/uBFqKjjEEdIqVAqfQ2o= go.uber.org/fx v1.17.1 h1:S42dZ6Pok8hQ3jxKwo6ZMYcCgHQA/wAS/gnpRa1Pksg= go.uber.org/fx v1.17.1/go.mod h1:yO7KN5rhlARljyo4LR047AjaV6J+KFzd/Z7rnTbEn0A= -go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= -go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= -go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= +go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= -golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= +golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220111093109-d55c255bac03/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.3.0 h1:6l90koy8/LaBLmLu8jpHeHexzMwEita0zFfYlggy2F8= -golang.org/x/oauth2 v0.3.0/go.mod h1:rQrIauxkUhJ6CuwEXwymO2/eh4xz2ZWF1nBkcxS+tGk= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= +golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= +golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= +golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= +golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= 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= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.zx2c4.com/wireguard/wgctrl v0.0.0-20221104135756-97bc4ad4a1cb h1:9aqVcYEDHmSNb0uOWukxV5lHV09WqiSiCuhEgWNETLY= -golang.zx2c4.com/wireguard/wgctrl v0.0.0-20221104135756-97bc4ad4a1cb/go.mod h1:mQqgjkW8GQQcJQsbBvK890TKqUK1DfKWkuBGbOkuMHQ= -gomodules.xyz/jsonpatch/v2 v2.2.0 h1:4pT439QV83L+G9FkcCriY6EkpcK6r6bK+A5FBUMI7qY= -gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.25.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.103.0 h1:9yuVqlu2JCvcLg9p8S3fcFLZij8EPSyvODIY1rkMizQ= -google.golang.org/api v0.103.0/go.mod h1:hGtW6nK1AC+d9si/UBhw8Xli+QMOf6xyNAyJw4qU9w0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw= +gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20221111202108-142d8a6fa32e h1:azcyH5lGzGy7pkLCbhPe0KkKxsM7c6UA/FZIXImKE7M= -google.golang.org/genproto v0.0.0-20221111202108-142d8a6fa32e/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.51.0 h1:E1eGv1FTqoLIdnBCZufiSHgKjlqG6fKFf6pPWtMTh8U= -google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c h1:jHkCUWkseRf+W+edG5hMzr/Uh1xkDREY4caybAq4dpY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c/go.mod h1:4cYg8o5yUbm77w8ZX00LhMVNl/YVBFJRYWDc0uYWMs0= +google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= +google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.26.1 h1:f+SWYiPd/GsiWwVRz+NbFyCgvv75Pk9NK6dlkZgpCRQ= -k8s.io/api v0.26.1/go.mod h1:xd/GBNgR0f707+ATNyPmQ1oyKSgndzXij81FzWGsejg= -k8s.io/apiextensions-apiserver v0.26.0 h1:Gy93Xo1eg2ZIkNX/8vy5xviVSxwQulsnUdQ00nEdpDo= -k8s.io/apiextensions-apiserver v0.26.0/go.mod h1:7ez0LTiyW5nq3vADtK6C3kMESxadD51Bh6uz3JOlqWQ= -k8s.io/apimachinery v0.26.1 h1:8EZ/eGJL+hY/MYCNwhmDzVqq2lPl3N3Bo8rvweJwXUQ= -k8s.io/apimachinery v0.26.1/go.mod h1:tnPmbONNJ7ByJNz9+n9kMjNP8ON+1qoAIIC70lztu74= -k8s.io/client-go v0.26.1 h1:87CXzYJnAMGaa/IDDfRdhTzxk/wzGZ+/HUQpqgVSZXU= -k8s.io/client-go v0.26.1/go.mod h1:IWNSglg+rQ3OcvDkhY6+QLeasV4OYHDjdqeWkDQZwGE= -k8s.io/component-base v0.26.0 h1:0IkChOCohtDHttmKuz+EP3j3+qKmV55rM9gIFTXA7Vs= -k8s.io/component-base v0.26.0/go.mod h1:lqHwlfV1/haa14F/Z5Zizk5QmzaVf23nQzCwVOQpfC8= -k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= -k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 h1:+70TFaan3hfJzs+7VK2o+OGxg8HsuBr/5f6tVAjDu6E= -k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4= -k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 h1:KTgPnR10d5zhztWptI952TNtt/4u5h3IzDXkdIMuo2Y= -k8s.io/utils v0.0.0-20221128185143-99ec85e7a448/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -knative.dev/eventing v0.30.1-0.20220407170245-58865afba92c h1:5QvWwe3uB7BefHGMg6hC05YVi+zr1kGK7DVMFquqJMI= -knative.dev/networking v0.0.0-20220404212543-dde40b019aff h1:pqzWi29qb44TY+5xtc9vty4mSyUYvojXZGCp0y/91eo= -knative.dev/pkg v0.0.0-20221011175852-714b7630a836 h1:0N7Zo/O+xeUUebJPm9keBaGclrUoEbljr3J1MsqtaIM= -knative.dev/pkg v0.0.0-20221011175852-714b7630a836/go.mod h1:DMTRDJ5WRxf/DrlOPzohzfhSuJggscLZ8EavOq9O/x8= -knative.dev/serving v0.30.1-0.20220402124840-21c05dc9d9a4 h1:iRFWsFKsA5ddhi+eKZVJdf8gPBomTfjIyRAKk9Uh7Ko= -rogchap.com/v8go v0.8.0 h1:/crDEiga68kOtbIqw3K9Rt9OztYz0LhAPHm2e3wK7Q4= -rogchap.com/v8go v0.8.0/go.mod h1:MxgP3pL2MW4dpme/72QRs8sgNMmM0pRc8DPhcuLWPAs= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/controller-runtime v0.14.1 h1:vThDes9pzg0Y+UbCPY3Wj34CGIYPgdmspPm2GIpxpzM= -sigs.k8s.io/controller-runtime v0.14.1/go.mod h1:GaRkrY8a7UZF0kqFFbUKG7n9ICiTY5T55P1RiE3UZlU= -sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k= -sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= +k8s.io/api v0.28.3 h1:Gj1HtbSdB4P08C8rs9AR94MfSGpRhJgsS+GF9V26xMM= +k8s.io/api v0.28.3/go.mod h1:MRCV/jr1dW87/qJnZ57U5Pak65LGmQVkKTzf3AtKFHc= +k8s.io/apiextensions-apiserver v0.28.3 h1:Od7DEnhXHnHPZG+W9I97/fSQkVpVPQx2diy+2EtmY08= +k8s.io/apiextensions-apiserver v0.28.3/go.mod h1:NE1XJZ4On0hS11aWWJUTNkmVB03j9LM7gJSisbRt8Lc= +k8s.io/apimachinery v0.28.3 h1:B1wYx8txOaCQG0HmYF6nbpU8dg6HvA06x5tEffvOe7A= +k8s.io/apimachinery v0.28.3/go.mod h1:uQTKmIqs+rAYaq+DFaoD2X7pcjLOqbQX2AOiO0nIpb8= +k8s.io/client-go v0.28.3 h1:2OqNb72ZuTZPKCl+4gTKvqao0AMOl9f3o2ijbAj3LI4= +k8s.io/client-go v0.28.3/go.mod h1:LTykbBp9gsA7SwqirlCXBWtK0guzfhpoW4qSm7i9dxo= +k8s.io/component-base v0.28.3 h1:rDy68eHKxq/80RiMb2Ld/tbH8uAE75JdCqJyi6lXMzI= +k8s.io/component-base v0.28.3/go.mod h1:fDJ6vpVNSk6cRo5wmDa6eKIG7UlIQkaFmZN2fYgIUD8= +k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= +k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/kube-openapi v0.0.0-20230905202853-d090da108d2f h1:eeEUOoGYWhOz7EyXqhlR2zHKNw2mNJ9vzJmub6YN6kk= +k8s.io/kube-openapi v0.0.0-20230905202853-d090da108d2f/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +sigs.k8s.io/controller-runtime v0.16.3 h1:2TuvuokmfXvDUamSx1SuAOO3eTyye+47mJCigwG62c4= +sigs.k8s.io/controller-runtime v0.16.3/go.mod h1:j7bialYoSn142nv9sCOJmQgDXQXxnroFU4VnX/brVJ0= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/structured-merge-diff/v4 v4.3.0 h1:UZbZAZfX0wV2zr7YZorDz6GXROfDFj6LvqCRm4VUVKk= +sigs.k8s.io/structured-merge-diff/v4 v4.3.0/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/grpc-interfaces/Taskfile.yml b/grpc-interfaces/Taskfile.yml index 3f6ec790d..7e619cba3 100644 --- a/grpc-interfaces/Taskfile.yml +++ b/grpc-interfaces/Taskfile.yml @@ -4,3 +4,33 @@ tasks: build: cmds: - protoc --go_out=. --go-grpc_out=. --go_opt=paths=import --go-grpc_opt=paths=import ./*.proto + + mocks: + cmds: + - mkdir -p kloudlite.io/rpc/auth/mocks + - mocki --package kloudlite.io/grpc-interfaces/kloudlite.io/rpc/auth --interface AuthClient > kloudlite.io/rpc/auth/mocks/auth-client.go + - mocki --package kloudlite.io/grpc-interfaces/kloudlite.io/rpc/auth --interface AuthServer > kloudlite.io/rpc/auth/mocks/auth-server.go + + - mkdir -p kloudlite.io/rpc/iam/mocks + - mocki --package kloudlite.io/grpc-interfaces/kloudlite.io/rpc/iam --interface IAMClient > kloudlite.io/rpc/iam/mocks/iam-client.go + - mocki --package kloudlite.io/grpc-interfaces/kloudlite.io/rpc/iam --interface IAMServer > kloudlite.io/rpc/iam/mocks/iam-server.go + + - mkdir -p kloudlite.io/rpc/comms/mocks + - mocki --package kloudlite.io/grpc-interfaces/kloudlite.io/rpc/comms --interface CommsClient > kloudlite.io/rpc/comms/mocks/comms-client.go + - mocki --package kloudlite.io/grpc-interfaces/kloudlite.io/rpc/comms --interface CommsServer > kloudlite.io/rpc/comms/mocks/comms-server.go + + - mkdir -p kloudlite.io/rpc/container_registry/mocks + - mocki --package kloudlite.io/grpc-interfaces/kloudlite.io/rpc/container_registry --interface ContainerRegistryClient > kloudlite.io/rpc/container_registry/mocks/container_registry-client.go + - mocki --package kloudlite.io/grpc-interfaces/kloudlite.io/rpc/container_registry --interface ContainerRegistryServer > kloudlite.io/rpc/container_registry/mocks/container_registry-server.go + + - mkdir -p kloudlite.io/rpc/infra/mocks + - mocki --package kloudlite.io/grpc-interfaces/kloudlite.io/rpc/infra --interface InfraClient > kloudlite.io/rpc/infra/mocks/infra-client.go + - mocki --package kloudlite.io/grpc-interfaces/kloudlite.io/rpc/infra --interface InfraServer > kloudlite.io/rpc/infra/mocks/infra-server.go + + - mkdir -p kloudlite.io/rpc/console/mocks + - mocki --package kloudlite.io/grpc-interfaces/kloudlite.io/rpc/console --interface ConsoleClient > kloudlite.io/rpc/console/mocks/console-client.go + - mocki --package kloudlite.io/grpc-interfaces/kloudlite.io/rpc/console --interface ConsoleServer > kloudlite.io/rpc/console/mocks/console-server.go + + - mkdir -p kloudlite.io/rpc/agent/mocks + - mocki --package kloudlite.io/grpc-interfaces/kloudlite.io/rpc/agent --interface KubeAgentClient > kloudlite.io/rpc/agent/mocks/agent-client.go + - mocki --package kloudlite.io/grpc-interfaces/kloudlite.io/rpc/agent --interface KubeAgentServer > kloudlite.io/rpc/agent/mocks/agent-server.go diff --git a/grpc-interfaces/accounts.proto b/grpc-interfaces/accounts.proto new file mode 100644 index 000000000..dd18f1343 --- /dev/null +++ b/grpc-interfaces/accounts.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +option go_package = "kloudlite.io/rpc/accounts"; + +service Accounts { + rpc GetAccount(GetAccountIn) returns (GetAccountOut); +} + +message GetAccountIn { + string userId = 1; + string accountName = 2; +} + +message GetAccountOut { + bool isActive = 1; + string targetNamespace = 2; + string accountId = 3; +} diff --git a/grpc-interfaces/auth.proto b/grpc-interfaces/auth.proto index 0dcc42ddc..c97c965cf 100644 --- a/grpc-interfaces/auth.proto +++ b/grpc-interfaces/auth.proto @@ -5,6 +5,7 @@ option go_package = "kloudlite.io/rpc/auth"; service Auth { rpc GetAccessToken(GetAccessTokenRequest) returns (AccessTokenOut); rpc EnsureUserByEmail(GetUserByEmailRequest) returns (GetUserByEmailOut); + rpc GetUser(GetUserIn) returns (GetUserOut); } message GetUserByEmailRequest { @@ -37,3 +38,12 @@ message OauthToken { string raw=5; } +message GetUserIn { + string userId = 1; +} + +message GetUserOut { + string id = 1; + string email = 2; + string name = 3; +} diff --git a/grpc-interfaces/comms.proto b/grpc-interfaces/comms.proto index 58c77fd8f..7c12af514 100644 --- a/grpc-interfaces/comms.proto +++ b/grpc-interfaces/comms.proto @@ -30,17 +30,18 @@ message PasswordResetEmailInput{ message AccountMemberInviteEmailInput{ string accountName = 1; string invitationToken = 2; - string email = 3; - string name = 4; + string invitedBy = 3; + string email = 4; + string name = 5; } message ProjectMemberInviteEmailInput{ string projectName = 1; string invitationToken = 2; - string email = 3; - string name = 4; + string invitedBy = 3; + string email = 4; + string name = 5; } message Void{ - } diff --git a/grpc-interfaces/iam.proto b/grpc-interfaces/iam.proto index 45f18c2d9..8eab8e8fb 100644 --- a/grpc-interfaces/iam.proto +++ b/grpc-interfaces/iam.proto @@ -6,43 +6,30 @@ service IAM { // Query rpc Ping(Message) returns (Message); rpc Can(CanIn) returns (CanOut); - rpc ListUserMemberships(UserMembershipsIn) returns (ListMembershipsOut); - rpc GetMembership(GetMembershipIn) returns (GetMembershipOut); - rpc ListResourceMemberships(ResourceMembershipsIn) returns (ListMembershipsOut); - rpc ListMembershipsByResource(MembershipsByResourceIn) returns (ListMembershipsOut); + rpc ListMembershipsForResource(MembershipsForResourceIn) returns (ListMembershipsOut); rpc ListMembershipsForUser(MembershipsForUserIn) returns (ListMembershipsOut); + rpc GetMembership(GetMembershipIn) returns (GetMembershipOut); + // Mutation rpc AddMembership(AddMembershipIn) returns (AddMembershipOut); - rpc InviteMembership(AddMembershipIn) returns (AddMembershipOut); - rpc ConfirmMembership(ConfirmMembershipIn) returns (ConfirmMembershipOut); + rpc UpdateMembership(UpdateMembershipIn) returns (UpdateMembershipOut); rpc RemoveMembership(RemoveMembershipIn) returns (RemoveMembershipOut); rpc RemoveResource(RemoveResourceIn) returns (RemoveResourceOut); } -message ConfirmMembershipIn{ - string user_id = 1; - string resource_ref = 2; - string role = 3; -} - -message ConfirmMembershipOut { -} - message RoleBinding { string userId = 1; string ResourceRef = 2; string resourceType = 3; string role = 4; - bool accepted = 5; } message GetMembershipIn { string userId = 1; string resourceType = 2; string ResourceRef = 3; - bool accepted = 5; } message AddMembershipIn { @@ -53,11 +40,21 @@ message AddMembershipIn { string filter = 5; } +message UpdateMembershipIn { + string userId = 1; + string resourceType = 2; + string resourceRef = 3; + string role = 4; +} + +message UpdateMembershipOut { + bool result = 1; +} + message GetMembershipOut { string userId=1; string ResourceRef=2; string role=3; - bool accepted = 5; } message AddMembershipOut { @@ -85,20 +82,9 @@ message ListMembershipsOut { repeated RoleBinding roleBindings = 1; } -message UserMembershipsIn { - string userId = 1; - string resourceType = 2; -} - -message ResourceMembershipsIn { - string resourceType = 1; - string ResourceRef = 2; -} - -message MembershipsByResourceIn { +message MembershipsForResourceIn { string resourceType = 1; string resourceRef = 2; - optional bool accepted = 3; } message MembershipsForUserIn { diff --git a/grpc-interfaces/infra.proto b/grpc-interfaces/infra.proto index 22eeb65d3..93f3b567a 100644 --- a/grpc-interfaces/infra.proto +++ b/grpc-interfaces/infra.proto @@ -3,16 +3,38 @@ syntax = "proto3"; option go_package = "kloudlite.io/rpc/infra"; service Infra { - rpc GetResourceOutput(GetInput) returns (Output); + rpc GetCluster(GetClusterIn) returns (GetClusterOut); + rpc GetNodepool(GetNodepoolIn) returns (GetNodepoolOut); } -message GetInput { - string managedResName = 1; - string clusterId = 2; - string namespace = 3; +message GetClusterIn { + string userId = 1; + string userName = 2; + string userEmail = 3; + + string accountName = 4; + string clusterName = 5; +} + +message GetClusterOut { + string messageQueueTopic = 1; + string dnsHost = 2; + + string IACJobName = 3; + string IACJobNamespace = 4; } -message Output { - map output = 1; +message GetNodepoolIn { + string userId = 1; + string userName = 2; + string userEmail = 3; + + string accountName = 4; + string clusterName = 5; + string nodepoolName = 6; } +message GetNodepoolOut { + string IACJobName = 1; + string IACJobNamespace = 2; +} diff --git a/grpc-interfaces/kloudlite.io/rpc/accounts/accounts.pb.go b/grpc-interfaces/kloudlite.io/rpc/accounts/accounts.pb.go new file mode 100644 index 000000000..f84d0eadb --- /dev/null +++ b/grpc-interfaces/kloudlite.io/rpc/accounts/accounts.pb.go @@ -0,0 +1,241 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: accounts.proto + +package accounts + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type GetAccountIn struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + AccountName string `protobuf:"bytes,2,opt,name=accountName,proto3" json:"accountName,omitempty"` +} + +func (x *GetAccountIn) Reset() { + *x = GetAccountIn{} + if protoimpl.UnsafeEnabled { + mi := &file_accounts_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAccountIn) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAccountIn) ProtoMessage() {} + +func (x *GetAccountIn) ProtoReflect() protoreflect.Message { + mi := &file_accounts_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAccountIn.ProtoReflect.Descriptor instead. +func (*GetAccountIn) Descriptor() ([]byte, []int) { + return file_accounts_proto_rawDescGZIP(), []int{0} +} + +func (x *GetAccountIn) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *GetAccountIn) GetAccountName() string { + if x != nil { + return x.AccountName + } + return "" +} + +type GetAccountOut struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IsActive bool `protobuf:"varint,1,opt,name=isActive,proto3" json:"isActive,omitempty"` + TargetNamespace string `protobuf:"bytes,2,opt,name=targetNamespace,proto3" json:"targetNamespace,omitempty"` + AccountId string `protobuf:"bytes,3,opt,name=accountId,proto3" json:"accountId,omitempty"` +} + +func (x *GetAccountOut) Reset() { + *x = GetAccountOut{} + if protoimpl.UnsafeEnabled { + mi := &file_accounts_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAccountOut) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAccountOut) ProtoMessage() {} + +func (x *GetAccountOut) ProtoReflect() protoreflect.Message { + mi := &file_accounts_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAccountOut.ProtoReflect.Descriptor instead. +func (*GetAccountOut) Descriptor() ([]byte, []int) { + return file_accounts_proto_rawDescGZIP(), []int{1} +} + +func (x *GetAccountOut) GetIsActive() bool { + if x != nil { + return x.IsActive + } + return false +} + +func (x *GetAccountOut) GetTargetNamespace() string { + if x != nil { + return x.TargetNamespace + } + return "" +} + +func (x *GetAccountOut) GetAccountId() string { + if x != nil { + return x.AccountId + } + return "" +} + +var File_accounts_proto protoreflect.FileDescriptor + +var file_accounts_proto_rawDesc = []byte{ + 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x48, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, + 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x73, 0x0a, 0x0d, 0x47, 0x65, + 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x69, + 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, + 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x32, + 0x37, 0x0a, 0x08, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x2b, 0x0a, 0x0a, 0x47, + 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x0d, 0x2e, 0x47, 0x65, 0x74, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x1a, 0x0e, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x42, 0x1b, 0x5a, 0x19, 0x6b, 0x6c, 0x6f, 0x75, + 0x64, 0x6c, 0x69, 0x74, 0x65, 0x2e, 0x69, 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_accounts_proto_rawDescOnce sync.Once + file_accounts_proto_rawDescData = file_accounts_proto_rawDesc +) + +func file_accounts_proto_rawDescGZIP() []byte { + file_accounts_proto_rawDescOnce.Do(func() { + file_accounts_proto_rawDescData = protoimpl.X.CompressGZIP(file_accounts_proto_rawDescData) + }) + return file_accounts_proto_rawDescData +} + +var file_accounts_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_accounts_proto_goTypes = []interface{}{ + (*GetAccountIn)(nil), // 0: GetAccountIn + (*GetAccountOut)(nil), // 1: GetAccountOut +} +var file_accounts_proto_depIdxs = []int32{ + 0, // 0: Accounts.GetAccount:input_type -> GetAccountIn + 1, // 1: Accounts.GetAccount:output_type -> GetAccountOut + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_accounts_proto_init() } +func file_accounts_proto_init() { + if File_accounts_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_accounts_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAccountIn); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_accounts_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAccountOut); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_accounts_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_accounts_proto_goTypes, + DependencyIndexes: file_accounts_proto_depIdxs, + MessageInfos: file_accounts_proto_msgTypes, + }.Build() + File_accounts_proto = out.File + file_accounts_proto_rawDesc = nil + file_accounts_proto_goTypes = nil + file_accounts_proto_depIdxs = nil +} diff --git a/grpc-interfaces/kloudlite.io/rpc/accounts/accounts_grpc.pb.go b/grpc-interfaces/kloudlite.io/rpc/accounts/accounts_grpc.pb.go new file mode 100644 index 000000000..91b0b817c --- /dev/null +++ b/grpc-interfaces/kloudlite.io/rpc/accounts/accounts_grpc.pb.go @@ -0,0 +1,109 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.24.4 +// source: accounts.proto + +package accounts + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Accounts_GetAccount_FullMethodName = "/Accounts/GetAccount" +) + +// AccountsClient is the client API for Accounts service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type AccountsClient interface { + GetAccount(ctx context.Context, in *GetAccountIn, opts ...grpc.CallOption) (*GetAccountOut, error) +} + +type accountsClient struct { + cc grpc.ClientConnInterface +} + +func NewAccountsClient(cc grpc.ClientConnInterface) AccountsClient { + return &accountsClient{cc} +} + +func (c *accountsClient) GetAccount(ctx context.Context, in *GetAccountIn, opts ...grpc.CallOption) (*GetAccountOut, error) { + out := new(GetAccountOut) + err := c.cc.Invoke(ctx, Accounts_GetAccount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AccountsServer is the server API for Accounts service. +// All implementations must embed UnimplementedAccountsServer +// for forward compatibility +type AccountsServer interface { + GetAccount(context.Context, *GetAccountIn) (*GetAccountOut, error) + mustEmbedUnimplementedAccountsServer() +} + +// UnimplementedAccountsServer must be embedded to have forward compatible implementations. +type UnimplementedAccountsServer struct { +} + +func (UnimplementedAccountsServer) GetAccount(context.Context, *GetAccountIn) (*GetAccountOut, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAccount not implemented") +} +func (UnimplementedAccountsServer) mustEmbedUnimplementedAccountsServer() {} + +// UnsafeAccountsServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AccountsServer will +// result in compilation errors. +type UnsafeAccountsServer interface { + mustEmbedUnimplementedAccountsServer() +} + +func RegisterAccountsServer(s grpc.ServiceRegistrar, srv AccountsServer) { + s.RegisterService(&Accounts_ServiceDesc, srv) +} + +func _Accounts_GetAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAccountIn) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountsServer).GetAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Accounts_GetAccount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountsServer).GetAccount(ctx, req.(*GetAccountIn)) + } + return interceptor(ctx, in, info, handler) +} + +// Accounts_ServiceDesc is the grpc.ServiceDesc for Accounts service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Accounts_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "Accounts", + HandlerType: (*AccountsServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetAccount", + Handler: _Accounts_GetAccount_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "accounts.proto", +} diff --git a/grpc-interfaces/kloudlite.io/rpc/agent/kubeagent.pb.go b/grpc-interfaces/kloudlite.io/rpc/agent/kubeagent.pb.go index 90d8ee761..b69a7602d 100644 --- a/grpc-interfaces/kloudlite.io/rpc/agent/kubeagent.pb.go +++ b/grpc-interfaces/kloudlite.io/rpc/agent/kubeagent.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v3.21.12 +// protoc-gen-go v1.31.0 +// protoc v4.24.4 // source: kubeagent.proto package agent diff --git a/grpc-interfaces/kloudlite.io/rpc/agent/kubeagent_grpc.pb.go b/grpc-interfaces/kloudlite.io/rpc/agent/kubeagent_grpc.pb.go index 8a2bdca4f..0d761c0bd 100644 --- a/grpc-interfaces/kloudlite.io/rpc/agent/kubeagent_grpc.pb.go +++ b/grpc-interfaces/kloudlite.io/rpc/agent/kubeagent_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.12 +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.24.4 // source: kubeagent.proto package agent @@ -18,6 +18,10 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + KubeAgent_KubeApply_FullMethodName = "/KubeAgent/KubeApply" +) + // KubeAgentClient is the client API for KubeAgent service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -35,7 +39,7 @@ func NewKubeAgentClient(cc grpc.ClientConnInterface) KubeAgentClient { func (c *kubeAgentClient) KubeApply(ctx context.Context, in *PayloadIn, opts ...grpc.CallOption) (*PayloadOut, error) { out := new(PayloadOut) - err := c.cc.Invoke(ctx, "/KubeAgent/KubeApply", in, out, opts...) + err := c.cc.Invoke(ctx, KubeAgent_KubeApply_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -80,7 +84,7 @@ func _KubeAgent_KubeApply_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/KubeAgent/KubeApply", + FullMethod: KubeAgent_KubeApply_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(KubeAgentServer).KubeApply(ctx, req.(*PayloadIn)) diff --git a/grpc-interfaces/kloudlite.io/rpc/agent/mocks/agent-client.go b/grpc-interfaces/kloudlite.io/rpc/agent/mocks/agent-client.go new file mode 100644 index 000000000..da1937938 --- /dev/null +++ b/grpc-interfaces/kloudlite.io/rpc/agent/mocks/agent-client.go @@ -0,0 +1,35 @@ +package mocks + +import ( + context "context" + agent "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/agent" + grpc "google.golang.org/grpc" +) + +type KubeAgentClientCallerInfo struct { + Args []any +} + +type KubeAgentClient struct { + Calls map[string][]KubeAgentClientCallerInfo + MockKubeApply func(ctx context.Context, in *agent.PayloadIn, opts ...grpc.CallOption) (*agent.PayloadOut, error) +} + +func (m *KubeAgentClient) registerCall(funcName string, args ...any) { + if m.Calls == nil { + m.Calls = map[string][]KubeAgentClientCallerInfo{} + } + m.Calls[funcName] = append(m.Calls[funcName], KubeAgentClientCallerInfo{Args: args}) +} + +func (kMock *KubeAgentClient) KubeApply(ctx context.Context, in *agent.PayloadIn, opts ...grpc.CallOption) (*agent.PayloadOut, error) { + if kMock.MockKubeApply != nil { + kMock.registerCall("KubeApply", ctx, in, opts) + return kMock.MockKubeApply(ctx, in, opts...) + } + panic("method 'KubeApply' not implemented, yet") +} + +func NewKubeAgentClient() *KubeAgentClient { + return &KubeAgentClient{} +} diff --git a/grpc-interfaces/kloudlite.io/rpc/agent/mocks/agent-server.go b/grpc-interfaces/kloudlite.io/rpc/agent/mocks/agent-server.go new file mode 100644 index 000000000..6532d4bdd --- /dev/null +++ b/grpc-interfaces/kloudlite.io/rpc/agent/mocks/agent-server.go @@ -0,0 +1,34 @@ +package mocks + +import ( + context "context" + agent "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/agent" +) + +type KubeAgentServerCallerInfo struct { + Args []any +} + +type KubeAgentServer struct { + Calls map[string][]KubeAgentServerCallerInfo + MockKubeApply func(ka context.Context, kb *agent.PayloadIn) (*agent.PayloadOut, error) +} + +func (m *KubeAgentServer) registerCall(funcName string, args ...any) { + if m.Calls == nil { + m.Calls = map[string][]KubeAgentServerCallerInfo{} + } + m.Calls[funcName] = append(m.Calls[funcName], KubeAgentServerCallerInfo{Args: args}) +} + +func (kMock *KubeAgentServer) KubeApply(ka context.Context, kb *agent.PayloadIn) (*agent.PayloadOut, error) { + if kMock.MockKubeApply != nil { + kMock.registerCall("KubeApply", ka, kb) + return kMock.MockKubeApply(ka, kb) + } + panic("method 'KubeApply' not implemented, yet") +} + +func NewKubeAgentServer() *KubeAgentServer { + return &KubeAgentServer{} +} diff --git a/grpc-interfaces/kloudlite.io/rpc/auth/auth.pb.go b/grpc-interfaces/kloudlite.io/rpc/auth/auth.pb.go index 131a9a2f7..e732090d6 100644 --- a/grpc-interfaces/kloudlite.io/rpc/auth/auth.pb.go +++ b/grpc-interfaces/kloudlite.io/rpc/auth/auth.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v3.21.12 +// protoc-gen-go v1.31.0 +// protoc v4.24.4 // source: auth.proto package auth @@ -335,6 +335,116 @@ func (x *OauthToken) GetRaw() string { return "" } +type GetUserIn struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` +} + +func (x *GetUserIn) Reset() { + *x = GetUserIn{} + if protoimpl.UnsafeEnabled { + mi := &file_auth_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUserIn) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserIn) ProtoMessage() {} + +func (x *GetUserIn) ProtoReflect() protoreflect.Message { + mi := &file_auth_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserIn.ProtoReflect.Descriptor instead. +func (*GetUserIn) Descriptor() ([]byte, []int) { + return file_auth_proto_rawDescGZIP(), []int{5} +} + +func (x *GetUserIn) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +type GetUserOut struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *GetUserOut) Reset() { + *x = GetUserOut{} + if protoimpl.UnsafeEnabled { + mi := &file_auth_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUserOut) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserOut) ProtoMessage() {} + +func (x *GetUserOut) ProtoReflect() protoreflect.Message { + mi := &file_auth_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserOut.ProtoReflect.Descriptor instead. +func (*GetUserOut) Descriptor() ([]byte, []int) { + return file_auth_proto_rawDescGZIP(), []int{6} +} + +func (x *GetUserOut) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *GetUserOut) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *GetUserOut) GetName() string { + if x != nil { + return x.Name + } + return "" +} + var File_auth_proto protoreflect.FileDescriptor var file_auth_proto_rawDesc = []byte{ @@ -370,17 +480,26 @@ var file_auth_proto_rawDesc = []byte{ 0x09, 0x52, 0x0c, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x61, 0x77, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x61, 0x77, 0x32, 0x82, 0x01, 0x0a, 0x04, 0x41, 0x75, - 0x74, 0x68, 0x12, 0x39, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x16, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x41, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4f, 0x75, 0x74, 0x12, 0x3f, 0x0a, - 0x11, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x45, 0x6d, 0x61, - 0x69, 0x6c, 0x12, 0x16, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x45, 0x6d, - 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x47, 0x65, 0x74, - 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x4f, 0x75, 0x74, 0x42, 0x17, - 0x5a, 0x15, 0x6b, 0x6c, 0x6f, 0x75, 0x64, 0x6c, 0x69, 0x74, 0x65, 0x2e, 0x69, 0x6f, 0x2f, 0x72, - 0x70, 0x63, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x61, 0x77, 0x22, 0x23, 0x0a, 0x09, 0x47, 0x65, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x46, + 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, + 0x69, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x32, 0xa6, 0x01, 0x0a, 0x04, 0x41, 0x75, 0x74, 0x68, 0x12, + 0x39, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x12, 0x16, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x41, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4f, 0x75, 0x74, 0x12, 0x3f, 0x0a, 0x11, 0x45, 0x6e, + 0x73, 0x75, 0x72, 0x65, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, + 0x16, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x45, 0x6d, 0x61, 0x69, 0x6c, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, + 0x72, 0x42, 0x79, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x4f, 0x75, 0x74, 0x12, 0x22, 0x0a, 0x07, 0x47, + 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0a, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, + 0x49, 0x6e, 0x1a, 0x0b, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x42, + 0x17, 0x5a, 0x15, 0x6b, 0x6c, 0x6f, 0x75, 0x64, 0x6c, 0x69, 0x74, 0x65, 0x2e, 0x69, 0x6f, 0x2f, + 0x72, 0x70, 0x63, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -395,22 +514,26 @@ func file_auth_proto_rawDescGZIP() []byte { return file_auth_proto_rawDescData } -var file_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_auth_proto_goTypes = []interface{}{ (*GetUserByEmailRequest)(nil), // 0: GetUserByEmailRequest (*GetUserByEmailOut)(nil), // 1: GetUserByEmailOut (*GetAccessTokenRequest)(nil), // 2: GetAccessTokenRequest (*AccessTokenOut)(nil), // 3: AccessTokenOut (*OauthToken)(nil), // 4: OauthToken + (*GetUserIn)(nil), // 5: GetUserIn + (*GetUserOut)(nil), // 6: GetUserOut } var file_auth_proto_depIdxs = []int32{ 4, // 0: AccessTokenOut.oauthToken:type_name -> OauthToken 2, // 1: Auth.GetAccessToken:input_type -> GetAccessTokenRequest 0, // 2: Auth.EnsureUserByEmail:input_type -> GetUserByEmailRequest - 3, // 3: Auth.GetAccessToken:output_type -> AccessTokenOut - 1, // 4: Auth.EnsureUserByEmail:output_type -> GetUserByEmailOut - 3, // [3:5] is the sub-list for method output_type - 1, // [1:3] is the sub-list for method input_type + 5, // 3: Auth.GetUser:input_type -> GetUserIn + 3, // 4: Auth.GetAccessToken:output_type -> AccessTokenOut + 1, // 5: Auth.EnsureUserByEmail:output_type -> GetUserByEmailOut + 6, // 6: Auth.GetUser:output_type -> GetUserOut + 4, // [4:7] is the sub-list for method output_type + 1, // [1:4] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name 1, // [1:1] is the sub-list for extension extendee 0, // [0:1] is the sub-list for field type_name @@ -482,6 +605,30 @@ func file_auth_proto_init() { return nil } } + file_auth_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUserIn); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_auth_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUserOut); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -489,7 +636,7 @@ func file_auth_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_auth_proto_rawDesc, NumEnums: 0, - NumMessages: 5, + NumMessages: 7, NumExtensions: 0, NumServices: 1, }, diff --git a/grpc-interfaces/kloudlite.io/rpc/auth/auth_grpc.pb.go b/grpc-interfaces/kloudlite.io/rpc/auth/auth_grpc.pb.go index c94fe31bd..d7b047468 100644 --- a/grpc-interfaces/kloudlite.io/rpc/auth/auth_grpc.pb.go +++ b/grpc-interfaces/kloudlite.io/rpc/auth/auth_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.12 +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.24.4 // source: auth.proto package auth @@ -18,12 +18,19 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + Auth_GetAccessToken_FullMethodName = "/Auth/GetAccessToken" + Auth_EnsureUserByEmail_FullMethodName = "/Auth/EnsureUserByEmail" + Auth_GetUser_FullMethodName = "/Auth/GetUser" +) + // AuthClient is the client API for Auth service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type AuthClient interface { GetAccessToken(ctx context.Context, in *GetAccessTokenRequest, opts ...grpc.CallOption) (*AccessTokenOut, error) EnsureUserByEmail(ctx context.Context, in *GetUserByEmailRequest, opts ...grpc.CallOption) (*GetUserByEmailOut, error) + GetUser(ctx context.Context, in *GetUserIn, opts ...grpc.CallOption) (*GetUserOut, error) } type authClient struct { @@ -36,7 +43,7 @@ func NewAuthClient(cc grpc.ClientConnInterface) AuthClient { func (c *authClient) GetAccessToken(ctx context.Context, in *GetAccessTokenRequest, opts ...grpc.CallOption) (*AccessTokenOut, error) { out := new(AccessTokenOut) - err := c.cc.Invoke(ctx, "/Auth/GetAccessToken", in, out, opts...) + err := c.cc.Invoke(ctx, Auth_GetAccessToken_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -45,7 +52,16 @@ func (c *authClient) GetAccessToken(ctx context.Context, in *GetAccessTokenReque func (c *authClient) EnsureUserByEmail(ctx context.Context, in *GetUserByEmailRequest, opts ...grpc.CallOption) (*GetUserByEmailOut, error) { out := new(GetUserByEmailOut) - err := c.cc.Invoke(ctx, "/Auth/EnsureUserByEmail", in, out, opts...) + err := c.cc.Invoke(ctx, Auth_EnsureUserByEmail_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *authClient) GetUser(ctx context.Context, in *GetUserIn, opts ...grpc.CallOption) (*GetUserOut, error) { + out := new(GetUserOut) + err := c.cc.Invoke(ctx, Auth_GetUser_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -58,6 +74,7 @@ func (c *authClient) EnsureUserByEmail(ctx context.Context, in *GetUserByEmailRe type AuthServer interface { GetAccessToken(context.Context, *GetAccessTokenRequest) (*AccessTokenOut, error) EnsureUserByEmail(context.Context, *GetUserByEmailRequest) (*GetUserByEmailOut, error) + GetUser(context.Context, *GetUserIn) (*GetUserOut, error) mustEmbedUnimplementedAuthServer() } @@ -71,6 +88,9 @@ func (UnimplementedAuthServer) GetAccessToken(context.Context, *GetAccessTokenRe func (UnimplementedAuthServer) EnsureUserByEmail(context.Context, *GetUserByEmailRequest) (*GetUserByEmailOut, error) { return nil, status.Errorf(codes.Unimplemented, "method EnsureUserByEmail not implemented") } +func (UnimplementedAuthServer) GetUser(context.Context, *GetUserIn) (*GetUserOut, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented") +} func (UnimplementedAuthServer) mustEmbedUnimplementedAuthServer() {} // UnsafeAuthServer may be embedded to opt out of forward compatibility for this service. @@ -94,7 +114,7 @@ func _Auth_GetAccessToken_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Auth/GetAccessToken", + FullMethod: Auth_GetAccessToken_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AuthServer).GetAccessToken(ctx, req.(*GetAccessTokenRequest)) @@ -112,7 +132,7 @@ func _Auth_EnsureUserByEmail_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Auth/EnsureUserByEmail", + FullMethod: Auth_EnsureUserByEmail_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AuthServer).EnsureUserByEmail(ctx, req.(*GetUserByEmailRequest)) @@ -120,6 +140,24 @@ func _Auth_EnsureUserByEmail_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _Auth_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserIn) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthServer).GetUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Auth_GetUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthServer).GetUser(ctx, req.(*GetUserIn)) + } + return interceptor(ctx, in, info, handler) +} + // Auth_ServiceDesc is the grpc.ServiceDesc for Auth service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -135,6 +173,10 @@ var Auth_ServiceDesc = grpc.ServiceDesc{ MethodName: "EnsureUserByEmail", Handler: _Auth_EnsureUserByEmail_Handler, }, + { + MethodName: "GetUser", + Handler: _Auth_GetUser_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "auth.proto", diff --git a/grpc-interfaces/kloudlite.io/rpc/auth/mocks/auth-client.go b/grpc-interfaces/kloudlite.io/rpc/auth/mocks/auth-client.go new file mode 100644 index 000000000..42a3001fa --- /dev/null +++ b/grpc-interfaces/kloudlite.io/rpc/auth/mocks/auth-client.go @@ -0,0 +1,53 @@ +package mocks + +import ( + context "context" + auth "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/auth" + grpc "google.golang.org/grpc" +) + +type AuthClientCallerInfo struct { + Args []any +} + +type AuthClient struct { + Calls map[string][]AuthClientCallerInfo + MockEnsureUserByEmail func(ctx context.Context, in *auth.GetUserByEmailRequest, opts ...grpc.CallOption) (*auth.GetUserByEmailOut, error) + MockGetAccessToken func(ctx context.Context, in *auth.GetAccessTokenRequest, opts ...grpc.CallOption) (*auth.AccessTokenOut, error) + MockGetUser func(ctx context.Context, in *auth.GetUserIn, opts ...grpc.CallOption) (*auth.GetUserOut, error) +} + +func (m *AuthClient) registerCall(funcName string, args ...any) { + if m.Calls == nil { + m.Calls = map[string][]AuthClientCallerInfo{} + } + m.Calls[funcName] = append(m.Calls[funcName], AuthClientCallerInfo{Args: args}) +} + +func (aMock *AuthClient) EnsureUserByEmail(ctx context.Context, in *auth.GetUserByEmailRequest, opts ...grpc.CallOption) (*auth.GetUserByEmailOut, error) { + if aMock.MockEnsureUserByEmail != nil { + aMock.registerCall("EnsureUserByEmail", ctx, in, opts) + return aMock.MockEnsureUserByEmail(ctx, in, opts...) + } + panic("method 'EnsureUserByEmail' not implemented, yet") +} + +func (aMock *AuthClient) GetAccessToken(ctx context.Context, in *auth.GetAccessTokenRequest, opts ...grpc.CallOption) (*auth.AccessTokenOut, error) { + if aMock.MockGetAccessToken != nil { + aMock.registerCall("GetAccessToken", ctx, in, opts) + return aMock.MockGetAccessToken(ctx, in, opts...) + } + panic("method 'GetAccessToken' not implemented, yet") +} + +func (aMock *AuthClient) GetUser(ctx context.Context, in *auth.GetUserIn, opts ...grpc.CallOption) (*auth.GetUserOut, error) { + if aMock.MockGetUser != nil { + aMock.registerCall("GetUser", ctx, in, opts) + return aMock.MockGetUser(ctx, in, opts...) + } + panic("method 'GetUser' not implemented, yet") +} + +func NewAuthClient() *AuthClient { + return &AuthClient{} +} diff --git a/grpc-interfaces/kloudlite.io/rpc/auth/mocks/auth-server.go b/grpc-interfaces/kloudlite.io/rpc/auth/mocks/auth-server.go new file mode 100644 index 000000000..7856e5f77 --- /dev/null +++ b/grpc-interfaces/kloudlite.io/rpc/auth/mocks/auth-server.go @@ -0,0 +1,52 @@ +package mocks + +import ( + context "context" + auth "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/auth" +) + +type AuthServerCallerInfo struct { + Args []any +} + +type AuthServer struct { + Calls map[string][]AuthServerCallerInfo + MockEnsureUserByEmail func(ka context.Context, kb *auth.GetUserByEmailRequest) (*auth.GetUserByEmailOut, error) + MockGetAccessToken func(kc context.Context, kd *auth.GetAccessTokenRequest) (*auth.AccessTokenOut, error) + MockGetUser func(ke context.Context, kf *auth.GetUserIn) (*auth.GetUserOut, error) +} + +func (m *AuthServer) registerCall(funcName string, args ...any) { + if m.Calls == nil { + m.Calls = map[string][]AuthServerCallerInfo{} + } + m.Calls[funcName] = append(m.Calls[funcName], AuthServerCallerInfo{Args: args}) +} + +func (aMock *AuthServer) EnsureUserByEmail(ka context.Context, kb *auth.GetUserByEmailRequest) (*auth.GetUserByEmailOut, error) { + if aMock.MockEnsureUserByEmail != nil { + aMock.registerCall("EnsureUserByEmail", ka, kb) + return aMock.MockEnsureUserByEmail(ka, kb) + } + panic("method 'EnsureUserByEmail' not implemented, yet") +} + +func (aMock *AuthServer) GetAccessToken(kc context.Context, kd *auth.GetAccessTokenRequest) (*auth.AccessTokenOut, error) { + if aMock.MockGetAccessToken != nil { + aMock.registerCall("GetAccessToken", kc, kd) + return aMock.MockGetAccessToken(kc, kd) + } + panic("method 'GetAccessToken' not implemented, yet") +} + +func (aMock *AuthServer) GetUser(ke context.Context, kf *auth.GetUserIn) (*auth.GetUserOut, error) { + if aMock.MockGetUser != nil { + aMock.registerCall("GetUser", ke, kf) + return aMock.MockGetUser(ke, kf) + } + panic("method 'GetUser' not implemented, yet") +} + +func NewAuthServer() *AuthServer { + return &AuthServer{} +} diff --git a/grpc-interfaces/kloudlite.io/rpc/ci/ci.pb.go b/grpc-interfaces/kloudlite.io/rpc/ci/ci.pb.go index e9e73c980..956a394a4 100644 --- a/grpc-interfaces/kloudlite.io/rpc/ci/ci.pb.go +++ b/grpc-interfaces/kloudlite.io/rpc/ci/ci.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v3.21.12 +// protoc-gen-go v1.31.0 +// protoc v4.24.4 // source: ci.proto package ci diff --git a/grpc-interfaces/kloudlite.io/rpc/ci/ci_grpc.pb.go b/grpc-interfaces/kloudlite.io/rpc/ci/ci_grpc.pb.go index 073735fd0..aa4fbd339 100644 --- a/grpc-interfaces/kloudlite.io/rpc/ci/ci_grpc.pb.go +++ b/grpc-interfaces/kloudlite.io/rpc/ci/ci_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.12 +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.24.4 // source: ci.proto package ci @@ -18,6 +18,11 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + CI_CreateHarborProject_FullMethodName = "/CI/CreateHarborProject" + CI_DeleteHarborProject_FullMethodName = "/CI/DeleteHarborProject" +) + // CIClient is the client API for CI service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -36,7 +41,7 @@ func NewCIClient(cc grpc.ClientConnInterface) CIClient { func (c *cIClient) CreateHarborProject(ctx context.Context, in *HarborProjectIn, opts ...grpc.CallOption) (*HarborProjectOut, error) { out := new(HarborProjectOut) - err := c.cc.Invoke(ctx, "/CI/CreateHarborProject", in, out, opts...) + err := c.cc.Invoke(ctx, CI_CreateHarborProject_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -45,7 +50,7 @@ func (c *cIClient) CreateHarborProject(ctx context.Context, in *HarborProjectIn, func (c *cIClient) DeleteHarborProject(ctx context.Context, in *HarborProjectIn, opts ...grpc.CallOption) (*HarborProjectOut, error) { out := new(HarborProjectOut) - err := c.cc.Invoke(ctx, "/CI/DeleteHarborProject", in, out, opts...) + err := c.cc.Invoke(ctx, CI_DeleteHarborProject_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -94,7 +99,7 @@ func _CI_CreateHarborProject_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/CI/CreateHarborProject", + FullMethod: CI_CreateHarborProject_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CIServer).CreateHarborProject(ctx, req.(*HarborProjectIn)) @@ -112,7 +117,7 @@ func _CI_DeleteHarborProject_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/CI/DeleteHarborProject", + FullMethod: CI_DeleteHarborProject_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CIServer).DeleteHarborProject(ctx, req.(*HarborProjectIn)) diff --git a/grpc-interfaces/kloudlite.io/rpc/comms/comms.pb.go b/grpc-interfaces/kloudlite.io/rpc/comms/comms.pb.go index c15ab5edc..645945bea 100644 --- a/grpc-interfaces/kloudlite.io/rpc/comms/comms.pb.go +++ b/grpc-interfaces/kloudlite.io/rpc/comms/comms.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v3.21.12 +// protoc-gen-go v1.31.0 +// protoc v4.24.4 // source: comms.proto package comms @@ -208,8 +208,9 @@ type AccountMemberInviteEmailInput struct { AccountName string `protobuf:"bytes,1,opt,name=accountName,proto3" json:"accountName,omitempty"` InvitationToken string `protobuf:"bytes,2,opt,name=invitationToken,proto3" json:"invitationToken,omitempty"` - Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + InvitedBy string `protobuf:"bytes,3,opt,name=invitedBy,proto3" json:"invitedBy,omitempty"` + Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` + Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` } func (x *AccountMemberInviteEmailInput) Reset() { @@ -258,6 +259,13 @@ func (x *AccountMemberInviteEmailInput) GetInvitationToken() string { return "" } +func (x *AccountMemberInviteEmailInput) GetInvitedBy() string { + if x != nil { + return x.InvitedBy + } + return "" +} + func (x *AccountMemberInviteEmailInput) GetEmail() string { if x != nil { return x.Email @@ -279,8 +287,9 @@ type ProjectMemberInviteEmailInput struct { ProjectName string `protobuf:"bytes,1,opt,name=projectName,proto3" json:"projectName,omitempty"` InvitationToken string `protobuf:"bytes,2,opt,name=invitationToken,proto3" json:"invitationToken,omitempty"` - Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + InvitedBy string `protobuf:"bytes,3,opt,name=invitedBy,proto3" json:"invitedBy,omitempty"` + Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` + Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` } func (x *ProjectMemberInviteEmailInput) Reset() { @@ -329,6 +338,13 @@ func (x *ProjectMemberInviteEmailInput) GetInvitationToken() string { return "" } +func (x *ProjectMemberInviteEmailInput) GetInvitedBy() string { + if x != nil { + return x.InvitedBy + } + return "" +} + func (x *ProjectMemberInviteEmailInput) GetEmail() string { if x != nil { return x.Email @@ -402,48 +418,52 @@ var file_comms_proto_rawDesc = []byte{ 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x73, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x65, 0x74, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x22, 0x95, 0x01, 0x0a, 0x1d, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4d, + 0x6b, 0x65, 0x6e, 0x22, 0xb3, 0x01, 0x0a, 0x1d, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x95, 0x01, 0x0a, 0x1d, - 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x6e, 0x76, - 0x69, 0x74, 0x65, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x20, 0x0a, - 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x28, 0x0a, 0x0f, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, - 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x22, 0x06, 0x0a, 0x04, 0x56, 0x6f, 0x69, 0x64, 0x32, 0xb8, 0x02, 0x0a, 0x05, - 0x43, 0x6f, 0x6d, 0x6d, 0x73, 0x12, 0x37, 0x0a, 0x15, 0x53, 0x65, 0x6e, 0x64, 0x56, 0x65, 0x72, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x17, - 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6d, 0x61, - 0x69, 0x6c, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x1a, 0x05, 0x2e, 0x56, 0x6f, 0x69, 0x64, 0x12, 0x39, - 0x0a, 0x16, 0x53, 0x65, 0x6e, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, - 0x73, 0x65, 0x74, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x18, 0x2e, 0x50, 0x61, 0x73, 0x73, 0x77, - 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x65, 0x74, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x49, 0x6e, 0x70, - 0x75, 0x74, 0x1a, 0x05, 0x2e, 0x56, 0x6f, 0x69, 0x64, 0x12, 0x45, 0x0a, 0x1c, 0x53, 0x65, 0x6e, - 0x64, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x6e, - 0x76, 0x69, 0x74, 0x65, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1e, 0x2e, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x45, - 0x6d, 0x61, 0x69, 0x6c, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x1a, 0x05, 0x2e, 0x56, 0x6f, 0x69, 0x64, - 0x12, 0x45, 0x0a, 0x1c, 0x53, 0x65, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, + 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x64, 0x42, 0x79, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x64, 0x42, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xb3, 0x01, 0x0a, 0x1d, 0x50, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x6e, 0x76, 0x69, 0x74, + 0x65, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, + 0x0f, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x76, 0x69, 0x74, + 0x65, 0x64, 0x42, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x69, + 0x74, 0x65, 0x64, 0x42, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, + 0x06, 0x0a, 0x04, 0x56, 0x6f, 0x69, 0x64, 0x32, 0xb8, 0x02, 0x0a, 0x05, 0x43, 0x6f, 0x6d, 0x6d, + 0x73, 0x12, 0x37, 0x0a, 0x15, 0x53, 0x65, 0x6e, 0x64, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x17, 0x2e, 0x56, 0x65, 0x72, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x49, 0x6e, + 0x70, 0x75, 0x74, 0x1a, 0x05, 0x2e, 0x56, 0x6f, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x16, 0x53, 0x65, + 0x6e, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x65, 0x74, 0x45, + 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x18, 0x2e, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, + 0x65, 0x73, 0x65, 0x74, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x1a, 0x05, + 0x2e, 0x56, 0x6f, 0x69, 0x64, 0x12, 0x45, 0x0a, 0x1c, 0x53, 0x65, 0x6e, 0x64, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, + 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1e, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x45, 0x6d, 0x61, 0x69, 0x6c, - 0x12, 0x1e, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, - 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x49, 0x6e, 0x70, 0x75, 0x74, - 0x1a, 0x05, 0x2e, 0x56, 0x6f, 0x69, 0x64, 0x12, 0x2d, 0x0a, 0x10, 0x53, 0x65, 0x6e, 0x64, 0x57, - 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x12, 0x2e, 0x57, 0x65, - 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x1a, - 0x05, 0x2e, 0x56, 0x6f, 0x69, 0x64, 0x42, 0x18, 0x5a, 0x16, 0x6b, 0x6c, 0x6f, 0x75, 0x64, 0x6c, - 0x69, 0x74, 0x65, 0x2e, 0x69, 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x73, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x49, 0x6e, 0x70, 0x75, 0x74, 0x1a, 0x05, 0x2e, 0x56, 0x6f, 0x69, 0x64, 0x12, 0x45, 0x0a, 0x1c, + 0x53, 0x65, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1e, 0x2e, 0x50, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x6e, 0x76, 0x69, + 0x74, 0x65, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x1a, 0x05, 0x2e, 0x56, + 0x6f, 0x69, 0x64, 0x12, 0x2d, 0x0a, 0x10, 0x53, 0x65, 0x6e, 0x64, 0x57, 0x65, 0x6c, 0x63, 0x6f, + 0x6d, 0x65, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x12, 0x2e, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, + 0x65, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x1a, 0x05, 0x2e, 0x56, 0x6f, + 0x69, 0x64, 0x42, 0x18, 0x5a, 0x16, 0x6b, 0x6c, 0x6f, 0x75, 0x64, 0x6c, 0x69, 0x74, 0x65, 0x2e, + 0x69, 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x73, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/grpc-interfaces/kloudlite.io/rpc/comms/comms_grpc.pb.go b/grpc-interfaces/kloudlite.io/rpc/comms/comms_grpc.pb.go index 03306a6f7..68f1c675e 100644 --- a/grpc-interfaces/kloudlite.io/rpc/comms/comms_grpc.pb.go +++ b/grpc-interfaces/kloudlite.io/rpc/comms/comms_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.12 +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.24.4 // source: comms.proto package comms @@ -18,6 +18,14 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + Comms_SendVerificationEmail_FullMethodName = "/Comms/SendVerificationEmail" + Comms_SendPasswordResetEmail_FullMethodName = "/Comms/SendPasswordResetEmail" + Comms_SendAccountMemberInviteEmail_FullMethodName = "/Comms/SendAccountMemberInviteEmail" + Comms_SendProjectMemberInviteEmail_FullMethodName = "/Comms/SendProjectMemberInviteEmail" + Comms_SendWelcomeEmail_FullMethodName = "/Comms/SendWelcomeEmail" +) + // CommsClient is the client API for Comms service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -39,7 +47,7 @@ func NewCommsClient(cc grpc.ClientConnInterface) CommsClient { func (c *commsClient) SendVerificationEmail(ctx context.Context, in *VerificationEmailInput, opts ...grpc.CallOption) (*Void, error) { out := new(Void) - err := c.cc.Invoke(ctx, "/Comms/SendVerificationEmail", in, out, opts...) + err := c.cc.Invoke(ctx, Comms_SendVerificationEmail_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -48,7 +56,7 @@ func (c *commsClient) SendVerificationEmail(ctx context.Context, in *Verificatio func (c *commsClient) SendPasswordResetEmail(ctx context.Context, in *PasswordResetEmailInput, opts ...grpc.CallOption) (*Void, error) { out := new(Void) - err := c.cc.Invoke(ctx, "/Comms/SendPasswordResetEmail", in, out, opts...) + err := c.cc.Invoke(ctx, Comms_SendPasswordResetEmail_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -57,7 +65,7 @@ func (c *commsClient) SendPasswordResetEmail(ctx context.Context, in *PasswordRe func (c *commsClient) SendAccountMemberInviteEmail(ctx context.Context, in *AccountMemberInviteEmailInput, opts ...grpc.CallOption) (*Void, error) { out := new(Void) - err := c.cc.Invoke(ctx, "/Comms/SendAccountMemberInviteEmail", in, out, opts...) + err := c.cc.Invoke(ctx, Comms_SendAccountMemberInviteEmail_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -66,7 +74,7 @@ func (c *commsClient) SendAccountMemberInviteEmail(ctx context.Context, in *Acco func (c *commsClient) SendProjectMemberInviteEmail(ctx context.Context, in *ProjectMemberInviteEmailInput, opts ...grpc.CallOption) (*Void, error) { out := new(Void) - err := c.cc.Invoke(ctx, "/Comms/SendProjectMemberInviteEmail", in, out, opts...) + err := c.cc.Invoke(ctx, Comms_SendProjectMemberInviteEmail_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -75,7 +83,7 @@ func (c *commsClient) SendProjectMemberInviteEmail(ctx context.Context, in *Proj func (c *commsClient) SendWelcomeEmail(ctx context.Context, in *WelcomeEmailInput, opts ...grpc.CallOption) (*Void, error) { out := new(Void) - err := c.cc.Invoke(ctx, "/Comms/SendWelcomeEmail", in, out, opts...) + err := c.cc.Invoke(ctx, Comms_SendWelcomeEmail_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -136,7 +144,7 @@ func _Comms_SendVerificationEmail_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Comms/SendVerificationEmail", + FullMethod: Comms_SendVerificationEmail_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CommsServer).SendVerificationEmail(ctx, req.(*VerificationEmailInput)) @@ -154,7 +162,7 @@ func _Comms_SendPasswordResetEmail_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Comms/SendPasswordResetEmail", + FullMethod: Comms_SendPasswordResetEmail_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CommsServer).SendPasswordResetEmail(ctx, req.(*PasswordResetEmailInput)) @@ -172,7 +180,7 @@ func _Comms_SendAccountMemberInviteEmail_Handler(srv interface{}, ctx context.Co } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Comms/SendAccountMemberInviteEmail", + FullMethod: Comms_SendAccountMemberInviteEmail_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CommsServer).SendAccountMemberInviteEmail(ctx, req.(*AccountMemberInviteEmailInput)) @@ -190,7 +198,7 @@ func _Comms_SendProjectMemberInviteEmail_Handler(srv interface{}, ctx context.Co } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Comms/SendProjectMemberInviteEmail", + FullMethod: Comms_SendProjectMemberInviteEmail_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CommsServer).SendProjectMemberInviteEmail(ctx, req.(*ProjectMemberInviteEmailInput)) @@ -208,7 +216,7 @@ func _Comms_SendWelcomeEmail_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Comms/SendWelcomeEmail", + FullMethod: Comms_SendWelcomeEmail_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CommsServer).SendWelcomeEmail(ctx, req.(*WelcomeEmailInput)) diff --git a/grpc-interfaces/kloudlite.io/rpc/comms/mocks/comms-client.go b/grpc-interfaces/kloudlite.io/rpc/comms/mocks/comms-client.go new file mode 100644 index 000000000..9dd36315a --- /dev/null +++ b/grpc-interfaces/kloudlite.io/rpc/comms/mocks/comms-client.go @@ -0,0 +1,71 @@ +package mocks + +import ( + context "context" + comms "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/comms" + grpc "google.golang.org/grpc" +) + +type CommsClientCallerInfo struct { + Args []any +} + +type CommsClient struct { + Calls map[string][]CommsClientCallerInfo + MockSendAccountMemberInviteEmail func(ctx context.Context, in *comms.AccountMemberInviteEmailInput, opts ...grpc.CallOption) (*comms.Void, error) + MockSendPasswordResetEmail func(ctx context.Context, in *comms.PasswordResetEmailInput, opts ...grpc.CallOption) (*comms.Void, error) + MockSendProjectMemberInviteEmail func(ctx context.Context, in *comms.ProjectMemberInviteEmailInput, opts ...grpc.CallOption) (*comms.Void, error) + MockSendVerificationEmail func(ctx context.Context, in *comms.VerificationEmailInput, opts ...grpc.CallOption) (*comms.Void, error) + MockSendWelcomeEmail func(ctx context.Context, in *comms.WelcomeEmailInput, opts ...grpc.CallOption) (*comms.Void, error) +} + +func (m *CommsClient) registerCall(funcName string, args ...any) { + if m.Calls == nil { + m.Calls = map[string][]CommsClientCallerInfo{} + } + m.Calls[funcName] = append(m.Calls[funcName], CommsClientCallerInfo{Args: args}) +} + +func (cMock *CommsClient) SendAccountMemberInviteEmail(ctx context.Context, in *comms.AccountMemberInviteEmailInput, opts ...grpc.CallOption) (*comms.Void, error) { + if cMock.MockSendAccountMemberInviteEmail != nil { + cMock.registerCall("SendAccountMemberInviteEmail", ctx, in, opts) + return cMock.MockSendAccountMemberInviteEmail(ctx, in, opts...) + } + panic("method 'SendAccountMemberInviteEmail' not implemented, yet") +} + +func (cMock *CommsClient) SendPasswordResetEmail(ctx context.Context, in *comms.PasswordResetEmailInput, opts ...grpc.CallOption) (*comms.Void, error) { + if cMock.MockSendPasswordResetEmail != nil { + cMock.registerCall("SendPasswordResetEmail", ctx, in, opts) + return cMock.MockSendPasswordResetEmail(ctx, in, opts...) + } + panic("method 'SendPasswordResetEmail' not implemented, yet") +} + +func (cMock *CommsClient) SendProjectMemberInviteEmail(ctx context.Context, in *comms.ProjectMemberInviteEmailInput, opts ...grpc.CallOption) (*comms.Void, error) { + if cMock.MockSendProjectMemberInviteEmail != nil { + cMock.registerCall("SendProjectMemberInviteEmail", ctx, in, opts) + return cMock.MockSendProjectMemberInviteEmail(ctx, in, opts...) + } + panic("method 'SendProjectMemberInviteEmail' not implemented, yet") +} + +func (cMock *CommsClient) SendVerificationEmail(ctx context.Context, in *comms.VerificationEmailInput, opts ...grpc.CallOption) (*comms.Void, error) { + if cMock.MockSendVerificationEmail != nil { + cMock.registerCall("SendVerificationEmail", ctx, in, opts) + return cMock.MockSendVerificationEmail(ctx, in, opts...) + } + panic("method 'SendVerificationEmail' not implemented, yet") +} + +func (cMock *CommsClient) SendWelcomeEmail(ctx context.Context, in *comms.WelcomeEmailInput, opts ...grpc.CallOption) (*comms.Void, error) { + if cMock.MockSendWelcomeEmail != nil { + cMock.registerCall("SendWelcomeEmail", ctx, in, opts) + return cMock.MockSendWelcomeEmail(ctx, in, opts...) + } + panic("method 'SendWelcomeEmail' not implemented, yet") +} + +func NewCommsClient() *CommsClient { + return &CommsClient{} +} diff --git a/grpc-interfaces/kloudlite.io/rpc/comms/mocks/comms-server.go b/grpc-interfaces/kloudlite.io/rpc/comms/mocks/comms-server.go new file mode 100644 index 000000000..93aeafa87 --- /dev/null +++ b/grpc-interfaces/kloudlite.io/rpc/comms/mocks/comms-server.go @@ -0,0 +1,70 @@ +package mocks + +import ( + context "context" + comms "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/comms" +) + +type CommsServerCallerInfo struct { + Args []any +} + +type CommsServer struct { + Calls map[string][]CommsServerCallerInfo + MockSendAccountMemberInviteEmail func(ka context.Context, kb *comms.AccountMemberInviteEmailInput) (*comms.Void, error) + MockSendPasswordResetEmail func(kc context.Context, kd *comms.PasswordResetEmailInput) (*comms.Void, error) + MockSendProjectMemberInviteEmail func(ke context.Context, kf *comms.ProjectMemberInviteEmailInput) (*comms.Void, error) + MockSendVerificationEmail func(kg context.Context, kh *comms.VerificationEmailInput) (*comms.Void, error) + MockSendWelcomeEmail func(ki context.Context, kj *comms.WelcomeEmailInput) (*comms.Void, error) +} + +func (m *CommsServer) registerCall(funcName string, args ...any) { + if m.Calls == nil { + m.Calls = map[string][]CommsServerCallerInfo{} + } + m.Calls[funcName] = append(m.Calls[funcName], CommsServerCallerInfo{Args: args}) +} + +func (cMock *CommsServer) SendAccountMemberInviteEmail(ka context.Context, kb *comms.AccountMemberInviteEmailInput) (*comms.Void, error) { + if cMock.MockSendAccountMemberInviteEmail != nil { + cMock.registerCall("SendAccountMemberInviteEmail", ka, kb) + return cMock.MockSendAccountMemberInviteEmail(ka, kb) + } + panic("method 'SendAccountMemberInviteEmail' not implemented, yet") +} + +func (cMock *CommsServer) SendPasswordResetEmail(kc context.Context, kd *comms.PasswordResetEmailInput) (*comms.Void, error) { + if cMock.MockSendPasswordResetEmail != nil { + cMock.registerCall("SendPasswordResetEmail", kc, kd) + return cMock.MockSendPasswordResetEmail(kc, kd) + } + panic("method 'SendPasswordResetEmail' not implemented, yet") +} + +func (cMock *CommsServer) SendProjectMemberInviteEmail(ke context.Context, kf *comms.ProjectMemberInviteEmailInput) (*comms.Void, error) { + if cMock.MockSendProjectMemberInviteEmail != nil { + cMock.registerCall("SendProjectMemberInviteEmail", ke, kf) + return cMock.MockSendProjectMemberInviteEmail(ke, kf) + } + panic("method 'SendProjectMemberInviteEmail' not implemented, yet") +} + +func (cMock *CommsServer) SendVerificationEmail(kg context.Context, kh *comms.VerificationEmailInput) (*comms.Void, error) { + if cMock.MockSendVerificationEmail != nil { + cMock.registerCall("SendVerificationEmail", kg, kh) + return cMock.MockSendVerificationEmail(kg, kh) + } + panic("method 'SendVerificationEmail' not implemented, yet") +} + +func (cMock *CommsServer) SendWelcomeEmail(ki context.Context, kj *comms.WelcomeEmailInput) (*comms.Void, error) { + if cMock.MockSendWelcomeEmail != nil { + cMock.registerCall("SendWelcomeEmail", ki, kj) + return cMock.MockSendWelcomeEmail(ki, kj) + } + panic("method 'SendWelcomeEmail' not implemented, yet") +} + +func NewCommsServer() *CommsServer { + return &CommsServer{} +} diff --git a/grpc-interfaces/kloudlite.io/rpc/console/console.pb.go b/grpc-interfaces/kloudlite.io/rpc/console/console.pb.go index 8fbcc408f..d1b22c3f7 100644 --- a/grpc-interfaces/kloudlite.io/rpc/console/console.pb.go +++ b/grpc-interfaces/kloudlite.io/rpc/console/console.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v3.21.12 +// protoc-gen-go v1.31.0 +// protoc v4.24.4 // source: console.proto package console diff --git a/grpc-interfaces/kloudlite.io/rpc/console/console_grpc.pb.go b/grpc-interfaces/kloudlite.io/rpc/console/console_grpc.pb.go index ae4859610..d1ae92d93 100644 --- a/grpc-interfaces/kloudlite.io/rpc/console/console_grpc.pb.go +++ b/grpc-interfaces/kloudlite.io/rpc/console/console_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.12 +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.24.4 // source: console.proto package console @@ -18,6 +18,13 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + Console_GetProjectName_FullMethodName = "/Console/GetProjectName" + Console_GetApp_FullMethodName = "/Console/GetApp" + Console_GetManagedSvc_FullMethodName = "/Console/GetManagedSvc" + Console_SetupAccount_FullMethodName = "/Console/SetupAccount" +) + // ConsoleClient is the client API for Console service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -38,7 +45,7 @@ func NewConsoleClient(cc grpc.ClientConnInterface) ConsoleClient { func (c *consoleClient) GetProjectName(ctx context.Context, in *ProjectIn, opts ...grpc.CallOption) (*ProjectOut, error) { out := new(ProjectOut) - err := c.cc.Invoke(ctx, "/Console/GetProjectName", in, out, opts...) + err := c.cc.Invoke(ctx, Console_GetProjectName_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -47,7 +54,7 @@ func (c *consoleClient) GetProjectName(ctx context.Context, in *ProjectIn, opts func (c *consoleClient) GetApp(ctx context.Context, in *AppIn, opts ...grpc.CallOption) (*AppOut, error) { out := new(AppOut) - err := c.cc.Invoke(ctx, "/Console/GetApp", in, out, opts...) + err := c.cc.Invoke(ctx, Console_GetApp_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -56,7 +63,7 @@ func (c *consoleClient) GetApp(ctx context.Context, in *AppIn, opts ...grpc.Call func (c *consoleClient) GetManagedSvc(ctx context.Context, in *MSvcIn, opts ...grpc.CallOption) (*MSvcOut, error) { out := new(MSvcOut) - err := c.cc.Invoke(ctx, "/Console/GetManagedSvc", in, out, opts...) + err := c.cc.Invoke(ctx, Console_GetManagedSvc_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -65,7 +72,7 @@ func (c *consoleClient) GetManagedSvc(ctx context.Context, in *MSvcIn, opts ...g func (c *consoleClient) SetupAccount(ctx context.Context, in *AccountSetupIn, opts ...grpc.CallOption) (*AccountSetupVoid, error) { out := new(AccountSetupVoid) - err := c.cc.Invoke(ctx, "/Console/SetupAccount", in, out, opts...) + err := c.cc.Invoke(ctx, Console_SetupAccount_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -122,7 +129,7 @@ func _Console_GetProjectName_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Console/GetProjectName", + FullMethod: Console_GetProjectName_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ConsoleServer).GetProjectName(ctx, req.(*ProjectIn)) @@ -140,7 +147,7 @@ func _Console_GetApp_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Console/GetApp", + FullMethod: Console_GetApp_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ConsoleServer).GetApp(ctx, req.(*AppIn)) @@ -158,7 +165,7 @@ func _Console_GetManagedSvc_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Console/GetManagedSvc", + FullMethod: Console_GetManagedSvc_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ConsoleServer).GetManagedSvc(ctx, req.(*MSvcIn)) @@ -176,7 +183,7 @@ func _Console_SetupAccount_Handler(srv interface{}, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Console/SetupAccount", + FullMethod: Console_SetupAccount_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ConsoleServer).SetupAccount(ctx, req.(*AccountSetupIn)) diff --git a/grpc-interfaces/kloudlite.io/rpc/console/mocks/console-client.go b/grpc-interfaces/kloudlite.io/rpc/console/mocks/console-client.go new file mode 100644 index 000000000..bdc8cb670 --- /dev/null +++ b/grpc-interfaces/kloudlite.io/rpc/console/mocks/console-client.go @@ -0,0 +1,62 @@ +package mocks + +import ( + context "context" + console "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/console" + grpc "google.golang.org/grpc" +) + +type ConsoleClientCallerInfo struct { + Args []any +} + +type ConsoleClient struct { + Calls map[string][]ConsoleClientCallerInfo + MockGetApp func(ctx context.Context, in *console.AppIn, opts ...grpc.CallOption) (*console.AppOut, error) + MockGetManagedSvc func(ctx context.Context, in *console.MSvcIn, opts ...grpc.CallOption) (*console.MSvcOut, error) + MockGetProjectName func(ctx context.Context, in *console.ProjectIn, opts ...grpc.CallOption) (*console.ProjectOut, error) + MockSetupAccount func(ctx context.Context, in *console.AccountSetupIn, opts ...grpc.CallOption) (*console.AccountSetupVoid, error) +} + +func (m *ConsoleClient) registerCall(funcName string, args ...any) { + if m.Calls == nil { + m.Calls = map[string][]ConsoleClientCallerInfo{} + } + m.Calls[funcName] = append(m.Calls[funcName], ConsoleClientCallerInfo{Args: args}) +} + +func (cMock *ConsoleClient) GetApp(ctx context.Context, in *console.AppIn, opts ...grpc.CallOption) (*console.AppOut, error) { + if cMock.MockGetApp != nil { + cMock.registerCall("GetApp", ctx, in, opts) + return cMock.MockGetApp(ctx, in, opts...) + } + panic("method 'GetApp' not implemented, yet") +} + +func (cMock *ConsoleClient) GetManagedSvc(ctx context.Context, in *console.MSvcIn, opts ...grpc.CallOption) (*console.MSvcOut, error) { + if cMock.MockGetManagedSvc != nil { + cMock.registerCall("GetManagedSvc", ctx, in, opts) + return cMock.MockGetManagedSvc(ctx, in, opts...) + } + panic("method 'GetManagedSvc' not implemented, yet") +} + +func (cMock *ConsoleClient) GetProjectName(ctx context.Context, in *console.ProjectIn, opts ...grpc.CallOption) (*console.ProjectOut, error) { + if cMock.MockGetProjectName != nil { + cMock.registerCall("GetProjectName", ctx, in, opts) + return cMock.MockGetProjectName(ctx, in, opts...) + } + panic("method 'GetProjectName' not implemented, yet") +} + +func (cMock *ConsoleClient) SetupAccount(ctx context.Context, in *console.AccountSetupIn, opts ...grpc.CallOption) (*console.AccountSetupVoid, error) { + if cMock.MockSetupAccount != nil { + cMock.registerCall("SetupAccount", ctx, in, opts) + return cMock.MockSetupAccount(ctx, in, opts...) + } + panic("method 'SetupAccount' not implemented, yet") +} + +func NewConsoleClient() *ConsoleClient { + return &ConsoleClient{} +} diff --git a/grpc-interfaces/kloudlite.io/rpc/console/mocks/console-server.go b/grpc-interfaces/kloudlite.io/rpc/console/mocks/console-server.go new file mode 100644 index 000000000..f7396ba57 --- /dev/null +++ b/grpc-interfaces/kloudlite.io/rpc/console/mocks/console-server.go @@ -0,0 +1,61 @@ +package mocks + +import ( + context "context" + console "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/console" +) + +type ConsoleServerCallerInfo struct { + Args []any +} + +type ConsoleServer struct { + Calls map[string][]ConsoleServerCallerInfo + MockGetApp func(ka context.Context, kb *console.AppIn) (*console.AppOut, error) + MockGetManagedSvc func(kc context.Context, kd *console.MSvcIn) (*console.MSvcOut, error) + MockGetProjectName func(ke context.Context, kf *console.ProjectIn) (*console.ProjectOut, error) + MockSetupAccount func(kg context.Context, kh *console.AccountSetupIn) (*console.AccountSetupVoid, error) +} + +func (m *ConsoleServer) registerCall(funcName string, args ...any) { + if m.Calls == nil { + m.Calls = map[string][]ConsoleServerCallerInfo{} + } + m.Calls[funcName] = append(m.Calls[funcName], ConsoleServerCallerInfo{Args: args}) +} + +func (cMock *ConsoleServer) GetApp(ka context.Context, kb *console.AppIn) (*console.AppOut, error) { + if cMock.MockGetApp != nil { + cMock.registerCall("GetApp", ka, kb) + return cMock.MockGetApp(ka, kb) + } + panic("method 'GetApp' not implemented, yet") +} + +func (cMock *ConsoleServer) GetManagedSvc(kc context.Context, kd *console.MSvcIn) (*console.MSvcOut, error) { + if cMock.MockGetManagedSvc != nil { + cMock.registerCall("GetManagedSvc", kc, kd) + return cMock.MockGetManagedSvc(kc, kd) + } + panic("method 'GetManagedSvc' not implemented, yet") +} + +func (cMock *ConsoleServer) GetProjectName(ke context.Context, kf *console.ProjectIn) (*console.ProjectOut, error) { + if cMock.MockGetProjectName != nil { + cMock.registerCall("GetProjectName", ke, kf) + return cMock.MockGetProjectName(ke, kf) + } + panic("method 'GetProjectName' not implemented, yet") +} + +func (cMock *ConsoleServer) SetupAccount(kg context.Context, kh *console.AccountSetupIn) (*console.AccountSetupVoid, error) { + if cMock.MockSetupAccount != nil { + cMock.registerCall("SetupAccount", kg, kh) + return cMock.MockSetupAccount(kg, kh) + } + panic("method 'SetupAccount' not implemented, yet") +} + +func NewConsoleServer() *ConsoleServer { + return &ConsoleServer{} +} diff --git a/grpc-interfaces/kloudlite.io/rpc/console/mocks/mock_ConsoleClient.go b/grpc-interfaces/kloudlite.io/rpc/console/mocks/mock_ConsoleClient.go new file mode 100644 index 000000000..127e86335 --- /dev/null +++ b/grpc-interfaces/kloudlite.io/rpc/console/mocks/mock_ConsoleClient.go @@ -0,0 +1,320 @@ +// Code generated by mockery v2.32.4. DO NOT EDIT. + +package mocks + +import ( + context "context" + + console "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/console" + + grpc "google.golang.org/grpc" + + mock "github.com/stretchr/testify/mock" +) + +// console_client is an autogenerated mock type for the ConsoleClient type +type console_client struct { + mock.Mock +} + +type console_client_Expecter struct { + mock *mock.Mock +} + +func (_m *console_client) EXPECT() *console_client_Expecter { + return &console_client_Expecter{mock: &_m.Mock} +} + +// GetApp provides a mock function with given fields: ctx, in, opts +func (_m *console_client) GetApp(ctx context.Context, in *console.AppIn, opts ...grpc.CallOption) (*console.AppOut, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *console.AppOut + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *console.AppIn, ...grpc.CallOption) (*console.AppOut, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *console.AppIn, ...grpc.CallOption) *console.AppOut); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*console.AppOut) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *console.AppIn, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// console_client_GetApp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetApp' +type console_client_GetApp_Call struct { + *mock.Call +} + +// GetApp is a helper method to define mock.On call +// - ctx context.Context +// - in *console.AppIn +// - opts ...grpc.CallOption +func (_e *console_client_Expecter) GetApp(ctx interface{}, in interface{}, opts ...interface{}) *console_client_GetApp_Call { + return &console_client_GetApp_Call{Call: _e.mock.On("GetApp", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *console_client_GetApp_Call) Run(run func(ctx context.Context, in *console.AppIn, opts ...grpc.CallOption)) *console_client_GetApp_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*console.AppIn), variadicArgs...) + }) + return _c +} + +func (_c *console_client_GetApp_Call) Return(_a0 *console.AppOut, _a1 error) *console_client_GetApp_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *console_client_GetApp_Call) RunAndReturn(run func(context.Context, *console.AppIn, ...grpc.CallOption) (*console.AppOut, error)) *console_client_GetApp_Call { + _c.Call.Return(run) + return _c +} + +// GetManagedSvc provides a mock function with given fields: ctx, in, opts +func (_m *console_client) GetManagedSvc(ctx context.Context, in *console.MSvcIn, opts ...grpc.CallOption) (*console.MSvcOut, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *console.MSvcOut + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *console.MSvcIn, ...grpc.CallOption) (*console.MSvcOut, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *console.MSvcIn, ...grpc.CallOption) *console.MSvcOut); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*console.MSvcOut) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *console.MSvcIn, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// console_client_GetManagedSvc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetManagedSvc' +type console_client_GetManagedSvc_Call struct { + *mock.Call +} + +// GetManagedSvc is a helper method to define mock.On call +// - ctx context.Context +// - in *console.MSvcIn +// - opts ...grpc.CallOption +func (_e *console_client_Expecter) GetManagedSvc(ctx interface{}, in interface{}, opts ...interface{}) *console_client_GetManagedSvc_Call { + return &console_client_GetManagedSvc_Call{Call: _e.mock.On("GetManagedSvc", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *console_client_GetManagedSvc_Call) Run(run func(ctx context.Context, in *console.MSvcIn, opts ...grpc.CallOption)) *console_client_GetManagedSvc_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*console.MSvcIn), variadicArgs...) + }) + return _c +} + +func (_c *console_client_GetManagedSvc_Call) Return(_a0 *console.MSvcOut, _a1 error) *console_client_GetManagedSvc_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *console_client_GetManagedSvc_Call) RunAndReturn(run func(context.Context, *console.MSvcIn, ...grpc.CallOption) (*console.MSvcOut, error)) *console_client_GetManagedSvc_Call { + _c.Call.Return(run) + return _c +} + +// GetProjectName provides a mock function with given fields: ctx, in, opts +func (_m *console_client) GetProjectName(ctx context.Context, in *console.ProjectIn, opts ...grpc.CallOption) (*console.ProjectOut, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *console.ProjectOut + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *console.ProjectIn, ...grpc.CallOption) (*console.ProjectOut, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *console.ProjectIn, ...grpc.CallOption) *console.ProjectOut); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*console.ProjectOut) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *console.ProjectIn, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// console_client_GetProjectName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProjectName' +type console_client_GetProjectName_Call struct { + *mock.Call +} + +// GetProjectName is a helper method to define mock.On call +// - ctx context.Context +// - in *console.ProjectIn +// - opts ...grpc.CallOption +func (_e *console_client_Expecter) GetProjectName(ctx interface{}, in interface{}, opts ...interface{}) *console_client_GetProjectName_Call { + return &console_client_GetProjectName_Call{Call: _e.mock.On("GetProjectName", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *console_client_GetProjectName_Call) Run(run func(ctx context.Context, in *console.ProjectIn, opts ...grpc.CallOption)) *console_client_GetProjectName_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*console.ProjectIn), variadicArgs...) + }) + return _c +} + +func (_c *console_client_GetProjectName_Call) Return(_a0 *console.ProjectOut, _a1 error) *console_client_GetProjectName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *console_client_GetProjectName_Call) RunAndReturn(run func(context.Context, *console.ProjectIn, ...grpc.CallOption) (*console.ProjectOut, error)) *console_client_GetProjectName_Call { + _c.Call.Return(run) + return _c +} + +// SetupAccount provides a mock function with given fields: ctx, in, opts +func (_m *console_client) SetupAccount(ctx context.Context, in *console.AccountSetupIn, opts ...grpc.CallOption) (*console.AccountSetupVoid, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *console.AccountSetupVoid + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *console.AccountSetupIn, ...grpc.CallOption) (*console.AccountSetupVoid, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *console.AccountSetupIn, ...grpc.CallOption) *console.AccountSetupVoid); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*console.AccountSetupVoid) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *console.AccountSetupIn, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// console_client_SetupAccount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetupAccount' +type console_client_SetupAccount_Call struct { + *mock.Call +} + +// SetupAccount is a helper method to define mock.On call +// - ctx context.Context +// - in *console.AccountSetupIn +// - opts ...grpc.CallOption +func (_e *console_client_Expecter) SetupAccount(ctx interface{}, in interface{}, opts ...interface{}) *console_client_SetupAccount_Call { + return &console_client_SetupAccount_Call{Call: _e.mock.On("SetupAccount", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *console_client_SetupAccount_Call) Run(run func(ctx context.Context, in *console.AccountSetupIn, opts ...grpc.CallOption)) *console_client_SetupAccount_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*console.AccountSetupIn), variadicArgs...) + }) + return _c +} + +func (_c *console_client_SetupAccount_Call) Return(_a0 *console.AccountSetupVoid, _a1 error) *console_client_SetupAccount_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *console_client_SetupAccount_Call) RunAndReturn(run func(context.Context, *console.AccountSetupIn, ...grpc.CallOption) (*console.AccountSetupVoid, error)) *console_client_SetupAccount_Call { + _c.Call.Return(run) + return _c +} + +// newConsole_client creates a new instance of console_client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newConsole_client(t interface { + mock.TestingT + Cleanup(func()) +}) *console_client { + mock := &console_client{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/grpc-interfaces/kloudlite.io/rpc/console/mocks/mock_ConsoleServer.go b/grpc-interfaces/kloudlite.io/rpc/console/mocks/mock_ConsoleServer.go new file mode 100644 index 000000000..e70a25d36 --- /dev/null +++ b/grpc-interfaces/kloudlite.io/rpc/console/mocks/mock_ConsoleServer.go @@ -0,0 +1,290 @@ +// Code generated by mockery v2.32.4. DO NOT EDIT. + +package mocks + +import ( + context "context" + + console "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/console" + + mock "github.com/stretchr/testify/mock" +) + +// console_server is an autogenerated mock type for the ConsoleServer type +type console_server struct { + mock.Mock +} + +type console_server_Expecter struct { + mock *mock.Mock +} + +func (_m *console_server) EXPECT() *console_server_Expecter { + return &console_server_Expecter{mock: &_m.Mock} +} + +// GetApp provides a mock function with given fields: _a0, _a1 +func (_m *console_server) GetApp(_a0 context.Context, _a1 *console.AppIn) (*console.AppOut, error) { + ret := _m.Called(_a0, _a1) + + var r0 *console.AppOut + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *console.AppIn) (*console.AppOut, error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *console.AppIn) *console.AppOut); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*console.AppOut) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *console.AppIn) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// console_server_GetApp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetApp' +type console_server_GetApp_Call struct { + *mock.Call +} + +// GetApp is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *console.AppIn +func (_e *console_server_Expecter) GetApp(_a0 interface{}, _a1 interface{}) *console_server_GetApp_Call { + return &console_server_GetApp_Call{Call: _e.mock.On("GetApp", _a0, _a1)} +} + +func (_c *console_server_GetApp_Call) Run(run func(_a0 context.Context, _a1 *console.AppIn)) *console_server_GetApp_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*console.AppIn)) + }) + return _c +} + +func (_c *console_server_GetApp_Call) Return(_a0 *console.AppOut, _a1 error) *console_server_GetApp_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *console_server_GetApp_Call) RunAndReturn(run func(context.Context, *console.AppIn) (*console.AppOut, error)) *console_server_GetApp_Call { + _c.Call.Return(run) + return _c +} + +// GetManagedSvc provides a mock function with given fields: _a0, _a1 +func (_m *console_server) GetManagedSvc(_a0 context.Context, _a1 *console.MSvcIn) (*console.MSvcOut, error) { + ret := _m.Called(_a0, _a1) + + var r0 *console.MSvcOut + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *console.MSvcIn) (*console.MSvcOut, error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *console.MSvcIn) *console.MSvcOut); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*console.MSvcOut) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *console.MSvcIn) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// console_server_GetManagedSvc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetManagedSvc' +type console_server_GetManagedSvc_Call struct { + *mock.Call +} + +// GetManagedSvc is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *console.MSvcIn +func (_e *console_server_Expecter) GetManagedSvc(_a0 interface{}, _a1 interface{}) *console_server_GetManagedSvc_Call { + return &console_server_GetManagedSvc_Call{Call: _e.mock.On("GetManagedSvc", _a0, _a1)} +} + +func (_c *console_server_GetManagedSvc_Call) Run(run func(_a0 context.Context, _a1 *console.MSvcIn)) *console_server_GetManagedSvc_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*console.MSvcIn)) + }) + return _c +} + +func (_c *console_server_GetManagedSvc_Call) Return(_a0 *console.MSvcOut, _a1 error) *console_server_GetManagedSvc_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *console_server_GetManagedSvc_Call) RunAndReturn(run func(context.Context, *console.MSvcIn) (*console.MSvcOut, error)) *console_server_GetManagedSvc_Call { + _c.Call.Return(run) + return _c +} + +// GetProjectName provides a mock function with given fields: _a0, _a1 +func (_m *console_server) GetProjectName(_a0 context.Context, _a1 *console.ProjectIn) (*console.ProjectOut, error) { + ret := _m.Called(_a0, _a1) + + var r0 *console.ProjectOut + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *console.ProjectIn) (*console.ProjectOut, error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *console.ProjectIn) *console.ProjectOut); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*console.ProjectOut) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *console.ProjectIn) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// console_server_GetProjectName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProjectName' +type console_server_GetProjectName_Call struct { + *mock.Call +} + +// GetProjectName is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *console.ProjectIn +func (_e *console_server_Expecter) GetProjectName(_a0 interface{}, _a1 interface{}) *console_server_GetProjectName_Call { + return &console_server_GetProjectName_Call{Call: _e.mock.On("GetProjectName", _a0, _a1)} +} + +func (_c *console_server_GetProjectName_Call) Run(run func(_a0 context.Context, _a1 *console.ProjectIn)) *console_server_GetProjectName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*console.ProjectIn)) + }) + return _c +} + +func (_c *console_server_GetProjectName_Call) Return(_a0 *console.ProjectOut, _a1 error) *console_server_GetProjectName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *console_server_GetProjectName_Call) RunAndReturn(run func(context.Context, *console.ProjectIn) (*console.ProjectOut, error)) *console_server_GetProjectName_Call { + _c.Call.Return(run) + return _c +} + +// SetupAccount provides a mock function with given fields: _a0, _a1 +func (_m *console_server) SetupAccount(_a0 context.Context, _a1 *console.AccountSetupIn) (*console.AccountSetupVoid, error) { + ret := _m.Called(_a0, _a1) + + var r0 *console.AccountSetupVoid + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *console.AccountSetupIn) (*console.AccountSetupVoid, error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *console.AccountSetupIn) *console.AccountSetupVoid); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*console.AccountSetupVoid) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *console.AccountSetupIn) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// console_server_SetupAccount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetupAccount' +type console_server_SetupAccount_Call struct { + *mock.Call +} + +// SetupAccount is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *console.AccountSetupIn +func (_e *console_server_Expecter) SetupAccount(_a0 interface{}, _a1 interface{}) *console_server_SetupAccount_Call { + return &console_server_SetupAccount_Call{Call: _e.mock.On("SetupAccount", _a0, _a1)} +} + +func (_c *console_server_SetupAccount_Call) Run(run func(_a0 context.Context, _a1 *console.AccountSetupIn)) *console_server_SetupAccount_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*console.AccountSetupIn)) + }) + return _c +} + +func (_c *console_server_SetupAccount_Call) Return(_a0 *console.AccountSetupVoid, _a1 error) *console_server_SetupAccount_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *console_server_SetupAccount_Call) RunAndReturn(run func(context.Context, *console.AccountSetupIn) (*console.AccountSetupVoid, error)) *console_server_SetupAccount_Call { + _c.Call.Return(run) + return _c +} + +// mustEmbedUnimplementedConsoleServer provides a mock function with given fields: +func (_m *console_server) mustEmbedUnimplementedConsoleServer() { + _m.Called() +} + +// console_server_mustEmbedUnimplementedConsoleServer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'mustEmbedUnimplementedConsoleServer' +type console_server_mustEmbedUnimplementedConsoleServer_Call struct { + *mock.Call +} + +// mustEmbedUnimplementedConsoleServer is a helper method to define mock.On call +func (_e *console_server_Expecter) mustEmbedUnimplementedConsoleServer() *console_server_mustEmbedUnimplementedConsoleServer_Call { + return &console_server_mustEmbedUnimplementedConsoleServer_Call{Call: _e.mock.On("mustEmbedUnimplementedConsoleServer")} +} + +func (_c *console_server_mustEmbedUnimplementedConsoleServer_Call) Run(run func()) *console_server_mustEmbedUnimplementedConsoleServer_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *console_server_mustEmbedUnimplementedConsoleServer_Call) Return() *console_server_mustEmbedUnimplementedConsoleServer_Call { + _c.Call.Return() + return _c +} + +func (_c *console_server_mustEmbedUnimplementedConsoleServer_Call) RunAndReturn(run func()) *console_server_mustEmbedUnimplementedConsoleServer_Call { + _c.Call.Return(run) + return _c +} + +// newConsole_server creates a new instance of console_server. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newConsole_server(t interface { + mock.TestingT + Cleanup(func()) +}) *console_server { + mock := &console_server{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/grpc-interfaces/kloudlite.io/rpc/container_registry/container-registry.pb.go b/grpc-interfaces/kloudlite.io/rpc/container_registry/container-registry.pb.go index 05ce92859..30582ea80 100644 --- a/grpc-interfaces/kloudlite.io/rpc/container_registry/container-registry.pb.go +++ b/grpc-interfaces/kloudlite.io/rpc/container_registry/container-registry.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v3.21.12 +// protoc-gen-go v1.31.0 +// protoc v4.24.4 // source: container-registry.proto package container_registry diff --git a/grpc-interfaces/kloudlite.io/rpc/container_registry/container-registry_grpc.pb.go b/grpc-interfaces/kloudlite.io/rpc/container_registry/container-registry_grpc.pb.go index 0a3a1b0b4..d43d00396 100644 --- a/grpc-interfaces/kloudlite.io/rpc/container_registry/container-registry_grpc.pb.go +++ b/grpc-interfaces/kloudlite.io/rpc/container_registry/container-registry_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.12 +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.24.4 // source: container-registry.proto package container_registry @@ -18,6 +18,11 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + ContainerRegistry_CreateProjectForAccount_FullMethodName = "/ContainerRegistry/CreateProjectForAccount" + ContainerRegistry_GetSvcCredentials_FullMethodName = "/ContainerRegistry/GetSvcCredentials" +) + // ContainerRegistryClient is the client API for ContainerRegistry service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -36,7 +41,7 @@ func NewContainerRegistryClient(cc grpc.ClientConnInterface) ContainerRegistryCl func (c *containerRegistryClient) CreateProjectForAccount(ctx context.Context, in *CreateProjectIn, opts ...grpc.CallOption) (*CreateProjectOut, error) { out := new(CreateProjectOut) - err := c.cc.Invoke(ctx, "/ContainerRegistry/CreateProjectForAccount", in, out, opts...) + err := c.cc.Invoke(ctx, ContainerRegistry_CreateProjectForAccount_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -45,7 +50,7 @@ func (c *containerRegistryClient) CreateProjectForAccount(ctx context.Context, i func (c *containerRegistryClient) GetSvcCredentials(ctx context.Context, in *GetSvcCredentialsIn, opts ...grpc.CallOption) (*GetSvcCredentialsOut, error) { out := new(GetSvcCredentialsOut) - err := c.cc.Invoke(ctx, "/ContainerRegistry/GetSvcCredentials", in, out, opts...) + err := c.cc.Invoke(ctx, ContainerRegistry_GetSvcCredentials_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -94,7 +99,7 @@ func _ContainerRegistry_CreateProjectForAccount_Handler(srv interface{}, ctx con } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ContainerRegistry/CreateProjectForAccount", + FullMethod: ContainerRegistry_CreateProjectForAccount_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ContainerRegistryServer).CreateProjectForAccount(ctx, req.(*CreateProjectIn)) @@ -112,7 +117,7 @@ func _ContainerRegistry_GetSvcCredentials_Handler(srv interface{}, ctx context.C } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ContainerRegistry/GetSvcCredentials", + FullMethod: ContainerRegistry_GetSvcCredentials_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ContainerRegistryServer).GetSvcCredentials(ctx, req.(*GetSvcCredentialsIn)) diff --git a/grpc-interfaces/kloudlite.io/rpc/container_registry/mocks/container_registry-client.go b/grpc-interfaces/kloudlite.io/rpc/container_registry/mocks/container_registry-client.go new file mode 100644 index 000000000..4938fd921 --- /dev/null +++ b/grpc-interfaces/kloudlite.io/rpc/container_registry/mocks/container_registry-client.go @@ -0,0 +1,44 @@ +package mocks + +import ( + context "context" + container_registry "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/container_registry" + grpc "google.golang.org/grpc" +) + +type ContainerRegistryClientCallerInfo struct { + Args []any +} + +type ContainerRegistryClient struct { + Calls map[string][]ContainerRegistryClientCallerInfo + MockCreateProjectForAccount func(ctx context.Context, in *container_registry.CreateProjectIn, opts ...grpc.CallOption) (*container_registry.CreateProjectOut, error) + MockGetSvcCredentials func(ctx context.Context, in *container_registry.GetSvcCredentialsIn, opts ...grpc.CallOption) (*container_registry.GetSvcCredentialsOut, error) +} + +func (m *ContainerRegistryClient) registerCall(funcName string, args ...any) { + if m.Calls == nil { + m.Calls = map[string][]ContainerRegistryClientCallerInfo{} + } + m.Calls[funcName] = append(m.Calls[funcName], ContainerRegistryClientCallerInfo{Args: args}) +} + +func (cMock *ContainerRegistryClient) CreateProjectForAccount(ctx context.Context, in *container_registry.CreateProjectIn, opts ...grpc.CallOption) (*container_registry.CreateProjectOut, error) { + if cMock.MockCreateProjectForAccount != nil { + cMock.registerCall("CreateProjectForAccount", ctx, in, opts) + return cMock.MockCreateProjectForAccount(ctx, in, opts...) + } + panic("method 'CreateProjectForAccount' not implemented, yet") +} + +func (cMock *ContainerRegistryClient) GetSvcCredentials(ctx context.Context, in *container_registry.GetSvcCredentialsIn, opts ...grpc.CallOption) (*container_registry.GetSvcCredentialsOut, error) { + if cMock.MockGetSvcCredentials != nil { + cMock.registerCall("GetSvcCredentials", ctx, in, opts) + return cMock.MockGetSvcCredentials(ctx, in, opts...) + } + panic("method 'GetSvcCredentials' not implemented, yet") +} + +func NewContainerRegistryClient() *ContainerRegistryClient { + return &ContainerRegistryClient{} +} diff --git a/grpc-interfaces/kloudlite.io/rpc/container_registry/mocks/container_registry-server.go b/grpc-interfaces/kloudlite.io/rpc/container_registry/mocks/container_registry-server.go new file mode 100644 index 000000000..9124fd1c3 --- /dev/null +++ b/grpc-interfaces/kloudlite.io/rpc/container_registry/mocks/container_registry-server.go @@ -0,0 +1,43 @@ +package mocks + +import ( + context "context" + container_registry "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/container_registry" +) + +type ContainerRegistryServerCallerInfo struct { + Args []any +} + +type ContainerRegistryServer struct { + Calls map[string][]ContainerRegistryServerCallerInfo + MockCreateProjectForAccount func(ka context.Context, kb *container_registry.CreateProjectIn) (*container_registry.CreateProjectOut, error) + MockGetSvcCredentials func(kc context.Context, kd *container_registry.GetSvcCredentialsIn) (*container_registry.GetSvcCredentialsOut, error) +} + +func (m *ContainerRegistryServer) registerCall(funcName string, args ...any) { + if m.Calls == nil { + m.Calls = map[string][]ContainerRegistryServerCallerInfo{} + } + m.Calls[funcName] = append(m.Calls[funcName], ContainerRegistryServerCallerInfo{Args: args}) +} + +func (cMock *ContainerRegistryServer) CreateProjectForAccount(ka context.Context, kb *container_registry.CreateProjectIn) (*container_registry.CreateProjectOut, error) { + if cMock.MockCreateProjectForAccount != nil { + cMock.registerCall("CreateProjectForAccount", ka, kb) + return cMock.MockCreateProjectForAccount(ka, kb) + } + panic("method 'CreateProjectForAccount' not implemented, yet") +} + +func (cMock *ContainerRegistryServer) GetSvcCredentials(kc context.Context, kd *container_registry.GetSvcCredentialsIn) (*container_registry.GetSvcCredentialsOut, error) { + if cMock.MockGetSvcCredentials != nil { + cMock.registerCall("GetSvcCredentials", kc, kd) + return cMock.MockGetSvcCredentials(kc, kd) + } + panic("method 'GetSvcCredentials' not implemented, yet") +} + +func NewContainerRegistryServer() *ContainerRegistryServer { + return &ContainerRegistryServer{} +} diff --git a/grpc-interfaces/kloudlite.io/rpc/dns/dns.pb.go b/grpc-interfaces/kloudlite.io/rpc/dns/dns.pb.go index 8248fe00a..5f6a66af9 100644 --- a/grpc-interfaces/kloudlite.io/rpc/dns/dns.pb.go +++ b/grpc-interfaces/kloudlite.io/rpc/dns/dns.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v3.21.12 +// protoc-gen-go v1.31.0 +// protoc v4.24.4 // source: dns.proto package dns diff --git a/grpc-interfaces/kloudlite.io/rpc/dns/dns_grpc.pb.go b/grpc-interfaces/kloudlite.io/rpc/dns/dns_grpc.pb.go index 236e6e14b..079d66d82 100644 --- a/grpc-interfaces/kloudlite.io/rpc/dns/dns_grpc.pb.go +++ b/grpc-interfaces/kloudlite.io/rpc/dns/dns_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.12 +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.24.4 // source: dns.proto package dns @@ -18,6 +18,10 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + DNS_GetAccountDomains_FullMethodName = "/DNS/GetAccountDomains" +) + // DNSClient is the client API for DNS service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -35,7 +39,7 @@ func NewDNSClient(cc grpc.ClientConnInterface) DNSClient { func (c *dNSClient) GetAccountDomains(ctx context.Context, in *GetAccountDomainsIn, opts ...grpc.CallOption) (*GetAccountDomainsOut, error) { out := new(GetAccountDomainsOut) - err := c.cc.Invoke(ctx, "/DNS/GetAccountDomains", in, out, opts...) + err := c.cc.Invoke(ctx, DNS_GetAccountDomains_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -80,7 +84,7 @@ func _DNS_GetAccountDomains_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/DNS/GetAccountDomains", + FullMethod: DNS_GetAccountDomains_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DNSServer).GetAccountDomains(ctx, req.(*GetAccountDomainsIn)) diff --git a/grpc-interfaces/kloudlite.io/rpc/finance/finance-infra.pb.go b/grpc-interfaces/kloudlite.io/rpc/finance/finance-infra.pb.go index 7e17258e8..5683406ee 100644 --- a/grpc-interfaces/kloudlite.io/rpc/finance/finance-infra.pb.go +++ b/grpc-interfaces/kloudlite.io/rpc/finance/finance-infra.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v3.21.12 +// protoc-gen-go v1.31.0 +// protoc v4.24.4 // source: finance-infra.proto package finance diff --git a/grpc-interfaces/kloudlite.io/rpc/finance/finance-infra_grpc.pb.go b/grpc-interfaces/kloudlite.io/rpc/finance/finance-infra_grpc.pb.go index 08e9a8844..417b15177 100644 --- a/grpc-interfaces/kloudlite.io/rpc/finance/finance-infra_grpc.pb.go +++ b/grpc-interfaces/kloudlite.io/rpc/finance/finance-infra_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.12 +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.24.4 // source: finance-infra.proto package finance @@ -18,6 +18,19 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + FinanceInfra_ComputeStart_FullMethodName = "/FinanceInfra/ComputeStart" + FinanceInfra_ComputeEnd_FullMethodName = "/FinanceInfra/ComputeEnd" + FinanceInfra_LambdaStart_FullMethodName = "/FinanceInfra/LambdaStart" + FinanceInfra_LambdaEnd_FullMethodName = "/FinanceInfra/LambdaEnd" + FinanceInfra_BlockStorageStart_FullMethodName = "/FinanceInfra/BlockStorageStart" + FinanceInfra_BlockStorageEnd_FullMethodName = "/FinanceInfra/BlockStorageEnd" + FinanceInfra_ObjectStorageStart_FullMethodName = "/FinanceInfra/ObjectStorageStart" + FinanceInfra_ObjectStorageEnd_FullMethodName = "/FinanceInfra/ObjectStorageEnd" + FinanceInfra_CIStart_FullMethodName = "/FinanceInfra/CIStart" + FinanceInfra_CIEnd_FullMethodName = "/FinanceInfra/CIEnd" +) + // FinanceInfraClient is the client API for FinanceInfra service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -44,7 +57,7 @@ func NewFinanceInfraClient(cc grpc.ClientConnInterface) FinanceInfraClient { func (c *financeInfraClient) ComputeStart(ctx context.Context, in *ComputeStartIn, opts ...grpc.CallOption) (*FinanceInfraVoid, error) { out := new(FinanceInfraVoid) - err := c.cc.Invoke(ctx, "/FinanceInfra/ComputeStart", in, out, opts...) + err := c.cc.Invoke(ctx, FinanceInfra_ComputeStart_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -53,7 +66,7 @@ func (c *financeInfraClient) ComputeStart(ctx context.Context, in *ComputeStartI func (c *financeInfraClient) ComputeEnd(ctx context.Context, in *ComputeEndIn, opts ...grpc.CallOption) (*FinanceInfraVoid, error) { out := new(FinanceInfraVoid) - err := c.cc.Invoke(ctx, "/FinanceInfra/ComputeEnd", in, out, opts...) + err := c.cc.Invoke(ctx, FinanceInfra_ComputeEnd_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -62,7 +75,7 @@ func (c *financeInfraClient) ComputeEnd(ctx context.Context, in *ComputeEndIn, o func (c *financeInfraClient) LambdaStart(ctx context.Context, in *LambdaStartIn, opts ...grpc.CallOption) (*FinanceInfraVoid, error) { out := new(FinanceInfraVoid) - err := c.cc.Invoke(ctx, "/FinanceInfra/LambdaStart", in, out, opts...) + err := c.cc.Invoke(ctx, FinanceInfra_LambdaStart_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -71,7 +84,7 @@ func (c *financeInfraClient) LambdaStart(ctx context.Context, in *LambdaStartIn, func (c *financeInfraClient) LambdaEnd(ctx context.Context, in *LambdaEndIn, opts ...grpc.CallOption) (*FinanceInfraVoid, error) { out := new(FinanceInfraVoid) - err := c.cc.Invoke(ctx, "/FinanceInfra/LambdaEnd", in, out, opts...) + err := c.cc.Invoke(ctx, FinanceInfra_LambdaEnd_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -80,7 +93,7 @@ func (c *financeInfraClient) LambdaEnd(ctx context.Context, in *LambdaEndIn, opt func (c *financeInfraClient) BlockStorageStart(ctx context.Context, in *BlockStorageStartIn, opts ...grpc.CallOption) (*FinanceInfraVoid, error) { out := new(FinanceInfraVoid) - err := c.cc.Invoke(ctx, "/FinanceInfra/BlockStorageStart", in, out, opts...) + err := c.cc.Invoke(ctx, FinanceInfra_BlockStorageStart_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -89,7 +102,7 @@ func (c *financeInfraClient) BlockStorageStart(ctx context.Context, in *BlockSto func (c *financeInfraClient) BlockStorageEnd(ctx context.Context, in *BlockStorageEndIn, opts ...grpc.CallOption) (*FinanceInfraVoid, error) { out := new(FinanceInfraVoid) - err := c.cc.Invoke(ctx, "/FinanceInfra/BlockStorageEnd", in, out, opts...) + err := c.cc.Invoke(ctx, FinanceInfra_BlockStorageEnd_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -98,7 +111,7 @@ func (c *financeInfraClient) BlockStorageEnd(ctx context.Context, in *BlockStora func (c *financeInfraClient) ObjectStorageStart(ctx context.Context, in *ObjectStorageStartIn, opts ...grpc.CallOption) (*FinanceInfraVoid, error) { out := new(FinanceInfraVoid) - err := c.cc.Invoke(ctx, "/FinanceInfra/ObjectStorageStart", in, out, opts...) + err := c.cc.Invoke(ctx, FinanceInfra_ObjectStorageStart_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -107,7 +120,7 @@ func (c *financeInfraClient) ObjectStorageStart(ctx context.Context, in *ObjectS func (c *financeInfraClient) ObjectStorageEnd(ctx context.Context, in *ObjectStorageEndIn, opts ...grpc.CallOption) (*FinanceInfraVoid, error) { out := new(FinanceInfraVoid) - err := c.cc.Invoke(ctx, "/FinanceInfra/ObjectStorageEnd", in, out, opts...) + err := c.cc.Invoke(ctx, FinanceInfra_ObjectStorageEnd_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -116,7 +129,7 @@ func (c *financeInfraClient) ObjectStorageEnd(ctx context.Context, in *ObjectSto func (c *financeInfraClient) CIStart(ctx context.Context, in *CIStartIn, opts ...grpc.CallOption) (*FinanceInfraVoid, error) { out := new(FinanceInfraVoid) - err := c.cc.Invoke(ctx, "/FinanceInfra/CIStart", in, out, opts...) + err := c.cc.Invoke(ctx, FinanceInfra_CIStart_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -125,7 +138,7 @@ func (c *financeInfraClient) CIStart(ctx context.Context, in *CIStartIn, opts .. func (c *financeInfraClient) CIEnd(ctx context.Context, in *CIEndIn, opts ...grpc.CallOption) (*FinanceInfraVoid, error) { out := new(FinanceInfraVoid) - err := c.cc.Invoke(ctx, "/FinanceInfra/CIEnd", in, out, opts...) + err := c.cc.Invoke(ctx, FinanceInfra_CIEnd_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -206,7 +219,7 @@ func _FinanceInfra_ComputeStart_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/FinanceInfra/ComputeStart", + FullMethod: FinanceInfra_ComputeStart_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FinanceInfraServer).ComputeStart(ctx, req.(*ComputeStartIn)) @@ -224,7 +237,7 @@ func _FinanceInfra_ComputeEnd_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/FinanceInfra/ComputeEnd", + FullMethod: FinanceInfra_ComputeEnd_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FinanceInfraServer).ComputeEnd(ctx, req.(*ComputeEndIn)) @@ -242,7 +255,7 @@ func _FinanceInfra_LambdaStart_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/FinanceInfra/LambdaStart", + FullMethod: FinanceInfra_LambdaStart_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FinanceInfraServer).LambdaStart(ctx, req.(*LambdaStartIn)) @@ -260,7 +273,7 @@ func _FinanceInfra_LambdaEnd_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/FinanceInfra/LambdaEnd", + FullMethod: FinanceInfra_LambdaEnd_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FinanceInfraServer).LambdaEnd(ctx, req.(*LambdaEndIn)) @@ -278,7 +291,7 @@ func _FinanceInfra_BlockStorageStart_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/FinanceInfra/BlockStorageStart", + FullMethod: FinanceInfra_BlockStorageStart_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FinanceInfraServer).BlockStorageStart(ctx, req.(*BlockStorageStartIn)) @@ -296,7 +309,7 @@ func _FinanceInfra_BlockStorageEnd_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/FinanceInfra/BlockStorageEnd", + FullMethod: FinanceInfra_BlockStorageEnd_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FinanceInfraServer).BlockStorageEnd(ctx, req.(*BlockStorageEndIn)) @@ -314,7 +327,7 @@ func _FinanceInfra_ObjectStorageStart_Handler(srv interface{}, ctx context.Conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/FinanceInfra/ObjectStorageStart", + FullMethod: FinanceInfra_ObjectStorageStart_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FinanceInfraServer).ObjectStorageStart(ctx, req.(*ObjectStorageStartIn)) @@ -332,7 +345,7 @@ func _FinanceInfra_ObjectStorageEnd_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/FinanceInfra/ObjectStorageEnd", + FullMethod: FinanceInfra_ObjectStorageEnd_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FinanceInfraServer).ObjectStorageEnd(ctx, req.(*ObjectStorageEndIn)) @@ -350,7 +363,7 @@ func _FinanceInfra_CIStart_Handler(srv interface{}, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/FinanceInfra/CIStart", + FullMethod: FinanceInfra_CIStart_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FinanceInfraServer).CIStart(ctx, req.(*CIStartIn)) @@ -368,7 +381,7 @@ func _FinanceInfra_CIEnd_Handler(srv interface{}, ctx context.Context, dec func( } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/FinanceInfra/CIEnd", + FullMethod: FinanceInfra_CIEnd_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FinanceInfraServer).CIEnd(ctx, req.(*CIEndIn)) diff --git a/grpc-interfaces/kloudlite.io/rpc/finance/finance.pb.go b/grpc-interfaces/kloudlite.io/rpc/finance/finance.pb.go index c03c8c34c..092912d55 100644 --- a/grpc-interfaces/kloudlite.io/rpc/finance/finance.pb.go +++ b/grpc-interfaces/kloudlite.io/rpc/finance/finance.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v3.21.12 +// protoc-gen-go v1.31.0 +// protoc v4.24.4 // source: finance.proto package finance diff --git a/grpc-interfaces/kloudlite.io/rpc/finance/finance_grpc.pb.go b/grpc-interfaces/kloudlite.io/rpc/finance/finance_grpc.pb.go index fc39ec6de..61e0d9dd7 100644 --- a/grpc-interfaces/kloudlite.io/rpc/finance/finance_grpc.pb.go +++ b/grpc-interfaces/kloudlite.io/rpc/finance/finance_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.12 +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.24.4 // source: finance.proto package finance @@ -18,6 +18,12 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + Finance_StartBillable_FullMethodName = "/Finance/startBillable" + Finance_StopBillable_FullMethodName = "/Finance/stopBillable" + Finance_GetAttachedCluster_FullMethodName = "/Finance/getAttachedCluster" +) + // FinanceClient is the client API for Finance service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -37,7 +43,7 @@ func NewFinanceClient(cc grpc.ClientConnInterface) FinanceClient { func (c *financeClient) StartBillable(ctx context.Context, in *StartBillableIn, opts ...grpc.CallOption) (*StartBillableOut, error) { out := new(StartBillableOut) - err := c.cc.Invoke(ctx, "/Finance/startBillable", in, out, opts...) + err := c.cc.Invoke(ctx, Finance_StartBillable_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -46,7 +52,7 @@ func (c *financeClient) StartBillable(ctx context.Context, in *StartBillableIn, func (c *financeClient) StopBillable(ctx context.Context, in *StopBillableIn, opts ...grpc.CallOption) (*StopBillableOut, error) { out := new(StopBillableOut) - err := c.cc.Invoke(ctx, "/Finance/stopBillable", in, out, opts...) + err := c.cc.Invoke(ctx, Finance_StopBillable_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -55,7 +61,7 @@ func (c *financeClient) StopBillable(ctx context.Context, in *StopBillableIn, op func (c *financeClient) GetAttachedCluster(ctx context.Context, in *GetAttachedClusterIn, opts ...grpc.CallOption) (*GetAttachedClusterOut, error) { out := new(GetAttachedClusterOut) - err := c.cc.Invoke(ctx, "/Finance/getAttachedCluster", in, out, opts...) + err := c.cc.Invoke(ctx, Finance_GetAttachedCluster_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -108,7 +114,7 @@ func _Finance_StartBillable_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Finance/startBillable", + FullMethod: Finance_StartBillable_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FinanceServer).StartBillable(ctx, req.(*StartBillableIn)) @@ -126,7 +132,7 @@ func _Finance_StopBillable_Handler(srv interface{}, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Finance/stopBillable", + FullMethod: Finance_StopBillable_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FinanceServer).StopBillable(ctx, req.(*StopBillableIn)) @@ -144,7 +150,7 @@ func _Finance_GetAttachedCluster_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Finance/getAttachedCluster", + FullMethod: Finance_GetAttachedCluster_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FinanceServer).GetAttachedCluster(ctx, req.(*GetAttachedClusterIn)) diff --git a/grpc-interfaces/kloudlite.io/rpc/iam/iam.pb.go b/grpc-interfaces/kloudlite.io/rpc/iam/iam.pb.go index aba761393..63f51fe3b 100644 --- a/grpc-interfaces/kloudlite.io/rpc/iam/iam.pb.go +++ b/grpc-interfaces/kloudlite.io/rpc/iam/iam.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v3.21.12 +// protoc-gen-go v1.31.0 +// protoc v4.24.4 // source: iam.proto package iam @@ -20,18 +20,19 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type ConfirmMembershipIn struct { +type RoleBinding struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - ResourceRef string `protobuf:"bytes,2,opt,name=resource_ref,json=resourceRef,proto3" json:"resource_ref,omitempty"` - Role string `protobuf:"bytes,3,opt,name=role,proto3" json:"role,omitempty"` + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + ResourceRef string `protobuf:"bytes,2,opt,name=ResourceRef,proto3" json:"ResourceRef,omitempty"` + ResourceType string `protobuf:"bytes,3,opt,name=resourceType,proto3" json:"resourceType,omitempty"` + Role string `protobuf:"bytes,4,opt,name=role,proto3" json:"role,omitempty"` } -func (x *ConfirmMembershipIn) Reset() { - *x = ConfirmMembershipIn{} +func (x *RoleBinding) Reset() { + *x = RoleBinding{} if protoimpl.UnsafeEnabled { mi := &file_iam_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -39,13 +40,13 @@ func (x *ConfirmMembershipIn) Reset() { } } -func (x *ConfirmMembershipIn) String() string { +func (x *RoleBinding) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ConfirmMembershipIn) ProtoMessage() {} +func (*RoleBinding) ProtoMessage() {} -func (x *ConfirmMembershipIn) ProtoReflect() protoreflect.Message { +func (x *RoleBinding) ProtoReflect() protoreflect.Message { mi := &file_iam_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -57,40 +58,51 @@ func (x *ConfirmMembershipIn) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ConfirmMembershipIn.ProtoReflect.Descriptor instead. -func (*ConfirmMembershipIn) Descriptor() ([]byte, []int) { +// Deprecated: Use RoleBinding.ProtoReflect.Descriptor instead. +func (*RoleBinding) Descriptor() ([]byte, []int) { return file_iam_proto_rawDescGZIP(), []int{0} } -func (x *ConfirmMembershipIn) GetUserId() string { +func (x *RoleBinding) GetUserId() string { if x != nil { return x.UserId } return "" } -func (x *ConfirmMembershipIn) GetResourceRef() string { +func (x *RoleBinding) GetResourceRef() string { if x != nil { return x.ResourceRef } return "" } -func (x *ConfirmMembershipIn) GetRole() string { +func (x *RoleBinding) GetResourceType() string { + if x != nil { + return x.ResourceType + } + return "" +} + +func (x *RoleBinding) GetRole() string { if x != nil { return x.Role } return "" } -type ConfirmMembershipOut struct { +type GetMembershipIn struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + ResourceType string `protobuf:"bytes,2,opt,name=resourceType,proto3" json:"resourceType,omitempty"` + ResourceRef string `protobuf:"bytes,3,opt,name=ResourceRef,proto3" json:"ResourceRef,omitempty"` } -func (x *ConfirmMembershipOut) Reset() { - *x = ConfirmMembershipOut{} +func (x *GetMembershipIn) Reset() { + *x = GetMembershipIn{} if protoimpl.UnsafeEnabled { mi := &file_iam_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -98,13 +110,13 @@ func (x *ConfirmMembershipOut) Reset() { } } -func (x *ConfirmMembershipOut) String() string { +func (x *GetMembershipIn) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ConfirmMembershipOut) ProtoMessage() {} +func (*GetMembershipIn) ProtoMessage() {} -func (x *ConfirmMembershipOut) ProtoReflect() protoreflect.Message { +func (x *GetMembershipIn) ProtoReflect() protoreflect.Message { mi := &file_iam_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -116,25 +128,46 @@ func (x *ConfirmMembershipOut) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ConfirmMembershipOut.ProtoReflect.Descriptor instead. -func (*ConfirmMembershipOut) Descriptor() ([]byte, []int) { +// Deprecated: Use GetMembershipIn.ProtoReflect.Descriptor instead. +func (*GetMembershipIn) Descriptor() ([]byte, []int) { return file_iam_proto_rawDescGZIP(), []int{1} } -type RoleBinding struct { +func (x *GetMembershipIn) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *GetMembershipIn) GetResourceType() string { + if x != nil { + return x.ResourceType + } + return "" +} + +func (x *GetMembershipIn) GetResourceRef() string { + if x != nil { + return x.ResourceRef + } + return "" +} + +type AddMembershipIn struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` - ResourceRef string `protobuf:"bytes,2,opt,name=ResourceRef,proto3" json:"ResourceRef,omitempty"` - ResourceType string `protobuf:"bytes,3,opt,name=resourceType,proto3" json:"resourceType,omitempty"` + ResourceType string `protobuf:"bytes,2,opt,name=resourceType,proto3" json:"resourceType,omitempty"` + ResourceRef string `protobuf:"bytes,3,opt,name=resourceRef,proto3" json:"resourceRef,omitempty"` Role string `protobuf:"bytes,4,opt,name=role,proto3" json:"role,omitempty"` - Accepted bool `protobuf:"varint,5,opt,name=accepted,proto3" json:"accepted,omitempty"` + Filter string `protobuf:"bytes,5,opt,name=filter,proto3" json:"filter,omitempty"` } -func (x *RoleBinding) Reset() { - *x = RoleBinding{} +func (x *AddMembershipIn) Reset() { + *x = AddMembershipIn{} if protoimpl.UnsafeEnabled { mi := &file_iam_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -142,13 +175,13 @@ func (x *RoleBinding) Reset() { } } -func (x *RoleBinding) String() string { +func (x *AddMembershipIn) String() string { return protoimpl.X.MessageStringOf(x) } -func (*RoleBinding) ProtoMessage() {} +func (*AddMembershipIn) ProtoMessage() {} -func (x *RoleBinding) ProtoReflect() protoreflect.Message { +func (x *AddMembershipIn) ProtoReflect() protoreflect.Message { mi := &file_iam_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -160,59 +193,59 @@ func (x *RoleBinding) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use RoleBinding.ProtoReflect.Descriptor instead. -func (*RoleBinding) Descriptor() ([]byte, []int) { +// Deprecated: Use AddMembershipIn.ProtoReflect.Descriptor instead. +func (*AddMembershipIn) Descriptor() ([]byte, []int) { return file_iam_proto_rawDescGZIP(), []int{2} } -func (x *RoleBinding) GetUserId() string { +func (x *AddMembershipIn) GetUserId() string { if x != nil { return x.UserId } return "" } -func (x *RoleBinding) GetResourceRef() string { +func (x *AddMembershipIn) GetResourceType() string { if x != nil { - return x.ResourceRef + return x.ResourceType } return "" } -func (x *RoleBinding) GetResourceType() string { +func (x *AddMembershipIn) GetResourceRef() string { if x != nil { - return x.ResourceType + return x.ResourceRef } return "" } -func (x *RoleBinding) GetRole() string { +func (x *AddMembershipIn) GetRole() string { if x != nil { return x.Role } return "" } -func (x *RoleBinding) GetAccepted() bool { +func (x *AddMembershipIn) GetFilter() string { if x != nil { - return x.Accepted + return x.Filter } - return false + return "" } -type GetMembershipIn struct { +type UpdateMembershipIn struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` ResourceType string `protobuf:"bytes,2,opt,name=resourceType,proto3" json:"resourceType,omitempty"` - ResourceRef string `protobuf:"bytes,3,opt,name=ResourceRef,proto3" json:"ResourceRef,omitempty"` - Accepted bool `protobuf:"varint,5,opt,name=accepted,proto3" json:"accepted,omitempty"` + ResourceRef string `protobuf:"bytes,3,opt,name=resourceRef,proto3" json:"resourceRef,omitempty"` + Role string `protobuf:"bytes,4,opt,name=role,proto3" json:"role,omitempty"` } -func (x *GetMembershipIn) Reset() { - *x = GetMembershipIn{} +func (x *UpdateMembershipIn) Reset() { + *x = UpdateMembershipIn{} if protoimpl.UnsafeEnabled { mi := &file_iam_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -220,13 +253,13 @@ func (x *GetMembershipIn) Reset() { } } -func (x *GetMembershipIn) String() string { +func (x *UpdateMembershipIn) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetMembershipIn) ProtoMessage() {} +func (*UpdateMembershipIn) ProtoMessage() {} -func (x *GetMembershipIn) ProtoReflect() protoreflect.Message { +func (x *UpdateMembershipIn) ProtoReflect() protoreflect.Message { mi := &file_iam_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -238,53 +271,49 @@ func (x *GetMembershipIn) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetMembershipIn.ProtoReflect.Descriptor instead. -func (*GetMembershipIn) Descriptor() ([]byte, []int) { +// Deprecated: Use UpdateMembershipIn.ProtoReflect.Descriptor instead. +func (*UpdateMembershipIn) Descriptor() ([]byte, []int) { return file_iam_proto_rawDescGZIP(), []int{3} } -func (x *GetMembershipIn) GetUserId() string { +func (x *UpdateMembershipIn) GetUserId() string { if x != nil { return x.UserId } return "" } -func (x *GetMembershipIn) GetResourceType() string { +func (x *UpdateMembershipIn) GetResourceType() string { if x != nil { return x.ResourceType } return "" } -func (x *GetMembershipIn) GetResourceRef() string { +func (x *UpdateMembershipIn) GetResourceRef() string { if x != nil { return x.ResourceRef } return "" } -func (x *GetMembershipIn) GetAccepted() bool { +func (x *UpdateMembershipIn) GetRole() string { if x != nil { - return x.Accepted + return x.Role } - return false + return "" } -type AddMembershipIn struct { +type UpdateMembershipOut struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` - ResourceType string `protobuf:"bytes,2,opt,name=resourceType,proto3" json:"resourceType,omitempty"` - ResourceRef string `protobuf:"bytes,3,opt,name=resourceRef,proto3" json:"resourceRef,omitempty"` - Role string `protobuf:"bytes,4,opt,name=role,proto3" json:"role,omitempty"` - Filter string `protobuf:"bytes,5,opt,name=filter,proto3" json:"filter,omitempty"` + Result bool `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"` } -func (x *AddMembershipIn) Reset() { - *x = AddMembershipIn{} +func (x *UpdateMembershipOut) Reset() { + *x = UpdateMembershipOut{} if protoimpl.UnsafeEnabled { mi := &file_iam_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -292,13 +321,13 @@ func (x *AddMembershipIn) Reset() { } } -func (x *AddMembershipIn) String() string { +func (x *UpdateMembershipOut) String() string { return protoimpl.X.MessageStringOf(x) } -func (*AddMembershipIn) ProtoMessage() {} +func (*UpdateMembershipOut) ProtoMessage() {} -func (x *AddMembershipIn) ProtoReflect() protoreflect.Message { +func (x *UpdateMembershipOut) ProtoReflect() protoreflect.Message { mi := &file_iam_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -310,44 +339,16 @@ func (x *AddMembershipIn) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use AddMembershipIn.ProtoReflect.Descriptor instead. -func (*AddMembershipIn) Descriptor() ([]byte, []int) { +// Deprecated: Use UpdateMembershipOut.ProtoReflect.Descriptor instead. +func (*UpdateMembershipOut) Descriptor() ([]byte, []int) { return file_iam_proto_rawDescGZIP(), []int{4} } -func (x *AddMembershipIn) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -func (x *AddMembershipIn) GetResourceType() string { - if x != nil { - return x.ResourceType - } - return "" -} - -func (x *AddMembershipIn) GetResourceRef() string { - if x != nil { - return x.ResourceRef - } - return "" -} - -func (x *AddMembershipIn) GetRole() string { - if x != nil { - return x.Role - } - return "" -} - -func (x *AddMembershipIn) GetFilter() string { +func (x *UpdateMembershipOut) GetResult() bool { if x != nil { - return x.Filter + return x.Result } - return "" + return false } type GetMembershipOut struct { @@ -358,7 +359,6 @@ type GetMembershipOut struct { UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` ResourceRef string `protobuf:"bytes,2,opt,name=ResourceRef,proto3" json:"ResourceRef,omitempty"` Role string `protobuf:"bytes,3,opt,name=role,proto3" json:"role,omitempty"` - Accepted bool `protobuf:"varint,5,opt,name=accepted,proto3" json:"accepted,omitempty"` } func (x *GetMembershipOut) Reset() { @@ -414,13 +414,6 @@ func (x *GetMembershipOut) GetRole() string { return "" } -func (x *GetMembershipOut) GetAccepted() bool { - if x != nil { - return x.Accepted - } - return false -} - type AddMembershipOut struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -711,17 +704,17 @@ func (x *ListMembershipsOut) GetRoleBindings() []*RoleBinding { return nil } -type UserMembershipsIn struct { +type MembershipsForResourceIn struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` - ResourceType string `protobuf:"bytes,2,opt,name=resourceType,proto3" json:"resourceType,omitempty"` + ResourceType string `protobuf:"bytes,1,opt,name=resourceType,proto3" json:"resourceType,omitempty"` + ResourceRef string `protobuf:"bytes,2,opt,name=resourceRef,proto3" json:"resourceRef,omitempty"` } -func (x *UserMembershipsIn) Reset() { - *x = UserMembershipsIn{} +func (x *MembershipsForResourceIn) Reset() { + *x = MembershipsForResourceIn{} if protoimpl.UnsafeEnabled { mi := &file_iam_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -729,13 +722,13 @@ func (x *UserMembershipsIn) Reset() { } } -func (x *UserMembershipsIn) String() string { +func (x *MembershipsForResourceIn) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UserMembershipsIn) ProtoMessage() {} +func (*MembershipsForResourceIn) ProtoMessage() {} -func (x *UserMembershipsIn) ProtoReflect() protoreflect.Message { +func (x *MembershipsForResourceIn) ProtoReflect() protoreflect.Message { mi := &file_iam_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -747,143 +740,25 @@ func (x *UserMembershipsIn) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UserMembershipsIn.ProtoReflect.Descriptor instead. -func (*UserMembershipsIn) Descriptor() ([]byte, []int) { +// Deprecated: Use MembershipsForResourceIn.ProtoReflect.Descriptor instead. +func (*MembershipsForResourceIn) Descriptor() ([]byte, []int) { return file_iam_proto_rawDescGZIP(), []int{12} } -func (x *UserMembershipsIn) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -func (x *UserMembershipsIn) GetResourceType() string { - if x != nil { - return x.ResourceType - } - return "" -} - -type ResourceMembershipsIn struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ResourceType string `protobuf:"bytes,1,opt,name=resourceType,proto3" json:"resourceType,omitempty"` - ResourceRef string `protobuf:"bytes,2,opt,name=ResourceRef,proto3" json:"ResourceRef,omitempty"` -} - -func (x *ResourceMembershipsIn) Reset() { - *x = ResourceMembershipsIn{} - if protoimpl.UnsafeEnabled { - mi := &file_iam_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResourceMembershipsIn) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResourceMembershipsIn) ProtoMessage() {} - -func (x *ResourceMembershipsIn) ProtoReflect() protoreflect.Message { - mi := &file_iam_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ResourceMembershipsIn.ProtoReflect.Descriptor instead. -func (*ResourceMembershipsIn) Descriptor() ([]byte, []int) { - return file_iam_proto_rawDescGZIP(), []int{13} -} - -func (x *ResourceMembershipsIn) GetResourceType() string { - if x != nil { - return x.ResourceType - } - return "" -} - -func (x *ResourceMembershipsIn) GetResourceRef() string { - if x != nil { - return x.ResourceRef - } - return "" -} - -type MembershipsByResourceIn struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ResourceType string `protobuf:"bytes,1,opt,name=resourceType,proto3" json:"resourceType,omitempty"` - ResourceRef string `protobuf:"bytes,2,opt,name=resourceRef,proto3" json:"resourceRef,omitempty"` - Accepted *bool `protobuf:"varint,3,opt,name=accepted,proto3,oneof" json:"accepted,omitempty"` -} - -func (x *MembershipsByResourceIn) Reset() { - *x = MembershipsByResourceIn{} - if protoimpl.UnsafeEnabled { - mi := &file_iam_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MembershipsByResourceIn) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MembershipsByResourceIn) ProtoMessage() {} - -func (x *MembershipsByResourceIn) ProtoReflect() protoreflect.Message { - mi := &file_iam_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MembershipsByResourceIn.ProtoReflect.Descriptor instead. -func (*MembershipsByResourceIn) Descriptor() ([]byte, []int) { - return file_iam_proto_rawDescGZIP(), []int{14} -} - -func (x *MembershipsByResourceIn) GetResourceType() string { +func (x *MembershipsForResourceIn) GetResourceType() string { if x != nil { return x.ResourceType } return "" } -func (x *MembershipsByResourceIn) GetResourceRef() string { +func (x *MembershipsForResourceIn) GetResourceRef() string { if x != nil { return x.ResourceRef } return "" } -func (x *MembershipsByResourceIn) GetAccepted() bool { - if x != nil && x.Accepted != nil { - return *x.Accepted - } - return false -} - type MembershipsForUserIn struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -896,7 +771,7 @@ type MembershipsForUserIn struct { func (x *MembershipsForUserIn) Reset() { *x = MembershipsForUserIn{} if protoimpl.UnsafeEnabled { - mi := &file_iam_proto_msgTypes[15] + mi := &file_iam_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -909,7 +784,7 @@ func (x *MembershipsForUserIn) String() string { func (*MembershipsForUserIn) ProtoMessage() {} func (x *MembershipsForUserIn) ProtoReflect() protoreflect.Message { - mi := &file_iam_proto_msgTypes[15] + mi := &file_iam_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -922,7 +797,7 @@ func (x *MembershipsForUserIn) ProtoReflect() protoreflect.Message { // Deprecated: Use MembershipsForUserIn.ProtoReflect.Descriptor instead. func (*MembershipsForUserIn) Descriptor() ([]byte, []int) { - return file_iam_proto_rawDescGZIP(), []int{15} + return file_iam_proto_rawDescGZIP(), []int{13} } func (x *MembershipsForUserIn) GetUserId() string { @@ -951,7 +826,7 @@ type ResourceMembershipsOut struct { func (x *ResourceMembershipsOut) Reset() { *x = ResourceMembershipsOut{} if protoimpl.UnsafeEnabled { - mi := &file_iam_proto_msgTypes[16] + mi := &file_iam_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -964,7 +839,7 @@ func (x *ResourceMembershipsOut) String() string { func (*ResourceMembershipsOut) ProtoMessage() {} func (x *ResourceMembershipsOut) ProtoReflect() protoreflect.Message { - mi := &file_iam_proto_msgTypes[16] + mi := &file_iam_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -977,7 +852,7 @@ func (x *ResourceMembershipsOut) ProtoReflect() protoreflect.Message { // Deprecated: Use ResourceMembershipsOut.ProtoReflect.Descriptor instead. func (*ResourceMembershipsOut) Descriptor() ([]byte, []int) { - return file_iam_proto_rawDescGZIP(), []int{16} + return file_iam_proto_rawDescGZIP(), []int{14} } func (x *ResourceMembershipsOut) GetResourceType() string { @@ -1005,7 +880,7 @@ type Message struct { func (x *Message) Reset() { *x = Message{} if protoimpl.UnsafeEnabled { - mi := &file_iam_proto_msgTypes[17] + mi := &file_iam_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1018,7 +893,7 @@ func (x *Message) String() string { func (*Message) ProtoMessage() {} func (x *Message) ProtoReflect() protoreflect.Message { - mi := &file_iam_proto_msgTypes[17] + mi := &file_iam_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1031,7 +906,7 @@ func (x *Message) ProtoReflect() protoreflect.Message { // Deprecated: Use Message.ProtoReflect.Descriptor instead. func (*Message) Descriptor() ([]byte, []int) { - return file_iam_proto_rawDescGZIP(), []int{17} + return file_iam_proto_rawDescGZIP(), []int{15} } func (x *Message) GetMessage() string { @@ -1054,7 +929,7 @@ type CanIn struct { func (x *CanIn) Reset() { *x = CanIn{} if protoimpl.UnsafeEnabled { - mi := &file_iam_proto_msgTypes[18] + mi := &file_iam_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1067,7 +942,7 @@ func (x *CanIn) String() string { func (*CanIn) ProtoMessage() {} func (x *CanIn) ProtoReflect() protoreflect.Message { - mi := &file_iam_proto_msgTypes[18] + mi := &file_iam_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1080,7 +955,7 @@ func (x *CanIn) ProtoReflect() protoreflect.Message { // Deprecated: Use CanIn.ProtoReflect.Descriptor instead. func (*CanIn) Descriptor() ([]byte, []int) { - return file_iam_proto_rawDescGZIP(), []int{18} + return file_iam_proto_rawDescGZIP(), []int{16} } func (x *CanIn) GetUserId() string { @@ -1115,7 +990,7 @@ type CanOut struct { func (x *CanOut) Reset() { *x = CanOut{} if protoimpl.UnsafeEnabled { - mi := &file_iam_proto_msgTypes[19] + mi := &file_iam_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1128,7 +1003,7 @@ func (x *CanOut) String() string { func (*CanOut) ProtoMessage() {} func (x *CanOut) ProtoReflect() protoreflect.Message { - mi := &file_iam_proto_msgTypes[19] + mi := &file_iam_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1141,7 +1016,7 @@ func (x *CanOut) ProtoReflect() protoreflect.Message { // Deprecated: Use CanOut.ProtoReflect.Descriptor instead. func (*CanOut) Descriptor() ([]byte, []int) { - return file_iam_proto_rawDescGZIP(), []int{19} + return file_iam_proto_rawDescGZIP(), []int{17} } func (x *CanOut) GetStatus() bool { @@ -1154,15 +1029,7 @@ func (x *CanOut) GetStatus() bool { var File_iam_proto protoreflect.FileDescriptor var file_iam_proto_rawDesc = []byte{ - 0x0a, 0x09, 0x69, 0x61, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x65, 0x0a, 0x13, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, - 0x49, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x12, 0x12, - 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, - 0x6c, 0x65, 0x22, 0x16, 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x4d, 0x65, 0x6d, - 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x4f, 0x75, 0x74, 0x22, 0x9b, 0x01, 0x0a, 0x0b, 0x52, + 0x0a, 0x09, 0x69, 0x61, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7f, 0x0a, 0x0b, 0x52, 0x6f, 0x6c, 0x65, 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, @@ -1170,144 +1037,124 @@ var file_iam_proto_rawDesc = []byte{ 0x65, 0x52, 0x65, 0x66, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, - 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, - 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x22, 0x8b, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, - 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x49, 0x6e, 0x12, 0x16, 0x0a, 0x06, - 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, - 0x65, 0x72, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x63, - 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x61, 0x63, - 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x22, 0x9b, 0x01, 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x4d, 0x65, - 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x49, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, - 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, - 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, - 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x52, 0x65, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, - 0x6c, 0x74, 0x65, 0x72, 0x22, 0x7c, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, - 0x72, 0x73, 0x68, 0x69, 0x70, 0x4f, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, - 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, - 0x12, 0x20, 0x0a, 0x0b, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, - 0x65, 0x66, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, - 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, - 0x65, 0x64, 0x22, 0x2a, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, - 0x68, 0x69, 0x70, 0x4f, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x4e, - 0x0a, 0x12, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, - 0x69, 0x70, 0x49, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x22, 0x2d, - 0x0a, 0x13, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, - 0x69, 0x70, 0x4f, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x34, 0x0a, - 0x10, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, - 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x52, 0x65, 0x66, 0x22, 0x2b, 0x0a, 0x11, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x6f, 0x0a, 0x0f, + 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x49, 0x6e, 0x12, + 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x22, 0x9b, 0x01, + 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x49, + 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, + 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x12, + 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, + 0x6f, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x86, 0x01, 0x0a, 0x12, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, + 0x49, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, + 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, + 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x2d, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, + 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x4f, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x22, 0x60, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x73, 0x68, 0x69, 0x70, 0x4f, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, + 0x20, 0x0a, 0x0b, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, + 0x66, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x2a, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x4d, 0x65, 0x6d, 0x62, + 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x4f, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x22, 0x4e, 0x0a, 0x12, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x73, 0x68, 0x69, 0x70, 0x49, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, + 0x20, 0x0a, 0x0b, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, + 0x66, 0x22, 0x2d, 0x0a, 0x13, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x73, 0x68, 0x69, 0x70, 0x4f, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x22, 0x46, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, - 0x69, 0x70, 0x73, 0x4f, 0x75, 0x74, 0x12, 0x30, 0x0a, 0x0c, 0x72, 0x6f, 0x6c, 0x65, 0x42, 0x69, - 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x52, - 0x6f, 0x6c, 0x65, 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x0c, 0x72, 0x6f, 0x6c, 0x65, - 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x4f, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, - 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x73, 0x49, 0x6e, 0x12, 0x16, 0x0a, - 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, - 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x5d, 0x0a, 0x15, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x73, - 0x49, 0x6e, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, - 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x52, 0x65, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x22, 0x8d, 0x01, 0x0a, 0x17, 0x4d, 0x65, 0x6d, - 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x73, 0x42, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x49, 0x6e, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x12, 0x1f, 0x0a, 0x08, 0x61, 0x63, - 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x08, - 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, - 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x22, 0x52, 0x0a, 0x14, 0x4d, 0x65, 0x6d, 0x62, + 0x22, 0x34, 0x0a, 0x10, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x49, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x52, 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x22, 0x2b, 0x0a, 0x11, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x22, 0x46, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x73, 0x68, 0x69, 0x70, 0x73, 0x4f, 0x75, 0x74, 0x12, 0x30, 0x0a, 0x0c, 0x72, 0x6f, 0x6c, + 0x65, 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x0c, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x0c, 0x72, + 0x6f, 0x6c, 0x65, 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x60, 0x0a, 0x18, 0x4d, + 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x73, 0x46, 0x6f, 0x72, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x22, 0x52, 0x0a, + 0x14, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x73, 0x46, 0x6f, 0x72, 0x55, + 0x73, 0x65, 0x72, 0x49, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x22, 0x0a, + 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x22, 0x5e, 0x0a, 0x16, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x73, 0x4f, 0x75, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x20, 0x0a, 0x0b, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, + 0x66, 0x22, 0x23, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x5b, 0x0a, 0x05, 0x43, 0x61, 0x6e, 0x49, 0x6e, 0x12, + 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x22, 0x20, 0x0a, 0x06, 0x43, 0x61, 0x6e, 0x4f, 0x75, 0x74, 0x12, 0x16, 0x0a, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, 0xf0, 0x03, 0x0a, 0x03, 0x49, 0x41, 0x4d, 0x12, 0x1a, 0x0a, + 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x08, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, + 0x08, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x03, 0x43, 0x61, 0x6e, + 0x12, 0x06, 0x2e, 0x43, 0x61, 0x6e, 0x49, 0x6e, 0x1a, 0x07, 0x2e, 0x43, 0x61, 0x6e, 0x4f, 0x75, + 0x74, 0x12, 0x4c, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, + 0x68, 0x69, 0x70, 0x73, 0x46, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, + 0x19, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x73, 0x46, 0x6f, 0x72, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x1a, 0x13, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x73, 0x4f, 0x75, 0x74, 0x12, + 0x44, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, + 0x70, 0x73, 0x46, 0x6f, 0x72, 0x55, 0x73, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x73, 0x46, 0x6f, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, - 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x5e, 0x0a, 0x16, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, - 0x69, 0x70, 0x73, 0x4f, 0x75, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x22, 0x23, 0x0a, 0x07, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x22, 0x5b, 0x0a, 0x05, 0x43, 0x61, 0x6e, 0x49, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, - 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, - 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, - 0x66, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x52, 0x65, 0x66, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x20, - 0x0a, 0x06, 0x43, 0x61, 0x6e, 0x4f, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x32, 0xb2, 0x05, 0x0a, 0x03, 0x49, 0x41, 0x4d, 0x12, 0x1a, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, - 0x12, 0x08, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x08, 0x2e, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x03, 0x43, 0x61, 0x6e, 0x12, 0x06, 0x2e, 0x43, 0x61, - 0x6e, 0x49, 0x6e, 0x1a, 0x07, 0x2e, 0x43, 0x61, 0x6e, 0x4f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x13, - 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, - 0x69, 0x70, 0x73, 0x12, 0x12, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, - 0x73, 0x68, 0x69, 0x70, 0x73, 0x49, 0x6e, 0x1a, 0x13, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, - 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x73, 0x4f, 0x75, 0x74, 0x12, 0x34, 0x0a, 0x0d, - 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x12, 0x10, 0x2e, - 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x49, 0x6e, 0x1a, - 0x11, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x4f, - 0x75, 0x74, 0x12, 0x46, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x73, 0x12, 0x16, 0x2e, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, - 0x69, 0x70, 0x73, 0x49, 0x6e, 0x1a, 0x13, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x62, - 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x73, 0x4f, 0x75, 0x74, 0x12, 0x4a, 0x0a, 0x19, 0x4c, 0x69, - 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x73, 0x42, 0x79, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x18, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, - 0x73, 0x68, 0x69, 0x70, 0x73, 0x42, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, - 0x6e, 0x1a, 0x13, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, - 0x69, 0x70, 0x73, 0x4f, 0x75, 0x74, 0x12, 0x44, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, - 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x73, 0x46, 0x6f, 0x72, 0x55, 0x73, 0x65, 0x72, - 0x12, 0x15, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x73, 0x46, 0x6f, - 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x1a, 0x13, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, - 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x73, 0x4f, 0x75, 0x74, 0x12, 0x34, 0x0a, 0x0d, - 0x41, 0x64, 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x12, 0x10, 0x2e, - 0x41, 0x64, 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x49, 0x6e, 0x1a, - 0x11, 0x2e, 0x41, 0x64, 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x4f, - 0x75, 0x74, 0x12, 0x37, 0x0a, 0x10, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x62, - 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x12, 0x10, 0x2e, 0x41, 0x64, 0x64, 0x4d, 0x65, 0x6d, 0x62, - 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x49, 0x6e, 0x1a, 0x11, 0x2e, 0x41, 0x64, 0x64, 0x4d, 0x65, - 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x4f, 0x75, 0x74, 0x12, 0x40, 0x0a, 0x11, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, - 0x12, 0x14, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, - 0x73, 0x68, 0x69, 0x70, 0x49, 0x6e, 0x1a, 0x15, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, - 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x4f, 0x75, 0x74, 0x12, 0x3d, 0x0a, - 0x10, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, - 0x70, 0x12, 0x13, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, - 0x73, 0x68, 0x69, 0x70, 0x49, 0x6e, 0x1a, 0x14, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4d, - 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x4f, 0x75, 0x74, 0x12, 0x37, 0x0a, 0x0e, - 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x11, - 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, - 0x6e, 0x1a, 0x12, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x4f, 0x75, 0x74, 0x42, 0x16, 0x5a, 0x14, 0x6b, 0x6c, 0x6f, 0x75, 0x64, 0x6c, 0x69, - 0x74, 0x65, 0x2e, 0x69, 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x69, 0x61, 0x6d, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x1a, 0x13, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, + 0x70, 0x73, 0x4f, 0x75, 0x74, 0x12, 0x34, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x62, + 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x12, 0x10, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x62, + 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x49, 0x6e, 0x1a, 0x11, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, + 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x4f, 0x75, 0x74, 0x12, 0x34, 0x0a, 0x0d, 0x41, + 0x64, 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x12, 0x10, 0x2e, 0x41, + 0x64, 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x49, 0x6e, 0x1a, 0x11, + 0x2e, 0x41, 0x64, 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x4f, 0x75, + 0x74, 0x12, 0x3d, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x73, 0x68, 0x69, 0x70, 0x12, 0x13, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, + 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x49, 0x6e, 0x1a, 0x14, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x4f, 0x75, 0x74, + 0x12, 0x3d, 0x0a, 0x10, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x73, 0x68, 0x69, 0x70, 0x12, 0x13, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x49, 0x6e, 0x1a, 0x14, 0x2e, 0x52, 0x65, 0x6d, 0x6f, + 0x76, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x4f, 0x75, 0x74, 0x12, + 0x37, 0x0a, 0x0e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x12, 0x11, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x49, 0x6e, 0x1a, 0x12, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x75, 0x74, 0x42, 0x16, 0x5a, 0x14, 0x6b, 0x6c, 0x6f, 0x75, + 0x64, 0x6c, 0x69, 0x74, 0x65, 0x2e, 0x69, 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x69, 0x61, 0x6d, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1322,57 +1169,49 @@ func file_iam_proto_rawDescGZIP() []byte { return file_iam_proto_rawDescData } -var file_iam_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_iam_proto_msgTypes = make([]protoimpl.MessageInfo, 18) var file_iam_proto_goTypes = []interface{}{ - (*ConfirmMembershipIn)(nil), // 0: ConfirmMembershipIn - (*ConfirmMembershipOut)(nil), // 1: ConfirmMembershipOut - (*RoleBinding)(nil), // 2: RoleBinding - (*GetMembershipIn)(nil), // 3: GetMembershipIn - (*AddMembershipIn)(nil), // 4: AddMembershipIn - (*GetMembershipOut)(nil), // 5: GetMembershipOut - (*AddMembershipOut)(nil), // 6: AddMembershipOut - (*RemoveMembershipIn)(nil), // 7: RemoveMembershipIn - (*RemoveMembershipOut)(nil), // 8: RemoveMembershipOut - (*RemoveResourceIn)(nil), // 9: RemoveResourceIn - (*RemoveResourceOut)(nil), // 10: RemoveResourceOut - (*ListMembershipsOut)(nil), // 11: ListMembershipsOut - (*UserMembershipsIn)(nil), // 12: UserMembershipsIn - (*ResourceMembershipsIn)(nil), // 13: ResourceMembershipsIn - (*MembershipsByResourceIn)(nil), // 14: MembershipsByResourceIn - (*MembershipsForUserIn)(nil), // 15: MembershipsForUserIn - (*ResourceMembershipsOut)(nil), // 16: ResourceMembershipsOut - (*Message)(nil), // 17: Message - (*CanIn)(nil), // 18: CanIn - (*CanOut)(nil), // 19: CanOut + (*RoleBinding)(nil), // 0: RoleBinding + (*GetMembershipIn)(nil), // 1: GetMembershipIn + (*AddMembershipIn)(nil), // 2: AddMembershipIn + (*UpdateMembershipIn)(nil), // 3: UpdateMembershipIn + (*UpdateMembershipOut)(nil), // 4: UpdateMembershipOut + (*GetMembershipOut)(nil), // 5: GetMembershipOut + (*AddMembershipOut)(nil), // 6: AddMembershipOut + (*RemoveMembershipIn)(nil), // 7: RemoveMembershipIn + (*RemoveMembershipOut)(nil), // 8: RemoveMembershipOut + (*RemoveResourceIn)(nil), // 9: RemoveResourceIn + (*RemoveResourceOut)(nil), // 10: RemoveResourceOut + (*ListMembershipsOut)(nil), // 11: ListMembershipsOut + (*MembershipsForResourceIn)(nil), // 12: MembershipsForResourceIn + (*MembershipsForUserIn)(nil), // 13: MembershipsForUserIn + (*ResourceMembershipsOut)(nil), // 14: ResourceMembershipsOut + (*Message)(nil), // 15: Message + (*CanIn)(nil), // 16: CanIn + (*CanOut)(nil), // 17: CanOut } var file_iam_proto_depIdxs = []int32{ - 2, // 0: ListMembershipsOut.roleBindings:type_name -> RoleBinding - 17, // 1: IAM.Ping:input_type -> Message - 18, // 2: IAM.Can:input_type -> CanIn - 12, // 3: IAM.ListUserMemberships:input_type -> UserMembershipsIn - 3, // 4: IAM.GetMembership:input_type -> GetMembershipIn - 13, // 5: IAM.ListResourceMemberships:input_type -> ResourceMembershipsIn - 14, // 6: IAM.ListMembershipsByResource:input_type -> MembershipsByResourceIn - 15, // 7: IAM.ListMembershipsForUser:input_type -> MembershipsForUserIn - 4, // 8: IAM.AddMembership:input_type -> AddMembershipIn - 4, // 9: IAM.InviteMembership:input_type -> AddMembershipIn - 0, // 10: IAM.ConfirmMembership:input_type -> ConfirmMembershipIn - 7, // 11: IAM.RemoveMembership:input_type -> RemoveMembershipIn - 9, // 12: IAM.RemoveResource:input_type -> RemoveResourceIn - 17, // 13: IAM.Ping:output_type -> Message - 19, // 14: IAM.Can:output_type -> CanOut - 11, // 15: IAM.ListUserMemberships:output_type -> ListMembershipsOut - 5, // 16: IAM.GetMembership:output_type -> GetMembershipOut - 11, // 17: IAM.ListResourceMemberships:output_type -> ListMembershipsOut - 11, // 18: IAM.ListMembershipsByResource:output_type -> ListMembershipsOut - 11, // 19: IAM.ListMembershipsForUser:output_type -> ListMembershipsOut - 6, // 20: IAM.AddMembership:output_type -> AddMembershipOut - 6, // 21: IAM.InviteMembership:output_type -> AddMembershipOut - 1, // 22: IAM.ConfirmMembership:output_type -> ConfirmMembershipOut - 8, // 23: IAM.RemoveMembership:output_type -> RemoveMembershipOut - 10, // 24: IAM.RemoveResource:output_type -> RemoveResourceOut - 13, // [13:25] is the sub-list for method output_type - 1, // [1:13] is the sub-list for method input_type + 0, // 0: ListMembershipsOut.roleBindings:type_name -> RoleBinding + 15, // 1: IAM.Ping:input_type -> Message + 16, // 2: IAM.Can:input_type -> CanIn + 12, // 3: IAM.ListMembershipsForResource:input_type -> MembershipsForResourceIn + 13, // 4: IAM.ListMembershipsForUser:input_type -> MembershipsForUserIn + 1, // 5: IAM.GetMembership:input_type -> GetMembershipIn + 2, // 6: IAM.AddMembership:input_type -> AddMembershipIn + 3, // 7: IAM.UpdateMembership:input_type -> UpdateMembershipIn + 7, // 8: IAM.RemoveMembership:input_type -> RemoveMembershipIn + 9, // 9: IAM.RemoveResource:input_type -> RemoveResourceIn + 15, // 10: IAM.Ping:output_type -> Message + 17, // 11: IAM.Can:output_type -> CanOut + 11, // 12: IAM.ListMembershipsForResource:output_type -> ListMembershipsOut + 11, // 13: IAM.ListMembershipsForUser:output_type -> ListMembershipsOut + 5, // 14: IAM.GetMembership:output_type -> GetMembershipOut + 6, // 15: IAM.AddMembership:output_type -> AddMembershipOut + 4, // 16: IAM.UpdateMembership:output_type -> UpdateMembershipOut + 8, // 17: IAM.RemoveMembership:output_type -> RemoveMembershipOut + 10, // 18: IAM.RemoveResource:output_type -> RemoveResourceOut + 10, // [10:19] is the sub-list for method output_type + 1, // [1:10] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name 1, // [1:1] is the sub-list for extension extendee 0, // [0:1] is the sub-list for field type_name @@ -1385,7 +1224,7 @@ func file_iam_proto_init() { } if !protoimpl.UnsafeEnabled { file_iam_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConfirmMembershipIn); i { + switch v := v.(*RoleBinding); i { case 0: return &v.state case 1: @@ -1397,7 +1236,7 @@ func file_iam_proto_init() { } } file_iam_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConfirmMembershipOut); i { + switch v := v.(*GetMembershipIn); i { case 0: return &v.state case 1: @@ -1409,7 +1248,7 @@ func file_iam_proto_init() { } } file_iam_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RoleBinding); i { + switch v := v.(*AddMembershipIn); i { case 0: return &v.state case 1: @@ -1421,7 +1260,7 @@ func file_iam_proto_init() { } } file_iam_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetMembershipIn); i { + switch v := v.(*UpdateMembershipIn); i { case 0: return &v.state case 1: @@ -1433,7 +1272,7 @@ func file_iam_proto_init() { } } file_iam_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddMembershipIn); i { + switch v := v.(*UpdateMembershipOut); i { case 0: return &v.state case 1: @@ -1529,7 +1368,7 @@ func file_iam_proto_init() { } } file_iam_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserMembershipsIn); i { + switch v := v.(*MembershipsForResourceIn); i { case 0: return &v.state case 1: @@ -1541,30 +1380,6 @@ func file_iam_proto_init() { } } file_iam_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResourceMembershipsIn); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_iam_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MembershipsByResourceIn); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_iam_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MembershipsForUserIn); i { case 0: return &v.state @@ -1576,7 +1391,7 @@ func file_iam_proto_init() { return nil } } - file_iam_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_iam_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ResourceMembershipsOut); i { case 0: return &v.state @@ -1588,7 +1403,7 @@ func file_iam_proto_init() { return nil } } - file_iam_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_iam_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Message); i { case 0: return &v.state @@ -1600,7 +1415,7 @@ func file_iam_proto_init() { return nil } } - file_iam_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_iam_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CanIn); i { case 0: return &v.state @@ -1612,7 +1427,7 @@ func file_iam_proto_init() { return nil } } - file_iam_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_iam_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CanOut); i { case 0: return &v.state @@ -1625,14 +1440,13 @@ func file_iam_proto_init() { } } } - file_iam_proto_msgTypes[14].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_iam_proto_rawDesc, NumEnums: 0, - NumMessages: 20, + NumMessages: 18, NumExtensions: 0, NumServices: 1, }, diff --git a/grpc-interfaces/kloudlite.io/rpc/iam/iam_grpc.pb.go b/grpc-interfaces/kloudlite.io/rpc/iam/iam_grpc.pb.go index 8f5cab4bc..1810941e2 100644 --- a/grpc-interfaces/kloudlite.io/rpc/iam/iam_grpc.pb.go +++ b/grpc-interfaces/kloudlite.io/rpc/iam/iam_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.12 +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.24.4 // source: iam.proto package iam @@ -18,6 +18,18 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + IAM_Ping_FullMethodName = "/IAM/Ping" + IAM_Can_FullMethodName = "/IAM/Can" + IAM_ListMembershipsForResource_FullMethodName = "/IAM/ListMembershipsForResource" + IAM_ListMembershipsForUser_FullMethodName = "/IAM/ListMembershipsForUser" + IAM_GetMembership_FullMethodName = "/IAM/GetMembership" + IAM_AddMembership_FullMethodName = "/IAM/AddMembership" + IAM_UpdateMembership_FullMethodName = "/IAM/UpdateMembership" + IAM_RemoveMembership_FullMethodName = "/IAM/RemoveMembership" + IAM_RemoveResource_FullMethodName = "/IAM/RemoveResource" +) + // IAMClient is the client API for IAM service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -25,15 +37,12 @@ type IAMClient interface { // Query Ping(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) Can(ctx context.Context, in *CanIn, opts ...grpc.CallOption) (*CanOut, error) - ListUserMemberships(ctx context.Context, in *UserMembershipsIn, opts ...grpc.CallOption) (*ListMembershipsOut, error) - GetMembership(ctx context.Context, in *GetMembershipIn, opts ...grpc.CallOption) (*GetMembershipOut, error) - ListResourceMemberships(ctx context.Context, in *ResourceMembershipsIn, opts ...grpc.CallOption) (*ListMembershipsOut, error) - ListMembershipsByResource(ctx context.Context, in *MembershipsByResourceIn, opts ...grpc.CallOption) (*ListMembershipsOut, error) + ListMembershipsForResource(ctx context.Context, in *MembershipsForResourceIn, opts ...grpc.CallOption) (*ListMembershipsOut, error) ListMembershipsForUser(ctx context.Context, in *MembershipsForUserIn, opts ...grpc.CallOption) (*ListMembershipsOut, error) + GetMembership(ctx context.Context, in *GetMembershipIn, opts ...grpc.CallOption) (*GetMembershipOut, error) // Mutation AddMembership(ctx context.Context, in *AddMembershipIn, opts ...grpc.CallOption) (*AddMembershipOut, error) - InviteMembership(ctx context.Context, in *AddMembershipIn, opts ...grpc.CallOption) (*AddMembershipOut, error) - ConfirmMembership(ctx context.Context, in *ConfirmMembershipIn, opts ...grpc.CallOption) (*ConfirmMembershipOut, error) + UpdateMembership(ctx context.Context, in *UpdateMembershipIn, opts ...grpc.CallOption) (*UpdateMembershipOut, error) RemoveMembership(ctx context.Context, in *RemoveMembershipIn, opts ...grpc.CallOption) (*RemoveMembershipOut, error) RemoveResource(ctx context.Context, in *RemoveResourceIn, opts ...grpc.CallOption) (*RemoveResourceOut, error) } @@ -48,7 +57,7 @@ func NewIAMClient(cc grpc.ClientConnInterface) IAMClient { func (c *iAMClient) Ping(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) { out := new(Message) - err := c.cc.Invoke(ctx, "/IAM/Ping", in, out, opts...) + err := c.cc.Invoke(ctx, IAM_Ping_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -57,43 +66,16 @@ func (c *iAMClient) Ping(ctx context.Context, in *Message, opts ...grpc.CallOpti func (c *iAMClient) Can(ctx context.Context, in *CanIn, opts ...grpc.CallOption) (*CanOut, error) { out := new(CanOut) - err := c.cc.Invoke(ctx, "/IAM/Can", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *iAMClient) ListUserMemberships(ctx context.Context, in *UserMembershipsIn, opts ...grpc.CallOption) (*ListMembershipsOut, error) { - out := new(ListMembershipsOut) - err := c.cc.Invoke(ctx, "/IAM/ListUserMemberships", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *iAMClient) GetMembership(ctx context.Context, in *GetMembershipIn, opts ...grpc.CallOption) (*GetMembershipOut, error) { - out := new(GetMembershipOut) - err := c.cc.Invoke(ctx, "/IAM/GetMembership", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *iAMClient) ListResourceMemberships(ctx context.Context, in *ResourceMembershipsIn, opts ...grpc.CallOption) (*ListMembershipsOut, error) { - out := new(ListMembershipsOut) - err := c.cc.Invoke(ctx, "/IAM/ListResourceMemberships", in, out, opts...) + err := c.cc.Invoke(ctx, IAM_Can_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *iAMClient) ListMembershipsByResource(ctx context.Context, in *MembershipsByResourceIn, opts ...grpc.CallOption) (*ListMembershipsOut, error) { +func (c *iAMClient) ListMembershipsForResource(ctx context.Context, in *MembershipsForResourceIn, opts ...grpc.CallOption) (*ListMembershipsOut, error) { out := new(ListMembershipsOut) - err := c.cc.Invoke(ctx, "/IAM/ListMembershipsByResource", in, out, opts...) + err := c.cc.Invoke(ctx, IAM_ListMembershipsForResource_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -102,34 +84,34 @@ func (c *iAMClient) ListMembershipsByResource(ctx context.Context, in *Membershi func (c *iAMClient) ListMembershipsForUser(ctx context.Context, in *MembershipsForUserIn, opts ...grpc.CallOption) (*ListMembershipsOut, error) { out := new(ListMembershipsOut) - err := c.cc.Invoke(ctx, "/IAM/ListMembershipsForUser", in, out, opts...) + err := c.cc.Invoke(ctx, IAM_ListMembershipsForUser_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *iAMClient) AddMembership(ctx context.Context, in *AddMembershipIn, opts ...grpc.CallOption) (*AddMembershipOut, error) { - out := new(AddMembershipOut) - err := c.cc.Invoke(ctx, "/IAM/AddMembership", in, out, opts...) +func (c *iAMClient) GetMembership(ctx context.Context, in *GetMembershipIn, opts ...grpc.CallOption) (*GetMembershipOut, error) { + out := new(GetMembershipOut) + err := c.cc.Invoke(ctx, IAM_GetMembership_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *iAMClient) InviteMembership(ctx context.Context, in *AddMembershipIn, opts ...grpc.CallOption) (*AddMembershipOut, error) { +func (c *iAMClient) AddMembership(ctx context.Context, in *AddMembershipIn, opts ...grpc.CallOption) (*AddMembershipOut, error) { out := new(AddMembershipOut) - err := c.cc.Invoke(ctx, "/IAM/InviteMembership", in, out, opts...) + err := c.cc.Invoke(ctx, IAM_AddMembership_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *iAMClient) ConfirmMembership(ctx context.Context, in *ConfirmMembershipIn, opts ...grpc.CallOption) (*ConfirmMembershipOut, error) { - out := new(ConfirmMembershipOut) - err := c.cc.Invoke(ctx, "/IAM/ConfirmMembership", in, out, opts...) +func (c *iAMClient) UpdateMembership(ctx context.Context, in *UpdateMembershipIn, opts ...grpc.CallOption) (*UpdateMembershipOut, error) { + out := new(UpdateMembershipOut) + err := c.cc.Invoke(ctx, IAM_UpdateMembership_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -138,7 +120,7 @@ func (c *iAMClient) ConfirmMembership(ctx context.Context, in *ConfirmMembership func (c *iAMClient) RemoveMembership(ctx context.Context, in *RemoveMembershipIn, opts ...grpc.CallOption) (*RemoveMembershipOut, error) { out := new(RemoveMembershipOut) - err := c.cc.Invoke(ctx, "/IAM/RemoveMembership", in, out, opts...) + err := c.cc.Invoke(ctx, IAM_RemoveMembership_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -147,7 +129,7 @@ func (c *iAMClient) RemoveMembership(ctx context.Context, in *RemoveMembershipIn func (c *iAMClient) RemoveResource(ctx context.Context, in *RemoveResourceIn, opts ...grpc.CallOption) (*RemoveResourceOut, error) { out := new(RemoveResourceOut) - err := c.cc.Invoke(ctx, "/IAM/RemoveResource", in, out, opts...) + err := c.cc.Invoke(ctx, IAM_RemoveResource_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -161,15 +143,12 @@ type IAMServer interface { // Query Ping(context.Context, *Message) (*Message, error) Can(context.Context, *CanIn) (*CanOut, error) - ListUserMemberships(context.Context, *UserMembershipsIn) (*ListMembershipsOut, error) - GetMembership(context.Context, *GetMembershipIn) (*GetMembershipOut, error) - ListResourceMemberships(context.Context, *ResourceMembershipsIn) (*ListMembershipsOut, error) - ListMembershipsByResource(context.Context, *MembershipsByResourceIn) (*ListMembershipsOut, error) + ListMembershipsForResource(context.Context, *MembershipsForResourceIn) (*ListMembershipsOut, error) ListMembershipsForUser(context.Context, *MembershipsForUserIn) (*ListMembershipsOut, error) + GetMembership(context.Context, *GetMembershipIn) (*GetMembershipOut, error) // Mutation AddMembership(context.Context, *AddMembershipIn) (*AddMembershipOut, error) - InviteMembership(context.Context, *AddMembershipIn) (*AddMembershipOut, error) - ConfirmMembership(context.Context, *ConfirmMembershipIn) (*ConfirmMembershipOut, error) + UpdateMembership(context.Context, *UpdateMembershipIn) (*UpdateMembershipOut, error) RemoveMembership(context.Context, *RemoveMembershipIn) (*RemoveMembershipOut, error) RemoveResource(context.Context, *RemoveResourceIn) (*RemoveResourceOut, error) mustEmbedUnimplementedIAMServer() @@ -185,29 +164,20 @@ func (UnimplementedIAMServer) Ping(context.Context, *Message) (*Message, error) func (UnimplementedIAMServer) Can(context.Context, *CanIn) (*CanOut, error) { return nil, status.Errorf(codes.Unimplemented, "method Can not implemented") } -func (UnimplementedIAMServer) ListUserMemberships(context.Context, *UserMembershipsIn) (*ListMembershipsOut, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListUserMemberships not implemented") -} -func (UnimplementedIAMServer) GetMembership(context.Context, *GetMembershipIn) (*GetMembershipOut, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetMembership not implemented") -} -func (UnimplementedIAMServer) ListResourceMemberships(context.Context, *ResourceMembershipsIn) (*ListMembershipsOut, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListResourceMemberships not implemented") -} -func (UnimplementedIAMServer) ListMembershipsByResource(context.Context, *MembershipsByResourceIn) (*ListMembershipsOut, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListMembershipsByResource not implemented") +func (UnimplementedIAMServer) ListMembershipsForResource(context.Context, *MembershipsForResourceIn) (*ListMembershipsOut, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListMembershipsForResource not implemented") } func (UnimplementedIAMServer) ListMembershipsForUser(context.Context, *MembershipsForUserIn) (*ListMembershipsOut, error) { return nil, status.Errorf(codes.Unimplemented, "method ListMembershipsForUser not implemented") } +func (UnimplementedIAMServer) GetMembership(context.Context, *GetMembershipIn) (*GetMembershipOut, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMembership not implemented") +} func (UnimplementedIAMServer) AddMembership(context.Context, *AddMembershipIn) (*AddMembershipOut, error) { return nil, status.Errorf(codes.Unimplemented, "method AddMembership not implemented") } -func (UnimplementedIAMServer) InviteMembership(context.Context, *AddMembershipIn) (*AddMembershipOut, error) { - return nil, status.Errorf(codes.Unimplemented, "method InviteMembership not implemented") -} -func (UnimplementedIAMServer) ConfirmMembership(context.Context, *ConfirmMembershipIn) (*ConfirmMembershipOut, error) { - return nil, status.Errorf(codes.Unimplemented, "method ConfirmMembership not implemented") +func (UnimplementedIAMServer) UpdateMembership(context.Context, *UpdateMembershipIn) (*UpdateMembershipOut, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateMembership not implemented") } func (UnimplementedIAMServer) RemoveMembership(context.Context, *RemoveMembershipIn) (*RemoveMembershipOut, error) { return nil, status.Errorf(codes.Unimplemented, "method RemoveMembership not implemented") @@ -238,7 +208,7 @@ func _IAM_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{ } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/IAM/Ping", + FullMethod: IAM_Ping_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(IAMServer).Ping(ctx, req.(*Message)) @@ -256,7 +226,7 @@ func _IAM_Can_Handler(srv interface{}, ctx context.Context, dec func(interface{} } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/IAM/Can", + FullMethod: IAM_Can_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(IAMServer).Can(ctx, req.(*CanIn)) @@ -264,74 +234,20 @@ func _IAM_Can_Handler(srv interface{}, ctx context.Context, dec func(interface{} return interceptor(ctx, in, info, handler) } -func _IAM_ListUserMemberships_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UserMembershipsIn) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(IAMServer).ListUserMemberships(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/IAM/ListUserMemberships", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(IAMServer).ListUserMemberships(ctx, req.(*UserMembershipsIn)) - } - return interceptor(ctx, in, info, handler) -} - -func _IAM_GetMembership_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetMembershipIn) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(IAMServer).GetMembership(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/IAM/GetMembership", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(IAMServer).GetMembership(ctx, req.(*GetMembershipIn)) - } - return interceptor(ctx, in, info, handler) -} - -func _IAM_ListResourceMemberships_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ResourceMembershipsIn) +func _IAM_ListMembershipsForResource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MembershipsForResourceIn) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(IAMServer).ListResourceMemberships(ctx, in) + return srv.(IAMServer).ListMembershipsForResource(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/IAM/ListResourceMemberships", + FullMethod: IAM_ListMembershipsForResource_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(IAMServer).ListResourceMemberships(ctx, req.(*ResourceMembershipsIn)) - } - return interceptor(ctx, in, info, handler) -} - -func _IAM_ListMembershipsByResource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MembershipsByResourceIn) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(IAMServer).ListMembershipsByResource(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/IAM/ListMembershipsByResource", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(IAMServer).ListMembershipsByResource(ctx, req.(*MembershipsByResourceIn)) + return srv.(IAMServer).ListMembershipsForResource(ctx, req.(*MembershipsForResourceIn)) } return interceptor(ctx, in, info, handler) } @@ -346,7 +262,7 @@ func _IAM_ListMembershipsForUser_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/IAM/ListMembershipsForUser", + FullMethod: IAM_ListMembershipsForUser_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(IAMServer).ListMembershipsForUser(ctx, req.(*MembershipsForUserIn)) @@ -354,56 +270,56 @@ func _IAM_ListMembershipsForUser_Handler(srv interface{}, ctx context.Context, d return interceptor(ctx, in, info, handler) } -func _IAM_AddMembership_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddMembershipIn) +func _IAM_GetMembership_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetMembershipIn) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(IAMServer).AddMembership(ctx, in) + return srv.(IAMServer).GetMembership(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/IAM/AddMembership", + FullMethod: IAM_GetMembership_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(IAMServer).AddMembership(ctx, req.(*AddMembershipIn)) + return srv.(IAMServer).GetMembership(ctx, req.(*GetMembershipIn)) } return interceptor(ctx, in, info, handler) } -func _IAM_InviteMembership_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _IAM_AddMembership_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AddMembershipIn) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(IAMServer).InviteMembership(ctx, in) + return srv.(IAMServer).AddMembership(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/IAM/InviteMembership", + FullMethod: IAM_AddMembership_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(IAMServer).InviteMembership(ctx, req.(*AddMembershipIn)) + return srv.(IAMServer).AddMembership(ctx, req.(*AddMembershipIn)) } return interceptor(ctx, in, info, handler) } -func _IAM_ConfirmMembership_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ConfirmMembershipIn) +func _IAM_UpdateMembership_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateMembershipIn) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(IAMServer).ConfirmMembership(ctx, in) + return srv.(IAMServer).UpdateMembership(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/IAM/ConfirmMembership", + FullMethod: IAM_UpdateMembership_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(IAMServer).ConfirmMembership(ctx, req.(*ConfirmMembershipIn)) + return srv.(IAMServer).UpdateMembership(ctx, req.(*UpdateMembershipIn)) } return interceptor(ctx, in, info, handler) } @@ -418,7 +334,7 @@ func _IAM_RemoveMembership_Handler(srv interface{}, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/IAM/RemoveMembership", + FullMethod: IAM_RemoveMembership_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(IAMServer).RemoveMembership(ctx, req.(*RemoveMembershipIn)) @@ -436,7 +352,7 @@ func _IAM_RemoveResource_Handler(srv interface{}, ctx context.Context, dec func( } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/IAM/RemoveResource", + FullMethod: IAM_RemoveResource_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(IAMServer).RemoveResource(ctx, req.(*RemoveResourceIn)) @@ -460,36 +376,24 @@ var IAM_ServiceDesc = grpc.ServiceDesc{ Handler: _IAM_Can_Handler, }, { - MethodName: "ListUserMemberships", - Handler: _IAM_ListUserMemberships_Handler, - }, - { - MethodName: "GetMembership", - Handler: _IAM_GetMembership_Handler, - }, - { - MethodName: "ListResourceMemberships", - Handler: _IAM_ListResourceMemberships_Handler, - }, - { - MethodName: "ListMembershipsByResource", - Handler: _IAM_ListMembershipsByResource_Handler, + MethodName: "ListMembershipsForResource", + Handler: _IAM_ListMembershipsForResource_Handler, }, { MethodName: "ListMembershipsForUser", Handler: _IAM_ListMembershipsForUser_Handler, }, { - MethodName: "AddMembership", - Handler: _IAM_AddMembership_Handler, + MethodName: "GetMembership", + Handler: _IAM_GetMembership_Handler, }, { - MethodName: "InviteMembership", - Handler: _IAM_InviteMembership_Handler, + MethodName: "AddMembership", + Handler: _IAM_AddMembership_Handler, }, { - MethodName: "ConfirmMembership", - Handler: _IAM_ConfirmMembership_Handler, + MethodName: "UpdateMembership", + Handler: _IAM_UpdateMembership_Handler, }, { MethodName: "RemoveMembership", diff --git a/grpc-interfaces/kloudlite.io/rpc/iam/mocks/iam-client.go b/grpc-interfaces/kloudlite.io/rpc/iam/mocks/iam-client.go new file mode 100644 index 000000000..da8ee4f1b --- /dev/null +++ b/grpc-interfaces/kloudlite.io/rpc/iam/mocks/iam-client.go @@ -0,0 +1,107 @@ +package mocks + +import ( + context "context" + iam "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" + grpc "google.golang.org/grpc" +) + +type IAMClientCallerInfo struct { + Args []any +} + +type IAMClient struct { + Calls map[string][]IAMClientCallerInfo + MockAddMembership func(ctx context.Context, in *iam.AddMembershipIn, opts ...grpc.CallOption) (*iam.AddMembershipOut, error) + MockCan func(ctx context.Context, in *iam.CanIn, opts ...grpc.CallOption) (*iam.CanOut, error) + MockGetMembership func(ctx context.Context, in *iam.GetMembershipIn, opts ...grpc.CallOption) (*iam.GetMembershipOut, error) + MockListMembershipsForResource func(ctx context.Context, in *iam.MembershipsForResourceIn, opts ...grpc.CallOption) (*iam.ListMembershipsOut, error) + MockListMembershipsForUser func(ctx context.Context, in *iam.MembershipsForUserIn, opts ...grpc.CallOption) (*iam.ListMembershipsOut, error) + MockPing func(ctx context.Context, in *iam.Message, opts ...grpc.CallOption) (*iam.Message, error) + MockRemoveMembership func(ctx context.Context, in *iam.RemoveMembershipIn, opts ...grpc.CallOption) (*iam.RemoveMembershipOut, error) + MockRemoveResource func(ctx context.Context, in *iam.RemoveResourceIn, opts ...grpc.CallOption) (*iam.RemoveResourceOut, error) + MockUpdateMembership func(ctx context.Context, in *iam.UpdateMembershipIn, opts ...grpc.CallOption) (*iam.UpdateMembershipOut, error) +} + +func (m *IAMClient) registerCall(funcName string, args ...any) { + if m.Calls == nil { + m.Calls = map[string][]IAMClientCallerInfo{} + } + m.Calls[funcName] = append(m.Calls[funcName], IAMClientCallerInfo{Args: args}) +} + +func (iMock *IAMClient) AddMembership(ctx context.Context, in *iam.AddMembershipIn, opts ...grpc.CallOption) (*iam.AddMembershipOut, error) { + if iMock.MockAddMembership != nil { + iMock.registerCall("AddMembership", ctx, in, opts) + return iMock.MockAddMembership(ctx, in, opts...) + } + panic("method 'AddMembership' not implemented, yet") +} + +func (iMock *IAMClient) Can(ctx context.Context, in *iam.CanIn, opts ...grpc.CallOption) (*iam.CanOut, error) { + if iMock.MockCan != nil { + iMock.registerCall("Can", ctx, in, opts) + return iMock.MockCan(ctx, in, opts...) + } + panic("method 'Can' not implemented, yet") +} + +func (iMock *IAMClient) GetMembership(ctx context.Context, in *iam.GetMembershipIn, opts ...grpc.CallOption) (*iam.GetMembershipOut, error) { + if iMock.MockGetMembership != nil { + iMock.registerCall("GetMembership", ctx, in, opts) + return iMock.MockGetMembership(ctx, in, opts...) + } + panic("method 'GetMembership' not implemented, yet") +} + +func (iMock *IAMClient) ListMembershipsForResource(ctx context.Context, in *iam.MembershipsForResourceIn, opts ...grpc.CallOption) (*iam.ListMembershipsOut, error) { + if iMock.MockListMembershipsForResource != nil { + iMock.registerCall("ListMembershipsForResource", ctx, in, opts) + return iMock.MockListMembershipsForResource(ctx, in, opts...) + } + panic("method 'ListMembershipsForResource' not implemented, yet") +} + +func (iMock *IAMClient) ListMembershipsForUser(ctx context.Context, in *iam.MembershipsForUserIn, opts ...grpc.CallOption) (*iam.ListMembershipsOut, error) { + if iMock.MockListMembershipsForUser != nil { + iMock.registerCall("ListMembershipsForUser", ctx, in, opts) + return iMock.MockListMembershipsForUser(ctx, in, opts...) + } + panic("method 'ListMembershipsForUser' not implemented, yet") +} + +func (iMock *IAMClient) Ping(ctx context.Context, in *iam.Message, opts ...grpc.CallOption) (*iam.Message, error) { + if iMock.MockPing != nil { + iMock.registerCall("Ping", ctx, in, opts) + return iMock.MockPing(ctx, in, opts...) + } + panic("method 'Ping' not implemented, yet") +} + +func (iMock *IAMClient) RemoveMembership(ctx context.Context, in *iam.RemoveMembershipIn, opts ...grpc.CallOption) (*iam.RemoveMembershipOut, error) { + if iMock.MockRemoveMembership != nil { + iMock.registerCall("RemoveMembership", ctx, in, opts) + return iMock.MockRemoveMembership(ctx, in, opts...) + } + panic("method 'RemoveMembership' not implemented, yet") +} + +func (iMock *IAMClient) RemoveResource(ctx context.Context, in *iam.RemoveResourceIn, opts ...grpc.CallOption) (*iam.RemoveResourceOut, error) { + if iMock.MockRemoveResource != nil { + iMock.registerCall("RemoveResource", ctx, in, opts) + return iMock.MockRemoveResource(ctx, in, opts...) + } + panic("method 'RemoveResource' not implemented, yet") +} + +func (iMock *IAMClient) UpdateMembership(ctx context.Context, in *iam.UpdateMembershipIn, opts ...grpc.CallOption) (*iam.UpdateMembershipOut, error) { + if iMock.MockUpdateMembership != nil { + iMock.registerCall("UpdateMembership", ctx, in, opts) + return iMock.MockUpdateMembership(ctx, in, opts...) + } + panic("method 'UpdateMembership' not implemented, yet") +} + +func NewIAMClient() *IAMClient { + return &IAMClient{} +} diff --git a/grpc-interfaces/kloudlite.io/rpc/iam/mocks/iam-server.go b/grpc-interfaces/kloudlite.io/rpc/iam/mocks/iam-server.go new file mode 100644 index 000000000..8deecd09e --- /dev/null +++ b/grpc-interfaces/kloudlite.io/rpc/iam/mocks/iam-server.go @@ -0,0 +1,106 @@ +package mocks + +import ( + context "context" + iam "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" +) + +type IAMServerCallerInfo struct { + Args []any +} + +type IAMServer struct { + Calls map[string][]IAMServerCallerInfo + MockAddMembership func(ka context.Context, kb *iam.AddMembershipIn) (*iam.AddMembershipOut, error) + MockCan func(kc context.Context, kd *iam.CanIn) (*iam.CanOut, error) + MockGetMembership func(ke context.Context, kf *iam.GetMembershipIn) (*iam.GetMembershipOut, error) + MockListMembershipsForResource func(kg context.Context, kh *iam.MembershipsForResourceIn) (*iam.ListMembershipsOut, error) + MockListMembershipsForUser func(ki context.Context, kj *iam.MembershipsForUserIn) (*iam.ListMembershipsOut, error) + MockPing func(kk context.Context, kl *iam.Message) (*iam.Message, error) + MockRemoveMembership func(km context.Context, kn *iam.RemoveMembershipIn) (*iam.RemoveMembershipOut, error) + MockRemoveResource func(ko context.Context, kp *iam.RemoveResourceIn) (*iam.RemoveResourceOut, error) + MockUpdateMembership func(kq context.Context, kr *iam.UpdateMembershipIn) (*iam.UpdateMembershipOut, error) +} + +func (m *IAMServer) registerCall(funcName string, args ...any) { + if m.Calls == nil { + m.Calls = map[string][]IAMServerCallerInfo{} + } + m.Calls[funcName] = append(m.Calls[funcName], IAMServerCallerInfo{Args: args}) +} + +func (iMock *IAMServer) AddMembership(ka context.Context, kb *iam.AddMembershipIn) (*iam.AddMembershipOut, error) { + if iMock.MockAddMembership != nil { + iMock.registerCall("AddMembership", ka, kb) + return iMock.MockAddMembership(ka, kb) + } + panic("method 'AddMembership' not implemented, yet") +} + +func (iMock *IAMServer) Can(kc context.Context, kd *iam.CanIn) (*iam.CanOut, error) { + if iMock.MockCan != nil { + iMock.registerCall("Can", kc, kd) + return iMock.MockCan(kc, kd) + } + panic("method 'Can' not implemented, yet") +} + +func (iMock *IAMServer) GetMembership(ke context.Context, kf *iam.GetMembershipIn) (*iam.GetMembershipOut, error) { + if iMock.MockGetMembership != nil { + iMock.registerCall("GetMembership", ke, kf) + return iMock.MockGetMembership(ke, kf) + } + panic("method 'GetMembership' not implemented, yet") +} + +func (iMock *IAMServer) ListMembershipsForResource(kg context.Context, kh *iam.MembershipsForResourceIn) (*iam.ListMembershipsOut, error) { + if iMock.MockListMembershipsForResource != nil { + iMock.registerCall("ListMembershipsForResource", kg, kh) + return iMock.MockListMembershipsForResource(kg, kh) + } + panic("method 'ListMembershipsForResource' not implemented, yet") +} + +func (iMock *IAMServer) ListMembershipsForUser(ki context.Context, kj *iam.MembershipsForUserIn) (*iam.ListMembershipsOut, error) { + if iMock.MockListMembershipsForUser != nil { + iMock.registerCall("ListMembershipsForUser", ki, kj) + return iMock.MockListMembershipsForUser(ki, kj) + } + panic("method 'ListMembershipsForUser' not implemented, yet") +} + +func (iMock *IAMServer) Ping(kk context.Context, kl *iam.Message) (*iam.Message, error) { + if iMock.MockPing != nil { + iMock.registerCall("Ping", kk, kl) + return iMock.MockPing(kk, kl) + } + panic("method 'Ping' not implemented, yet") +} + +func (iMock *IAMServer) RemoveMembership(km context.Context, kn *iam.RemoveMembershipIn) (*iam.RemoveMembershipOut, error) { + if iMock.MockRemoveMembership != nil { + iMock.registerCall("RemoveMembership", km, kn) + return iMock.MockRemoveMembership(km, kn) + } + panic("method 'RemoveMembership' not implemented, yet") +} + +func (iMock *IAMServer) RemoveResource(ko context.Context, kp *iam.RemoveResourceIn) (*iam.RemoveResourceOut, error) { + if iMock.MockRemoveResource != nil { + iMock.registerCall("RemoveResource", ko, kp) + return iMock.MockRemoveResource(ko, kp) + } + panic("method 'RemoveResource' not implemented, yet") +} + +func (iMock *IAMServer) UpdateMembership(kq context.Context, kr *iam.UpdateMembershipIn) (*iam.UpdateMembershipOut, error) { + if iMock.MockUpdateMembership != nil { + iMock.registerCall("UpdateMembership", kq, kr) + return iMock.MockUpdateMembership(kq, kr) + } + panic("method 'UpdateMembership' not implemented, yet") +} + +func NewIAMServer() *IAMServer { + return &IAMServer{} +} diff --git a/grpc-interfaces/kloudlite.io/rpc/infra/infra.pb.go b/grpc-interfaces/kloudlite.io/rpc/infra/infra.pb.go index bd113a4d4..5c02906f5 100644 --- a/grpc-interfaces/kloudlite.io/rpc/infra/infra.pb.go +++ b/grpc-interfaces/kloudlite.io/rpc/infra/infra.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v3.21.12 +// protoc-gen-go v1.31.0 +// protoc v4.24.4 // source: infra.proto package infra @@ -20,18 +20,20 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type GetInput struct { +type GetClusterIn struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ManagedResName string `protobuf:"bytes,1,opt,name=managedResName,proto3" json:"managedResName,omitempty"` - ClusterId string `protobuf:"bytes,2,opt,name=clusterId,proto3" json:"clusterId,omitempty"` - Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + UserName string `protobuf:"bytes,2,opt,name=userName,proto3" json:"userName,omitempty"` + UserEmail string `protobuf:"bytes,3,opt,name=userEmail,proto3" json:"userEmail,omitempty"` + AccountName string `protobuf:"bytes,4,opt,name=accountName,proto3" json:"accountName,omitempty"` + ClusterName string `protobuf:"bytes,5,opt,name=clusterName,proto3" json:"clusterName,omitempty"` } -func (x *GetInput) Reset() { - *x = GetInput{} +func (x *GetClusterIn) Reset() { + *x = GetClusterIn{} if protoimpl.UnsafeEnabled { mi := &file_infra_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -39,13 +41,13 @@ func (x *GetInput) Reset() { } } -func (x *GetInput) String() string { +func (x *GetClusterIn) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetInput) ProtoMessage() {} +func (*GetClusterIn) ProtoMessage() {} -func (x *GetInput) ProtoReflect() protoreflect.Message { +func (x *GetClusterIn) ProtoReflect() protoreflect.Message { mi := &file_infra_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -57,42 +59,59 @@ func (x *GetInput) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetInput.ProtoReflect.Descriptor instead. -func (*GetInput) Descriptor() ([]byte, []int) { +// Deprecated: Use GetClusterIn.ProtoReflect.Descriptor instead. +func (*GetClusterIn) Descriptor() ([]byte, []int) { return file_infra_proto_rawDescGZIP(), []int{0} } -func (x *GetInput) GetManagedResName() string { +func (x *GetClusterIn) GetUserId() string { if x != nil { - return x.ManagedResName + return x.UserId } return "" } -func (x *GetInput) GetClusterId() string { +func (x *GetClusterIn) GetUserName() string { if x != nil { - return x.ClusterId + return x.UserName } return "" } -func (x *GetInput) GetNamespace() string { +func (x *GetClusterIn) GetUserEmail() string { if x != nil { - return x.Namespace + return x.UserEmail } return "" } -type Output struct { +func (x *GetClusterIn) GetAccountName() string { + if x != nil { + return x.AccountName + } + return "" +} + +func (x *GetClusterIn) GetClusterName() string { + if x != nil { + return x.ClusterName + } + return "" +} + +type GetClusterOut struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Output map[string]string `protobuf:"bytes,1,rep,name=output,proto3" json:"output,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + MessageQueueTopic string `protobuf:"bytes,1,opt,name=messageQueueTopic,proto3" json:"messageQueueTopic,omitempty"` + DnsHost string `protobuf:"bytes,2,opt,name=dnsHost,proto3" json:"dnsHost,omitempty"` + IACJobName string `protobuf:"bytes,3,opt,name=IACJobName,proto3" json:"IACJobName,omitempty"` + IACJobNamespace string `protobuf:"bytes,4,opt,name=IACJobNamespace,proto3" json:"IACJobNamespace,omitempty"` } -func (x *Output) Reset() { - *x = Output{} +func (x *GetClusterOut) Reset() { + *x = GetClusterOut{} if protoimpl.UnsafeEnabled { mi := &file_infra_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -100,13 +119,13 @@ func (x *Output) Reset() { } } -func (x *Output) String() string { +func (x *GetClusterOut) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Output) ProtoMessage() {} +func (*GetClusterOut) ProtoMessage() {} -func (x *Output) ProtoReflect() protoreflect.Message { +func (x *GetClusterOut) ProtoReflect() protoreflect.Message { mi := &file_infra_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -118,42 +137,233 @@ func (x *Output) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Output.ProtoReflect.Descriptor instead. -func (*Output) Descriptor() ([]byte, []int) { +// Deprecated: Use GetClusterOut.ProtoReflect.Descriptor instead. +func (*GetClusterOut) Descriptor() ([]byte, []int) { return file_infra_proto_rawDescGZIP(), []int{1} } -func (x *Output) GetOutput() map[string]string { +func (x *GetClusterOut) GetMessageQueueTopic() string { + if x != nil { + return x.MessageQueueTopic + } + return "" +} + +func (x *GetClusterOut) GetDnsHost() string { + if x != nil { + return x.DnsHost + } + return "" +} + +func (x *GetClusterOut) GetIACJobName() string { + if x != nil { + return x.IACJobName + } + return "" +} + +func (x *GetClusterOut) GetIACJobNamespace() string { + if x != nil { + return x.IACJobNamespace + } + return "" +} + +type GetNodepoolIn struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + UserName string `protobuf:"bytes,2,opt,name=userName,proto3" json:"userName,omitempty"` + UserEmail string `protobuf:"bytes,3,opt,name=userEmail,proto3" json:"userEmail,omitempty"` + AccountName string `protobuf:"bytes,4,opt,name=accountName,proto3" json:"accountName,omitempty"` + ClusterName string `protobuf:"bytes,5,opt,name=clusterName,proto3" json:"clusterName,omitempty"` + NodepoolName string `protobuf:"bytes,6,opt,name=nodepoolName,proto3" json:"nodepoolName,omitempty"` +} + +func (x *GetNodepoolIn) Reset() { + *x = GetNodepoolIn{} + if protoimpl.UnsafeEnabled { + mi := &file_infra_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetNodepoolIn) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetNodepoolIn) ProtoMessage() {} + +func (x *GetNodepoolIn) ProtoReflect() protoreflect.Message { + mi := &file_infra_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetNodepoolIn.ProtoReflect.Descriptor instead. +func (*GetNodepoolIn) Descriptor() ([]byte, []int) { + return file_infra_proto_rawDescGZIP(), []int{2} +} + +func (x *GetNodepoolIn) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *GetNodepoolIn) GetUserName() string { + if x != nil { + return x.UserName + } + return "" +} + +func (x *GetNodepoolIn) GetUserEmail() string { + if x != nil { + return x.UserEmail + } + return "" +} + +func (x *GetNodepoolIn) GetAccountName() string { + if x != nil { + return x.AccountName + } + return "" +} + +func (x *GetNodepoolIn) GetClusterName() string { + if x != nil { + return x.ClusterName + } + return "" +} + +func (x *GetNodepoolIn) GetNodepoolName() string { if x != nil { - return x.Output + return x.NodepoolName + } + return "" +} + +type GetNodepoolOut struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IACJobName string `protobuf:"bytes,1,opt,name=IACJobName,proto3" json:"IACJobName,omitempty"` + IACJobNamespace string `protobuf:"bytes,2,opt,name=IACJobNamespace,proto3" json:"IACJobNamespace,omitempty"` +} + +func (x *GetNodepoolOut) Reset() { + *x = GetNodepoolOut{} + if protoimpl.UnsafeEnabled { + mi := &file_infra_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return nil +} + +func (x *GetNodepoolOut) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetNodepoolOut) ProtoMessage() {} + +func (x *GetNodepoolOut) ProtoReflect() protoreflect.Message { + mi := &file_infra_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetNodepoolOut.ProtoReflect.Descriptor instead. +func (*GetNodepoolOut) Descriptor() ([]byte, []int) { + return file_infra_proto_rawDescGZIP(), []int{3} +} + +func (x *GetNodepoolOut) GetIACJobName() string { + if x != nil { + return x.IACJobName + } + return "" +} + +func (x *GetNodepoolOut) GetIACJobNamespace() string { + if x != nil { + return x.IACJobNamespace + } + return "" } var File_infra_proto protoreflect.FileDescriptor var file_infra_proto_rawDesc = []byte{ - 0x0a, 0x0b, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6e, 0x0a, - 0x08, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x26, 0x0a, 0x0e, 0x6d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x64, 0x52, 0x65, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x52, 0x65, 0x73, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, - 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0x70, 0x0a, - 0x06, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x2b, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, - 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, - 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6f, 0x75, - 0x74, 0x70, 0x75, 0x74, 0x1a, 0x39, 0x0a, 0x0b, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x32, - 0x30, 0x0a, 0x05, 0x49, 0x6e, 0x66, 0x72, 0x61, 0x12, 0x27, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x09, 0x2e, - 0x47, 0x65, 0x74, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x1a, 0x07, 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75, - 0x74, 0x42, 0x18, 0x5a, 0x16, 0x6b, 0x6c, 0x6f, 0x75, 0x64, 0x6c, 0x69, 0x74, 0x65, 0x2e, 0x69, - 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x0a, 0x0b, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa4, 0x01, + 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x12, 0x16, + 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, + 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, + 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x4e, 0x61, 0x6d, 0x65, 0x22, 0xa1, 0x01, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, + 0x74, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x12, 0x2c, 0x0a, 0x11, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x51, 0x75, 0x65, 0x75, 0x65, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x11, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x51, 0x75, 0x65, 0x75, 0x65, 0x54, + 0x6f, 0x70, 0x69, 0x63, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x6e, 0x73, 0x48, 0x6f, 0x73, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x6e, 0x73, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x1e, + 0x0a, 0x0a, 0x49, 0x41, 0x43, 0x4a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x49, 0x41, 0x43, 0x4a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x28, + 0x0a, 0x0f, 0x49, 0x41, 0x43, 0x4a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x49, 0x41, 0x43, 0x4a, 0x6f, 0x62, 0x4e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0xc9, 0x01, 0x0a, 0x0d, 0x47, 0x65, 0x74, + 0x4e, 0x6f, 0x64, 0x65, 0x70, 0x6f, 0x6f, 0x6c, 0x49, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, + 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, + 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, + 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x20, 0x0a, 0x0b, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, + 0x0a, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x22, 0x0a, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x70, 0x6f, 0x6f, 0x6c, 0x4e, 0x61, 0x6d, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x70, 0x6f, 0x6f, 0x6c, + 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x5a, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x70, + 0x6f, 0x6f, 0x6c, 0x4f, 0x75, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x49, 0x41, 0x43, 0x4a, 0x6f, 0x62, + 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x49, 0x41, 0x43, 0x4a, + 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x49, 0x41, 0x43, 0x4a, 0x6f, 0x62, + 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0f, 0x49, 0x41, 0x43, 0x4a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x32, 0x64, 0x0a, 0x05, 0x49, 0x6e, 0x66, 0x72, 0x61, 0x12, 0x2b, 0x0a, 0x0a, 0x47, 0x65, 0x74, + 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x0d, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x1a, 0x0e, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, + 0x74, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x12, 0x2e, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, + 0x65, 0x70, 0x6f, 0x6f, 0x6c, 0x12, 0x0e, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x70, + 0x6f, 0x6f, 0x6c, 0x49, 0x6e, 0x1a, 0x0f, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x70, + 0x6f, 0x6f, 0x6c, 0x4f, 0x75, 0x74, 0x42, 0x18, 0x5a, 0x16, 0x6b, 0x6c, 0x6f, 0x75, 0x64, 0x6c, + 0x69, 0x74, 0x65, 0x2e, 0x69, 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -168,21 +378,23 @@ func file_infra_proto_rawDescGZIP() []byte { return file_infra_proto_rawDescData } -var file_infra_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_infra_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_infra_proto_goTypes = []interface{}{ - (*GetInput)(nil), // 0: GetInput - (*Output)(nil), // 1: Output - nil, // 2: Output.OutputEntry + (*GetClusterIn)(nil), // 0: GetClusterIn + (*GetClusterOut)(nil), // 1: GetClusterOut + (*GetNodepoolIn)(nil), // 2: GetNodepoolIn + (*GetNodepoolOut)(nil), // 3: GetNodepoolOut } var file_infra_proto_depIdxs = []int32{ - 2, // 0: Output.output:type_name -> Output.OutputEntry - 0, // 1: Infra.GetResourceOutput:input_type -> GetInput - 1, // 2: Infra.GetResourceOutput:output_type -> Output - 2, // [2:3] is the sub-list for method output_type - 1, // [1:2] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 0, // 0: Infra.GetCluster:input_type -> GetClusterIn + 2, // 1: Infra.GetNodepool:input_type -> GetNodepoolIn + 1, // 2: Infra.GetCluster:output_type -> GetClusterOut + 3, // 3: Infra.GetNodepool:output_type -> GetNodepoolOut + 2, // [2:4] is the sub-list for method output_type + 0, // [0:2] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name } func init() { file_infra_proto_init() } @@ -192,7 +404,7 @@ func file_infra_proto_init() { } if !protoimpl.UnsafeEnabled { file_infra_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetInput); i { + switch v := v.(*GetClusterIn); i { case 0: return &v.state case 1: @@ -204,7 +416,31 @@ func file_infra_proto_init() { } } file_infra_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Output); i { + switch v := v.(*GetClusterOut); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_infra_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetNodepoolIn); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_infra_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetNodepoolOut); i { case 0: return &v.state case 1: @@ -222,7 +458,7 @@ func file_infra_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_infra_proto_rawDesc, NumEnums: 0, - NumMessages: 3, + NumMessages: 4, NumExtensions: 0, NumServices: 1, }, diff --git a/grpc-interfaces/kloudlite.io/rpc/infra/infra_grpc.pb.go b/grpc-interfaces/kloudlite.io/rpc/infra/infra_grpc.pb.go index f9d635f99..b2e347c64 100644 --- a/grpc-interfaces/kloudlite.io/rpc/infra/infra_grpc.pb.go +++ b/grpc-interfaces/kloudlite.io/rpc/infra/infra_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.12 +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.24.4 // source: infra.proto package infra @@ -18,11 +18,17 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + Infra_GetCluster_FullMethodName = "/Infra/GetCluster" + Infra_GetNodepool_FullMethodName = "/Infra/GetNodepool" +) + // InfraClient is the client API for Infra service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type InfraClient interface { - GetResourceOutput(ctx context.Context, in *GetInput, opts ...grpc.CallOption) (*Output, error) + GetCluster(ctx context.Context, in *GetClusterIn, opts ...grpc.CallOption) (*GetClusterOut, error) + GetNodepool(ctx context.Context, in *GetNodepoolIn, opts ...grpc.CallOption) (*GetNodepoolOut, error) } type infraClient struct { @@ -33,9 +39,18 @@ func NewInfraClient(cc grpc.ClientConnInterface) InfraClient { return &infraClient{cc} } -func (c *infraClient) GetResourceOutput(ctx context.Context, in *GetInput, opts ...grpc.CallOption) (*Output, error) { - out := new(Output) - err := c.cc.Invoke(ctx, "/Infra/GetResourceOutput", in, out, opts...) +func (c *infraClient) GetCluster(ctx context.Context, in *GetClusterIn, opts ...grpc.CallOption) (*GetClusterOut, error) { + out := new(GetClusterOut) + err := c.cc.Invoke(ctx, Infra_GetCluster_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *infraClient) GetNodepool(ctx context.Context, in *GetNodepoolIn, opts ...grpc.CallOption) (*GetNodepoolOut, error) { + out := new(GetNodepoolOut) + err := c.cc.Invoke(ctx, Infra_GetNodepool_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -46,7 +61,8 @@ func (c *infraClient) GetResourceOutput(ctx context.Context, in *GetInput, opts // All implementations must embed UnimplementedInfraServer // for forward compatibility type InfraServer interface { - GetResourceOutput(context.Context, *GetInput) (*Output, error) + GetCluster(context.Context, *GetClusterIn) (*GetClusterOut, error) + GetNodepool(context.Context, *GetNodepoolIn) (*GetNodepoolOut, error) mustEmbedUnimplementedInfraServer() } @@ -54,8 +70,11 @@ type InfraServer interface { type UnimplementedInfraServer struct { } -func (UnimplementedInfraServer) GetResourceOutput(context.Context, *GetInput) (*Output, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetResourceOutput not implemented") +func (UnimplementedInfraServer) GetCluster(context.Context, *GetClusterIn) (*GetClusterOut, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCluster not implemented") +} +func (UnimplementedInfraServer) GetNodepool(context.Context, *GetNodepoolIn) (*GetNodepoolOut, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNodepool not implemented") } func (UnimplementedInfraServer) mustEmbedUnimplementedInfraServer() {} @@ -70,20 +89,38 @@ func RegisterInfraServer(s grpc.ServiceRegistrar, srv InfraServer) { s.RegisterService(&Infra_ServiceDesc, srv) } -func _Infra_GetResourceOutput_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetInput) +func _Infra_GetCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetClusterIn) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InfraServer).GetCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Infra_GetCluster_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InfraServer).GetCluster(ctx, req.(*GetClusterIn)) + } + return interceptor(ctx, in, info, handler) +} + +func _Infra_GetNodepool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetNodepoolIn) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(InfraServer).GetResourceOutput(ctx, in) + return srv.(InfraServer).GetNodepool(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Infra/GetResourceOutput", + FullMethod: Infra_GetNodepool_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(InfraServer).GetResourceOutput(ctx, req.(*GetInput)) + return srv.(InfraServer).GetNodepool(ctx, req.(*GetNodepoolIn)) } return interceptor(ctx, in, info, handler) } @@ -96,8 +133,12 @@ var Infra_ServiceDesc = grpc.ServiceDesc{ HandlerType: (*InfraServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "GetResourceOutput", - Handler: _Infra_GetResourceOutput_Handler, + MethodName: "GetCluster", + Handler: _Infra_GetCluster_Handler, + }, + { + MethodName: "GetNodepool", + Handler: _Infra_GetNodepool_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/grpc-interfaces/kloudlite.io/rpc/infra/mocks/infra-client.go b/grpc-interfaces/kloudlite.io/rpc/infra/mocks/infra-client.go new file mode 100644 index 000000000..2aab4bdc5 --- /dev/null +++ b/grpc-interfaces/kloudlite.io/rpc/infra/mocks/infra-client.go @@ -0,0 +1,35 @@ +package mocks + +import ( + context "context" + infra "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/infra" + grpc "google.golang.org/grpc" +) + +type InfraClientCallerInfo struct { + Args []any +} + +type InfraClient struct { + Calls map[string][]InfraClientCallerInfo + MockGetResourceOutput func(ctx context.Context, in *infra.GetInput, opts ...grpc.CallOption) (*infra.Output, error) +} + +func (m *InfraClient) registerCall(funcName string, args ...any) { + if m.Calls == nil { + m.Calls = map[string][]InfraClientCallerInfo{} + } + m.Calls[funcName] = append(m.Calls[funcName], InfraClientCallerInfo{Args: args}) +} + +func (iMock *InfraClient) GetResourceOutput(ctx context.Context, in *infra.GetInput, opts ...grpc.CallOption) (*infra.Output, error) { + if iMock.MockGetResourceOutput != nil { + iMock.registerCall("GetResourceOutput", ctx, in, opts) + return iMock.MockGetResourceOutput(ctx, in, opts...) + } + panic("method 'GetResourceOutput' not implemented, yet") +} + +func NewInfraClient() *InfraClient { + return &InfraClient{} +} diff --git a/grpc-interfaces/kloudlite.io/rpc/infra/mocks/infra-server.go b/grpc-interfaces/kloudlite.io/rpc/infra/mocks/infra-server.go new file mode 100644 index 000000000..c7449f91c --- /dev/null +++ b/grpc-interfaces/kloudlite.io/rpc/infra/mocks/infra-server.go @@ -0,0 +1,34 @@ +package mocks + +import ( + context "context" + infra "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/infra" +) + +type InfraServerCallerInfo struct { + Args []any +} + +type InfraServer struct { + Calls map[string][]InfraServerCallerInfo + MockGetResourceOutput func(ka context.Context, kb *infra.GetInput) (*infra.Output, error) +} + +func (m *InfraServer) registerCall(funcName string, args ...any) { + if m.Calls == nil { + m.Calls = map[string][]InfraServerCallerInfo{} + } + m.Calls[funcName] = append(m.Calls[funcName], InfraServerCallerInfo{Args: args}) +} + +func (iMock *InfraServer) GetResourceOutput(ka context.Context, kb *infra.GetInput) (*infra.Output, error) { + if iMock.MockGetResourceOutput != nil { + iMock.registerCall("GetResourceOutput", ka, kb) + return iMock.MockGetResourceOutput(ka, kb) + } + panic("method 'GetResourceOutput' not implemented, yet") +} + +func NewInfraServer() *InfraServer { + return &InfraServer{} +} diff --git a/grpc-interfaces/kloudlite.io/rpc/jseval/jseval.pb.go b/grpc-interfaces/kloudlite.io/rpc/jseval/jseval.pb.go index 078b1e051..14b49384b 100644 --- a/grpc-interfaces/kloudlite.io/rpc/jseval/jseval.pb.go +++ b/grpc-interfaces/kloudlite.io/rpc/jseval/jseval.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v3.21.12 +// protoc-gen-go v1.31.0 +// protoc v4.24.4 // source: jseval.proto package jseval diff --git a/grpc-interfaces/kloudlite.io/rpc/jseval/jseval_grpc.pb.go b/grpc-interfaces/kloudlite.io/rpc/jseval/jseval_grpc.pb.go index 07d47fbf5..8c2cb8221 100644 --- a/grpc-interfaces/kloudlite.io/rpc/jseval/jseval_grpc.pb.go +++ b/grpc-interfaces/kloudlite.io/rpc/jseval/jseval_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.12 +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.24.4 // source: jseval.proto package jseval @@ -18,6 +18,10 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + JSEval_Eval_FullMethodName = "/JSEval/Eval" +) + // JSEvalClient is the client API for JSEval service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -35,7 +39,7 @@ func NewJSEvalClient(cc grpc.ClientConnInterface) JSEvalClient { func (c *jSEvalClient) Eval(ctx context.Context, in *EvalIn, opts ...grpc.CallOption) (*EvalOut, error) { out := new(EvalOut) - err := c.cc.Invoke(ctx, "/JSEval/Eval", in, out, opts...) + err := c.cc.Invoke(ctx, JSEval_Eval_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -80,7 +84,7 @@ func _JSEval_Eval_Handler(srv interface{}, ctx context.Context, dec func(interfa } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/JSEval/Eval", + FullMethod: JSEval_Eval_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(JSEvalServer).Eval(ctx, req.(*EvalIn)) diff --git a/grpc-interfaces/kloudlite.io/rpc/message-office-internal/message-office-internal.pb.go b/grpc-interfaces/kloudlite.io/rpc/message-office-internal/message-office-internal.pb.go new file mode 100644 index 000000000..734e85fd4 --- /dev/null +++ b/grpc-interfaces/kloudlite.io/rpc/message-office-internal/message-office-internal.pb.go @@ -0,0 +1,228 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: message-office-internal.proto + +package message_office_internal + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type GenerateClusterTokenIn struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AccountName string `protobuf:"bytes,1,opt,name=accountName,proto3" json:"accountName,omitempty"` + ClusterName string `protobuf:"bytes,2,opt,name=clusterName,proto3" json:"clusterName,omitempty"` +} + +func (x *GenerateClusterTokenIn) Reset() { + *x = GenerateClusterTokenIn{} + if protoimpl.UnsafeEnabled { + mi := &file_message_office_internal_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenerateClusterTokenIn) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenerateClusterTokenIn) ProtoMessage() {} + +func (x *GenerateClusterTokenIn) ProtoReflect() protoreflect.Message { + mi := &file_message_office_internal_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GenerateClusterTokenIn.ProtoReflect.Descriptor instead. +func (*GenerateClusterTokenIn) Descriptor() ([]byte, []int) { + return file_message_office_internal_proto_rawDescGZIP(), []int{0} +} + +func (x *GenerateClusterTokenIn) GetAccountName() string { + if x != nil { + return x.AccountName + } + return "" +} + +func (x *GenerateClusterTokenIn) GetClusterName() string { + if x != nil { + return x.ClusterName + } + return "" +} + +type GenerateClusterTokenOut struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClusterToken string `protobuf:"bytes,1,opt,name=clusterToken,proto3" json:"clusterToken,omitempty"` +} + +func (x *GenerateClusterTokenOut) Reset() { + *x = GenerateClusterTokenOut{} + if protoimpl.UnsafeEnabled { + mi := &file_message_office_internal_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenerateClusterTokenOut) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenerateClusterTokenOut) ProtoMessage() {} + +func (x *GenerateClusterTokenOut) ProtoReflect() protoreflect.Message { + mi := &file_message_office_internal_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GenerateClusterTokenOut.ProtoReflect.Descriptor instead. +func (*GenerateClusterTokenOut) Descriptor() ([]byte, []int) { + return file_message_office_internal_proto_rawDescGZIP(), []int{1} +} + +func (x *GenerateClusterTokenOut) GetClusterToken() string { + if x != nil { + return x.ClusterToken + } + return "" +} + +var File_message_office_internal_proto protoreflect.FileDescriptor + +var file_message_office_internal_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, + 0x2d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x5c, 0x0a, 0x16, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x49, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, + 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x3d, 0x0a, + 0x17, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4f, 0x75, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x63, 0x6c, 0x75, 0x73, + 0x74, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0x62, 0x0a, 0x15, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x12, 0x49, 0x0a, 0x14, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x17, 0x2e, + 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x49, 0x6e, 0x1a, 0x18, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4f, 0x75, 0x74, + 0x42, 0x2a, 0x5a, 0x28, 0x6b, 0x6c, 0x6f, 0x75, 0x64, 0x6c, 0x69, 0x74, 0x65, 0x2e, 0x69, 0x6f, + 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2d, 0x6f, 0x66, 0x66, + 0x69, 0x63, 0x65, 0x2d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_message_office_internal_proto_rawDescOnce sync.Once + file_message_office_internal_proto_rawDescData = file_message_office_internal_proto_rawDesc +) + +func file_message_office_internal_proto_rawDescGZIP() []byte { + file_message_office_internal_proto_rawDescOnce.Do(func() { + file_message_office_internal_proto_rawDescData = protoimpl.X.CompressGZIP(file_message_office_internal_proto_rawDescData) + }) + return file_message_office_internal_proto_rawDescData +} + +var file_message_office_internal_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_message_office_internal_proto_goTypes = []interface{}{ + (*GenerateClusterTokenIn)(nil), // 0: GenerateClusterTokenIn + (*GenerateClusterTokenOut)(nil), // 1: GenerateClusterTokenOut +} +var file_message_office_internal_proto_depIdxs = []int32{ + 0, // 0: MessageOfficeInternal.GenerateClusterToken:input_type -> GenerateClusterTokenIn + 1, // 1: MessageOfficeInternal.GenerateClusterToken:output_type -> GenerateClusterTokenOut + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_message_office_internal_proto_init() } +func file_message_office_internal_proto_init() { + if File_message_office_internal_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_message_office_internal_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenerateClusterTokenIn); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_office_internal_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenerateClusterTokenOut); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_message_office_internal_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_message_office_internal_proto_goTypes, + DependencyIndexes: file_message_office_internal_proto_depIdxs, + MessageInfos: file_message_office_internal_proto_msgTypes, + }.Build() + File_message_office_internal_proto = out.File + file_message_office_internal_proto_rawDesc = nil + file_message_office_internal_proto_goTypes = nil + file_message_office_internal_proto_depIdxs = nil +} diff --git a/grpc-interfaces/kloudlite.io/rpc/message-office-internal/message-office-internal_grpc.pb.go b/grpc-interfaces/kloudlite.io/rpc/message-office-internal/message-office-internal_grpc.pb.go new file mode 100644 index 000000000..6ba4302d3 --- /dev/null +++ b/grpc-interfaces/kloudlite.io/rpc/message-office-internal/message-office-internal_grpc.pb.go @@ -0,0 +1,109 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.24.4 +// source: message-office-internal.proto + +package message_office_internal + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + MessageOfficeInternal_GenerateClusterToken_FullMethodName = "/MessageOfficeInternal/GenerateClusterToken" +) + +// MessageOfficeInternalClient is the client API for MessageOfficeInternal service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MessageOfficeInternalClient interface { + GenerateClusterToken(ctx context.Context, in *GenerateClusterTokenIn, opts ...grpc.CallOption) (*GenerateClusterTokenOut, error) +} + +type messageOfficeInternalClient struct { + cc grpc.ClientConnInterface +} + +func NewMessageOfficeInternalClient(cc grpc.ClientConnInterface) MessageOfficeInternalClient { + return &messageOfficeInternalClient{cc} +} + +func (c *messageOfficeInternalClient) GenerateClusterToken(ctx context.Context, in *GenerateClusterTokenIn, opts ...grpc.CallOption) (*GenerateClusterTokenOut, error) { + out := new(GenerateClusterTokenOut) + err := c.cc.Invoke(ctx, MessageOfficeInternal_GenerateClusterToken_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MessageOfficeInternalServer is the server API for MessageOfficeInternal service. +// All implementations must embed UnimplementedMessageOfficeInternalServer +// for forward compatibility +type MessageOfficeInternalServer interface { + GenerateClusterToken(context.Context, *GenerateClusterTokenIn) (*GenerateClusterTokenOut, error) + mustEmbedUnimplementedMessageOfficeInternalServer() +} + +// UnimplementedMessageOfficeInternalServer must be embedded to have forward compatible implementations. +type UnimplementedMessageOfficeInternalServer struct { +} + +func (UnimplementedMessageOfficeInternalServer) GenerateClusterToken(context.Context, *GenerateClusterTokenIn) (*GenerateClusterTokenOut, error) { + return nil, status.Errorf(codes.Unimplemented, "method GenerateClusterToken not implemented") +} +func (UnimplementedMessageOfficeInternalServer) mustEmbedUnimplementedMessageOfficeInternalServer() {} + +// UnsafeMessageOfficeInternalServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MessageOfficeInternalServer will +// result in compilation errors. +type UnsafeMessageOfficeInternalServer interface { + mustEmbedUnimplementedMessageOfficeInternalServer() +} + +func RegisterMessageOfficeInternalServer(s grpc.ServiceRegistrar, srv MessageOfficeInternalServer) { + s.RegisterService(&MessageOfficeInternal_ServiceDesc, srv) +} + +func _MessageOfficeInternal_GenerateClusterToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GenerateClusterTokenIn) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MessageOfficeInternalServer).GenerateClusterToken(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MessageOfficeInternal_GenerateClusterToken_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MessageOfficeInternalServer).GenerateClusterToken(ctx, req.(*GenerateClusterTokenIn)) + } + return interceptor(ctx, in, info, handler) +} + +// MessageOfficeInternal_ServiceDesc is the grpc.ServiceDesc for MessageOfficeInternal service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var MessageOfficeInternal_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "MessageOfficeInternal", + HandlerType: (*MessageOfficeInternalServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GenerateClusterToken", + Handler: _MessageOfficeInternal_GenerateClusterToken_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "message-office-internal.proto", +} diff --git a/grpc-interfaces/message-office-internal.proto b/grpc-interfaces/message-office-internal.proto new file mode 100644 index 000000000..30b10411e --- /dev/null +++ b/grpc-interfaces/message-office-internal.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; + +option go_package = "kloudlite.io/rpc/message-office-internal"; + +service MessageOfficeInternal { + rpc GenerateClusterToken(GenerateClusterTokenIn) returns (GenerateClusterTokenOut); +} + +message GenerateClusterTokenIn { + string accountName = 1; + string clusterName = 2; +} + +message GenerateClusterTokenOut { + string clusterToken = 1; +} diff --git a/mocks/grpc-interfaces/kloudlite.io/rpc/accounts/accountsclient.go b/mocks/grpc-interfaces/kloudlite.io/rpc/accounts/accountsclient.go new file mode 100644 index 000000000..015cfd585 --- /dev/null +++ b/mocks/grpc-interfaces/kloudlite.io/rpc/accounts/accountsclient.go @@ -0,0 +1,35 @@ +package mocks + +import ( + context "context" + accounts "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/accounts" + grpc "google.golang.org/grpc" +) + +type AccountsClientCallerInfo struct { + Args []any +} + +type AccountsClient struct { + Calls map[string][]AccountsClientCallerInfo + MockGetAccount func(ctx context.Context, in *accounts.GetAccountIn, opts ...grpc.CallOption) (*accounts.GetAccountOut, error) +} + +func (m *AccountsClient) registerCall(funcName string, args ...any) { + if m.Calls == nil { + m.Calls = map[string][]AccountsClientCallerInfo{} + } + m.Calls[funcName] = append(m.Calls[funcName], AccountsClientCallerInfo{Args: args}) +} + +func (aMock *AccountsClient) GetAccount(ctx context.Context, in *accounts.GetAccountIn, opts ...grpc.CallOption) (*accounts.GetAccountOut, error) { + if aMock.MockGetAccount != nil { + aMock.registerCall("GetAccount", ctx, in, opts) + return aMock.MockGetAccount(ctx, in, opts...) + } + panic("AccountsClient: method 'GetAccount' not implemented, yet") +} + +func NewAccountsClient() *AccountsClient { + return &AccountsClient{} +} diff --git a/mocks/grpc-interfaces/kloudlite.io/rpc/iam/iamclient.go b/mocks/grpc-interfaces/kloudlite.io/rpc/iam/iamclient.go new file mode 100644 index 000000000..578b62ed7 --- /dev/null +++ b/mocks/grpc-interfaces/kloudlite.io/rpc/iam/iamclient.go @@ -0,0 +1,107 @@ +package mocks + +import ( + context "context" + iam "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" + grpc "google.golang.org/grpc" +) + +type IAMClientCallerInfo struct { + Args []any +} + +type IAMClient struct { + Calls map[string][]IAMClientCallerInfo + MockAddMembership func(ctx context.Context, in *iam.AddMembershipIn, opts ...grpc.CallOption) (*iam.AddMembershipOut, error) + MockCan func(ctx context.Context, in *iam.CanIn, opts ...grpc.CallOption) (*iam.CanOut, error) + MockGetMembership func(ctx context.Context, in *iam.GetMembershipIn, opts ...grpc.CallOption) (*iam.GetMembershipOut, error) + MockListMembershipsForResource func(ctx context.Context, in *iam.MembershipsForResourceIn, opts ...grpc.CallOption) (*iam.ListMembershipsOut, error) + MockListMembershipsForUser func(ctx context.Context, in *iam.MembershipsForUserIn, opts ...grpc.CallOption) (*iam.ListMembershipsOut, error) + MockPing func(ctx context.Context, in *iam.Message, opts ...grpc.CallOption) (*iam.Message, error) + MockRemoveMembership func(ctx context.Context, in *iam.RemoveMembershipIn, opts ...grpc.CallOption) (*iam.RemoveMembershipOut, error) + MockRemoveResource func(ctx context.Context, in *iam.RemoveResourceIn, opts ...grpc.CallOption) (*iam.RemoveResourceOut, error) + MockUpdateMembership func(ctx context.Context, in *iam.UpdateMembershipIn, opts ...grpc.CallOption) (*iam.UpdateMembershipOut, error) +} + +func (m *IAMClient) registerCall(funcName string, args ...any) { + if m.Calls == nil { + m.Calls = map[string][]IAMClientCallerInfo{} + } + m.Calls[funcName] = append(m.Calls[funcName], IAMClientCallerInfo{Args: args}) +} + +func (iMock *IAMClient) AddMembership(ctx context.Context, in *iam.AddMembershipIn, opts ...grpc.CallOption) (*iam.AddMembershipOut, error) { + if iMock.MockAddMembership != nil { + iMock.registerCall("AddMembership", ctx, in, opts) + return iMock.MockAddMembership(ctx, in, opts...) + } + panic("IAMClient: method 'AddMembership' not implemented, yet") +} + +func (iMock *IAMClient) Can(ctx context.Context, in *iam.CanIn, opts ...grpc.CallOption) (*iam.CanOut, error) { + if iMock.MockCan != nil { + iMock.registerCall("Can", ctx, in, opts) + return iMock.MockCan(ctx, in, opts...) + } + panic("IAMClient: method 'Can' not implemented, yet") +} + +func (iMock *IAMClient) GetMembership(ctx context.Context, in *iam.GetMembershipIn, opts ...grpc.CallOption) (*iam.GetMembershipOut, error) { + if iMock.MockGetMembership != nil { + iMock.registerCall("GetMembership", ctx, in, opts) + return iMock.MockGetMembership(ctx, in, opts...) + } + panic("IAMClient: method 'GetMembership' not implemented, yet") +} + +func (iMock *IAMClient) ListMembershipsForResource(ctx context.Context, in *iam.MembershipsForResourceIn, opts ...grpc.CallOption) (*iam.ListMembershipsOut, error) { + if iMock.MockListMembershipsForResource != nil { + iMock.registerCall("ListMembershipsForResource", ctx, in, opts) + return iMock.MockListMembershipsForResource(ctx, in, opts...) + } + panic("IAMClient: method 'ListMembershipsForResource' not implemented, yet") +} + +func (iMock *IAMClient) ListMembershipsForUser(ctx context.Context, in *iam.MembershipsForUserIn, opts ...grpc.CallOption) (*iam.ListMembershipsOut, error) { + if iMock.MockListMembershipsForUser != nil { + iMock.registerCall("ListMembershipsForUser", ctx, in, opts) + return iMock.MockListMembershipsForUser(ctx, in, opts...) + } + panic("IAMClient: method 'ListMembershipsForUser' not implemented, yet") +} + +func (iMock *IAMClient) Ping(ctx context.Context, in *iam.Message, opts ...grpc.CallOption) (*iam.Message, error) { + if iMock.MockPing != nil { + iMock.registerCall("Ping", ctx, in, opts) + return iMock.MockPing(ctx, in, opts...) + } + panic("IAMClient: method 'Ping' not implemented, yet") +} + +func (iMock *IAMClient) RemoveMembership(ctx context.Context, in *iam.RemoveMembershipIn, opts ...grpc.CallOption) (*iam.RemoveMembershipOut, error) { + if iMock.MockRemoveMembership != nil { + iMock.registerCall("RemoveMembership", ctx, in, opts) + return iMock.MockRemoveMembership(ctx, in, opts...) + } + panic("IAMClient: method 'RemoveMembership' not implemented, yet") +} + +func (iMock *IAMClient) RemoveResource(ctx context.Context, in *iam.RemoveResourceIn, opts ...grpc.CallOption) (*iam.RemoveResourceOut, error) { + if iMock.MockRemoveResource != nil { + iMock.registerCall("RemoveResource", ctx, in, opts) + return iMock.MockRemoveResource(ctx, in, opts...) + } + panic("IAMClient: method 'RemoveResource' not implemented, yet") +} + +func (iMock *IAMClient) UpdateMembership(ctx context.Context, in *iam.UpdateMembershipIn, opts ...grpc.CallOption) (*iam.UpdateMembershipOut, error) { + if iMock.MockUpdateMembership != nil { + iMock.registerCall("UpdateMembership", ctx, in, opts) + return iMock.MockUpdateMembership(ctx, in, opts...) + } + panic("IAMClient: method 'UpdateMembership' not implemented, yet") +} + +func NewIAMClient() *IAMClient { + return &IAMClient{} +} diff --git a/mocks/grpc-interfaces/kloudlite.io/rpc/message-office-internal/messageofficeinternalclient.go b/mocks/grpc-interfaces/kloudlite.io/rpc/message-office-internal/messageofficeinternalclient.go new file mode 100644 index 000000000..57f1b062f --- /dev/null +++ b/mocks/grpc-interfaces/kloudlite.io/rpc/message-office-internal/messageofficeinternalclient.go @@ -0,0 +1,35 @@ +package mocks + +import ( + context "context" + message_office_internal "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/message-office-internal" + grpc "google.golang.org/grpc" +) + +type MessageOfficeInternalClientCallerInfo struct { + Args []any +} + +type MessageOfficeInternalClient struct { + Calls map[string][]MessageOfficeInternalClientCallerInfo + MockGenerateClusterToken func(ctx context.Context, in *message_office_internal.GenerateClusterTokenIn, opts ...grpc.CallOption) (*message_office_internal.GenerateClusterTokenOut, error) +} + +func (m *MessageOfficeInternalClient) registerCall(funcName string, args ...any) { + if m.Calls == nil { + m.Calls = map[string][]MessageOfficeInternalClientCallerInfo{} + } + m.Calls[funcName] = append(m.Calls[funcName], MessageOfficeInternalClientCallerInfo{Args: args}) +} + +func (mMock *MessageOfficeInternalClient) GenerateClusterToken(ctx context.Context, in *message_office_internal.GenerateClusterTokenIn, opts ...grpc.CallOption) (*message_office_internal.GenerateClusterTokenOut, error) { + if mMock.MockGenerateClusterToken != nil { + mMock.registerCall("GenerateClusterToken", ctx, in, opts) + return mMock.MockGenerateClusterToken(ctx, in, opts...) + } + panic("MessageOfficeInternalClient: method 'GenerateClusterToken' not implemented, yet") +} + +func NewMessageOfficeInternalClient() *MessageOfficeInternalClient { + return &MessageOfficeInternalClient{} +} diff --git a/mocks/pkg/k8s/client.go b/mocks/pkg/k8s/client.go new file mode 100644 index 000000000..d30d86aa0 --- /dev/null +++ b/mocks/pkg/k8s/client.go @@ -0,0 +1,62 @@ +package mocks + +import ( + context "context" + types "k8s.io/apimachinery/pkg/types" + client "sigs.k8s.io/controller-runtime/pkg/client" +) + +type ClientCallerInfo struct { + Args []any +} + +type Client struct { + Calls map[string][]ClientCallerInfo + MockApplyYAML func(ctx context.Context, yamls ...[]byte) error + MockDeleteYAML func(ctx context.Context, yamls ...[]byte) error + MockGet func(ctx context.Context, nn types.NamespacedName, obj client.Object) error + MockValidateObject func(ctx context.Context, obj client.Object) error +} + +func (m *Client) registerCall(funcName string, args ...any) { + if m.Calls == nil { + m.Calls = map[string][]ClientCallerInfo{} + } + m.Calls[funcName] = append(m.Calls[funcName], ClientCallerInfo{Args: args}) +} + +func (cMock *Client) ApplyYAML(ctx context.Context, yamls ...[]byte) error { + if cMock.MockApplyYAML != nil { + cMock.registerCall("ApplyYAML", ctx, yamls) + return cMock.MockApplyYAML(ctx, yamls...) + } + panic("Client: method 'ApplyYAML' not implemented, yet") +} + +func (cMock *Client) DeleteYAML(ctx context.Context, yamls ...[]byte) error { + if cMock.MockDeleteYAML != nil { + cMock.registerCall("DeleteYAML", ctx, yamls) + return cMock.MockDeleteYAML(ctx, yamls...) + } + panic("Client: method 'DeleteYAML' not implemented, yet") +} + +func (cMock *Client) Get(ctx context.Context, nn types.NamespacedName, obj client.Object) error { + if cMock.MockGet != nil { + cMock.registerCall("Get", ctx, nn, obj) + return cMock.MockGet(ctx, nn, obj) + } + panic("Client: method 'Get' not implemented, yet") +} + +func (cMock *Client) ValidateObject(ctx context.Context, obj client.Object) error { + if cMock.MockValidateObject != nil { + cMock.registerCall("ValidateObject", ctx, obj) + return cMock.MockValidateObject(ctx, obj) + } + panic("Client: method 'ValidateObject' not implemented, yet") +} + +func NewClient() *Client { + return &Client{} +} diff --git a/.tools/__http__/consolev2/routers.graphql.yml b/mocks/pkg/repos/dbrepo.go similarity index 100% rename from .tools/__http__/consolev2/routers.graphql.yml rename to mocks/pkg/repos/dbrepo.go diff --git a/pkg/agent/sender.go b/pkg/agent/sender.go deleted file mode 100644 index a534c1dee..000000000 --- a/pkg/agent/sender.go +++ /dev/null @@ -1,26 +0,0 @@ -package agent - -import ( - "context" - "encoding/json" - - "kloudlite.io/pkg/redpanda" -) - -type sender struct { - producer redpanda.Producer -} - -func (s *sender) Dispatch(ctx context.Context, topic string, key string, msg Message) (*redpanda.ProducerOutput, error) { - m, err := json.Marshal(msg) - if err != nil { - return nil, err - } - return s.producer.Produce(ctx, topic, key, m) -} - -func NewSender(producer redpanda.Producer) Sender { - return &sender{ - producer: producer, - } -} diff --git a/pkg/agent/types.go b/pkg/agent/types.go deleted file mode 100644 index b186abb80..000000000 --- a/pkg/agent/types.go +++ /dev/null @@ -1,23 +0,0 @@ -package agent - -import ( - "context" - - "kloudlite.io/pkg/redpanda" -) - -type Action string - -const ( - Apply Action = "apply" - Delete Action = "delete" -) - -type Message struct { - Action Action - Yamls []byte -} - -type Sender interface { - Dispatch(ctx context.Context, topic string, key string, msg Message) (*redpanda.ProducerOutput, error) -} diff --git a/pkg/aws-s3/main.go b/pkg/aws-s3/main.go new file mode 100644 index 000000000..804978f71 --- /dev/null +++ b/pkg/aws-s3/main.go @@ -0,0 +1,181 @@ +package awss3 + +import ( + "fmt" + "github.com/kloudlite/api/pkg/errors" + "hash/fnv" + "io" + "os" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/service/s3" +) + +type AwsS3 interface { + DownloadFile(filePath, fileKey string) error + UploadFile(filePath, fileKey string) error + IsFileExists(fileKey string) error +} + +func (a awsS3) DeleteFile(fileKey string) error { + fmt.Printf("\n[#] deleting file %s\n", fileKey) + defer fmt.Printf("\n[#] deleted file %s\n", fileKey) + + // Delete the file from the bucket + _, err := a.svc.DeleteObject(&s3.DeleteObjectInput{ + Bucket: aws.String(a.bucketName), + Key: aws.String(fileKey), + }) + if err != nil { + return errors.NewE(err) + } + + return nil +} + +func (a awsS3) createBucket() error { + fmt.Printf("\n[#] creating bucket %s\n", a.bucketName) + defer fmt.Printf("\n[#] created bucket %s\n", a.bucketName) + + _, err := a.svc.CreateBucket(&s3.CreateBucketInput{ + Bucket: aws.String(a.bucketName), + }) + if err != nil { + return errors.NewE(err) + } + + return nil +} + +func (a awsS3) IsFileExists(fileKey string) error { + _, err := a.svc.HeadObject(&s3.HeadObjectInput{ + Bucket: aws.String(a.bucketName), + Key: aws.String(fileKey), + }) + if err != nil { + // If the file does not exist or there is an error, handle the error + // fmt.Println(err) + return errors.NewE(err) + } + return nil +} + +func (a awsS3) checkS3Created() error { + _, err := a.svc.HeadBucket(&s3.HeadBucketInput{ + Bucket: aws.String(a.bucketName), + }) + if err != nil { + return errors.NewE(err) + } + return nil +} + +func (a awsS3) createBucketIfNotCreated() error { + if err := a.checkS3Created(); err != nil { + return a.createBucket() + } + return nil +} + +func getS3Client(accessKey, accessSecret string) (*s3.S3, error) { + sess, err := session.NewSession(&aws.Config{ + Region: aws.String("us-west-1"), // Replace with your desired region + Credentials: credentials.NewStaticCredentials(accessKey, accessSecret, ""), + }) + if err != nil { + return nil, errors.NewE(err) + } + + return s3.New(sess), nil +} + +type awsS3 struct { + svc *s3.S3 + bucketName string +} + +// downloadFile implements AwsS3. +func (a awsS3) DownloadFile(filePath, fileKey string) error { + fmt.Printf("\n[#] downloading file %s\n", fileKey) + defer fmt.Printf("\n[#] downloaded file %s\n", fileKey) + + file, err := os.Create(filePath) + if err != nil { + return errors.NewE(err) + } + defer func() { + if err:=file.Close(); err!=nil { + fmt.Printf("\n[#] error closing file %s\n", fileKey) + } + }() + + // Download the file from S3 + resp, err := a.svc.GetObject(&s3.GetObjectInput{ + Bucket: aws.String(a.bucketName), + Key: aws.String(fileKey), + }) + if err != nil { + return errors.NewE(err) + } + + // Write the downloaded file data to the file + _, err = io.Copy(file, resp.Body) + if err != nil { + return errors.NewE(err) + } + return nil +} + +// uploadFile implements AwsS3. +func (a awsS3) UploadFile(filePath, fileKey string) error { + fmt.Printf("\n[#] uploading file %s\n", fileKey) + defer fmt.Printf("\n[#] uploaded file %s\n", fileKey) + + file, err := os.Open(filePath) + if err != nil { + return errors.NewE(err) + } + defer func() { + if err := file.Close(); err != nil { + fmt.Printf("\n[#] error closing file %s\n", fileKey) + } + }() + + _, err = a.svc.PutObject(&s3.PutObjectInput{ + Bucket: aws.String(a.bucketName), + Key: aws.String(fileKey), + Body: file, + }) + if err != nil { + return errors.NewE(err) + } + + return nil +} + +func hash(s string) uint32 { + h := fnv.New32a() + if _, err := h.Write([]byte(s)); err != nil { + fmt.Printf("error hashing string %s\n", s) + } + return h.Sum32() +} + +func NewAwsS3Client(accessKey, accessSec, bucketName string) (AwsS3, error) { + svc, err := getS3Client(accessKey, accessSec) + if err != nil { + return nil, errors.NewE(err) + } + + a := awsS3{ + svc: svc, + bucketName: fmt.Sprintf("kloudlite-%s-%d", bucketName, hash(bucketName)), + } + if err := a.createBucketIfNotCreated(); err != nil { + return nil, errors.NewE(err) + } + + return a, nil +} diff --git a/pkg/beacon/api.go b/pkg/beacon/api.go index e64407cce..b145d55dc 100644 --- a/pkg/beacon/api.go +++ b/pkg/beacon/api.go @@ -2,10 +2,10 @@ package beacon import ( "context" - "kloudlite.io/pkg/repos" + "github.com/kloudlite/api/pkg/repos" ) type Beacon interface { TriggerEvent(ctx context.Context, accountId repos.ID, event *AuditLogEvent) error - TriggerWithUserCtx(ctx context.Context, accountId repos.ID, act EventAction) + TriggerWithUserCtx(ctx context.Context, accountId repos.ID, act EventAction) error } diff --git a/pkg/beacon/audit-events.go b/pkg/beacon/audit-events.go index d3db0bb8b..bd55676e7 100644 --- a/pkg/beacon/audit-events.go +++ b/pkg/beacon/audit-events.go @@ -4,12 +4,13 @@ import ( "context" "encoding/json" "fmt" - "kloudlite.io/common" - "kloudlite.io/constants" - "kloudlite.io/pkg/errors" - httpServer "kloudlite.io/pkg/http-server" - "kloudlite.io/pkg/redpanda" - "kloudlite.io/pkg/repos" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/constants" + "github.com/kloudlite/api/pkg/errors" + httpServer "github.com/kloudlite/api/pkg/http-server" + "github.com/kloudlite/api/pkg/messaging" + "github.com/kloudlite/api/pkg/messaging/types" + "github.com/kloudlite/api/pkg/repos" "time" ) @@ -18,22 +19,22 @@ type EventTarget struct { ResourceId repos.ID `json:"resourceId" bson:"resourceId"` } -type status struct { +type Status struct { Value string `json:"value" bson:"value"` Message string `json:"message" bson:"message"` } -func StatusOK() status { - return status{Value: "OK"} +func StatusOK() Status { + return Status{Value: "OK"} } -func StatusError(err error) status { - return status{Value: "ERROR", Message: err.Error()} +func StatusError(err error) Status { + return Status{Value: "ERROR", Message: err.Error()} } type EventAction struct { Action constants.Action `json:"action" bson:"action"` - Status status `json:"status" bson:"status"` + Status Status `json:"status" bson:"status"` ResourceType constants.ResourceType `json:"resourceType" bson:"resourceType"` ResourceId repos.ID `json:"resourceId" bson:"resourceId"` Tags map[string]string `json:"tags" bson:"tags"` @@ -51,7 +52,7 @@ type AuditLogEvent struct { } type beacon struct { - producer redpanda.Producer + producer messaging.Producer topic string } @@ -67,7 +68,7 @@ func getSession(ctx context.Context) (*common.AuthSession, error) { func (b *beacon) TriggerEvent(ctx context.Context, accountId repos.ID, event *AuditLogEvent) error { eventB, err := json.Marshal(event) if err != nil { - return err + return errors.NewE(err) } if event.Tags == nil { @@ -81,9 +82,11 @@ func (b *beacon) TriggerEvent(ctx context.Context, accountId repos.ID, event *Au event.Tags["user-agent"] = ua } } - _, err = b.producer.Produce(ctx, b.topic, string(accountId), eventB) - if err != nil { - return err + if err := b.producer.Produce(ctx, types.ProduceMsg{ + Subject: b.topic, + Payload: eventB, + }); err != nil { + return errors.NewE(err) } return nil } @@ -92,10 +95,10 @@ func defaultDesc(action, resType, resId string) string { return fmt.Sprintf("performed [action=%s] on target [type=%s, id=%s]", action, resType, resId) } -func (b *beacon) TriggerWithUserCtx(ctx context.Context, accountId repos.ID, act EventAction) { +func (b *beacon) TriggerWithUserCtx(ctx context.Context, accountId repos.ID, act EventAction) error { session, err := getSession(ctx) if err != nil { - return + return errors.NewE(err) } ale := AuditLogEvent{ @@ -127,15 +130,18 @@ func (b *beacon) TriggerWithUserCtx(ctx context.Context, accountId repos.ID, act eventB, err := json.Marshal(ale) if err != nil { - return + return errors.NewE(err) } - _, err = b.producer.Produce(ctx, b.topic, string(accountId), eventB) - if err != nil { - return + if err := b.producer.Produce(ctx, types.ProduceMsg{ + Subject: b.topic, + Payload: eventB, + }); err != nil { + return errors.NewE(err) } - return + + return nil } -func NewBeacon(producer redpanda.Producer, topic string) Beacon { +func NewBeacon(producer messaging.Producer, topic string) Beacon { return &beacon{producer: producer, topic: topic} } diff --git a/pkg/config/env.go b/pkg/config/env.go index 4d0bc114d..63dc0a3a0 100644 --- a/pkg/config/env.go +++ b/pkg/config/env.go @@ -1,7 +1,7 @@ package config import ( - "fmt" + "github.com/kloudlite/api/pkg/errors" "go.uber.org/fx" "github.com/codingconcepts/env" @@ -12,9 +12,9 @@ func LoadEnv[T any]() func() (*T, error) { var x T err := env.Set(&x) if err != nil { - return nil, fmt.Errorf("not able to load ENV: %v", err) + return nil, errors.Newf("not able to load ENV: %v", err) } - return &x, err + return &x, errors.NewE(err) } } diff --git a/pkg/dns/main.go b/pkg/dns/main.go deleted file mode 100644 index 5b987151a..000000000 --- a/pkg/dns/main.go +++ /dev/null @@ -1,77 +0,0 @@ -package dns - -import ( - "context" - "fmt" - "log" - "net" - "strconv" - - "github.com/miekg/dns" - "go.uber.org/fx" -) - -var domainsToAddresses map[string]string = map[string]string{ - "google.com.": "1.2.3.4", - "jameshfisher.com.": "104.198.14.52", -} - -type handler struct{} - -func (h *handler) ServeDNS(w dns.ResponseWriter, r *dns.Msg) { - msg := dns.Msg{} - msg.SetReply(r) - switch r.Question[0].Qtype { - case dns.TypeA: - msg.Authoritative = true - domain := msg.Question[0].Name - address, ok := domainsToAddresses[domain] - if ok { - msg.Answer = append(msg.Answer, &dns.A{ - Hdr: dns.RR_Header{Name: domain, Rrtype: dns.TypeA, Class: dns.ClassINET, Ttl: 60}, - A: net.ParseIP(address), - }) - } - } - w.WriteMsg(&msg) -} - -func NewServer(port uint16) *dns.Server { - srv := &dns.Server{Addr: fmt.Sprintf(":%d", port), Net: "udp"} - srv.Handler = &handler{} - return srv -} - -type ServerOptions interface { - GetDNSPort() uint16 -} - -func Fx[T ServerOptions]() fx.Option { - return fx.Module( - "dns", fx.Provide(func(env T) *dns.Server { - return NewServer(env.GetDNSPort()) - }), - fx.Invoke(func(lifecycle fx.Lifecycle, s *dns.Server) { - lifecycle.Append(fx.Hook{ - OnStart: func(ctx context.Context) error { - go func() error { - if err := s.ListenAndServe(); err != nil { - log.Fatalf("Failed to set udp listener %s\n", err.Error()) - return err - } - return nil - }() - return nil - }, - }) - }), - ) -} - -func main() { - srv := &dns.Server{Addr: ":" + strconv.Itoa(53), Net: "udp"} - srv.Handler = &handler{} - if err := srv.ListenAndServe(); err != nil { - log.Fatalf("Failed to set udp listener %s\n", err.Error()) - } -} diff --git a/pkg/docker/main.go b/pkg/docker/main.go new file mode 100644 index 000000000..30fa20e70 --- /dev/null +++ b/pkg/docker/main.go @@ -0,0 +1,58 @@ +package docker + +import ( + "fmt" + "github.com/kloudlite/api/pkg/errors" + "io" + "log" + "net/http" +) + +type Docker interface { + DeleteDigest(repoName string, tagName string) error +} + +type docker struct { + registryUrl string +} + +func (d *docker) DeleteDigest(repoName string, refrence string) error { + uri := fmt.Sprintf("%s/v2/%s/manifests/%s", d.registryUrl, repoName, refrence) + req, err := http.NewRequest("DELETE", uri, nil) + + // create a new HTTP client + client := &http.Client{} + + // send the request + resp, err := client.Do(req) + if err != nil { + return errors.NewE(err) + } + defer func() { + if err := resp.Body.Close(); err != nil { + log.Println(err) + } + }() + + if resp.StatusCode != 202 { + fmt.Println(uri) + return errors.Newf("failed to delete tag %s:%s: %s", repoName, refrence, resp.Status) + } + + // read the response body + body, err := io.ReadAll(resp.Body) + if err != nil { + return errors.NewE(err) + } + + // print the response body + log.Println(string(body)) + + return nil +} + +func NewDockerClient(registryUrl string) Docker { + return &docker{ + registryUrl: registryUrl, + } +} diff --git a/pkg/errors/main.go b/pkg/errors/main.go index 5fbfcded8..37820832c 100644 --- a/pkg/errors/main.go +++ b/pkg/errors/main.go @@ -4,8 +4,9 @@ import ( "fmt" "net/http" + "github.com/ztrue/tracerr" + "github.com/pkg/errors" - "github.com/yext/yerrors" ) func HandleErr(e *error) { @@ -33,8 +34,12 @@ func Is(err error, target error) bool { return errors.Is(err, target) } +func As(err error, target any) bool { + return errors.As(err, target) +} + func NewEf(err error, msg string, args ...any) error { - return yerrors.WrapFrame(yerrors.Errorf("%s while %s", fmt.Sprintf(msg, args...), err.Error()), 1) + return tracerr.Wrap(fmt.Errorf("%s while %s", fmt.Sprintf(msg, args...), err.Error())) } func ErrMarshal(err error) error { @@ -43,17 +48,20 @@ func ErrMarshal(err error) error { func Newf(msg string, a ...any) error { if len(a) > 0 { - return yerrors.WrapFrame(yerrors.Errorf(msg, a...), 1) + return tracerr.Wrap(fmt.Errorf(msg, a...)) } - return yerrors.New(msg) + return tracerr.New(msg) } func NewE(err error) error { - return yerrors.Wrap(err) + if err == nil { + return nil + } + return tracerr.Wrap(err) } func New(msg string) error { - return yerrors.Wrap(yerrors.New(msg)) + return tracerr.Wrap(tracerr.New(msg)) } var NotLoggedIn error = fmt.Errorf("%d Not LoggedIn", http.StatusUnauthorized) diff --git a/pkg/functions/fx-error-handler.go b/pkg/functions/fx-error-handler.go index 844bc4ca0..e52f82df7 100644 --- a/pkg/functions/fx-error-handler.go +++ b/pkg/functions/fx-error-handler.go @@ -1,22 +1,26 @@ package functions import ( + "github.com/kloudlite/api/pkg/logging" "go.uber.org/fx" - "kloudlite.io/pkg/logging" ) -type errH struct { - logger logging.Logger +type ErrH struct { + Logger logging.Logger } -func (e errH) HandleError(err error) { - e.logger.Errorf(err) +func (e *ErrH) HandleError(err error) { + e.Logger.Errorf(err) +} + +func (e *ErrH) String() string { + return "err-handler" } func FxErrorHandler() fx.Option { return fx.Provide( func(logger logging.Logger) fx.Option { - return fx.ErrorHook(errH{logger: logger}) + return fx.ErrorHook(&ErrH{Logger: logger.WithKV("component", "fx-error-handler")}) }, ) } diff --git a/pkg/functions/k8s-utils.go b/pkg/functions/k8s-utils.go index d3ff4f541..f4357c86f 100644 --- a/pkg/functions/k8s-utils.go +++ b/pkg/functions/k8s-utils.go @@ -2,7 +2,11 @@ package functions import ( "encoding/json" + "github.com/kloudlite/api/pkg/errors" + "regexp" + "github.com/kloudlite/api/constants" + "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/yaml" @@ -19,12 +23,27 @@ func K8sObjToYAML(obj client.Object) ([]byte, error) { func K8sObjToMap(obj client.Object) (map[string]any, error) { b, err := json.Marshal(obj) if err != nil { - return nil, err + return nil, errors.NewE(err) } var m map[string]any if err := json.Unmarshal(b, &m); err != nil { - return nil, err + return nil, errors.NewE(err) } return m, nil } + +var nameValidator *regexp.Regexp = regexp.MustCompile(constants.K8sNameValidatorRegex) + +func IsValidK8sResourceName(name string) bool { + return nameValidator.Match([]byte(name)) +} + +func GVK(apiVersion string, kind string) schema.GroupVersionKind { + gv, _ := schema.ParseGroupVersion(apiVersion) + return schema.GroupVersionKind{ + Group: gv.Group, + Version: gv.Version, + Kind: kind, + } +} diff --git a/pkg/functions/main.go b/pkg/functions/main.go index 54d13f038..e1780bec6 100644 --- a/pkg/functions/main.go +++ b/pkg/functions/main.go @@ -3,54 +3,27 @@ package functions import ( "encoding/base64" "encoding/json" - "fmt" "regexp" "strings" + "github.com/kloudlite/api/pkg/errors" nanoid "github.com/matoous/go-nanoid/v2" - "kloudlite.io/pkg/errors" ) -func NewBool(b bool) *bool { - return &b -} - -type JsonFeatures interface { - ToB64Url(v interface{}) (string, error) - ToB64String(v interface{}) (string, error) - FromB64Url(s string, v interface{}) error -} - -type jsonFeatures struct{} - -func (j *jsonFeatures) ToB64Url(v interface{}) (string, error) { - b, e := json.Marshal(v) - return base64.URLEncoding.EncodeToString(b), e -} - -func (j *jsonFeatures) ToB64String(v interface{}) (string, error) { - b, e := json.Marshal(v) - return base64.StdEncoding.EncodeToString(b), e -} - -func (j *jsonFeatures) FromB64Url(s string, v interface{}) error { - b, err := base64.URLEncoding.DecodeString(s) - if err != nil { - return errors.NewEf(err, "not a valid b64-url string") - } - err = json.Unmarshal(b, &v) +func ToBase64StringFromJson(v interface{}) (string, error) { + b, err := json.Marshal(v) if err != nil { - return errors.NewEf(err, "could not unmarshal") + return "", errors.NewE(err) } - - return nil + return base64.StdEncoding.EncodeToString(b), nil } -var Json = &jsonFeatures{} - -func ToBase64StringFromJson(v interface{}) (string, error) { - b, e := json.Marshal(v) - return base64.StdEncoding.EncodeToString(b), e +func ToBase64UrlFromJson(v interface{}) (string, error) { + b, err := json.Marshal(v) + if err != nil { + return "", errors.NewE(err) + } + return base64.URLEncoding.EncodeToString(b), nil } func Must[T any](value T, err error) T { @@ -91,7 +64,7 @@ func JsonConversion(from any, to any) error { } if to == nil { - return fmt.Errorf("receiver (to) is nil") + return errors.Newf("receiver (to) is nil") } b, err := json.Marshal(from) @@ -99,7 +72,41 @@ func JsonConversion(from any, to any) error { return nil } if err := json.Unmarshal(b, &to); err != nil { - return err + return errors.NewE(err) } return nil } + +func JsonConvertP[T any](from any) (*T, error) { + var to T + if from == nil { + return nil, nil + } + + b, err := json.Marshal(from) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(b, &to); err != nil { + return nil, errors.NewE(err) + } + return &to, nil +} + +func JsonConvert[T any](from any) (T, error) { + var to T + if from == nil { + return to, nil + } + + b, err := json.Marshal(from) + if err != nil { + return to, err + } + + if err := json.Unmarshal(b, &to); err != nil { + return to, errors.NewE(err) + } + return to, nil +} diff --git a/pkg/functions/readable-name-gen.go b/pkg/functions/readable-name-gen.go index f45a977e6..e9ea0acb2 100644 --- a/pkg/functions/readable-name-gen.go +++ b/pkg/functions/readable-name-gen.go @@ -5,17 +5,43 @@ import ( "math" "math/rand" "regexp" + "strings" ) -func GenReadableName(seed string) string { +var generator *regexp.Regexp = regexp.MustCompile(`^([[:lower:]]|[[:digit:]]|-)*`) + +// GenReadableName generates a readable name from a given string (seed). +// It finds matches in the seed following regex `^([[:lower:]]|[[:digit:]]|-)*`. +// It also limits maximum match text length to 20 (by default) +func GenReadableName(seed string, maxMatchLen ...int) string { if seed == "" { return "" } + maxLength := 20 + if len(maxMatchLen) > 0 { + maxLength = maxMatchLen[0] + } - re := regexp.MustCompile(`^(\w[a-z]+)([^a-z].*)`) - sp := re.FindStringSubmatch(seed) + sp := generator.FindStringSubmatch(strings.ToLower(seed)) if len(sp) > 0 { - return fmt.Sprintf("%s-%d", sp[1], rand.Intn(999999)) + return fmt.Sprintf("%s-%d", sp[0][:int(math.Min(float64(maxLength), float64(len(sp[0]))))], rand.Intn(999999)) } return fmt.Sprintf("%s-%d", seed[0:int(math.Min(float64(10), float64(len(seed))))], rand.Intn(999999)) } + +// GenValidK8sResourceNames generates a list of valid k8s resource names from a given string (seed). +// It makes use of GenReadableName to generate a readable name from the seed. +// It also checks if the generated name is valid k8s resource name. + +// TODO (nxtcoder17): need to benchmark this function +func GenValidK8sResourceNames(seed string, count int) []string { + names := make([]string, count) + for i := 0; i < count; i++ { + gn := GenReadableName(seed) + for !IsValidK8sResourceName(gn) { + gn = GenReadableName(gn) + } + names[i] = gn + } + return names +} diff --git a/pkg/functions/readable-name-gen_test.go b/pkg/functions/readable-name-gen_test.go index 7a66745b0..4bdeb15d4 100644 --- a/pkg/functions/readable-name-gen_test.go +++ b/pkg/functions/readable-name-gen_test.go @@ -16,27 +16,24 @@ func TestGenReadableName(t *testing.T) { }{ // TODO: Add test cases. {name: "seed with space", args: args{seed: "hello world"}, want: "hello-"}, - {name: "seed with camelcase", args: args{seed: "helloWorld"}, want: "hello-"}, - {name: "seed with hyphen", args: args{seed: "hello-world"}, want: "hello-"}, + {name: "seed with camelcase", args: args{seed: "helloWorld"}, want: "helloworld-"}, + {name: "seed with hyphen", args: args{seed: "hello-world"}, want: "hello-world"}, {name: "seed with dot", args: args{seed: "hello.world"}, want: "hello-"}, {name: "seed with underscore", args: args{seed: "hello_world"}, want: "hello-"}, - {name: "seed with numbers", args: args{seed: "hello123"}, want: "hello-"}, + {name: "seed with numbers", args: args{seed: "hello123"}, want: "hello123-"}, // from chatgpt {name: "seed with single word", args: args{seed: "hello"}, want: "hello-"}, - {name: "empty seed", args: args{seed: ""}}, - {name: "super long seed", args: args{seed: "supercalifragilisticexpialidocious"}, want: "supercalif-"}, + {name: "empty seed", args: args{seed: ""}, want: ""}, + {name: "super long seed", args: args{seed: "supercalifragilisticexpialidocious"}, want: "supercalifragilistic-"}, } - for _, tt := range tests { + for _, _tt := range tests { + tt := _tt t.Run(tt.name, func(t *testing.T) { + t.Parallel() got := GenReadableName(tt.args.seed) - if strings.HasPrefix(got, "-") { - t.Errorf("GenReadableName() = %v, want %q as prefix, can not get strings starting with -", got, tt.want) - } - if tt.args.seed == "" { - if len(got) == 0 { - t.Errorf("GenReadableName(%q) = %q, must give some generated string, instead of empty string", tt.args.seed, got) - } + if got != "" && !IsValidK8sResourceName(got) { + t.Errorf("got %q, which is not a valid k8s resource name", got) } if !strings.HasPrefix(got, tt.want) { t.Errorf("GenReadableName() = %v, want %q as prefix", got, tt.want) diff --git a/pkg/functions/strings.go b/pkg/functions/strings.go new file mode 100644 index 000000000..a7e6e5eb3 --- /dev/null +++ b/pkg/functions/strings.go @@ -0,0 +1,9 @@ +package functions + +func StringReverse(x string) string { + runes := []rune(x) + for i := 0; i < len(runes)/2; i += 1 { + runes[i], runes[len(runes)-i-1] = runes[len(runes)-i-1], runes[i] + } + return string(runes) +} diff --git a/pkg/functions/strings_test.go b/pkg/functions/strings_test.go new file mode 100644 index 000000000..ea4d67f84 --- /dev/null +++ b/pkg/functions/strings_test.go @@ -0,0 +1,41 @@ +package functions_test + +import ( + "testing" + + fn "github.com/kloudlite/api/pkg/functions" +) + +func TestReverse(t *testing.T) { + type args struct { + x string + } + tests := []struct { + name string + args args + want string + }{ + { + name: "sample", + args: args{x: "sample"}, + want: "elpmas", + }, + { + name: "sample2133", + args: args{x: "sample2133"}, + want: "3312elpmas", + }, + { + name: "sample.2133435", + args: args{x: "sample.2133435"}, + want: "5343312.elpmas", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := fn.StringReverse(tt.args.x); got != tt.want { + t.Errorf("StringReverse() = %v, want %v", got, tt.want) + } + }) + } +} diff --git a/pkg/functions/utils.go b/pkg/functions/utils.go index 6e0d04926..256b5f451 100644 --- a/pkg/functions/utils.go +++ b/pkg/functions/utils.go @@ -39,8 +39,16 @@ func New[T any](v T) *T { return &v } +// IsNil is useful when checking for a typed pointer +// for primitive types, use v == nil +func IsNil[T any](v T) bool { + var x T + return func(a, b any) bool { + return a == b + }(v, x) +} + // RegularPlural is copied from https://github.com/kubernetes-sigs/kubebuilder/blob/afce6a0e8c2a6d5682be07bbe502e728dd619714/pkg/model/resource/utils.go#L71 func RegularPlural(singular string) string { return flect.Pluralize(strings.ToLower(singular)) } - diff --git a/pkg/gql-types-generator/main.go b/pkg/gql-types-generator/main.go deleted file mode 100644 index f7d19bd54..000000000 --- a/pkg/gql-types-generator/main.go +++ /dev/null @@ -1,227 +0,0 @@ -package gqltypesgenerator - -import ( - "fmt" - "reflect" - "strings" -) - -func GenerateGraphQLTypes(inputs []interface{}, notReqTypes []string) string { - // var sb strings.Builder - seenTypes := make(map[reflect.Type]bool) - - if notReqTypes == nil { - notReqTypes = []string{"Time", "-", "RawJson", "Location", "zone", "zoneTrans", "creation_time", "update_time", "FieldsV1"} - } - - res := "" - - for i, _ := range inputs { - op1, op2 := generateGraphQLTypesRecursive(reflect.TypeOf(inputs[i]), seenTypes, false, notReqTypes) - res += op1 + op2 - } - - return res - -} - -func isNeeded(fieldName string, notReqTypes []string) bool { - - for _, v := range notReqTypes { - if fieldName == v { - return false - } - } - - return true -} - -func generateGraphQLTypesRecursive(t reflect.Type, seenTypes map[reflect.Type]bool, onlyMembers bool, notReqTypes []string) (string, string) { - // fmt.Printf("%s", seenTypes) - - // main string - res := "" - - if t.Kind() == reflect.Ptr { - t = t.Elem() - } - - if seenTypes[t] { - return res, "" - } - - // fmt.Println(t) - - seenTypes[t] = true - - if t.Kind() == reflect.Struct { - - typeName := t.Name() - - if typeName == "" { - // If the type doesn't have a name, use the name of the parent struct and the field name - parentType := t.Field(0).Type - if parentType.Kind() == reflect.Ptr { - parentType = parentType.Elem() - } - typeName = fmt.Sprintf("%s%s", parentType.Name(), strings.Title(t.Field(0).Name)) - } - - res2 := "" - res3 := "" - res4 := "" - res5 := "" - res6 := "" - - // fmt.Println(sb) - for i := 0; i < t.NumField(); i++ { - - field := t.Field(i) - fieldName := field.Tag.Get("json") - if fieldName == "" { - fieldName = field.Name - } else if fieldName == ",inline" { - op1, op2 := generateGraphQLTypesRecursive(field.Type, seenTypes, true, notReqTypes) - // fmt.Println(op2, field.Name) - - res4 += op1 - res6 += op2 - continue - } else if s := strings.Split(fieldName, ","); len(s) == 2 && s[1] == "omitempty" { - // fmt.Println("yes", fieldName) - fieldName = s[0] - } - - if !isNeeded(fieldName, notReqTypes) { - continue - } - - // fmt.Println("here1", typeName) - fieldType := getGraphQLType(field.Type, seenTypes) - - if !isNeeded(fieldType, notReqTypes) { - // either continue - // continue - // or use String - fieldType = "String" - } - - res2 += fmt.Sprintf("\t%s: %s%s\n", fieldName, fieldType, getGraphQLRequired(field)) - - mT := field.Type - for { - if mT.Kind() != reflect.Ptr { - break - } - mT = mT.Elem() - } - - if mT.Kind() == reflect.Struct { - op1, op2 := generateGraphQLTypesRecursive(field.Type, seenTypes, false, notReqTypes) - res3 += op1 - res6 += op2 - // + op2 - } else if mT.Kind() == reflect.Slice || mT.Kind() == reflect.Array { - - op1, op2 := generateGraphQLTypesRecursive(mT.Elem(), seenTypes, false, notReqTypes) - res3 += op1 - res6 += op2 - } - - } - - if isNeeded(typeName, notReqTypes) { - if !onlyMembers { - if res4 != "" || res2 != "" { - res += fmt.Sprintf("type %s {\n", typeName) - - res += res2 - // res += res5 - res += res6 - - res += "}\n\n" - - res += res4 - } else { - res += fmt.Sprintf("type %s String\n\n", typeName) - } - } else { - // fmt.Println(res2, typeName) - res5 += res2 - res5 += res6 - res5 += res4 - } - } else { - res5 += res6 - } - - // fmt.Println(res5) - - res += res3 - - return res, res5 - } - - return "", "" -} - -func getGraphQLType(t reflect.Type, seenTypes map[reflect.Type]bool) string { - tObj := t - if t.Kind() == reflect.Ptr { - tObj = t.Elem() - } - - // switch tObj.Name() { - // case "Time": - // return "String" - // } - - switch tObj.Kind() { - case reflect.String: - return "String" - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return "Int" - case reflect.Uint, reflect.Uint64, reflect.Uint8, reflect.Uint32: - return "Int" - case reflect.Map: - return "String" - case reflect.Float32, reflect.Float64: - return "Float" - case reflect.Bool: - return "Boolean" - case reflect.Slice, reflect.Array: - return "[" + getGraphQLType(tObj.Elem(), seenTypes) + "]" - case reflect.Struct: - typeName := tObj.Name() - if typeName == "" { - parentType := tObj.Field(0).Type - if parentType.Kind() == reflect.Ptr { - parentType = parentType.Elem() - } - typeName = fmt.Sprintf("%s%s", parentType.Name(), strings.Title(tObj.Field(0).Name)) - } - if seenTypes[tObj] { - return typeName - } - // fmt.Println("here", typeName) - // generateGraphQLTypesRecursive(tObj, seenTypes) - return typeName - default: - fmt.Println("unknown type:", tObj.Kind()) - return "" - } -} - -func getGraphQLRequired(t reflect.StructField) string { - req := true - fieldName := t.Tag.Get("json") - s := strings.Split(fieldName, ",") - if len(s) == 2 && s[1] == "omitempty" { - // fmt.Println("yes", fieldName) - req = false - } - if t.Type.Kind() != reflect.Ptr && req { - return "!" - } - return "" -} diff --git a/pkg/gql-types-generator/main.go_ b/pkg/gql-types-generator/main.go_ deleted file mode 100644 index da206aabd..000000000 --- a/pkg/gql-types-generator/main.go_ +++ /dev/null @@ -1,222 +0,0 @@ -package gqltypesgenerator - -import ( - "fmt" - "reflect" - "strings" -) - -func GenerateGraphQLTypes(input interface{}, notReqTypes []string) string { - // var sb strings.Builder - seenTypes := make(map[reflect.Type]bool) - - if notReqTypes == nil { - notReqTypes = []string{"Time", "-", "RawJson", "Location", "zone", "zoneTrans", "creation_time", "update_time", "FieldsV1"} - } - - op1, op2 := generateGraphQLTypesRecursive(reflect.TypeOf(input), seenTypes, false, notReqTypes) - return op1 + op2 - -} - -func isNeeded(fieldName string, notReqTypes []string) bool { - - for _, v := range notReqTypes { - if fieldName == v { - return false - } - } - - return true -} - -func generateGraphQLTypesRecursive(t reflect.Type, seenTypes map[reflect.Type]bool, onlyMembers bool, notReqTypes []string) (string, string) { - // fmt.Printf("%s", seenTypes) - - // main string - res := "" - - if t.Kind() == reflect.Ptr { - t = t.Elem() - } - - if seenTypes[t] { - return res, "" - } - - // fmt.Println(t) - - seenTypes[t] = true - - if t.Kind() == reflect.Struct { - - typeName := t.Name() - - if typeName == "" { - // If the type doesn't have a name, use the name of the parent struct and the field name - parentType := t.Field(0).Type - if parentType.Kind() == reflect.Ptr { - parentType = parentType.Elem() - } - typeName = fmt.Sprintf("%s%s", parentType.Name(), strings.Title(t.Field(0).Name)) - } - - res2 := "" - res3 := "" - res4 := "" - res5 := "" - res6 := "" - - // fmt.Println(sb) - for i := 0; i < t.NumField(); i++ { - - field := t.Field(i) - fieldName := field.Tag.Get("json") - if fieldName == "" { - fieldName = field.Name - } else if fieldName == ",inline" { - op1, op2 := generateGraphQLTypesRecursive(field.Type, seenTypes, true, notReqTypes) - // fmt.Println(op2, field.Name) - - res4 += op1 - res6 += op2 - continue - } else if s := strings.Split(fieldName, ","); len(s) == 2 && s[1] == "omitempty" { - // fmt.Println("yes", fieldName) - fieldName = s[0] - } - - if !isNeeded(fieldName, notReqTypes) { - continue - } - - // fmt.Println("here1", typeName) - fieldType := getGraphQLType(field.Type, seenTypes) - - if !isNeeded(fieldType, notReqTypes) { - // either continue - // continue - // or use String - fieldType = "String" - } - - res2 += fmt.Sprintf("\t%s: %s%s\n", fieldName, fieldType, getGraphQLRequired(field)) - - mT := field.Type - for { - if mT.Kind() != reflect.Ptr { - break - } - mT = mT.Elem() - } - - if mT.Kind() == reflect.Struct { - op1, op2 := generateGraphQLTypesRecursive(field.Type, seenTypes, false, notReqTypes) - res3 += op1 - res6 += op2 - // + op2 - } else if mT.Kind() == reflect.Slice || mT.Kind() == reflect.Array { - - op1, op2 := generateGraphQLTypesRecursive(mT.Elem(), seenTypes, false, notReqTypes) - res3 += op1 - res6 += op2 - } - - } - - if isNeeded(typeName, notReqTypes) { - if !onlyMembers { - if res4 != "" || res2 != "" { - res += fmt.Sprintf("type %s {\n", typeName) - - res += res2 - // res += res5 - res += res6 - - res += "}\n\n" - - res += res4 - } else { - res += fmt.Sprintf("type %s String\n\n", typeName) - } - } else { - // fmt.Println(res2, typeName) - res5 += res2 - res5 += res6 - res5 += res4 - } - } else { - res5 += res6 - } - - // fmt.Println(res5) - - res += res3 - - return res, res5 - } - - return "", "" -} - -func getGraphQLType(t reflect.Type, seenTypes map[reflect.Type]bool) string { - tObj := t - if t.Kind() == reflect.Ptr { - tObj = t.Elem() - } - - // switch tObj.Name() { - // case "Time": - // return "String" - // } - - switch tObj.Kind() { - case reflect.String: - return "String" - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return "Int" - case reflect.Uint, reflect.Uint64, reflect.Uint8, reflect.Uint32: - return "Int" - case reflect.Map: - return "String" - case reflect.Float32, reflect.Float64: - return "Float" - case reflect.Bool: - return "Boolean" - case reflect.Slice, reflect.Array: - return "[" + getGraphQLType(tObj.Elem(), seenTypes) + "]" - case reflect.Struct: - typeName := tObj.Name() - if typeName == "" { - parentType := tObj.Field(0).Type - if parentType.Kind() == reflect.Ptr { - parentType = parentType.Elem() - } - typeName = fmt.Sprintf("%s%s", parentType.Name(), strings.Title(tObj.Field(0).Name)) - } - if seenTypes[tObj] { - return typeName - } - // fmt.Println("here", typeName) - // generateGraphQLTypesRecursive(tObj, seenTypes) - return typeName - default: - fmt.Println("unknown type:", tObj.Kind()) - return "" - } -} - -func getGraphQLRequired(t reflect.StructField) string { - - req := true - fieldName := t.Tag.Get("json") - s := strings.Split(fieldName, ",") - if len(s) == 2 && s[1] == "omitempty" { - // fmt.Println("yes", fieldName) - req = false - } - if t.Type.Kind() != reflect.Ptr && req { - return "!" - } - return "" -} diff --git a/pkg/grpc/client.go b/pkg/grpc/client.go index 903517567..f39594fe7 100644 --- a/pkg/grpc/client.go +++ b/pkg/grpc/client.go @@ -1,54 +1,28 @@ -package rpc +package grpc import ( - "context" - - "go.uber.org/fx" + "github.com/kloudlite/api/pkg/errors" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" ) -func NewInsecureClient(grpcUrl string) (*grpc.ClientConn, error) { - conn, err := grpc.Dial(grpcUrl, grpc.WithTransportCredentials(insecure.NewCredentials())) - if err != nil { - return nil, err - } - return conn, nil +type Client interface { + grpc.ClientConnInterface + Close() error } -type ClientOptions interface { - GetGRPCServerURL() string +type grpcClient struct { + *grpc.ClientConn } -type GrpcClient interface { - ~*grpc.ClientConn +func (g *grpcClient) Close() error { + return g.ClientConn.Close() } -func NewGrpcClientFx[T ClientOptions, M GrpcClient]() fx.Option { - return fx.Module( - "grpc-client", - fx.Provide( - func(env T) (M, error) { - return NewInsecureClient(env.GetGRPCServerURL()) - }, - ), - fx.Invoke( - func(grpcClient M, lifecycle fx.Lifecycle) { - lifecycle.Append( - fx.Hook{ - OnStart: func(ctx context.Context) error { - return nil - }, - OnStop: func(ctx context.Context) error { - return nil - }, - }, - ) - }, - ), - ) -} - -func NewGrpcClient[T GrpcClient](addr string) (T, error) { - return NewInsecureClient(addr) +func NewGrpcClient(serverAddr string) (Client, error) { + conn, err := grpc.Dial(serverAddr, grpc.WithTransportCredentials(insecure.NewCredentials())) + if err != nil { + return nil, errors.NewE(err) + } + return &grpcClient{ClientConn: conn}, nil } diff --git a/pkg/grpc/client_deprecated.go b/pkg/grpc/client_deprecated.go new file mode 100644 index 000000000..381aa2feb --- /dev/null +++ b/pkg/grpc/client_deprecated.go @@ -0,0 +1,51 @@ +package grpc + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + + "go.uber.org/fx" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" +) + +func NewInsecureClient(grpcUrl string) (*grpc.ClientConn, error) { + conn, err := grpc.Dial(grpcUrl, grpc.WithTransportCredentials(insecure.NewCredentials())) + if err != nil { + return nil, errors.NewE(err) + } + return conn, nil +} + +type ClientOptions interface { + GetGRPCServerURL() string +} + +type GrpcClient2 interface { + ~*grpc.ClientConn +} + +func NewGrpcClientFx[T ClientOptions, M GrpcClient2]() fx.Option { + return fx.Module( + "grpc-client", + fx.Provide( + func(env T) (M, error) { + return NewInsecureClient(env.GetGRPCServerURL()) + }, + ), + fx.Invoke( + func(grpcClient M, lifecycle fx.Lifecycle) { + lifecycle.Append( + fx.Hook{ + OnStart: func(ctx context.Context) error { + return nil + }, + OnStop: func(ctx context.Context) error { + return nil + }, + }, + ) + }, + ), + ) +} diff --git a/pkg/grpc/server.go b/pkg/grpc/server.go index 8cd98ee82..e04952a98 100644 --- a/pkg/grpc/server.go +++ b/pkg/grpc/server.go @@ -1,78 +1,63 @@ -package rpc +package grpc import ( - "context" - "fmt" "net" - "go.uber.org/fx" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/logging" "google.golang.org/grpc" "google.golang.org/grpc/peer" - "kloudlite.io/pkg/errors" - "kloudlite.io/pkg/logging" ) -func GRPCStartServer(_ context.Context, server *grpc.Server, port int) error { - listen, err := net.Listen("tcp", fmt.Sprintf(":%d", port)) +type Server interface { + grpc.ServiceRegistrar + Listen(addr string) error + Stop() +} + +type ServerOpts struct { + Logger logging.Logger +} + +type grpcServer struct { + *grpc.Server + logger logging.Logger +} + +func (g *grpcServer) Listen(addr string) error { + listen, err := net.Listen("tcp", addr) if err != nil { return errors.NewEf(err, "could not listen to net/tcp server") } - go func() error { - err := server.Serve(listen) - if err != nil { - return errors.NewEf(err, "could not start grpc server ") - } - return nil - }() - return nil + g.logger.Infof("listening on %s", addr) + return g.Serve(listen) } -type ServerOptions interface { - GetGRPCPort() uint16 +func (g *grpcServer) Stop() { + g.Server.GracefulStop() } -func NewGrpcServerFx[T ServerOptions]() fx.Option { - return fx.Module( - "grpc-server", - fx.Provide(func(logger logging.Logger) *grpc.Server { - return grpc.NewServer( - grpc.StreamInterceptor(func(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { - p, ok := peer.FromContext(stream.Context()) - if ok { - logger.Debugf("New connection from %s", p.Addr.String()) - } - return handler(srv, stream) - }), - ) +func NewGrpcServer(opts ServerOpts) (Server, error) { + if opts.Logger == nil { + lgr, err := logging.New(&logging.Options{Name: "grpc-server", Dev: false}) + if err != nil { + return nil, errors.NewE(err) + } + opts.Logger = lgr + } + + server := grpc.NewServer( + grpc.StreamInterceptor(func(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { + p, ok := peer.FromContext(stream.Context()) + if ok { + opts.Logger.Debugf("[Stream] New connection from %s", p.Addr.String()) + } + return handler(srv, stream) }), - fx.Invoke( - func(lf fx.Lifecycle, env T, server *grpc.Server, logger logging.Logger) { - lf.Append( - fx.Hook{ - OnStart: func(ctx context.Context) error { - listen, err := net.Listen("tcp", fmt.Sprintf(":%d", env.GetGRPCPort())) - defer func() { - logger.Infof("[GRPC Server] started on port (%d)", env.GetGRPCPort()) - }() - if err != nil { - return errors.NewEf(err, "could not listen to net/tcp server") - } - go func() error { - err := server.Serve(listen) - if err != nil { - return errors.NewEf(err, "could not start grpc server ") - } - return nil - }() - return nil - }, - OnStop: func(context.Context) error { - server.Stop() - return nil - }, - }, - ) - }, - ), ) + + return &grpcServer{Server: server, logger: opts.Logger}, nil } + +// Type guard to ensure grpcServer implements Server interface, at compile time +var _ Server = &grpcServer{} diff --git a/pkg/grpc/server_deprecated.go b/pkg/grpc/server_deprecated.go new file mode 100644 index 000000000..a7b88dc85 --- /dev/null +++ b/pkg/grpc/server_deprecated.go @@ -0,0 +1,61 @@ +package grpc + +import ( + "context" + "fmt" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/logging" + "go.uber.org/fx" + "google.golang.org/grpc" + "google.golang.org/grpc/peer" + "net" +) + +type ServerOptions interface { + GetGRPCPort() uint16 +} + +func NewGrpcServerFx[T ServerOptions]() fx.Option { + return fx.Module( + "grpc-server", + fx.Provide(func(logger logging.Logger) *grpc.Server { + return grpc.NewServer( + grpc.StreamInterceptor(func(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { + p, ok := peer.FromContext(stream.Context()) + if ok { + logger.Debugf("[Stream] New connection from %s", p.Addr.String()) + } + return handler(srv, stream) + }), + ) + }), + fx.Invoke( + func(lf fx.Lifecycle, env T, server *grpc.Server, logger logging.Logger) { + lf.Append( + fx.Hook{ + OnStart: func(ctx context.Context) error { + listen, err := net.Listen("tcp", fmt.Sprintf(":%d", env.GetGRPCPort())) + defer func() { + logger.Infof("[GRPC Server] started on port (%d)", env.GetGRPCPort()) + }() + if err != nil { + return errors.NewEf(err, "could not listen to net/tcp server") + } + go func() { + err := server.Serve(listen) + if err != nil { + logger.Errorf(err, "could not start grpc server ") + } + }() + return nil + }, + OnStop: func(context.Context) error { + server.Stop() + return nil + }, + }, + ) + }, + ), + ) +} diff --git a/pkg/harbor/main.go b/pkg/harbor/main.go deleted file mode 100644 index 8f7b01db2..000000000 --- a/pkg/harbor/main.go +++ /dev/null @@ -1,59 +0,0 @@ -package harbor - -import ( - "context" - "fmt" - "io" - "net/http" - "net/url" - "strings" - - "kloudlite.io/pkg/errors" -) - -type Client struct { - args *Args - url *url.URL -} - -func (h *Client) NewAuthzRequest(ctx context.Context, method, urlPath string, body io.Reader) (*http.Request, error) { - nUrl := func() string { - if strings.HasPrefix(urlPath, fmt.Sprintf("/api/%s", *h.args.HarborApiVersion)) { - return h.url.String() + urlPath - } - return h.url.String() + "/api/" + *h.args.HarborApiVersion + urlPath - }() - - req, err := http.NewRequestWithContext(ctx, method, nUrl, body) - if err != nil { - return nil, err - } - req.Header.Add("Content-Type", "application/json") - req.SetBasicAuth(h.args.HarborAdminUsername, h.args.HarborAdminPassword) - return req, nil -} - -type Args struct { - HarborAdminUsername string - HarborAdminPassword string - HarborRegistryHost string - HarborApiVersion *string -} - -var ( - DefaultApiVersion = "v2.0" -) - -func NewClient(args Args) (*Client, error) { - if args.HarborApiVersion == nil { - args.HarborApiVersion = &DefaultApiVersion - } - u, err := url.Parse("https://" + args.HarborRegistryHost) - if err != nil { - return nil, errors.NewEf(err, "registryUrl is not a valid url") - } - return &Client{ - args: &args, - url: u, - }, nil -} diff --git a/pkg/harbor/project.go b/pkg/harbor/project.go deleted file mode 100644 index a7588f2d2..000000000 --- a/pkg/harbor/project.go +++ /dev/null @@ -1,50 +0,0 @@ -package harbor - -import ( - "context" - "fmt" - "net/http" - "strings" -) - -type Project struct { - ProjectId int `json:"project_id"` -} - -func (h *Client) CreateProject(ctx context.Context, accountName string) (*Project, error) { - req, err := h.NewAuthzRequest(ctx, http.MethodPost, "/projects", strings.NewReader(fmt.Sprintf(` - { - "project_name":"%s", - "storage_limit":-1, - "metadata": { - "public": "false" - } - } -`, accountName))) - if err != nil { - panic(err) - } - resp, err := http.DefaultClient.Do(req) - if err != nil { - panic(err) - } - if resp.StatusCode != http.StatusCreated { - return nil, fmt.Errorf("bad status code (%d)", resp.StatusCode) - } - projectLocation := resp.Header.Get("Location") - if projectLocation == "" { - return nil, fmt.Errorf("no project location") - } - // get project id from location - parts := strings.Split(projectLocation, "/") - if len(parts) < 2 { - return nil, fmt.Errorf("invalid project location") - } - projectId := parts[len(parts)-1] - var project Project - // convert projectId to int - if _, err := fmt.Sscanf(projectId, "%d", &project.ProjectId); err != nil { - return nil, err - } - return &project, nil -} diff --git a/pkg/harbor/robots.go b/pkg/harbor/robots.go deleted file mode 100644 index 5c07f1b3f..000000000 --- a/pkg/harbor/robots.go +++ /dev/null @@ -1,299 +0,0 @@ -package harbor - -import ( - "context" - "encoding/json" - "fmt" - "io/ioutil" - "kloudlite.io/pkg/errors" - "net/http" - "strconv" - "strings" -) - -type Robot struct { - Id int `json:"id"` - Name string `json:"name"` - ReadOnly bool `json:"read_only"` - Secret string `json:"secret"` -} - -type Permission string - -const ( - PermissionPush Permission = "push" - PermissionPull Permission = "pull" -) - -func (h *Client) GetRobot(ctx context.Context, accountName string, robotId int) (*Robot, error) { - req, err := h.NewAuthzRequest(ctx, http.MethodGet, fmt.Sprintf("/robots/%d", robotId), nil) - if err != nil { - return nil, err - } - - resp, err := http.DefaultClient.Do(req) - if err != nil { - return nil, err - } - - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - return nil, err - } - - type RobotResult struct { - Name string `json:"name"` - Secret string `json:"secret"` - Id int `json:"id"` - Permissions []struct { - Namespace string `json:"namespace"` - Kind string `json:"kind"` - Access []struct { - Resource string `json:"resource"` - Action string `json:"action"` - Effect string `json:"effect"` - } - } - } - - if resp.StatusCode == http.StatusOK { - var robot RobotResult - if err := json.Unmarshal(body, &robot); err != nil { - return nil, err - } - readOnly := true - for _, p := range robot.Permissions { - if p.Kind == "project" { - for _, a := range p.Access { - if a.Action == "push" && a.Resource == "repository" { - readOnly = false - } - } - } - } - - if !strings.HasPrefix(robot.Name, fmt.Sprintf("robot-%s", accountName)) { - return nil, errors.New(http.StatusText(http.StatusNotFound)) - } - - return &Robot{ - Id: robot.Id, - Name: robot.Name, - ReadOnly: readOnly, - Secret: robot.Secret, - }, nil - } - - return nil, errors.New(http.StatusText(resp.StatusCode)) -} - -func (h *Client) CreateRobot(ctx context.Context, accountName string, name string, description *string, readOnly bool) (*Robot, error) { - type AccessReq struct { - Resource string `json:"resource"` - Action string `json:"action"` - Effect string `json:"effect"` - } - type PermissionsReq struct { - Namespace string `json:"namespace"` - Kind string `json:"kind"` - Access []AccessReq `json:"access"` - } - type RobotReq struct { - Name string `json:"name"` - Level string `json:"level"` - Duration int `json:"duration"` - Permissions []PermissionsReq `json:"permissions"` - Description string `json:"description"` - } - - req := RobotReq{ - Name: name, - Level: "project", - Duration: -1, - Description: func() string { - if description != nil { - return *description - } - return "" - }(), - Permissions: []PermissionsReq{ - { - Namespace: string(accountName), - Kind: "project", - Access: []AccessReq{ - { - Resource: "repository", - Action: string(PermissionPull), - Effect: "allow", - }, - }, - }, - }, - } - - if !readOnly { - req.Permissions[0].Access = append(req.Permissions[0].Access, AccessReq{ - Resource: "repository", - Action: string(PermissionPush), - Effect: "allow", - }) - } - - reqMarshal, err := json.Marshal(req) - - if err != nil { - return nil, err - } - - httpRequest, err := h.NewAuthzRequest(ctx, http.MethodPost, "/robots", strings.NewReader(string(reqMarshal))) - if err != nil { - return nil, err - } - type RobotResult struct { - Id int `json:"id"` - Name string `json:"name"` - Secret string `json:"secret"` - Permissions []struct { - Namespace string `json:"namespace"` - Kind string `json:"kind"` - Access []struct { - Resource string `json:"resource"` - Action string `json:"action"` - Effect string `json:"effect"` - } - } - } - - resp, err := http.DefaultClient.Do(httpRequest) - if err != nil { - return nil, err - } - - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - return nil, err - } - - if resp.StatusCode == http.StatusCreated { - var result RobotResult - if err := json.Unmarshal(body, &result); err != nil { - return nil, err - } - var resp *Robot - readOnly := true - for _, p := range result.Permissions { - if p.Kind == "project" { - for _, a := range p.Access { - if a.Action == "push" && a.Resource == "repository" { - readOnly = false - } - } - } - } - resp = &Robot{ - Id: result.Id, - Name: result.Name, - ReadOnly: readOnly, - Secret: result.Secret, - } - return resp, nil - } - return nil, errors.New(string(body)) -} - -func (h *Client) GetRobots(ctx context.Context, projectId int, searchOpts ListOptions) ([]Robot, error) { - req, err := h.NewAuthzRequest(ctx, http.MethodGet, "/robots", nil) - if err != nil { - return nil, err - } - q := req.URL.Query() - q.Add("q", fmt.Sprintf("Level=project,ProjectID=%d", projectId)) - q.Add( - "sort", func() string { - if searchOpts.Sort == "" { - return "-id" - } - return searchOpts.Sort - }(), - ) - q.Add("page", strconv.FormatInt(searchOpts.Page, 10)) - q.Add("page_size", strconv.FormatInt(searchOpts.PageSize, 10)) - req.URL.RawQuery = q.Encode() - - resp, err := http.DefaultClient.Do(req) - if err != nil { - return nil, err - } - - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - return nil, err - } - type RobotResult struct { - Name string `json:"name"` - Secret string `json:"secret"` - Id int `json:"id"` - Permissions []struct { - Namespace string `json:"namespace"` - Kind string `json:"kind"` - Access []struct { - Resource string `json:"resource"` - Action string `json:"action"` - Effect string `json:"effect"` - } - } - } - - if resp.StatusCode == http.StatusOK { - var results []RobotResult - if err := json.Unmarshal(body, &results); err != nil { - return nil, err - } - var resp []Robot - for _, r := range results { - readOnly := true - for _, p := range r.Permissions { - if p.Kind == "project" { - for _, a := range p.Access { - if a.Action == "push" && a.Resource == "repository" { - readOnly = false - } - } - } - } - resp = append(resp, Robot{ - Id: r.Id, - Name: r.Name, - ReadOnly: readOnly, - Secret: r.Secret, - }) - } - return resp, nil - } - - return nil, errors.Newf("bad status code (%d) received, with error message, %s", resp.StatusCode, body) -} - -func (h *Client) DeleteRobot(ctx context.Context, accountName string, robotId int) error { - _, err := h.GetRobot(ctx, accountName, robotId) - if err != nil { - return err - } - req, err := h.NewAuthzRequest(ctx, http.MethodDelete, fmt.Sprintf("/robots/%d", robotId), nil) - if err != nil { - return err - } - resp, err := http.DefaultClient.Do(req) - if err != nil { - return err - } - - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - return err - } - if resp.StatusCode == http.StatusOK { - return nil - } - return errors.Newf("bad status code (%d) received, with error message, %s", resp.StatusCode, body) -} diff --git a/pkg/harbor/search.go b/pkg/harbor/search.go deleted file mode 100644 index f018ef5c8..000000000 --- a/pkg/harbor/search.go +++ /dev/null @@ -1,160 +0,0 @@ -package harbor - -import ( - "context" - "encoding/json" - "fmt" - "io/ioutil" - "net/http" - "net/url" - "strconv" - "strings" - "time" - - "kloudlite.io/pkg/errors" -) - -// Repository created by pasting json from harbor instance network tab -type Repository struct { - ArtifactCount int `json:"artifact_count"` - CreationTime time.Time `json:"creation_time"` - Id int `json:"id"` - Name string `json:"name"` - ProjectId int `json:"project_id"` - PullCount int `json:"pull_count"` - UpdateTime time.Time `json:"update_time"` -} - -func (h *Client) SearchRepositories(ctx context.Context, accountName string, searchQ string, searchOpts ListOptions) ([]Repository, error) { - req, err := h.NewAuthzRequest(ctx, http.MethodGet, fmt.Sprintf("/projects/%s/repositories", accountName), nil) - if err != nil { - return nil, err - } - q := req.URL.Query() - if searchQ != "" { - q.Add("q", fmt.Sprintf("name=~%s", searchQ)) - } - - q.Add( - "sort", func() string { - if searchOpts.Sort == "" { - return "-id" - } - return searchOpts.Sort - }(), - ) - q.Add("page", strconv.FormatInt(searchOpts.Page, 10)) - q.Add("page_size", strconv.FormatInt(searchOpts.PageSize, 10)) - req.URL.RawQuery = q.Encode() - - resp, err := http.DefaultClient.Do(req) - if err != nil { - return nil, err - } - - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - return nil, err - } - - if resp.StatusCode == http.StatusOK { - var results []Repository - if err := json.Unmarshal(body, &results); err != nil { - return nil, err - } - return results, nil - } - - return nil, errors.Newf("bad status code (%d) received, with error message, %s", resp.StatusCode, body) -} - -type Artifact struct { - Size int `json:"size"` - Tags []ImageTag `json:"tags"` -} - -type ImageTag struct { - RepositoryId int `json:"repository_id"` - Name string `json:"name"` - PushTime time.Time `json:"push_time"` - PullTime time.Time `json:"pull_time"` - Signed bool `json:"signed"` - Id int `json:"id"` - Immutable bool `json:"immutable"` - ArtifactId int `json:"artifact_id"` -} - -type ListOptions struct { - Page int64 `json:"page"` - PageSize int64 `json:"page_size"` - Sort string `json:"sort"` -} - -type ListTagsOpts struct { - WithImmutable bool - WithSignature bool - ListOptions -} - -func (h *Client) ListArtifacts(ctx context.Context, accountName string, repoName string, tagOpts ListTagsOpts) ([]Artifact, error) { - rName := func() string { - // remove first path component - parts := strings.Split(repoName, "/") - if len(parts) > 1 { - return strings.Join(parts[1:], "/") - } - return repoName - } - req, err := h.NewAuthzRequest( - ctx, - http.MethodGet, - fmt.Sprintf("/projects/%s/repositories/%s/artifacts", accountName, url.PathEscape(rName())), - nil, - ) - q := req.URL.Query() - - q.Add("with_tag", "true") - q.Add("with_label", "true") - q.Add("with_scan_overview", "true") - q.Add("with_accessory", "false") - //if tagOpts.WithImmutable { - // q.Add("with_immutable", "true") - //} - //if tagOpts.WithSignature { - // q.Add("with_signature", "true") - //} - q.Add( - "sort", func() string { - if tagOpts.Sort == "" { - return "-id" - } - return tagOpts.Sort - }(), - ) - q.Add("page", strconv.FormatInt(tagOpts.Page, 10)) - q.Add("page_size", strconv.FormatInt(tagOpts.PageSize, 10)) - - req.URL.RawQuery = q.Encode() - - if err != nil { - return nil, err - } - resp, err := http.DefaultClient.Do(req) - if err != nil { - return nil, err - } - - b, err := ioutil.ReadAll(resp.Body) - if err != nil { - return nil, err - } - - if resp.StatusCode == http.StatusOK { - var artifacts []Artifact - if err := json.Unmarshal(b, &artifacts); err != nil { - return nil, err - } - return artifacts, nil - } - return nil, errors.Newf("bad status code received (%d), with message, %s", resp.StatusCode, b) -} diff --git a/pkg/harbor/types.go b/pkg/harbor/types.go deleted file mode 100644 index 962eedd63..000000000 --- a/pkg/harbor/types.go +++ /dev/null @@ -1,21 +0,0 @@ -package harbor - -type WebhookBody struct { - Type string `json:"type"` - OccurAt int `json:"occur_at"` - Operator string `json:"operator"` - EventData struct { - Resources []struct { - Digest string `json:"digest"` - Tag string `json:"tag"` - ResourceUrl string `json:"resource_url"` - } `json:"resources"` - Repository struct { - DateCreated int `json:"date_created"` - Name string `json:"name"` - Namespace string `json:"namespace"` - RepoFullName string `json:"repo_full_name"` - RepoType string `json:"repo_type"` - } `json:"repository"` - } `json:"event_data"` -} diff --git a/pkg/http-server/http-server.go b/pkg/http-server/http-server.go new file mode 100644 index 000000000..0c3d9d112 --- /dev/null +++ b/pkg/http-server/http-server.go @@ -0,0 +1,129 @@ +package httpServer + +import ( + "context" + "fmt" + "net/http" + "strings" + "time" + + "github.com/kloudlite/api/pkg/errors" + "github.com/vektah/gqlparser/v2/gqlerror" + "github.com/ztrue/tracerr" + + "github.com/99designs/gqlgen/graphql" + gqlHandler "github.com/99designs/gqlgen/graphql/handler" + "github.com/99designs/gqlgen/graphql/playground" + "github.com/gofiber/adaptor/v2" + + "github.com/gofiber/fiber/v2" + "github.com/gofiber/fiber/v2/middleware/cors" + l "github.com/gofiber/fiber/v2/middleware/logger" + "github.com/kloudlite/api/pkg/logging" +) + +type Server interface { + SetupGraphqlServer(es graphql.ExecutableSchema, middlewares ...fiber.Handler) + Listen(addr string) error + Close() error + + Raw() *fiber.App +} + +type server struct { + Logger logging.Logger + *fiber.App + isDev bool +} + +func (s *server) Raw() *fiber.App { + return s.App +} + +func (s *server) Close() error { + return s.App.Shutdown() +} + +func (s *server) Listen(addr string) error { + errChannel := make(chan error, 1) + ctx, cancel := context.WithTimeout(context.TODO(), time.Second*1) + defer cancel() + + go func() { + errChannel <- s.App.Listen(addr) + }() + + select { + case status := <-errChannel: + return errors.Newf("could not start server because %v", status.Error()) + case <-ctx.Done(): + s.Logger.Infof("Http Server started @ (addr: %q)", addr) + } + return nil +} + +type ServerArgs struct { + IsDev bool + Logger logging.Logger + CorsAllowOrigins *string +} + +func NewServer(args ServerArgs) Server { + app := fiber.New(fiber.Config{ + ErrorHandler: func(ctx *fiber.Ctx, err error) error { + args.Logger.Errorf(err) + return errors.NewE(err) + }, + }) + app.Use( + l.New( + l.Config{ + Format: "${time} ${status} - ${method} ${latency} \t ${path} \n", + TimeFormat: "02-Jan-2006 15:04:05", + TimeZone: "Asia/Kolkata", + }, + ), + ) + + if args.CorsAllowOrigins != nil { + app.Use( + cors.New( + cors.Config{ + AllowOrigins: *args.CorsAllowOrigins, + AllowCredentials: true, + AllowMethods: strings.Join( + []string{http.MethodGet, http.MethodPost, http.MethodPut, http.MethodOptions}, + ",", + ), + }, + ), + ) + } + + if args.Logger == nil { + args.Logger = logging.EmptyLogger + } + + return &server{App: app, Logger: args.Logger, isDev: args.IsDev} +} + +func (s *server) SetupGraphqlServer(es graphql.ExecutableSchema, middlewares ...fiber.Handler) { + s.All("/explorer", func(c *fiber.Ctx) error { + return c.Redirect(fmt.Sprintf("https://studio.apollographql.com/sandbox/explorer?endpoint=http://%s/query", c.Context().LocalAddr())) + }) + + s.All("/play", adaptor.HTTPHandler(playground.Handler("GraphQL playground", "/query"))) + gqlServer := gqlHandler.NewDefaultServer(es) + for _, v := range middlewares { + s.Use(v) + } + + gqlServer.SetErrorPresenter(func(ctx context.Context, err error) *gqlerror.Error { + if s.isDev { + tracerr.Print(err.(*gqlerror.Error).Unwrap()) + } + return gqlerror.Errorf(err.Error()) + }) + + s.All("/query", adaptor.HTTPHandlerFunc(gqlServer.ServeHTTP)) +} diff --git a/pkg/http-server/http-session.go b/pkg/http-server/http-session.go index 4075a4179..a5cb775af 100644 --- a/pkg/http-server/http-session.go +++ b/pkg/http-server/http-session.go @@ -5,20 +5,22 @@ import ( "fmt" "time" + "github.com/kloudlite/api/common" + "github.com/kloudlite/api/pkg/errors" + "github.com/gofiber/fiber/v2" - "kloudlite.io/pkg/cache" - "kloudlite.io/pkg/repos" + "github.com/kloudlite/api/pkg/kv" + "github.com/kloudlite/api/pkg/repos" ) const userContextKey = "__local_user_context__" -func NewSessionMiddleware[T repos.Entity]( - cacheClient cache.Client, +func NewSessionMiddleware( + repo kv.Repo[*common.AuthSession], cookieName string, cookieDomain string, sessionKeyPrefix string, ) fiber.Handler { - repo := cache.NewRepo[T](cacheClient) return func(ctx *fiber.Ctx) error { cookies := map[string]string{} ctx.Request().Header.VisitAllCookie(func(key, value []byte) { @@ -29,14 +31,14 @@ func NewSessionMiddleware[T repos.Entity]( cookieValue := ctx.Cookies(cookieName) - if cookieValue != "" || false { + if cookieValue != "" { key := fmt.Sprintf("%s:%s", sessionKeyPrefix, cookieValue) var get any get, err := repo.Get(ctx.Context(), key) if err != nil { - if !repo.ErrNoRecord(err) { - return err - } + if !repo.ErrKeyNotFound(err) { + return errors.NewE(err) + } } if get != nil { @@ -46,7 +48,7 @@ func NewSessionMiddleware[T repos.Entity]( ctx.SetUserContext( context.WithValue( - ctx.UserContext(), "set-session", func(session T) { + ctx.UserContext(), "set-session", func(session *common.AuthSession) { err := repo.Set(ctx.Context(), fmt.Sprintf("%v:%v", sessionKeyPrefix, session.GetId()), session) if err != nil { fmt.Println("[ERROR]", err) @@ -73,7 +75,9 @@ func NewSessionMiddleware[T repos.Entity]( context.WithValue( ctx.UserContext(), "delete-session", func() { if cookieValue != "" { - repo.Drop(ctx.Context(), fmt.Sprintf("%v:%v", sessionKeyPrefix, cookieValue)) + if err := repo.Drop(ctx.Context(), fmt.Sprintf("%v:%v", sessionKeyPrefix, cookieValue)); err != nil { + fmt.Println("[ERROR]", err) + } } }, ), diff --git a/pkg/http-server/main.go b/pkg/http-server/main.go deleted file mode 100644 index 09316f859..000000000 --- a/pkg/http-server/main.go +++ /dev/null @@ -1,105 +0,0 @@ -package httpServer - -import ( - "context" - "fmt" - "net/http" - "strings" - "time" - - "github.com/99designs/gqlgen/graphql" - gqlHandler "github.com/99designs/gqlgen/graphql/handler" - "github.com/99designs/gqlgen/graphql/playground" - "github.com/gofiber/adaptor/v2" - "github.com/gofiber/fiber/v2" - "github.com/gofiber/fiber/v2/middleware/cors" - l "github.com/gofiber/fiber/v2/middleware/logger" - "go.uber.org/fx" - "kloudlite.io/pkg/logging" -) - -func Start(ctx context.Context, port uint16, app *fiber.App, logger logging.Logger) error { - errChannel := make(chan error, 1) - go func() { - errChannel <- app.Listen(fmt.Sprintf(":%d", port)) - }() - - ctx, cancel := context.WithTimeout(ctx, time.Second*2) - defer cancel() - select { - case status := <-errChannel: - return fmt.Errorf("could not start server because %v", status.Error()) - case <-ctx.Done(): - logger.Infof("Http Server started @ (port=%v)", port) - } - return nil -} - -func SetupGQLServer( - app *fiber.App, - es graphql.ExecutableSchema, - middlewares ...fiber.Handler, -) { - app.All("/play", adaptor.HTTPHandler(playground.Handler("GraphQL playground", "/query"))) - gqlServer := gqlHandler.NewDefaultServer(es) - for _, v := range middlewares { - app.Use(v) - } - app.All("/query", adaptor.HTTPHandlerFunc(gqlServer.ServeHTTP)) -} - -type ServerOptions interface { - GetHttpPort() uint16 - GetHttpCors() string -} - -func NewHttpServerFx[T ServerOptions]() fx.Option { - return fx.Module( - "http-server", - fx.Provide( - func(serverOpts T) *fiber.App { - app := fiber.New() - - app.Use( - l.New( - l.Config{ - Format: "${time} ${status} - ${method} ${latency} \t ${path} \n", - TimeFormat: "02-Jan-2006 15:04:05", - TimeZone: "Asia/Kolkata", - }, - ), - ) - - app.Use( - cors.New( - cors.Config{ - AllowOrigins: serverOpts.GetHttpCors(), - AllowCredentials: true, - AllowMethods: strings.Join( - []string{http.MethodGet, http.MethodPost, http.MethodPut, http.MethodOptions}, - ",", - ), - }, - ), - ) - - return app - }, - ), - - fx.Invoke( - func(lf fx.Lifecycle, env T, logger logging.Logger, app *fiber.App) { - lf.Append( - fx.Hook{ - OnStart: func(ctx context.Context) error { - return Start(ctx, env.GetHttpPort(), app, logger) - }, - OnStop: func(ctx context.Context) error { - return app.Shutdown() - }, - }, - ) - }, - ), - ) -} diff --git a/pkg/infraClient/.dockerignore b/pkg/infraClient/.dockerignore deleted file mode 100644 index 002bae2c9..000000000 --- a/pkg/infraClient/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -aws-test* -do-test* -consts.go diff --git a/pkg/infraClient/aws-test.go b/pkg/infraClient/aws-test.go deleted file mode 100644 index 548e8e327..000000000 --- a/pkg/infraClient/aws-test.go +++ /dev/null @@ -1,53 +0,0 @@ -package infraclient - -import ( - "fmt" -) - -func testAwsClient() { - env := GetEnvOrDie() - - awsp := NewAWSProvider(AWSProvider{ - AccessKey: "***REMOVED***", - AccessSecret: "***REMOVED***", - AccountId: "kl-core", - }, AWSProviderEnv{ - StorePath: "/home/vision/tf", - TfTemplates: "/home/vision/kloudlite/api-go/pkg/infraClient/terraform", - Secrets: env.Secret, - SSHPath: "/home/vision/.ssh", - }) - - var err error - - node := AWSNode{ - NodeId: "aws-worker-01", - Region: "ap-south-1", - InstanceType: "m5.large", - VPC: "", - } - - if false { - - if err = awsp.NewNode(node); err != nil { - fmt.Println(err) - return - } - - if err = awsp.AttachNode(node); err != nil { - fmt.Println(err) - return - } - - } else { - - if err = awsp.DeleteNode(node); err != nil { - fmt.Println(err) - return - } - - } - - // time.Sleep(time.Second * 10) - -} diff --git a/pkg/infraClient/aws.go b/pkg/infraClient/aws.go deleted file mode 100644 index 979ba2a2a..000000000 --- a/pkg/infraClient/aws.go +++ /dev/null @@ -1,305 +0,0 @@ -package infraclient - -import ( - "encoding/base64" - "fmt" - "os" - "os/exec" - "path" - "strings" - "time" - - "gopkg.in/yaml.v3" -) - -type awsProvider struct { - accessKey string - accessSecret string - - SSHPath string - accountId string - secrets string - providerDir string - storePath string - tfTemplates string - labels map[string]string - taints []string -} - -type AWSNode struct { - NodeId string - Region string - InstanceType string - VPC string - ImageId string -} - -type awsProviderClient interface { - NewNode(node AWSNode) error - DeleteNode(node AWSNode) error - - AttachNode(node AWSNode) error - UnattachNode(node AWSNode) error - - // mkdir(folder string) error - // rmdir(folder string) error - // getFolder(region, nodeId string) string - // initTFdir(region, nodeId string) error - // applyTF(region, nodeId string, values map[string]string) error - // destroyNode(folder string) error - // execCmd(cmd string) error -} - -// getFolder implements doProviderClient -func (a *awsProvider) getFolder(region string, nodeId string) string { - // eg -> /path/acc_id/do/blr1/node_id/do - - return path.Join(a.storePath, a.accountId, a.providerDir, region, nodeId) -} - -// initTFdir implements doProviderClient -func (d *awsProvider) initTFdir(node AWSNode) error { - - folder := d.getFolder(node.Region, node.NodeId) - - if err := execCmd(fmt.Sprintf("cp -r %s %s", fmt.Sprintf("%s/%s", d.tfTemplates, d.providerDir), folder), "initialize terraform"); err != nil { - return err - } - - cmd := exec.Command("terraform", "init") - cmd.Dir = path.Join(folder, d.providerDir) - - cmd.Stdout = os.Stdout - cmd.Stderr = os.Stderr - - return cmd.Run() -} - -type TalosAmi struct { - Cloud string - Version string - Region string - Arch string - Type string - Id string -} - -// NewNode implements awsProviderClient -func (a *awsProvider) NewNode(node AWSNode) error { - - values := map[string]string{} - - values["access_key"] = a.accessKey - values["secret_key"] = a.accessSecret - - values["region"] = node.Region - values["node_id"] = node.NodeId - values["instance_type"] = node.InstanceType - values["keys-path"] = a.SSHPath - values["ami"] = node.ImageId - - // making dir - if err := mkdir(a.getFolder(node.Region, node.NodeId)); err != nil { - return err - } - - // initialize directory - if err := a.initTFdir(node); err != nil { - return err - } - - // apply terraform - return applyTF(path.Join(a.getFolder(node.Region, node.NodeId), a.providerDir), values) - -} - -// AttachNode implements awsProviderClient -func (a *awsProvider) AttachNode(node AWSNode) error { - - var out, secretYaml []byte - var err error - - if out, err = getOutput(path.Join(a.getFolder(node.Region, node.NodeId), a.providerDir), "node-ip"); err != nil { - return err - } - - if secretYaml, err = base64.StdEncoding.DecodeString(a.secrets); err != nil { - return err - } - - var sec joinTokenSecret - - if err = yaml.Unmarshal(secretYaml, &sec); err != nil { - return err - } - - labels := func() []string { - l := []string{} - for k, v := range a.labels { - l = append(l, fmt.Sprintf("--node-label %s=%s", k, v)) - } - l = append(l, fmt.Sprintf("--node-label %s=%s", "kloudlite.io/public-ip", string(out))) - return l - }() - - count := 0 - - for { - if e := execCmd( - fmt.Sprintf("ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i %s root@%s ls", - fmt.Sprintf("%v/access", a.SSHPath), - string(out)), - "checking if node is ready "); e == nil { - break - } - - count++ - if count > 24 { - return fmt.Errorf("node is not ready even after 6 minutes") - } - time.Sleep(time.Second * 15) - } - - if err = execCmd(fmt.Sprintf("kubectl get node %s", node.NodeId), "checking if node attached"); err == nil { - fmt.Println("node already attached. clean exit") - return nil - } - - // // install k3s - // if e := execCmd( - // fmt.Sprintf("ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i %s root@%s sudo sh /tmp/k3s-install.sh", - // fmt.Sprintf("%v/access", d.SSHPath), string(out)), - // ""); e != nil { - // return e - // } - - // attach node - if e := execCmd( - fmt.Sprintf("ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i %s root@%s sudo sh /tmp/k3s-install.sh agent --server %s --token %s %s --node-name %s --node-external-ip %s --node-ip %s", - fmt.Sprintf("%v/access", a.SSHPath), string(out), sec.EndpointUrl, sec.JoinToken, - strings.Join(labels, " "), node.NodeId, string(out), string(out)), - "attaching to cluster"); e != nil { - return e - } - - count = 0 - for { - if err = execCmd(fmt.Sprintf("kubectl get node %s", node.NodeId), "checking if node attached"); err == nil { - fmt.Println("node attached successfully.") - break - } - - count++ - if count > 24 { - return fmt.Errorf("node not attached even after 6minutes") - } - time.Sleep(time.Second * 15) - } - - // "hostname": node.NodeId, - // "labels": strings.Join(labels, ","), - // TODO: needs to AttachNode here - return nil - -} - -// DeleteNode implements awsProviderClient -func (a *awsProvider) DeleteNode(node AWSNode) error { - var err error - - // time.Sleep(time.Minute * 2) - values := map[string]string{} - - //TODO: remove node from cluster after drain proceed following - - values["access_key"] = a.accessKey - values["secret_key"] = a.accessSecret - - values["region"] = node.Region - values["node_id"] = node.NodeId - values["instance_type"] = node.InstanceType - values["keys-path"] = a.SSHPath - values["ami"] = node.ImageId - - nodetfpath := path.Join(a.getFolder(node.Region, node.NodeId), a.providerDir) - - // check if dir present - if _, e := os.Stat(path.Join(nodetfpath, "init.sh")); e != nil && os.IsNotExist(e) { - fmt.Println("tf state not present nothing to do") - return nil - } - - // get node name - var out []byte - if out, err = getOutput(nodetfpath, "node-name"); err != nil { - return err - } else if strings.TrimSpace(string(out)) == "" { - fmt.Println("something went wrong, can't find node_name") - return nil - } - - // destroy node - return destroyNode(nodetfpath, values) - -} - -func (a *awsProvider) UnattachNode(node AWSNode) error { - var out []byte - var err error - - if out, err = getOutput(path.Join(a.getFolder(node.Region, node.NodeId), a.providerDir), "node-name"); err != nil { - return err - } else if strings.TrimSpace(string(out)) == "" { - fmt.Println("something went wrong, can't find node_name") - return nil - } - - if err = execCmd(fmt.Sprintf("kubectl get node %s", out), "checknode present"); err != nil { - fmt.Println("node not found may be already deleted") - return nil - } - - // drain node - if err = execCmd(fmt.Sprintf("kubectl taint nodes %s force=delete:NoExecute", node.NodeId), "drain node to delete"); err != nil { - return err - } - - fmt.Println("[#] waiting 10 seconds after drain") - time.Sleep(time.Second * 10) - - // delete node - return execCmd(fmt.Sprintf("kubectl delete node %s", out), - "delete node from cluster") -} - -type AWSProvider struct { - AccessKey string - AccessSecret string - AccountId string -} - -type AWSProviderEnv struct { - StorePath string - TfTemplates string - - Labels map[string]string - Taints []string - Secrets string - SSHPath string -} - -func NewAWSProvider(provider AWSProvider, p AWSProviderEnv) awsProviderClient { - return &awsProvider{ - accessKey: provider.AccessKey, - accessSecret: provider.AccessSecret, - accountId: provider.AccountId, - - providerDir: "aws", - secrets: p.Secrets, - storePath: p.StorePath, - tfTemplates: p.TfTemplates, - labels: p.Labels, - taints: p.Taints, - SSHPath: p.SSHPath, - } -} diff --git a/pkg/infraClient/azure.go b/pkg/infraClient/azure.go deleted file mode 100644 index da2ccd9bb..000000000 --- a/pkg/infraClient/azure.go +++ /dev/null @@ -1,11 +0,0 @@ -package infraclient - -type azureProvider struct { - provider string -} - -func NewAzureProvider() *azureProvider { - return &azureProvider{ - provider: "", - } -} diff --git a/pkg/infraClient/common.go b/pkg/infraClient/common.go deleted file mode 100644 index 5acbbd941..000000000 --- a/pkg/infraClient/common.go +++ /dev/null @@ -1,125 +0,0 @@ -package infraclient - -import ( - "encoding/csv" - "encoding/json" - "fmt" - "os" - "os/exec" - "strings" -) - -const ( - CLUSTER_ID = "kl" -) - -// rmTFdir implements doProviderClient -// func rmdir(folder string) error { -// return execCmd(fmt.Sprintf("rm -rf %q", folder), "") -// } - -// makeTFdir implements doProviderClient -func mkdir(folder string) error { - return execCmd(fmt.Sprintf("mkdir -p %q", folder), "mkdir ") -} - -// destroyNode implements doProviderClient -func destroyNode(folder string, values map[string]string) error { - vars := []string{"destroy", "-auto-approve"} - - for k, v := range values { - vars = append(vars, fmt.Sprintf("-var=%s=%s", k, v)) - } - - cmd := exec.Command("terraform", vars...) - cmd.Dir = folder - - cmd.Stdout = os.Stdout - cmd.Stderr = os.Stderr - - err := cmd.Run() - if err != nil { - fmt.Println(err) - return err - } - - return os.RemoveAll(folder) - - // return err -} - -func getOutput(folder, key string) ([]byte, error) { - vars := []string{"output", "-json"} - fmt.Printf("[#] terraform %s\n", strings.Join(vars, " ")) - cmd := exec.Command("terraform", vars...) - cmd.Dir = folder - - // cmd.Stdout = os.Stdout - cmd.Stderr = os.Stderr - - out, err := cmd.Output() - if err != nil { - return nil, err - - } - - // fmt.Println(string(out)) - - var resp map[string]struct { - Value string `json:"value"` - } - - err = json.Unmarshal(out, &resp) - if err != nil { - return nil, err - } - - return []byte(resp[key].Value), nil -} - -// applyTF implements doProviderClient -func applyTF(folder string, values map[string]string) error { - - vars := []string{"apply", "-auto-approve"} - - fmt.Printf("[#] terraform %s", strings.Join(vars, " ")) - - for k, v := range values { - vars = append(vars, fmt.Sprintf("-var=%s=%s", k, v)) - } - - cmd := exec.Command("terraform", vars...) - cmd.Dir = folder - - cmd.Stdout = os.Stdout - cmd.Stderr = os.Stderr - - cmd.Dir = folder - - return cmd.Run() -} - -func execCmd(cmdString string, logStr string) error { - r := csv.NewReader(strings.NewReader(cmdString)) - r.Comma = ' ' - cmdArr, err := r.Read() - if err != nil { - return err - } - - if logStr != "" { - fmt.Printf("[#] %s\n", logStr) - } else { - fmt.Printf("[#] %s\n", strings.Join(cmdArr, " ")) - } - - cmd := exec.Command(cmdArr[0], cmdArr[1:]...) - cmd.Stderr = os.Stderr - // cmd.Stdout = os.Stdout - - if err := cmd.Run(); err != nil { - fmt.Printf("err occurred: %s\n", err.Error()) - return err - } - return nil -} diff --git a/pkg/infraClient/do-test.go b/pkg/infraClient/do-test.go deleted file mode 100644 index 6505ce256..000000000 --- a/pkg/infraClient/do-test.go +++ /dev/null @@ -1,82 +0,0 @@ -package infraclient - -import ( - "fmt" - "time" - - "github.com/codingconcepts/env" -) - -type Env struct { - Secret string `env:"SECRETS" required:"true"` -} - -func GetEnvOrDie() *Env { - var ev Env - if err := env.Set(&ev); err != nil { - panic(err) - } - return &ev -} - -func testDoClient() { - env := GetEnvOrDie() - - dop := NewDOProvider(DoProvider{ - ApiToken: "***REMOVED***", - AccountId: "kl-core", - }, DoProviderEnv{ - StorePath: "/home/vision/tf", - TfTemplates: "/home/vision/kloudlite/api-go/pkg/infraClient/terraform", - Secrets: env.Secret, - Labels: map[string]string{ - // "kloudlite.io/region": "blr1", - - }, - - SSHPath: "/home/vision/.ssh", - }) - - var err error - - node := DoNode{ - Region: "blr1", - // Size: "s-4vcpu-8gb-amd", - // Size: "s-2vcpu-4gb-amd", - // Size: "s-1vcpu-1gb-amd", - Size: "c-2", - NodeId: "try-agent-01", - ImageId: "ubuntu-22-10-x64", - } - - // fmt.Println(node, err, dop) - - if false { - - if err = dop.NewNode(node); err != nil { - fmt.Println(err) - return - } - - for { - - if err = dop.AttachNode(node); err != nil { - fmt.Println(err) - - time.Sleep(time.Second * 5) - continue - } - - return - } - - } else { - - if err = dop.DeleteNode(node); err != nil { - fmt.Println(err) - return - } - - } - -} diff --git a/pkg/infraClient/do.go b/pkg/infraClient/do.go deleted file mode 100644 index 4e7768b17..000000000 --- a/pkg/infraClient/do.go +++ /dev/null @@ -1,300 +0,0 @@ -package infraclient - -import ( - "encoding/base64" - "fmt" - "os" - "os/exec" - "path" - "strings" - "time" - - "gopkg.in/yaml.v3" -) - -type doProviderClient interface { - NewNode(node DoNode) error - DeleteNode(node DoNode) error - - AttachNode(node DoNode) error - UnattachNode(node DoNode) error - - // mkdir(folder string) error - // rmdir(folder string) error - // getFolder(region, nodeId string) string - // initTFdir(region, nodeId string) error - // applyTF(region, nodeId string, values map[string]string) error - // destroyNode(folder string) error - // execCmd(cmd string) error -} - -type DoNode struct { - Region string - Size string - NodeId string - ImageId string -} - -type joinTokenSecret struct { - JoinToken string `json:"joinToken" yaml:"joinToken"` - EndpointUrl string `json:"endpointUrl" yaml:"endPointUrl"` -} - -type doProvider struct { - apiToken string - accountId string - providerDir string - storePath string - tfTemplates string - SSHPath string - PubKey string - labels map[string]string - taints []string - secrets string -} - -// getFolder implements doProviderClient -func (d *doProvider) getFolder(region string, nodeId string) string { - // eg -> /path/do/blr1/acc_id/node_id - return path.Join(d.storePath, d.accountId, d.providerDir, region, nodeId) -} - -// initTFdir implements doProviderClient -func (d *doProvider) initTFdir(node DoNode) error { - - folder := d.getFolder(node.Region, node.NodeId) - - if err := execCmd(fmt.Sprintf("cp -r %s %s", fmt.Sprintf("%s/%s", d.tfTemplates, d.providerDir), folder), "initialize terraform"); err != nil { - return err - } - - cmd := exec.Command("terraform", "init") - cmd.Dir = path.Join(folder, d.providerDir) - - cmd.Stdout = os.Stdout - cmd.Stderr = os.Stderr - - return cmd.Run() -} - -// NewNode implements doProviderClient -func (d *doProvider) NewNode(node DoNode) error { - values := map[string]string{} - - values["cluster-id"] = CLUSTER_ID - - // values["keys-path"] = d.sshKeyPath - values["do-token"] = d.apiToken - values["accountId"] = d.accountId - - values["do-image-id"] = "ubuntu-22-10-x64" - values["nodeId"] = node.NodeId - values["size"] = node.Size - values["keys-path"] = d.SSHPath - - // making dir - if err := mkdir(d.getFolder(node.Region, node.NodeId)); err != nil { - return err - } - - // initialize directory - if err := d.initTFdir(node); err != nil { - return err - } - - tfPath := path.Join(d.getFolder(node.Region, node.NodeId), d.providerDir) - - // apply terraform - return applyTF(tfPath, values) -} - -// DeleteNode implements ProviderClient -func (d *doProvider) DeleteNode(node DoNode) error { - // time.Sleep(time.Minute * 2) - values := map[string]string{} - - //TODO: remove node from cluster after drain proceed following - - values["cluster-id"] = CLUSTER_ID - - // values["keys-path"] = d.sshKeyPath - values["do-token"] = d.apiToken - values["accountId"] = d.accountId - - // values["do-image-id"] = node.ImageId - values["do-image-id"] = "ubuntu-22-10-x64" - values["nodeId"] = node.NodeId - values["keys-path"] = d.SSHPath - - nodetfpath := path.Join(d.getFolder(node.Region, node.NodeId), d.providerDir) - - // check if dir present - if _, err := os.Stat(path.Join(nodetfpath, "init.sh")); err != nil && os.IsNotExist(err) { - fmt.Println("tf state not present nothing to do") - return nil - } - - // get node name - var out []byte - var err error - if out, err = getOutput(nodetfpath, "node-name"); err != nil { - return err - } else if strings.TrimSpace(string(out)) == "" { - fmt.Println("something went wrong, can't find node_name") - return nil - } - - // destroy node - return destroyNode(nodetfpath, values) -} - -// AttachNode implements ProviderClient -func (d *doProvider) AttachNode(node DoNode) error { - - var out, secretYaml []byte - var err error - - if out, err = getOutput(path.Join(d.getFolder(node.Region, node.NodeId), d.providerDir), "node-ip"); err != nil { - return err - } - - if secretYaml, err = base64.StdEncoding.DecodeString(d.secrets); err != nil { - fmt.Println("here", d.secrets) - return err - } - - var sec joinTokenSecret - - if err = yaml.Unmarshal(secretYaml, &sec); err != nil { - return err - } - - labels := func() []string { - l := []string{} - for k, v := range d.labels { - l = append(l, fmt.Sprintf("--node-label %s=%s", k, v)) - } - l = append(l, fmt.Sprintf("--node-label %s=%s", "kloudlite.io/public-ip", string(out))) - return l - }() - - // fmt.Println(labels) - - // "hostname": node.NodeId, - // "labels": strings.Join(labels, ","), - //check is node ready - count := 0 - - for { - if e := execCmd( - fmt.Sprintf("ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i %s root@%s ls", - fmt.Sprintf("%v/access", d.SSHPath), - string(out)), - "checking if node is ready"); e == nil { - break - } - - count++ - if count > 24 { - return fmt.Errorf("node is not ready even after 6 minutes") - } - time.Sleep(time.Second * 15) - } - - if err = execCmd(fmt.Sprintf("kubectl get node %s", node.NodeId), "checking if node attached"); err == nil { - fmt.Println("node already attached. clean exit") - return nil - } - - // // install k3s - // if e := execCmd( - // fmt.Sprintf("ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i %s root@%s sudo sh /tmp/k3s-install.sh", - // fmt.Sprintf("%v/access", d.SSHPath), string(out)), - // ""); e != nil { - // return e - // } - - // attach node - if e := execCmd( - fmt.Sprintf("ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i %s root@%s sudo sh /tmp/k3s-install.sh agent --server %s --token %s %s --node-name %s --node-external-ip %s", - fmt.Sprintf("%v/access", d.SSHPath), string(out), sec.EndpointUrl, sec.JoinToken, - strings.Join(labels, " "), node.NodeId, string(out)), - "attaching to cluster"); e != nil { - return e - } - - count = 0 - for { - if err = execCmd(fmt.Sprintf("kubectl get node %s", node.NodeId), "checking if node attached"); err == nil { - fmt.Println("node attached successfully.") - break - } - - count++ - if count > 24 { - return fmt.Errorf("node not attached even after 6minutes") - } - time.Sleep(time.Second * 15) - } - - return nil -} - -// UnattachNode implements doProviderClient -func (d *doProvider) UnattachNode(node DoNode) error { - var out []byte - var err error - - if out, err = getOutput(path.Join(d.getFolder(node.Region, node.NodeId), d.providerDir), "node-name"); err != nil { - return err - } else if strings.TrimSpace(string(out)) == "" { - fmt.Println("something went wrong, can't find node_name") - return nil - } - - if err = execCmd(fmt.Sprintf("kubectl get node %s", out), "checking if node attached"); err != nil { - fmt.Println("node not found may be already deleted") - return nil - } - - // drain node - if err = execCmd(fmt.Sprintf("kubectl taint nodes %s force=delete:NoExecute", node.NodeId), "drain node to delete"); err != nil { - return err - } - - fmt.Println("[#] waiting 10 seconds after drain") - time.Sleep(time.Second * 10) - - // delete node - return execCmd(fmt.Sprintf("kubectl delete node %s", out), - "delete node from cluster") -} - -type DoProvider struct { - ApiToken string - AccountId string -} - -type DoProviderEnv struct { - StorePath string - TfTemplates string - - SSHPath string - Secrets string - Labels map[string]string - Taints []string -} - -func NewDOProvider(provider DoProvider, p DoProviderEnv) doProviderClient { - return &doProvider{ - secrets: p.Secrets, - apiToken: provider.ApiToken, - accountId: provider.AccountId, - providerDir: "do", - storePath: p.StorePath, - tfTemplates: p.TfTemplates, - labels: p.Labels, - taints: p.Taints, - SSHPath: p.SSHPath, - } -} diff --git a/pkg/infraClient/interface.go b/pkg/infraClient/interface.go deleted file mode 100644 index 98b6eb076..000000000 --- a/pkg/infraClient/interface.go +++ /dev/null @@ -1,8 +0,0 @@ -package infraclient - -type ProviderClient interface { - NewNode() error - DeleteNode() error - UpdateNode() error - AttachNode() error -} diff --git a/pkg/infraClient/main.go b/pkg/infraClient/main.go deleted file mode 100644 index 96dc63cfc..000000000 --- a/pkg/infraClient/main.go +++ /dev/null @@ -1,6 +0,0 @@ -package infraclient - -func InfraClientTest() { - testAwsClient() - // testDoClient() -} diff --git a/pkg/infraClient/terraform/aws/init.sh b/pkg/infraClient/terraform/aws/init.sh deleted file mode 100644 index fa313848b..000000000 --- a/pkg/infraClient/terraform/aws/init.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -cat >> /root/.ssh/authorized_keys << EOF -${pubkey} -EOF - -echo "curl -sfL https://get.k3s.io | sh -s - \$@" > /tmp/k3s-install.sh && chomod +x /tmp/k3s-install.sh diff --git a/pkg/infraClient/terraform/aws/resource.tf b/pkg/infraClient/terraform/aws/resource.tf deleted file mode 100644 index e1ec3ae56..000000000 --- a/pkg/infraClient/terraform/aws/resource.tf +++ /dev/null @@ -1,161 +0,0 @@ -terraform { - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 4.16" - } - } - - required_version = ">= 1.2.0" -} - -provider "aws" { - region = var.region - access_key = var.access_key - secret_key = var.secret_key -} - - -data "aws_ami" "latest-ubuntu" { - most_recent = true - owners = ["099720109477"] # Canonical - - filter { - name = "name" - values = ["ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*"] - } - - filter { - name = "virtualization-type" - values = ["hvm"] - } -} - - -resource "aws_security_group" "sg" { - # name = "${var.node_id}-sg" - - ingress { - from_port = 22 - protocol = "tcp" - to_port = 22 - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - from_port = 6443 - protocol = "tcp" - to_port = 6443 - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - from_port = 8472 - protocol = "udp" - to_port = 8472 - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - from_port = 9100 - protocol = "tcp" - to_port = 9100 - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - from_port = 51820 - protocol = "udp" - to_port = 51820 - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - from_port = 51821 - protocol = "udp" - to_port = 51821 - cidr_blocks = ["0.0.0.0/0"] - } - - - ingress { - from_port = 10250 - protocol = "tcp" - to_port = 10250 - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - from_port = 80 - protocol = "tcp" - to_port = 80 - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - from_port = 443 - protocol = "tcp" - to_port = 443 - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - from_port = 30000 - protocol = "tcp" - to_port = 32768 - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - from_port = 30000 - protocol = "udp" - to_port = 32768 - cidr_blocks = ["0.0.0.0/0"] - } - - - egress { - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - - # lifecycle { - # create_before_destroy = true - # } -} - - - -resource "aws_instance" "byoc-node" { - ami = var.ami == "" ? "${data.aws_ami.latest-ubuntu.id}" : var.ami - instance_type = var.instance_type - security_groups = [aws_security_group.sg.name] - - user_data = templatefile("./init.sh", { - pubkey = file("${var.keys-path}/access.pub") - # hostname = var.node_id - }) - - tags = { - Name = var.node_id - } - - root_block_device { - volume_size = 100 # in GB <<----- I increased this! - volume_type = "standard" - encrypted = false - # kms_key_id = data.aws_kms_key.customer_master_key.arn - } - -} - - -output "node-ip" { - value = aws_instance.byoc-node.public_ip -} - -output "node-name" { - value = var.node_id -} diff --git a/pkg/infraClient/terraform/aws/variables.tf b/pkg/infraClient/terraform/aws/variables.tf deleted file mode 100644 index 456101f16..000000000 --- a/pkg/infraClient/terraform/aws/variables.tf +++ /dev/null @@ -1,31 +0,0 @@ -variable "access_key" { - default = "" -} - -variable "secret_key" { - default = "" -} - -variable "region" { - default = "" -} - -variable "node_id" { - default = "" -} - -variable "instance_type" { - default = "" -} - -variable "pubkey" { - default = "" -} - -variable "keys-path" { - default = "" -} - -variable "ami" { - default = "" -} diff --git a/pkg/infraClient/terraform/do/init.sh b/pkg/infraClient/terraform/do/init.sh deleted file mode 100644 index e0a23d369..000000000 --- a/pkg/infraClient/terraform/do/init.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -cat > /root/.ssh/authorized_keys << EOF -${pubkey} -EOF - -echo "curl -sfL https://get.k3s.io | sh -s - \$@" > /tmp/k3s-install.sh && chomod +x /tmp/k3s-install.sh diff --git a/pkg/infraClient/terraform/do/resource.tf b/pkg/infraClient/terraform/do/resource.tf deleted file mode 100644 index 792dfdea0..000000000 --- a/pkg/infraClient/terraform/do/resource.tf +++ /dev/null @@ -1,36 +0,0 @@ -terraform { - required_providers { - digitalocean = { - source = "digitalocean/digitalocean" - version = "2.22.3" - } - tls = { - source = "hashicorp/tls" - version = "4.0.3" - } - } -} - -provider "digitalocean" { - token = var.do-token -} - -resource "digitalocean_droplet" "byoc-node" { - image = var.do-image-id - name = var.nodeId - region = var.region - size = var.size - ssh_keys = var.ssh_keys - user_data = templatefile("./init.sh", { - pubkey = file("${var.keys-path}/access.pub") - }) - -} - -output "node-ip" { - value = digitalocean_droplet.byoc-node.ipv4_address -} - -output "node-name" { - value = digitalocean_droplet.byoc-node.name -} diff --git a/pkg/infraClient/terraform/do/variables.tf b/pkg/infraClient/terraform/do/variables.tf deleted file mode 100644 index f78fac56b..000000000 --- a/pkg/infraClient/terraform/do/variables.tf +++ /dev/null @@ -1,40 +0,0 @@ -variable "cluster-id" { - default = "kl" -} - -variable "do-token" { - default = "" -} - -variable "accountId" { - default = "" -} - -variable "nodeId" { - default = "" -} - -variable "size" { - default = "s-4vcpu-8gb" -} - -variable "region" { - default = "blr1" -} - -variable "keys-path" { - # default = "" -} - -# variable "pubkey" { -# # default = "" -# } - -variable "do-image-id" { - default = "ubuntu-22-10-x64" - # default = "105910703" -} - -variable "ssh_keys" { - default = ["25:d8:56:2b:70:15:43:c5:dd:e2:ff:d7:47:1b:68:22"] -} diff --git a/pkg/infraClient/terraform/e b/pkg/infraClient/terraform/e deleted file mode 100644 index fda47e4f0..000000000 --- a/pkg/infraClient/terraform/e +++ /dev/null @@ -1 +0,0 @@ -export SECRETS=***REMOVED*** diff --git a/pkg/infraClient/terraform/secrets.yml b/pkg/infraClient/terraform/secrets.yml deleted file mode 100644 index 8c5f7afb0..000000000 --- a/pkg/infraClient/terraform/secrets.yml +++ /dev/null @@ -1,2 +0,0 @@ -joinToken: ***REMOVED*** -endPointUrl: ***REMOVED*** diff --git a/pkg/k8s/api-extensions.go b/pkg/k8s/api-extensions.go deleted file mode 100644 index 7ee87af99..000000000 --- a/pkg/k8s/api-extensions.go +++ /dev/null @@ -1,123 +0,0 @@ -package k8s - -import ( - "context" - "encoding/json" - "fmt" - - "github.com/xeipuuv/gojsonschema" - apiExtensionsV1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/rest" - "kloudlite.io/pkg/errors" - fn "kloudlite.io/pkg/functions" - "sigs.k8s.io/controller-runtime/pkg/client" -) - -type InvalidSchemaError struct { - err error - errMsgs []string -} - -func (ise InvalidSchemaError) Error() string { - m := map[string]any{ - "message": ise.err.Error(), - "type": "InvalidData", - "validationErrors": ise.errMsgs, - } - b, err := json.Marshal(m) - if err != nil { - fmt.Println("[UNEXPECTED] failed to marshal InvalidSchemaError", err) - return ise.err.Error() - } - return string(b) -} - -func NewInvalidSchemaError(err error, errMsgs []string) InvalidSchemaError { - return InvalidSchemaError{err: err, errMsgs: errMsgs} -} - -type ExtendedK8sClient interface { - GetCRDJsonSchema(ctx context.Context, name string) (*apiExtensionsV1.JSONSchemaProps, error) - ValidateStruct(ctx context.Context, obj client.Object) error -} - -type extendedK8sClient struct { - client *clientset.Clientset -} - -func (e extendedK8sClient) GetCRDJsonSchema(ctx context.Context, name string) (*apiExtensionsV1.JSONSchemaProps, error) { - crd, err := e.client.ApiextensionsV1().CustomResourceDefinitions().Get(ctx, name, metav1.GetOptions{}) - if err != nil { - return nil, err - } - return crd.Spec.Versions[0].Schema.OpenAPIV3Schema, nil -} - -func (e extendedK8sClient) ValidateStruct(ctx context.Context, obj client.Object) error { - gvk := obj.GetObjectKind().GroupVersionKind() - - input, err := json.Marshal(obj) - if err != nil { - return errors.NewEf(err, "failed to marshal input struct") - } - documentLoader := gojsonschema.NewBytesLoader(input) - - crd, err := e.client.ApiextensionsV1().CustomResourceDefinitions().Get(ctx, - fmt.Sprintf("%s.%s", fn.RegularPlural(gvk.Kind), gvk.Group), metav1.GetOptions{}) - if err != nil { - return err - } - - var props apiExtensionsV1.JSONSchemaProps = crd.Spec.Versions[0].Schema.OpenAPIV3Schema.Properties["metadata"] - props.Required = []string{"name"} - if crd.Spec.Scope == apiExtensionsV1.NamespaceScoped { - props.Required = append(props.Required, "namespace") - } - - props.Properties = map[string]apiExtensionsV1.JSONSchemaProps{ - "name": { - Type: gojsonschema.TYPE_STRING, - MinLength: fn.New(int64(1)), - MaxLength: fn.New(int64(63)), - }, - "namespace": { - Type: gojsonschema.TYPE_STRING, - MinLength: fn.New(int64(1)), - MaxLength: fn.New(int64(63)), - }, - } - crd.Spec.Versions[0].Schema.OpenAPIV3Schema.Properties["metadata"] = props - - b, err := json.Marshal(crd.Spec.Versions[0].Schema.OpenAPIV3Schema) - if err != nil { - return err - } - - schemaLoader := gojsonschema.NewBytesLoader(b) - - result, err := gojsonschema.Validate(schemaLoader, documentLoader) - if err != nil { - return err - } - - if !result.Valid() { - errMsgs := make([]string, 0, len(result.Errors())) - for _, err := range result.Errors() { - errMsgs = append(errMsgs, err.String()) - } - return NewInvalidSchemaError(fmt.Errorf("document is invalid"), errMsgs) - } - return nil -} - -func NewExtendedK8sClient(config *rest.Config) (ExtendedK8sClient, error) { - client, err := clientset.NewForConfig(config) - if err != nil { - return nil, err - } - return &extendedK8sClient{ - client: client, - }, nil -} diff --git a/pkg/k8s/client.go b/pkg/k8s/client.go new file mode 100644 index 000000000..bc573ec20 --- /dev/null +++ b/pkg/k8s/client.go @@ -0,0 +1,166 @@ +package k8s + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/kloudlite/api/pkg/errors" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/operator/pkg/kubectl" + "github.com/xeipuuv/gojsonschema" + apiExtensionsV1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/types" + clientgoscheme "k8s.io/client-go/kubernetes/scheme" + "k8s.io/client-go/rest" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +type Client interface { + // client go like + Get(ctx context.Context, nn types.NamespacedName, obj client.Object) error + Create(ctx context.Context, obj client.Object) error + Update(ctx context.Context, obj client.Object) error + Delete(ctx context.Context, obj client.Object) error + + // custom ones + ValidateObject(ctx context.Context, obj client.Object) error + + ApplyYAML(ctx context.Context, yamls ...[]byte) error + DeleteYAML(ctx context.Context, yamls ...[]byte) error +} + +type clientHandler struct { + kclient client.Client + kclientset *clientset.Clientset + yamlclient kubectl.YAMLClient +} + +// Delete implements Client. +func (ch *clientHandler) Delete(ctx context.Context, obj client.Object) error { + return ch.kclient.Delete(ctx, obj) +} + +// Update implements Client. +func (ch *clientHandler) Update(ctx context.Context, obj client.Object) error { + return ch.kclient.Update(ctx, obj) +} + +// CreateOrUpdate implements Client. +func (ch *clientHandler) Create(ctx context.Context, obj client.Object) error { + return ch.kclient.Create(ctx, obj) +} + +// Get implements Client. +func (c *clientHandler) Get(ctx context.Context, nn types.NamespacedName, obj client.Object) error { + return c.kclient.Get(ctx, nn, obj) +} + +// ValidateObject implements Client. +func (c *clientHandler) ValidateObject(ctx context.Context, obj client.Object) error { + gvk := obj.GetObjectKind().GroupVersionKind() + + input, err := json.Marshal(obj) + if err != nil { + return errors.NewEf(err, "failed to marshal input struct") + } + documentLoader := gojsonschema.NewBytesLoader(input) + + crd, err := c.kclientset.ApiextensionsV1().CustomResourceDefinitions().Get(ctx, + fmt.Sprintf("%s.%s", fn.RegularPlural(gvk.Kind), gvk.Group), metav1.GetOptions{}) + if err != nil { + return errors.NewE(err) + } + + var props apiExtensionsV1.JSONSchemaProps = crd.Spec.Versions[0].Schema.OpenAPIV3Schema.Properties["metadata"] + props.Required = []string{"name"} + if crd.Spec.Scope == apiExtensionsV1.NamespaceScoped { + props.Required = append(props.Required, "namespace") + } + + props.Properties = map[string]apiExtensionsV1.JSONSchemaProps{ + "name": { + Type: gojsonschema.TYPE_STRING, + Pattern: `^[a-z0-9]([-a-z0-9]*[a-z0-9])?([.][a-z0-9]([-a-z0-9]*[a-z0-9])?)*$`, // source, kubectl apply with an incorrect name + MinLength: fn.New(int64(1)), + MaxLength: fn.New(int64(63)), + }, + "namespace": { + Type: gojsonschema.TYPE_STRING, + MinLength: fn.New(int64(1)), + MaxLength: fn.New(int64(63)), + }, + } + crd.Spec.Versions[0].Schema.OpenAPIV3Schema.Properties["metadata"] = props + + b, err := json.Marshal(crd.Spec.Versions[0].Schema.OpenAPIV3Schema) + if err != nil { + return errors.NewE(err) + } + + schemaLoader := gojsonschema.NewBytesLoader(b) + + result, err := gojsonschema.Validate(schemaLoader, documentLoader) + if err != nil { + return errors.NewE(err) + } + + if !result.Valid() { + errMsgs := make([]string, 0, len(result.Errors())) + for _, err := range result.Errors() { + errMsgs = append(errMsgs, err.String()) + } + return NewInvalidSchemaError(errors.Newf("document is invalid"), errMsgs) + } + return nil +} + +// ApplyYAML implements Client. +func (c *clientHandler) ApplyYAML(ctx context.Context, yamls ...[]byte) error { + if _, err := c.yamlclient.ApplyYAML(ctx, yamls...); err != nil { + return errors.NewE(err) + } + return nil +} + +// DeleteYAML implements Client. +func (c *clientHandler) DeleteYAML(ctx context.Context, yamls ...[]byte) error { + return c.yamlclient.DeleteYAML(ctx, yamls...) +} + +func NewClient(cfg *rest.Config, scheme *runtime.Scheme) (Client, error) { + if scheme == nil { + scheme = runtime.NewScheme() + } + + if err := clientgoscheme.AddToScheme(scheme); err != nil { + fmt.Println(err) + } + + c, err := client.New(cfg, client.Options{ + Scheme: scheme, + Mapper: nil, + }) + if err != nil { + return nil, errors.NewE(err) + } + + cs, err := clientset.NewForConfig(cfg) + if err != nil { + return nil, errors.NewE(err) + } + + yamlclient, err := kubectl.NewYAMLClient(cfg, kubectl.YAMLClientOpts{}) + if err != nil { + return nil, errors.NewE(err) + } + + return &clientHandler{ + kclient: c, + kclientset: cs, + yamlclient: yamlclient, + }, nil +} diff --git a/pkg/k8s/api-client.go b/pkg/k8s/helper-functions.go similarity index 81% rename from pkg/k8s/api-client.go rename to pkg/k8s/helper-functions.go index 21357e842..7acf1298a 100644 --- a/pkg/k8s/api-client.go +++ b/pkg/k8s/helper-functions.go @@ -2,28 +2,33 @@ package k8s import ( "encoding/json" - "fmt" + "github.com/kloudlite/api/pkg/errors" + "os" + "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/tools/clientcmd/api" - "os" ) +func RestInclusterConfig() (*rest.Config, error) { + return rest.InClusterConfig() +} + func RestConfigFromEnv(envVar string) (*rest.Config, error) { kcfgPath, ok := os.LookupEnv(envVar) if !ok { - return nil, fmt.Errorf("KUBECONFIG env variable is not set") + return nil, errors.Newf("KUBECONFIG env variable is not set") } return clientcmd.BuildConfigFromKubeconfigGetter("", func() (*api.Config, error) { b, err := os.ReadFile(kcfgPath) if err != nil { - return nil, err + return nil, errors.NewE(err) } var kubeconfig api.Config if err := json.Unmarshal(b, &kubeconfig); err != nil { - return nil, err + return nil, errors.NewE(err) } return &kubeconfig, nil @@ -34,13 +39,9 @@ func RestConfigFromKubeConfig(b []byte) (*rest.Config, error) { return clientcmd.BuildConfigFromKubeconfigGetter("", func() (*api.Config, error) { var kubeconfig api.Config if err := json.Unmarshal(b, &kubeconfig); err != nil { - return nil, err + return nil, errors.NewE(err) } return &kubeconfig, nil }) } - -func RestInclusterConfig() (*rest.Config, error) { - return rest.InClusterConfig() -} diff --git a/pkg/k8s/types.go b/pkg/k8s/types.go new file mode 100644 index 000000000..ecace4a14 --- /dev/null +++ b/pkg/k8s/types.go @@ -0,0 +1,29 @@ +package k8s + +import ( + "encoding/json" + "fmt" +) + +type InvalidSchemaError struct { + err error + errMsgs []string +} + +func (ise InvalidSchemaError) Error() string { + m := map[string]any{ + "message": ise.err.Error(), + "type": "InvalidData", + "validationErrors": ise.errMsgs, + } + b, err := json.Marshal(m) + if err != nil { + fmt.Println("[UNEXPECTED] failed to marshal InvalidSchemaError", err) + return ise.err.Error() + } + return string(b) +} + +func NewInvalidSchemaError(err error, errMsgs []string) InvalidSchemaError { + return InvalidSchemaError{err: err, errMsgs: errMsgs} +} diff --git a/pkg/k8s/utils.go b/pkg/k8s/utils.go deleted file mode 100644 index 334de22d4..000000000 --- a/pkg/k8s/utils.go +++ /dev/null @@ -1,10 +0,0 @@ -package k8s - -import ( - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/rest" -) - -func NewClientSet(cfg *rest.Config) (*kubernetes.Clientset, error) { - return kubernetes.NewForConfig(cfg) -} diff --git a/pkg/k8s/without-kubectl.go b/pkg/k8s/without-kubectl.go deleted file mode 100644 index c219901d1..000000000 --- a/pkg/k8s/without-kubectl.go +++ /dev/null @@ -1,134 +0,0 @@ -package k8s - -import ( - "bytes" - "context" - "io" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/api/meta" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/serializer/yaml" - yamlutil "k8s.io/apimachinery/pkg/util/yaml" - "k8s.io/client-go/dynamic" - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/rest" - "k8s.io/client-go/restmapper" - - "k8s.io/apimachinery/pkg/types" -) - -type YAMLClient struct { - k8sClient *kubernetes.Clientset - dynamicClient dynamic.Interface - restMapper meta.RESTMapper -} - -func (yc *YAMLClient) ApplyYAML(ctx context.Context, yamls ...[]byte) error { - jYamls := bytes.Join(yamls, []byte("\n---\n")) - decoder := yamlutil.NewYAMLOrJSONDecoder(bytes.NewReader(jYamls), 200) - for { - var rawObj runtime.RawExtension - if err := decoder.Decode(&rawObj); err != nil { - if err != io.EOF { - return err - } - break - } - - if rawObj.Raw == nil { - continue - } - - obj, gvk, err := yaml.NewDecodingSerializer(unstructured.UnstructuredJSONScheme).Decode(rawObj.Raw, nil, nil) - if err != nil { - return err - } - unstructuredMap, err := runtime.DefaultUnstructuredConverter.ToUnstructured(obj) - if err != nil { - // log.Fatal(err) - return err - } - - unstructuredObj := &unstructured.Unstructured{Object: unstructuredMap} - - var dri dynamic.ResourceInterface - - mapping, err := yc.restMapper.RESTMapping(gvk.GroupKind(), gvk.Version) - if err != nil { - // log.Fatal(err) - return err - } - if mapping.Scope.Name() == meta.RESTScopeNameNamespace { - if unstructuredObj.GetNamespace() == "" { - unstructuredObj.SetNamespace("default") - } - dri = yc.dynamicClient.Resource(mapping.Resource).Namespace(unstructuredObj.GetNamespace()) - } else { - dri = yc.dynamicClient.Resource(mapping.Resource) - } - - if _, err := dri.Patch( - context.Background(), - unstructuredObj.GetName(), - types.MergePatchType, - rawObj.Raw, - metav1.PatchOptions{}, - ); err != nil { - if errors.IsNotFound(err) { - if _, err := dri.Create(ctx, unstructuredObj, metav1.CreateOptions{}); err != nil { - // log.Fatal(err) - return err - } - continue - } - // log.Fatal(err) - return err - } - } - return nil -} - -func (yc *YAMLClient) GetSecret(ctx context.Context, namespace, name string) (*corev1.Secret, error) { - return yc.k8sClient.CoreV1().Secrets(namespace).Get(ctx, name, metav1.GetOptions{}) -} - -func (yc *YAMLClient) GetConfigMap(ctx context.Context, namespace, name string) (*corev1.ConfigMap, error) { - return yc.k8sClient.CoreV1().ConfigMaps(namespace).Get(ctx, name, metav1.GetOptions{}) -} - -func NewYAMLClient(config *rest.Config) (*YAMLClient, error) { - c, err := kubernetes.NewForConfig(config) - if err != nil { - return nil, err - } - - dc, err := dynamic.NewForConfig(config) - if err != nil { - return nil, err - } - - gr, err := restmapper.GetAPIGroupResources(c.Discovery()) - if err != nil { - // log.Fatal(err) - return nil, err - } - - mapper := restmapper.NewDiscoveryRESTMapper(gr) - - return &YAMLClient{ - k8sClient: c, - dynamicClient: dc, - restMapper: mapper, - }, nil -} - -func NewYAMLClientOrDie(config *rest.Config) *YAMLClient { - client, err := NewYAMLClient(config) - if err != nil { - panic(err) - } - return client -} diff --git a/pkg/kubeapi/acount-nodes.go b/pkg/kubeapi/acount-nodes.go index 612bf4267..04e6a29be 100644 --- a/pkg/kubeapi/acount-nodes.go +++ b/pkg/kubeapi/acount-nodes.go @@ -5,6 +5,7 @@ import ( "context" "encoding/json" "fmt" + "github.com/kloudlite/api/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "os" "os/exec" @@ -57,7 +58,7 @@ func (c *Client) GetAccountNodes(ctx context.Context, edgeId string) (*AccountNo var nodeList AccountNodeList if err := json.Unmarshal(stdout.Bytes(), &nodeList); err != nil { - return nil, err + return nil, errors.NewE(err) } return &nodeList, nil diff --git a/pkg/kubeapi/main.go b/pkg/kubeapi/main.go index b9b91246d..1064c7000 100644 --- a/pkg/kubeapi/main.go +++ b/pkg/kubeapi/main.go @@ -5,6 +5,7 @@ import ( "context" "encoding/json" "fmt" + "github.com/kloudlite/api/pkg/errors" "os" "os/exec" @@ -29,7 +30,7 @@ func (c *Client) GetSecret(ctx context.Context, namespace, name string) (*v1.Sec var secret v1.Secret if err := json.Unmarshal(stdout.Bytes(), &secret); err != nil { - return nil, err + return nil, errors.NewE(err) } return &secret, nil diff --git a/pkg/cache/client.go b/pkg/kv/client.go similarity index 64% rename from pkg/cache/client.go rename to pkg/kv/client.go index 78235c5b7..976a00281 100644 --- a/pkg/cache/client.go +++ b/pkg/kv/client.go @@ -1,4 +1,4 @@ -package cache +package kv import ( "context" @@ -18,6 +18,14 @@ type Repo[T any] interface { Set(c context.Context, key string, value T) error SetWithExpiry(c context.Context, key string, value T, duration time.Duration) error Get(c context.Context, key string) (T, error) + ErrKeyNotFound(err error) bool + Drop(c context.Context, key string) error +} + +type BinaryDataRepo interface { + Set(c context.Context, key string, value []byte) error + SetWithExpiry(c context.Context, key string, value []byte, duration time.Duration) error + Get(c context.Context, key string) ([]byte, error) + ErrKeyNotFound(err error) bool Drop(c context.Context, key string) error - ErrNoRecord(err error) bool } diff --git a/pkg/kv/nats-kv-binary-repo.go b/pkg/kv/nats-kv-binary-repo.go new file mode 100644 index 000000000..0701bb481 --- /dev/null +++ b/pkg/kv/nats-kv-binary-repo.go @@ -0,0 +1,95 @@ +package kv + +import ( + "context" + "encoding/json" + "fmt" + "time" + + "github.com/kloudlite/api/pkg/nats" + "github.com/nats-io/nats.go/jetstream" + + "github.com/kloudlite/api/pkg/errors" +) + +type natsKVBinaryRepo struct { + keyValue jetstream.KeyValue +} + +type BinaryValue struct { + Data []byte + ExpiresAt time.Time +} + +func (v *BinaryValue) isExpired() bool { + if v.ExpiresAt.IsZero() { + return false + } + return time.Since(v.ExpiresAt) > 0 +} + +func (r *natsKVBinaryRepo) Set(c context.Context, key string, value []byte) error { + v := BinaryValue{ + Data: value, + } + b, err := json.Marshal(v) + if err != nil { + return errors.NewEf(err, "failed to marshal value") + } + if _, err := r.keyValue.Put(c, key, b); err != nil { + return errors.NewE(err) + } + return nil +} + +func (r *natsKVBinaryRepo) Get(c context.Context, key string) ([]byte, error) { + get, err := r.keyValue.Get(c, key) + if err != nil { + return nil, errors.NewE(err) + } + var value BinaryValue + err = json.Unmarshal(get.Value(), &value) + if value.isExpired() { + go func() { + if err = r.Drop(c, key); err != nil { + fmt.Printf("unable to drop key %s", key) + } + }() + return value.Data, errors.New("Key is expired") + } + return value.Data, errors.NewE(err) +} + +// ErrKeyNotFound implements BinaryDataRepo. +func (*natsKVBinaryRepo) ErrKeyNotFound(err error) bool { + return errors.Is(err, jetstream.ErrKeyNotFound) +} + +func (r *natsKVBinaryRepo) SetWithExpiry(c context.Context, key string, value []byte, duration time.Duration) error { + v := BinaryValue{ + Data: value, + ExpiresAt: time.Now().Add(duration), + } + b, err := json.Marshal(v) + if err != nil { + return errors.NewEf(err, "failed to marshal value") + } + if _, err := r.keyValue.Put(c, key, b); err != nil { + return errors.NewE(err) + } + return nil +} + +func (r *natsKVBinaryRepo) Drop(c context.Context, key string) error { + return r.keyValue.Delete(c, key) +} + +func NewNatsKVBinaryRepo(ctx context.Context, bucketName string, jc *nats.JetstreamClient) (BinaryDataRepo, error) { + value, err := jc.Jetstream.KeyValue(ctx, bucketName) + if err != nil { + return nil, err + } + return &natsKVBinaryRepo{ + value, + }, nil +} diff --git a/pkg/kv/nats-kv-repo.go b/pkg/kv/nats-kv-repo.go new file mode 100644 index 000000000..7e7990e47 --- /dev/null +++ b/pkg/kv/nats-kv-repo.go @@ -0,0 +1,105 @@ +package kv + +import ( + "context" + "encoding/json" + "fmt" + "github.com/kloudlite/api/pkg/nats" + "github.com/nats-io/nats.go/jetstream" + "strings" + "time" + + "github.com/kloudlite/api/pkg/errors" +) + +type natsKVRepo[T any] struct { + keyValue jetstream.KeyValue +} +type Value[T any] struct { + Data T + ExpiresAt time.Time +} + +func (v *Value[T]) isExpired() bool { + if v.ExpiresAt.IsZero() { + return false + } + return time.Since(v.ExpiresAt) > 0 +} + +func (r *natsKVRepo[T]) Set(c context.Context, _key string, value T) error { + key := sanitiseKey(_key) + v := Value[T]{ + Data: value, + } + b, err := json.Marshal(v) + if err != nil { + return errors.NewEf(err, "failed to marshal value") + } + if _, err := r.keyValue.Put(c, key, b); err != nil { + return errors.NewE(err) + } + return nil +} + +func (r *natsKVRepo[T]) Get(c context.Context, _key string) (T, error) { + key := sanitiseKey(_key) + get, err := r.keyValue.Get(c, key) + if err != nil { + var x T + return x, errors.NewE(err) + } + var value Value[T] + err = json.Unmarshal(get.Value(), &value) + if value.isExpired() { + go func() { + if err = r.Drop(c, key); err != nil { + fmt.Printf("unable to drop key %s", key) + } + }() + return value.Data, errors.New("Key is expired") + } + return value.Data, errors.NewE(err) +} + +func (r *natsKVRepo[T]) ErrKeyNotFound(err error) bool { + return errors.Is(err, jetstream.ErrKeyNotFound) +} + +func sanitiseKey(key string) string { + return strings.ReplaceAll(key, ":", "-") +} + +func (r *natsKVRepo[T]) SetWithExpiry(c context.Context, _key string, value T, duration time.Duration) error { + key := sanitiseKey(_key) + v := Value[T]{ + Data: value, + ExpiresAt: time.Now().Add(duration), + } + b, err := json.Marshal(v) + if err != nil { + return errors.NewEf(err, "failed to marshal value") + } + if _, err := r.keyValue.Put(c, key, b); err != nil { + return errors.NewE(err) + } + return nil +} + +func (r *natsKVRepo[T]) Drop(c context.Context, key string) error { + return r.keyValue.Delete(c, key) +} + +func (r *natsKVRepo[T]) ErrNoRecord(err error) bool { + return errors.Is(err, jetstream.ErrKeyNotFound) +} + +func NewNatsKVRepo[T any](ctx context.Context, bucketName string, jc *nats.JetstreamClient) (Repo[T], error) { + if value, err := jc.Jetstream.KeyValue(ctx, bucketName); err != nil { + return nil, errors.NewE(err) + } else { + return &natsKVRepo[T]{ + value, + }, nil + } +} diff --git a/pkg/cache/redis.go b/pkg/kv/redis.go similarity index 91% rename from pkg/cache/redis.go rename to pkg/kv/redis.go index 35c472433..282ecb26c 100644 --- a/pkg/cache/redis.go +++ b/pkg/kv/redis.go @@ -1,4 +1,4 @@ -package cache +package kv import ( "context" @@ -7,7 +7,7 @@ import ( "time" "github.com/go-redis/redis/v8" - "kloudlite.io/pkg/errors" + "github.com/kloudlite/api/pkg/errors" ) type RedisClient struct { @@ -28,7 +28,7 @@ func (c *RedisClient) Connect(ctx context.Context) error { func (c *RedisClient) Disconnect(context.Context) error { err := c.client.Close() if err != nil { - return err + return errors.NewE(err) } c.client = nil return nil @@ -51,10 +51,13 @@ func (c *RedisClient) Set(ctx context.Context, key string, value []byte) error { } func (c *RedisClient) Get(ctx context.Context, key string) ([]byte, error) { + if c.client == nil { + return nil, errors.Newf("redis client is not connected") + } status := c.client.Get(ctx, c.getKey(key)) err := status.Err() if err != nil { - return nil, err + return nil, errors.NewE(err) } return []byte(status.Val()), nil } @@ -75,6 +78,9 @@ func (c *RedisClient) SetWithExpiry( value []byte, duration time.Duration, ) error { + if c.client == nil { + return errors.Newf("redis client is not connected") + } k := c.getKey(key) err := c.client.Set(ctx, k, value, duration).Err() if err != nil { diff --git a/pkg/cache/repo.go b/pkg/kv/repo.go similarity index 84% rename from pkg/cache/repo.go rename to pkg/kv/repo.go index a7df90400..2b870f7ec 100644 --- a/pkg/cache/repo.go +++ b/pkg/kv/repo.go @@ -1,4 +1,4 @@ -package cache +package kv import ( "context" @@ -7,8 +7,8 @@ import ( "github.com/go-redis/redis/v8" + "github.com/kloudlite/api/pkg/errors" "go.uber.org/fx" - "kloudlite.io/pkg/errors" ) type redisRepo[T any] struct { @@ -27,17 +27,21 @@ func (r *redisRepo[T]) Get(c context.Context, key string) (T, error) { get, err := r.cli.Get(c, key) if err != nil { var x T - return x, err + return x, errors.NewE(err) } var value T err = json.Unmarshal(get, &value) - return value, err + return value, errors.NewE(err) +} + +func (r *redisRepo[T]) ErrKeyNotFound(err error) bool { + return errors.Is(err, redis.Nil) } func (r *redisRepo[T]) SetWithExpiry(c context.Context, key string, value T, duration time.Duration) error { marshal, err := json.Marshal(value) if err != nil { - return err + return errors.NewE(err) } err = r.cli.SetWithExpiry(c, key, marshal, duration) if err != nil { diff --git a/pkg/logging/http-logger.go b/pkg/logging/http-logger.go new file mode 100644 index 000000000..5131f1165 --- /dev/null +++ b/pkg/logging/http-logger.go @@ -0,0 +1,21 @@ +package logging + +import ( + "os" + + "github.com/rs/zerolog" +) + +type HttpLogger interface { +} + +type httpLogger struct { + zerolog.Logger +} + +func NewHttpLogger() HttpLogger { + z := zerolog.New(os.Stdout).With().Caller().Timestamp().Logger() + return &httpLogger{ + Logger: z, + } +} diff --git a/pkg/logging/logger.go b/pkg/logging/logger.go index c1552264a..a5e0d8290 100644 --- a/pkg/logging/logger.go +++ b/pkg/logging/logger.go @@ -1,38 +1,38 @@ package logging import ( - "fmt" + "os" "go.uber.org/zap" "go.uber.org/zap/zapcore" ) -// type Logger interface { -// Debugf(msg string, args ...any) -// Infof(msg string, args ...any) -// Errorf(err error, msg string, args ...any) -// Warnf(msg string, args ...any) -// WithName(name string) Logger -// WithKV(keyValuePairs ...any) Logger -// } +type Logger interface { + Debugf(msg string, args ...any) + Infof(msg string, args ...any) + Errorf(err error, args ...any) + Warnf(msg string, args ...any) + WithName(name string) Logger + WithKV(keyValuePairs ...any) Logger +} -type Logger struct { +type logger struct { zapLogger *zap.SugaredLogger } -func (c Logger) WithKV(keyValuePairs ...any) Logger { - return Logger{zapLogger: c.zapLogger.With(keyValuePairs...)} +func (c *logger) WithKV(keyValuePairs ...any) Logger { + return &logger{zapLogger: c.zapLogger.With(keyValuePairs...)} } -func (c Logger) Debugf(msg string, args ...any) { +func (c *logger) Debugf(msg string, args ...any) { c.zapLogger.Debugf(msg, args...) } -func (c Logger) Infof(msg string, args ...any) { +func (c *logger) Infof(msg string, args ...any) { c.zapLogger.Infof(msg, args...) } -func (c Logger) Errorf(err error, args ...string) { +func (c *logger) Errorf(err error, args ...any) { if len(args) > 0 { c.zapLogger.Error(err, args) return @@ -40,45 +40,69 @@ func (c Logger) Errorf(err error, args ...string) { c.zapLogger.Error(err) } -func (c Logger) Warnf(msg string, args ...any) { +func (c *logger) Warnf(msg string, args ...any) { c.zapLogger.Warnf(msg, args...) } -func (c Logger) WithName(name string) Logger { - return Logger{zapLogger: c.zapLogger.Named(name)} +func (c *logger) WithName(name string) Logger { + return &logger{zapLogger: c.zapLogger.Named(name)} } type Options struct { - Name string - Dev bool + Name string + Dev bool + CallerTrace bool } +var EmptyLogger *logger + func New(options *Options) (Logger, error) { opts := Options{} if options != nil { opts = *options } - zapConfig := func() zap.Config { + cfg := func() zapcore.EncoderConfig { if opts.Dev { - cfg := zap.NewDevelopmentConfig() - cfg.EncoderConfig.EncodeLevel = zapcore.CapitalColorLevelEncoder - cfg.EncoderConfig.LineEnding = "\n" - cfg.EncoderConfig.TimeKey = "" - cfg.EncoderConfig.EncodeCaller = func(caller zapcore.EntryCaller, enc zapcore.PrimitiveArrayEncoder) { - enc.AppendString(fmt.Sprintf("(%s) %s", caller.Function, caller.TrimmedPath())) - } + cfg := zap.NewDevelopmentEncoderConfig() + cfg.EncodeLevel = zapcore.CapitalColorLevelEncoder + cfg.LineEnding = "\n" + cfg.TimeKey = "" + return cfg } - return zap.NewProductionConfig() + pcfg := zap.NewProductionEncoderConfig() + pcfg.TimeKey = "" + pcfg.LineEnding = "\n" + return pcfg }() - logger, err := zapConfig.Build(zap.AddCallerSkip(1)) - if err != nil { - return Logger{}, err + + // if !opts.Dev { + // cfg.EncodeTime = func(ts time.Time, encoder zapcore.PrimitiveArrayEncoder) { + // encoder.AppendString(ts.UTC().Format(time.RFC3339)) + // } + // } + + loglevel := zapcore.InfoLevel + if opts.Dev { + loglevel = zapcore.DebugLevel + } + + zapOpts := make([]zap.Option, 0, 3) + zapOpts = append(zapOpts, zap.AddStacktrace(zap.DPanicLevel)) + + if !opts.Dev { + opts.CallerTrace = true + } + + if opts.CallerTrace { + zapOpts = append(zapOpts, zap.AddCaller(), zap.AddCallerSkip(1)) } - cLogger := Logger{zapLogger: logger.Sugar()} - if opts.Name != "" { - cLogger.zapLogger = cLogger.zapLogger.Named(opts.Name) + + lgr := zap.New(zapcore.NewCore(zapcore.NewConsoleEncoder(cfg), os.Stdout, loglevel), zapOpts...) + + cLogger := &logger{ + zapLogger: lgr.Sugar(), } return cLogger, nil } diff --git a/pkg/loki-client/client.go b/pkg/loki-client/client.go new file mode 100644 index 000000000..84d25d002 --- /dev/null +++ b/pkg/loki-client/client.go @@ -0,0 +1,223 @@ +package loki_client + +import ( + "context" + "encoding/json" + "fmt" + "github.com/kloudlite/api/pkg/errors" + "io" + "net/http" + "net/url" + "strconv" + "strings" + "time" + + fn "github.com/kloudlite/api/pkg/functions" +) + +type lokiClient struct { + url *url.URL + opts ClientOpts + clientCtx context.Context + cancelClientCtx context.CancelFunc +} + +func parseLastTimestamp(data *LogResult) (*uint64, error) { + var lastTimestamp uint64 + for _, result := range data.Data.Result { + for _, values := range result.Values { + val, err := strconv.ParseUint(values[0], 10, 64) + if err != nil { + return nil, errors.NewE(err) + } + if val > lastTimestamp { + val, err := strconv.ParseUint(values[0], 10, 64) + if err != nil { + return nil, errors.NewE(err) + } + lastTimestamp = val + } + } + } + + return &lastTimestamp, nil +} + +func doRequest(req *http.Request) ([]byte, error) { + get, err := http.DefaultClient.Do(req) + if err != nil { + return nil, errors.NewE(err) + } + + all, err := io.ReadAll(get.Body) + if err != nil { + return nil, errors.NewE(err) + } + + return all, nil +} + +func (l *lokiClient) createLokiHttpRequest(filter QueryArgs) (*http.Request, error) { + streamSelectorSplits := make([]string, 0) + for _, label := range filter.StreamSelectors { + streamSelectorSplits = append(streamSelectorSplits, label.Key+label.Operation+fmt.Sprintf("%q", label.Value)) + } + + query := url.Values{} + searchKeywordStr := "" + + if filter.SearchKeyword != nil { + searchKeywordStr = *filter.SearchKeyword + } + + query.Set("query", fmt.Sprintf("%v%v", fmt.Sprintf("{%v}", strings.Join(streamSelectorSplits, ",")), searchKeywordStr)) + query.Set("direction", "BACKWARD") + if filter.StartTime == nil { + filter.StartTime = fn.New(time.Now().Add(-time.Hour * 24 * 30)) + } + + query.Set("start", fmt.Sprintf("%d", filter.StartTime.UnixNano())) + if filter.EndTime != nil { + query.Set("end", fmt.Sprintf("%d", filter.EndTime.UnixNano())) + } + + if filter.LimitLength == nil { + filter.LimitLength = fn.New(1000) + } + + query.Set("limit", fmt.Sprintf("%d", *filter.LimitLength)) + + request, err := http.NewRequest(http.MethodGet, fmt.Sprintf("http://%s/loki/api/v1/query_range", l.url.Host), nil) + if err != nil { + return nil, errors.NewE(err) + } + + if l.opts.BasicAuth != nil { + request.SetBasicAuth(l.opts.BasicAuth.Username, l.opts.BasicAuth.Password) + } + + request.URL.RawQuery = query.Encode() + + return request, nil +} + +func (l *lokiClient) GetLogs(args QueryArgs) ([]byte, error) { + if l.clientCtx.Err() != nil { + return nil, l.clientCtx.Err() + } + + req, err := l.createLokiHttpRequest(args) + if err != nil { + return nil, errors.NewE(err) + } + + if l.opts.Logger != nil { + l.opts.Logger.Debugf("Loki Http Request URL: %s", req.URL.String()) + } + + b, err := doRequest(req) + if err != nil { + return nil, errors.NewE(err) + } + + if args.PreWriteFunc != nil { + var result LogResult + if err := json.Unmarshal(b, &result); err != nil { + return nil, errors.NewE(err) + } + + b2, err := args.PreWriteFunc(&result) + if err != nil { + return nil, errors.NewE(err) + } + return b2, nil + } + + return b, nil +} + +func (l *lokiClient) TailLogs(args QueryArgs, writer io.WriteCloser) error { + + req, err := l.createLokiHttpRequest(args) + if err != nil { + return errors.NewE(err) + } + + for { + if l.clientCtx.Err() != nil { + return l.clientCtx.Err() + } + + b, err := doRequest(req) + if err != nil { + return errors.NewE(err) + } + + var result LogResult + if err := json.Unmarshal(b, &result); err != nil { + return errors.NewE(err) + } + + lt, err := parseLastTimestamp(&result) + if err != nil { + return errors.NewE(err) + } + + if _, err := func() (int, error) { + if args.PreWriteFunc != nil { + b2, err := args.PreWriteFunc(&result) + if err != nil { + return 0, errors.NewE(err) + } + return writer.Write(b2) + } + return writer.Write(b) + }(); err != nil { + return errors.NewE(err) + } + + qp := req.URL.Query() + qp.Set("start", fmt.Sprintf("%d", (*lt)+1)) + qp.Del("limit") + qp.Del("end") + req.URL.RawQuery = qp.Encode() + + // sleeping cause, 5 seconds delay ain't that bad for logs + time.Sleep(5 * time.Second) + } +} + +func (l *lokiClient) Ping(ctx context.Context) error { + request, err := http.NewRequest(http.MethodGet, fmt.Sprintf("http://%s/ready", l.url.Host), nil) + if err != nil { + return errors.NewE(err) + } + r, err := http.DefaultClient.Do(request) + if err != nil { + return errors.NewE(err) + } + if r.StatusCode != http.StatusOK { + return errors.Newf("loki server is not ready, ping check failed with status code: %d", r.StatusCode) + } + return nil +} + +func (l *lokiClient) Close() { + l.cancelClientCtx() +} + +func NewLokiClient(httpAddr string, opts ClientOpts) (LokiClient, error) { + u, err := url.Parse(httpAddr) + if err != nil { + return nil, errors.NewE(err) + } + + ctx, cf := context.WithCancel(context.TODO()) + + return &lokiClient{ + url: u, + opts: opts, + clientCtx: ctx, + cancelClientCtx: cf, + }, nil +} diff --git a/pkg/loki-client/types.go b/pkg/loki-client/types.go new file mode 100644 index 000000000..619564c76 --- /dev/null +++ b/pkg/loki-client/types.go @@ -0,0 +1,53 @@ +package loki_client + +import ( + "context" + "io" + "time" + + "github.com/kloudlite/api/pkg/logging" +) + +type StreamSelector struct { + Key string + Value string + Operation string +} + +type BasicAuth struct { + Username string + Password string +} + +type ClientOpts struct { + Logger logging.Logger + BasicAuth *BasicAuth +} + +type PreWriteFunc func(log *LogResult) ([]byte, error) + +type QueryArgs struct { + StreamSelectors []StreamSelector + SearchKeyword *string + StartTime *time.Time + EndTime *time.Time + LimitLength *int + + PreWriteFunc PreWriteFunc +} + +type LogResult struct { + Data struct { + Result []struct { + Stream map[string]string `json:"stream,omitempty"` + Values [][]string `json:"values,omitempty"` + } `json:"result,omitempty"` + } `json:"data"` +} + +type LokiClient interface { + Ping(ctx context.Context) error + GetLogs(args QueryArgs) ([]byte, error) + TailLogs(args QueryArgs, writer io.WriteCloser) error + Close() +} diff --git a/pkg/loki-server/main.go b/pkg/loki-server/main.go index 3b7874e41..30db2d6b4 100644 --- a/pkg/loki-server/main.go +++ b/pkg/loki-server/main.go @@ -4,17 +4,18 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" + "github.com/gofiber/fiber/v2" + "github.com/kloudlite/api/pkg/errors" + "io" "net/http" "net/url" "strconv" "strings" "time" - "github.com/gofiber/fiber/v2" fWebsocket "github.com/gofiber/websocket/v2" "github.com/gorilla/websocket" - "go.uber.org/fx" + fn "github.com/kloudlite/api/pkg/functions" ) var upgrader = websocket.Upgrader{} @@ -26,12 +27,16 @@ type StreamSelector struct { } type LokiClient interface { - Tail(clusterId string, streamSelectors []StreamSelector, filter *string, start, end *int64, limit *int, connection *fWebsocket.Conn) error + Ping(ctx context.Context) error + Tail(streamSelectors []StreamSelector, filter *string, startTime, endTime *time.Time, limitLength *int, connection *fWebsocket.Conn) error + Close() } type lokiClient struct { - url *url.URL - opts ClientOpts + url *url.URL + opts ClientOpts + clientCtx context.Context + cancelClientCtx context.CancelFunc } type logResult struct { @@ -42,10 +47,10 @@ type logResult struct { } `json:"data"` } -func (l *lokiClient) Tail(clusterId string, streamSelectors []StreamSelector, filter *string, start, end *int64, limit *int, connection *fWebsocket.Conn) error { +func (l *lokiClient) Tail(streamSelectors []StreamSelector, filter *string, startTime, endTime *time.Time, limitLength *int, connection *fWebsocket.Conn) error { streamSelectorSplits := make([]string, 0) for _, label := range streamSelectors { - streamSelectorSplits = append(streamSelectorSplits, label.Key+label.Operation+fmt.Sprintf("\"%s\"", label.Value)) + streamSelectorSplits = append(streamSelectorSplits, label.Key+label.Operation+fmt.Sprintf("%q", label.Value)) } query := url.Values{} filterStr := "" @@ -54,57 +59,46 @@ func (l *lokiClient) Tail(clusterId string, streamSelectors []StreamSelector, fi } query.Set("query", fmt.Sprintf("%v%v", fmt.Sprintf("{%v}", strings.Join(streamSelectorSplits, ",")), filterStr)) query.Set("direction", "BACKWARD") - startTime := "" - if start != nil { - startTime = fmt.Sprintf("%v", start) - } else { - startTime = fmt.Sprintf("%v", time.Now().Add(-time.Hour*24*30).UnixNano()) + if startTime == nil { + startTime = fn.New(time.Now().Add(-time.Hour * 24 * 30)) } - query.Set("start", startTime) - if end != nil { - query.Set("end", fmt.Sprintf("%v", end)) + + query.Set("start", fmt.Sprintf("%d", startTime.UnixNano())) + if endTime != nil { + query.Set("end", fmt.Sprintf("%d", endTime.UnixNano())) } - if limit != nil { - query.Set("limit", fmt.Sprintf("%v", limit)) - } else { - query.Set("limit", fmt.Sprintf("%v", 1000)) + + if limitLength == nil { + limitLength = fn.New(1000) } + + query.Set("limit", fmt.Sprintf("%d", *limitLength)) + for { - request, err := http.NewRequest( - http.MethodGet, fmt.Sprintf("https://%s/loki/api/v1/query_range", strings.Replace(l.url.String(), "REPLACE_ME", clusterId, 1)), - nil, - ) + if l.clientCtx.Err() == nil { + return l.clientCtx.Err() + } + + request, err := http.NewRequest(http.MethodGet, fmt.Sprintf("http://%s/loki/api/v1/query_range", l.url.Host), nil) if err != nil { - return err + return errors.NewE(err) } + if l.opts.BasicAuth != nil { - username := func() string { - if l.opts.BasicAuth.Username == "" { - return clusterId - } - return l.opts.BasicAuth.Username - }() - request.SetBasicAuth(username, l.opts.BasicAuth.Password) + request.SetBasicAuth(l.opts.BasicAuth.Username, l.opts.BasicAuth.Password) } + request.URL.RawQuery = query.Encode() - // u := url.URL{Scheme: "http", Host: l.url.Host, Path: "/loki/api/v1/query_range", RawQuery: query.Encode()} - // get, err := http.Get(u.String()) get, err := http.DefaultClient.Do(request) if err != nil { - return err - } - all, _ := ioutil.ReadAll(get.Body) - var data struct { - Data struct { - Result []struct { - Values [][]string `json:"values,omitempty"` - } - } + return errors.NewE(err) } + all, _ := io.ReadAll(get.Body) + var data logResult err = json.Unmarshal(all, &data) if err != nil { - return err + return errors.NewE(err) } // fmt.Printf("DATA: %+v\n", data) // connection.WriteMessage(websocket.TextMessage, all) @@ -114,7 +108,7 @@ func (l *lokiClient) Tail(clusterId string, streamSelectors []StreamSelector, fi if values[0] > lastTimeStamp { val, err := strconv.ParseUint(values[0], 10, 64) if err != nil { - return err + return errors.NewE(err) } lastTimeStamp = fmt.Sprintf("%v", val+1) } @@ -123,19 +117,45 @@ func (l *lokiClient) Tail(clusterId string, streamSelectors []StreamSelector, fi query.Set("start", lastTimeStamp) query.Del("limit") query.Del("end") - connection.WriteMessage(websocket.TextMessage, all) + if err = connection.WriteMessage(websocket.TextMessage, all); err != nil { + fmt.Println("[ERROR]", err) + } time.Sleep(5 * time.Second) } } -func NewLokiClient(serverUrl string, opts ClientOpts) (LokiClient, error) { - u, err := url.Parse(serverUrl) +func (l *lokiClient) Ping(ctx context.Context) error { + request, err := http.NewRequest(http.MethodGet, fmt.Sprintf("http://%s/ready", l.url.Host), nil) + if err != nil { + return errors.NewE(err) + } + r, err := http.DefaultClient.Do(request) if err != nil { - return nil, err + return errors.NewE(err) + } + if r.StatusCode != http.StatusOK { + return errors.Newf("loki server is not ready, ping check failed with status code: %d", r.StatusCode) } + return nil +} + +func (l *lokiClient) Close() { + l.cancelClientCtx() +} + +func NewLokiClient(httpAddr string, opts ClientOpts) (LokiClient, error) { + u, err := url.Parse(httpAddr) + if err != nil { + return nil, errors.NewE(err) + } + + ctx, cf := context.WithCancel(context.TODO()) + return &lokiClient{ - url: u, - opts: opts, + url: u, + opts: opts, + clientCtx: ctx, + cancelClientCtx: cf, }, nil } @@ -146,50 +166,3 @@ type LokiClientOptions interface { GetLogServerPort() uint64 } -func NewLogServerFx[T LokiClientOptions]() fx.Option { - return fx.Module( - "loki-client", - fx.Provide( - func() LogServer { - return fiber.New() - }, - ), - fx.Invoke( - func(o T, app LogServer, lifecycle fx.Lifecycle) { - var a *fiber.App - a = app - lifecycle.Append( - fx.Hook{ - OnStart: func(ctx context.Context) error { - go a.Listen(fmt.Sprintf(":%v", o.GetLogServerPort())) - return nil - }, - OnStop: func(ctx context.Context) error { - return a.Shutdown() - }, - }, - ) - }, - ), - fx.Provide( - func(o T) (LokiClient, error) { - return NewLokiClient(o.GetLokiServerUrlAndOptions()) - }, - ), - fx.Invoke( - func(app LogServer, lokiServer LokiClient) { - var a *fiber.App - a = app - a.Use( - "/", func(c *fiber.Ctx) error { - if fWebsocket.IsWebSocketUpgrade(c) { - c.Locals("allowed", true) - return c.Next() - } - return fiber.ErrUpgradeRequired - }, - ) - }, - ), - ) -} diff --git a/pkg/mail/mail.go b/pkg/mail/mail.go new file mode 100644 index 000000000..820fe7fa7 --- /dev/null +++ b/pkg/mail/mail.go @@ -0,0 +1,31 @@ +package mail + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + "github.com/sendgrid/sendgrid-go" + "github.com/sendgrid/sendgrid-go/helpers/mail" +) + +type SendgridMailer struct { + client *sendgrid.Client +} + +func (s SendgridMailer) SendEmail(ctx context.Context, email Email) error { + if _, err := s.client.SendWithContext( + ctx, + mail.NewSingleEmail( + mail.NewEmail(email.FromName, email.FromEmailAddress), + email.Subject, + mail.NewEmail(email.ToName, email.ToEmailAddress), + email.PlainText, email.HtmlText, + ), + ); err != nil { + return errors.NewE(err) + } + return nil +} + +func NewSendgridMailer(apiKey string) Mailer { + return SendgridMailer{client: sendgrid.NewSendClient(apiKey)} +} diff --git a/pkg/mail/mailer.go b/pkg/mail/mailer.go deleted file mode 100644 index cc26f0aaf..000000000 --- a/pkg/mail/mailer.go +++ /dev/null @@ -1,13 +0,0 @@ -package mail - -type Mailer interface { - SendEmail( - from string, - fromName string, - subject string, - to string, - toName string, - plaintextContent string, - htmlContent string, - ) error -} diff --git a/pkg/mail/main.go b/pkg/mail/main.go deleted file mode 100644 index 67911e22b..000000000 --- a/pkg/mail/main.go +++ /dev/null @@ -1,51 +0,0 @@ -package mail - -import ( - "fmt" - "github.com/sendgrid/sendgrid-go" - "github.com/sendgrid/sendgrid-go/helpers/mail" - "go.uber.org/fx" -) - -type SendgridMailer struct { - client *sendgrid.Client -} - -func (s SendgridMailer) SendEmail( - from string, - fromName string, - subject string, - to string, - toName string, - plaintextContent string, - htmlContent string, -) error { - _, err := s.client.Send(mail.NewSingleEmail(mail.NewEmail(fromName, from), subject, mail.NewEmail(toName, to), plaintextContent, htmlContent)) - fmt.Println( - from, - fromName, - subject, - to, - toName, - plaintextContent, - htmlContent, err) - if err != nil { - return err - } - return nil -} - -func NewSendgridMailer(apiKey string) Mailer { - return SendgridMailer{client: sendgrid.NewSendClient(apiKey)} -} - -type SendgridMailerOptions interface { - GetSendGridApiKey() string -} - -func NewSendGridMailerFx[T SendgridMailerOptions]() fx.Option { - return fx.Module("mailer", fx.Provide(func(o T) Mailer { - fmt.Println("NewSendGridMailerFx", o.GetSendGridApiKey()) - return NewSendgridMailer(o.GetSendGridApiKey()) - })) -} diff --git a/pkg/mail/types.go b/pkg/mail/types.go new file mode 100644 index 000000000..6b7ee532d --- /dev/null +++ b/pkg/mail/types.go @@ -0,0 +1,17 @@ +package mail + +import "context" + +type Email struct { + FromEmailAddress string + FromName string + Subject string + ToEmailAddress string + ToName string + PlainText string + HtmlText string +} + +type Mailer interface { + SendEmail(ctx context.Context, email Email) error +} diff --git a/pkg/messaging/client.go b/pkg/messaging/client.go deleted file mode 100644 index 9bdca42c2..000000000 --- a/pkg/messaging/client.go +++ /dev/null @@ -1,31 +0,0 @@ -package messaging - -import "go.uber.org/fx" - -type KafkaClient interface { - GetBrokers() string -} - -type KafkaClientOptions interface { - GetBrokers() string -} - -type kafkaClient struct { - Brokers string -} - -func (k *kafkaClient) GetBrokers() string { - return k.Brokers -} - -func NewKafkaClient(brokers string) KafkaClient { - return &kafkaClient{ - Brokers: brokers, - } -} - -func NewKafkaClientFx[T KafkaClientOptions]() fx.Option { - return fx.Module("kafka", fx.Provide(func(env T) KafkaClient { - return NewKafkaClient(env.GetBrokers()) - })) -} diff --git a/pkg/messaging/consumer.go b/pkg/messaging/consumer.go new file mode 100644 index 000000000..45056ba3f --- /dev/null +++ b/pkg/messaging/consumer.go @@ -0,0 +1,15 @@ +package messaging + +import ( + "context" + + "github.com/kloudlite/api/pkg/messaging/nats" + "github.com/kloudlite/api/pkg/messaging/types" +) + +type Consumer interface { + Consume(consumeFn func(msg *types.ConsumeMsg) error, opts types.ConsumeOpts) error + Stop(ctx context.Context) error +} + +var _ Consumer = (*nats.JetstreamConsumer)(nil) diff --git a/pkg/messaging/examples/Taskfile.yml b/pkg/messaging/examples/Taskfile.yml new file mode 100644 index 000000000..838fc2718 --- /dev/null +++ b/pkg/messaging/examples/Taskfile.yml @@ -0,0 +1,16 @@ +version: 3 + +dotenv: + - .secrets/env + +tasks: + example:producer: + dir: ./nats-producer/ + cmds: + - go run . {{.CLI_ARGS}} + + example:consumer: + dir: ./nats-consumer/ + cmds: + - go run . {{.CLI_ARGS}} + diff --git a/pkg/messaging/examples/nats-consumer/main.go b/pkg/messaging/examples/nats-consumer/main.go new file mode 100644 index 000000000..10c49a5db --- /dev/null +++ b/pkg/messaging/examples/nats-consumer/main.go @@ -0,0 +1,53 @@ +package main + +import ( + "context" + "fmt" + "log" + "os" + + "github.com/kloudlite/api/pkg/messaging" + msg_nats "github.com/kloudlite/api/pkg/messaging/nats" + "github.com/kloudlite/api/pkg/messaging/types" + "github.com/kloudlite/api/pkg/nats" +) + +func main() { + var consumer messaging.Consumer + + natsUrl := os.Getenv("NATS_URL") + natsStream := os.Getenv("NATS_STREAM") + + nc, err := nats.NewClient(natsUrl, nats.ClientOpts{ + Name: "nats-consumer", + }) + if err != nil { + log.Fatal(err) + } + + jc, err := nats.NewJetstreamClient(nc) + if err != nil { + log.Fatal(err) + } + + subjectBase := fmt.Sprintf("resource-sync.*.*.platform.kloudlite-console.resource-update") + _ = subjectBase + + consumer, err = msg_nats.NewJetstreamConsumer(context.TODO(), jc, msg_nats.JetstreamConsumerArgs{ + Stream: natsStream, + ConsumerConfig: msg_nats.ConsumerConfig{ + FilterSubjects: []string{subjectBase}, + Name: "example-consumer", + Durable: "example-consumer", + Description: "this is a test consumer", + }, + }) + if err != nil { + log.Fatal(err) + } + + consumer.Consume(func(msg *types.ConsumeMsg) error { + log.Println(string(msg.Payload)) + return nil + }, types.ConsumeOpts{}) +} diff --git a/pkg/messaging/examples/nats-producer/main.go b/pkg/messaging/examples/nats-producer/main.go new file mode 100644 index 000000000..626d106dc --- /dev/null +++ b/pkg/messaging/examples/nats-producer/main.go @@ -0,0 +1,63 @@ +package main + +import ( + "context" + "fmt" + "log" + "os" + "time" + + "github.com/kloudlite/api/pkg/messaging" + msg_nats "github.com/kloudlite/api/pkg/messaging/nats" + "github.com/kloudlite/api/pkg/messaging/types" + "github.com/kloudlite/api/pkg/nats" +) + +func main() { + natsUrl := os.Getenv("NATS_URL") + // natsStream := os.Getenv("NATS_STREAM") + + nc, err := nats.NewClient(natsUrl, nats.ClientOpts{ + Name: "nats-producer", + }) + if err != nil { + log.Fatal(err) + } + + jc, err := nats.NewJetstreamClient(nc) + if err != nil { + log.Fatal(err) + } + + var producer messaging.Producer = msg_nats.NewJetstreamProducer(jc) + if err != nil { + log.Fatal(err) + } + + subjectBase := fmt.Sprintf("resource-sync.account-sasfa.cluster-asdfasf.platform.kloudlite-console.resource-update") + + fmt.Printf("subject base: %s\n", subjectBase) + + for i := 0; i < 1000; i++ { + if err := producer.Produce(context.TODO(), types.ProduceMsg{ + Subject: func() string { + if i%2 == 0 { + return fmt.Sprintf("%s.even", subjectBase) + } + return fmt.Sprintf("%s.odd", subjectBase) + }(), + Payload: func() []byte { + if i%2 == 0 { + return []byte(fmt.Sprintf("even: %d", i)) + } + return []byte(fmt.Sprintf("odd: %d", i)) + }(), + }); err != nil { + log.Fatal(err) + } + fmt.Printf("%d message sent\n", i+1) + time.Sleep(1 * time.Second) + } + + producer.Stop(context.TODO()) +} diff --git a/pkg/messaging/nats/jetstream-consumer.go b/pkg/messaging/nats/jetstream-consumer.go new file mode 100644 index 000000000..81f1f79aa --- /dev/null +++ b/pkg/messaging/nats/jetstream-consumer.go @@ -0,0 +1,116 @@ +package nats + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + "os" + "os/signal" + + "github.com/kloudlite/api/pkg/messaging/types" + "github.com/kloudlite/api/pkg/nats" + "github.com/nats-io/nats.go/jetstream" +) + +type JetstreamConsumer struct { + name string + client *nats.JetstreamClient + consumer jetstream.Consumer + consumeCtx jetstream.ConsumeContext +} + +// Consume implements messaging.Consumer. +func (jc *JetstreamConsumer) Consume(consumeFn func(msg *types.ConsumeMsg) error, opts types.ConsumeOpts) error { + cctx, err := jc.consumer.Consume(func(msg jetstream.Msg) { + mm, err := msg.Metadata() + if err != nil { + if err := msg.Nak(); err != nil { + jc.client.Logger.Errorf(err, "while consuming message from subject: %s, sending NACK", msg.Subject()) + return + } + return + } + + if err = msg.InProgress(); err != nil { + if err := msg.Nak(); err != nil { + jc.client.Logger.Errorf(err, "while consuming message from subject: %s, sending NACK", msg.Subject()) + return + } + return + } + + if err := consumeFn(&types.ConsumeMsg{ + Subject: msg.Subject(), + Timestamp: mm.Timestamp, + Payload: msg.Data(), + }); err != nil { + if opts.OnError == nil { + jc.client.Logger.Errorf(err, "while consuming message from subject: %s, sending NACK", msg.Subject()) + if err := msg.Nak(); err != nil { + jc.client.Logger.Errorf(err, "while consuming message from subject: %s, sending NACK", msg.Subject()) + return + } + return + } + + if opts.OnError != nil { + if err := opts.OnError(err); err != nil { + jc.client.Logger.Errorf(err, "while consuming message from subject: %s, sending NACK", msg.Subject()) + if err := msg.Nak(); err != nil { + jc.client.Logger.Errorf(err, "while consuming message from subject: %s, sending NACK", msg.Subject()) + return + } + return + } + } + } + + if err := msg.Ack(); err != nil { + jc.client.Logger.Errorf(err, "while consuming message from subject: %s, sending ACK", msg.Subject()) + return + } + jc.client.Logger.Infof("acknowledged message, stream: %s, consumer: %s", mm.Stream, mm.Consumer) + }) + if err != nil { + return errors.NewE(err) + } + + defer cctx.Stop() + + jc.consumeCtx = cctx + + quit := make(chan os.Signal, 1) + signal.Notify(quit, os.Interrupt) + s := <-quit + return errors.Newf("os signal: %s received, stopped consuming messages", s) +} + +// Stop implements Consumer. +func (nc *JetstreamConsumer) Stop(context.Context) error { + nc.consumeCtx.Stop() + return nil +} + +type ConsumerConfig jetstream.ConsumerConfig + +type JetstreamConsumerArgs struct { + Stream string + ConsumerConfig ConsumerConfig +} + +func NewJetstreamConsumer(ctx context.Context, jc *nats.JetstreamClient, args JetstreamConsumerArgs) (*JetstreamConsumer, error) { + s, err := jc.Jetstream.Stream(ctx, args.Stream) + if err != nil { + return nil, errors.NewE(err) + } + + c, err := s.CreateOrUpdateConsumer(ctx, jetstream.ConsumerConfig(args.ConsumerConfig)) + if err != nil { + return nil, errors.NewE(err) + } + + return &JetstreamConsumer{ + name: args.ConsumerConfig.Name, + client: jc, + consumer: c, + }, nil +} diff --git a/pkg/messaging/nats/jetstream-producer.go b/pkg/messaging/nats/jetstream-producer.go new file mode 100644 index 000000000..ab1b2f4d9 --- /dev/null +++ b/pkg/messaging/nats/jetstream-producer.go @@ -0,0 +1,60 @@ +package nats + +import ( + "context" + "fmt" + "github.com/kloudlite/api/pkg/errors" + "time" + + "github.com/kloudlite/api/pkg/messaging/types" + "github.com/kloudlite/api/pkg/nats" +) + +type JetstreamProducer struct { + client *nats.JetstreamClient +} + +// Stop implements messaging.Producer. +func (c *JetstreamProducer) Stop(ctx context.Context) error { + sctx, cf := context.WithTimeout(ctx, 5*time.Second) + defer cf() + + select { + case <-c.client.Jetstream.PublishAsyncComplete(): + fmt.Println("All Messages Acknowledged") + case <-sctx.Done(): + fmt.Println("server is dying, cannot wait more, Message Acknowledgement Timeout") + } + return nil +} + +// ProduceAsync implements messaging.Producer. +func (c *JetstreamProducer) ProduceAsync(ctx context.Context, msg types.ProduceMsg) error { + pa, err := c.client.Jetstream.PublishAsync(msg.Subject, msg.Payload) + if err != nil { + return errors.NewE(err) + } + + go func() { + fmt.Println("waiting for acknowledgement") + select { + case ack := <-pa.Ok(): + fmt.Println("Message Acknowledged, at stream: ", ack.Stream, " seq: ", ack.Sequence) + case <-pa.Err(): + fmt.Println("Message Failed to be Acknowledged") + } + }() + return nil +} + +// Produce implements messaging.Producer. +func (c *JetstreamProducer) Produce(ctx context.Context, msg types.ProduceMsg) error { + _, err := c.client.Jetstream.Publish(ctx, msg.Subject, msg.Payload) + return errors.NewE(err) +} + +func NewJetstreamProducer(jc *nats.JetstreamClient) *JetstreamProducer { + return &JetstreamProducer{ + client: jc, + } +} diff --git a/pkg/messaging/producer.go b/pkg/messaging/producer.go new file mode 100644 index 000000000..a8ec8b881 --- /dev/null +++ b/pkg/messaging/producer.go @@ -0,0 +1,17 @@ +package messaging + +import ( + "context" + + "github.com/kloudlite/api/pkg/messaging/nats" + "github.com/kloudlite/api/pkg/messaging/types" +) + +type Producer interface { + Produce(ctx context.Context, msg types.ProduceMsg) error + ProduceAsync(ctx context.Context, msg types.ProduceMsg) error + + Stop(ctx context.Context) error +} + +var _ Producer = (*nats.JetstreamProducer)(nil) diff --git a/pkg/messaging/types.go b/pkg/messaging/types.go deleted file mode 100644 index 0361c8ae4..000000000 --- a/pkg/messaging/types.go +++ /dev/null @@ -1,3 +0,0 @@ -package messaging - -type Json map[string]any diff --git a/pkg/messaging/types/types.go b/pkg/messaging/types/types.go new file mode 100644 index 000000000..6c5d2aedb --- /dev/null +++ b/pkg/messaging/types/types.go @@ -0,0 +1,41 @@ +package types + +import "time" + +type NatsJetstreamProduceMsg struct { + Subject string + Payload []byte +} + +type ProduceMsg struct { + Subject string + Payload []byte +} + +type ProducerOutput struct{} + +type ConsumeMsg struct { + Subject string + Timestamp time.Time + Payload []byte +} + +type ConsumerOutput struct{} + +type ErrShouldRetry struct { + Err error +} + +func (e ErrShouldRetry) Error() string { + return "error occurred" +} + +type ConsumeOpts struct { + /* OnError is called when an error occurs while consuming a message. + If OnError returns an error, then + the consumer will not commit that message, so that it will be queued again. + Otherwise, + the consumer will commit the message, so that it will not be consumed again + */ + OnError func(err error) error +} diff --git a/pkg/nats/client.go b/pkg/nats/client.go new file mode 100644 index 000000000..a6344bcbf --- /dev/null +++ b/pkg/nats/client.go @@ -0,0 +1,144 @@ +package nats + +import ( + "context" + "fmt" + "github.com/kloudlite/api/pkg/errors" + "time" + + "github.com/kloudlite/api/pkg/logging" + "github.com/nats-io/nats.go" +) + +type Client struct { + Conn *nats.Conn + logger logging.Logger +} + +// Close implements Client. +func (nc *Client) Close(ctx context.Context) error { + nc.Conn.Close() + return nil +} + +// expose these nats types, so that we can use them directly, without having to import nats.io/nats.go +type ( + Options nats.Options +) + +type ClientOpts struct { + CrdentialsFile string + // Options + + Name string + // https://pkg.go.dev/github.com/nats-io/nats.go#Options + Servers []string + Logger logging.Logger + + DisconnectedCB func() + ReconnectedCB func() + ConnectedCB func() + ClosedCB func() +} + +func NewClient(url string, opts ClientOpts) (*Client, error) { + if opts.Name == "" { + return nil, errors.Newf("opts.name is required") + } + + if opts.Logger == nil { + var err error + opts.Logger, err = logging.New(&logging.Options{ + Name: fmt.Sprintf("nats-client:%s", opts.Name), + Dev: true, + }) + if err != nil { + return nil, errors.NewE(err) + } + } + + connectOpts := []nats.Option{ + func(o *nats.Options) error { + // *o = nats.Options(opts.Options) + *o = nats.Options{ + Url: url, + Servers: func() []string { + // INFO: without setting this servers with the url, i am not able to connect to nats either hosted at synadia cloud, or my own helm installed cluster + serverUrlExists := false + for i := range opts.Servers { + if url == opts.Servers[i] { + serverUrlExists = true + } + } + + if !serverUrlExists { + opts.Servers = append(opts.Servers, url) + } + + return opts.Servers + }(), + Name: opts.Name, + Verbose: false, + Pedantic: false, + Secure: false, + AllowReconnect: true, + MaxReconnect: -1, + ReconnectWait: 3 * time.Second, + PingInterval: 3 * time.Second, + MaxPingsOut: 0, + ClosedCB: func(*nats.Conn) { + if opts.ClosedCB != nil { + opts.ClosedCB() + return + } + opts.Logger.Infof("[%s] connection closed with nats server", opts.Name) + }, + DisconnectedCB: func(*nats.Conn) { + if opts.DisconnectedCB != nil { + opts.DisconnectedCB() + return + } + opts.Logger.Infof("[%s] disconnected with nats server", opts.Name) + }, + ConnectedCB: func(*nats.Conn) { + if opts.ConnectedCB != nil { + opts.ConnectedCB() + return + } + opts.Logger.Infof("[%s] connected to nats server", opts.Name) + }, + ReconnectedCB: func(*nats.Conn) { + if opts.ReconnectedCB != nil { + opts.ReconnectedCB() + return + } + opts.Logger.Infof("[%s] reconnected to nats server", opts.Name) + }, + DiscoveredServersCB: func(c *nats.Conn) { + opts.Logger.Infof("[%s] discovered additional nats servers: %+v\n", c.DiscoveredServers()) + }, + AsyncErrorCB: func(_ *nats.Conn, sub *nats.Subscription, err error) { + opts.Logger.Warnf("[%s] async error received in subject(%s): %v", opts.Name, sub.Subject, err) + }, + RetryOnFailedConnect: true, + Compression: true, + } + + return nil + }, + } + + if opts.CrdentialsFile != "" { + connectOpts = append(connectOpts, nats.UserCredentials(opts.CrdentialsFile)) + } + + nc, err := nats.Connect(url, connectOpts...) + if err != nil { + return nil, errors.NewE(err) + } + + return &Client{ + Conn: nc, + logger: opts.Logger, + }, nil +} diff --git a/pkg/nats/jetstream-client.go b/pkg/nats/jetstream-client.go new file mode 100644 index 000000000..a4bc4ea3d --- /dev/null +++ b/pkg/nats/jetstream-client.go @@ -0,0 +1,72 @@ +package nats + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + + "github.com/kloudlite/api/pkg/logging" + "github.com/nats-io/nats.go/jetstream" +) + +type JetstreamClient struct { + Jetstream jetstream.JetStream + Logger logging.Logger +} + +type ConsumerManager interface { + GetConsumerInfo(ctx context.Context, stream string, consumer string) (*jetstream.ConsumerInfo, error) + ListConsumers(ctx context.Context, stream string) ([]*jetstream.ConsumerInfo, error) + DeleteConsumer(ctx context.Context, stream string, consumer string) error +} + +var _ ConsumerManager = (*JetstreamClient)(nil) + +// DeleteConsumer implements ConsumerManager. +func (jc *JetstreamClient) DeleteConsumer(ctx context.Context, stream string, consumer string) error { + err := jc.Jetstream.DeleteConsumer(ctx, stream, consumer) + return errors.NewE(err) +} + +// ListConsumers implements ConsumerManager. +func (jc *JetstreamClient) ListConsumers(ctx context.Context, stream string) ([]*jetstream.ConsumerInfo, error) { + s, err := jc.Jetstream.Stream(ctx, stream) + if err != nil { + return nil, errors.NewE(err) + } + + consumers := make([]*jetstream.ConsumerInfo, 0, 5) + + cil := s.ListConsumers(ctx) + for ci := range cil.Info() { + consumers = append(consumers, ci) + } + + return consumers, nil +} + +// GetConsumerInfo implements ConsumerManager +func (jc *JetstreamClient) GetConsumerInfo(ctx context.Context, stream string, consumer string) (*jetstream.ConsumerInfo, error) { + s, err := jc.Jetstream.Stream(ctx, stream) + if err != nil { + return nil, errors.NewE(err) + } + + c, err := s.Consumer(ctx, consumer) + if err != nil { + return nil, errors.NewE(err) + } + + return c.Info(ctx) +} + +func NewJetstreamClient(nc *Client) (*JetstreamClient, error) { + js, err := jetstream.New(nc.Conn) + if err != nil { + return nil, errors.NewE(err) + } + + return &JetstreamClient{ + Jetstream: js, + Logger: nc.logger, + }, nil +} diff --git a/pkg/nats/kv-manager.go b/pkg/nats/kv-manager.go new file mode 100644 index 000000000..c14b6c7b1 --- /dev/null +++ b/pkg/nats/kv-manager.go @@ -0,0 +1,52 @@ +package nats + +import ( + "context" + "github.com/kloudlite/api/pkg/errors" + "time" + + fn "github.com/kloudlite/api/pkg/functions" + "github.com/nats-io/nats.go/jetstream" +) + +type KeyValueManager struct { + jc *JetstreamClient +} + +func (kvm KeyValueManager) ListStores(ctx context.Context) []string { + kvml := kvm.jc.Jetstream.KeyValueStoreNames(ctx) + buckets := make([]string, 0, 2) + for e := range kvml.Name() { + buckets = append(buckets, e) + } + return buckets +} + +type CreateStoreArgs struct { + Replicas int + TTL *time.Duration + MaxValueSize *int32 + Description *string +} + +func (kvm KeyValueManager) CreateStore(ctx context.Context, store string, args CreateStoreArgs) error { + _, err := kvm.jc.Jetstream.CreateKeyValue(ctx, jetstream.KeyValueConfig{ + Bucket: store, + Description: fn.DefaultIfNil(args.Description), + MaxValueSize: fn.DefaultIfNil(args.MaxValueSize), + TTL: fn.DefaultIfNil(args.TTL), + Storage: jetstream.FileStorage, + Replicas: args.Replicas, + }) + return errors.NewE(err) +} + +func (kvm KeyValueManager) DeleteStore(ctx context.Context, store string) error { + return kvm.jc.Jetstream.DeleteKeyValue(ctx, store) +} + +func NewKeyValueManager(jc *JetstreamClient, bucketName string) (*KeyValueManager, error) { + return &KeyValueManager{ + jc: jc, + }, nil +} diff --git a/pkg/pdf/main.go b/pkg/pdf/main.go deleted file mode 100644 index 7043f30a8..000000000 --- a/pkg/pdf/main.go +++ /dev/null @@ -1,528 +0,0 @@ -package main - -import ( - "fmt" - - "github.com/signintech/gopdf" -) - -const topMargin = 40 -const leftMargin = 35.0 - -var effectiveWidth = gopdf.PageSizeA4.W - leftMargin*2 - -type Table struct { - Header []string - rows [][]string -} - -func main() { - pdf := gopdf.GoPdf{} - pdf.Start(gopdf.Config{ - PageSize: *gopdf.PageSizeA4, - }) - pdf.AddPage() - pdf.AddTTFFont("OpenSans-Regular", "./fonts/OpenSans-Regular.ttf") - pdf.AddTTFFont("OpenSans-Medium", "./fonts/OpenSans-Medium.ttf") - pdf.AddTTFFont("OpenSans-Bold", "./fonts/OpenSans-Bold.ttf") - pdf.AddTTFFont("OpenSans-Italic", "./fonts/OpenSans-Italic.ttf") - - base := func() { - pdf.SetFont("OpenSans-Regular", "", 12) - pdf.SetTextColor(71, 85, 105) - // pdf.SetTextColor(255, 0, 0) - } - - base() - header(&pdf) - - base() - fromAdress(&pdf) - - base() - forAddress(&pdf) - - base() - details(&pdf) - - base() - summary(&pdf) - - // pdf.SetY(pdf.GetY() + 55) - tableSection(&pdf, &Table{ - Header: []string{"Droplets", "Hours", "Start", "End", "$29.81"}, - rows: [][]string{ - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - }, - }) - - tableSection(&pdf, &Table{ - Header: []string{"Droplets", "Hours", "Start", "End", "$29.81"}, - rows: [][]string{ - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"remote-baby(s-4vcpu-8gb-amd)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - {"plaxlb (s-vcpu-1gb)", "744", "01-01 00:00", "01-01 00:00", "$29.81"}, - }, - }) - - setPage(&pdf) - - pdf.AddOutline("Kloudlite Bill") - pdf.WritePdf("hello.pdf") -} - -func setPage(goPdf *gopdf.GoPdf) { - goPdf.SetFont("OpenSans-Medium", "", 9) - - goPdf.SetX(gopdf.PageSizeA4.W - leftMargin - effectiveWidth/2) - goPdf.SetY(gopdf.PageSizeA4.H - topMargin) - - goPdf.CellWithOption(&gopdf.Rect{ - W: effectiveWidth / 2, - H: 30, - }, fmt.Sprintf("Page %v", goPdf.GetNumberOfPages()), gopdf.CellOption{ - Align: gopdf.Right, - }) -} - -func tableSection(goPdf *gopdf.GoPdf, table *Table) { - tableTop := goPdf.GetY() + 30 - - if tableTop >= gopdf.PageSizeA4.H-topMargin*2 { - setPage(goPdf) - goPdf.AddPage() - tableTop = topMargin - } - - titleText, hoursText, startText, endText, priceText := table.Header[0], table.Header[1], table.Header[2], table.Header[3], table.Header[4] - - goPdf.SetFont("OpenSans-Bold", "", 8) - // goPdf.SetTextColor(71, 85, 105) - goPdf.SetY(tableTop + 2) - goPdf.SetX(leftMargin) - goPdf.MultiCell(&gopdf.Rect{ - W: effectiveWidth/2 + leftMargin, - H: 20, - }, titleText) - - goPdf.SetY(tableTop + 2) - goPdf.SetX(leftMargin + 277) - - goPdf.MultiCell(&gopdf.Rect{ - W: effectiveWidth/2 + leftMargin, - H: 20, - }, hoursText) - - goPdf.SetY(tableTop + 2) - goPdf.SetX(leftMargin + 326) - - goPdf.MultiCell(&gopdf.Rect{ - W: effectiveWidth/2 + leftMargin, - H: 20, - }, startText) - - goPdf.SetY(tableTop + 2) - goPdf.SetX(leftMargin + 394) - - goPdf.MultiCell(&gopdf.Rect{ - W: effectiveWidth/2 + leftMargin, - H: 20, - }, endText) - - goPdf.SetY(tableTop + 2) - goPdf.SetX(gopdf.PageSizeA4.W - effectiveWidth/2 - leftMargin) - - goPdf.CellWithOption(&gopdf.Rect{ - W: effectiveWidth / 2, - H: 30, - }, priceText, gopdf.CellOption{ - Align: gopdf.Right, - }) - - goPdf.SetY(goPdf.GetY() + 19) - - goPdf.Line(leftMargin, goPdf.GetY(), gopdf.PageSizeA4.W-leftMargin, goPdf.GetY()) - - goPdf.SetY(goPdf.GetY() + 6) - - // for in table.rows - for _, row := range table.rows { - - titleText, hoursText, startText, endText, priceText := row[0], row[1], row[2], row[3], row[4] - - tableTop = goPdf.GetY() - - if tableTop >= gopdf.PageSizeA4.H-topMargin-15 { - setPage(goPdf) - goPdf.AddPage() - tableTop = topMargin - } - - goPdf.SetFont("OpenSans-Regular", "", 8) - // goPdf.SetTextColor(71, 85, 105) - goPdf.SetY(tableTop + 2) - goPdf.SetX(leftMargin) - goPdf.MultiCell(&gopdf.Rect{ - W: effectiveWidth/2 + leftMargin, - H: 20, - }, titleText) - - goPdf.SetY(tableTop + 2) - goPdf.SetX(leftMargin + 277) - - goPdf.MultiCell(&gopdf.Rect{ - W: effectiveWidth/2 + leftMargin, - H: 20, - }, hoursText) - - goPdf.SetY(tableTop + 2) - goPdf.SetX(leftMargin + 326) - - goPdf.MultiCell(&gopdf.Rect{ - W: effectiveWidth/2 + leftMargin, - H: 20, - }, startText) - - goPdf.SetY(tableTop + 2) - goPdf.SetX(leftMargin + 394) - - goPdf.MultiCell(&gopdf.Rect{ - W: effectiveWidth/2 + leftMargin, - H: 20, - }, endText) - - goPdf.SetY(tableTop + 2) - goPdf.SetX(gopdf.PageSizeA4.W - effectiveWidth/2 - leftMargin) - - goPdf.CellWithOption(&gopdf.Rect{ - W: effectiveWidth / 2, - H: 30, - }, priceText, gopdf.CellOption{ - Align: gopdf.Right, - }) - - goPdf.SetY(goPdf.GetY() + 19) - } -} - -func fromAdress(pdf *gopdf.GoPdf) { - pdf.SetFont("OpenSans-Bold", "", 8) - // pdf.SetTextColor(71, 85, 105) - pdf.SetY(pdf.GetY() + 31.5) - pdf.MultiCell(&gopdf.Rect{ - W: gopdf.PageSizeA4.W, - H: 20, - }, "From") - - pdf.SetY(pdf.GetY() + 3.9) - pdf.SetFont("OpenSans-Regular", "", 8.5) - - wrap, _ := pdf.SplitTextWithWordWrap("Kloudlite Inc, \n651 N Broad St, Suite 201, Middletown, \nDE 19709 US", gopdf.PageSizeA4.W/3) - for _, line := range wrap { - pdf.MultiCell(&gopdf.Rect{ - W: gopdf.PageSizeA4.W / 3, - H: 80, - }, line) - - pdf.SetY(pdf.GetY() + -1) - } -} - -func summary(pdf *gopdf.GoPdf) { - pdf.SetX(leftMargin) - pdf.SetY(topMargin + 245) - - pdf.SetFont("OpenSans-Medium", "", 12) - pdf.MultiCell(&gopdf.Rect{ - W: effectiveWidth, - H: 20, - }, "Summary") - - pdf.SetY(pdf.GetY() + 8) - pdf.SetStrokeColor(203, 213, 225) - // pdf.SetLineType("dotted") - pdf.SetLineWidth(0.5) - pdf.Line(leftMargin, pdf.GetY(), gopdf.PageSizeA4.W-leftMargin, pdf.GetY()) - - pdf.SetY(pdf.GetY() + 8) - - pdf.SetFont("OpenSans-Regular", "", 8.5) - pdf.Cell(&gopdf.Rect{ - W: effectiveWidth / 2, - H: 30, - }, "Total usage charges") - - pdf.SetFont("OpenSans-Medium", "", 8.5) - pdf.CellWithOption(&gopdf.Rect{ - W: effectiveWidth / 2, - H: 30, - }, "$444.89", gopdf.CellOption{ - Align: gopdf.Right, - }) - - pdf.SetY(pdf.GetY() + 19) - - pdf.SetStrokeColor(203, 213, 225) - pdf.Line(leftMargin, pdf.GetY(), gopdf.PageSizeA4.W-leftMargin, pdf.GetY()) - - pdf.SetFont("OpenSans-Bold", "", 12.5) - pdf.SetX(leftMargin) - pdf.SetY(pdf.GetY() + 9) - pdf.Cell(&gopdf.Rect{ - W: effectiveWidth / 2, - H: 30, - }, "Total due") - - pdf.SetFont("OpenSans-Bold", "", 12.5) - pdf.CellWithOption(&gopdf.Rect{ - W: effectiveWidth / 2, - H: 30, - }, "$444.89", gopdf.CellOption{ - Align: gopdf.Right, - }) - - pdf.SetFont("OpenSans-Regular", "", 8) - pdf.SetX(leftMargin) - - pdf.SetY(pdf.GetY() + 25) - pdf.Cell(&gopdf.Rect{ - W: effectiveWidth / 2, - H: 30, - }, "If you have a credit card on file, it will be automatically charged within 24 hours") - - pdf.SetY(pdf.GetY() + 39) - pdf.Line(leftMargin, pdf.GetY(), gopdf.PageSizeA4.W-leftMargin, pdf.GetY()) - - pdf.SetY(pdf.GetY() + 23) - pdf.SetX(leftMargin) - pdf.SetFont("OpenSans-Regular", "", 12.5) - pdf.Cell(&gopdf.Rect{ - W: effectiveWidth / 2, - H: 30, - }, "Product usage charges") - - pdf.SetY(pdf.GetY() + 19.5) - pdf.SetX(leftMargin) - pdf.SetFont("OpenSans-Italic", "", 8.75) - pdf.Cell(&gopdf.Rect{ - W: effectiveWidth / 2, - H: 30, - }, "Detailed usage infromation is avaailable via the API or can be downloaded from the billing section of your account") - - pdf.SetY(pdf.GetY() + 15) - -} - -func details(pdf *gopdf.GoPdf) { - pdf.SetFont("OpenSans-Bold", "", 8) - // pdf.SetTextColor(71, 85, 105) - pdf.SetX(effectiveWidth/2 + leftMargin) - pdf.SetY(topMargin + 81) - pdf.MultiCell(&gopdf.Rect{ - W: effectiveWidth / 2, - H: 20, - }, "Details") - - pdf.SetY(pdf.GetY() + 6.5) - - pdf.SetFont("OpenSans-Regular", "", 8.5) - - pdf.Cell(&gopdf.Rect{ - W: effectiveWidth / 4, - H: 100, - }, "Invoice Number") - - pdf.CellWithOption(&gopdf.Rect{ - W: effectiveWidth / 4, - H: 100, - }, "123456789", gopdf.CellOption{ - Align: gopdf.Right, - }) - pdf.Br(14) - pdf.SetX(gopdf.PageSizeA4.W / 2) - pdf.Cell(&gopdf.Rect{ - W: effectiveWidth / 4, - H: 100, - }, "Date of issue:") - pdf.CellWithOption(&gopdf.Rect{ - W: effectiveWidth / 4, - H: 100, - }, "February 1, 2022", gopdf.CellOption{ - Align: gopdf.Right, - }) - pdf.Br(14) - pdf.SetX(gopdf.PageSizeA4.W / 2) - pdf.Cell(&gopdf.Rect{ - W: effectiveWidth / 4, - H: 100, - }, "Payment due on:") - pdf.CellWithOption(&gopdf.Rect{ - W: effectiveWidth / 4, - H: 100, - }, "February 1, 2022", gopdf.CellOption{ - Align: gopdf.Right, - }) -} - -func forAddress(pdf *gopdf.GoPdf) { - pdf.SetFont("OpenSans-Bold", "", 8) - // pdf.SetTextColor(71, 85, 105) - pdf.SetY(pdf.GetY() + 15.5) - pdf.MultiCell(&gopdf.Rect{ - W: effectiveWidth/2 + leftMargin, - H: 20, - }, "For") - - pdf.SetY(pdf.GetY() + 5) - pdf.SetFont("OpenSans-Regular", "", 8) - wrap, _ := pdf.SplitTextWithWordWrap("Plaxonic Technologies Pvt Ltd, \n141 Stevens Ave STE 5 Oldsmar\nFL 34677 US", gopdf.PageSizeA4.W/3) - for _, line := range wrap { - pdf.MultiCell(&gopdf.Rect{ - W: gopdf.PageSizeA4.W / 3, - H: 80, - }, line) - } -} - -func header(pdf *gopdf.GoPdf) { - // pdf.Image("./images/template.png", 0, 0, &gopdf.Rect{ - // W: gopdf.PageSizeA4.W, - // H: gopdf.PageSizeA4.H, - // }) - - const imageRatioDevider = 2.2 - pdf.Image("./images/logo-scalable.png", leftMargin, topMargin, &gopdf.Rect{ - W: 323 / imageRatioDevider, - H: 51 / imageRatioDevider, - }) - - pdf.SetY(topMargin + 32) - pdf.SetX(leftMargin) - pdf.SetFont("OpenSans-Medium", "", 12.4) - pdf.MultiCell(&gopdf.Rect{ - W: gopdf.PageSizeA4.W, - H: 20, - }, "Final invoice for the January 2022 billing period") -} diff --git a/pkg/redis/client.go b/pkg/redis/client similarity index 98% rename from pkg/redis/client.go rename to pkg/redis/client index efba1f697..4f509ff9f 100644 --- a/pkg/redis/client.go +++ b/pkg/redis/client @@ -6,7 +6,7 @@ import ( "time" "github.com/go-redis/redis/v8" - "kloudlite.io/pkg/errors" + "github.com/kloudlite/api/pkg/errors" ) type redisCli[T any] struct { diff --git a/pkg/redpanda/auth.go b/pkg/redpanda/auth.go deleted file mode 100644 index f2503e6fb..000000000 --- a/pkg/redpanda/auth.go +++ /dev/null @@ -1,87 +0,0 @@ -package redpanda - -import ( - "context" - "github.com/twmb/franz-go/pkg/kgo" - "github.com/twmb/franz-go/pkg/sasl/scram" - "kloudlite.io/pkg/errors" - fn "kloudlite.io/pkg/functions" - "kloudlite.io/pkg/logging" -) - -type SASLMechanism string - -const ( - ScramSHA256 SASLMechanism = "SCRAM-SHA-256" - ScramSHA512 SASLMechanism = "SCRAM-SHA-512" -) - -type KafkaSASLAuth struct { - SASLMechanism SASLMechanism - User string - Password string -} - -type ProducerOpts struct { - SASLAuth *KafkaSASLAuth - Logger logging.Logger -} - -type ConsumerOpts struct { - SASLAuth *KafkaSASLAuth - Logger logging.Logger - MaxRetries *int - MaxPollRecords *int -} - -func parseSASLAuth(sasl *KafkaSASLAuth) (kgo.Opt, error) { - if sasl == nil { - return nil, nil - } - - if sasl.SASLMechanism == ScramSHA256 { - return kgo.SASL( - scram.Sha256( - func(context.Context) (scram.Auth, error) { - return scram.Auth{ - User: sasl.User, - Pass: sasl.Password, - }, nil - }, - ), - ), nil - } - - if sasl.SASLMechanism == ScramSHA512 { - return kgo.SASL( - scram.Sha512( - func(ctx context.Context) (scram.Auth, error) { - return scram.Auth{ - User: sasl.User, - Pass: sasl.Password, - }, nil - }, - ), - ), nil - } - return nil, errors.Newf("unknown SASL mechanism") -} - -func (c *ConsumerOpts) getWithDefaults() *ConsumerOpts { - opts := func() *ConsumerOpts { - if c == nil { - return &ConsumerOpts{} - } - return c - }() - - if opts.MaxRetries == nil { - opts.MaxRetries = fn.New(3) - } - - if opts.MaxPollRecords == nil { - opts.MaxPollRecords = fn.New(1) - } - - return opts -} diff --git a/pkg/redpanda/client.go b/pkg/redpanda/client.go deleted file mode 100644 index 126c05acb..000000000 --- a/pkg/redpanda/client.go +++ /dev/null @@ -1,42 +0,0 @@ -package redpanda - -import "go.uber.org/fx" - -type Client interface { - GetBrokerHosts() string - GetKafkaSASLAuth() *KafkaSASLAuth -} - -type ClientImpl struct { - brokerHosts string - saslAuth *KafkaSASLAuth -} - -func (c *ClientImpl) GetKafkaSASLAuth() *KafkaSASLAuth { - return c.saslAuth -} - -func (c *ClientImpl) GetBrokerHosts() string { - return c.brokerHosts -} - -func NewClient(brokers string, auth *KafkaSASLAuth) Client { - return &ClientImpl{ - brokerHosts: brokers, - saslAuth: auth, - } -} - -type ClientConfig interface { - GetBrokers() (brokers string) - GetKafkaSASLAuth() *KafkaSASLAuth -} - -func NewClientFx[T ClientConfig]() fx.Option { - return fx.Module( - "redpanda", - fx.Provide(func(cc T) Client { - return NewClient(cc.GetBrokers(), cc.GetKafkaSASLAuth()) - }), - ) -} diff --git a/pkg/redpanda/consumer.go b/pkg/redpanda/consumer.go deleted file mode 100644 index f3386ecdc..000000000 --- a/pkg/redpanda/consumer.go +++ /dev/null @@ -1,211 +0,0 @@ -package redpanda - -import ( - "context" - "strings" - "time" - - "github.com/twmb/franz-go/pkg/kgo" - "go.uber.org/fx" - "go.uber.org/zap" - "kloudlite.io/pkg/errors" -) - -type Consumer interface { - SetupLogger(logger *zap.SugaredLogger) - Close() - Ping(ctx context.Context) error - StartConsuming(onMessage ReaderFunc) - StartConsumingSync(onMessage ReaderFunc) -} - -type ConsumerImpl struct { - client *kgo.Client - logger *zap.SugaredLogger - isConnected bool -} - -// type Message struct { -// Action string `json:"action"` -// Payload map[string]any `json:"payload"` -// record *kgo.Record -// } - -type ReaderFunc func(msg []byte, timeStamp time.Time, offset int64) error - -func (c *ConsumerImpl) SetupLogger(logger *zap.SugaredLogger) { - c.logger = logger -} - -func (c *ConsumerImpl) Close() { - c.client.Close() -} - -func (c *ConsumerImpl) Ping(ctx context.Context) error { - if err := c.client.Ping(ctx); err != nil { - return err - } - c.isConnected = true - return nil -} - -func (c *ConsumerImpl) StartConsuming(onMessage ReaderFunc) { - go func() { - for { - fetches := c.client.PollFetches(context.Background()) - if fetches.IsClientClosed() { - return - } - - fetches.EachError( - func(topic string, partition int32, err error) { - if c.logger != nil { - c.logger.Warnf("topic=%s, partition=%d read failed as %v", topic, partition, err) - } - }, - ) - - fetches.EachRecord( - func(record *kgo.Record) { - if err := onMessage(record.Value, record.Timestamp, record.Offset); err != nil { - if c.logger != nil { - c.logger.Error("error in onMessage(): %+v\n", err) - } - return - } - if err := c.client.CommitRecords(context.TODO(), record); err != nil { - if c.logger != nil { - c.logger.Error("error while commiting records: %+v\n", err) - } - return - } - }, - ) - } - }() -} - -func (c *ConsumerImpl) StartConsumingSync(onMessage ReaderFunc) { - for { - fetches := c.client.PollFetches(context.Background()) - if fetches.IsClientClosed() { - return - } - - fetches.EachError( - func(topic string, partition int32, err error) { - if c.logger != nil { - c.logger.Warnf("topic=%s, partition=%d read failed as %v", topic, partition, err) - } - }, - ) - - fetches.EachRecord( - func(record *kgo.Record) { - if err := onMessage(record.Value, record.Timestamp, record.Offset); err != nil { - if c.logger != nil { - c.logger.Error("error in onMessage(): %+v\n", err) - } - return - } - if err := c.client.CommitRecords(context.TODO(), record); err != nil { - if c.logger != nil { - c.logger.Error("error while commiting records: %+v\n", err) - } - return - } - }, - ) - } -} - -// func NewRawConsumer(client Client, consumerGroupId string) (Consumer, error) { -// opts := []kgo.Opt{ -// kgo.SeedBrokers(strings.Split(client.GetBrokerHosts(), ",")...), -// kgo.ConsumerGroup(consumerGroupId), -// kgo.DisableAutoCommit(), -// } -// -// saslOpt, err := parseSASLAuth(client.GetKafkaSASLAuth()) -// if err != nil { -// return nil, err -// } -// -// if saslOpt != nil { -// opts = append(opts, saslOpt) -// } -// -// cli, err := kgo.NewClient(opts...) -// if err != nil { -// return nil, errors.NewEf(err, "unable to create client") -// } -// return &ConsumerImpl{client: cli}, nil -// } - -func NewConsumer( - brokerHosts string, - consumerGroup string, - options ConsumerOpts, - topics []string, -) (Consumer, error) { - cOpts := options.getWithDefaults() - - opts := []kgo.Opt{ - kgo.SeedBrokers(strings.Split(brokerHosts, ",")...), - kgo.ConsumerGroup(consumerGroup), - kgo.ConsumeTopics(topics...), - kgo.DisableAutoCommit(), - } - - saslOpt, err := parseSASLAuth(cOpts.SASLAuth) - if err != nil { - return nil, err - } - - if saslOpt != nil { - opts = append(opts, saslOpt) - } - - client, err := kgo.NewClient(opts...) - if err != nil { - return nil, errors.NewEf(err, "unable to create client") - } - - return &ConsumerImpl{client: client}, nil -} - -type ConsumerConfig interface { - GetSubscriptionTopics() []string - GetConsumerGroupId() string -} - -func NewConsumerFx[T ConsumerConfig]() fx.Option { - return fx.Module( - "consumer", - fx.Provide( - func(cfg T, client Client, lf fx.Lifecycle) (Consumer, error) { - topics := cfg.GetSubscriptionTopics() - consumerGroup := cfg.GetConsumerGroupId() - consumer, err := NewConsumer(client.GetBrokerHosts(), consumerGroup, ConsumerOpts{ - SASLAuth: client.GetKafkaSASLAuth(), - }, topics) - if err != nil { - return nil, err - } - - lf.Append( - fx.Hook{ - OnStart: func(ctx context.Context) error { - return consumer.Ping(ctx) - }, - OnStop: func(context.Context) error { - consumer.Close() - return nil - }, - }, - ) - return consumer, nil - }, - ), - ) -} diff --git a/pkg/redpanda/message.go b/pkg/redpanda/message.go deleted file mode 100644 index 9ea19206f..000000000 --- a/pkg/redpanda/message.go +++ /dev/null @@ -1,13 +0,0 @@ -package redpanda - -import "time" - -type Message struct { - Key []byte `json:"key"` - Value []byte `json:"value"` - Timestamp time.Time `json:"timestamp"` - Topic string `json:"topic"` - Partition int32 `json:"partition"` - ProducerId int64 `json:"producerId"` - Offset int64 `json:"offset"` -} diff --git a/pkg/redpanda/producer.go b/pkg/redpanda/producer.go deleted file mode 100644 index a36cdc2b9..000000000 --- a/pkg/redpanda/producer.go +++ /dev/null @@ -1,127 +0,0 @@ -package redpanda - -import ( - "context" - "strings" - "time" - - "kloudlite.io/pkg/logging" - - "github.com/twmb/franz-go/pkg/kgo" - "go.uber.org/fx" -) - -type Producer interface { - Ping(ctx context.Context) error - Close() - Produce(ctx context.Context, topic string, key string, value []byte) (*ProducerOutput, error) -} - -type ProducerImpl struct { - client *kgo.Client -} - -func (p *ProducerImpl) Ping(ctx context.Context) error { - return p.client.Ping(ctx) -} - -func (p *ProducerImpl) Close() { - p.client.Close() -} - -type ProducerOutput struct { - Key []byte `json:"key,omitempty"` - Timestamp time.Time `json:"timestamp"` - Topic string `json:"topic"` - Partition int32 `json:"partition,omitempty"` - ProducerId int64 `json:"producerId,omitempty"` - Offset int64 `json:"offset"` -} - -func (p *ProducerImpl) Produce(ctx context.Context, topic string, key string, value []byte) (*ProducerOutput, error) { - record := kgo.KeySliceRecord( - func() []byte { - if key == "" { - return nil - } - return []byte(key) - }(), value, - ) - - record.Topic = topic - - sync, err := p.client.ProduceSync(ctx, record).First() - if err != nil { - return nil, err - } - - return &ProducerOutput{ - Key: sync.Key, - Timestamp: sync.Timestamp, - Topic: sync.Topic, - Partition: sync.Partition, - ProducerId: sync.ProducerID, - Offset: sync.Offset, - }, nil -} - -func NewProducer(brokerHosts string, producerOpts *ProducerOpts) (Producer, error) { - opts := []kgo.Opt{ - kgo.SeedBrokers(strings.Split(brokerHosts, ",")...), - } - saslOpt, err := parseSASLAuth(producerOpts.SASLAuth) - if err != nil { - return nil, err - } - - if saslOpt != nil { - opts = append(opts, saslOpt) - } - - client, err := kgo.NewClient(opts...) - - if err != nil { - return nil, err - } - if err := client.Ping(context.TODO()); err != nil { - return nil, err - } - return &ProducerImpl{client: client}, nil -} - -func NewProducerFx[T Client]() fx.Option { - return fx.Module( - "redpanda", - fx.Provide( - // func(client Client) (Producer, error) { - func(client T) (Producer, error) { - return NewProducer( - client.GetBrokerHosts(), &ProducerOpts{ - SASLAuth: client.GetKafkaSASLAuth(), - Logger: logging.Logger{}, - }, - ) - }, - ), - - fx.Invoke( - func(lf fx.Lifecycle, producer Producer, logger logging.Logger) { - lf.Append( - fx.Hook{ - OnStart: func(ctx context.Context) error { - if err := producer.Ping(ctx); err != nil { - return err - } - logger.Infof("successfully connected to kafka brokers") - return nil - }, - OnStop: func(context.Context) error { - producer.Close() - return nil - }, - }, - ) - }, - ), - ) -} diff --git a/pkg/repos/base.go b/pkg/repos/base.go index efef2c207..7553c1097 100644 --- a/pkg/repos/base.go +++ b/pkg/repos/base.go @@ -1,11 +1,20 @@ package repos -import "time" +import ( + "time" +) type BaseEntity struct { - Id ID `json:"id" bson:"id"` - CreationTime time.Time `json:"creation_time" bson:"creation_time"` - UpdateTime time.Time `json:"update_time" bson:"update_time"` + PrimitiveId ID `json:"_id,omitempty" graphql:"ignore" struct-json-path:",ignore"` + Id ID `json:"id"` + CreationTime time.Time `json:"creationTime"` + UpdateTime time.Time `json:"updateTime"` + RecordVersion int `json:"recordVersion"` + MarkedForDeletion *bool `json:"markedForDeletion,omitempty"` +} + +func (c *BaseEntity) GetPrimitiveID() ID { + return c.PrimitiveId } func (c *BaseEntity) GetId() ID { @@ -33,5 +42,20 @@ func (c *BaseEntity) SetUpdateTime(ut time.Time) { } func (c *BaseEntity) IsZero() bool { - return c.Id == "" + return c == nil || c.Id == "" +} + +func (c *BaseEntity) IncrementRecordVersion() { + c.RecordVersion += 1 +} + +func (c *BaseEntity) GetRecordVersion() int { + return c.RecordVersion +} + +func (c *BaseEntity) IsMarkedForDeletion() bool { + if c.MarkedForDeletion == nil { + return false + } + return *c.MarkedForDeletion } diff --git a/pkg/repos/db-repo-mongo.go b/pkg/repos/db-repo-mongo.go index b98865312..1c794c9ba 100644 --- a/pkg/repos/db-repo-mongo.go +++ b/pkg/repos/db-repo-mongo.go @@ -9,12 +9,14 @@ import ( "time" "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/bson/primitive" "go.uber.org/fx" + "github.com/kloudlite/api/pkg/errors" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/logging" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" - "kloudlite.io/pkg/errors" - fn "kloudlite.io/pkg/functions" ) type dbRepo[T Entity] struct { @@ -28,35 +30,68 @@ var re = regexp.MustCompile(`(\W|_)+/g`) func toMap(v any) (map[string]any, error) { b, err := json.Marshal(v) if err != nil { - return nil, err + return nil, errors.NewE(err) } var m map[string]any if err := json.Unmarshal(b, &m); err != nil { - return nil, err + return nil, errors.NewE(err) } return m, nil } +func fromMap[T Entity](v map[string]any) (T, error) { + var emptyResult T + b, err := json.Marshal(v) + if err != nil { + return emptyResult, errors.NewE(err) + } + var result T + if err := json.Unmarshal(b, &result); err != nil { + return emptyResult, errors.NewE(err) + } + return result, nil +} + func bsonToStruct[T any](r *mongo.SingleResult) (T, error) { var m map[string]any var result T if err := r.Decode(&m); err != nil { - return result, err + return result, errors.NewE(err) } b, err := json.Marshal(m) if err != nil { - return result, err + return result, errors.NewE(err) } if err := json.Unmarshal(b, &result); err != nil { - return result, err + return result, errors.NewE(err) } return result, nil } +func cursorToStruct[T any](ctx context.Context, curr *mongo.Cursor) ([]T, error) { + var m []map[string]any + var results []T + + if err := curr.All(ctx, &m); err != nil { + return results, errors.NewE(err) + } + + b, err := json.Marshal(m) + if err != nil { + return results, errors.NewE(err) + } + + if err := json.Unmarshal(b, &results); err != nil { + return results, errors.NewE(err) + } + + return results, nil +} + func (repo *dbRepo[T]) NewId() ID { id, e := fn.CleanerNanoid(28) if e != nil { - panic(fmt.Errorf("could not get cleanerNanoid()")) + panic(errors.Newf("could not get cleanerNanoid()")) } return ID(fmt.Sprintf("%s-%s", repo.shortName, strings.ToLower(id))) } @@ -68,101 +103,167 @@ func (repo *dbRepo[T]) Find(ctx context.Context, query Query) ([]T, error) { }, ) if err != nil { - if err == mongo.ErrNoDocuments { + if errors.Is(err, mongo.ErrNoDocuments) { return make([]T, 0), nil } - return nil, err + return nil, errors.NewE(err) } - var m []map[string]any + return cursorToStruct[T](ctx, curr) +} - err = curr.All(ctx, &m) +func (repo *dbRepo[T]) Count(ctx context.Context, filter Filter) (int64, error) { + return repo.db.Collection(repo.collectionName).CountDocuments(ctx, filter, options.Count().SetMaxTime(1*time.Second)) +} + +func (repo *dbRepo[T]) findOne(ctx context.Context, filter Filter) (T, error) { + one := repo.db.Collection(repo.collectionName).FindOne(ctx, filter) + item, err := bsonToStruct[T](one) if err != nil { - return nil, err + if errors.Is(err, mongo.ErrNoDocuments) { + return item, errors.Newf("no document found") + } + return item, errors.NewE(err) } + return item, nil +} - results := make([]T, len(m)) - b, err := json.Marshal(m) +func (repo *dbRepo[T]) FindOne(ctx context.Context, filter Filter) (T, error) { + one := repo.db.Collection(repo.collectionName).FindOne(ctx, filter) + item, err := bsonToStruct[T](one) if err != nil { - return nil, err + if errors.Is(err, mongo.ErrNoDocuments) { + return item, nil + } + return item, errors.NewE(err) } - if err := json.Unmarshal(b, &results); err != nil { - return nil, err + return item, nil +} + +func (repo *dbRepo[T]) FindPaginated(ctx context.Context, filter Filter, pagination CursorPagination) (*PaginatedRecord[T], error) { + if pagination.First != nil && pagination.Last != nil { + return nil, errors.Newf("first/last only one of these parameters could be passed on, you have specified both") } - return results, err -} + if pagination.After != nil && pagination.Before != nil { + return nil, errors.Newf("after/before only one of these parameters could be passed on, you have specified both") + } -func (repo *dbRepo[T]) findOne(ctx context.Context, filter Filter) (T, error) { - one := repo.db.Collection(repo.collectionName).FindOne(ctx, filter) - res := fn.NewTypeFromPointer[T]() - var m map[string]any - err := one.Decode(&m) - if err != nil { - fmt.Println("(debug/info) ERR: ", err) - return res, err + if pagination.After != nil && pagination.First == nil { + return nil, errors.Newf("paramter `after` requires paramter `first` to be specified") } - b, err := json.Marshal(m) - if err != nil { - return res, err + + if pagination.Before != nil && pagination.Last == nil { + return nil, errors.Newf("paramter `before` requires paramter `last` to be specified") } - if err := json.Unmarshal(b, &res); err != nil { - return res, err + + queryFilter := Filter{} + + for k, v := range filter { + queryFilter[k] = v } - return res, nil -} -func (repo *dbRepo[T]) FindOne(ctx context.Context, filter Filter) (T, error) { - one := repo.db.Collection(repo.collectionName).FindOne(ctx, filter) - t := make([]T, 1) - var m map[string]any - err := one.Decode(&m) - if err != nil { - if err == mongo.ErrNoDocuments { - return t[0], nil + if pagination.After != nil { + aft, err := CursorFromBase64(*pagination.After) + if err != nil { + return nil, errors.NewE(err) + } + objectID, err := primitive.ObjectIDFromHex(string(aft)) + if err != nil { + return nil, errors.NewE(err) } - return t[0], err + queryFilter["_id"] = bson.M{"$gt": objectID} } - b, err := json.Marshal(m) - if err != nil { - return t[0], err + if pagination.Before != nil { + bef, err := CursorFromBase64(*pagination.Before) + if err != nil { + return nil, errors.NewE(err) + } + objectID, err := primitive.ObjectIDFromHex(string(bef)) + if err != nil { + return nil, errors.NewE(err) + } + queryFilter["_id"] = bson.M{"$lt": objectID} } - if err := json.Unmarshal(b, &t[0]); err != nil { - return t[0], err + + var limit int64 + if pagination.Last != nil { + limit = *pagination.Last + 1 } - return t[0], nil -} -func (repo *dbRepo[T]) FindPaginated(ctx context.Context, query Query, page int64, size int64, opts ...Opts) (PaginatedRecord[T], error) { - results := make([]T, 0) - var offset int64 = (page - 1) * size - curr, e := repo.db.Collection(repo.collectionName).Find( - ctx, query.Filter, &options.FindOptions{ - Limit: &size, - Skip: &offset, - Sort: query.Sort, + if pagination.First != nil { + limit = *pagination.First + 1 + } + + // var results []T + curr, err := repo.db.Collection(repo.collectionName).Find( + ctx, queryFilter, &options.FindOptions{ + Limit: &limit, + Sort: bson.M{pagination.OrderBy: func() int { + if pagination.SortDirection == SortDirectionDesc { + return -1 + } + return 1 + }()}, }, ) - e = curr.All(ctx, results) + if err != nil { + return nil, errors.NewE(err) + } + + results, err := cursorToStruct[T](ctx, curr) + if err != nil { + return nil, errors.NewE(err) + } + + total, err := repo.db.Collection(repo.collectionName).CountDocuments(ctx, filter) + if err != nil { + return nil, errors.NewE(err) + } + + pageInfo := PageInfo{} - total, e := repo.db.Collection(repo.collectionName).CountDocuments(ctx, query.Filter) + if len(results) > 0 { + pageInfo.StartCursor = CursorToBase64(Cursor(string(results[0].GetPrimitiveID()))) + pageInfo.EndCursor = CursorToBase64(Cursor(string(results[len(results)-1].GetPrimitiveID()))) - return PaginatedRecord[T]{ - Results: results, + if pagination.First != nil { + pageInfo.HasNextPage = fn.New(len(results) > int(*pagination.First)) + if pageInfo.HasNextPage != nil && *pageInfo.HasNextPage { + results = results[:*pagination.First] + } + pageInfo.HasPrevPage = fn.New(pagination.After != nil) + } + + if pagination.Last != nil { + pageInfo.HasNextPage = fn.New(pagination.Before != nil) + pageInfo.HasPrevPage = fn.New(len(results) > int(*pagination.Last)) + + if pageInfo.HasPrevPage != nil && *pageInfo.HasPrevPage { + results = results[:*pagination.Last] + } + } + } + + edges := make([]RecordEdge[T], len(results)) + for i := range results { + edges[i] = RecordEdge[T]{ + Node: results[i], + Cursor: CursorToBase64(Cursor(results[i].GetPrimitiveID())), + } + } + + return &PaginatedRecord[T]{ + Edges: edges, + PageInfo: pageInfo, TotalCount: total, - }, e + }, nil } func (repo *dbRepo[T]) FindById(ctx context.Context, id ID) (T, error) { - var result T r := repo.db.Collection(repo.collectionName).FindOne(ctx, &Filter{"id": id}) - - err := r.Decode(&result) - if err != nil { - return result, err - } - return result, err + return bsonToStruct[T](r) } func (repo *dbRepo[T]) withId(data T) { @@ -186,48 +287,34 @@ func (repo *dbRepo[T]) withUpdateTime(data T) { func (repo *dbRepo[T]) Create(ctx context.Context, data T) (T, error) { repo.withId(data) - repo.withCreationTime(data) + data.SetCreationTime(time.Now()) + data.SetUpdateTime(time.Now()) - b, err := json.Marshal(data) - if err != nil { - var x T - return x, err - } - var m map[string]any - if err := json.Unmarshal(b, &m); err != nil { - var x T - return x, err - } + var emptyResult T - r, e := repo.db.Collection(repo.collectionName).InsertOne(ctx, m) - if e != nil { - var x T - return x, e + inputM, err := toMap(data) + if err != nil { + return emptyResult, errors.NewE(err) } - var result T - r2 := repo.db.Collection(repo.collectionName).FindOne(ctx, Filter{"_id": r.InsertedID}) - - var resultM map[string]any - e = r2.Decode(&resultM) - m2, err := json.Marshal(resultM) - if err := json.Unmarshal(m2, &result); err != nil { - var x T - return x, err + r, err := repo.db.Collection(repo.collectionName).InsertOne(ctx, inputM) + if err != nil { + return emptyResult, errors.NewE(err) } - return result, e + r2 := repo.db.Collection(repo.collectionName).FindOne(ctx, Filter{"_id": r.InsertedID}) + return bsonToStruct[T](r2) } func (repo *dbRepo[T]) Exists(ctx context.Context, filter Filter) (bool, error) { one := repo.db.Collection(repo.collectionName).FindOne(ctx, filter) - res := fn.NewTypeFromPointer[T]() - err := one.Decode(&res) + var m map[string]any + err := one.Decode(&m) if err != nil { if err == mongo.ErrNoDocuments { return false, nil } - return false, err + return false, errors.NewE(err) } return true, nil } @@ -241,11 +328,67 @@ func (repo *dbRepo[T]) UpdateMany(ctx context.Context, filter Filter, updatedDat bson.M{"$set": updatedData}, ) if err != nil { - return err + return errors.NewE(err) } return nil } +func (repo *dbRepo[T]) Patch(ctx context.Context, filter Filter, patch Document, opts ...UpdateOpts) (T, error) { + var x T + + res, err := repo.findOne(ctx, filter) + if err != nil { + return x, errors.NewE(err) + } + + return repo.patchRecordByID(ctx, res.GetId(), patch, res.IsMarkedForDeletion(), opts...) +} + +func (repo *dbRepo[T]) patchRecordByID(ctx context.Context, id ID, patch Document, markedForDeletion bool, opts ...UpdateOpts) (T, error) { + patch["updateTime"] = time.Now() + + var x T + m, err := toMap(patch) + if err != nil { + return x, errors.NewE(err) + } + + delete(m, "$inc") + + updatedDoc := bson.M{"$set": m} + if v, ok := patch["$inc"]; ok { + updatedDoc["$inc"] = v + } + + after := options.After + updateOpts := &options.FindOneAndUpdateOptions{ + ReturnDocument: &after, + } + if opt := fn.ParseOnlyOption[UpdateOpts](opts); opt != nil { + updateOpts.Upsert = &opt.Upsert + } + + r := repo.db.Collection(repo.collectionName).FindOneAndUpdate( + ctx, + &Filter{"id": id}, + updatedDoc, + updateOpts, + ) + return bsonToStruct[T](r) +} + +func (repo *dbRepo[T]) PatchById(ctx context.Context, id ID, patch Document, opts ...UpdateOpts) (T, error) { + var x T + res, err := repo.findOne(ctx, Filter{ + "id": id, + }) + if err != nil { + return x, errors.NewE(err) + } + + return repo.patchRecordByID(ctx, res.GetId(), patch, res.IsMarkedForDeletion(), opts...) +} + func (repo *dbRepo[T]) UpdateOne(ctx context.Context, filter Filter, updatedData T, opts ...UpdateOpts) (T, error) { after := options.After updateOpts := &options.FindOneAndUpdateOptions{ @@ -256,13 +399,14 @@ func (repo *dbRepo[T]) UpdateOne(ctx context.Context, filter Filter, updatedData updateOpts.Upsert = &opt.Upsert } + updatedData.SetUpdateTime(time.Now()) + m, err := toMap(updatedData) if err != nil { var x T - return x, err + return x, errors.NewE(err) } - repo.withUpdateTime(updatedData) r := repo.db.Collection(repo.collectionName).FindOneAndUpdate( ctx, filter, @@ -273,6 +417,28 @@ func (repo *dbRepo[T]) UpdateOne(ctx context.Context, filter Filter, updatedData return bsonToStruct[T](r) } +func (repo *dbRepo[T]) PatchOne(ctx context.Context, filter Filter, patch Document, opts ...UpdateOpts) (T, error) { + after := options.After + updateOpts := &options.FindOneAndUpdateOptions{ + ReturnDocument: &after, + } + + if opt := fn.ParseOnlyOption[UpdateOpts](opts); opt != nil { + updateOpts.Upsert = &opt.Upsert + } + + patch["updateTime"] = time.Now() + + r := repo.db.Collection(repo.collectionName).FindOneAndUpdate( + ctx, + filter, + bson.M{"$set": patch}, + updateOpts, + ) + + return bsonToStruct[T](r) +} + func (repo *dbRepo[T]) UpdateById(ctx context.Context, id ID, updatedData T, opts ...UpdateOpts) (T, error) { var result T after := options.After @@ -281,13 +447,16 @@ func (repo *dbRepo[T]) UpdateById(ctx context.Context, id ID, updatedData T, opt if opt := fn.ParseOnlyOption[UpdateOpts](opts); opt != nil { updateOpts.Upsert = &opt.Upsert } - repo.withUpdateTime(updatedData) + + updatedData.SetUpdateTime(time.Now()) m, err := toMap(updatedData) if err != nil { - return result, err + return result, errors.NewE(err) } + delete(m, "_id") + r := repo.db.Collection(repo.collectionName).FindOneAndUpdate( ctx, &Filter{"id": id}, @@ -322,8 +491,7 @@ func (repo *dbRepo[T]) Upsert(ctx context.Context, filter Filter, data T) (T, er func (repo *dbRepo[T]) DeleteById(ctx context.Context, id ID) error { var result T r := repo.db.Collection(repo.collectionName).FindOneAndDelete(ctx, &Filter{"id": id}) - e := r.Decode(&result) - return e + return r.Decode(&result) } func (repo *dbRepo[T]) DeleteOne(ctx context.Context, filter Filter) error { @@ -335,13 +503,13 @@ func (repo *dbRepo[T]) DeleteOne(ctx context.Context, filter Filter) error { return nil } } - return err + return errors.NewE(err) } func (repo *dbRepo[T]) DeleteMany(ctx context.Context, filter Filter) error { _, err := repo.db.Collection(repo.collectionName).DeleteMany(ctx, filter) if err != nil { - return err + return errors.NewE(err) } return nil } @@ -357,6 +525,11 @@ func (repo *dbRepo[T]) IndexFields(ctx context.Context, indices []IndexField) er if len(indices) == 0 { return nil } + + indices = append(indices, IndexField{ + Field: []IndexKey{{Key: "creationTime", Value: IndexAsc}}, + Unique: false, + }) // var models []mongo.IndexModel for _, f := range indices { b := bson.D{} @@ -385,101 +558,48 @@ func (repo *dbRepo[T]) IndexFields(ctx context.Context, indices []IndexField) er dummyIdxName := buildIndexName(indexName, dummyKey, 1) _, err := repo.db.Collection(repo.collectionName).Indexes().CreateOne(ctx, mongo.IndexModel{Keys: b2, Options: &options.IndexOptions{Unique: &f.Unique, Name: &dummyIdxName}}) if err != nil { - return err + return errors.NewE(err) } _, err = repo.db.Collection(repo.collectionName).Indexes().DropOne(ctx, indexName) if err != nil { - return err + return errors.NewE(err) } if _, err := repo.db.Collection(repo.collectionName).Indexes().CreateOne(ctx, indexModel); err != nil { - return err + return errors.NewE(err) } if _, err := repo.db.Collection(repo.collectionName).Indexes().DropOne(ctx, dummyIdxName); err != nil { - return err + return errors.NewE(err) } } - - // models = append( - // models, mongo.IndexModel{ - // Keys: b, - // Options: &options.IndexOptions{ - // Unique: &f.Unique, - // }, - // }, - // ) - } - - // for i := range models { - // _, err := repo.db.Collection(repo.collectionName).Indexes().CreateOne(ctx, models[i]) - // if err != nil{ - // repo.db.Collection(repo.collectionName).Indexes().CreateOne(ctx, models[i]., opts ...*options.CreateIndexesOptions) - // } - // //body - // } - - // _, err := repo.db.Collection(repo.collectionName).Indexes().CreateMany(ctx, models) - // return err + } return nil } -func (repo *dbRepo[T]) SilentUpsert(ctx context.Context, filter Filter, data T) (T, error) { - id := func() ID { - if data.GetId() != "" { - return data.GetId() - } - if t, err := repo.findOne(ctx, filter); err == nil { - return t.GetId() - } - return repo.NewId() - }() - data.SetId(id) - if data.GetCreationTime().IsZero() { - repo.withCreationTime(data) - } - return repo.UpdateById( - ctx, id, data, UpdateOpts{ - Upsert: true, - }, - ) -} -func (repo *dbRepo[T]) SilentUpdateMany(ctx context.Context, filter Filter, updatedData map[string]any) error { - _, err := repo.db.Collection(repo.collectionName).UpdateMany( - ctx, - filter, - bson.M{"$set": updatedData}, - ) - if err != nil { - return err - } - return nil +func (repo *dbRepo[T]) ErrAlreadyExists(err error) bool { + return mongo.IsDuplicateKeyError(err) } -func (repo *dbRepo[T]) SilentUpdateById(ctx context.Context, id ID, updatedData T, opts ...UpdateOpts) (T, error) { - after := options.After - updateOpts := &options.FindOneAndUpdateOptions{ - ReturnDocument: &after, - } - if opt := fn.ParseOnlyOption[UpdateOpts](opts); opt != nil { - updateOpts.Upsert = &opt.Upsert +func (repo *dbRepo[T]) MergeMatchFilters(filter Filter, mFilter map[string]MatchFilter) Filter { + if filter == nil { + filter = map[string]any{} } - m, err := toMap(updatedData) - if err != nil { - var x T - return x, err + for k, v := range mFilter { + _, ok := filter[k] + if ok { + fmt.Printf("skipping search filter field %q, as it is already specified in filter", k) + continue + } + switch v.MatchType { + case MatchTypeExact: + filter[k] = v.Exact + case MatchTypeArray: + filter[k] = bson.M{"$in": v.Array} + case MatchTypeRegex: + filter[k] = bson.M{"$regex": primitive.Regex{Pattern: *v.Regex, Options: "i"}} + } } - - r := repo.db.Collection(repo.collectionName).FindOneAndUpdate( - ctx, - &Filter{"id": id}, - bson.M{"$set": m}, - updateOpts, - ) - return bsonToStruct[T](r) -} - -func (repo *dbRepo[T]) ErrAlreadyExists(err error) bool { - return mongo.IsDuplicateKeyError(err) + return filter } type MongoRepoOptions struct { @@ -511,14 +631,17 @@ func NewFxMongoRepo[T Entity](collectionName, shortName string, indexFields []In }, ), fx.Invoke( - func(lifecycle fx.Lifecycle, repo DbRepo[T]) { + func(lifecycle fx.Lifecycle, repo DbRepo[T], logger logging.Logger) { lifecycle.Append( fx.Hook{ OnStart: func(ctx context.Context) error { - err := repo.IndexFields(ctx, indexFields) - if err != nil { - return errors.NewEf(err, "could not create indexes on DB for repo %T", repo) - } + go func() { + err := repo.IndexFields(ctx, indexFields) + if err != nil { + logger.Errorf(err, "failed to update indexes on DB for repo %T", repo) + } + logger.Infof("indexes updated on DB for repo %T", repo) + }() return nil }, }, diff --git a/pkg/repos/db-repo.go b/pkg/repos/db-repo.go index 2435c3f71..3475ce885 100644 --- a/pkg/repos/db-repo.go +++ b/pkg/repos/db-repo.go @@ -2,10 +2,15 @@ package repos import ( "context" + "encoding/base64" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/functions" + "go.mongodb.org/mongo-driver/bson" "time" ) type Entity interface { + GetPrimitiveID() ID GetId() ID SetId(id ID) GetCreationTime() time.Time @@ -13,20 +18,58 @@ type Entity interface { SetCreationTime(time.Time) SetUpdateTime(time.Time) IsZero() bool + + IncrementRecordVersion() + GetRecordVersion() int + IsMarkedForDeletion() bool } type Opts map[string]interface{} type SortOpts map[string]int32 type Filter map[string]interface{} + +func (f Filter) Add(key string, value interface{}) Filter{ + f[key] = value + return f +} + type Query struct { Filter Filter Sort map[string]interface{} } +type MatchType string + +const ( + MatchTypeExact = "exact" + MatchTypeArray = "array" + MatchTypeRegex = "regex" +) + +type MatchFilter struct { + MatchType MatchType `json:"matchType" graphql:"enum=exact;array;regex;"` + Exact any `json:"exact,omitempty"` + Array []any `json:"array,omitempty"` + Regex *string `json:"regex,omitempty"` +} + type ID string +type PageInfo struct { + StartCursor string + EndCursor string + HasNextPage *bool + HasPrevPage *bool +} + +type RecordEdge[T Entity] struct { + Node T + Cursor string +} + type PaginatedRecord[T Entity] struct { - Results []T + Edges []RecordEdge[T] + PageInfo PageInfo TotalCount int64 } @@ -34,23 +77,28 @@ type UpdateOpts struct { Upsert bool } +type Document bson.M + type DbRepo[T Entity] interface { NewId() ID Find(ctx context.Context, query Query) ([]T, error) FindOne(ctx context.Context, filter Filter) (T, error) - FindPaginated(ctx context.Context, query Query, page int64, size int64, opts ...Opts) (PaginatedRecord[T], error) + FindPaginated(ctx context.Context, filter Filter, pagination CursorPagination) (*PaginatedRecord[T], error) FindById(ctx context.Context, id ID) (T, error) Create(ctx context.Context, data T) (T, error) Exists(ctx context.Context, filter Filter) (bool, error) + Count(ctx context.Context, filter Filter) (int64, error) + // upsert Upsert(ctx context.Context, filter Filter, data T) (T, error) UpdateMany(ctx context.Context, filter Filter, updatedData map[string]any) error UpdateById(ctx context.Context, id ID, updatedData T, opts ...UpdateOpts) (T, error) + PatchById(ctx context.Context, id ID, patch Document, opts ...UpdateOpts) (T, error) + + Patch(ctx context.Context, filter Filter, patch Document, opts ...UpdateOpts) (T, error) UpdateOne(ctx context.Context, filter Filter, updatedData T, opts ...UpdateOpts) (T, error) - SilentUpsert(ctx context.Context, filter Filter, data T) (T, error) - SilentUpdateMany(ctx context.Context, filter Filter, updatedData map[string]any) error - SilentUpdateById(ctx context.Context, id ID, updatedData T, opts ...UpdateOpts) (T, error) + PatchOne(ctx context.Context, filter Filter, patch Document, opts ...UpdateOpts) (T, error) DeleteById(ctx context.Context, id ID) error DeleteMany(ctx context.Context, filter Filter) error IndexFields(ctx context.Context, indices []IndexField) error @@ -58,6 +106,7 @@ type DbRepo[T Entity] interface { DeleteOne(ctx context.Context, filter Filter) error ErrAlreadyExists(err error) bool + MergeMatchFilters(filter Filter, matchFilters map[string]MatchFilter) Filter } type indexOrder bool @@ -76,3 +125,47 @@ type IndexField struct { Field []IndexKey Unique bool } + +func CursorFromBase64(b string) (Cursor, error) { + b2, err := base64.StdEncoding.DecodeString(b) + if err != nil { + return Cursor(""), errors.NewE(err) + } + return Cursor(b2), nil +} + +func CursorToBase64(c Cursor) string { + return base64.StdEncoding.EncodeToString([]byte(c)) +} + +type CursorSortBy struct { + Field string `json:"field"` + Direction SortDirection `json:"sortDirection"` +} + +type Cursor string + +type CursorPagination struct { + First *int64 `json:"first"` + After *string `json:"after,omitempty"` + + Last *int64 `json:"last,omitempty"` + Before *string `json:"before,omitempty"` + + OrderBy string `json:"orderBy,omitempty" graphql:"default=\"_id\""` + SortDirection SortDirection `json:"sortDirection,omitempty" graphql:"enum=ASC;DESC,default=\"ASC\""` +} + +type SortDirection string + +const ( + SortDirectionAsc SortDirection = "ASC" + SortDirectionDesc SortDirection = "DESC" +) + +var DefaultCursorPagination = CursorPagination{ + First: functions.New(int64(10)), + After: nil, + OrderBy: "_id", + SortDirection: SortDirectionAsc, +} diff --git a/pkg/repos/mongo.go b/pkg/repos/mongo.go index 553578431..8662f9d45 100644 --- a/pkg/repos/mongo.go +++ b/pkg/repos/mongo.go @@ -2,25 +2,20 @@ package repos import ( "context" - "fmt" + "time" + + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/logging" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" "go.uber.org/fx" - "kloudlite.io/pkg/errors" ) -func NewMongoDatabase(url string, dbName string) (db *mongo.Database, e error) { - defer errors.HandleErr(&e) - - //structcodec, _ := bsoncodec.NewStructCodec(bsoncodec.JSONFallbackStructTagParser) - //rb := bson.NewRegistryBuilder() - //// register struct codec - //rb.RegisterDefaultEncoder(reflect.Struct, structcodec) - // - //client, e := mongo.NewClient(options.Client().SetRegistry(rb.Build()).ApplyURI(url)) - - client, e := mongo.NewClient(options.Client().ApplyURI(url)) - errors.AssertNoError(e, fmt.Errorf("could not create mongo client")) +func NewMongoDatabase(ctx context.Context, uri string, dbName string) (db *mongo.Database, e error) { + client, err := mongo.Connect(ctx, options.Client().ApplyURI(uri)) + if err != nil { + return nil, errors.NewEf(err, "could not connect to mongodb servers") + } return client.Database(dbName), nil } @@ -31,17 +26,22 @@ type MongoConfig interface { func NewMongoClientFx[T MongoConfig]() fx.Option { return fx.Module("db", fx.Provide(func(env T) (*mongo.Database, error) { - return NewMongoDatabase(env.GetMongoConfig()) + url, dbName := env.GetMongoConfig() + ctx, cf := context.WithTimeout(context.TODO(), 10*time.Second) + defer cf() + return NewMongoDatabase(ctx, url, dbName) }), - fx.Invoke(func(db *mongo.Database, lifecycle fx.Lifecycle) { + + fx.Invoke(func(db *mongo.Database, logger logging.Logger, lifecycle fx.Lifecycle) { lifecycle.Append(fx.Hook{ OnStart: func(ctx context.Context) error { - err := db.Client().Connect(ctx) - if err != nil { - return errors.NewEf(err, "coult not connect to Mongo") + if err := db.Client().Ping(ctx, nil); err != nil { + return errors.NewEf(err, "could not ping Mongo") } - return db.Client().Ping(ctx, nil) + logger.Infof("connected to mongodb database: %s", db.Name()) + return nil }, + OnStop: func(ctx context.Context) error { return db.Client().Disconnect(ctx) }, diff --git a/pkg/res-change-notifier/main.go b/pkg/res-change-notifier/main.go index db59d77ca..f014ace80 100644 --- a/pkg/res-change-notifier/main.go +++ b/pkg/res-change-notifier/main.go @@ -2,8 +2,9 @@ package rcn import ( "fmt" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/repos" "go.uber.org/fx" - "kloudlite.io/pkg/repos" "net/http" ) @@ -18,7 +19,7 @@ type rcn struct { func (r *rcn) Notify(resourceId repos.ID) error { _, err := http.Post(fmt.Sprintf("%s/publish/resource_update/%s", r.serviceUrl, resourceId), "text/plain", nil) fmt.Println(err) - return err + return errors.NewE(err) } func NewResourceChangeNotifier(serviceUrl string) ResourceChangeNotifier { diff --git a/pkg/rexec/main.go b/pkg/rexec/main.go deleted file mode 100644 index 3f3f88299..000000000 --- a/pkg/rexec/main.go +++ /dev/null @@ -1,75 +0,0 @@ -package rexec - -import ( - b64 "encoding/base64" - "fmt" - "os" - "os/exec" - "strings" -) - -type Rclient interface { - Run(cmd string, args ...string) *exec.Cmd - Readfile(file string) ([]byte, error) - WriteFile(path string, content []byte) error -} - -type rK8sClient struct { - kubeConfigPath string - namespace string - name string -} - -func (r *rK8sClient) Run(cmd string, args ...string) *exec.Cmd { - kubeEnv := fmt.Sprintf("KUBECONFIG=%v", r.kubeConfigPath) - _cmd := exec.Command("kubectl", append(append([]string{}, "exec", "-n", r.namespace, r.name, "--", cmd), args...)...) - _cmd.Env = append(_cmd.Env, kubeEnv) - return _cmd -} - -func (r *rK8sClient) Readfile(file string) ([]byte, error) { - return r.Run("cat", file).Output() -} - -func (r *rK8sClient) WriteFile(file string, content []byte) error { - _content := b64.StdEncoding.EncodeToString(content) - _cmd := exec.Command("kubectl", "exec", "-n", r.namespace, r.name, "--", "bash", "-c", fmt.Sprintf("echo %v | base64 -d > %v", _content, file)) - kubeEnv := fmt.Sprintf("KUBECONFIG=%v", r.kubeConfigPath) - _cmd.Env = append(_cmd.Env, kubeEnv) - _cmd.Stderr = os.Stderr - _cmd.Stdout = os.Stdout - return _cmd.Run() -} - -func NewK8sRclient(kubeConfigPath, namespace, name string) Rclient { - return &rK8sClient{kubeConfigPath, namespace, name} -} - -type rSshClient struct { - host string - access_path string - user string -} - -func (r *rSshClient) Run(cmd string, args ...string) *exec.Cmd { - _args := strings.Split(fmt.Sprintf("%v@%v -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -i %v %v", r.user, r.host, r.access_path, cmd), " ") - return exec.Command("ssh", append(_args, args...)...) -} - -func (r *rSshClient) Readfile(file string) ([]byte, error) { - return r.Run("cat", file).Output() -} - -func (r *rSshClient) WriteFile(file string, content []byte) error { - _content := b64.StdEncoding.EncodeToString(content) - - _, err := exec.Command("ssh", fmt.Sprintf("%v@%v", r.user, r.host), "-o", "StrictHostKeyChecking=no", "-o", "UserKnownHostsFile=/dev/null", "-o", "LogLevel=quiet", "-i", r.access_path, "--", fmt.Sprintf("bash -c \"echo %v | base64 -d > %v\"", _content, file)).Output() - return err -} - -func NewSshRclient(host, user, access_path string) Rclient { - return &rSshClient{host: host, access_path: access_path, user: user} -} - -// to from local to kube -// KUBECONFIG=./kubeconfig kubectl exec -n wireguard deploy/wireguard-deployment -- bash -c "echo $data > abc.txt" diff --git a/pkg/stripe/client.go b/pkg/stripe/client.go deleted file mode 100644 index c4d2f1d22..000000000 --- a/pkg/stripe/client.go +++ /dev/null @@ -1,14 +0,0 @@ -package stripe - -import ( - "github.com/stripe/stripe-go/client" -) - -type Client struct { - stripe *client.API -} - -func NewClient(pk string) *Client { - cli := client.New(pk, nil) - return &Client{stripe: cli} -} diff --git a/pkg/stripe/customer.go b/pkg/stripe/customer.go deleted file mode 100644 index 2f7ff2a04..000000000 --- a/pkg/stripe/customer.go +++ /dev/null @@ -1,38 +0,0 @@ -package stripe - -import ( - "fmt" - "github.com/stripe/stripe-go" - fn "kloudlite.io/pkg/functions" -) - -type CustomerId string - -func (c *CustomerId) Str() string { - return string(*c) -} - -func (c *CustomerId) StrP() *string { - return fn.New(string(*c)) -} - -func (c *Client) NewCustomer(accountId string, paymentMethodId string) (*CustomerId, error) { - customer, err := c.stripe.Customers.New( - &stripe.CustomerParams{ - Name: &accountId, - Description: stripe.String(fmt.Sprintf("kloudlite accountId=%s", accountId)), - PaymentMethod: &paymentMethodId, - }, - ) - if err != nil { - return nil, err - } - return fn.New(CustomerId(customer.ID)), nil -} - -func (c *Client) DeleteCustomer(cus CustomerId) error { - if _, err := c.stripe.Customers.Del(cus.Str(), &stripe.CustomerParams{}); err != nil { - return err - } - return nil -} diff --git a/pkg/stripe/intent.go b/pkg/stripe/intent.go deleted file mode 100644 index 4171cdfdf..000000000 --- a/pkg/stripe/intent.go +++ /dev/null @@ -1,18 +0,0 @@ -package stripe - -import ( - "github.com/stripe/stripe-go" -) - -func (c *Client) NewSetupIntent() (clientSecret string, err error) { - intentParams := stripe.SetupIntentParams{ - PaymentMethodTypes: []*string{ - stripe.String(string(stripe.PaymentMethodTypeCard)), - }, - } - intent, err := c.stripe.SetupIntents.New(&intentParams) - if err != nil { - return "", err - } - return intent.ClientSecret, nil -} diff --git a/pkg/stripe/payment.go b/pkg/stripe/payment.go deleted file mode 100644 index e29435f1f..000000000 --- a/pkg/stripe/payment.go +++ /dev/null @@ -1,50 +0,0 @@ -package stripe - -import ( - "github.com/stripe/stripe-go" - "math" -) - -// Note: [Future Payment save & reuse](https://stripe.com/docs/payments/save-and-reuse?html-or-react=react) - -// Note: [Stripe Docs Ref](https://stripe.com/docs/api/charges) - -type CardId string - -type Payment struct { - IntentId string - ClientSecret string - MethodId string - Status bool -} - -func (c *Client) NewPayment(cus CustomerId, paymentMethodId string, amount float64) (*Payment, error) { - params := stripe.PaymentIntentParams{ - Amount: stripe.Int64(int64(math.Round(amount))), - Currency: stripe.String(string(stripe.CurrencyUSD)), - Customer: cus.StrP(), - PaymentMethod: stripe.String(paymentMethodId), - Confirm: stripe.Bool(true), - OffSession: stripe.Bool(true), - } - - intent, err := c.stripe.PaymentIntents.New(¶ms) - if err != nil { - if sErr, ok := err.(*stripe.Error); ok { - if sErr.Code == stripe.ErrorCodeAuthenticationRequired { - return &Payment{ - IntentId: sErr.PaymentIntent.ID, - ClientSecret: sErr.PaymentIntent.ClientSecret, - MethodId: sErr.PaymentMethod.ID, - }, err - } - } - return nil, err - } - - return &Payment{ - IntentId: intent.ID, - MethodId: intent.PaymentMethod.ID, - Status: intent.Status == stripe.PaymentIntentStatusSucceeded, - }, nil -} diff --git a/pkg/tekton/main.go b/pkg/tekton/main.go deleted file mode 100644 index 6d50c46f1..000000000 --- a/pkg/tekton/main.go +++ /dev/null @@ -1,84 +0,0 @@ -package tekton - -import ( - "encoding/json" - triggers "github.com/tektoncd/triggers/pkg/apis/triggers/v1beta1" - "google.golang.org/grpc/codes" - "net/http" -) - -type Request struct { - triggers.InterceptorRequest -} - -type errT struct { - Code int - error -} - -func (err errT) Error() string { - return err.error.Error() -} - -func NewError(code int, err error) error { - return errT{code, err} -} - -type Response struct { - triggers.InterceptorResponse -} - -func NewResponse(req *Request) *Response { - return &Response{ - InterceptorResponse: triggers.InterceptorResponse{ - Extensions: req.Extensions, - // Continue: false, - // Status: triggers.Status{}, - }, - } -} - -func (r *Response) Err(err error) *Response { - e := func() errT { - if tkErr, ok := err.(errT); ok { - return tkErr - } - return errT{Code: http.StatusInternalServerError, error: err} - }() - - r.InterceptorResponse.Continue = false - - r.InterceptorResponse.Status = triggers.Status{ - Code: codes.Code(e.Code), - Message: err.Error(), - } - - return r -} - -func (r *Response) Extend(m map[string]any) *Response { - for k, v := range m { - if r.InterceptorResponse.Extensions == nil { - r.InterceptorResponse.Extensions = map[string]any{} - } - r.InterceptorResponse.Extensions[k] = v - } - return r -} - -func (r *Response) Ok() *Response { - r.InterceptorResponse.Continue = true - // r.InterceptorResponse.Status = triggers.Status{ - // Code: http.StatusOK, - // Message: "success", - // } - return r -} - -func (r *Response) ToJson() ([]byte, error) { - m, err := json.Marshal(r.InterceptorResponse) - if err != nil { - return nil, err - } - return m, nil -} diff --git a/pkg/text-templates/templates.go b/pkg/text-templates/templates.go index 371811c7d..18a973865 100644 --- a/pkg/text-templates/templates.go +++ b/pkg/text-templates/templates.go @@ -2,6 +2,7 @@ package text_templates import ( "bytes" + "github.com/kloudlite/api/pkg/errors" "text/template" "github.com/Masterminds/sprig/v3" @@ -12,7 +13,7 @@ func WithFunctions(t *template.Template) *template.Template { funcs["include"] = func(templateName string, templateData any) (string, error) { buf := bytes.NewBuffer(nil) if err := t.ExecuteTemplate(buf, templateName, templateData); err != nil { - return "", err + return "", errors.NewE(err) } return buf.String(), nil } diff --git a/pkg/types/encoded-string.go b/pkg/types/encoded-string.go new file mode 100644 index 000000000..669e7926b --- /dev/null +++ b/pkg/types/encoded-string.go @@ -0,0 +1,6 @@ +package types + +type EncodedString struct { + Value string `json:"value"` + Encoding string `json:"encoding"` +} diff --git a/pkg/types/hook-types.go b/pkg/types/hook-types.go index ce423095c..ae671575d 100644 --- a/pkg/types/hook-types.go +++ b/pkg/types/hook-types.go @@ -1,11 +1,11 @@ package types type HttpHook struct { - Body []byte `json:"body"` - Headers map[string]string `json:"headers"` - Url string `json:"url"` - QueryParams []byte `json:"queryParams,omitempty"` - Metadata map[string]string `json:"metadata,omitempty"` + Body []byte `json:"body"` + Headers map[string][]string `json:"headers"` + Url string `json:"url"` + QueryParams []byte `json:"queryParams,omitempty"` + Metadata map[string]string `json:"metadata,omitempty"` } type GitHttpHook struct { diff --git a/pkg/types/sync-status.go b/pkg/types/sync-status.go index 94514c516..d6a93651b 100644 --- a/pkg/types/sync-status.go +++ b/pkg/types/sync-status.go @@ -4,15 +4,17 @@ import ( "time" ) -type SyncState string -type SyncAction string +type ( + SyncState string + SyncAction string +) type SyncStatus struct { SyncScheduledAt time.Time `json:"syncScheduledAt,omitempty"` LastSyncedAt time.Time `json:"lastSyncedAt,omitempty"` - Action SyncAction `json:"action,omitempty"` - Generation int64 `json:"generation,omitempty"` - State SyncState `json:"state,omitempty"` + Action SyncAction `json:"action"` + RecordVersion int `json:"recordVersion"` + State SyncState `json:"state"` Error *string `json:"error,omitempty"` } @@ -22,36 +24,21 @@ const ( ) const ( - SyncStateIdle SyncState = "IDLE" - SyncStateInProgress SyncState = "IN_PROGRESS" - SyncStateReady SyncState = "READY" - SyncStateNotReady SyncState = "NOT_READY" + SyncStateIdle SyncState = "IDLE" + SyncStateInQueue SyncState = "IN_QUEUE" + SyncStateAppliedAtAgent SyncState = "APPLIED_AT_AGENT" + SyncStateErroredAtAgent SyncState = "ERRORED_AT_AGENT" + SyncStateUpdatedAtAgent SyncState = "UPDATED_AT_AGENT" + SyncStateDeletingAtAgent SyncState = "DELETING_AT_AGENT" + SyncStateDeletedAtAgent SyncState = "DELETED_AT_AGENT" ) -func GenSyncStatus(action SyncAction, generation int64) SyncStatus { +func GenSyncStatus(action SyncAction, recordVersion int) SyncStatus { return SyncStatus{ SyncScheduledAt: time.Now(), Action: action, - Generation: generation, - State: SyncStateIdle, - } -} - -func GetSyncStatusForCreation() SyncStatus { - return SyncStatus{ - SyncScheduledAt: time.Now(), - Action: SyncActionApply, - Generation: 1, - State: SyncStateIdle, - } -} - -func GetSyncStatusForUpdation(generation int64) SyncStatus { - return SyncStatus{ - SyncScheduledAt: time.Now(), - Action: SyncActionApply, - Generation: generation, - State: SyncStateIdle, + RecordVersion: recordVersion, + State: SyncStateInQueue, } } @@ -59,14 +46,7 @@ func GetSyncStatusForDeletion(generation int64) SyncStatus { return SyncStatus{ SyncScheduledAt: time.Now(), Action: SyncActionDelete, - Generation: generation, - State: SyncStateIdle, - } -} - -func ParseSyncState(isReady bool) SyncState { - if isReady { - return SyncStateReady + RecordVersion: int(generation), + State: SyncStateInQueue, } - return SyncStateNotReady } diff --git a/pkg/wgman/.gitignore b/pkg/wgman/.gitignore deleted file mode 100644 index ba077a403..000000000 --- a/pkg/wgman/.gitignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/pkg/wgman/Makefile b/pkg/wgman/Makefile deleted file mode 100644 index e1706a41b..000000000 --- a/pkg/wgman/Makefile +++ /dev/null @@ -1,24 +0,0 @@ - -build: - GOOS=linux GOARCH=amd64 go build -o bin/wgman - -push: - scp bin/wgman root@143.110.242.223:/root/bin/wgman - -test.vminit: - ssh root@143.110.242.223 wgman -command=init -ip=143.110.242.223 - ssh root@143.110.242.223 wg - -test.vmpeers: data=$(shell cat peers.json | base64) -test.vmpeers: - ssh root@143.110.242.223 wgman -command=peers -peers=$(data) - ssh root@143.110.242.223 wg - -test.podinit: - ssh root@143.110.242.223 k3s kubectl exec -n wireguard wireguard -- /host-scripts/wgman -command=init -ip=143.110.242.223 - ssh root@143.110.242.223 k3s kubectl exec -n wireguard wireguard -- wg - -test.podpeers: data=$(shell cat peers.json | base64) -test.podpeers: - ssh root@143.110.242.223 k3s kubectl exec -n wireguard wireguard -- /host-scripts/wgman -command=peers -peers=$(data) - ssh root@143.110.242.223 k3s kubectl exec -n wireguard wireguard -- wg diff --git a/pkg/wgman/main.go b/pkg/wgman/main.go deleted file mode 100644 index bf896697c..000000000 --- a/pkg/wgman/main.go +++ /dev/null @@ -1,344 +0,0 @@ -package wgman - -import ( - "bytes" - "encoding/json" - "fmt" - "text/template" - - "golang.zx2c4.com/wireguard/wgctrl/wgtypes" - "kloudlite.io/pkg/rexec" -) - -type wgManager struct { - isServer bool - configPath string - remoteClient rexec.Rclient - configDataPath string -} - -func NewSshWgManager(configPath, hostIp, user, accessPath, configDataPath string, isServer bool) *wgManager { - return &wgManager{ - configPath: configPath, - configDataPath: configDataPath, - remoteClient: rexec.NewSshRclient(hostIp, user, accessPath), - isServer: isServer, - } -} - -func NewKubeWgManager( - configPath, kubeConfigPath, namespace, name, configDataPath string, - isServer bool, -) *wgManager { - return &wgManager{ - configPath: configPath, - configDataPath: configDataPath, - remoteClient: rexec.NewK8sRclient(kubeConfigPath, namespace, name), - isServer: isServer, - } -} - -type Peer struct { - PublicKey string `json:"public_key"` - Endpoint *string `json:"endpoint,omitempty"` - AllowedIps string `json:"allowed_ips"` -} - -type Config struct { - PublicKey string `json:"public_key"` - PrivateKey string `json:"private_key"` - PublicIp string `json:"public_ip"` - Peers map[string]Peer `json:"peers"` - RemotePeers map[string]Peer `json:"remote_peers"` - NetInterface string `json:"net_interface"` -} - -func (c *Config) writeConfig(w wgManager) error { - var config string - var err error - remoteClient := w.remoteClient - configPath := w.configPath - if w.isServer { - config, err = c.getWgConfig() - } else { - config, err = c.getWgClientConfig() - } - // fmt.Println(config) - if err != nil { - panic(err) - return err - } - - remoteClient.Run("wg-quick", "down", "wg0").Run() - remoteClient.Run("rm", configPath).Run() - if err != nil { - panic(err) - return err - } - err = remoteClient.WriteFile(configPath, []byte(config)) - if err != nil { - panic(err) - return err - } - - err = remoteClient.Run("wg-quick", "up", "wg0").Run() - - if err != nil { - return err - } - return nil -} - -func (c *Config) getWgConfig() (string, error) { - f := ` -[Interface] -Address ={{.PublicIp}} -ListenPort = 51820 -PrivateKey = {{.PrivateKey}} -PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE -PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE - - -{{- range $key, $value := .Peers }} - -[Peer] -PublicKey = {{ $value.PublicKey }} -AllowedIPs = {{ $value.AllowedIps }} - {{- if $value.Endpoint }} -Endpoint = {{ $value.Endpoint }} - {{- end }} -{{- end}} - -{{- range $key, $value := .RemotePeers }} - -[Peer] -PublicKey = {{ $value.PublicKey }} -AllowedIPs = {{ $value.AllowedIps }} - {{- if $value.Endpoint }} -Endpoint = {{ $value.Endpoint }} - {{- end }} -{{- end}} - -` - parse, err := template.New("wg").Parse(f) - if err != nil { - return "", err - } - var buf bytes.Buffer - parse.Execute(&buf, c) - return buf.String(), err - -} - -func (c *Config) getWgClientConfig() (string, error) { - f := ` -[Interface] -PrivateKey = {{.PrivateKey}} -Address ={{.PublicIp}} -DNS=10.43.0.10 - -{{- range $key, $value := .Peers }} - -[Peer] -PublicKey = {{ $value.PublicKey }} -AllowedIPs = {{ $value.AllowedIps }} - {{- if $value.Endpoint }} -Endpoint = {{ $value.Endpoint }} - {{- end }} -{{- end}} -` - parse, err := template.New("wg").Parse(f) - if err != nil { - return "", err - } - var buf bytes.Buffer - parse.Execute(&buf, c) - return buf.String(), err - -} - -func (wgc *wgManager) IsSetupDone() bool { - _, err := wgc.remoteClient.Readfile(fmt.Sprintf("%v/config.json", wgc.configDataPath)) - if err != nil { - return false - } - return true -} - -func (wgc *wgManager) Init(nodeIp string) (string, error) { - fmt.Println("Initializing wireguard") - - out, err := wgc.remoteClient.Readfile(fmt.Sprintf("%v/config.json", wgc.configDataPath)) - - var c Config - - if err != nil { - fmt.Println("config.json not found generating new") - - key, err := wgtypes.GenerateKey() - - if err != nil { - return "", fmt.Errorf("failed to generate public, private keys: %v", err) - } - - c = Config{ - PublicKey: key.PublicKey().String(), - PrivateKey: key.String(), - PublicIp: nodeIp, - Peers: map[string]Peer{}, - NetInterface: "eth0", - } - } else { - fmt.Println("config found using old remote peers") - err := json.Unmarshal(out, &c) - - if err != nil { - return "", fmt.Errorf("failed to marshal config.json: %v", err) - } - - c.Peers = map[string]Peer{} - - } - - var marshal []byte - if marshal, err = json.Marshal(c); err != nil { - fmt.Printf("failed to marshal config: %v\n", err) - return "", fmt.Errorf("failed to masrshal config: %v ", err) - } - - fmt.Println(fmt.Sprintf("%v/config.json", wgc.configDataPath), string(marshal)) - if err := wgc.remoteClient.WriteFile(fmt.Sprintf("%v/config.json", wgc.configDataPath), marshal); err != nil { - return "", fmt.Errorf("failed to write config: %v ", err) - } - - if err := c.writeConfig(*wgc); err != nil { - return "", fmt.Errorf("unable to write config file: %v", err) - } - - return c.PublicKey, nil - -} - -func (wgc *wgManager) GetEmbededWireguardIp() (string, error) { - out, err := wgc.remoteClient.Readfile("wg-ip") - if err != nil { - return "10.13.13.1", nil - } - return string(out), nil -} - -func (wgc *wgManager) GetPublicKey() (string, error) { - var c Config - var configsRaw []byte - var err error - - if configsRaw, err = wgc.remoteClient.Readfile(fmt.Sprintf("%v/config.json", wgc.configDataPath)); err != nil { - return "", fmt.Errorf("unable read config.json: %v", err) - } - if err := json.Unmarshal(configsRaw, &c); err != nil { - return "", fmt.Errorf("unable to parse config error: %v", err) - } - return c.PublicKey, nil -} - -func (wgc *wgManager) AddRemotePeer(publicKey string, allowedIps string, endpoint *string) error { - - var c Config - var configsRaw []byte - var err error - - if configsRaw, err = wgc.remoteClient.Readfile(fmt.Sprintf("%v/config.json", wgc.configDataPath)); err != nil { - return fmt.Errorf("unable read config.json: %v", err) - } - - if err := json.Unmarshal(configsRaw, &c); err != nil { - return fmt.Errorf("unable to parse config error: %v", err) - } - - if c.RemotePeers == nil { - c.RemotePeers = map[string]Peer{} - } - - fmt.Println(c.RemotePeers, "remote peers") - - c.RemotePeers[publicKey] = Peer{ - PublicKey: publicKey, - Endpoint: endpoint, - AllowedIps: allowedIps, - } - err = c.writeConfig(*wgc) - if err != nil { - panic(err) - return fmt.Errorf("unable to write config file: %v", err) - } - marshal, err := json.Marshal(c) - err = wgc.remoteClient.WriteFile(fmt.Sprintf("%v/config.json", wgc.configDataPath), marshal) - return err -} - -func (wgc *wgManager) AddPeer(publicKey string, allowedIps string, endpoint *string) error { - var c Config - var configsRaw []byte - var err error - if configsRaw, err = wgc.remoteClient.Readfile(fmt.Sprintf("%v/config.json", wgc.configDataPath)); err != nil { - return fmt.Errorf("unable read config.json: %v", err) - } - - if err := json.Unmarshal(configsRaw, &c); err != nil { - return fmt.Errorf("unable to parse config error: %v", err) - } - c.Peers[publicKey] = Peer{ - PublicKey: publicKey, - Endpoint: endpoint, - AllowedIps: allowedIps, - } - err = c.writeConfig(*wgc) - if err != nil { - panic(err) - return fmt.Errorf("unable to write config file: %v", err) - } - marshal, err := json.Marshal(c) - err = wgc.remoteClient.WriteFile(fmt.Sprintf("%v/config.json", wgc.configDataPath), marshal) - return err -} - -func (wgc *wgManager) getConfig() (Config, error) { - var c Config - var configsRaw []byte - var err error - if configsRaw, err = wgc.remoteClient.Readfile("config.json"); err != nil { - return c, fmt.Errorf("unable to parse config error: %v", err) - } - if err := json.Unmarshal(configsRaw, &c); err != nil { - return c, fmt.Errorf("unable to parse config error: %v", err) - } - return c, nil -} - -func (wgc *wgManager) DeleteRemotePeer(publicKey string) error { - var c Config - var configsRaw []byte - var err error - if configsRaw, err = wgc.remoteClient.Readfile(fmt.Sprintf("%v/config.json", wgc.configDataPath)); err != nil { - return fmt.Errorf("unable to parse config error: %v", err) - } - if err := json.Unmarshal(configsRaw, &c); err != nil { - return fmt.Errorf("unable to parse config error: %v", err) - } - delete(c.RemotePeers, publicKey) - return c.writeConfig(*wgc) -} - -func (wgc *wgManager) DeletePeer(publicKey string) error { - var c Config - var configsRaw []byte - var err error - if configsRaw, err = wgc.remoteClient.Readfile(fmt.Sprintf("%v/config.json", wgc.configDataPath)); err != nil { - return fmt.Errorf("unable to parse config error: %v", err) - } - if err := json.Unmarshal(configsRaw, &c); err != nil { - return fmt.Errorf("unable to parse config error: %v", err) - } - delete(c.Peers, publicKey) - return c.writeConfig(*wgc) -} diff --git a/pkg/wgman/peers.json b/pkg/wgman/peers.json deleted file mode 100644 index afc192baf..000000000 --- a/pkg/wgman/peers.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - { - "public_key": "ILz3kHnqygAjznWxLp9nGWS7yQjozHUSQivnSHuHskc=", - "allowed_ips": "10.13.0.0/16, 10.43.0.0/16" - } -] diff --git a/pkg/wgman/test/main.go b/pkg/wgman/test/main.go deleted file mode 100644 index e44606949..000000000 --- a/pkg/wgman/test/main.go +++ /dev/null @@ -1,12 +0,0 @@ -package main - -import "fmt" - -type A struct { - name string - value string -} - -func main() { - fmt.Println(A{name: "name", value: "value"} == A{name: "name", value: "value"}) -}